Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
perpending
/
wp-content
/
plugins
/
seo-by-rank-math-pro
/
assets
/
admin
/
js
:
gutenberg-formats.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
(()=>{"use strict";const t=wp.richText,e=wp.i18n,r=wp.url,n=wp.htmlEntities,o=wp.element,i=React;function a(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=a(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}const l=function(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=a(t))&&(n&&(n+=" "),n+=e);return n},u=t=>(0,o.createElement)("path",t),s=(0,o.forwardRef)((({className:t,isPressed:e,...r},n)=>{const i={...r,className:l(t,{"is-pressed":e})||void 0,"aria-hidden":!0,focusable:!1};return(0,o.createElement)("svg",{...i,ref:n})}));s.displayName="SVG";const c=(0,i.createElement)(s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(u,{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"})),f=(0,i.createElement)(s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(u,{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"})),p=wp.blockEditor,m=wp.components,y=lodash;function d(t,e,r,n,o){for(var i=e,a={forwards:1,backwards:-1}[o]||1,l=-1*a;t[i]&&t[i][n]===r;)i+=a;return i+=l}function b(t,e){var r,n,o,i,a,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.start,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.end,s={start:null,end:null},c=t.formats;if(null==c||!c.length)return s;var f=c.slice(),p=null===(r=f[l])||void 0===r?void 0:r.find((function(t){return t.type===e.type})),m=null===(n=f[u])||void 0===n?void 0:n.find((function(t){return t.type===e.type})),y=null===(o=f[u-1])||void 0===o?void 0:o.find((function(t){return t.type===e.type}));if(p)i=p,a=l;else if(m)i=m,a=u;else{if(!y)return s;i=y,a=u-1}var d=f[a].indexOf(i),b=[f,a,i,d];return{start:l=(l=h.apply(void 0,b))<0?0:l,end:u=g.apply(void 0,b)}}var v=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(void 0,n.concat(r))}},h=v(d,"backwards"),g=v(d,"forwards");const w=wp.data;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function S(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=O(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const E=(0,m.withSpokenMessages)((function(n){var i,a,l=n.isActive,u=n.activeAttributes,s=n.addingLink,c=n.value,f=n.onChange,d=n.speak,v=n.stopAddingLink,h=n.contentRef,g=function(e,r){var n=e.start,o=e.end;if(r){var i=b(e,{type:"core/link"});n=i.start,o=i.end+1}return(0,t.slice)(e,n,o)}(c,l).text,O=u.hasOwnProperty("data-schema-attribute")?u["data-schema-attribute"].split(" "):[],k={url:u.url,type:u.type,id:u.id,opensInNewTab:"_blank"===u.target,nofollow:null===(i=u.rel)||void 0===i?void 0:i.includes("nofollow"),sponsored:null===(a=u.rel)||void 0===a?void 0:a.includes("sponsored"),about:O.includes("about"),mentions:O.includes("mentions"),title:g},j=(0,w.useDispatch)(p.store).selectionChange,_=(0,w.useSelect)((function(t){var e=t(p.store),r=e.getSettings,n=e.getSelectionStart,o=r();return{createPageEntity:o.__experimentalCreatePageEntity,userCanCreatePages:o.__experimentalUserCanCreatePages,selectionStart:n()}}),[]).selectionStart,E=(0,o.useRef)(!!s&&"firstElement"),A=[{id:"opensInNewTab",title:(0,e.__)("Open in new tab.","rank-math-pro")},{id:"nofollow",title:(0,e.__)("Set to nofollow.","rank-math-pro")},{id:"sponsored",title:(0,e.__)("Set to sponsored.","rank-math-pro")},{id:"about",title:(0,e.__)("Set to about.","rank-math-pro")},{id:"mentions",title:(0,e.__)("Set to mentions.","rank-math-pro")}],C=(0,t.useAnchor)({editableContentElement:h.current,settings:P(P({},L),{},{isActive:l})});return wp.element.createElement(m.Popover,{anchor:C,focusOnMount:E.current,onClose:v,position:"bottom",offset:8,shift:!0},wp.element.createElement(p.LinkControl,{value:k,onChange:function(n){var o=!(null==k?void 0:k.url);n=P(P({},k),n);var i,a=(0,r.prependHTTP)(n.url),u=function(t){var r=t.url,n=t.opensInNewWindow,o=t.nofollow,i=t.sponsored,a=t.about,l=t.mentions,u=t.text,s=t.type,c=t.id,f={type:"core/link",attributes:{url:r}},p=[],m=[];if(n){if(f.attributes.target="_blank",u){var y=(0,e.sprintf)((0,e.__)("%s (opens in a new tab)","rank-math"),u);f.attributes["aria-label"]=y}p.push("noreferrer noopener")}return s&&(f.attributes.type=s),c&&(f.attributes.id=c),o&&p.push("nofollow"),i&&p.push("sponsored"),a&&m.push("about"),l&&m.push("mentions"),m.length>0&&(f.attributes["data-schema-attribute"]=m.join(" ")),p.length>0&&(f.attributes.rel=p.join(" ")),f}({url:a,type:n.type,id:void 0!==n.id&&null!==n.id?String(n.id):void 0,opensInNewWindow:n.opensInNewTab,nofollow:n.nofollow,sponsored:n.sponsored,about:n.about,mentions:n.mentions}),s=n.title||a;if((0,t.isCollapsed)(c)&&!l){var p=(0,t.insert)(c,s);return i=(0,t.applyFormat)(p,u,c.start,c.start+s.length),f(i),v(),void j({clientId:_.clientId,identifier:_.attributeKey,start:c.start+s.length+1})}if(s===g)i=(0,t.applyFormat)(c,u);else{i=(0,t.create)({text:s}),i=(0,t.applyFormat)(i,u,0,s.length);var m=b(c,{type:"core/link"}),h=S((0,t.split)(c,m.start,m.start),2),w=h[0],O=h[1],E=(0,t.replace)(O,g,i);i=(0,t.concat)(w,E)}f(i),o||v(),!function(t){if(!t)return!1;var e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){var n=(0,r.getProtocol)(e);if(!(0,r.isValidProtocol)(n))return!1;if((0,y.startsWith)(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;var o=(0,r.getAuthority)(e);if(!(0,r.isValidAuthority)(o))return!1;var i=(0,r.getPath)(e);if(i&&!(0,r.isValidPath)(i))return!1;var a=(0,r.getQueryString)(e);if(a&&!(0,r.isValidQueryString)(a))return!1;var l=(0,r.getFragment)(e);if(l&&!(0,r.isValidFragment)(l))return!1}return!((0,y.startsWith)(e,"#")&&!(0,r.isValidFragment)(e))}(a)?d((0,e.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive"):d(l?(0,e.__)("Link edited."):(0,e.__)("Link inserted."),"assertive")},onRemove:function(){var r=(0,t.removeFormat)(c,"core/link");f(r),v(),d((0,e.__)("Link removed."),"assertive")},forceIsEditingLink:s,settings:A,hasTextControl:!0,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}))}));function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==A(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return I(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var R="core/link";const F=function(n){var i=n.isActive,a=n.activeAttributes,l=n.value,u=n.onChange,s=n.onFocus,m=n.contentRef,y=x((0,o.useState)(!1),2),d=y[0],b=y[1];function v(){var e=(0,t.getTextContent)((0,t.slice)(l));e&&(0,r.isURL)(e)?u((0,t.applyFormat)(l,{type:R,attributes:{url:e}})):e&&(0,r.isEmail)(e)?u((0,t.applyFormat)(l,{type:R,attributes:{url:"mailto:".concat(e)}})):b(!0)}function h(){var e=l;e=(0,t.removeFormat)(e,"core/link"),u(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e))}return wp.element.createElement(React.Fragment,null,wp.element.createElement(p.RichTextShortcut,{type:"primary",character:"k",onUse:v}),wp.element.createElement(p.RichTextShortcut,{type:"primaryShift",character:"k",onUse:h}),i&&wp.element.createElement(p.RichTextToolbarButton,{name:"link",className:"rank-math-link-control",icon:c,title:(0,e.__)("Unlink","rank-math"),onClick:h,isActive:i,shortcutType:"primaryShift",shortcutCharacter:"k"}),!i&&wp.element.createElement(p.RichTextToolbarButton,{name:"link",className:"rank-math-link-control",icon:f,title:(0,e.__)("Link","rank-math"),onClick:v,isActive:i,shortcutType:"primary",shortcutCharacter:"k"}),(d||i)&&wp.element.createElement(E,{addingLink:d,stopAddingLink:function(){b(!1),s()},isActive:i,activeAttributes:a,value:l,onChange:u,contentRef:m}))};var L={name:"core/link",title:(0,e.__)("Link","rank-math-pro"),tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target",rel:"rel","data-schema-attribute":"data-schema-attribute"},__unstablePasteRule:function(e,o){var i=o.html,a=o.plainText;if((0,t.isCollapsed)(e))return e;var l=(i||a).replace(/<[^>]+>/g,"").trim();return(0,r.isURL)(l)?(window.console.log("Created link:\n\n",l),(0,t.applyFormat)(e,{type:"core/link",attributes:{url:(0,n.decodeEntities)(l)}})):e},edit:F},N=["name","replaces"];wp.domReady((function(){[L].forEach((function(e){var r=e.name,n=(e.replaces,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,N));r&&((0,t.unregisterFormatType)("core/link"),(0,t.registerFormatType)(r,n))}))}))})();