Version Description
- Bug Fix: Conflict with the SmartCrawl Pro plugin
Download this release
Release Info
Developer | caseproof |
Plugin | ThirstyAffiliates Affiliate Link Manager |
Version | 3.9.4 |
Comparing to | |
See all releases |
Code changes from version 3.9.3 to 3.9.4
- Helpers/Plugin_Constants.php +1 -1
- js/app/gutenberg_support/dist/gutenberg-support.js +1 -1
- js/app/gutenberg_support/dist/gutenberg-support.js.map +1 -1
- js/app/gutenberg_support/package-lock.json +30 -11
- js/app/gutenberg_support/src/blocks/ta-image/edit.js +1 -1
- readme.txt +5 -2
- thirstyaffiliates.php +5 -5
Helpers/Plugin_Constants.php
CHANGED
@@ -27,7 +27,7 @@ class Plugin_Constants {
|
|
27 |
// Plugin configuration constants
|
28 |
const TOKEN = 'ta';
|
29 |
const INSTALLED_VERSION = 'ta_installed_version';
|
30 |
-
const VERSION = '3.9.
|
31 |
const TEXT_DOMAIN = 'thirstyaffiliates';
|
32 |
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
|
33 |
const META_DATA_PREFIX = '_ta_';
|
27 |
// Plugin configuration constants
|
28 |
const TOKEN = 'ta';
|
29 |
const INSTALLED_VERSION = 'ta_installed_version';
|
30 |
+
const VERSION = '3.9.4';
|
31 |
const TEXT_DOMAIN = 'thirstyaffiliates';
|
32 |
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
|
33 |
const META_DATA_PREFIX = '_ta_';
|
js/app/gutenberg_support/dist/gutenberg-support.js
CHANGED
@@ -3,5 +3,5 @@
|
|
3 |
Licensed under the MIT License (MIT), see
|
4 |
http://jedwatson.github.io/classnames
|
5 |
*/
|
6 |
-
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)&&i.length){var a=n.apply(null,i);a&&e.push(a)}else if("object"===o)for(var l in i)r.call(i,l)&&i[l]&&e.push(l)}}return e.join(" ")}var r={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):(i=[],void 0!==(o=function(){return n}.apply(t,i))&&(e.exports=o))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(8),r=n(17);n.n(r);Object(i.a)(),Object(o.a)()},function(e,t,n){"use strict";function i(){[o].forEach(function(e){if(e){var t=e.name,n=e.settings;r(t,n)}})}t.a=i;var o=n(3),r=wp.blocks.registerBlockType},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"name",function(){return g}),n.d(t,"settings",function(){return w});var o=n(0),r=n.n(o),a=n(4),l=wp.element.Fragment,s=wp.i18n.__,u=wp.blocks,c=(u.createBlock,u.getBlockAttributes,u.getPhrasingContentSchema),p=wp.editor.RichText,d=wp.components,f=d.Path,h=d.SVG,g="ta/image",m={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"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkid:{type:"number"},href:{type:"string",source:"attribute",selector:"ta",attribute:"href"},affiliateLink:{type:"object"}},v={img:{attributes:["src","alt"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},w=(c(),{title:s("ThirstyAffiliates Image"),description:s("Insert an image with an affiliate link to make a visual statement."),icon:wp.element.createElement(h,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(f,{d:"M0,0h24v24H0V0z",fill:"none"}),wp.element.createElement(f,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),wp.element.createElement(f,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),category:"common",keywords:["img",s("photo"),s("affiliate")],attributes:m,getEditWrapperProps:function(e){var t=e.align,n=e.width;if("left"===t||"center"===t||"right"===t||"wide"===t||"full"===t)return{"data-align":t,"data-resized":!!n}},edit:a.a,save:function(e){var t,n=e.attributes,o=n.url,a=n.alt,s=n.caption,u=n.align,c=n.width,d=n.height,f=n.id,h=n.linkid,g=n.href,m=r()((t={},i(t,"align"+u,u),i(t,"is-resized",c||d),t)),v=wp.element.createElement("img",{src:o,alt:a,className:f?"wp-image-"+f:null,width:c,height:d}),w=wp.element.createElement(l,null,wp.element.createElement("ta",{linkid:h,href:g},v),wp.element.createElement(p.Content,{tagName:"figcaption",value:s}));return"left"===u||"right"===u||"center"===u?wp.element.createElement("div",{className:"wp-block-image"},wp.element.createElement("figure",{className:m},w)):wp.element.createElement("figure",{className:"wp-block-image "+m},w)}})},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=n(5),u=n(6),c=n(7),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){var n=[],i=!0,o=!1,r=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){o=!0,r=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=lodash,g=h.get,m=h.isEmpty,v=h.map,w=h.last,b=h.pick,y=h.compact,k=wp.url.getPath,S=wp.i18n,E=S.__,_=S.sprintf,L=wp.element,O=L.Component,C=L.Fragment,I=L.createRef,T=wp.blob,R=T.getBlobByURL,P=T.revokeBlobURL,A=T.isBlobURL,x=wp.components,j=x.Placeholder,N=x.Button,F=x.ButtonGroup,W=x.IconButton,D=x.PanelBody,V=x.ResizableBox,z=x.SelectControl,B=x.Spinner,H=x.TextControl,U=x.TextareaControl,M=x.Toolbar,K=x.withNotices,q=(x.ToggleControl,x.Popover,wp.data.withSelect),G=wp.editor,Q=G.RichText,Z=G.BlockControls,$=G.InspectorControls,X=(G.MediaUpload,G.MediaUploadCheck,G.MediaPlaceholder,G.BlockAlignmentToolbar),Y=G.mediaUpload,J=wp.viewport.withViewportMatch,ee=wp.compose.compose,te=["image"],ne=function(e){var t=b(e,["alt","id","link","caption"]);return t.url=g(e,["sizes","large","url"])||g(e,["media_details","sizes","large","source_url"])||e.url,t},ie=function(e,t){return!e&&A(t)},oe=function(e,t){return t&&!e&&!A(t)},re=function(e){function t(e){var n=e.attributes;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.updateAlt=r.updateAlt.bind(r),r.updateAlignment=r.updateAlignment.bind(r),r.onFocusCaption=r.onFocusCaption.bind(r),r.onImageClick=r.onImageClick.bind(r),r.onSelectImage=r.onSelectImage.bind(r),r.updateImageURL=r.updateImageURL.bind(r),r.updateWidth=r.updateWidth.bind(r),r.updateHeight=r.updateHeight.bind(r),r.updateDimensions=r.updateDimensions.bind(r),r.getFilename=r.getFilename.bind(r),r.toggleIsEditing=r.toggleIsEditing.bind(r),r.onImageError=r.onImageError.bind(r),r.onChangeInputValue=r.onChangeInputValue.bind(r),r.autocompleteRef=I(),r.resetInvalidLink=r.resetInvalidLink.bind(r),r.updateImageSelection=r.updateImageSelection.bind(r),r.onSelectAffiliateImage=r.onSelectAffiliateImage.bind(r),r.editAFfiliateImage=r.editAFfiliateImage.bind(r),r.state={captionFocused:!1,isEditing:!n.url,inputValue:"",linkid:0,post:null,showSuggestions:!1,imageSelection:[],affiliateLink:null},r}return r(t,e),f(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,i=t.setAttributes,o=t.noticeOperations,r=n.id,a=n.url,l=void 0===a?"":a;if(ie(r,l)){var s=R(l);s&&Y({filesList:[s],onFileChange:function(e){var t=d(e,1),n=t[0];i(ne(n))},allowedTypes:te,onError:function(t){o.createErrorNotice(t),e.setState({isEditing:!0})}})}}},{key:"componentDidUpdate",value:function(e){var t=e.attributes,n=t.id,i=t.url,o=void 0===i?"":i,r=this.props.attributes,a=r.id,l=r.url,s=void 0===l?"":l;ie(n,o)&&!ie(a,s)&&P(s),!this.props.isSelected&&e.isSelected&&this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"onSelectImage",value:function(e){if(!e||!e.url)return void this.props.setAttributes({url:void 0,alt:void 0,id:void 0,caption:void 0});var t=this.state.affiliateLink;this.setState({isEditing:!1}),this.props.setAttributes(p({},ne(e),{linkid:t.id,href:t.link,affiliateLink:t,width:void 0,height:void 0}))}},{key:"onImageError",value:function(e){var t=Object(s.a)({attributes:{url:e}});void 0!==t&&this.props.onReplace(t)}},{key:"onFocusCaption",value:function(){this.state.captionFocused||this.setState({captionFocused:!0})}},{key:"onImageClick",value:function(){this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"updateAlt",value:function(e){this.props.setAttributes({alt:e})}},{key:"updateAlignment",value:function(e){var t=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};this.props.setAttributes(p({},t,{align:e}))}},{key:"updateImageURL",value:function(e){this.props.setAttributes({url:e,width:void 0,height:void 0})}},{key:"updateWidth",value:function(e){this.props.setAttributes({width:parseInt(e,10)})}},{key:"updateHeight",value:function(e){this.props.setAttributes({height:parseInt(e,10)})}},{key:"updateDimensions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(){e.props.setAttributes({width:t,height:n})}}},{key:"getFilename",value:function(e){var t=k(e);if(t)return w(t.split("/"))}},{key:"getLinkDestinationOptions",value:function(){return[{value:"none",label:E("None")},{value:"media",label:E("Media File")},{value:"attachment",label:E("Attachment Page")},{value:"custom",label:E("Custom URL")}]}},{key:"toggleIsEditing",value:function(){this.setState({isEditing:!this.state.isEditing})}},{key:"getImageSizeOptions",value:function(){var e=this.props,t=e.imageSizes,n=e.image;return y(v(t,function(e){var t=e.name,i=e.slug,o=g(n,["media_details","sizes",i,"source_url"]);return o?{value:o,label:t}:null}))}},{key:"onChangeInputValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?t.id:0;this.setState({inputValue:e,linkid:n,post:t})}},{key:"resetInvalidLink",value:function(){this.setState({invalidLink:!1})}},{key:"updateImageSelection",value:function(e,t){this.setState({imageSelection:e,affiliateLink:t})}},{key:"onSelectAffiliateImage",value:function(e){var t=this;if(oe(e.id,e.src))e.url=e.src,this.onSelectImage(e);else{wp.apiFetch({path:wp.url.addQueryArgs("wp/v2/media/"+e.id,{context:"edit",_locale:"user"})}).then(function(e){e.url=e.source_url,t.onSelectImage(e)})}}},{key:"editAFfiliateImage",value:function(){var e=this.props.attributes,t=e.affiliateLink;this.setState({isEditing:!0,imageSelection:t.images,affiliateLink:t})}},{key:"render",value:function(){var e=this,t=this.state,n=t.isEditing,i=t.imageSelection,o=t.affiliateLink,r=this.props,a=r.attributes,s=r.setAttributes,p=r.isLargeViewport,d=r.isSelected,f=r.className,h=r.maxWidth,g=r.toggleSelection,v=r.isRTL,w=a.url,b=a.alt,y=a.caption,k=a.align,S=(a.linkDestination,a.width),L=a.height,O=a.linkid,I=a.href,T=wp.element.createElement(M,null,wp.element.createElement(W,{className:"ta-edit-image-button components-icon-button components-toolbar__control",label:E("Edit ThirstyAffiliates Image"),icon:"edit",onClick:this.editAFfiliateImage})),R=wp.element.createElement(Z,null,wp.element.createElement(X,{value:k,onChange:this.updateAlignment}),T);if(n)return wp.element.createElement(C,null,R,wp.element.createElement(j,{icon:"format-image",label:E("ThirstyAffiliates Image"),instructions:E("Search for an affiliate link and select image to insert.")},wp.element.createElement(c.a,{updateImageSelection:this.updateImageSelection}),!!i.length&&wp.element.createElement("div",{className:"ta-image-sel-wrap"},wp.element.createElement("h3",null,o.title+" "+E("attached images:")),wp.element.createElement("div",{className:"ta-image-selection"},i.map(function(t,n){return wp.element.createElement("button",{onClick:function(){return e.onSelectAffiliateImage(t)}},wp.element.createElement("img",{src:t.src}))})))));var P=l()(f,{"wp-block-image":!0,"is-transient":A(w),"is-resized":!!S||!!L,"is-focused":d}),x=-1===["wide","full"].indexOf(k)&&p,K=this.getImageSizeOptions(),q=function(t,n){return wp.element.createElement($,null,wp.element.createElement(D,{title:E("Image Settings")},wp.element.createElement(U,{label:E("Alt Text (Alternative Text)"),value:b,onChange:e.updateAlt,help:E("Alternative text describes your image to people who can’t see it. Add a short description with its key details.")}),!m(K)&&wp.element.createElement(z,{label:E("Image Size"),value:w,options:K,onChange:e.updateImageURL}),x&&wp.element.createElement("div",{className:"block-library-image__dimensions"},wp.element.createElement("p",{className:"block-library-image__dimensions__row"},E("Image Dimensions")),wp.element.createElement("div",{className:"block-library-image__dimensions__row"},wp.element.createElement(H,{type:"number",className:"block-library-image__dimensions__width",label:E("Width"),value:void 0!==S?S:"",placeholder:t,min:1,onChange:e.updateWidth}),wp.element.createElement(H,{type:"number",className:"block-library-image__dimensions__height",label:E("Height"),value:void 0!==L?L:"",placeholder:n,min:1,onChange:e.updateHeight})),wp.element.createElement("div",{className:"block-library-image__dimensions__row"},wp.element.createElement(F,{"aria-label":E("Image Size")},[25,50,75,100].map(function(i){var o=Math.round(t*(i/100)),r=Math.round(n*(i/100)),a=S===o&&L===r;return wp.element.createElement(N,{key:i,isSmall:!0,isPrimary:a,"aria-pressed":a,onClick:e.updateDimensions(o,r)},i,"%")})),wp.element.createElement(N,{isSmall:!0,onClick:e.updateDimensions()},E("Reset"))))))};return wp.element.createElement(C,null,R,wp.element.createElement("figure",{className:P},wp.element.createElement(u.a,{src:w,dirtynessTrigger:k},function(t){var n=t.imageWidthWithinContainer,i=t.imageHeightWithinContainer,o=t.imageWidth,r=t.imageHeight,a=e.getFilename(w),l=void 0;l=b||(a?_(E("This image has an empty alt attribute; its file name is %s"),a):E("This image has an empty alt attribute"));var u=wp.element.createElement(C,null,wp.element.createElement("ta",{linkid:O,href:I},wp.element.createElement("img",{src:w,alt:l,onClick:e.onImageClick,onError:function(){return e.onImageError(w)}})),A(w)&&wp.element.createElement(B,null));if(!x||!n)return wp.element.createElement(C,null,q(o,r),wp.element.createElement("div",{style:{width:S,height:L}},u));var c=S||n,p=L||i,d=o/r,f=o<r?20:20*d,m=r<o?20:20/d,y=2.5*h,T=!1,R=!1;return"center"===k?(T=!0,R=!0):v?"left"===k?T=!0:R=!0:"right"===k?R=!0:T=!0,wp.element.createElement(C,null,q(o,r),wp.element.createElement(V,{size:S&&L?{width:S,height:L}:void 0,minWidth:f,maxWidth:y,minHeight:m,maxHeight:y/d,lockAspectRatio:!0,enable:{top:!1,right:T,bottom:!0,left:R},onResizeStart:function(){g(!1)},onResizeStop:function(e,t,n,i){s({width:parseInt(c+i.width,10),height:parseInt(p+i.height,10)}),g(!0)}},u))}),(!Q.isEmpty(y)||d)&&wp.element.createElement(Q,{tagName:"figcaption",placeholder:E("Write caption…"),value:y,unstableOnFocus:this.onFocusCaption,onChange:function(e){return s({caption:e})},isSelected:this.state.captionFocused,inlineToolbar:!0})))}}]),t}(O);t.a=ee([q(function(e,t){var n=e("core"),i=n.getMedia,o=e("core/editor"),r=o.getEditorSettings,a=t.attributes.id,l=r(),s=l.maxWidth,u=l.isRTL,c=l.imageSizes;return{image:a?i(a):null,maxWidth:s,isRTL:u,imageSizes:c}}),J({isLargeViewport:"medium"}),K])(re)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=lodash,r=o.includes,a=(wp.element.renderToString,wp.blocks.createBlock),l=function(e,t){var n=e.preview,o=e.name,r=e.attributes.url;if(r){var l=findBlock(r);if("core-embed/wordpress"!==o&&DEFAULT_EMBED_BLOCK!==l&&o!==l)return a(l,{url:r});if(n){var u=n.html;if(s(u)&&"core-embed/wordpress"!==o)return a("core-embed/wordpress",i({url:r},t))}}},s=function(e){return r(e,'class="wp-embedded-content" data-secret')}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=lodash,s=l.noop,u=wp.compose.withGlobalEvents,c=wp.element.Component,p=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={width:void 0,height:void 0},e.bindContainer=e.bindContainer.bind(e),e.calculateSize=e.calculateSize.bind(e),e}return r(t,e),a(t,[{key:"bindContainer",value:function(e){this.container=e}},{key:"componentDidUpdate",value:function(e){this.props.src!==e.src&&(this.setState({width:void 0,height:void 0}),this.fetchImageSize()),this.props.dirtynessTrigger!==e.dirtynessTrigger&&this.calculateSize()}},{key:"componentDidMount",value:function(){this.fetchImageSize()}},{key:"componentWillUnmount",value:function(){this.image&&(this.image.onload=s)}},{key:"fetchImageSize",value:function(){this.image=new window.Image,this.image.onload=this.calculateSize,this.image.src=this.props.src}},{key:"calculateSize",value:function(){var e=this.container.clientWidth,t=this.image.width>e,n=this.image.height/this.image.width,i=t?e:this.image.width,o=t?e*n:this.image.height;this.setState({width:i,height:o})}},{key:"render",value:function(){var e={imageWidth:this.image&&this.image.width,imageHeight:this.image&&this.image.height,containerWidth:this.container&&this.container.clientWidth,containerHeight:this.container&&this.container.clientHeight,imageWidthWithinContainer:this.state.width,imageHeightWithinContainer:this.state.height};return wp.element.createElement("div",{ref:this.bindContainer},this.props.children(e))}}]),t}(c);t.a=u({resize:"calculateSize"})(p)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=wp.i18n.__,c=wp.element,p=c.Component,d=c.createRef,f=wp.components,h=f.Spinner,g=f.withSpokenMessages,m=f.Popover,v=f.TextControl,w=wp.compose.withInstanceId,b=function(e){function t(e){var n=e.autocompleteRef;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.autocompleteRef=n||d(),r.inputRef=d(),r.searchAffiliateLinks=r.searchAffiliateLinks.bind(r),r.suggestionNodes=[],r.state={posts:[],showSuggestions:!1,selectedSuggestion:null,loading:!1},r}return r(t,e),s(t,[{key:"componentDidUpdate",value:function(){var e=this,t=this.state,n=t.showSuggestions,i=t.selectedSuggestion;n&&null!==i&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,scrollIntoView(this.suggestionNodes[i],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),setTimeout(function(){e.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(e){var t=this;return function(n){t.suggestionNodes[e]=n}}},{key:"searchAffiliateLinks",value:function(e){var t=this;if(e.length<2)return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=new FormData;n.append("action","search_affiliate_links_query"),n.append("keyword",e),n.append("paged",1),n.append("gutenberg",!0),n.append("with_images",!0);var i=fetch(ajaxurl,{method:"POST",body:n});i.then(function(e){return e.json()}).then(function(e){if(e.affiliate_links){var n=e.affiliate_links;t.suggestionsRequest===i&&(t.setState({posts:n,loading:!1}),n.length?t.props.debouncedSpeak(sprintf(_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length),"assertive"):t.props.debouncedSpeak(u("No results."),"assertive"))}}).catch(function(){t.suggestionsRequest===i&&t.setState({loading:!1})}),this.suggestionsRequest=i}},{key:"selectLink",value:function(e){this.setState({selectedSuggestion:e,showSuggestions:!1}),this.props.updateImageSelection(e.images,e)}},{key:"handleOnClick",value:function(e){this.selectLink(e)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.autoFocus,t.instanceId),i=this.state,o=i.showSuggestions,r=i.posts,a=i.selectedSuggestion,s=i.loading;return wp.element.createElement("div",{class:"edit-search-affiliate-links"},wp.element.createElement("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover",onSubmit:this.displayAffiliateImages},wp.element.createElement(v,{type:"text",className:"ta-search-affiliate-links",placeholder:u("Type to search affiliate links"),onChange:this.searchAffiliateLinks,autocomplete:"off"}),s&&wp.element.createElement(h,null),o&&!!r.length&&wp.element.createElement(m,{position:"bottom",focusOnMount:!1},wp.element.createElement("div",{class:"affilate-links-suggestions"},r.map(function(t,i){return wp.element.createElement("button",{key:t.id,role:"option",tabIndex:"-1",id:"editor-url-input-suggestion-"+n+"-"+i,ref:e.bindSuggestionNode(i),className:l()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":i===a}),onClick:function(){return e.handleOnClick(t)},"aria-selected":i===a},t.title||u("(no title)"))})))))}}]),t}(p);t.a=g(w(b))},function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(){[r.a].forEach(function(e){var t=e.name,n=i(e,["name"]);return a(t,n)})}t.a=o;var r=n(9),a=wp.richText.registerFormatType},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return O});var a=n(10),l=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=wp.i18n.__,u=wp.element,c=u.Component,p=u.Fragment,d=wp.components.withSpokenMessages,f=wp.richText,h=f.getTextContent,g=f.applyFormat,m=f.removeFormat,v=f.slice,w=wp.url.isURL,b=wp.editor,y=b.RichTextToolbarButton,k=b.RichTextShortcut,S=wp.components,E=S.Path,_=S.SVG,L=wp.dom.getRectangleFromRange,O={name:"ta/link",title:s("Affiliate Link"),tagName:"ta",className:null,attributes:{url:"href",target:"target"},edit:d(function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.addLink=e.addLink.bind(e),e.stopAddingLink=e.stopAddingLink.bind(e),e.onRemoveFormat=e.onRemoveFormat.bind(e),e.state={addingLink:!1},e}return r(t,e),l(t,[{key:"addLink",value:function(){var e=this.props,t=e.value,n=e.onChange,i=h(v(t));i&&w(i)?n(g(t,{type:"ta/link",attributes:{url:i}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1})}},{key:"onRemoveFormat",value:function(){var e=this.props,t=e.value,n=e.onChange,i=e.speak;n(m(t,"ta/link")),i(s("Affiliate Link removed."),"assertive")}},{key:"getAnchorRect",value:function(){var e=window.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):null;if(t){var n=null;if(this.state.addingLink)n=L(t);else{var i=t.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==window.Node.ELEMENT_NODE;)i=i.parentNode;var o=i.closest("ta");o&&(n=o.getBoundingClientRect())}return n}}},{key:"render",value:function(){var e=this.props,t=e.isActive,n=e.activeAttributes,i=e.value,o=e.onChange,r=this.getAnchorRect();return wp.element.createElement(p,null,wp.element.createElement(k,{type:"access",character:"s",onUse:this.onRemoveFormat}),wp.element.createElement(k,{type:"primary",character:"l",onUse:this.addLink}),wp.element.createElement(k,{type:"primaryShift",character:"l",onUse:this.onRemoveFormat}),t&&wp.element.createElement(y,{icon:"editor-unlink",title:s("Remove Affiliate Link"),className:"ta-unlink-button",onClick:this.onRemoveFormat,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"l"}),!t&&wp.element.createElement(y,{icon:wp.element.createElement(_,{xmlns:"http://www.w3.org/2000/svg",width:"16.688",height:"9.875",viewBox:"0 0 16.688 9.875"},wp.element.createElement(E,{id:"TA.svg",fill:"black",class:"cls-1",d:"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z",transform:"translate(-1.188 -5.25)"})),title:s("Affiliate Link"),className:"ta-link-button",onClick:this.addLink,shortcutType:"primary",shortcutCharacter:"l"}),wp.element.createElement(a.a,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:t,activeAttributes:n,anchorRect:r,value:i,onChange:o}))}}]),t}(c))}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=e.url,n=e.linkid;e.text;return{type:"ta/link",attributes:{url:t,linkid:n.toString()}}}function l(e,t){return e.addingLink||t.editLink}var s=n(0),u=n.n(s),c=n(11),p=n(12),d=n(13),f=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=wp.i18n.__,g=wp.element,m=g.Component,v=g.createRef,w=wp.components,b=w.ExternalLink,y=(w.ToggleControl,w.IconButton),k=w.withSpokenMessages,S=wp.keycodes,E=S.LEFT,_=S.RIGHT,L=S.UP,O=S.DOWN,C=S.BACKSPACE,I=S.ENTER,T=wp.url,R=T.prependHTTP,P=T.safeDecodeURI,A=T.filterURLForDisplay,x=wp.richText,j=x.create,N=x.insert,F=x.isCollapsed,W=x.applyFormat,D=x.getTextContent,V=x.slice,z=function(e){return e.stopPropagation()},B=function(e){var t=e.value,n=e.onChangeInputValue,i=e.onKeyDown,o=e.submitLink,r=e.invalidLink,a=e.resetInvalidLink,l=e.autocompleteRef;return wp.element.createElement("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover",onKeyPress:z,onKeyDown:i,onSubmit:o},wp.element.createElement(d.a,{value:t,onChange:n,autocompleteRef:l,invalidLink:r,resetInvalidLink:a}),wp.element.createElement(y,{icon:"editor-break",label:h("Apply"),type:"submit"}))},H=function(e){var t=e.url,n=R(t),i=u()("editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value",{"has-invalid-link":!Object(c.a)(n)});return t?wp.element.createElement(b,{className:i,href:t},A(P(t))):wp.element.createElement("span",{className:i})},U=function(e){var t=e.url,n=e.editLink;return wp.element.createElement("div",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:z},wp.element.createElement(H,{url:t}),wp.element.createElement(y,{icon:"edit",label:h("Edit"),onClick:n}))},M=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.editLink=e.editLink.bind(e),e.submitLink=e.submitLink.bind(e),e.onKeyDown=e.onKeyDown.bind(e),e.onChangeInputValue=e.onChangeInputValue.bind(e),e.onClickOutside=e.onClickOutside.bind(e),e.resetState=e.resetState.bind(e),e.autocompleteRef=v(),e.resetInvalidLink=e.resetInvalidLink.bind(e),e.state={inputValue:"",linkid:0,post:null,invalidLink:!1},e}return r(t,e),f(t,[{key:"onKeyDown",value:function(e){[E,O,_,L,C,I].indexOf(e.keyCode)>-1&&e.stopPropagation()}},{key:"onChangeInputValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?t.id:0;this.setState({inputValue:e,linkid:n,post:t})}},{key:"editLink",value:function(e){this.setState({editLink:!0}),e.preventDefault()}},{key:"submitLink",value:function(e){var t=this.props,n=t.isActive,i=t.value,o=t.onChange,r=t.speak,l=this.state,s=l.inputValue,u=l.linkid,p=l.post,d=R(s),f=D(V(i)),g=a({url:d,linkid:u,text:f});if(e.preventDefault(),!u||!p)return void this.setState({invalidLink:!0});if(F(i)&&!n){var m=W(j({text:p.title}),g,0,d.length);o(N(i,m))}else o(W(i,g));this.resetState(),Object(c.a)(d)?n?r(h("Link edited."),"assertive"):r(h("Link inserted"),"assertive"):r(h("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}},{key:"onClickOutside",value:function(e){var t=this.autocompleteRef.current;t&&t.contains(e.target)||this.resetState()}},{key:"resetState",value:function(){this.props.stopAddingLink(),this.setState({inputValue:"",editLink:!1}),this.resetInvalidLink()}},{key:"resetInvalidLink",value:function(){this.setState({invalidLink:!1})}},{key:"render",value:function(){var e=this.props,t=e.isActive,n=e.activeAttributes,i=n.url,o=(n.linkid,e.addingLink),r=e.anchorRect;e.value,e.onChange;if(!t&&!o)return null;var a=this.state,s=a.inputValue,u=a.invalidLink,c=l(this.props,this.state);return wp.element.createElement(p.a,{onClickOutside:this.onClickOutside,onClose:this.resetState,focusOnMount:!!c&&"firstElement",invalidLink:u,anchorRect:r},c?wp.element.createElement(B,{value:s,onChangeInputValue:this.onChangeInputValue,onKeyDown:this.onKeyDown,submitLink:this.submitLink,autocompleteRef:this.autocompleteRef,updateLinkId:this.updateLinkId,invalidLink:u,resetInvalidLink:this.resetInvalidLink}):wp.element.createElement(U,{url:i,editLink:this.editLink}))}}]),t}(m);t.a=k(M)},function(e,t,n){"use strict";function i(e){if(!e)return!1;var t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){var n=l(t);if(!s(n))return!1;if(r(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;var i=u(t);if(!c(i))return!1;var o=p(t);if(o&&!d(o))return!1;var a=f(t);if(a&&!h(a))return!1;var v=g(t);if(v&&!m(v))return!1}return!(r(t,"#")&&!m(t))}t.a=i;var o=lodash,r=o.startsWith,a=wp.url,l=a.getProtocol,s=a.isValidProtocol,u=a.getAuthority,c=a.isValidAuthority,p=a.getPath,d=a.isValidPath,f=a.getQueryString,h=a.isValidQueryString,g=a.getFragment,m=a.isValidFragment},function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=wp.i18n.__,c=wp.element.Component,p=wp.components,d=p.Popover,f=p.IconButton,h=function(e){function t(){o(this,t);var e=r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.toggleSettingsVisibility=e.toggleSettingsVisibility.bind(e),e.state={isSettingsExpanded:!1},e}return a(t,e),s(t,[{key:"toggleSettingsVisibility",value:function(){this.setState({isSettingsExpanded:!this.state.isSettingsExpanded})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.renderSettings,o=e.invalidLink,r=e.position,a=void 0===r?"bottom center":r,s=e.focusOnMount,c=void 0===s?"firstElement":s,p=i(e,["children","renderSettings","invalidLink","position","focusOnMount"]),h=this.state.isSettingsExpanded,g=!!n&&h;return wp.element.createElement(d,l({className:"ta-url-popover editor-url-popover block-editor-url-popover",focusOnMount:c,position:a},p),wp.element.createElement("div",{className:"editor-url-popover__row"},t,!!n&&wp.element.createElement(f,{className:"editor-url-popover__settings-toggle",icon:"ellipsis",label:u("Link Settings"),onClick:this.toggleSettingsVisibility,"aria-expanded":h})),g&&wp.element.createElement("div",{className:"editor-url-popover__row editor-url-popover__settings"},n()),o&&wp.element.createElement("div",{class:"ta-invalid-link"},u("Invalid affiliate link")))}}]),t}(c);t.a=h},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=n(14),u=n.n(s),c=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=wp.i18n.__,d=lodash,f=d.throttle,h=wp.element,g=h.Component,m=h.createRef,v=wp.keycodes,w=v.UP,b=v.DOWN,y=v.ENTER,k=v.TAB,S=wp.components,E=S.Spinner,_=S.withSpokenMessages,L=S.Popover,O=wp.compose.withInstanceId,C=function(e){return e.stopPropagation()},I=function(e){function t(e){var n=e.autocompleteRef;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.onChange=r.onChange.bind(r),r.onKeyDown=r.onKeyDown.bind(r),r.autocompleteRef=n||m(),r.inputRef=m(),r.updateSuggestions=f(r.updateSuggestions.bind(r),200),r.suggestionNodes=[],r.state={posts:[],showSuggestions:!1,selectedSuggestion:null},r}return r(t,e),c(t,[{key:"componentDidUpdate",value:function(){var e=this,t=this.state,n=t.showSuggestions,i=t.selectedSuggestion;n&&null!==i&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,u()(this.suggestionNodes[i],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),setTimeout(function(){e.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(e){var t=this;return function(n){t.suggestionNodes[e]=n}}},{key:"updateSuggestions",value:function(e){var t=this;if(e.length<2||/^https?:/.test(e))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=new FormData;n.append("action","search_affiliate_links_query"),n.append("keyword",e),n.append("paged",1),n.append("gutenberg",!0);var i=fetch(ajaxurl,{method:"POST",body:n});i.then(function(e){return e.json()}).then(function(e){if(e.affiliate_links){var n=e.affiliate_links;t.suggestionsRequest===i&&(t.setState({posts:n,loading:!1}),n.length?t.props.debouncedSpeak(sprintf(_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length),"assertive"):t.props.debouncedSpeak(p("No results."),"assertive"))}}).catch(function(){t.suggestionsRequest===i&&t.setState({loading:!1})}),this.suggestionsRequest=i}},{key:"onChange",value:function(e){this.props.resetInvalidLink();var t=e.target.value;this.props.onChange(t),this.updateSuggestions(t)}},{key:"onKeyDown",value:function(e){var t=this.state,n=t.showSuggestions,i=t.selectedSuggestion,o=t.posts,r=t.loading;if(n&&o.length&&!r){var a=this.state.posts[this.state.selectedSuggestion];switch(e.keyCode){case w:e.stopPropagation(),e.preventDefault();var l=i?i-1:o.length-1;this.setState({selectedSuggestion:l});break;case b:e.stopPropagation(),e.preventDefault();var s=null===i||i===o.length-1?0:i+1;this.setState({selectedSuggestion:s});break;case k:null!==this.state.selectedSuggestion&&(this.selectLink(a),this.props.speak(p("Link selected")));break;case y:null!==this.state.selectedSuggestion&&(e.stopPropagation(),this.selectLink(a))}}else switch(e.keyCode){case w:0!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(0,0));break;case b:this.props.value.length!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length))}}},{key:"selectLink",value:function(e){this.props.onChange(e.link,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}},{key:"handleOnClick",value:function(e){this.selectLink(e),this.inputRef.current.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.value,i=void 0===n?"":n,o=t.autoFocus,r=void 0===o||o,a=t.instanceId,s=t.invalidLink,u=this.state,c=u.showSuggestions,d=u.posts,f=u.selectedSuggestion,h=u.loading;return wp.element.createElement("div",{className:"editor-url-input block-editor-url-input"},wp.element.createElement("input",{autoFocus:r,type:"text","aria-label":p("URL"),required:!0,value:i,onChange:this.onChange,onInput:C,placeholder:p("Paste URL or type to search"),onKeyDown:this.onKeyDown,role:"combobox","aria-expanded":c,"aria-autocomplete":"list","aria-owns":"editor-url-input-suggestions-"+a,"aria-activedescendant":null!==f?"editor-url-input-suggestion-"+a+"-"+f:void 0,ref:this.inputRef}),h&&wp.element.createElement(E,null),c&&!!d.length&&!s&&wp.element.createElement(L,{position:"bottom",noArrow:!0,focusOnMount:!1},wp.element.createElement("div",{className:"editor-url-input__suggestions block-editor-url-input__suggestions",id:"editor-url-input-suggestions-"+a,ref:this.autocompleteRef,role:"listbox"},d.map(function(t,n){return wp.element.createElement("button",{key:t.id,role:"option",tabIndex:"-1",id:"block-editor-url-input-suggestion-"+a+"-"+n,ref:e.bindSuggestionNode(n),className:l()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":n===f}),onClick:function(){return e.handleOnClick(t)},"aria-selected":n===f},t.title||p("(no title)"))}))))}}]),t}(g);t.a=_(O(I))},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";function i(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var i=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,a=n.alignWithTop,l=n.alignWithLeft,s=n.offsetTop||0,u=n.offsetLeft||0,c=n.offsetBottom||0,p=n.offsetRight||0;i=void 0===i||i;var d=o.isWindow(t),f=o.offset(e),h=o.outerHeight(e),g=o.outerWidth(e),m=void 0,v=void 0,w=void 0,b=void 0,y=void 0,k=void 0,S=void 0,E=void 0,_=void 0,L=void 0;d?(S=t,L=o.height(S),_=o.width(S),E={left:o.scrollLeft(S),top:o.scrollTop(S)},y={left:f.left-E.left-u,top:f.top-E.top-s},k={left:f.left+g-(E.left+_)+p,top:f.top+h-(E.top+L)+c},b=E):(m=o.offset(t),v=t.clientHeight,w=t.clientWidth,b={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(m.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-u,top:f.top-(m.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},k={left:f.left+g-(m.left+w+(parseFloat(o.css(t,"borderRightWidth"))||0))+p,top:f.top+h-(m.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+c}),y.top<0||k.top>0?!0===a?o.scrollTop(t,b.top+y.top):!1===a?o.scrollTop(t,b.top+k.top):y.top<0?o.scrollTop(t,b.top+y.top):o.scrollTop(t,b.top+k.top):r||(a=void 0===a||!!a,a?o.scrollTop(t,b.top+y.top):o.scrollTop(t,b.top+k.top)),i&&(y.left<0||k.left>0?!0===l?o.scrollLeft(t,b.left+y.left):!1===l?o.scrollLeft(t,b.left+k.left):y.left<0?o.scrollLeft(t,b.left+y.left):o.scrollLeft(t,b.left+k.left):r||(l=void 0===l||!!l,l?o.scrollLeft(t,b.left+y.left):o.scrollLeft(t,b.left+k.left)))}var o=n(16);e.exports=i},function(e,t,n){"use strict";function i(e){var t=void 0,n=void 0,i=void 0,o=e.ownerDocument,r=o.body,a=o&&o.documentElement;return t=e.getBoundingClientRect(),n=t.left,i=t.top,n-=a.clientLeft||r.clientLeft||0,i-=a.clientTop||r.clientTop||0,{left:n,top:i}}function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],i="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[i],"number"!=typeof n&&(n=o.body[i])}return n}function r(e){return o(e)}function a(e){return o(e,!0)}function l(e){var t=i(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=a(o),t}function s(e,t,n){var i="",o=e.ownerDocument,r=n||o.defaultView.getComputedStyle(e,null);return r&&(i=r.getPropertyValue(t)||r[t]),i}function u(e,t){var n=e[_]&&e[_][t];if(S.test(n)&&!E.test(t)){var i=e.style,o=i[O],r=e[L][O];e[L][O]=e[_][O],i[O]="fontSize"===t?"1em":n||0,n=i.pixelLeft+C,i[O]=o,e[L][O]=r}return""===n?"auto":n}function c(e,t){for(var n=0;n<e.length;n++)t(e[n])}function p(e){return"border-box"===I(e,"boxSizing")}function d(e,t,n){var i={},o=e.style,r=void 0;for(r in t)t.hasOwnProperty(r)&&(i[r]=o[r],o[r]=t[r]);n.call(e);for(r in t)t.hasOwnProperty(r)&&(o[r]=i[r])}function f(e,t,n){var i=0,o=void 0,r=void 0,a=void 0;for(r=0;r<t.length;r++)if(o=t[r])for(a=0;a<n.length;a++){var l=void 0;l="border"===o?o+n[a]+"Width":o+n[a],i+=parseFloat(I(e,l))||0}return i}function h(e){return null!=e&&e==e.window}function g(e,t,n){if(h(e))return"width"===t?x.viewportWidth(e):x.viewportHeight(e);if(9===e.nodeType)return"width"===t?x.docWidth(e):x.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,r=I(e),a=p(e,r),l=0;(null==o||o<=0)&&(o=void 0,l=I(e,t),(null==l||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===n&&(n=a?A:R);var s=void 0!==o||a,u=o||l;if(n===R)return s?u-f(e,["border","padding"],i,r):l;if(s){var c=n===P?-f(e,["border"],i,r):f(e,["margin"],i,r);return u+(n===A?0:c)}return l+f(e,T.slice(n),i,r)}function m(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=g.apply(void 0,n):d(e,j,function(){t=g.apply(void 0,n)}),t}function v(e,t,n){var i=n;{if("object"!==(void 0===t?"undefined":y(t)))return void 0!==i?("number"==typeof i&&(i+="px"),void(e.style[t]=i)):I(e,t);for(var o in t)t.hasOwnProperty(o)&&v(e,o,t[o])}}function w(e,t){"static"===v(e,"position")&&(e.style.position="relative");var n=l(e),i={},o=void 0,r=void 0;for(r in t)t.hasOwnProperty(r)&&(o=parseFloat(v(e,r))||0,i[r]=o+t[r]-n[r]);v(e,i)}var b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},k=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,S=new RegExp("^("+k+")(?!px)[a-z%]+$","i"),E=/^(top|right|bottom|left)$/,_="currentStyle",L="runtimeStyle",O="left",C="px",I=void 0;"undefined"!=typeof window&&(I=window.getComputedStyle?s:u);var T=["margin","border","padding"],R=-1,P=2,A=1,x={};c(["Width","Height"],function(e){x["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],x["viewport"+e](n))},x["viewport"+e]=function(t){var n="client"+e,i=t.document,o=i.body,r=i.documentElement,a=r[n];return"CSS1Compat"===i.compatMode&&a||o&&o[n]||a}});var j={position:"absolute",visibility:"hidden",display:"block"};c(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);x["outer"+t]=function(t,n){return t&&m(t,e,n?0:A)};var n="width"===e?["Left","Right"]:["Top","Bottom"];x[e]=function(t,i){if(void 0===i)return t&&m(t,e,R);if(t){var o=I(t);return p(t)&&(i+=f(t,["padding","border"],n,o)),v(t,e,i)}}}),e.exports=b({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return l(e);w(e,t)},isWindow:h,each:c,css:v,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,a(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return a(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},x)},function(e,t){}]);
|
7 |
//# sourceMappingURL=gutenberg-support.js.map
|
3 |
Licensed under the MIT License (MIT), see
|
4 |
http://jedwatson.github.io/classnames
|
5 |
*/
|
6 |
+
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)&&i.length){var a=n.apply(null,i);a&&e.push(a)}else if("object"===o)for(var l in i)r.call(i,l)&&i[l]&&e.push(l)}}return e.join(" ")}var r={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):(i=[],void 0!==(o=function(){return n}.apply(t,i))&&(e.exports=o))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(8),r=n(17);n.n(r);Object(i.a)(),Object(o.a)()},function(e,t,n){"use strict";function i(){[o].forEach(function(e){if(e){var t=e.name,n=e.settings;r(t,n)}})}t.a=i;var o=n(3),r=wp.blocks.registerBlockType},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"name",function(){return g}),n.d(t,"settings",function(){return w});var o=n(0),r=n.n(o),a=n(4),l=wp.element.Fragment,s=wp.i18n.__,u=wp.blocks,c=(u.createBlock,u.getBlockAttributes,u.getPhrasingContentSchema),p=wp.editor.RichText,d=wp.components,f=d.Path,h=d.SVG,g="ta/image",m={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"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkid:{type:"number"},href:{type:"string",source:"attribute",selector:"ta",attribute:"href"},affiliateLink:{type:"object"}},v={img:{attributes:["src","alt"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},w=(c(),{title:s("ThirstyAffiliates Image"),description:s("Insert an image with an affiliate link to make a visual statement."),icon:wp.element.createElement(h,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(f,{d:"M0,0h24v24H0V0z",fill:"none"}),wp.element.createElement(f,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),wp.element.createElement(f,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),category:"common",keywords:["img",s("photo"),s("affiliate")],attributes:m,getEditWrapperProps:function(e){var t=e.align,n=e.width;if("left"===t||"center"===t||"right"===t||"wide"===t||"full"===t)return{"data-align":t,"data-resized":!!n}},edit:a.a,save:function(e){var t,n=e.attributes,o=n.url,a=n.alt,s=n.caption,u=n.align,c=n.width,d=n.height,f=n.id,h=n.linkid,g=n.href,m=r()((t={},i(t,"align"+u,u),i(t,"is-resized",c||d),t)),v=wp.element.createElement("img",{src:o,alt:a,className:f?"wp-image-"+f:null,width:c,height:d}),w=wp.element.createElement(l,null,wp.element.createElement("ta",{linkid:h,href:g},v),wp.element.createElement(p.Content,{tagName:"figcaption",value:s}));return"left"===u||"right"===u||"center"===u?wp.element.createElement("div",{className:"wp-block-image"},wp.element.createElement("figure",{className:m},w)):wp.element.createElement("figure",{className:"wp-block-image "+m},w)}})},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=n(5),u=n(6),c=n(7),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){var n=[],i=!0,o=!1,r=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){o=!0,r=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=lodash,g=h.get,m=h.isEmpty,v=h.map,w=h.last,b=h.pick,y=h.compact,k=wp.url.getPath,S=wp.i18n,E=S.__,_=S.sprintf,L=wp.element,O=L.Component,C=L.Fragment,I=L.createRef,T=wp.blob,R=T.getBlobByURL,P=T.revokeBlobURL,A=T.isBlobURL,x=wp.components,j=x.Placeholder,N=x.Button,F=x.ButtonGroup,W=x.IconButton,D=x.PanelBody,V=x.ResizableBox,z=x.SelectControl,B=x.Spinner,H=x.TextControl,U=x.TextareaControl,M=x.Toolbar,K=x.withNotices,q=(x.ToggleControl,x.Popover,wp.data.withSelect),G=wp.editor,Q=G.RichText,Z=G.BlockControls,$=G.InspectorControls,X=(G.MediaUpload,G.MediaUploadCheck,G.MediaPlaceholder,G.BlockAlignmentToolbar),Y=G.mediaUpload,J=wp.viewport.withViewportMatch,ee=wp.compose.compose,te=["image"],ne=function(e){var t=b(e,["alt","id","link","caption"]);return t.url=g(e,["sizes","large","url"])||g(e,["media_details","sizes","large","source_url"])||e.url,t},ie=function(e,t){return!e&&A(t)},oe=function(e,t){return t&&!e&&!A(t)},re=function(e){function t(e){var n=e.attributes;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.updateAlt=r.updateAlt.bind(r),r.updateAlignment=r.updateAlignment.bind(r),r.onFocusCaption=r.onFocusCaption.bind(r),r.onImageClick=r.onImageClick.bind(r),r.onSelectImage=r.onSelectImage.bind(r),r.updateImageURL=r.updateImageURL.bind(r),r.updateWidth=r.updateWidth.bind(r),r.updateHeight=r.updateHeight.bind(r),r.updateDimensions=r.updateDimensions.bind(r),r.getFilename=r.getFilename.bind(r),r.toggleIsEditing=r.toggleIsEditing.bind(r),r.onImageError=r.onImageError.bind(r),r.onChangeInputValue=r.onChangeInputValue.bind(r),r.autocompleteRef=I(),r.resetInvalidLink=r.resetInvalidLink.bind(r),r.updateImageSelection=r.updateImageSelection.bind(r),r.onSelectAffiliateImage=r.onSelectAffiliateImage.bind(r),r.editAFfiliateImage=r.editAFfiliateImage.bind(r),r.state={captionFocused:!1,isEditing:!n.url,inputValue:"",linkid:0,post:null,showSuggestions:!1,imageSelection:[],affiliateLink:null},r}return r(t,e),f(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,i=t.setAttributes,o=t.noticeOperations,r=n.id,a=n.url,l=void 0===a?"":a;if(ie(r,l)){var s=R(l);s&&Y({filesList:[s],onFileChange:function(e){var t=d(e,1),n=t[0];i(ne(n))},allowedTypes:te,onError:function(t){o.createErrorNotice(t),e.setState({isEditing:!0})}})}}},{key:"componentDidUpdate",value:function(e){var t=e.attributes,n=t.id,i=t.url,o=void 0===i?"":i,r=this.props.attributes,a=r.id,l=r.url,s=void 0===l?"":l;ie(n,o)&&!ie(a,s)&&P(s),!this.props.isSelected&&e.isSelected&&this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"onSelectImage",value:function(e){if(!e||!e.url)return void this.props.setAttributes({url:void 0,alt:void 0,id:void 0,caption:void 0});var t=this.state.affiliateLink;this.setState({isEditing:!1}),this.props.setAttributes(p({},ne(e),{linkid:t.id,href:t.link,affiliateLink:t,width:void 0,height:void 0}))}},{key:"onImageError",value:function(e){var t=Object(s.a)({attributes:{url:e}});void 0!==t&&this.props.onReplace(t)}},{key:"onFocusCaption",value:function(){this.state.captionFocused||this.setState({captionFocused:!0})}},{key:"onImageClick",value:function(){this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"updateAlt",value:function(e){this.props.setAttributes({alt:e})}},{key:"updateAlignment",value:function(e){var t=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};this.props.setAttributes(p({},t,{align:e}))}},{key:"updateImageURL",value:function(e){this.props.setAttributes({url:e,width:void 0,height:void 0})}},{key:"updateWidth",value:function(e){this.props.setAttributes({width:parseInt(e,10)})}},{key:"updateHeight",value:function(e){this.props.setAttributes({height:parseInt(e,10)})}},{key:"updateDimensions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(){e.props.setAttributes({width:t,height:n})}}},{key:"getFilename",value:function(e){var t=k(e);if(t)return w(t.split("/"))}},{key:"getLinkDestinationOptions",value:function(){return[{value:"none",label:E("None")},{value:"media",label:E("Media File")},{value:"attachment",label:E("Attachment Page")},{value:"custom",label:E("Custom URL")}]}},{key:"toggleIsEditing",value:function(){this.setState({isEditing:!this.state.isEditing})}},{key:"getImageSizeOptions",value:function(){var e=this.props,t=e.imageSizes,n=e.image;return y(v(t,function(e){var t=e.name,i=e.slug,o=g(n,["media_details","sizes",i,"source_url"]);return o?{value:o,label:t}:null}))}},{key:"onChangeInputValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?t.id:0;this.setState({inputValue:e,linkid:n,post:t})}},{key:"resetInvalidLink",value:function(){this.setState({invalidLink:!1})}},{key:"updateImageSelection",value:function(e,t){this.setState({imageSelection:e,affiliateLink:t})}},{key:"onSelectAffiliateImage",value:function(e){var t=this;if(oe(e.id,e.src))e.url=e.src,this.onSelectImage(e);else{wp.apiFetch({path:wp.url.addQueryArgs("/wp/v2/media/"+e.id,{context:"edit",_locale:"user"})}).then(function(e){e.url=e.source_url,t.onSelectImage(e)})}}},{key:"editAFfiliateImage",value:function(){var e=this.props.attributes,t=e.affiliateLink;this.setState({isEditing:!0,imageSelection:t.images,affiliateLink:t})}},{key:"render",value:function(){var e=this,t=this.state,n=t.isEditing,i=t.imageSelection,o=t.affiliateLink,r=this.props,a=r.attributes,s=r.setAttributes,p=r.isLargeViewport,d=r.isSelected,f=r.className,h=r.maxWidth,g=r.toggleSelection,v=r.isRTL,w=a.url,b=a.alt,y=a.caption,k=a.align,S=(a.linkDestination,a.width),L=a.height,O=a.linkid,I=a.href,T=wp.element.createElement(M,null,wp.element.createElement(W,{className:"ta-edit-image-button components-icon-button components-toolbar__control",label:E("Edit ThirstyAffiliates Image"),icon:"edit",onClick:this.editAFfiliateImage})),R=wp.element.createElement(Z,null,wp.element.createElement(X,{value:k,onChange:this.updateAlignment}),T);if(n)return wp.element.createElement(C,null,R,wp.element.createElement(j,{icon:"format-image",label:E("ThirstyAffiliates Image"),instructions:E("Search for an affiliate link and select image to insert.")},wp.element.createElement(c.a,{updateImageSelection:this.updateImageSelection}),!!i.length&&wp.element.createElement("div",{className:"ta-image-sel-wrap"},wp.element.createElement("h3",null,o.title+" "+E("attached images:")),wp.element.createElement("div",{className:"ta-image-selection"},i.map(function(t,n){return wp.element.createElement("button",{onClick:function(){return e.onSelectAffiliateImage(t)}},wp.element.createElement("img",{src:t.src}))})))));var P=l()(f,{"wp-block-image":!0,"is-transient":A(w),"is-resized":!!S||!!L,"is-focused":d}),x=-1===["wide","full"].indexOf(k)&&p,K=this.getImageSizeOptions(),q=function(t,n){return wp.element.createElement($,null,wp.element.createElement(D,{title:E("Image Settings")},wp.element.createElement(U,{label:E("Alt Text (Alternative Text)"),value:b,onChange:e.updateAlt,help:E("Alternative text describes your image to people who can’t see it. Add a short description with its key details.")}),!m(K)&&wp.element.createElement(z,{label:E("Image Size"),value:w,options:K,onChange:e.updateImageURL}),x&&wp.element.createElement("div",{className:"block-library-image__dimensions"},wp.element.createElement("p",{className:"block-library-image__dimensions__row"},E("Image Dimensions")),wp.element.createElement("div",{className:"block-library-image__dimensions__row"},wp.element.createElement(H,{type:"number",className:"block-library-image__dimensions__width",label:E("Width"),value:void 0!==S?S:"",placeholder:t,min:1,onChange:e.updateWidth}),wp.element.createElement(H,{type:"number",className:"block-library-image__dimensions__height",label:E("Height"),value:void 0!==L?L:"",placeholder:n,min:1,onChange:e.updateHeight})),wp.element.createElement("div",{className:"block-library-image__dimensions__row"},wp.element.createElement(F,{"aria-label":E("Image Size")},[25,50,75,100].map(function(i){var o=Math.round(t*(i/100)),r=Math.round(n*(i/100)),a=S===o&&L===r;return wp.element.createElement(N,{key:i,isSmall:!0,isPrimary:a,"aria-pressed":a,onClick:e.updateDimensions(o,r)},i,"%")})),wp.element.createElement(N,{isSmall:!0,onClick:e.updateDimensions()},E("Reset"))))))};return wp.element.createElement(C,null,R,wp.element.createElement("figure",{className:P},wp.element.createElement(u.a,{src:w,dirtynessTrigger:k},function(t){var n=t.imageWidthWithinContainer,i=t.imageHeightWithinContainer,o=t.imageWidth,r=t.imageHeight,a=e.getFilename(w),l=void 0;l=b||(a?_(E("This image has an empty alt attribute; its file name is %s"),a):E("This image has an empty alt attribute"));var u=wp.element.createElement(C,null,wp.element.createElement("ta",{linkid:O,href:I},wp.element.createElement("img",{src:w,alt:l,onClick:e.onImageClick,onError:function(){return e.onImageError(w)}})),A(w)&&wp.element.createElement(B,null));if(!x||!n)return wp.element.createElement(C,null,q(o,r),wp.element.createElement("div",{style:{width:S,height:L}},u));var c=S||n,p=L||i,d=o/r,f=o<r?20:20*d,m=r<o?20:20/d,y=2.5*h,T=!1,R=!1;return"center"===k?(T=!0,R=!0):v?"left"===k?T=!0:R=!0:"right"===k?R=!0:T=!0,wp.element.createElement(C,null,q(o,r),wp.element.createElement(V,{size:S&&L?{width:S,height:L}:void 0,minWidth:f,maxWidth:y,minHeight:m,maxHeight:y/d,lockAspectRatio:!0,enable:{top:!1,right:T,bottom:!0,left:R},onResizeStart:function(){g(!1)},onResizeStop:function(e,t,n,i){s({width:parseInt(c+i.width,10),height:parseInt(p+i.height,10)}),g(!0)}},u))}),(!Q.isEmpty(y)||d)&&wp.element.createElement(Q,{tagName:"figcaption",placeholder:E("Write caption…"),value:y,unstableOnFocus:this.onFocusCaption,onChange:function(e){return s({caption:e})},isSelected:this.state.captionFocused,inlineToolbar:!0})))}}]),t}(O);t.a=ee([q(function(e,t){var n=e("core"),i=n.getMedia,o=e("core/editor"),r=o.getEditorSettings,a=t.attributes.id,l=r(),s=l.maxWidth,u=l.isRTL,c=l.imageSizes;return{image:a?i(a):null,maxWidth:s,isRTL:u,imageSizes:c}}),J({isLargeViewport:"medium"}),K])(re)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=lodash,r=o.includes,a=(wp.element.renderToString,wp.blocks.createBlock),l=function(e,t){var n=e.preview,o=e.name,r=e.attributes.url;if(r){var l=findBlock(r);if("core-embed/wordpress"!==o&&DEFAULT_EMBED_BLOCK!==l&&o!==l)return a(l,{url:r});if(n){var u=n.html;if(s(u)&&"core-embed/wordpress"!==o)return a("core-embed/wordpress",i({url:r},t))}}},s=function(e){return r(e,'class="wp-embedded-content" data-secret')}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=lodash,s=l.noop,u=wp.compose.withGlobalEvents,c=wp.element.Component,p=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={width:void 0,height:void 0},e.bindContainer=e.bindContainer.bind(e),e.calculateSize=e.calculateSize.bind(e),e}return r(t,e),a(t,[{key:"bindContainer",value:function(e){this.container=e}},{key:"componentDidUpdate",value:function(e){this.props.src!==e.src&&(this.setState({width:void 0,height:void 0}),this.fetchImageSize()),this.props.dirtynessTrigger!==e.dirtynessTrigger&&this.calculateSize()}},{key:"componentDidMount",value:function(){this.fetchImageSize()}},{key:"componentWillUnmount",value:function(){this.image&&(this.image.onload=s)}},{key:"fetchImageSize",value:function(){this.image=new window.Image,this.image.onload=this.calculateSize,this.image.src=this.props.src}},{key:"calculateSize",value:function(){var e=this.container.clientWidth,t=this.image.width>e,n=this.image.height/this.image.width,i=t?e:this.image.width,o=t?e*n:this.image.height;this.setState({width:i,height:o})}},{key:"render",value:function(){var e={imageWidth:this.image&&this.image.width,imageHeight:this.image&&this.image.height,containerWidth:this.container&&this.container.clientWidth,containerHeight:this.container&&this.container.clientHeight,imageWidthWithinContainer:this.state.width,imageHeightWithinContainer:this.state.height};return wp.element.createElement("div",{ref:this.bindContainer},this.props.children(e))}}]),t}(c);t.a=u({resize:"calculateSize"})(p)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=wp.i18n.__,c=wp.element,p=c.Component,d=c.createRef,f=wp.components,h=f.Spinner,g=f.withSpokenMessages,m=f.Popover,v=f.TextControl,w=wp.compose.withInstanceId,b=function(e){function t(e){var n=e.autocompleteRef;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.autocompleteRef=n||d(),r.inputRef=d(),r.searchAffiliateLinks=r.searchAffiliateLinks.bind(r),r.suggestionNodes=[],r.state={posts:[],showSuggestions:!1,selectedSuggestion:null,loading:!1},r}return r(t,e),s(t,[{key:"componentDidUpdate",value:function(){var e=this,t=this.state,n=t.showSuggestions,i=t.selectedSuggestion;n&&null!==i&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,scrollIntoView(this.suggestionNodes[i],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),setTimeout(function(){e.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(e){var t=this;return function(n){t.suggestionNodes[e]=n}}},{key:"searchAffiliateLinks",value:function(e){var t=this;if(e.length<2)return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=new FormData;n.append("action","search_affiliate_links_query"),n.append("keyword",e),n.append("paged",1),n.append("gutenberg",!0),n.append("with_images",!0);var i=fetch(ajaxurl,{method:"POST",body:n});i.then(function(e){return e.json()}).then(function(e){if(e.affiliate_links){var n=e.affiliate_links;t.suggestionsRequest===i&&(t.setState({posts:n,loading:!1}),n.length?t.props.debouncedSpeak(sprintf(_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length),"assertive"):t.props.debouncedSpeak(u("No results."),"assertive"))}}).catch(function(){t.suggestionsRequest===i&&t.setState({loading:!1})}),this.suggestionsRequest=i}},{key:"selectLink",value:function(e){this.setState({selectedSuggestion:e,showSuggestions:!1}),this.props.updateImageSelection(e.images,e)}},{key:"handleOnClick",value:function(e){this.selectLink(e)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.autoFocus,t.instanceId),i=this.state,o=i.showSuggestions,r=i.posts,a=i.selectedSuggestion,s=i.loading;return wp.element.createElement("div",{class:"edit-search-affiliate-links"},wp.element.createElement("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover",onSubmit:this.displayAffiliateImages},wp.element.createElement(v,{type:"text",className:"ta-search-affiliate-links",placeholder:u("Type to search affiliate links"),onChange:this.searchAffiliateLinks,autocomplete:"off"}),s&&wp.element.createElement(h,null),o&&!!r.length&&wp.element.createElement(m,{position:"bottom",focusOnMount:!1},wp.element.createElement("div",{class:"affilate-links-suggestions"},r.map(function(t,i){return wp.element.createElement("button",{key:t.id,role:"option",tabIndex:"-1",id:"editor-url-input-suggestion-"+n+"-"+i,ref:e.bindSuggestionNode(i),className:l()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":i===a}),onClick:function(){return e.handleOnClick(t)},"aria-selected":i===a},t.title||u("(no title)"))})))))}}]),t}(p);t.a=g(w(b))},function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(){[r.a].forEach(function(e){var t=e.name,n=i(e,["name"]);return a(t,n)})}t.a=o;var r=n(9),a=wp.richText.registerFormatType},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return O});var a=n(10),l=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=wp.i18n.__,u=wp.element,c=u.Component,p=u.Fragment,d=wp.components.withSpokenMessages,f=wp.richText,h=f.getTextContent,g=f.applyFormat,m=f.removeFormat,v=f.slice,w=wp.url.isURL,b=wp.editor,y=b.RichTextToolbarButton,k=b.RichTextShortcut,S=wp.components,E=S.Path,_=S.SVG,L=wp.dom.getRectangleFromRange,O={name:"ta/link",title:s("Affiliate Link"),tagName:"ta",className:null,attributes:{url:"href",target:"target"},edit:d(function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.addLink=e.addLink.bind(e),e.stopAddingLink=e.stopAddingLink.bind(e),e.onRemoveFormat=e.onRemoveFormat.bind(e),e.state={addingLink:!1},e}return r(t,e),l(t,[{key:"addLink",value:function(){var e=this.props,t=e.value,n=e.onChange,i=h(v(t));i&&w(i)?n(g(t,{type:"ta/link",attributes:{url:i}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1})}},{key:"onRemoveFormat",value:function(){var e=this.props,t=e.value,n=e.onChange,i=e.speak;n(m(t,"ta/link")),i(s("Affiliate Link removed."),"assertive")}},{key:"getAnchorRect",value:function(){var e=window.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):null;if(t){var n=null;if(this.state.addingLink)n=L(t);else{var i=t.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==window.Node.ELEMENT_NODE;)i=i.parentNode;var o=i.closest("ta");o&&(n=o.getBoundingClientRect())}return n}}},{key:"render",value:function(){var e=this.props,t=e.isActive,n=e.activeAttributes,i=e.value,o=e.onChange,r=this.getAnchorRect();return wp.element.createElement(p,null,wp.element.createElement(k,{type:"access",character:"s",onUse:this.onRemoveFormat}),wp.element.createElement(k,{type:"primary",character:"l",onUse:this.addLink}),wp.element.createElement(k,{type:"primaryShift",character:"l",onUse:this.onRemoveFormat}),t&&wp.element.createElement(y,{icon:"editor-unlink",title:s("Remove Affiliate Link"),className:"ta-unlink-button",onClick:this.onRemoveFormat,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"l"}),!t&&wp.element.createElement(y,{icon:wp.element.createElement(_,{xmlns:"http://www.w3.org/2000/svg",width:"16.688",height:"9.875",viewBox:"0 0 16.688 9.875"},wp.element.createElement(E,{id:"TA.svg",fill:"black",class:"cls-1",d:"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z",transform:"translate(-1.188 -5.25)"})),title:s("Affiliate Link"),className:"ta-link-button",onClick:this.addLink,shortcutType:"primary",shortcutCharacter:"l"}),wp.element.createElement(a.a,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:t,activeAttributes:n,anchorRect:r,value:i,onChange:o}))}}]),t}(c))}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=e.url,n=e.linkid;e.text;return{type:"ta/link",attributes:{url:t,linkid:n.toString()}}}function l(e,t){return e.addingLink||t.editLink}var s=n(0),u=n.n(s),c=n(11),p=n(12),d=n(13),f=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=wp.i18n.__,g=wp.element,m=g.Component,v=g.createRef,w=wp.components,b=w.ExternalLink,y=(w.ToggleControl,w.IconButton),k=w.withSpokenMessages,S=wp.keycodes,E=S.LEFT,_=S.RIGHT,L=S.UP,O=S.DOWN,C=S.BACKSPACE,I=S.ENTER,T=wp.url,R=T.prependHTTP,P=T.safeDecodeURI,A=T.filterURLForDisplay,x=wp.richText,j=x.create,N=x.insert,F=x.isCollapsed,W=x.applyFormat,D=x.getTextContent,V=x.slice,z=function(e){return e.stopPropagation()},B=function(e){var t=e.value,n=e.onChangeInputValue,i=e.onKeyDown,o=e.submitLink,r=e.invalidLink,a=e.resetInvalidLink,l=e.autocompleteRef;return wp.element.createElement("form",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover",onKeyPress:z,onKeyDown:i,onSubmit:o},wp.element.createElement(d.a,{value:t,onChange:n,autocompleteRef:l,invalidLink:r,resetInvalidLink:a}),wp.element.createElement(y,{icon:"editor-break",label:h("Apply"),type:"submit"}))},H=function(e){var t=e.url,n=R(t),i=u()("editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value",{"has-invalid-link":!Object(c.a)(n)});return t?wp.element.createElement(b,{className:i,href:t},A(P(t))):wp.element.createElement("span",{className:i})},U=function(e){var t=e.url,n=e.editLink;return wp.element.createElement("div",{className:"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",onKeyPress:z},wp.element.createElement(H,{url:t}),wp.element.createElement(y,{icon:"edit",label:h("Edit"),onClick:n}))},M=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.editLink=e.editLink.bind(e),e.submitLink=e.submitLink.bind(e),e.onKeyDown=e.onKeyDown.bind(e),e.onChangeInputValue=e.onChangeInputValue.bind(e),e.onClickOutside=e.onClickOutside.bind(e),e.resetState=e.resetState.bind(e),e.autocompleteRef=v(),e.resetInvalidLink=e.resetInvalidLink.bind(e),e.state={inputValue:"",linkid:0,post:null,invalidLink:!1},e}return r(t,e),f(t,[{key:"onKeyDown",value:function(e){[E,O,_,L,C,I].indexOf(e.keyCode)>-1&&e.stopPropagation()}},{key:"onChangeInputValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?t.id:0;this.setState({inputValue:e,linkid:n,post:t})}},{key:"editLink",value:function(e){this.setState({editLink:!0}),e.preventDefault()}},{key:"submitLink",value:function(e){var t=this.props,n=t.isActive,i=t.value,o=t.onChange,r=t.speak,l=this.state,s=l.inputValue,u=l.linkid,p=l.post,d=R(s),f=D(V(i)),g=a({url:d,linkid:u,text:f});if(e.preventDefault(),!u||!p)return void this.setState({invalidLink:!0});if(F(i)&&!n){var m=W(j({text:p.title}),g,0,d.length);o(N(i,m))}else o(W(i,g));this.resetState(),Object(c.a)(d)?n?r(h("Link edited."),"assertive"):r(h("Link inserted"),"assertive"):r(h("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}},{key:"onClickOutside",value:function(e){var t=this.autocompleteRef.current;t&&t.contains(e.target)||this.resetState()}},{key:"resetState",value:function(){this.props.stopAddingLink(),this.setState({inputValue:"",editLink:!1}),this.resetInvalidLink()}},{key:"resetInvalidLink",value:function(){this.setState({invalidLink:!1})}},{key:"render",value:function(){var e=this.props,t=e.isActive,n=e.activeAttributes,i=n.url,o=(n.linkid,e.addingLink),r=e.anchorRect;e.value,e.onChange;if(!t&&!o)return null;var a=this.state,s=a.inputValue,u=a.invalidLink,c=l(this.props,this.state);return wp.element.createElement(p.a,{onClickOutside:this.onClickOutside,onClose:this.resetState,focusOnMount:!!c&&"firstElement",invalidLink:u,anchorRect:r},c?wp.element.createElement(B,{value:s,onChangeInputValue:this.onChangeInputValue,onKeyDown:this.onKeyDown,submitLink:this.submitLink,autocompleteRef:this.autocompleteRef,updateLinkId:this.updateLinkId,invalidLink:u,resetInvalidLink:this.resetInvalidLink}):wp.element.createElement(U,{url:i,editLink:this.editLink}))}}]),t}(m);t.a=k(M)},function(e,t,n){"use strict";function i(e){if(!e)return!1;var t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){var n=l(t);if(!s(n))return!1;if(r(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;var i=u(t);if(!c(i))return!1;var o=p(t);if(o&&!d(o))return!1;var a=f(t);if(a&&!h(a))return!1;var v=g(t);if(v&&!m(v))return!1}return!(r(t,"#")&&!m(t))}t.a=i;var o=lodash,r=o.startsWith,a=wp.url,l=a.getProtocol,s=a.isValidProtocol,u=a.getAuthority,c=a.isValidAuthority,p=a.getPath,d=a.isValidPath,f=a.getQueryString,h=a.isValidQueryString,g=a.getFragment,m=a.isValidFragment},function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=wp.i18n.__,c=wp.element.Component,p=wp.components,d=p.Popover,f=p.IconButton,h=function(e){function t(){o(this,t);var e=r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.toggleSettingsVisibility=e.toggleSettingsVisibility.bind(e),e.state={isSettingsExpanded:!1},e}return a(t,e),s(t,[{key:"toggleSettingsVisibility",value:function(){this.setState({isSettingsExpanded:!this.state.isSettingsExpanded})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.renderSettings,o=e.invalidLink,r=e.position,a=void 0===r?"bottom center":r,s=e.focusOnMount,c=void 0===s?"firstElement":s,p=i(e,["children","renderSettings","invalidLink","position","focusOnMount"]),h=this.state.isSettingsExpanded,g=!!n&&h;return wp.element.createElement(d,l({className:"ta-url-popover editor-url-popover block-editor-url-popover",focusOnMount:c,position:a},p),wp.element.createElement("div",{className:"editor-url-popover__row"},t,!!n&&wp.element.createElement(f,{className:"editor-url-popover__settings-toggle",icon:"ellipsis",label:u("Link Settings"),onClick:this.toggleSettingsVisibility,"aria-expanded":h})),g&&wp.element.createElement("div",{className:"editor-url-popover__row editor-url-popover__settings"},n()),o&&wp.element.createElement("div",{class:"ta-invalid-link"},u("Invalid affiliate link")))}}]),t}(c);t.a=h},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),l=n.n(a),s=n(14),u=n.n(s),c=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=wp.i18n.__,d=lodash,f=d.throttle,h=wp.element,g=h.Component,m=h.createRef,v=wp.keycodes,w=v.UP,b=v.DOWN,y=v.ENTER,k=v.TAB,S=wp.components,E=S.Spinner,_=S.withSpokenMessages,L=S.Popover,O=wp.compose.withInstanceId,C=function(e){return e.stopPropagation()},I=function(e){function t(e){var n=e.autocompleteRef;i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.onChange=r.onChange.bind(r),r.onKeyDown=r.onKeyDown.bind(r),r.autocompleteRef=n||m(),r.inputRef=m(),r.updateSuggestions=f(r.updateSuggestions.bind(r),200),r.suggestionNodes=[],r.state={posts:[],showSuggestions:!1,selectedSuggestion:null},r}return r(t,e),c(t,[{key:"componentDidUpdate",value:function(){var e=this,t=this.state,n=t.showSuggestions,i=t.selectedSuggestion;n&&null!==i&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,u()(this.suggestionNodes[i],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),setTimeout(function(){e.scrollingIntoView=!1},100))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest}},{key:"bindSuggestionNode",value:function(e){var t=this;return function(n){t.suggestionNodes[e]=n}}},{key:"updateSuggestions",value:function(e){var t=this;if(e.length<2||/^https?:/.test(e))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.setState({showSuggestions:!0,selectedSuggestion:null,loading:!0});var n=new FormData;n.append("action","search_affiliate_links_query"),n.append("keyword",e),n.append("paged",1),n.append("gutenberg",!0);var i=fetch(ajaxurl,{method:"POST",body:n});i.then(function(e){return e.json()}).then(function(e){if(e.affiliate_links){var n=e.affiliate_links;t.suggestionsRequest===i&&(t.setState({posts:n,loading:!1}),n.length?t.props.debouncedSpeak(sprintf(_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length),"assertive"):t.props.debouncedSpeak(p("No results."),"assertive"))}}).catch(function(){t.suggestionsRequest===i&&t.setState({loading:!1})}),this.suggestionsRequest=i}},{key:"onChange",value:function(e){this.props.resetInvalidLink();var t=e.target.value;this.props.onChange(t),this.updateSuggestions(t)}},{key:"onKeyDown",value:function(e){var t=this.state,n=t.showSuggestions,i=t.selectedSuggestion,o=t.posts,r=t.loading;if(n&&o.length&&!r){var a=this.state.posts[this.state.selectedSuggestion];switch(e.keyCode){case w:e.stopPropagation(),e.preventDefault();var l=i?i-1:o.length-1;this.setState({selectedSuggestion:l});break;case b:e.stopPropagation(),e.preventDefault();var s=null===i||i===o.length-1?0:i+1;this.setState({selectedSuggestion:s});break;case k:null!==this.state.selectedSuggestion&&(this.selectLink(a),this.props.speak(p("Link selected")));break;case y:null!==this.state.selectedSuggestion&&(e.stopPropagation(),this.selectLink(a))}}else switch(e.keyCode){case w:0!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(0,0));break;case b:this.props.value.length!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length))}}},{key:"selectLink",value:function(e){this.props.onChange(e.link,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}},{key:"handleOnClick",value:function(e){this.selectLink(e),this.inputRef.current.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.value,i=void 0===n?"":n,o=t.autoFocus,r=void 0===o||o,a=t.instanceId,s=t.invalidLink,u=this.state,c=u.showSuggestions,d=u.posts,f=u.selectedSuggestion,h=u.loading;return wp.element.createElement("div",{className:"editor-url-input block-editor-url-input"},wp.element.createElement("input",{autoFocus:r,type:"text","aria-label":p("URL"),required:!0,value:i,onChange:this.onChange,onInput:C,placeholder:p("Paste URL or type to search"),onKeyDown:this.onKeyDown,role:"combobox","aria-expanded":c,"aria-autocomplete":"list","aria-owns":"editor-url-input-suggestions-"+a,"aria-activedescendant":null!==f?"editor-url-input-suggestion-"+a+"-"+f:void 0,ref:this.inputRef}),h&&wp.element.createElement(E,null),c&&!!d.length&&!s&&wp.element.createElement(L,{position:"bottom",noArrow:!0,focusOnMount:!1},wp.element.createElement("div",{className:"editor-url-input__suggestions block-editor-url-input__suggestions",id:"editor-url-input-suggestions-"+a,ref:this.autocompleteRef,role:"listbox"},d.map(function(t,n){return wp.element.createElement("button",{key:t.id,role:"option",tabIndex:"-1",id:"block-editor-url-input-suggestion-"+a+"-"+n,ref:e.bindSuggestionNode(n),className:l()("editor-url-input__suggestion block-editor-url-input__suggestion",{"is-selected":n===f}),onClick:function(){return e.handleOnClick(t)},"aria-selected":n===f},t.title||p("(no title)"))}))))}}]),t}(g);t.a=_(O(I))},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";function i(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var i=n.allowHorizontalScroll,r=n.onlyScrollIfNeeded,a=n.alignWithTop,l=n.alignWithLeft,s=n.offsetTop||0,u=n.offsetLeft||0,c=n.offsetBottom||0,p=n.offsetRight||0;i=void 0===i||i;var d=o.isWindow(t),f=o.offset(e),h=o.outerHeight(e),g=o.outerWidth(e),m=void 0,v=void 0,w=void 0,b=void 0,y=void 0,k=void 0,S=void 0,E=void 0,_=void 0,L=void 0;d?(S=t,L=o.height(S),_=o.width(S),E={left:o.scrollLeft(S),top:o.scrollTop(S)},y={left:f.left-E.left-u,top:f.top-E.top-s},k={left:f.left+g-(E.left+_)+p,top:f.top+h-(E.top+L)+c},b=E):(m=o.offset(t),v=t.clientHeight,w=t.clientWidth,b={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(m.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-u,top:f.top-(m.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},k={left:f.left+g-(m.left+w+(parseFloat(o.css(t,"borderRightWidth"))||0))+p,top:f.top+h-(m.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+c}),y.top<0||k.top>0?!0===a?o.scrollTop(t,b.top+y.top):!1===a?o.scrollTop(t,b.top+k.top):y.top<0?o.scrollTop(t,b.top+y.top):o.scrollTop(t,b.top+k.top):r||(a=void 0===a||!!a,a?o.scrollTop(t,b.top+y.top):o.scrollTop(t,b.top+k.top)),i&&(y.left<0||k.left>0?!0===l?o.scrollLeft(t,b.left+y.left):!1===l?o.scrollLeft(t,b.left+k.left):y.left<0?o.scrollLeft(t,b.left+y.left):o.scrollLeft(t,b.left+k.left):r||(l=void 0===l||!!l,l?o.scrollLeft(t,b.left+y.left):o.scrollLeft(t,b.left+k.left)))}var o=n(16);e.exports=i},function(e,t,n){"use strict";function i(e){var t=void 0,n=void 0,i=void 0,o=e.ownerDocument,r=o.body,a=o&&o.documentElement;return t=e.getBoundingClientRect(),n=t.left,i=t.top,n-=a.clientLeft||r.clientLeft||0,i-=a.clientTop||r.clientTop||0,{left:n,top:i}}function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],i="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[i],"number"!=typeof n&&(n=o.body[i])}return n}function r(e){return o(e)}function a(e){return o(e,!0)}function l(e){var t=i(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=a(o),t}function s(e,t,n){var i="",o=e.ownerDocument,r=n||o.defaultView.getComputedStyle(e,null);return r&&(i=r.getPropertyValue(t)||r[t]),i}function u(e,t){var n=e[_]&&e[_][t];if(S.test(n)&&!E.test(t)){var i=e.style,o=i[O],r=e[L][O];e[L][O]=e[_][O],i[O]="fontSize"===t?"1em":n||0,n=i.pixelLeft+C,i[O]=o,e[L][O]=r}return""===n?"auto":n}function c(e,t){for(var n=0;n<e.length;n++)t(e[n])}function p(e){return"border-box"===I(e,"boxSizing")}function d(e,t,n){var i={},o=e.style,r=void 0;for(r in t)t.hasOwnProperty(r)&&(i[r]=o[r],o[r]=t[r]);n.call(e);for(r in t)t.hasOwnProperty(r)&&(o[r]=i[r])}function f(e,t,n){var i=0,o=void 0,r=void 0,a=void 0;for(r=0;r<t.length;r++)if(o=t[r])for(a=0;a<n.length;a++){var l=void 0;l="border"===o?o+n[a]+"Width":o+n[a],i+=parseFloat(I(e,l))||0}return i}function h(e){return null!=e&&e==e.window}function g(e,t,n){if(h(e))return"width"===t?x.viewportWidth(e):x.viewportHeight(e);if(9===e.nodeType)return"width"===t?x.docWidth(e):x.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,r=I(e),a=p(e,r),l=0;(null==o||o<=0)&&(o=void 0,l=I(e,t),(null==l||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===n&&(n=a?A:R);var s=void 0!==o||a,u=o||l;if(n===R)return s?u-f(e,["border","padding"],i,r):l;if(s){var c=n===P?-f(e,["border"],i,r):f(e,["margin"],i,r);return u+(n===A?0:c)}return l+f(e,T.slice(n),i,r)}function m(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=g.apply(void 0,n):d(e,j,function(){t=g.apply(void 0,n)}),t}function v(e,t,n){var i=n;{if("object"!==(void 0===t?"undefined":y(t)))return void 0!==i?("number"==typeof i&&(i+="px"),void(e.style[t]=i)):I(e,t);for(var o in t)t.hasOwnProperty(o)&&v(e,o,t[o])}}function w(e,t){"static"===v(e,"position")&&(e.style.position="relative");var n=l(e),i={},o=void 0,r=void 0;for(r in t)t.hasOwnProperty(r)&&(o=parseFloat(v(e,r))||0,i[r]=o+t[r]-n[r]);v(e,i)}var b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},k=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,S=new RegExp("^("+k+")(?!px)[a-z%]+$","i"),E=/^(top|right|bottom|left)$/,_="currentStyle",L="runtimeStyle",O="left",C="px",I=void 0;"undefined"!=typeof window&&(I=window.getComputedStyle?s:u);var T=["margin","border","padding"],R=-1,P=2,A=1,x={};c(["Width","Height"],function(e){x["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],x["viewport"+e](n))},x["viewport"+e]=function(t){var n="client"+e,i=t.document,o=i.body,r=i.documentElement,a=r[n];return"CSS1Compat"===i.compatMode&&a||o&&o[n]||a}});var j={position:"absolute",visibility:"hidden",display:"block"};c(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);x["outer"+t]=function(t,n){return t&&m(t,e,n?0:A)};var n="width"===e?["Left","Right"]:["Top","Bottom"];x[e]=function(t,i){if(void 0===i)return t&&m(t,e,R);if(t){var o=I(t);return p(t)&&(i+=f(t,["padding","border"],n,o)),v(t,e,i)}}}),e.exports=b({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return l(e);w(e,t)},isWindow:h,each:c,css:v,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,a(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return a(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},x)},function(e,t){}]);
|
7 |
//# sourceMappingURL=gutenberg-support.js.map
|
js/app/gutenberg_support/dist/gutenberg-support.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["webpack:///gutenberg-support.js","webpack:///webpack/bootstrap b9e91726b748eacc734c","webpack:///./node_modules/classnames/index.js","webpack:///./src/index.js","webpack:///./src/blocks/index.js","webpack:///./src/blocks/ta-image/index.js","webpack:///./src/blocks/ta-image/edit.js","webpack:///./src/blocks/ta-image/util.js","webpack:///./src/blocks/ta-image/image-size.js","webpack:///./src/blocks/ta-image/search-input.js","webpack:///./src/formats/index.js","webpack:///./src/formats/ta-link/index.js","webpack:///./src/formats/ta-link/inline.js","webpack:///./src/formats/ta-link/utils.js","webpack:///./src/formats/ta-link/url-popover.js","webpack:///./src/formats/ta-link/url-input.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","key","hasOwn","join","default","undefined","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__blocks__","__WEBPACK_IMPORTED_MODULE_1__formats__","__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__","registerBlocks","registerFormats","taimage","forEach","block","settings","registerBlockType","__WEBPACK_IMPORTED_MODULE_0__ta_image__","wp","blocks","_defineProperty","obj","writable","__WEBPACK_IMPORTED_MODULE_0_classnames__","__WEBPACK_IMPORTED_MODULE_0_classnames___default","__WEBPACK_IMPORTED_MODULE_1__edit__","Fragment","element","__","i18n","_wp$blocks","getPhrasingContentSchema","createBlock","getBlockAttributes","RichText","editor","_wp$components","components","Path","SVG","blockAttributes","url","type","source","selector","attribute","alt","caption","id","align","width","height","linkid","href","affiliateLink","imageSchema","img","attributes","title","description","icon","createElement","viewBox","xmlns","fill","category","keywords","getEditWrapperProps","data-align","data-resized","edit","save","_ref","_classnames","classnames","image","src","className","figure","Content","tagName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","__WEBPACK_IMPORTED_MODULE_1__util__","__WEBPACK_IMPORTED_MODULE_2__image_size__","__WEBPACK_IMPORTED_MODULE_3__search_input__","_extends","assign","target","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","err","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_lodash","lodash","isEmpty","map","last","pick","compact","getPath","_wp$i18n","sprintf","_wp$element","Component","createRef","_wp$blob","blob","getBlobByURL","revokeBlobURL","isBlobURL","Placeholder","Button","ButtonGroup","IconButton","PanelBody","ResizableBox","SelectControl","Spinner","TextControl","TextareaControl","Toolbar","withNotices","withSelect","ToggleControl","Popover","data","_wp$editor","BlockControls","InspectorControls","BlockAlignmentToolbar","MediaUpload","MediaUploadCheck","MediaPlaceholder","mediaUpload","withViewportMatch","viewport","compose","ALLOWED_MEDIA_TYPES","pickRelevantMediaFiles","imageProps","isTemporaryImage","isExternalImage","ImageEdit","_Component","this","_this","getPrototypeOf","updateAlt","bind","updateAlignment","onFocusCaption","onImageClick","onSelectImage","updateImageURL","updateWidth","updateHeight","updateDimensions","getFilename","toggleIsEditing","onImageError","onChangeInputValue","autocompleteRef","resetInvalidLink","updateImageSelection","onSelectAffiliateImage","editAFfiliateImage","state","captionFocused","isEditing","inputValue","post","showSuggestions","imageSelection","_this2","_props","setAttributes","noticeOperations","_attributes$url","file","filesList","onFileChange","_ref2","_ref3","allowedTypes","onError","message","createErrorNotice","setState","prevProps","_prevProps$attributes","prevID","_prevProps$attributes2","prevURL","_props$attributes","_props$attributes$url","isSelected","media","link","embedBlock","createUpgradedEmbedBlock","onReplace","newAlt","nextAlign","extraUpdatedAttributes","indexOf","parseInt","_this3","path","split","label","_props2","imageSizes","_ref4","slug","sizeUrl","invalidLink","_this4","apiFetch","addQueryArgs","context","_locale","then","source_url","images","_this5","_state","_props3","isLargeViewport","maxWidth","toggleSelection","isRTL","linkDestination","toolbarEditButton","onClick","controls","onChange","instructions","index","wp-block-image","is-transient","is-resized","is-focused","isResizable","imageSizeOptions","getImageSizeOptions","getInspectorControls","imageWidth","imageHeight","help","options","placeholder","min","aria-label","scale","scaledWidth","Math","round","scaledHeight","isCurrent","isSmall","isPrimary","aria-pressed","dirtynessTrigger","sizes","imageWidthWithinContainer","imageHeightWithinContainer","filename","defaultedAlt","style","currentWidth","currentHeight","ratio","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","maxHeight","lockAspectRatio","enable","top","right","bottom","left","onResizeStart","onResizeStop","event","direction","elt","delta","unstableOnFocus","inlineToolbar","select","_select","getMedia","_select2","getEditorSettings","_getEditorSettings","includes","renderToString","attributesFromPreview","preview","matchingBlock","findBlock","DEFAULT_EMBED_BLOCK","html","isFromWordPress","noop","withGlobalEvents","ImageSize","bindContainer","calculateSize","ref","container","fetchImageSize","onload","window","Image","clientWidth","exceedMaxWidth","containerWidth","containerHeight","clientHeight","children","resize","withSpokenMessages","withInstanceId","ThirstyURLInput","inputRef","searchAffiliateLinks","suggestionNodes","posts","selectedSuggestion","loading","scrollingIntoView","scrollIntoView","current","onlyScrollIfNeeded","setTimeout","suggestionsRequest","formData","FormData","append","request","fetch","ajaxurl","method","body","response","json","affiliate_links","debouncedSpeak","catch","selectLink","instanceId","autoFocus","_state2","class","onSubmit","displayAffiliateImages","autocomplete","position","focusOnMount","role","tabIndex","bindSuggestionNode","is-selected","handleOnClick","aria-selected","_objectWithoutProperties","keys","taLink","registerFormatType","__WEBPACK_IMPORTED_MODULE_0__ta_link__","richText","__WEBPACK_IMPORTED_MODULE_0__inline__","_wp$richText","getTextContent","applyFormat","removeFormat","slice","isURL","RichTextToolbarButton","RichTextShortcut","getRectangleFromRange","dom","LinkEdit","addLink","stopAddingLink","onRemoveFormat","addingLink","text","speak","selection","getSelection","range","rangeCount","getRangeAt","rect","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","isActive","activeAttributes","anchorRect","getAnchorRect","character","onUse","shortcutType","shortcutCharacter","transform","createLinkFormat","toString","isShowingInput","editLink","__WEBPACK_IMPORTED_MODULE_1__utils__","__WEBPACK_IMPORTED_MODULE_2__url_popover__","__WEBPACK_IMPORTED_MODULE_3__url_input__","ExternalLink","_wp$keycodes","keycodes","LEFT","RIGHT","UP","DOWN","BACKSPACE","ENTER","_wp$url","prependHTTP","safeDecodeURI","filterURLForDisplay","insert","isCollapsed","stopKeyPropagation","stopPropagation","LinkEditor","onKeyDown","submitLink","onKeyPress","LinkViewerUrl","prependedURL","linkClassName","has-invalid-link","isValidHref","LinkViewer","InlineAffiliateLinkUI","onClickOutside","resetState","keyCode","preventDefault","selectedText","format","toInsert","autocompleteElement","contains","_props2$activeAttribu","showInput","onClose","updateLinkId","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","ThirstyURLPopover","toggleSettingsVisibility","isSettingsExpanded","renderSettings","_props$position","_props$focusOnMount","popoverProps","showSettings","aria-expanded","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default","throttle","TAB","stopEventPropagation","updateSuggestions","previousIndex","nextIndex","selectionStart","setSelectionRange","focus","_props$value","_props$autoFocus","_state3","required","onInput","aria-autocomplete","aria-owns","aria-activedescendant","noArrow","elem","config","util","getWindow","allowHorizontalScroll","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","isWin","isWindow","elemOffset","offset","eh","outerHeight","ew","outerWidth","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","win","winScroll","ww","wh","scrollLeft","scrollTop","parseFloat","css","getClientPosition","box","x","y","doc","ownerDocument","docElem","documentElement","clientLeft","clientTop","getScroll","w","ret","document","getScrollLeft","getScrollTop","getOffset","el","pos","defaultView","parentWindow","_getComputedStyle","computedStyle_","val","computedStyle","getComputedStyle","getPropertyValue","_getComputedStyleIE","CURRENT_STYLE","_RE_NUM_NO_PX","RE_POS","rsLeft","RUNTIME_STYLE","pixelLeft","PX","each","fn","isBorderBoxFn","getComputedStyleX","swap","callback","old","getPBMWidth","which","prop","j","cssProp","getWH","extra","domUtils","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","offsetWidth","offsetHeight","isBorderBox","cssBoxValue","Number","BORDER_INDEX","CONTENT_INDEX","borderBoxValueOrIsBorderBox","padding","PADDING_INDEX","BOX_MODELS","getWHIgnoreDisplay","args","cssShow","v","_typeof","setOffset","RE_NUM","RegExp","refWin","max","documentElementProp","compatMode","visibility","display","first","charAt","toUpperCase","includeMargin","node","clone","overflow","scrollTo"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,EAASH,GEnEjC,GAAA2B,GAAAC;;;;;CAOA,WACA,YAIA,SAAAC,KAGA,OAFAC,MAEAzB,EAAA,EAAiBA,EAAA0B,UAAAC,OAAsB3B,IAAA,CACvC,GAAA4B,GAAAF,UAAA1B,EACA,IAAA4B,EAAA,CAEA,GAAAC,SAAAD,EAEA,eAAAC,GAAA,WAAAA,EACAJ,EAAAK,KAAAF,OACI,IAAAG,MAAAC,QAAAJ,MAAAD,OAAA,CACJ,GAAAM,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AAAnB,KACA4mB,EAAA5mB,GAAAwD,EAAAxD,GAIA,IADAwD,EAAA8nB,SAEA,OAAAtrB,KAAAwD,GACAA,EAAArC,eAAAnB,KACA4mB,EAAA0E,SAAAtrB,GAAAwD,EAAA8nB,SAAAtrB,GAIA,OAAA4mB,IAEAhB,WAAA,SAAAe,EAAA0D,GACA,GAAA1F,EAAAgC,GAAA,CACA,OAAApkB,KAAA8nB,EACA,MAAAvD,GAAAH,EAEA9O,QAAA0T,SAAAlB,EAAAtD,EAAAJ,QACK,CACL,OAAApkB,KAAA8nB,EACA,MAAA1D,GAAAf,UAEAe,GAAAf,WAAAyE,IAGAxE,UAAA,SAAAc,EAAA0D,GACA,GAAA1F,EAAAgC,GAAA,CACA,OAAApkB,KAAA8nB,EACA,MAAAtD,GAAAJ,EAEA9O,QAAA0T,SAAAzE,EAAAH,GAAA0D,OACK,CACL,OAAA9nB,KAAA8nB,EACA,MAAA1D,GAAAd,SAEAc,GAAAd,UAAAwE,IAIAnB,cAAA,EACAC,eAAA,GACCF,IlBgmGK,SAAUlpB,EAAQD","file":"gutenberg-support.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__blocks__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__formats__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__);\n\n\n\n\n\nObject(__WEBPACK_IMPORTED_MODULE_0__blocks__[\"a\" /* default */])();\nObject(__WEBPACK_IMPORTED_MODULE_1__formats__[\"a\" /* default */])();\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerBlocks;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_image__ = __webpack_require__(3);\n\n\nvar registerBlockType = wp.blocks.registerBlockType;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\n\nfunction registerBlocks() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_image__].forEach(function (block) {\n if (!block) return;\n\n var name = block.name,\n settings = block.settings;\n\n registerBlockType(name, settings);\n });\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"name\", function() { return name; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settings\", function() { return settings; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit__ = __webpack_require__(4);\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Fragment = wp.element.Fragment;\nvar __ = wp.i18n.__;\nvar _wp$blocks = wp.blocks,\n createBlock = _wp$blocks.createBlock,\n getBlockAttributes = _wp$blocks.getBlockAttributes,\n getPhrasingContentSchema = _wp$blocks.getPhrasingContentSchema;\nvar RichText = wp.editor.RichText;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\n\n\n\n\nvar name = 'ta/image';\n\nvar blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src'\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: ''\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption'\n\t},\n\tid: {\n\t\ttype: 'number'\n\t},\n\talign: {\n\t\ttype: 'string'\n\t},\n\twidth: {\n\t\ttype: 'number'\n\t},\n\theight: {\n\t\ttype: 'number'\n\t},\n\tlinkid: {\n\t\ttype: 'number'\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nvar imageSchema = {\n\timg: {\n\t\tattributes: ['src', 'alt'],\n\t\tclasses: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/]\n\t}\n};\n\nvar schema = {\n\tfigure: {\n\t\trequire: ['ta', 'img'],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: ['href', 'linkid'],\n\t\t\t\tchildren: imageSchema\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema()\n\t\t\t}\n\t\t}\n\t}\n};\n\nfunction getFirstAnchorAttributeFormHTML(html, attributeName) {\n\tvar _document$implementat = document.implementation.createHTMLDocument(''),\n\t body = _document$implementat.body;\n\n\tbody.innerHTML = html;\n\n\tvar firstElementChild = body.firstElementChild;\n\n\n\tif (firstElementChild && firstElementChild.nodeName === 'A') {\n\t\treturn firstElementChild.getAttribute(attributeName) || undefined;\n\t}\n}\n\nvar settings = {\n\ttitle: __('ThirstyAffiliates Image'),\n\n\tdescription: __('Insert an image with an affiliate link to make a visual statement.'),\n\n\ticon: wp.element.createElement(\n\t\tSVG,\n\t\t{ viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\" },\n\t\twp.element.createElement(Path, { d: \"M0,0h24v24H0V0z\", fill: \"none\" }),\n\t\twp.element.createElement(Path, { d: \"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" }),\n\t\twp.element.createElement(Path, { d: \"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" })\n\t),\n\n\tcategory: 'common',\n\n\tkeywords: ['img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t__('photo'), __('affiliate')],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align,\n\t\t width = attributes.width;\n\n\t\tif ('left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align) {\n\t\t\treturn { 'data-align': align, 'data-resized': !!width };\n\t\t}\n\t},\n\n\n\tedit: __WEBPACK_IMPORTED_MODULE_1__edit__[\"a\" /* default */],\n\n\tsave: function save(_ref) {\n\t\tvar _classnames;\n\n\t\tvar attributes = _ref.attributes;\n\t\tvar url = attributes.url,\n\t\t alt = attributes.alt,\n\t\t caption = attributes.caption,\n\t\t align = attributes.align,\n\t\t width = attributes.width,\n\t\t height = attributes.height,\n\t\t id = attributes.id,\n\t\t linkid = attributes.linkid,\n\t\t href = attributes.href;\n\n\n\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()((_classnames = {}, _defineProperty(_classnames, \"align\" + align, align), _defineProperty(_classnames, 'is-resized', width || height), _classnames));\n\n\t\tvar image = wp.element.createElement(\"img\", {\n\t\t\tsrc: url,\n\t\t\talt: alt,\n\t\t\tclassName: id ? \"wp-image-\" + id : null,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t});\n\n\t\tvar figure = wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\t\"ta\",\n\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\timage\n\t\t\t),\n\t\t\twp.element.createElement(RichText.Content, { tagName: \"figcaption\", value: caption })\n\t\t);\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ className: \"wp-block-image\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\tfigure\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn wp.element.createElement(\n\t\t\t\"figure\",\n\t\t\t{ className: \"wp-block-image \" + classes },\n\t\t\tfigure\n\t\t);\n\t}\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export pickRelevantMediaFiles */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_size__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__search_input__ = __webpack_require__(7);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar _lodash = lodash,\n get = _lodash.get,\n isEmpty = _lodash.isEmpty,\n map = _lodash.map,\n last = _lodash.last,\n pick = _lodash.pick,\n compact = _lodash.compact;\nvar getPath = wp.url.getPath;\nvar _wp$i18n = wp.i18n,\n __ = _wp$i18n.__,\n sprintf = _wp$i18n.sprintf;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment,\n createRef = _wp$element.createRef;\nvar _wp$blob = wp.blob,\n getBlobByURL = _wp$blob.getBlobByURL,\n revokeBlobURL = _wp$blob.revokeBlobURL,\n isBlobURL = _wp$blob.isBlobURL;\nvar _wp$components = wp.components,\n Placeholder = _wp$components.Placeholder,\n Button = _wp$components.Button,\n ButtonGroup = _wp$components.ButtonGroup,\n IconButton = _wp$components.IconButton,\n PanelBody = _wp$components.PanelBody,\n ResizableBox = _wp$components.ResizableBox,\n SelectControl = _wp$components.SelectControl,\n Spinner = _wp$components.Spinner,\n TextControl = _wp$components.TextControl,\n TextareaControl = _wp$components.TextareaControl,\n Toolbar = _wp$components.Toolbar,\n withNotices = _wp$components.withNotices,\n ToggleControl = _wp$components.ToggleControl,\n Popover = _wp$components.Popover;\nvar withSelect = wp.data.withSelect;\nvar _wp$editor = wp.editor,\n RichText = _wp$editor.RichText,\n BlockControls = _wp$editor.BlockControls,\n InspectorControls = _wp$editor.InspectorControls,\n MediaUpload = _wp$editor.MediaUpload,\n MediaUploadCheck = _wp$editor.MediaUploadCheck,\n MediaPlaceholder = _wp$editor.MediaPlaceholder,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n mediaUpload = _wp$editor.mediaUpload;\nvar withViewportMatch = wp.viewport.withViewportMatch;\nvar compose = wp.compose.compose;\n\n\n\n\n\n\n/**\n * Module constants\n */\nvar MIN_SIZE = 20;\nvar LINK_DESTINATION_NONE = 'none';\nvar LINK_DESTINATION_MEDIA = 'media';\nvar LINK_DESTINATION_ATTACHMENT = 'attachment';\nvar LINK_DESTINATION_CUSTOM = 'custom';\nvar NEW_TAB_REL = 'noreferrer noopener';\nvar ALLOWED_MEDIA_TYPES = ['image'];\n\nvar pickRelevantMediaFiles = function pickRelevantMediaFiles(image) {\n\tvar imageProps = pick(image, ['alt', 'id', 'link', 'caption']);\n\timageProps.url = get(image, ['sizes', 'large', 'url']) || get(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nvar isTemporaryImage = function isTemporaryImage(id, url) {\n\treturn !id && isBlobURL(url);\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nvar isExternalImage = function isExternalImage(id, url) {\n\treturn url && !id && !isBlobURL(url);\n};\n\nvar ImageEdit = function (_Component) {\n\t_inherits(ImageEdit, _Component);\n\n\tfunction ImageEdit(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\t_classCallCheck(this, ImageEdit);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageEdit.__proto__ || Object.getPrototypeOf(ImageEdit)).apply(this, arguments));\n\n\t\t_this.updateAlt = _this.updateAlt.bind(_this);\n\t\t_this.updateAlignment = _this.updateAlignment.bind(_this);\n\t\t_this.onFocusCaption = _this.onFocusCaption.bind(_this);\n\t\t_this.onImageClick = _this.onImageClick.bind(_this);\n\t\t_this.onSelectImage = _this.onSelectImage.bind(_this);\n\t\t_this.updateImageURL = _this.updateImageURL.bind(_this);\n\t\t_this.updateWidth = _this.updateWidth.bind(_this);\n\t\t_this.updateHeight = _this.updateHeight.bind(_this);\n\t\t_this.updateDimensions = _this.updateDimensions.bind(_this);\n\t\t_this.getFilename = _this.getFilename.bind(_this);\n\t\t_this.toggleIsEditing = _this.toggleIsEditing.bind(_this);\n\t\t_this.onImageError = _this.onImageError.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\t\t_this.updateImageSelection = _this.updateImageSelection.bind(_this);\n\t\t_this.onSelectAffiliateImage = _this.onSelectAffiliateImage.bind(_this);\n\t\t_this.editAFfiliateImage = _this.editAFfiliateImage.bind(_this);\n\n\t\t_this.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: !attributes.url,\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tshowSuggestions: false,\n\t\t\timageSelection: [],\n\t\t\taffiliateLink: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageEdit, [{\n\t\tkey: \"componentDidMount\",\n\t\tvalue: function componentDidMount() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t attributes = _props.attributes,\n\t\t\t setAttributes = _props.setAttributes,\n\t\t\t noticeOperations = _props.noticeOperations;\n\t\t\tvar id = attributes.id,\n\t\t\t _attributes$url = attributes.url,\n\t\t\t url = _attributes$url === undefined ? '' : _attributes$url;\n\n\n\t\t\tif (isTemporaryImage(id, url)) {\n\t\t\t\tvar file = getBlobByURL(url);\n\n\t\t\t\tif (file) {\n\t\t\t\t\tmediaUpload({\n\t\t\t\t\t\tfilesList: [file],\n\t\t\t\t\t\tonFileChange: function onFileChange(_ref2) {\n\t\t\t\t\t\t\tvar _ref3 = _slicedToArray(_ref2, 1),\n\t\t\t\t\t\t\t image = _ref3[0];\n\n\t\t\t\t\t\t\tsetAttributes(pickRelevantMediaFiles(image));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\t\tonError: function onError(message) {\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice(message);\n\t\t\t\t\t\t\t_this2.setState({ isEditing: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tvar _prevProps$attributes = prevProps.attributes,\n\t\t\t prevID = _prevProps$attributes.id,\n\t\t\t _prevProps$attributes2 = _prevProps$attributes.url,\n\t\t\t prevURL = _prevProps$attributes2 === undefined ? '' : _prevProps$attributes2;\n\t\t\tvar _props$attributes = this.props.attributes,\n\t\t\t id = _props$attributes.id,\n\t\t\t _props$attributes$url = _props$attributes.url,\n\t\t\t url = _props$attributes$url === undefined ? '' : _props$attributes$url;\n\n\n\t\t\tif (isTemporaryImage(prevID, prevURL) && !isTemporaryImage(id, url)) {\n\t\t\t\trevokeBlobURL(url);\n\t\t\t}\n\n\t\t\tif (!this.props.isSelected && prevProps.isSelected && this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onSelectImage\",\n\t\tvalue: function onSelectImage(media) {\n\n\t\t\tif (!media || !media.url) {\n\t\t\t\tthis.props.setAttributes({\n\t\t\t\t\turl: undefined,\n\t\t\t\t\talt: undefined,\n\t\t\t\t\tid: undefined,\n\t\t\t\t\tcaption: undefined\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar affiliateLink = this.state.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: false\n\t\t\t});\n\n\t\t\tthis.props.setAttributes(_extends({}, pickRelevantMediaFiles(media), {\n\t\t\t\tlinkid: affiliateLink.id,\n\t\t\t\thref: affiliateLink.link,\n\t\t\t\taffiliateLink: affiliateLink,\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onImageError\",\n\t\tvalue: function onImageError(url) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tvar embedBlock = Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"a\" /* createUpgradedEmbedBlock */])({ attributes: { url: url } });\n\t\t\tif (undefined !== embedBlock) {\n\t\t\t\tthis.props.onReplace(embedBlock);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onFocusCaption\",\n\t\tvalue: function onFocusCaption() {\n\t\t\tif (!this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onImageClick\",\n\t\tvalue: function onImageClick() {\n\t\t\tif (this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"updateAlt\",\n\t\tvalue: function updateAlt(newAlt) {\n\t\t\tthis.props.setAttributes({ alt: newAlt });\n\t\t}\n\t}, {\n\t\tkey: \"updateAlignment\",\n\t\tvalue: function updateAlignment(nextAlign) {\n\t\t\tvar extraUpdatedAttributes = ['wide', 'full'].indexOf(nextAlign) !== -1 ? { width: undefined, height: undefined } : {};\n\t\t\tthis.props.setAttributes(_extends({}, extraUpdatedAttributes, { align: nextAlign }));\n\t\t}\n\t}, {\n\t\tkey: \"updateImageURL\",\n\t\tvalue: function updateImageURL(url) {\n\t\t\tthis.props.setAttributes({ url: url, width: undefined, height: undefined });\n\t\t}\n\t}, {\n\t\tkey: \"updateWidth\",\n\t\tvalue: function updateWidth(width) {\n\t\t\tthis.props.setAttributes({ width: parseInt(width, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateHeight\",\n\t\tvalue: function updateHeight(height) {\n\t\t\tthis.props.setAttributes({ height: parseInt(height, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateDimensions\",\n\t\tvalue: function updateDimensions() {\n\t\t\tvar _this3 = this;\n\n\t\t\tvar width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\t\t\tvar height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\t\treturn function () {\n\t\t\t\t_this3.props.setAttributes({ width: width, height: height });\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"getFilename\",\n\t\tvalue: function getFilename(url) {\n\t\t\tvar path = getPath(url);\n\t\t\tif (path) {\n\t\t\t\treturn last(path.split('/'));\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"getLinkDestinationOptions\",\n\t\tvalue: function getLinkDestinationOptions() {\n\t\t\treturn [{ value: LINK_DESTINATION_NONE, label: __('None') }, { value: LINK_DESTINATION_MEDIA, label: __('Media File') }, { value: LINK_DESTINATION_ATTACHMENT, label: __('Attachment Page') }, { value: LINK_DESTINATION_CUSTOM, label: __('Custom URL') }];\n\t\t}\n\t}, {\n\t\tkey: \"toggleIsEditing\",\n\t\tvalue: function toggleIsEditing() {\n\t\t\tthis.setState({\n\t\t\t\tisEditing: !this.state.isEditing\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"getImageSizeOptions\",\n\t\tvalue: function getImageSizeOptions() {\n\t\t\tvar _props2 = this.props,\n\t\t\t imageSizes = _props2.imageSizes,\n\t\t\t image = _props2.image;\n\n\t\t\treturn compact(map(imageSizes, function (_ref4) {\n\t\t\t\tvar name = _ref4.name,\n\t\t\t\t slug = _ref4.slug;\n\n\t\t\t\tvar sizeUrl = get(image, ['media_details', 'sizes', slug, 'source_url']);\n\t\t\t\tif (!sizeUrl) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvalue: sizeUrl,\n\t\t\t\t\tlabel: name\n\t\t\t\t};\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onChangeInputValue\",\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\t}, {\n\t\tkey: \"resetInvalidLink\",\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\t}, {\n\t\tkey: \"updateImageSelection\",\n\t\tvalue: function updateImageSelection(imageSelection, affiliateLink) {\n\t\t\tthis.setState({\n\t\t\t\timageSelection: imageSelection,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"onSelectAffiliateImage\",\n\t\tvalue: function onSelectAffiliateImage(image) {\n\t\t\tvar _this4 = this;\n\n\t\t\tif (isExternalImage(image.id, image.src)) {\n\t\t\t\timage.url = image.src;\n\t\t\t\tthis.onSelectImage(image);\n\t\t\t} else {\n\t\t\t\tvar request = wp.apiFetch({\n\t\t\t\t\tpath: wp.url.addQueryArgs('wp/v2/media/' + image.id, {\n\t\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t\t_locale: 'user'\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\trequest.then(function (media) {\n\t\t\t\t\tmedia.url = media.source_url;\n\t\t\t\t\t_this4.onSelectImage(media);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"editAFfiliateImage\",\n\t\tvalue: function editAFfiliateImage() {\n\t\t\tvar attributes = this.props.attributes;\n\t\t\tvar affiliateLink = attributes.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: true,\n\t\t\t\timageSelection: affiliateLink.images,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t isEditing = _state.isEditing,\n\t\t\t imageSelection = _state.imageSelection,\n\t\t\t affiliateLink = _state.affiliateLink;\n\t\t\tvar _props3 = this.props,\n\t\t\t attributes = _props3.attributes,\n\t\t\t setAttributes = _props3.setAttributes,\n\t\t\t isLargeViewport = _props3.isLargeViewport,\n\t\t\t isSelected = _props3.isSelected,\n\t\t\t className = _props3.className,\n\t\t\t maxWidth = _props3.maxWidth,\n\t\t\t toggleSelection = _props3.toggleSelection,\n\t\t\t isRTL = _props3.isRTL;\n\t\t\tvar url = attributes.url,\n\t\t\t alt = attributes.alt,\n\t\t\t caption = attributes.caption,\n\t\t\t align = attributes.align,\n\t\t\t linkDestination = attributes.linkDestination,\n\t\t\t width = attributes.width,\n\t\t\t height = attributes.height,\n\t\t\t linkid = attributes.linkid,\n\t\t\t href = attributes.href;\n\n\t\t\tvar toolbarEditButton = wp.element.createElement(\n\t\t\t\tToolbar,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(IconButton, {\n\t\t\t\t\tclassName: \"ta-edit-image-button components-icon-button components-toolbar__control\",\n\t\t\t\t\tlabel: __('Edit ThirstyAffiliates Image'),\n\t\t\t\t\ticon: \"edit\",\n\t\t\t\t\tonClick: this.editAFfiliateImage\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tvar controls = wp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: this.updateAlignment\n\t\t\t\t}),\n\t\t\t\ttoolbarEditButton\n\t\t\t);\n\n\t\t\tif (isEditing) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\tcontrols,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPlaceholder,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: \"format-image\",\n\t\t\t\t\t\t\tlabel: __(\"ThirstyAffiliates Image\"),\n\t\t\t\t\t\t\tinstructions: __(\"Search for an affiliate link and select image to insert.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__search_input__[\"a\" /* default */], {\n\t\t\t\t\t\t\tupdateImageSelection: this.updateImageSelection\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!!imageSelection.length && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"ta-image-sel-wrap\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"h3\",\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\taffiliateLink.title + \" \" + __('attached images:')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"ta-image-selection\" },\n\t\t\t\t\t\t\t\timageSelection.map(function (image, index) {\n\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn _this5.onSelectAffiliateImage(image);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: image.src })\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()(className, {\n\t\t\t\t'wp-block-image': true,\n\t\t\t\t'is-transient': isBlobURL(url),\n\t\t\t\t'is-resized': !!width || !!height,\n\t\t\t\t'is-focused': isSelected\n\t\t\t});\n\n\t\t\tvar isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport;\n\t\t\tvar imageSizeOptions = this.getImageSizeOptions();\n\n\t\t\tvar getInspectorControls = function getInspectorControls(imageWidth, imageHeight) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tInspectorControls,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __('Image Settings') },\n\t\t\t\t\t\twp.element.createElement(TextareaControl, {\n\t\t\t\t\t\t\tlabel: __('Alt Text (Alternative Text)'),\n\t\t\t\t\t\t\tvalue: alt,\n\t\t\t\t\t\t\tonChange: _this5.updateAlt,\n\t\t\t\t\t\t\thelp: __('Alternative text describes your image to people who can’t see it. Add a short description with its key details.')\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!isEmpty(imageSizeOptions) && wp.element.createElement(SelectControl, {\n\t\t\t\t\t\t\tlabel: __('Image Size'),\n\t\t\t\t\t\t\tvalue: url,\n\t\t\t\t\t\t\toptions: imageSizeOptions,\n\t\t\t\t\t\t\tonChange: _this5.updateImageURL\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tisResizable && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"p\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\t__('Image Dimensions')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__width\",\n\t\t\t\t\t\t\t\t\tlabel: __('Width'),\n\t\t\t\t\t\t\t\t\tvalue: width !== undefined ? width : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageWidth,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateWidth\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__height\",\n\t\t\t\t\t\t\t\t\tlabel: __('Height'),\n\t\t\t\t\t\t\t\t\tvalue: height !== undefined ? height : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageHeight,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateHeight\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButtonGroup,\n\t\t\t\t\t\t\t\t\t{ \"aria-label\": __('Image Size') },\n\t\t\t\t\t\t\t\t\t[25, 50, 75, 100].map(function (scale) {\n\t\t\t\t\t\t\t\t\t\tvar scaledWidth = Math.round(imageWidth * (scale / 100));\n\t\t\t\t\t\t\t\t\t\tvar scaledHeight = Math.round(imageHeight * (scale / 100));\n\n\t\t\t\t\t\t\t\t\t\tvar isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tkey: scale,\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary: isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\t\"aria-pressed\": isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions(scaledWidth, scaledHeight)\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t\t\t\t\t\"%\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t__('Reset')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\tcontrols,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__image_size__[\"a\" /* default */],\n\t\t\t\t\t\t{ src: url, dirtynessTrigger: align },\n\t\t\t\t\t\tfunction (sizes) {\n\t\t\t\t\t\t\tvar imageWidthWithinContainer = sizes.imageWidthWithinContainer,\n\t\t\t\t\t\t\t imageHeightWithinContainer = sizes.imageHeightWithinContainer,\n\t\t\t\t\t\t\t imageWidth = sizes.imageWidth,\n\t\t\t\t\t\t\t imageHeight = sizes.imageHeight;\n\n\n\t\t\t\t\t\t\tvar filename = _this5.getFilename(url);\n\t\t\t\t\t\t\tvar defaultedAlt = void 0;\n\t\t\t\t\t\t\tif (alt) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if (filename) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf(__('This image has an empty alt attribute; its file name is %s'), filename);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __('This image has an empty alt attribute');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar img =\n\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"ta\",\n\t\t\t\t\t\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: url, alt: defaultedAlt, onClick: _this5.onImageClick, onError: function onError() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.onImageError(url);\n\t\t\t\t\t\t\t\t\t\t} })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tisBlobURL(url) && wp.element.createElement(Spinner, null)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\tif (!isResizable || !imageWidthWithinContainer) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t\t\t{ style: { width: width, height: height } },\n\t\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tvar currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tvar ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tvar minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tvar minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tvar maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tvar showRightHandle = false;\n\t\t\t\t\t\t\tvar showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif (align === 'center') {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if (isRTL) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif (align === 'left') {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif (align === 'right') {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tResizableBox,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tsize: width && height ? {\n\t\t\t\t\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\t\t\t\t\theight: height\n\t\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\t\tminWidth: minWidth,\n\t\t\t\t\t\t\t\t\t\tmaxWidth: maxWidthBuffer,\n\t\t\t\t\t\t\t\t\t\tminHeight: minHeight,\n\t\t\t\t\t\t\t\t\t\tmaxHeight: maxWidthBuffer / ratio,\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio: true,\n\t\t\t\t\t\t\t\t\t\tenable: {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStart: function onResizeStart() {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(false);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStop: function onResizeStop(event, direction, elt, delta) {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes({\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt(currentWidth + delta.width, 10),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt(currentHeight + delta.height, 10)\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t(!RichText.isEmpty(caption) || isSelected) && wp.element.createElement(RichText, {\n\t\t\t\t\t\ttagName: \"figcaption\",\n\t\t\t\t\t\tplaceholder: __('Write caption…'),\n\t\t\t\t\t\tvalue: caption,\n\t\t\t\t\t\tunstableOnFocus: this.onFocusCaption,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ caption: value });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisSelected: this.state.captionFocused,\n\t\t\t\t\t\tinlineToolbar: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t}\n\t}]);\n\n\treturn ImageEdit;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (compose([withSelect(function (select, props) {\n\tvar _select = select('core'),\n\t getMedia = _select.getMedia;\n\n\tvar _select2 = select('core/editor'),\n\t getEditorSettings = _select2.getEditorSettings;\n\n\tvar id = props.attributes.id;\n\n\tvar _getEditorSettings = getEditorSettings(),\n\t maxWidth = _getEditorSettings.maxWidth,\n\t isRTL = _getEditorSettings.isRTL,\n\t imageSizes = _getEditorSettings.imageSizes;\n\n\treturn {\n\t\timage: id ? getMedia(id) : null,\n\t\tmaxWidth: maxWidth,\n\t\tisRTL: isRTL,\n\t\timageSizes: imageSizes\n\t};\n}), withViewportMatch({ isLargeViewport: 'medium' }), withNotices])(ImageEdit));\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return createUpgradedEmbedBlock; });\n/* unused harmony export isFromWordPress */\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nvar _lodash = lodash,\n includes = _lodash.includes;\nvar renderToString = wp.element.renderToString;\nvar createBlock = wp.blocks.createBlock;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\n\nvar createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props, attributesFromPreview) {\n\tvar preview = props.preview,\n\t name = props.name;\n\tvar url = props.attributes.url;\n\n\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tvar matchingBlock = findBlock(url);\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif (WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif (name !== matchingBlock) {\n\t\t\treturn createBlock(matchingBlock, { url: url });\n\t\t}\n\t}\n\n\tif (preview) {\n\t\tvar html = preview.html;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\n\t\tif (isFromWordPress(html)) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif (WORDPRESS_EMBED_BLOCK !== name) {\n\t\t\t\treturn createBlock(WORDPRESS_EMBED_BLOCK, _extends({\n\t\t\t\t\turl: url\n\t\t\t\t}, attributesFromPreview));\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar isFromWordPress = function isFromWordPress(html) {\n\treturn includes(html, 'class=\"wp-embedded-content\" data-secret');\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _lodash = lodash,\n noop = _lodash.noop;\nvar withGlobalEvents = wp.compose.withGlobalEvents;\nvar Component = wp.element.Component;\n\nvar ImageSize = function (_Component) {\n\t_inherits(ImageSize, _Component);\n\n\tfunction ImageSize() {\n\t\t_classCallCheck(this, ImageSize);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageSize.__proto__ || Object.getPrototypeOf(ImageSize)).apply(this, arguments));\n\n\t\t_this.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined\n\t\t};\n\t\t_this.bindContainer = _this.bindContainer.bind(_this);\n\t\t_this.calculateSize = _this.calculateSize.bind(_this);\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageSize, [{\n\t\tkey: 'bindContainer',\n\t\tvalue: function bindContainer(ref) {\n\t\t\tthis.container = ref;\n\t\t}\n\t}, {\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tif (this.props.src !== prevProps.src) {\n\t\t\t\tthis.setState({\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined\n\t\t\t\t});\n\t\t\t\tthis.fetchImageSize();\n\t\t\t}\n\n\t\t\tif (this.props.dirtynessTrigger !== prevProps.dirtynessTrigger) {\n\t\t\t\tthis.calculateSize();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.fetchImageSize();\n\t\t}\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tif (this.image) {\n\t\t\t\tthis.image.onload = noop;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'fetchImageSize',\n\t\tvalue: function fetchImageSize() {\n\t\t\tthis.image = new window.Image();\n\t\t\tthis.image.onload = this.calculateSize;\n\t\t\tthis.image.src = this.props.src;\n\t\t}\n\t}, {\n\t\tkey: 'calculateSize',\n\t\tvalue: function calculateSize() {\n\t\t\tvar maxWidth = this.container.clientWidth;\n\t\t\tvar exceedMaxWidth = this.image.width > maxWidth;\n\t\t\tvar ratio = this.image.height / this.image.width;\n\t\t\tvar width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\t\tvar height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\t\tthis.setState({ width: width, height: height });\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar sizes = {\n\t\t\t\timageWidth: this.image && this.image.width,\n\t\t\t\timageHeight: this.image && this.image.height,\n\t\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\t\timageHeightWithinContainer: this.state.height\n\t\t\t};\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ ref: this.bindContainer },\n\t\t\t\tthis.props.children(sizes)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ImageSize;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withGlobalEvents({\n\tresize: 'calculateSize'\n})(ImageSize));\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover,\n TextControl = _wp$components.TextControl;\nvar withInstanceId = wp.compose.withInstanceId;\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.searchAffiliateLinks = _this.searchAffiliateLinks.bind(_this);\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\tscrollIntoView(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: \"componentWillUnmount\",\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: \"bindSuggestionNode\",\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"searchAffiliateLinks\",\n\t\tvalue: function searchAffiliateLinks(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters=\n\t\t\tif (value.length < 2) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\t\t\tformData.append(\"with_images\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"selectLink\",\n\t\tvalue: function selectLink(post) {\n\t\t\t// this.props.onChange( post.link, post );\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: post,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\n\t\t\tthis.props.updateImageSelection(post.images, post);\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"handleOnClick\",\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\t// this.inputRef.current.focus();\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId;\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t posts = _state2.posts,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t loading = _state2.loading;\n\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ \"class\": \"edit-search-affiliate-links\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"form\",\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: \"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\",\n\t\t\t\t\t\tonSubmit: this.displayAffiliateImages\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tclassName: \"ta-search-affiliate-links\",\n\t\t\t\t\t\tplaceholder: __(\"Type to search affiliate links\"),\n\t\t\t\t\t\tonChange: this.searchAffiliateLinks,\n\t\t\t\t\t\tautocomplete: \"off\"\n\t\t\t\t\t}),\n\t\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\t\tshowSuggestions && !!posts.length && wp.element.createElement(\n\t\t\t\t\t\tPopover,\n\t\t\t\t\t\t{ position: \"bottom\", focusOnMount: false },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ \"class\": \"affilate-links-suggestions\" },\n\t\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t\t\t\t\t\ttabIndex: \"-1\",\n\t\t\t\t\t\t\t\t\t\tid: \"editor-url-input-suggestion-\" + instanceId + \"-\" + index,\n\t\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"aria-selected\": index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerFormats;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_link__ = __webpack_require__(9);\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n\n\nvar registerFormatType = wp.richText.registerFormatType;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\n\nfunction registerFormats() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_link__[\"a\" /* taLink */]].forEach(function (_ref) {\n var name = _ref.name,\n settings = _objectWithoutProperties(_ref, [\"name\"]);\n\n return registerFormatType(name, settings);\n });\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return taLink; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inline__ = __webpack_require__(10);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSpokenMessages = wp.components.withSpokenMessages;\nvar _wp$richText = wp.richText,\n getTextContent = _wp$richText.getTextContent,\n applyFormat = _wp$richText.applyFormat,\n removeFormat = _wp$richText.removeFormat,\n slice = _wp$richText.slice;\nvar isURL = wp.url.isURL;\nvar _wp$editor = wp.editor,\n RichTextToolbarButton = _wp$editor.RichTextToolbarButton,\n RichTextShortcut = _wp$editor.RichTextShortcut;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\nvar getRectangleFromRange = wp.dom.getRectangleFromRange;\n\n\nvar name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nvar taLink = {\n\tname: name,\n\ttitle: __(\"Affiliate Link\"),\n\ttagName: \"ta\",\n\tclassName: null,\n\tattributes: {\n\t\turl: \"href\",\n\t\ttarget: \"target\"\n\t},\n\tedit: withSpokenMessages(function (_Component) {\n\t\t_inherits(LinkEdit, _Component);\n\n\t\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\t\tfunction LinkEdit() {\n\t\t\t_classCallCheck(this, LinkEdit);\n\n\t\t\tvar _this = _possibleConstructorReturn(this, (LinkEdit.__proto__ || Object.getPrototypeOf(LinkEdit)).apply(this, arguments));\n\n\t\t\t_this.addLink = _this.addLink.bind(_this);\n\t\t\t_this.stopAddingLink = _this.stopAddingLink.bind(_this);\n\t\t\t_this.onRemoveFormat = _this.onRemoveFormat.bind(_this);\n\t\t\t_this.state = {\n\t\t\t\taddingLink: false\n\t\t\t};\n\t\t\treturn _this;\n\t\t}\n\n\t\t/**\n * Callback to set state to adding link status.\n * \n * @since 3.6\n */\n\n\n\t\t_createClass(LinkEdit, [{\n\t\t\tkey: \"addLink\",\n\t\t\tvalue: function addLink() {\n\t\t\t\tvar _props = this.props,\n\t\t\t\t value = _props.value,\n\t\t\t\t onChange = _props.onChange;\n\n\t\t\t\tvar text = getTextContent(slice(value));\n\n\t\t\t\tif (text && isURL(text)) {\n\t\t\t\t\tonChange(applyFormat(value, { type: name, attributes: { url: text } }));\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState({ addingLink: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n * Callback to set state to stop adding link status.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"stopAddingLink\",\n\t\t\tvalue: function stopAddingLink() {\n\t\t\t\tthis.setState({ addingLink: false });\n\t\t\t}\n\n\t\t\t/**\n * Remove format event callback.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"onRemoveFormat\",\n\t\t\tvalue: function onRemoveFormat() {\n\t\t\t\tvar _props2 = this.props,\n\t\t\t\t value = _props2.value,\n\t\t\t\t onChange = _props2.onChange,\n\t\t\t\t speak = _props2.speak;\n\n\n\t\t\t\tonChange(removeFormat(value, name));\n\t\t\t\tspeak(__(\"Affiliate Link removed.\"), \"assertive\");\n\t\t\t}\n\n\t\t\t/**\n * Get selected anchor text.\n * \n * @since 3.9\n */\n\n\t\t}, {\n\t\t\tkey: \"getAnchorRect\",\n\t\t\tvalue: function getAnchorRect() {\n\n\t\t\t\tvar selection = window.getSelection();\n\t\t\t\tvar range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n\t\t\t\tif (!range) return;\n\n\t\t\t\tvar rect = null;\n\n\t\t\t\tif (this.state.addingLink) {\n\t\t\t\t\trect = getRectangleFromRange(range);\n\t\t\t\t} else {\n\n\t\t\t\t\tvar element = range.startContainer;\n\n\t\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\t\twhile (element.nodeType !== window.Node.ELEMENT_NODE) {\n\t\t\t\t\t\telement = element.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar closest = element.closest('ta');\n\t\t\t\t\tif (closest) {\n\t\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tvar _props3 = this.props,\n\t\t\t\t isActive = _props3.isActive,\n\t\t\t\t activeAttributes = _props3.activeAttributes,\n\t\t\t\t value = _props3.value,\n\t\t\t\t onChange = _props3.onChange;\n\n\n\t\t\t\tvar anchorRect = this.getAnchorRect();\n\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"access\",\n\t\t\t\t\t\tcharacter: \"s\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primary\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.addLink\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primaryShift\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\tisActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: \"editor-unlink\",\n\t\t\t\t\t\ttitle: __('Remove Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-unlink-button\",\n\t\t\t\t\t\tonClick: this.onRemoveFormat,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tshortcutType: \"primaryShift\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\t!isActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: wp.element.createElement(\n\t\t\t\t\t\t\tSVG,\n\t\t\t\t\t\t\t{ xmlns: \"http://www.w3.org/2000/svg\", width: \"16.688\", height: \"9.875\", viewBox: \"0 0 16.688 9.875\" },\n\t\t\t\t\t\t\twp.element.createElement(Path, { id: \"TA.svg\", fill: \"black\", \"class\": \"cls-1\", d: \"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\", transform: \"translate(-1.188 -5.25)\" })\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttitle: __('Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-link-button\",\n\t\t\t\t\t\tonClick: this.addLink,\n\t\t\t\t\t\tshortcutType: \"primary\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__inline__[\"a\" /* default */], {\n\t\t\t\t\t\taddingLink: this.state.addingLink,\n\t\t\t\t\t\tstopAddingLink: this.stopAddingLink,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tactiveAttributes: activeAttributes,\n\t\t\t\t\t\tanchorRect: anchorRect,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tonChange: onChange\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}]);\n\n\t\treturn LinkEdit;\n\t}(Component))\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(11);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_popover__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_input__ = __webpack_require__(13);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n ExternalLink = _wp$components.ExternalLink,\n ToggleControl = _wp$components.ToggleControl,\n IconButton = _wp$components.IconButton,\n withSpokenMessages = _wp$components.withSpokenMessages;\nvar _wp$keycodes = wp.keycodes,\n LEFT = _wp$keycodes.LEFT,\n RIGHT = _wp$keycodes.RIGHT,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n BACKSPACE = _wp$keycodes.BACKSPACE,\n ENTER = _wp$keycodes.ENTER;\nvar _wp$url = wp.url,\n prependHTTP = _wp$url.prependHTTP,\n safeDecodeURI = _wp$url.safeDecodeURI,\n filterURLForDisplay = _wp$url.filterURLForDisplay;\nvar _wp$richText = wp.richText,\n create = _wp$richText.create,\n insert = _wp$richText.insert,\n isCollapsed = _wp$richText.isCollapsed,\n applyFormat = _wp$richText.applyFormat,\n getTextContent = _wp$richText.getTextContent,\n slice = _wp$richText.slice;\n\n\nvar stopKeyPropagation = function stopKeyPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat(_ref) {\n\tvar url = _ref.url,\n\t linkid = _ref.linkid,\n\t text = _ref.text;\n\n\tvar format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl: url,\n\t\t\tlinkid: linkid.toString()\n\t\t}\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput(props, state) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nvar LinkEditor = function LinkEditor(_ref2) {\n\tvar value = _ref2.value,\n\t onChangeInputValue = _ref2.onChangeInputValue,\n\t onKeyDown = _ref2.onKeyDown,\n\t submitLink = _ref2.submitLink,\n\t invalidLink = _ref2.invalidLink,\n\t resetInvalidLink = _ref2.resetInvalidLink,\n\t autocompleteRef = _ref2.autocompleteRef;\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'form',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover',\n\t\t\t\tonKeyPress: stopKeyPropagation,\n\t\t\t\tonKeyDown: onKeyDown,\n\t\t\t\tonSubmit: submitLink\n\t\t\t},\n\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__url_input__[\"a\" /* default */], {\n\t\t\t\tvalue: value,\n\t\t\t\tonChange: onChangeInputValue,\n\t\t\t\tautocompleteRef: autocompleteRef,\n\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\tresetInvalidLink: resetInvalidLink\n\t\t\t}),\n\t\t\twp.element.createElement(IconButton, { icon: 'editor-break', label: __('Apply'), type: 'submit' })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\n\t);\n};\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewerUrl = function LinkViewerUrl(_ref3) {\n\tvar url = _ref3.url;\n\n\tvar prependedURL = prependHTTP(url);\n\tvar linkClassName = __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': !Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(prependedURL)\n\t});\n\n\tif (!url) {\n\t\treturn wp.element.createElement('span', { className: linkClassName });\n\t}\n\n\treturn wp.element.createElement(\n\t\tExternalLink,\n\t\t{\n\t\t\tclassName: linkClassName,\n\t\t\thref: url\n\t\t},\n\t\tfilterURLForDisplay(safeDecodeURI(url))\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewer = function LinkViewer(_ref4) {\n\tvar url = _ref4.url,\n\t editLink = _ref4.editLink;\n\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'div',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content',\n\t\t\t\tonKeyPress: stopKeyPropagation\n\t\t\t},\n\t\t\twp.element.createElement(LinkViewerUrl, { url: url }),\n\t\t\twp.element.createElement(IconButton, { icon: 'edit', label: __('Edit'), onClick: editLink })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\n\nvar InlineAffiliateLinkUI = function (_Component) {\n\t_inherits(InlineAffiliateLinkUI, _Component);\n\n\tfunction InlineAffiliateLinkUI() {\n\t\t_classCallCheck(this, InlineAffiliateLinkUI);\n\n\t\tvar _this = _possibleConstructorReturn(this, (InlineAffiliateLinkUI.__proto__ || Object.getPrototypeOf(InlineAffiliateLinkUI)).apply(this, arguments));\n\n\t\t_this.editLink = _this.editLink.bind(_this);\n\t\t_this.submitLink = _this.submitLink.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.onClickOutside = _this.onClickOutside.bind(_this);\n\t\t_this.resetState = _this.resetState.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\n\t\t_this.state = {\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tinvalidLink: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n * \n * @since 3.6\n * \n * @param {Object} event Event object.\n */\n\n\n\t_createClass(InlineAffiliateLinkUI, [{\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tif ([LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER].indexOf(event.keyCode) > -1) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to set state when input value is changed.\n * \n * @since 3.6\n * \n * @param {*} inputValue \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'onChangeInputValue',\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\n\t\t/**\n * Callback to set state when edit affiliate link (already inserted) is triggered.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'editLink',\n\t\tvalue: function editLink(event) {\n\t\t\tthis.setState({ editLink: true });\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n * Callback to apply the affiliate link format to the selected text or position in the active block.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'submitLink',\n\t\tvalue: function submitLink(event) {\n\t\t\tvar _props = this.props,\n\t\t\t isActive = _props.isActive,\n\t\t\t value = _props.value,\n\t\t\t onChange = _props.onChange,\n\t\t\t speak = _props.speak;\n\t\t\tvar _state = this.state,\n\t\t\t inputValue = _state.inputValue,\n\t\t\t linkid = _state.linkid,\n\t\t\t post = _state.post;\n\n\t\t\tvar url = prependHTTP(inputValue);\n\t\t\tvar selectedText = getTextContent(slice(value));\n\t\t\tvar format = createLinkFormat({\n\t\t\t\turl: url,\n\t\t\t\tlinkid: linkid,\n\t\t\t\ttext: selectedText\n\t\t\t});\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif (!linkid || !post) {\n\t\t\t\tthis.setState({ invalidLink: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCollapsed(value) && !isActive) {\n\t\t\t\tvar toInsert = applyFormat(create({ text: post.title }), format, 0, url.length);\n\t\t\t\tonChange(insert(value, toInsert));\n\t\t\t} else {\n\t\t\t\tonChange(applyFormat(value, format));\n\t\t\t}\n\n\t\t\tthis.resetState();\n\n\t\t\tif (!Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(url)) {\n\t\t\t\tspeak(__('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');\n\t\t\t} else if (isActive) {\n\t\t\t\tspeak(__('Link edited.'), 'assertive');\n\t\t\t} else {\n\t\t\t\tspeak(__('Link inserted'), 'assertive');\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to run when users clicks outside the popover UI.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onClickOutside',\n\t\tvalue: function onClickOutside(event) {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tvar autocompleteElement = this.autocompleteRef.current;\n\t\t\tif (autocompleteElement && autocompleteElement.contains(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.resetState();\n\t\t}\n\n\t\t/**\n * Reset state callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetState',\n\t\tvalue: function resetState() {\n\t\t\tthis.props.stopAddingLink();\n\t\t\tthis.setState({ inputValue: '', editLink: false });\n\t\t\tthis.resetInvalidLink();\n\t\t}\n\n\t\t/**\n * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetInvalidLink',\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\n\t\t/**\n * Component render method.\n *\n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props2 = this.props,\n\t\t\t isActive = _props2.isActive,\n\t\t\t _props2$activeAttribu = _props2.activeAttributes,\n\t\t\t url = _props2$activeAttribu.url,\n\t\t\t linkid = _props2$activeAttribu.linkid,\n\t\t\t addingLink = _props2.addingLink,\n\t\t\t anchorRect = _props2.anchorRect,\n\t\t\t value = _props2.value,\n\t\t\t onChange = _props2.onChange;\n\n\n\t\t\tif (!isActive && !addingLink) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar _state2 = this.state,\n\t\t\t inputValue = _state2.inputValue,\n\t\t\t invalidLink = _state2.invalidLink;\n\n\t\t\tvar showInput = isShowingInput(this.props, this.state);\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__url_popover__[\"a\" /* default */],\n\t\t\t\t{\n\t\t\t\t\tonClickOutside: this.onClickOutside,\n\t\t\t\t\tonClose: this.resetState,\n\t\t\t\t\tfocusOnMount: showInput ? 'firstElement' : false,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tanchorRect: anchorRect\n\t\t\t\t},\n\t\t\t\tshowInput ? wp.element.createElement(LinkEditor, {\n\t\t\t\t\tvalue: inputValue,\n\t\t\t\t\tonChangeInputValue: this.onChangeInputValue,\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\tsubmitLink: this.submitLink,\n\t\t\t\t\tautocompleteRef: this.autocompleteRef,\n\t\t\t\t\tupdateLinkId: this.updateLinkId,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tresetInvalidLink: this.resetInvalidLink\n\t\t\t\t}) : wp.element.createElement(LinkViewer, {\n\t\t\t\t\turl: url,\n\t\t\t\t\teditLink: this.editLink\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn InlineAffiliateLinkUI;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(InlineAffiliateLinkUI));\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isValidHref;\nvar _lodash = lodash,\n startsWith = _lodash.startsWith;\nvar _wp$url = wp.url,\n getProtocol = _wp$url.getProtocol,\n isValidProtocol = _wp$url.isValidProtocol,\n getAuthority = _wp$url.getAuthority,\n isValidAuthority = _wp$url.isValidAuthority,\n getPath = _wp$url.getPath,\n isValidPath = _wp$url.isValidPath,\n getQueryString = _wp$url.getQueryString,\n isValidQueryString = _wp$url.isValidQueryString,\n getFragment = _wp$url.getFragment,\n isValidFragment = _wp$url.isValidFragment;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\n\nfunction isValidHref(href) {\n\tif (!href) {\n\t\treturn false;\n\t}\n\n\tvar trimmedHref = href.trim();\n\n\tif (!trimmedHref) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif (/^\\S+:/.test(trimmedHref)) {\n\t\tvar protocol = getProtocol(trimmedHref);\n\t\tif (!isValidProtocol(protocol)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif (startsWith(protocol, 'http') && !/^https?:\\/\\/[^\\/\\s]/i.test(trimmedHref)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar authority = getAuthority(trimmedHref);\n\t\tif (!isValidAuthority(authority)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar path = getPath(trimmedHref);\n\t\tif (path && !isValidPath(path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar queryString = getQueryString(trimmedHref);\n\t\tif (queryString && !isValidQueryString(queryString)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar fragment = getFragment(trimmedHref);\n\t\tif (fragment && !isValidFragment(fragment)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif (startsWith(trimmedHref, '#') && !isValidFragment(trimmedHref)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _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; }; }();\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar __ = wp.i18n.__;\nvar Component = wp.element.Component;\nvar _wp$components = wp.components,\n Popover = _wp$components.Popover,\n IconButton = _wp$components.IconButton;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLPopover = function (_Component) {\n\t_inherits(ThirstyURLPopover, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tfunction ThirstyURLPopover() {\n\t\t_classCallCheck(this, ThirstyURLPopover);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLPopover.__proto__ || Object.getPrototypeOf(ThirstyURLPopover)).apply(this, arguments));\n\n\t\t_this.toggleSettingsVisibility = _this.toggleSettingsVisibility.bind(_this);\n\n\t\t_this.state = {\n\t\t\tisSettingsExpanded: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLPopover, [{\n\t\tkey: 'toggleSettingsVisibility',\n\t\tvalue: function toggleSettingsVisibility() {\n\t\t\tthis.setState({\n\t\t\t\tisSettingsExpanded: !this.state.isSettingsExpanded\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props = this.props,\n\t\t\t children = _props.children,\n\t\t\t renderSettings = _props.renderSettings,\n\t\t\t invalidLink = _props.invalidLink,\n\t\t\t _props$position = _props.position,\n\t\t\t position = _props$position === undefined ? 'bottom center' : _props$position,\n\t\t\t _props$focusOnMount = _props.focusOnMount,\n\t\t\t focusOnMount = _props$focusOnMount === undefined ? 'firstElement' : _props$focusOnMount,\n\t\t\t popoverProps = _objectWithoutProperties(_props, ['children', 'renderSettings', 'invalidLink', 'position', 'focusOnMount']);\n\n\t\t\tvar isSettingsExpanded = this.state.isSettingsExpanded;\n\n\n\t\t\tvar showSettings = !!renderSettings && isSettingsExpanded;\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\tPopover,\n\t\t\t\t_extends({\n\t\t\t\t\tclassName: 'ta-url-popover editor-url-popover block-editor-url-popover',\n\t\t\t\t\tfocusOnMount: focusOnMount,\n\t\t\t\t\tposition: position\n\t\t\t\t}, popoverProps),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row' },\n\t\t\t\t\tchildren,\n\t\t\t\t\t!!renderSettings && wp.element.createElement(IconButton, {\n\t\t\t\t\t\tclassName: 'editor-url-popover__settings-toggle',\n\t\t\t\t\t\ticon: 'ellipsis',\n\t\t\t\t\t\tlabel: __('Link Settings'),\n\t\t\t\t\t\tonClick: this.toggleSettingsVisibility,\n\t\t\t\t\t\t'aria-expanded': isSettingsExpanded\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tshowSettings && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row editor-url-popover__settings' },\n\t\t\t\t\trenderSettings()\n\t\t\t\t),\n\t\t\t\tinvalidLink && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ 'class': 'ta-invalid-link' },\n\t\t\t\t\t__('Invalid affiliate link')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLPopover;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (ThirstyURLPopover);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar __ = wp.i18n.__;\nvar _lodash = lodash,\n throttle = _lodash.throttle;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$keycodes = wp.keycodes,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n ENTER = _wp$keycodes.ENTER,\n TAB = _wp$keycodes.TAB;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover;\nvar withInstanceId = wp.compose.withInstanceId;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\n\nvar stopEventPropagation = function stopEventPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.onChange = _this.onChange.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.updateSuggestions = throttle(_this.updateSuggestions.bind(_this), 200);\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: 'bindSuggestionNode',\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\n\t\t/**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\n\t}, {\n\t\tkey: 'updateSuggestions',\n\t\tvalue: function updateSuggestions(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters\n\t\t\t// and also for URLs\n\t\t\tif (value.length < 2 || /^https?:/.test(value)) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onChange',\n\t\tvalue: function onChange(event) {\n\t\t\tthis.props.resetInvalidLink();\n\t\t\tvar inputValue = event.target.value;\n\t\t\tthis.props.onChange(inputValue);\n\t\t\tthis.updateSuggestions(inputValue);\n\t\t}\n\n\t\t/**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t posts = _state2.posts,\n\t\t\t loading = _state2.loading;\n\t\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\n\t\t\tif (!showSuggestions || !posts.length || loading) {\n\t\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\t\tswitch (event.keyCode) {\n\t\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t\t// position.\n\t\t\t\t\tcase UP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (0 !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t\t// last position.\n\t\t\t\t\tcase DOWN:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.props.value.length !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(this.props.value.length, this.props.value.length);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar post = this.state.posts[this.state.selectedSuggestion];\n\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase UP:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar previousIndex = !selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: previousIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar nextIndex = selectedSuggestion === null || selectedSuggestion === posts.length - 1 ? 0 : selectedSuggestion + 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: nextIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase TAB:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\t\t\tthis.props.speak(__('Link selected'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase ENTER:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'selectLink',\n\t\tvalue: function selectLink(post) {\n\t\t\tthis.props.onChange(post.link, post);\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'handleOnClick',\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\tthis.inputRef.current.focus();\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId,\n\t\t\t invalidLink = _props.invalidLink;\n\t\t\tvar _state3 = this.state,\n\t\t\t showSuggestions = _state3.showSuggestions,\n\t\t\t posts = _state3.posts,\n\t\t\t selectedSuggestion = _state3.selectedSuggestion,\n\t\t\t loading = _state3.loading;\n\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: 'editor-url-input block-editor-url-input' },\n\t\t\t\twp.element.createElement('input', {\n\t\t\t\t\tautoFocus: autoFocus,\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\t'aria-label': __('URL'),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tonChange: this.onChange,\n\t\t\t\t\tonInput: stopEventPropagation,\n\t\t\t\t\tplaceholder: __('Paste URL or type to search'),\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\trole: 'combobox',\n\t\t\t\t\t'aria-expanded': showSuggestions,\n\t\t\t\t\t'aria-autocomplete': 'list',\n\t\t\t\t\t'aria-owns': 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t'aria-activedescendant': selectedSuggestion !== null ? 'editor-url-input-suggestion-' + instanceId + '-' + selectedSuggestion : undefined,\n\t\t\t\t\tref: this.inputRef\n\t\t\t\t}),\n\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\tshowSuggestions && !!posts.length && !invalidLink && wp.element.createElement(\n\t\t\t\t\tPopover,\n\t\t\t\t\t{ position: 'bottom', noArrow: true, focusOnMount: false },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclassName: 'editor-url-input__suggestions block-editor-url-input__suggestions',\n\t\t\t\t\t\t\tid: 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t\t\tref: this.autocompleteRef,\n\t\t\t\t\t\t\trole: 'listbox'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\trole: 'option',\n\t\t\t\t\t\t\t\t\ttabIndex: '-1',\n\t\t\t\t\t\t\t\t\tid: 'block-editor-url-input-suggestion-' + instanceId + '-' + index,\n\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'aria-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(15);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar util = __webpack_require__(16);\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// gutenberg-support.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b9e91726b748eacc734c","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classnames/index.js\n// module id = 0\n// module chunks = 0","import registerBlocks from \"./blocks\";\nimport registerFormats from \"./formats\";\n\nimport \"./assets/styles/index.scss\";\n\nregisterBlocks();\nregisterFormats();\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import * as taimage from \"./ta-image\";\n\nconst { registerBlockType } = wp.blocks;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\nexport default function registerBlocks() {\n\n [\n taimage\n ].forEach( ( block ) => {\n if ( ! block ) return;\n\n const { name , settings } = block;\n registerBlockType( name , settings );\n } );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/index.js","import classnames from \"classnames\";\n\nconst { Fragment } = wp.element;\nconst { __ } = wp.i18n;\nconst { createBlock, getBlockAttributes, getPhrasingContentSchema } = wp.blocks;\nconst { RichText } = wp.editor;\nconst { Path , SVG } = wp.components;\n\nimport edit from \"./edit\";\n\nexport const name = 'ta/image';\n\nconst blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src',\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: '',\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption',\n\t},\n\tid: {\n\t\ttype: 'number',\n\t},\n\talign: {\n\t\ttype: 'string',\n\t},\n\twidth: {\n\t\ttype: 'number',\n\t},\n\theight: {\n\t\ttype: 'number',\n\t},\n\tlinkid: {\n\t\ttype: 'number',\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt' ],\n\t\tclasses: [ 'alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/ ],\n\t},\n};\n\nconst schema = {\n\tfigure: {\n\t\trequire: [ 'ta' , 'img' ],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: [ 'href', 'linkid' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema(),\n\t\t\t},\n\t\t},\n\t},\n};\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif (\n\t\tfirstElementChild &&\n\t\tfirstElementChild.nodeName === 'A'\n\t) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nexport const settings = {\n\ttitle: __( 'ThirstyAffiliates Image' ),\n\n\tdescription: __( 'Insert an image with an affiliate link to make a visual statement.' ),\n\n\ticon: <SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><Path d=\"M0,0h24v24H0V0z\" fill=\"none\" /><Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" /><Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" /></SVG>,\n\n\tcategory: 'common',\n\n\tkeywords: [\n\t\t'img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t\t__( 'photo' ),\n\t\t__( 'affiliate' )\n\t],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps( attributes ) {\n\t\tconst { align, width } = attributes;\n\t\tif ( 'left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align ) {\n\t\t\treturn { 'data-align': align, 'data-resized': !! width };\n\t\t}\n\t},\n\n\tedit,\n\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tid,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\n\t\tconst classes = classnames( {\n\t\t\t[ `align${ align }` ]: align,\n\t\t\t'is-resized': width || height,\n\t\t} );\n\n\t\tconst image = (\n\t\t\t<img\n\t\t\t\tsrc={ url }\n\t\t\t\talt={ alt }\n\t\t\t\tclassName={ id ? `wp-image-${ id }` : null }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t/>\n\t\t);\n\n\t\tconst figure = (\n\t\t\t<Fragment>\n\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t{ image }\n\t\t\t\t</ta>\n\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t</Fragment>\n\t\t);\n\n\t\tif ( 'left' === align || 'right' === align || 'center' === align ) {\n\t\t\treturn (\n\t\t\t\t<div className='wp-block-image'>\n\t\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t\t{ figure }\n\t\t\t\t\t</figure>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<figure className={ `wp-block-image ${classes}` }>\n\t\t\t\t{ figure }\n\t\t\t</figure>\n\t\t);\n\t}\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/index.js","import classnames from \"classnames\";\n\nconst { get , isEmpty , map , last , pick , compact } = lodash;\nconst { getPath } = wp.url;\nconst { __, sprintf } = wp.i18n;\nconst { Component, Fragment , createRef } = wp.element;\nconst { getBlobByURL, revokeBlobURL, isBlobURL } = wp.blob;\nconst { Placeholder , Button , ButtonGroup , IconButton , PanelBody , ResizableBox , SelectControl , Spinner , TextControl , TextareaControl , Toolbar , withNotices , ToggleControl , Popover } = wp.components;\nconst { withSelect } = wp.data;\nconst { RichText , BlockControls , InspectorControls , MediaUpload , MediaUploadCheck , MediaPlaceholder , BlockAlignmentToolbar , mediaUpload } = wp.editor;\nconst { withViewportMatch } = wp.viewport;\nconst { compose } = wp.compose;\n\nimport { createUpgradedEmbedBlock } from \"./util\";\nimport ImageSize from \"./image-size\";\nimport ThirstyURLInput from './search-input';\n\n/**\n * Module constants\n */\nconst MIN_SIZE = 20;\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst NEW_TAB_REL = 'noreferrer noopener';\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nexport const pickRelevantMediaFiles = ( image ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url = get( image, [ 'sizes', 'large', 'url' ] ) || get( image, [ 'media_details', 'sizes', 'large', 'source_url' ] ) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nconst isTemporaryImage = ( id, url ) => ! id && isBlobURL( url );\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nconst isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\nclass ImageEdit extends Component {\n\tconstructor( { attributes } ) {\n\t\tsuper( ...arguments );\n\t\tthis.updateAlt = this.updateAlt.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.onImageClick = this.onImageClick.bind( this );\n\t\tthis.onSelectImage = this.onSelectImage.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.updateWidth = this.updateWidth.bind( this );\n\t\tthis.updateHeight = this.updateHeight.bind( this );\n\t\tthis.updateDimensions = this.updateDimensions.bind( this );\n\t\tthis.getFilename = this.getFilename.bind( this );\n\t\tthis.toggleIsEditing = this.toggleIsEditing.bind( this );\n\t\tthis.onImageError = this.onImageError.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\t\tthis.updateImageSelection = this.updateImageSelection.bind( this );\n\t\tthis.onSelectAffiliateImage = this.onSelectAffiliateImage.bind( this );\n\t\tthis.editAFfiliateImage = this.editAFfiliateImage.bind( this );\n\n\t\tthis.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: ! attributes.url,\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tshowSuggestions : false,\n\t\t\timageSelection : [],\n\t\t\taffiliateLink : null\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes, noticeOperations } = this.props;\n\t\tconst { id, url = '' } = attributes;\n\n\t\tif ( isTemporaryImage( id, url ) ) {\n\t\t\tconst file = getBlobByURL( url );\n\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ image ] ) => {\n\t\t\t\t\t\tsetAttributes( pickRelevantMediaFiles( image ) );\n\t\t\t\t\t},\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\tonError: ( message ) => {\n\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\tthis.setState( { isEditing: true } );\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { id: prevID, url: prevURL = '' } = prevProps.attributes;\n\t\tconst { id, url = '' } = this.props.attributes;\n\n\t\tif ( isTemporaryImage( prevID, prevURL ) && ! isTemporaryImage( id, url ) ) {\n\t\t\trevokeBlobURL( url );\n\t\t}\n\n\t\tif ( ! this.props.isSelected && prevProps.isSelected && this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSelectImage( media ) {\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tthis.props.setAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { affiliateLink } = this.state;\n\n\t\tthis.setState( {\n\t\t\tisEditing: false,\n\t\t} );\n\n\t\tthis.props.setAttributes( {\n\t\t\t...pickRelevantMediaFiles( media ),\n\t\t\tlinkid: affiliateLink.id,\n\t\t\thref: affiliateLink.link,\n\t\t\taffiliateLink : affiliateLink,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tonImageError( url ) {\n\t\t// Check if there's an embed block that handles this URL.\n\t\tconst embedBlock = createUpgradedEmbedBlock(\n\t\t\t{ attributes: { url } }\n\t\t);\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tthis.props.onReplace( embedBlock );\n\t\t}\n\t}\n\n\tonFocusCaption() {\n\t\tif ( ! this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonImageClick() {\n\t\tif ( this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tupdateAlt( newAlt ) {\n\t\tthis.props.setAttributes( { alt: newAlt } );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = [ 'wide', 'full' ].indexOf( nextAlign ) !== -1 ?\n\t\t\t{ width: undefined, height: undefined } :\n\t\t\t{};\n\t\tthis.props.setAttributes( { ...extraUpdatedAttributes, align: nextAlign } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( { url, width: undefined, height: undefined } );\n\t}\n\n\tupdateWidth( width ) {\n\t\tthis.props.setAttributes( { width: parseInt( width, 10 ) } );\n\t}\n\n\tupdateHeight( height ) {\n\t\tthis.props.setAttributes( { height: parseInt( height, 10 ) } );\n\t}\n\n\tupdateDimensions( width = undefined, height = undefined ) {\n\t\treturn () => {\n\t\t\tthis.props.setAttributes( { width, height } );\n\t\t};\n\t}\n\n\tgetFilename( url ) {\n\t\tconst path = getPath( url );\n\t\tif ( path ) {\n\t\t\treturn last( path.split( '/' ) );\n\t\t}\n\t}\n\n\tgetLinkDestinationOptions() {\n\t\treturn [\n\t\t\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n\t\t\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t\t\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t\t\t{ value: LINK_DESTINATION_CUSTOM, label: __( 'Custom URL' ) },\n\t\t];\n\t}\n\n\ttoggleIsEditing() {\n\t\tthis.setState( {\n\t\t\tisEditing: ! this.state.isEditing,\n\t\t} );\n\t}\n\n\tgetImageSizeOptions() {\n\t\tconst { imageSizes, image } = this.props;\n\t\treturn compact( map( imageSizes, ( { name, slug } ) => {\n\t\t\tconst sizeUrl = get( image, [ 'media_details', 'sizes', slug, 'source_url' ] );\n\t\t\tif ( ! sizeUrl ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: sizeUrl,\n\t\t\t\tlabel: name,\n\t\t\t};\n\t\t} ) );\n\t}\n\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\tupdateImageSelection( imageSelection , affiliateLink ) {\n\t\tthis.setState({\n\t\t\timageSelection,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\tonSelectAffiliateImage( image ) {\n\n\t if ( isExternalImage( image.id, image.src ) ) {\n image.url = image.src;\n\t this.onSelectImage( image );\n } else {\n const request = wp.apiFetch( {\n path: wp.url.addQueryArgs( 'wp/v2/media/' + image.id , {\n context: 'edit',\n _locale: 'user'\n } ),\n } );\n\n request.then( (media) => {\n media.url = media.source_url;\n this.onSelectImage( media );\n } );\n }\n\t}\n\n\teditAFfiliateImage() {\n\n\t\tconst { attributes } = this.props;\n\t\tconst { affiliateLink } = attributes;\n\n\t\tthis.setState({\n\t\t\tisEditing : true,\n\t\t\timageSelection : affiliateLink.images,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tisEditing,\n\t\t\timageSelection,\n\t\t\taffiliateLink,\n\t\t} = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tsetAttributes,\n\t\t\tisLargeViewport,\n\t\t\tisSelected,\n\t\t\tclassName,\n\t\t\tmaxWidth,\n\t\t\ttoggleSelection,\n\t\t\tisRTL,\n\t\t} = this.props;\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\tlinkDestination,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\t\tconst toolbarEditButton = (\n\t\t\t<Toolbar>\n\t\t\t\t<IconButton\n\t\t\t\t\tclassName=\"ta-edit-image-button components-icon-button components-toolbar__control\"\n\t\t\t\t\tlabel={ __( 'Edit ThirstyAffiliates Image' ) }\n\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\tonClick={ this.editAFfiliateImage }\n\t\t\t\t/>\n\t\t\t</Toolbar>\n\t\t);\n\n\t\tconst controls = (\n\t\t\t<BlockControls>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t\t{ toolbarEditButton }\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tif ( isEditing ) {\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t{ controls }\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ \"format-image\" }\n\t\t\t\t\t\tlabel={ __( \"ThirstyAffiliates Image\" ) }\n\t\t\t\t\t\tinstructions={ __( \"Search for an affiliate link and select image to insert.\" ) }\n\t\t\t\t\t>\n\n\t\t\t\t\t\t<ThirstyURLInput\n\t\t\t\t\t\t\tupdateImageSelection={ this.updateImageSelection }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ !! imageSelection.length &&\n\t\t\t\t\t\t\t<div className=\"ta-image-sel-wrap\">\n\t\t\t\t\t\t\t\t<h3>{ `${affiliateLink.title} ${ __( 'attached images:' ) }` }</h3>\n\t\t\t\t\t\t\t\t<div className=\"ta-image-selection\">\n\t\t\t\t\t\t\t\t\t{ imageSelection.map( ( image , index ) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => this.onSelectAffiliateImage( image ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<img src={ image.src } />\n\t\t\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t</Placeholder>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n\n\t\tconst classes = classnames( className, {\n\t\t\t'wp-block-image' : true,\n\t\t\t'is-transient': isBlobURL( url ),\n\t\t\t'is-resized': !! width || !! height,\n\t\t\t'is-focused': isSelected,\n\t\t} );\n\n\t\tconst isResizable = [ 'wide', 'full' ].indexOf( align ) === -1 && isLargeViewport;\n\t\tconst imageSizeOptions = this.getImageSizeOptions();\n\n\t\tconst getInspectorControls = ( imageWidth, imageHeight ) => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image Settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alt Text (Alternative Text)' ) }\n\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\tonChange={ this.updateAlt }\n\t\t\t\t\t\thelp={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty( imageSizeOptions ) && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image Size' ) }\n\t\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ this.updateImageURL }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && (\n\t\t\t\t\t\t<div className=\"block-library-image__dimensions\">\n\t\t\t\t\t\t\t<p className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t{ __( 'Image Dimensions' ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__width\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\t\tvalue={ width !== undefined ? width : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageWidth }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateWidth }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__height\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\t\t\tvalue={ height !== undefined ? height : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageHeight }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<ButtonGroup aria-label={ __( 'Image Size' ) }>\n\t\t\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( scale ) => {\n\t\t\t\t\t\t\t\t\t\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\t\t\t\t\t\t\t\t\t\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\t\t\t\t\t\t\t\t\t\tconst isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions( scaledWidth, scaledHeight ) }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ scale }%\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions() }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{ controls }\n\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t<ImageSize src={ url } dirtynessTrigger={ align }>\n\t\t\t\t\t\t{ ( sizes ) => {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\timageWidthWithinContainer,\n\t\t\t\t\t\t\t\timageHeightWithinContainer,\n\t\t\t\t\t\t\t\timageWidth,\n\t\t\t\t\t\t\t\timageHeight,\n\t\t\t\t\t\t\t} = sizes;\n\n\t\t\t\t\t\t\tconst filename = this.getFilename( url );\n\t\t\t\t\t\t\tlet defaultedAlt;\n\t\t\t\t\t\t\tif ( alt ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if ( filename ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf( __( 'This image has an empty alt attribute; its file name is %s' ), filename );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst img = (\n\t\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t\t\t\t\t\t\t<img src={ url } alt={ defaultedAlt } onClick={ this.onImageClick } onError={ () => this.onImageError( url ) } />\n\t\t\t\t\t\t\t\t\t</ta>\n\t\t\t\t\t\t\t\t\t{ isBlobURL( url ) && <Spinner /> }\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t\t<div style={ { width, height } }>\n\t\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tconst currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tconst ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tconst minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tconst minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tlet showRightHandle = false;\n\t\t\t\t\t\t\tlet showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif ( align === 'center' ) {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if ( isRTL ) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif ( align === 'left' ) {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif ( align === 'right' ) {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\t\twidth && height ? {\n\t\t\t\t\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\t\t\t\t} : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\t\t\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\t\t\t\t\t\t\tminHeight={ minHeight }\n\t\t\t\t\t\t\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio\n\t\t\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t</ImageSize>\n\t\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tplaceholder={ __( 'Write caption…' ) }\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t\tunstableOnFocus={ this.onFocusCaption }\n\t\t\t\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\t\t\t\tisSelected={ this.state.captionFocused }\n\t\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t</Fragment>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( 'core' );\n\t\tconst { getEditorSettings } = select( 'core/editor' );\n\t\tconst { id } = props.attributes;\n\t\tconst { maxWidth, isRTL, imageSizes } = getEditorSettings();\n\n\t\treturn {\n\t\t\timage: id ? getMedia( id ) : null,\n\t\t\tmaxWidth,\n\t\t\tisRTL,\n\t\t\timageSizes,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithNotices,\n] )( ImageEdit );\n\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/edit.js","const WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nconst { includes } = lodash;\nconst { renderToString } = wp.element;\nconst { createBlock } = wp.blocks;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = ( props, attributesFromPreview ) => {\n\tconst { preview, name } = props;\n\tconst { url } = props.attributes;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\tconst matchingBlock = findBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif ( WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock ) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif ( name !== matchingBlock ) {\n\t\t\treturn createBlock( matchingBlock, { url } );\n\t\t}\n\t}\n\n\tif ( preview ) {\n\t\tconst { html } = preview;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif ( WORDPRESS_EMBED_BLOCK !== name ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\tWORDPRESS_EMBED_BLOCK,\n\t\t\t\t\t{\n\t\t\t\t\t\turl,\n\t\t\t\t\t\t// By now we have the preview, but when the new block first renders, it\n\t\t\t\t\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t\t\t\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t\t\t\t\t// here so that the initial render works when we switch to the WordPress\n\t\t\t\t\t\t// block. This only affects the WordPress block because it can't be\n\t\t\t\t\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t\t\t\t\t// relies on the preview to set the correct render type.\n\t\t\t\t\t\t...attributesFromPreview,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport const isFromWordPress = ( html ) => {\n\treturn includes( html, 'class=\"wp-embedded-content\" data-secret' );\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/util.js","const { noop } = lodash;\n\nconst { withGlobalEvents } = wp.compose;\nconst { Component } = wp.element;\n\nclass ImageSize extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t};\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\t\tthis.calculateSize = this.calculateSize.bind( this );\n\t}\n\n\tbindContainer( ref ) {\n\t\tthis.container = ref;\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.src !== prevProps.src ) {\n\t\t\tthis.setState( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t} );\n\t\t\tthis.fetchImageSize();\n\t\t}\n\n\t\tif ( this.props.dirtynessTrigger !== prevProps.dirtynessTrigger ) {\n\t\t\tthis.calculateSize();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.fetchImageSize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.image ) {\n\t\t\tthis.image.onload = noop;\n\t\t}\n\t}\n\n\tfetchImageSize() {\n\t\tthis.image = new window.Image();\n\t\tthis.image.onload = this.calculateSize;\n\t\tthis.image.src = this.props.src;\n\t}\n\n\tcalculateSize() {\n\t\tconst maxWidth = this.container.clientWidth;\n\t\tconst exceedMaxWidth = this.image.width > maxWidth;\n\t\tconst ratio = this.image.height / this.image.width;\n\t\tconst width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\tconst height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\tthis.setState( { width, height } );\n\t}\n\n\trender() {\n\t\tconst sizes = {\n\t\t\timageWidth: this.image && this.image.width,\n\t\t\timageHeight: this.image && this.image.height,\n\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\timageHeightWithinContainer: this.state.height,\n\t\t};\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer }>\n\t\t\t\t{ this.props.children( sizes ) }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withGlobalEvents( {\n\tresize: 'calculateSize',\n} )( ImageSize );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/image-size.js","import classnames from \"classnames\";\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { Spinner, withSpokenMessages, Popover , TextControl } = wp.components;\nconst { withInstanceId } = wp.compose;\n\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.searchAffiliateLinks = this.searchAffiliateLinks.bind( this );\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts : [],\n\t\t\tshowSuggestions : false,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : false\n\t\t};\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\t\n\tsearchAffiliateLinks( value ) {\n\n\t\t// Show the suggestions after typing at least 2 characters=\n\t\tif ( value.length < 2 ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState({\n\t\t\tshowSuggestions : true,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : true\n\t\t});\n\n\t\tconst formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n\t\tformData.append( \"gutenberg\" , true );\n\t\tformData.append( \"with_images\" , true );\n\t\t\n\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n\t\t} );\n\t\t\n\t\trequest\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\t// this.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: post,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\n\t\tthis.props.updateImageSelection( post.images , post );\n\t}\n\n\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t// this.inputRef.current.focus();\n\t}\n\n render() {\n const { value = '', autoFocus = true, instanceId } = this.props;\n const { showSuggestions , posts, selectedSuggestion , loading } = this.state;\n \n return (\n <div class=\"edit-search-affiliate-links\">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\t\t\t\tonSubmit={ this.displayAffiliateImages }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclassName=\"ta-search-affiliate-links\"\n\t\t\t\t\t\tplaceholder={ __( \"Type to search affiliate links\" ) }\n\t\t\t\t\t\tonChange={ this.searchAffiliateLinks }\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t\t{ showSuggestions && !! posts.length && \n\t\t\t\t\t\t<Popover position=\"bottom\" focusOnMount={ false }>\n\t\t\t\t\t\t\t<div class=\"affilate-links-suggestions\">\n\t\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\t\tid={ `editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t}\n\t\t\t\t</form>\n </div>\n );\n }\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/search-input.js","import { taLink } from \"./ta-link\";\n\nconst { registerFormatType } = wp.richText;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\nexport default function registerFormats() {\n\n [\n taLink\n ].forEach( ( { name , ...settings } ) => registerFormatType( name , settings ) );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/index.js","import InlineAffiliateLinkUI from './inline';\n\nconst { __ } = wp.i18n;\nconst { Component , Fragment } = wp.element;\nconst { withSpokenMessages } = wp.components;\nconst { getTextContent , applyFormat , removeFormat , slice } = wp.richText;\nconst { isURL } = wp.url;\nconst { RichTextToolbarButton , RichTextShortcut } = wp.editor;\nconst { Path , SVG } = wp.components;\nconst { getRectangleFromRange } = wp.dom;\n\nconst name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nexport const taLink = {\n name,\n title : __( \"Affiliate Link\" ),\n tagName : \"ta\",\n className : null,\n attributes : {\n\t\turl : \"href\",\n\t\ttarget : \"target\"\n },\n edit : withSpokenMessages( class LinkEdit extends Component {\n\t\t\n\t\t/**\n\t\t * Component constructor.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tthis.addLink = this.addLink.bind( this );\n\t\t\tthis.stopAddingLink = this.stopAddingLink.bind( this );\n\t\t\tthis.onRemoveFormat = this.onRemoveFormat.bind( this );\n\t\t\tthis.state = {\n\t\t\t\taddingLink: false,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\taddLink() {\n\n\t\t\tconst { value, onChange } = this.props;\n\t\t\tconst text = getTextContent( slice( value ) );\n\n\t\t\tif ( text && isURL( text ) ) {\n\t\t\t\tonChange( applyFormat( value, { type: name, attributes: { url: text } } ) );\n\t\t\t} else {\n\t\t\t\tthis.setState( { addingLink: true } );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to stop adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tstopAddingLink() {\n\t\t\tthis.setState( { addingLink: false } );\n\t\t}\n\n\t\t/**\n\t\t * Remove format event callback.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tonRemoveFormat() {\n\t\t\tconst { value , onChange , speak } = this.props;\n\n\t\t\tonChange( removeFormat( value , name ) );\n\t\t\tspeak( __( \"Affiliate Link removed.\" ), \"assertive\" );\n\t\t}\n\n\t\t/**\n\t\t * Get selected anchor text.\n\t\t * \n\t\t * @since 3.9\n\t\t */\n\t\tgetAnchorRect() {\n\n\t\t\tconst selection = window.getSelection();\n\t\t\tconst range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n\n\t\t\tif ( ! range ) return;\n\n\t\t\tlet rect = null;\n\n\t\t\tif ( this.state.addingLink ) {\n\t\t\t\trect = getRectangleFromRange( range );\n\t\t\t} else {\n\n\t\t\t\tlet element = range.startContainer;\n\n\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\twhile ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n\t\t\t\t\telement = element.parentNode;\n\t\t\t\t}\n\n\t\t\t\tconst closest = element.closest( 'ta' );\n\t\t\t\tif ( closest ) {\n\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\treturn rect;\n\t\t}\n\n\t\t/**\n\t\t * Component render method.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\trender() {\n\t\t\tconst { isActive , activeAttributes , value , onChange } = this.props;\n\n\t\t\tconst anchorRect = this.getAnchorRect();\n\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"access\"\n\t\t\t\t\t\tcharacter=\"s\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.addLink }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primaryShift\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon=\"editor-unlink\"\n\t\t\t\t\t\ttitle={ __( 'Remove Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-unlink-button\"\n\t\t\t\t\t\tonClick={ this.onRemoveFormat }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tshortcutType=\"primaryShift\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t{ ! isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon={ <SVG xmlns=\"http://www.w3.org/2000/svg\" width=\"16.688\" height=\"9.875\" viewBox=\"0 0 16.688 9.875\"><Path id=\"TA.svg\" fill=\"black\" class=\"cls-1\" d=\"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\" transform=\"translate(-1.188 -5.25)\"/></SVG> }\n\t\t\t\t\t\ttitle={ __( 'Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-link-button\"\n\t\t\t\t\t\tonClick={ this.addLink }\n\t\t\t\t\t\tshortcutType=\"primary\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t<InlineAffiliateLinkUI\n\t\t\t\t\t\taddingLink={ this.state.addingLink }\n\t\t\t\t\t\tstopAddingLink={ this.stopAddingLink }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tactiveAttributes={ activeAttributes }\n\t\t\t\t\t\tanchorRect={ anchorRect }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n } )\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/index.js","import classnames from \"classnames\";\nimport { isValidHref } from './utils';\nimport ThirstyURLPopover from './url-popover';\nimport ThirstyURLInput from './url-input';\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { ExternalLink , ToggleControl , IconButton , withSpokenMessages } = wp.components;\nconst { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } = wp.keycodes;\nconst { prependHTTP , safeDecodeURI , filterURLForDisplay } = wp.url;\nconst { create , insert , isCollapsed , applyFormat , getTextContent , slice } = wp.richText;\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat( { url , linkid , text } ) {\n\tconst format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl,\n\t\t\tlinkid : linkid.toString()\n\t\t},\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput( props , state ) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nconst LinkEditor = ( { value , onChangeInputValue , onKeyDown , submitLink, invalidLink , resetInvalidLink , autocompleteRef } ) => (\n\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t<form\n\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\tonKeyPress={ stopKeyPropagation }\n\t\tonKeyDown={ onKeyDown }\n\t\tonSubmit={ submitLink }\n\t>\n\t\t<ThirstyURLInput\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeInputValue }\n\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\tinvalidLink={ invalidLink }\n\t\t\tresetInvalidLink={ resetInvalidLink }\n\t\t/>\n\t\t<IconButton icon=\"editor-break\" label={ __( 'Apply' ) } type=\"submit\" />\n\t</form>\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewerUrl = ( { url } ) => {\n\tconst prependedURL = prependHTTP( url );\n\tconst linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': ! isValidHref( prependedURL ),\n\t} );\n\n\tif ( ! url ) {\n\t\treturn <span className={ linkClassName }></span>;\n\t}\n\n\treturn (\n\t\t<ExternalLink\n\t\t\tclassName={ linkClassName }\n\t\t\thref={ url }\n\t\t>\n\t\t\t{ filterURLForDisplay( safeDecodeURI( url ) ) }\n\t\t</ExternalLink>\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewer = ( { url, editLink } ) => {\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t<div\n\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n\t\t\tonKeyPress={ stopKeyPropagation }\n\t\t>\n\t\t\t<LinkViewerUrl url={ url } />\n\t\t\t<IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n\t\t</div>\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\nclass InlineAffiliateLinkUI extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.editLink = this.editLink.bind( this );\n\t\tthis.submitLink = this.submitLink.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.onClickOutside = this.onClickOutside.bind( this );\n\t\tthis.resetState = this.resetState.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\n\t\tthis.state = {\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tinvalidLink : false\n\t\t};\n\t}\n\n\t/**\n\t * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {Object} event Event object.\n\t */\n\tonKeyDown( event ) {\n\t\tif ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Callback to set state when input value is changed.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} inputValue \n\t * @param {*} post \n\t */\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\t/**\n\t * Callback to set state when edit affiliate link (already inserted) is triggered.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\teditLink( event ) {\n\t\tthis.setState( { editLink: true } );\n\t\tevent.preventDefault();\n\t}\n\n\t/**\n\t * Callback to apply the affiliate link format to the selected text or position in the active block.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tsubmitLink( event ) {\n\t\tconst { isActive, value, onChange, speak } = this.props;\n\t\tconst { inputValue, linkid , post } = this.state;\n\t\tconst url = prependHTTP( inputValue );\n\t\tconst selectedText = getTextContent( slice( value ) );\n\t\tconst format = createLinkFormat( {\n\t\t\turl,\n\t\t\tlinkid,\n\t\t\ttext: selectedText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! linkid || ! post ) {\n\t\t\tthis.setState( { invalidLink : true } )\n\t\t\treturn;\n\t\t} \n\n\t\tif ( isCollapsed( value ) && ! isActive ) {\n\t\t\tconst toInsert = applyFormat( create( { text: post.title } ), format, 0, url.length );\n\t\t\tonChange( insert( value, toInsert ) );\n\t\t} else {\n\t\t\tonChange( applyFormat( value, format ) );\n\t\t}\n\n\t\tthis.resetState();\n\n\t\tif ( ! isValidHref( url ) ) {\n\t\t\tspeak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n\t\t} else if ( isActive ) {\n\t\t\tspeak( __( 'Link edited.' ), 'assertive' );\n\t\t} else {\n\t\t\tspeak( __( 'Link inserted' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Callback to run when users clicks outside the popover UI.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tonClickOutside( event ) {\n\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t// return to avoid the popover being closed.\n\t\tconst autocompleteElement = this.autocompleteRef.current;\n\t\tif ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resetState();\n\t}\n\n\t/**\n\t * Reset state callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetState() {\n\t\tthis.props.stopAddingLink();\n\t\tthis.setState( { inputValue : '' , editLink: false } );\n\t\tthis.resetInvalidLink();\n\t}\n\n\t/**\n\t * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\t/**\n\t * Component render method.\n\t *\n\t * @since 3.6\n\t */\n\trender() {\n\t\tconst { isActive, activeAttributes: { url , linkid }, addingLink, anchorRect, value, onChange } = this.props;\n\n\t\tif ( ! isActive && ! addingLink ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { inputValue , invalidLink } = this.state;\n\t\tconst showInput = isShowingInput( this.props, this.state );\n\n\t\treturn (\n\t\t\t<ThirstyURLPopover\n\t\t\t\tonClickOutside={ this.onClickOutside }\n\t\t\t\tonClose={ this.resetState }\n\t\t\t\tfocusOnMount={ showInput ? 'firstElement' : false }\n\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\tanchorRect= { anchorRect }\n\t\t\t>\n\t\t\t\t{ showInput ? (\n\t\t\t\t\t<LinkEditor\n\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\tonChangeInputValue={ this.onChangeInputValue }\n\t\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\t\tsubmitLink={ this.submitLink }\n\t\t\t\t\t\tautocompleteRef={ this.autocompleteRef }\n\t\t\t\t\t\tupdateLinkId= { this.updateLinkId }\n\t\t\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\t\t\tresetInvalidLink={ this.resetInvalidLink }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<LinkViewer\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\teditLink={ this.editLink }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ThirstyURLPopover>\n\t\t);\n\t}\n}\n\nexport default withSpokenMessages( InlineAffiliateLinkUI );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/inline.js","const { startsWith } = lodash;\n\nconst {\n getProtocol,\n\tisValidProtocol,\n\tgetAuthority,\n\tisValidAuthority,\n\tgetPath,\n\tisValidPath,\n\tgetQueryString,\n\tisValidQueryString,\n\tgetFragment,\n\tisValidFragment,\n} = wp.url;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n\tif ( ! href ) {\n\t\treturn false;\n\t}\n\n\tconst trimmedHref = href.trim();\n\n\tif ( ! trimmedHref ) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif ( /^\\S+:/.test( trimmedHref ) ) {\n\t\tconst protocol = getProtocol( trimmedHref );\n\t\tif ( ! isValidProtocol( protocol ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst authority = getAuthority( trimmedHref );\n\t\tif ( ! isValidAuthority( authority ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst path = getPath( trimmedHref );\n\t\tif ( path && ! isValidPath( path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst queryString = getQueryString( trimmedHref );\n\t\tif ( queryString && ! isValidQueryString( queryString ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fragment = getFragment( trimmedHref );\n\t\tif ( fragment && ! isValidFragment( fragment ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/utils.js","const { __ } = wp.i18n;\nconst { Component } = wp.element;\nconst { Popover , IconButton } = wp.components;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\nclass ThirstyURLPopover extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tconstructor() {\n super( ...arguments );\n \n this.toggleSettingsVisibility = this.toggleSettingsVisibility.bind( this );\n\n\t\tthis.state = {\n\t\t\tisSettingsExpanded: false,\n\t\t};\n }\n \n /**\n * Component constructor.\n * \n * @since 3.6\n */\n toggleSettingsVisibility() {\n\t\tthis.setState( {\n\t\t\tisSettingsExpanded: ! this.state.isSettingsExpanded,\n\t\t} );\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\trenderSettings,\n invalidLink,\n\t\t\tposition = 'bottom center',\n\t\t\tfocusOnMount = 'firstElement',\n\t\t\t...popoverProps\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tisSettingsExpanded,\n } = this.state;\n \n const showSettings = !! renderSettings && isSettingsExpanded;\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassName=\"ta-url-popover editor-url-popover block-editor-url-popover\"\n\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\tposition={ position }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t<div className=\"editor-url-popover__row\">\n { children }\n { !! renderSettings && (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tclassName=\"editor-url-popover__settings-toggle\"\n\t\t\t\t\t\t\ticon=\"ellipsis\"\n\t\t\t\t\t\t\tlabel={ __( 'Link Settings' ) }\n\t\t\t\t\t\t\tonClick={ this.toggleSettingsVisibility }\n\t\t\t\t\t\t\taria-expanded={ isSettingsExpanded }\n\t\t\t\t\t\t/>\n ) }\n\t\t\t\t</div>\n { showSettings && (\n\t\t\t\t\t<div className=\"editor-url-popover__row editor-url-popover__settings\">\n\t\t\t\t\t\t{ renderSettings() }\n\t\t\t\t\t</div>\n ) }\n { invalidLink && <div class=\"ta-invalid-link\">{ __( 'Invalid affiliate link' ) }</div> }\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default ThirstyURLPopover;\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-popover.js","import classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\nconst { __ } = wp.i18n;\nconst { throttle } = lodash;\nconst { Component , createRef } = wp.element;\nconst { UP, DOWN, ENTER, TAB } = wp.keycodes;\nconst { Spinner, withSpokenMessages, Popover } = wp.components;\nconst { withInstanceId } = wp.compose;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\nconst stopEventPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t};\n\t}\n\n /**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n /**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n /**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n /**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\tupdateSuggestions( value ) {\n\t\t// Show the suggestions after typing at least 2 characters\n\t\t// and also for URLs\n\t\tif ( value.length < 2 || /^https?:/.test( value ) ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tshowSuggestions: true,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n const formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n formData.append( \"gutenberg\" , true );\n \n // We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n } );\n\n request\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n /**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonChange( event ) {\n this.props.resetInvalidLink();\n\t\tconst inputValue = event.target.value;\n\t\tthis.props.onChange( inputValue );\n\t\tthis.updateSuggestions( inputValue );\n\t}\n\n /**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonKeyDown( event ) {\n\t\tconst { showSuggestions, selectedSuggestion, posts, loading } = this.state;\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\t\tif ( ! showSuggestions || ! posts.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif ( this.props.value.length !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\tevent.target.setSelectionRange( this.props.value.length, this.props.value.length );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst post = this.state.posts[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = selectedSuggestion === null || ( selectedSuggestion === posts.length - 1 ) ? 0 : selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n /**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\tthis.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n /**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst { value = '', autoFocus = true, instanceId , invalidLink } = this.props;\n\t\tconst { showSuggestions, posts, selectedSuggestion, loading } = this.state;\n\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\treturn (\n\t\t\t<div className=\"editor-url-input block-editor-url-input\">\n\t\t\t\t<input\n\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\t\trequired\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ this.onChange }\n\t\t\t\t\tonInput={ stopEventPropagation }\n\t\t\t\t\tplaceholder={ __( 'Paste URL or type to search' ) }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={ showSuggestions }\n\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\taria-owns={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\taria-activedescendant={ selectedSuggestion !== null ? `editor-url-input-suggestion-${ instanceId }-${ selectedSuggestion }` : undefined }\n\t\t\t\t\tref={ this.inputRef }\n\t\t\t\t/>\n\n\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t{ showSuggestions && !! posts.length && ! invalidLink &&\n\t\t\t\t\t<Popover position=\"bottom\" noArrow focusOnMount={ false }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n\t\t\t\t\t\t\tid={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\t\t\tref={ this.autocompleteRef }\n\t\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\tid={ `block-editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t}\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-input.js","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/index.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/util.js\n// module id = 16\n// module chunks = 0"],"sourceRoot":""}
|
1 |
+
{"version":3,"sources":["webpack:///gutenberg-support.js","webpack:///webpack/bootstrap d99a01d6a74ed422ed81","webpack:///./node_modules/classnames/index.js","webpack:///./src/index.js","webpack:///./src/blocks/index.js","webpack:///./src/blocks/ta-image/index.js","webpack:///./src/blocks/ta-image/edit.js","webpack:///./src/blocks/ta-image/util.js","webpack:///./src/blocks/ta-image/image-size.js","webpack:///./src/blocks/ta-image/search-input.js","webpack:///./src/formats/index.js","webpack:///./src/formats/ta-link/index.js","webpack:///./src/formats/ta-link/inline.js","webpack:///./src/formats/ta-link/utils.js","webpack:///./src/formats/ta-link/url-popover.js","webpack:///./src/formats/ta-link/url-input.js","webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","key","hasOwn","join","default","undefined","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__blocks__","__WEBPACK_IMPORTED_MODULE_1__formats__","__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__","registerBlocks","registerFormats","taimage","forEach","block","settings","registerBlockType","__WEBPACK_IMPORTED_MODULE_0__ta_image__","wp","blocks","_defineProperty","obj","writable","__WEBPACK_IMPORTED_MODULE_0_classnames__","__WEBPACK_IMPORTED_MODULE_0_classnames___default","__WEBPACK_IMPORTED_MODULE_1__edit__","Fragment","element","__","i18n","_wp$blocks","getPhrasingContentSchema","createBlock","getBlockAttributes","RichText","editor","_wp$components","components","Path","SVG","blockAttributes","url","type","source","selector","attribute","alt","caption","id","align","width","height","linkid","href","affiliateLink","imageSchema","img","attributes","title","description","icon","createElement","viewBox","xmlns","fill","category","keywords","getEditWrapperProps","data-align","data-resized","edit","save","_ref","_classnames","classnames","image","src","className","figure","Content","tagName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","__WEBPACK_IMPORTED_MODULE_1__util__","__WEBPACK_IMPORTED_MODULE_2__image_size__","__WEBPACK_IMPORTED_MODULE_3__search_input__","_extends","assign","target","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","err","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_lodash","lodash","isEmpty","map","last","pick","compact","getPath","_wp$i18n","sprintf","_wp$element","Component","createRef","_wp$blob","blob","getBlobByURL","revokeBlobURL","isBlobURL","Placeholder","Button","ButtonGroup","IconButton","PanelBody","ResizableBox","SelectControl","Spinner","TextControl","TextareaControl","Toolbar","withNotices","withSelect","ToggleControl","Popover","data","_wp$editor","BlockControls","InspectorControls","BlockAlignmentToolbar","MediaUpload","MediaUploadCheck","MediaPlaceholder","mediaUpload","withViewportMatch","viewport","compose","ALLOWED_MEDIA_TYPES","pickRelevantMediaFiles","imageProps","isTemporaryImage","isExternalImage","ImageEdit","_Component","this","_this","getPrototypeOf","updateAlt","bind","updateAlignment","onFocusCaption","onImageClick","onSelectImage","updateImageURL","updateWidth","updateHeight","updateDimensions","getFilename","toggleIsEditing","onImageError","onChangeInputValue","autocompleteRef","resetInvalidLink","updateImageSelection","onSelectAffiliateImage","editAFfiliateImage","state","captionFocused","isEditing","inputValue","post","showSuggestions","imageSelection","_this2","_props","setAttributes","noticeOperations","_attributes$url","file","filesList","onFileChange","_ref2","_ref3","allowedTypes","onError","message","createErrorNotice","setState","prevProps","_prevProps$attributes","prevID","_prevProps$attributes2","prevURL","_props$attributes","_props$attributes$url","isSelected","media","link","embedBlock","createUpgradedEmbedBlock","onReplace","newAlt","nextAlign","extraUpdatedAttributes","indexOf","parseInt","_this3","path","split","label","_props2","imageSizes","_ref4","slug","sizeUrl","invalidLink","_this4","apiFetch","addQueryArgs","context","_locale","then","source_url","images","_this5","_state","_props3","isLargeViewport","maxWidth","toggleSelection","isRTL","linkDestination","toolbarEditButton","onClick","controls","onChange","instructions","index","wp-block-image","is-transient","is-resized","is-focused","isResizable","imageSizeOptions","getImageSizeOptions","getInspectorControls","imageWidth","imageHeight","help","options","placeholder","min","aria-label","scale","scaledWidth","Math","round","scaledHeight","isCurrent","isSmall","isPrimary","aria-pressed","dirtynessTrigger","sizes","imageWidthWithinContainer","imageHeightWithinContainer","filename","defaultedAlt","style","currentWidth","currentHeight","ratio","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","maxHeight","lockAspectRatio","enable","top","right","bottom","left","onResizeStart","onResizeStop","event","direction","elt","delta","unstableOnFocus","inlineToolbar","select","_select","getMedia","_select2","getEditorSettings","_getEditorSettings","includes","renderToString","attributesFromPreview","preview","matchingBlock","findBlock","DEFAULT_EMBED_BLOCK","html","isFromWordPress","noop","withGlobalEvents","ImageSize","bindContainer","calculateSize","ref","container","fetchImageSize","onload","window","Image","clientWidth","exceedMaxWidth","containerWidth","containerHeight","clientHeight","children","resize","withSpokenMessages","withInstanceId","ThirstyURLInput","inputRef","searchAffiliateLinks","suggestionNodes","posts","selectedSuggestion","loading","scrollingIntoView","scrollIntoView","current","onlyScrollIfNeeded","setTimeout","suggestionsRequest","formData","FormData","append","request","fetch","ajaxurl","method","body","response","json","affiliate_links","debouncedSpeak","catch","selectLink","instanceId","autoFocus","_state2","class","onSubmit","displayAffiliateImages","autocomplete","position","focusOnMount","role","tabIndex","bindSuggestionNode","is-selected","handleOnClick","aria-selected","_objectWithoutProperties","keys","taLink","registerFormatType","__WEBPACK_IMPORTED_MODULE_0__ta_link__","richText","__WEBPACK_IMPORTED_MODULE_0__inline__","_wp$richText","getTextContent","applyFormat","removeFormat","slice","isURL","RichTextToolbarButton","RichTextShortcut","getRectangleFromRange","dom","LinkEdit","addLink","stopAddingLink","onRemoveFormat","addingLink","text","speak","selection","getSelection","range","rangeCount","getRangeAt","rect","startContainer","nextElementSibling","nodeType","Node","ELEMENT_NODE","parentNode","closest","getBoundingClientRect","isActive","activeAttributes","anchorRect","getAnchorRect","character","onUse","shortcutType","shortcutCharacter","transform","createLinkFormat","toString","isShowingInput","editLink","__WEBPACK_IMPORTED_MODULE_1__utils__","__WEBPACK_IMPORTED_MODULE_2__url_popover__","__WEBPACK_IMPORTED_MODULE_3__url_input__","ExternalLink","_wp$keycodes","keycodes","LEFT","RIGHT","UP","DOWN","BACKSPACE","ENTER","_wp$url","prependHTTP","safeDecodeURI","filterURLForDisplay","insert","isCollapsed","stopKeyPropagation","stopPropagation","LinkEditor","onKeyDown","submitLink","onKeyPress","LinkViewerUrl","prependedURL","linkClassName","has-invalid-link","isValidHref","LinkViewer","InlineAffiliateLinkUI","onClickOutside","resetState","keyCode","preventDefault","selectedText","format","toInsert","autocompleteElement","contains","_props2$activeAttribu","showInput","onClose","updateLinkId","trimmedHref","trim","test","protocol","getProtocol","isValidProtocol","startsWith","authority","getAuthority","isValidAuthority","isValidPath","queryString","getQueryString","isValidQueryString","fragment","getFragment","isValidFragment","ThirstyURLPopover","toggleSettingsVisibility","isSettingsExpanded","renderSettings","_props$position","_props$focusOnMount","popoverProps","showSettings","aria-expanded","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__","__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default","throttle","TAB","stopEventPropagation","updateSuggestions","previousIndex","nextIndex","selectionStart","setSelectionRange","focus","_props$value","_props$autoFocus","_state3","required","onInput","aria-autocomplete","aria-owns","aria-activedescendant","noArrow","elem","config","util","getWindow","allowHorizontalScroll","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","isWin","isWindow","elemOffset","offset","eh","outerHeight","ew","outerWidth","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","win","winScroll","ww","wh","scrollLeft","scrollTop","parseFloat","css","getClientPosition","box","x","y","doc","ownerDocument","docElem","documentElement","clientLeft","clientTop","getScroll","w","ret","document","getScrollLeft","getScrollTop","getOffset","el","pos","defaultView","parentWindow","_getComputedStyle","computedStyle_","val","computedStyle","getComputedStyle","getPropertyValue","_getComputedStyleIE","CURRENT_STYLE","_RE_NUM_NO_PX","RE_POS","rsLeft","RUNTIME_STYLE","pixelLeft","PX","each","fn","isBorderBoxFn","getComputedStyleX","swap","callback","old","getPBMWidth","which","prop","j","cssProp","getWH","extra","domUtils","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","offsetWidth","offsetHeight","isBorderBox","cssBoxValue","Number","BORDER_INDEX","CONTENT_INDEX","borderBoxValueOrIsBorderBox","padding","PADDING_INDEX","BOX_MODELS","getWHIgnoreDisplay","args","cssShow","v","_typeof","setOffset","RE_NUM","RegExp","refWin","max","documentElementProp","compatMode","visibility","display","first","charAt","toUpperCase","includeMargin","node","clone","overflow","scrollTo"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,G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t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__blocks__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__formats__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__assets_styles_index_scss__);\n\n\n\n\n\nObject(__WEBPACK_IMPORTED_MODULE_0__blocks__[\"a\" /* default */])();\nObject(__WEBPACK_IMPORTED_MODULE_1__formats__[\"a\" /* default */])();\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerBlocks;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_image__ = __webpack_require__(3);\n\n\nvar registerBlockType = wp.blocks.registerBlockType;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\n\nfunction registerBlocks() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_image__].forEach(function (block) {\n if (!block) return;\n\n var name = block.name,\n settings = block.settings;\n\n registerBlockType(name, settings);\n });\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"name\", function() { return name; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"settings\", function() { return settings; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit__ = __webpack_require__(4);\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Fragment = wp.element.Fragment;\nvar __ = wp.i18n.__;\nvar _wp$blocks = wp.blocks,\n createBlock = _wp$blocks.createBlock,\n getBlockAttributes = _wp$blocks.getBlockAttributes,\n getPhrasingContentSchema = _wp$blocks.getPhrasingContentSchema;\nvar RichText = wp.editor.RichText;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\n\n\n\n\nvar name = 'ta/image';\n\nvar blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src'\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: ''\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption'\n\t},\n\tid: {\n\t\ttype: 'number'\n\t},\n\talign: {\n\t\ttype: 'string'\n\t},\n\twidth: {\n\t\ttype: 'number'\n\t},\n\theight: {\n\t\ttype: 'number'\n\t},\n\tlinkid: {\n\t\ttype: 'number'\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nvar imageSchema = {\n\timg: {\n\t\tattributes: ['src', 'alt'],\n\t\tclasses: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/]\n\t}\n};\n\nvar schema = {\n\tfigure: {\n\t\trequire: ['ta', 'img'],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: ['href', 'linkid'],\n\t\t\t\tchildren: imageSchema\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema()\n\t\t\t}\n\t\t}\n\t}\n};\n\nfunction getFirstAnchorAttributeFormHTML(html, attributeName) {\n\tvar _document$implementat = document.implementation.createHTMLDocument(''),\n\t body = _document$implementat.body;\n\n\tbody.innerHTML = html;\n\n\tvar firstElementChild = body.firstElementChild;\n\n\n\tif (firstElementChild && firstElementChild.nodeName === 'A') {\n\t\treturn firstElementChild.getAttribute(attributeName) || undefined;\n\t}\n}\n\nvar settings = {\n\ttitle: __('ThirstyAffiliates Image'),\n\n\tdescription: __('Insert an image with an affiliate link to make a visual statement.'),\n\n\ticon: wp.element.createElement(\n\t\tSVG,\n\t\t{ viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\" },\n\t\twp.element.createElement(Path, { d: \"M0,0h24v24H0V0z\", fill: \"none\" }),\n\t\twp.element.createElement(Path, { d: \"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" }),\n\t\twp.element.createElement(Path, { d: \"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" })\n\t),\n\n\tcategory: 'common',\n\n\tkeywords: ['img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t__('photo'), __('affiliate')],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align,\n\t\t width = attributes.width;\n\n\t\tif ('left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align) {\n\t\t\treturn { 'data-align': align, 'data-resized': !!width };\n\t\t}\n\t},\n\n\n\tedit: __WEBPACK_IMPORTED_MODULE_1__edit__[\"a\" /* default */],\n\n\tsave: function save(_ref) {\n\t\tvar _classnames;\n\n\t\tvar attributes = _ref.attributes;\n\t\tvar url = attributes.url,\n\t\t alt = attributes.alt,\n\t\t caption = attributes.caption,\n\t\t align = attributes.align,\n\t\t width = attributes.width,\n\t\t height = attributes.height,\n\t\t id = attributes.id,\n\t\t linkid = attributes.linkid,\n\t\t href = attributes.href;\n\n\n\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()((_classnames = {}, _defineProperty(_classnames, \"align\" + align, align), _defineProperty(_classnames, 'is-resized', width || height), _classnames));\n\n\t\tvar image = wp.element.createElement(\"img\", {\n\t\t\tsrc: url,\n\t\t\talt: alt,\n\t\t\tclassName: id ? \"wp-image-\" + id : null,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t});\n\n\t\tvar figure = wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\t\"ta\",\n\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\timage\n\t\t\t),\n\t\t\twp.element.createElement(RichText.Content, { tagName: \"figcaption\", value: caption })\n\t\t);\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ className: \"wp-block-image\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\tfigure\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn wp.element.createElement(\n\t\t\t\"figure\",\n\t\t\t{ className: \"wp-block-image \" + classes },\n\t\t\tfigure\n\t\t);\n\t}\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export pickRelevantMediaFiles */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__image_size__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__search_input__ = __webpack_require__(7);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar _lodash = lodash,\n get = _lodash.get,\n isEmpty = _lodash.isEmpty,\n map = _lodash.map,\n last = _lodash.last,\n pick = _lodash.pick,\n compact = _lodash.compact;\nvar getPath = wp.url.getPath;\nvar _wp$i18n = wp.i18n,\n __ = _wp$i18n.__,\n sprintf = _wp$i18n.sprintf;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment,\n createRef = _wp$element.createRef;\nvar _wp$blob = wp.blob,\n getBlobByURL = _wp$blob.getBlobByURL,\n revokeBlobURL = _wp$blob.revokeBlobURL,\n isBlobURL = _wp$blob.isBlobURL;\nvar _wp$components = wp.components,\n Placeholder = _wp$components.Placeholder,\n Button = _wp$components.Button,\n ButtonGroup = _wp$components.ButtonGroup,\n IconButton = _wp$components.IconButton,\n PanelBody = _wp$components.PanelBody,\n ResizableBox = _wp$components.ResizableBox,\n SelectControl = _wp$components.SelectControl,\n Spinner = _wp$components.Spinner,\n TextControl = _wp$components.TextControl,\n TextareaControl = _wp$components.TextareaControl,\n Toolbar = _wp$components.Toolbar,\n withNotices = _wp$components.withNotices,\n ToggleControl = _wp$components.ToggleControl,\n Popover = _wp$components.Popover;\nvar withSelect = wp.data.withSelect;\nvar _wp$editor = wp.editor,\n RichText = _wp$editor.RichText,\n BlockControls = _wp$editor.BlockControls,\n InspectorControls = _wp$editor.InspectorControls,\n MediaUpload = _wp$editor.MediaUpload,\n MediaUploadCheck = _wp$editor.MediaUploadCheck,\n MediaPlaceholder = _wp$editor.MediaPlaceholder,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n mediaUpload = _wp$editor.mediaUpload;\nvar withViewportMatch = wp.viewport.withViewportMatch;\nvar compose = wp.compose.compose;\n\n\n\n\n\n\n/**\n * Module constants\n */\nvar MIN_SIZE = 20;\nvar LINK_DESTINATION_NONE = 'none';\nvar LINK_DESTINATION_MEDIA = 'media';\nvar LINK_DESTINATION_ATTACHMENT = 'attachment';\nvar LINK_DESTINATION_CUSTOM = 'custom';\nvar NEW_TAB_REL = 'noreferrer noopener';\nvar ALLOWED_MEDIA_TYPES = ['image'];\n\nvar pickRelevantMediaFiles = function pickRelevantMediaFiles(image) {\n\tvar imageProps = pick(image, ['alt', 'id', 'link', 'caption']);\n\timageProps.url = get(image, ['sizes', 'large', 'url']) || get(image, ['media_details', 'sizes', 'large', 'source_url']) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nvar isTemporaryImage = function isTemporaryImage(id, url) {\n\treturn !id && isBlobURL(url);\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nvar isExternalImage = function isExternalImage(id, url) {\n\treturn url && !id && !isBlobURL(url);\n};\n\nvar ImageEdit = function (_Component) {\n\t_inherits(ImageEdit, _Component);\n\n\tfunction ImageEdit(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\t_classCallCheck(this, ImageEdit);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageEdit.__proto__ || Object.getPrototypeOf(ImageEdit)).apply(this, arguments));\n\n\t\t_this.updateAlt = _this.updateAlt.bind(_this);\n\t\t_this.updateAlignment = _this.updateAlignment.bind(_this);\n\t\t_this.onFocusCaption = _this.onFocusCaption.bind(_this);\n\t\t_this.onImageClick = _this.onImageClick.bind(_this);\n\t\t_this.onSelectImage = _this.onSelectImage.bind(_this);\n\t\t_this.updateImageURL = _this.updateImageURL.bind(_this);\n\t\t_this.updateWidth = _this.updateWidth.bind(_this);\n\t\t_this.updateHeight = _this.updateHeight.bind(_this);\n\t\t_this.updateDimensions = _this.updateDimensions.bind(_this);\n\t\t_this.getFilename = _this.getFilename.bind(_this);\n\t\t_this.toggleIsEditing = _this.toggleIsEditing.bind(_this);\n\t\t_this.onImageError = _this.onImageError.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\t\t_this.updateImageSelection = _this.updateImageSelection.bind(_this);\n\t\t_this.onSelectAffiliateImage = _this.onSelectAffiliateImage.bind(_this);\n\t\t_this.editAFfiliateImage = _this.editAFfiliateImage.bind(_this);\n\n\t\t_this.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: !attributes.url,\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tshowSuggestions: false,\n\t\t\timageSelection: [],\n\t\t\taffiliateLink: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageEdit, [{\n\t\tkey: \"componentDidMount\",\n\t\tvalue: function componentDidMount() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t attributes = _props.attributes,\n\t\t\t setAttributes = _props.setAttributes,\n\t\t\t noticeOperations = _props.noticeOperations;\n\t\t\tvar id = attributes.id,\n\t\t\t _attributes$url = attributes.url,\n\t\t\t url = _attributes$url === undefined ? '' : _attributes$url;\n\n\n\t\t\tif (isTemporaryImage(id, url)) {\n\t\t\t\tvar file = getBlobByURL(url);\n\n\t\t\t\tif (file) {\n\t\t\t\t\tmediaUpload({\n\t\t\t\t\t\tfilesList: [file],\n\t\t\t\t\t\tonFileChange: function onFileChange(_ref2) {\n\t\t\t\t\t\t\tvar _ref3 = _slicedToArray(_ref2, 1),\n\t\t\t\t\t\t\t image = _ref3[0];\n\n\t\t\t\t\t\t\tsetAttributes(pickRelevantMediaFiles(image));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\t\tonError: function onError(message) {\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice(message);\n\t\t\t\t\t\t\t_this2.setState({ isEditing: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tvar _prevProps$attributes = prevProps.attributes,\n\t\t\t prevID = _prevProps$attributes.id,\n\t\t\t _prevProps$attributes2 = _prevProps$attributes.url,\n\t\t\t prevURL = _prevProps$attributes2 === undefined ? '' : _prevProps$attributes2;\n\t\t\tvar _props$attributes = this.props.attributes,\n\t\t\t id = _props$attributes.id,\n\t\t\t _props$attributes$url = _props$attributes.url,\n\t\t\t url = _props$attributes$url === undefined ? '' : _props$attributes$url;\n\n\n\t\t\tif (isTemporaryImage(prevID, prevURL) && !isTemporaryImage(id, url)) {\n\t\t\t\trevokeBlobURL(url);\n\t\t\t}\n\n\t\t\tif (!this.props.isSelected && prevProps.isSelected && this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onSelectImage\",\n\t\tvalue: function onSelectImage(media) {\n\n\t\t\tif (!media || !media.url) {\n\t\t\t\tthis.props.setAttributes({\n\t\t\t\t\turl: undefined,\n\t\t\t\t\talt: undefined,\n\t\t\t\t\tid: undefined,\n\t\t\t\t\tcaption: undefined\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar affiliateLink = this.state.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: false\n\t\t\t});\n\n\t\t\tthis.props.setAttributes(_extends({}, pickRelevantMediaFiles(media), {\n\t\t\t\tlinkid: affiliateLink.id,\n\t\t\t\thref: affiliateLink.link,\n\t\t\t\taffiliateLink: affiliateLink,\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onImageError\",\n\t\tvalue: function onImageError(url) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tvar embedBlock = Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"a\" /* createUpgradedEmbedBlock */])({ attributes: { url: url } });\n\t\t\tif (undefined !== embedBlock) {\n\t\t\t\tthis.props.onReplace(embedBlock);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onFocusCaption\",\n\t\tvalue: function onFocusCaption() {\n\t\t\tif (!this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"onImageClick\",\n\t\tvalue: function onImageClick() {\n\t\t\tif (this.state.captionFocused) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tcaptionFocused: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"updateAlt\",\n\t\tvalue: function updateAlt(newAlt) {\n\t\t\tthis.props.setAttributes({ alt: newAlt });\n\t\t}\n\t}, {\n\t\tkey: \"updateAlignment\",\n\t\tvalue: function updateAlignment(nextAlign) {\n\t\t\tvar extraUpdatedAttributes = ['wide', 'full'].indexOf(nextAlign) !== -1 ? { width: undefined, height: undefined } : {};\n\t\t\tthis.props.setAttributes(_extends({}, extraUpdatedAttributes, { align: nextAlign }));\n\t\t}\n\t}, {\n\t\tkey: \"updateImageURL\",\n\t\tvalue: function updateImageURL(url) {\n\t\t\tthis.props.setAttributes({ url: url, width: undefined, height: undefined });\n\t\t}\n\t}, {\n\t\tkey: \"updateWidth\",\n\t\tvalue: function updateWidth(width) {\n\t\t\tthis.props.setAttributes({ width: parseInt(width, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateHeight\",\n\t\tvalue: function updateHeight(height) {\n\t\t\tthis.props.setAttributes({ height: parseInt(height, 10) });\n\t\t}\n\t}, {\n\t\tkey: \"updateDimensions\",\n\t\tvalue: function updateDimensions() {\n\t\t\tvar _this3 = this;\n\n\t\t\tvar width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\t\t\tvar height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\t\treturn function () {\n\t\t\t\t_this3.props.setAttributes({ width: width, height: height });\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"getFilename\",\n\t\tvalue: function getFilename(url) {\n\t\t\tvar path = getPath(url);\n\t\t\tif (path) {\n\t\t\t\treturn last(path.split('/'));\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"getLinkDestinationOptions\",\n\t\tvalue: function getLinkDestinationOptions() {\n\t\t\treturn [{ value: LINK_DESTINATION_NONE, label: __('None') }, { value: LINK_DESTINATION_MEDIA, label: __('Media File') }, { value: LINK_DESTINATION_ATTACHMENT, label: __('Attachment Page') }, { value: LINK_DESTINATION_CUSTOM, label: __('Custom URL') }];\n\t\t}\n\t}, {\n\t\tkey: \"toggleIsEditing\",\n\t\tvalue: function toggleIsEditing() {\n\t\t\tthis.setState({\n\t\t\t\tisEditing: !this.state.isEditing\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"getImageSizeOptions\",\n\t\tvalue: function getImageSizeOptions() {\n\t\t\tvar _props2 = this.props,\n\t\t\t imageSizes = _props2.imageSizes,\n\t\t\t image = _props2.image;\n\n\t\t\treturn compact(map(imageSizes, function (_ref4) {\n\t\t\t\tvar name = _ref4.name,\n\t\t\t\t slug = _ref4.slug;\n\n\t\t\t\tvar sizeUrl = get(image, ['media_details', 'sizes', slug, 'source_url']);\n\t\t\t\tif (!sizeUrl) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tvalue: sizeUrl,\n\t\t\t\t\tlabel: name\n\t\t\t\t};\n\t\t\t}));\n\t\t}\n\t}, {\n\t\tkey: \"onChangeInputValue\",\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\t}, {\n\t\tkey: \"resetInvalidLink\",\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\t}, {\n\t\tkey: \"updateImageSelection\",\n\t\tvalue: function updateImageSelection(imageSelection, affiliateLink) {\n\t\t\tthis.setState({\n\t\t\t\timageSelection: imageSelection,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"onSelectAffiliateImage\",\n\t\tvalue: function onSelectAffiliateImage(image) {\n\t\t\tvar _this4 = this;\n\n\t\t\tif (isExternalImage(image.id, image.src)) {\n\t\t\t\timage.url = image.src;\n\t\t\t\tthis.onSelectImage(image);\n\t\t\t} else {\n\t\t\t\tvar request = wp.apiFetch({\n\t\t\t\t\tpath: wp.url.addQueryArgs('/wp/v2/media/' + image.id, {\n\t\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t\t_locale: 'user'\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\trequest.then(function (media) {\n\t\t\t\t\tmedia.url = media.source_url;\n\t\t\t\t\t_this4.onSelectImage(media);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: \"editAFfiliateImage\",\n\t\tvalue: function editAFfiliateImage() {\n\t\t\tvar attributes = this.props.attributes;\n\t\t\tvar affiliateLink = attributes.affiliateLink;\n\n\n\t\t\tthis.setState({\n\t\t\t\tisEditing: true,\n\t\t\t\timageSelection: affiliateLink.images,\n\t\t\t\taffiliateLink: affiliateLink\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t isEditing = _state.isEditing,\n\t\t\t imageSelection = _state.imageSelection,\n\t\t\t affiliateLink = _state.affiliateLink;\n\t\t\tvar _props3 = this.props,\n\t\t\t attributes = _props3.attributes,\n\t\t\t setAttributes = _props3.setAttributes,\n\t\t\t isLargeViewport = _props3.isLargeViewport,\n\t\t\t isSelected = _props3.isSelected,\n\t\t\t className = _props3.className,\n\t\t\t maxWidth = _props3.maxWidth,\n\t\t\t toggleSelection = _props3.toggleSelection,\n\t\t\t isRTL = _props3.isRTL;\n\t\t\tvar url = attributes.url,\n\t\t\t alt = attributes.alt,\n\t\t\t caption = attributes.caption,\n\t\t\t align = attributes.align,\n\t\t\t linkDestination = attributes.linkDestination,\n\t\t\t width = attributes.width,\n\t\t\t height = attributes.height,\n\t\t\t linkid = attributes.linkid,\n\t\t\t href = attributes.href;\n\n\t\t\tvar toolbarEditButton = wp.element.createElement(\n\t\t\t\tToolbar,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(IconButton, {\n\t\t\t\t\tclassName: \"ta-edit-image-button components-icon-button components-toolbar__control\",\n\t\t\t\t\tlabel: __('Edit ThirstyAffiliates Image'),\n\t\t\t\t\ticon: \"edit\",\n\t\t\t\t\tonClick: this.editAFfiliateImage\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tvar controls = wp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: this.updateAlignment\n\t\t\t\t}),\n\t\t\t\ttoolbarEditButton\n\t\t\t);\n\n\t\t\tif (isEditing) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\tcontrols,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPlaceholder,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: \"format-image\",\n\t\t\t\t\t\t\tlabel: __(\"ThirstyAffiliates Image\"),\n\t\t\t\t\t\t\tinstructions: __(\"Search for an affiliate link and select image to insert.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__search_input__[\"a\" /* default */], {\n\t\t\t\t\t\t\tupdateImageSelection: this.updateImageSelection\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!!imageSelection.length && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"ta-image-sel-wrap\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"h3\",\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\taffiliateLink.title + \" \" + __('attached images:')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"ta-image-selection\" },\n\t\t\t\t\t\t\t\timageSelection.map(function (image, index) {\n\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\t\treturn _this5.onSelectAffiliateImage(image);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: image.src })\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar classes = __WEBPACK_IMPORTED_MODULE_0_classnames___default()(className, {\n\t\t\t\t'wp-block-image': true,\n\t\t\t\t'is-transient': isBlobURL(url),\n\t\t\t\t'is-resized': !!width || !!height,\n\t\t\t\t'is-focused': isSelected\n\t\t\t});\n\n\t\t\tvar isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport;\n\t\t\tvar imageSizeOptions = this.getImageSizeOptions();\n\n\t\t\tvar getInspectorControls = function getInspectorControls(imageWidth, imageHeight) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tInspectorControls,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __('Image Settings') },\n\t\t\t\t\t\twp.element.createElement(TextareaControl, {\n\t\t\t\t\t\t\tlabel: __('Alt Text (Alternative Text)'),\n\t\t\t\t\t\t\tvalue: alt,\n\t\t\t\t\t\t\tonChange: _this5.updateAlt,\n\t\t\t\t\t\t\thelp: __('Alternative text describes your image to people who can’t see it. Add a short description with its key details.')\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t!isEmpty(imageSizeOptions) && wp.element.createElement(SelectControl, {\n\t\t\t\t\t\t\tlabel: __('Image Size'),\n\t\t\t\t\t\t\tvalue: url,\n\t\t\t\t\t\t\toptions: imageSizeOptions,\n\t\t\t\t\t\t\tonChange: _this5.updateImageURL\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tisResizable && wp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions\" },\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"p\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\t__('Image Dimensions')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__width\",\n\t\t\t\t\t\t\t\t\tlabel: __('Width'),\n\t\t\t\t\t\t\t\t\tvalue: width !== undefined ? width : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageWidth,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateWidth\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\tclassName: \"block-library-image__dimensions__height\",\n\t\t\t\t\t\t\t\t\tlabel: __('Height'),\n\t\t\t\t\t\t\t\t\tvalue: height !== undefined ? height : '',\n\t\t\t\t\t\t\t\t\tplaceholder: imageHeight,\n\t\t\t\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\t\t\t\tonChange: _this5.updateHeight\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t{ className: \"block-library-image__dimensions__row\" },\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButtonGroup,\n\t\t\t\t\t\t\t\t\t{ \"aria-label\": __('Image Size') },\n\t\t\t\t\t\t\t\t\t[25, 50, 75, 100].map(function (scale) {\n\t\t\t\t\t\t\t\t\t\tvar scaledWidth = Math.round(imageWidth * (scale / 100));\n\t\t\t\t\t\t\t\t\t\tvar scaledHeight = Math.round(imageHeight * (scale / 100));\n\n\t\t\t\t\t\t\t\t\t\tvar isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tkey: scale,\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary: isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\t\"aria-pressed\": isCurrent,\n\t\t\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions(scaledWidth, scaledHeight)\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t\t\t\t\t\"%\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\t\t\tonClick: _this5.updateDimensions()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t__('Reset')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t};\n\n\t\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\tcontrols,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"figure\",\n\t\t\t\t\t{ className: classes },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__image_size__[\"a\" /* default */],\n\t\t\t\t\t\t{ src: url, dirtynessTrigger: align },\n\t\t\t\t\t\tfunction (sizes) {\n\t\t\t\t\t\t\tvar imageWidthWithinContainer = sizes.imageWidthWithinContainer,\n\t\t\t\t\t\t\t imageHeightWithinContainer = sizes.imageHeightWithinContainer,\n\t\t\t\t\t\t\t imageWidth = sizes.imageWidth,\n\t\t\t\t\t\t\t imageHeight = sizes.imageHeight;\n\n\n\t\t\t\t\t\t\tvar filename = _this5.getFilename(url);\n\t\t\t\t\t\t\tvar defaultedAlt = void 0;\n\t\t\t\t\t\t\tif (alt) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if (filename) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf(__('This image has an empty alt attribute; its file name is %s'), filename);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __('This image has an empty alt attribute');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar img =\n\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"ta\",\n\t\t\t\t\t\t\t\t\t{ linkid: linkid, href: href },\n\t\t\t\t\t\t\t\t\twp.element.createElement(\"img\", { src: url, alt: defaultedAlt, onClick: _this5.onImageClick, onError: function onError() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.onImageError(url);\n\t\t\t\t\t\t\t\t\t\t} })\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tisBlobURL(url) && wp.element.createElement(Spinner, null)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t;\n\n\t\t\t\t\t\t\tif (!isResizable || !imageWidthWithinContainer) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t\t\t\t{ style: { width: width, height: height } },\n\t\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tvar currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tvar ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tvar minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tvar minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tvar maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tvar showRightHandle = false;\n\t\t\t\t\t\t\tvar showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif (align === 'center') {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if (isRTL) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif (align === 'left') {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif (align === 'right') {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\tFragment,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tgetInspectorControls(imageWidth, imageHeight),\n\t\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t\tResizableBox,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tsize: width && height ? {\n\t\t\t\t\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t\t\t\t\t\theight: height\n\t\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\t\tminWidth: minWidth,\n\t\t\t\t\t\t\t\t\t\tmaxWidth: maxWidthBuffer,\n\t\t\t\t\t\t\t\t\t\tminHeight: minHeight,\n\t\t\t\t\t\t\t\t\t\tmaxHeight: maxWidthBuffer / ratio,\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio: true,\n\t\t\t\t\t\t\t\t\t\tenable: {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStart: function onResizeStart() {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(false);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonResizeStop: function onResizeStop(event, direction, elt, delta) {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes({\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt(currentWidth + delta.width, 10),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt(currentHeight + delta.height, 10)\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\timg\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t(!RichText.isEmpty(caption) || isSelected) && wp.element.createElement(RichText, {\n\t\t\t\t\t\ttagName: \"figcaption\",\n\t\t\t\t\t\tplaceholder: __('Write caption…'),\n\t\t\t\t\t\tvalue: caption,\n\t\t\t\t\t\tunstableOnFocus: this.onFocusCaption,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ caption: value });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisSelected: this.state.captionFocused,\n\t\t\t\t\t\tinlineToolbar: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\t}\n\t}]);\n\n\treturn ImageEdit;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (compose([withSelect(function (select, props) {\n\tvar _select = select('core'),\n\t getMedia = _select.getMedia;\n\n\tvar _select2 = select('core/editor'),\n\t getEditorSettings = _select2.getEditorSettings;\n\n\tvar id = props.attributes.id;\n\n\tvar _getEditorSettings = getEditorSettings(),\n\t maxWidth = _getEditorSettings.maxWidth,\n\t isRTL = _getEditorSettings.isRTL,\n\t imageSizes = _getEditorSettings.imageSizes;\n\n\treturn {\n\t\timage: id ? getMedia(id) : null,\n\t\tmaxWidth: maxWidth,\n\t\tisRTL: isRTL,\n\t\timageSizes: imageSizes\n\t};\n}), withViewportMatch({ isLargeViewport: 'medium' }), withNotices])(ImageEdit));\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return createUpgradedEmbedBlock; });\n/* unused harmony export isFromWordPress */\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nvar _lodash = lodash,\n includes = _lodash.includes;\nvar renderToString = wp.element.renderToString;\nvar createBlock = wp.blocks.createBlock;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\n\nvar createUpgradedEmbedBlock = function createUpgradedEmbedBlock(props, attributesFromPreview) {\n\tvar preview = props.preview,\n\t name = props.name;\n\tvar url = props.attributes.url;\n\n\n\tif (!url) {\n\t\treturn;\n\t}\n\n\tvar matchingBlock = findBlock(url);\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif (WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif (name !== matchingBlock) {\n\t\t\treturn createBlock(matchingBlock, { url: url });\n\t\t}\n\t}\n\n\tif (preview) {\n\t\tvar html = preview.html;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\n\t\tif (isFromWordPress(html)) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif (WORDPRESS_EMBED_BLOCK !== name) {\n\t\t\t\treturn createBlock(WORDPRESS_EMBED_BLOCK, _extends({\n\t\t\t\t\turl: url\n\t\t\t\t}, attributesFromPreview));\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar isFromWordPress = function isFromWordPress(html) {\n\treturn includes(html, 'class=\"wp-embedded-content\" data-secret');\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _lodash = lodash,\n noop = _lodash.noop;\nvar withGlobalEvents = wp.compose.withGlobalEvents;\nvar Component = wp.element.Component;\n\nvar ImageSize = function (_Component) {\n\t_inherits(ImageSize, _Component);\n\n\tfunction ImageSize() {\n\t\t_classCallCheck(this, ImageSize);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ImageSize.__proto__ || Object.getPrototypeOf(ImageSize)).apply(this, arguments));\n\n\t\t_this.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined\n\t\t};\n\t\t_this.bindContainer = _this.bindContainer.bind(_this);\n\t\t_this.calculateSize = _this.calculateSize.bind(_this);\n\t\treturn _this;\n\t}\n\n\t_createClass(ImageSize, [{\n\t\tkey: 'bindContainer',\n\t\tvalue: function bindContainer(ref) {\n\t\t\tthis.container = ref;\n\t\t}\n\t}, {\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate(prevProps) {\n\t\t\tif (this.props.src !== prevProps.src) {\n\t\t\t\tthis.setState({\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined\n\t\t\t\t});\n\t\t\t\tthis.fetchImageSize();\n\t\t\t}\n\n\t\t\tif (this.props.dirtynessTrigger !== prevProps.dirtynessTrigger) {\n\t\t\t\tthis.calculateSize();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.fetchImageSize();\n\t\t}\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tif (this.image) {\n\t\t\t\tthis.image.onload = noop;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'fetchImageSize',\n\t\tvalue: function fetchImageSize() {\n\t\t\tthis.image = new window.Image();\n\t\t\tthis.image.onload = this.calculateSize;\n\t\t\tthis.image.src = this.props.src;\n\t\t}\n\t}, {\n\t\tkey: 'calculateSize',\n\t\tvalue: function calculateSize() {\n\t\t\tvar maxWidth = this.container.clientWidth;\n\t\t\tvar exceedMaxWidth = this.image.width > maxWidth;\n\t\t\tvar ratio = this.image.height / this.image.width;\n\t\t\tvar width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\t\tvar height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\t\tthis.setState({ width: width, height: height });\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar sizes = {\n\t\t\t\timageWidth: this.image && this.image.width,\n\t\t\t\timageHeight: this.image && this.image.height,\n\t\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\t\timageHeightWithinContainer: this.state.height\n\t\t\t};\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ ref: this.bindContainer },\n\t\t\t\tthis.props.children(sizes)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ImageSize;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withGlobalEvents({\n\tresize: 'calculateSize'\n})(ImageSize));\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover,\n TextControl = _wp$components.TextControl;\nvar withInstanceId = wp.compose.withInstanceId;\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.searchAffiliateLinks = _this.searchAffiliateLinks.bind(_this);\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: \"componentDidUpdate\",\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\tscrollIntoView(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: \"componentWillUnmount\",\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: \"bindSuggestionNode\",\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\t}, {\n\t\tkey: \"searchAffiliateLinks\",\n\t\tvalue: function searchAffiliateLinks(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters=\n\t\t\tif (value.length < 2) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\t\t\tformData.append(\"with_images\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"selectLink\",\n\t\tvalue: function selectLink(post) {\n\t\t\t// this.props.onChange( post.link, post );\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: post,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\n\t\t\tthis.props.updateImageSelection(post.images, post);\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: \"handleOnClick\",\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\t// this.inputRef.current.focus();\n\t\t}\n\t}, {\n\t\tkey: \"render\",\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId;\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t posts = _state2.posts,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t loading = _state2.loading;\n\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"div\",\n\t\t\t\t{ \"class\": \"edit-search-affiliate-links\" },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t\"form\",\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: \"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\",\n\t\t\t\t\t\tonSubmit: this.displayAffiliateImages\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tclassName: \"ta-search-affiliate-links\",\n\t\t\t\t\t\tplaceholder: __(\"Type to search affiliate links\"),\n\t\t\t\t\t\tonChange: this.searchAffiliateLinks,\n\t\t\t\t\t\tautocomplete: \"off\"\n\t\t\t\t\t}),\n\t\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\t\tshowSuggestions && !!posts.length && wp.element.createElement(\n\t\t\t\t\t\tPopover,\n\t\t\t\t\t\t{ position: \"bottom\", focusOnMount: false },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\t{ \"class\": \"affilate-links-suggestions\" },\n\t\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t\t\"button\",\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t\t\t\t\t\ttabIndex: \"-1\",\n\t\t\t\t\t\t\t\t\t\tid: \"editor-url-input-suggestion-\" + instanceId + \"-\" + index,\n\t\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"aria-selected\": index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = registerFormats;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ta_link__ = __webpack_require__(9);\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n\n\nvar registerFormatType = wp.richText.registerFormatType;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\n\nfunction registerFormats() {\n\n [__WEBPACK_IMPORTED_MODULE_0__ta_link__[\"a\" /* taLink */]].forEach(function (_ref) {\n var name = _ref.name,\n settings = _objectWithoutProperties(_ref, [\"name\"]);\n\n return registerFormatType(name, settings);\n });\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return taLink; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inline__ = __webpack_require__(10);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSpokenMessages = wp.components.withSpokenMessages;\nvar _wp$richText = wp.richText,\n getTextContent = _wp$richText.getTextContent,\n applyFormat = _wp$richText.applyFormat,\n removeFormat = _wp$richText.removeFormat,\n slice = _wp$richText.slice;\nvar isURL = wp.url.isURL;\nvar _wp$editor = wp.editor,\n RichTextToolbarButton = _wp$editor.RichTextToolbarButton,\n RichTextShortcut = _wp$editor.RichTextShortcut;\nvar _wp$components = wp.components,\n Path = _wp$components.Path,\n SVG = _wp$components.SVG;\nvar getRectangleFromRange = wp.dom.getRectangleFromRange;\n\n\nvar name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nvar taLink = {\n\tname: name,\n\ttitle: __(\"Affiliate Link\"),\n\ttagName: \"ta\",\n\tclassName: null,\n\tattributes: {\n\t\turl: \"href\",\n\t\ttarget: \"target\"\n\t},\n\tedit: withSpokenMessages(function (_Component) {\n\t\t_inherits(LinkEdit, _Component);\n\n\t\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\t\tfunction LinkEdit() {\n\t\t\t_classCallCheck(this, LinkEdit);\n\n\t\t\tvar _this = _possibleConstructorReturn(this, (LinkEdit.__proto__ || Object.getPrototypeOf(LinkEdit)).apply(this, arguments));\n\n\t\t\t_this.addLink = _this.addLink.bind(_this);\n\t\t\t_this.stopAddingLink = _this.stopAddingLink.bind(_this);\n\t\t\t_this.onRemoveFormat = _this.onRemoveFormat.bind(_this);\n\t\t\t_this.state = {\n\t\t\t\taddingLink: false\n\t\t\t};\n\t\t\treturn _this;\n\t\t}\n\n\t\t/**\n * Callback to set state to adding link status.\n * \n * @since 3.6\n */\n\n\n\t\t_createClass(LinkEdit, [{\n\t\t\tkey: \"addLink\",\n\t\t\tvalue: function addLink() {\n\t\t\t\tvar _props = this.props,\n\t\t\t\t value = _props.value,\n\t\t\t\t onChange = _props.onChange;\n\n\t\t\t\tvar text = getTextContent(slice(value));\n\n\t\t\t\tif (text && isURL(text)) {\n\t\t\t\t\tonChange(applyFormat(value, { type: name, attributes: { url: text } }));\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState({ addingLink: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n * Callback to set state to stop adding link status.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"stopAddingLink\",\n\t\t\tvalue: function stopAddingLink() {\n\t\t\t\tthis.setState({ addingLink: false });\n\t\t\t}\n\n\t\t\t/**\n * Remove format event callback.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"onRemoveFormat\",\n\t\t\tvalue: function onRemoveFormat() {\n\t\t\t\tvar _props2 = this.props,\n\t\t\t\t value = _props2.value,\n\t\t\t\t onChange = _props2.onChange,\n\t\t\t\t speak = _props2.speak;\n\n\n\t\t\t\tonChange(removeFormat(value, name));\n\t\t\t\tspeak(__(\"Affiliate Link removed.\"), \"assertive\");\n\t\t\t}\n\n\t\t\t/**\n * Get selected anchor text.\n * \n * @since 3.9\n */\n\n\t\t}, {\n\t\t\tkey: \"getAnchorRect\",\n\t\t\tvalue: function getAnchorRect() {\n\n\t\t\t\tvar selection = window.getSelection();\n\t\t\t\tvar range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n\t\t\t\tif (!range) return;\n\n\t\t\t\tvar rect = null;\n\n\t\t\t\tif (this.state.addingLink) {\n\t\t\t\t\trect = getRectangleFromRange(range);\n\t\t\t\t} else {\n\n\t\t\t\t\tvar element = range.startContainer;\n\n\t\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\t\twhile (element.nodeType !== window.Node.ELEMENT_NODE) {\n\t\t\t\t\t\telement = element.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar closest = element.closest('ta');\n\t\t\t\t\tif (closest) {\n\t\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t\t}, {\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tvar _props3 = this.props,\n\t\t\t\t isActive = _props3.isActive,\n\t\t\t\t activeAttributes = _props3.activeAttributes,\n\t\t\t\t value = _props3.value,\n\t\t\t\t onChange = _props3.onChange;\n\n\n\t\t\t\tvar anchorRect = this.getAnchorRect();\n\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\tFragment,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"access\",\n\t\t\t\t\t\tcharacter: \"s\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primary\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.addLink\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(RichTextShortcut, {\n\t\t\t\t\t\ttype: \"primaryShift\",\n\t\t\t\t\t\tcharacter: \"l\",\n\t\t\t\t\t\tonUse: this.onRemoveFormat\n\t\t\t\t\t}),\n\t\t\t\t\tisActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: \"editor-unlink\",\n\t\t\t\t\t\ttitle: __('Remove Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-unlink-button\",\n\t\t\t\t\t\tonClick: this.onRemoveFormat,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tshortcutType: \"primaryShift\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\t!isActive && wp.element.createElement(RichTextToolbarButton, {\n\t\t\t\t\t\ticon: wp.element.createElement(\n\t\t\t\t\t\t\tSVG,\n\t\t\t\t\t\t\t{ xmlns: \"http://www.w3.org/2000/svg\", width: \"16.688\", height: \"9.875\", viewBox: \"0 0 16.688 9.875\" },\n\t\t\t\t\t\t\twp.element.createElement(Path, { id: \"TA.svg\", fill: \"black\", \"class\": \"cls-1\", d: \"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\", transform: \"translate(-1.188 -5.25)\" })\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttitle: __('Affiliate Link'),\n\t\t\t\t\t\tclassName: \"ta-link-button\",\n\t\t\t\t\t\tonClick: this.addLink,\n\t\t\t\t\t\tshortcutType: \"primary\",\n\t\t\t\t\t\tshortcutCharacter: \"l\"\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_0__inline__[\"a\" /* default */], {\n\t\t\t\t\t\taddingLink: this.state.addingLink,\n\t\t\t\t\t\tstopAddingLink: this.stopAddingLink,\n\t\t\t\t\t\tisActive: isActive,\n\t\t\t\t\t\tactiveAttributes: activeAttributes,\n\t\t\t\t\t\tanchorRect: anchorRect,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tonChange: onChange\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}]);\n\n\t\treturn LinkEdit;\n\t}(Component))\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(11);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_popover__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_input__ = __webpack_require__(13);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar __ = wp.i18n.__;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$components = wp.components,\n ExternalLink = _wp$components.ExternalLink,\n ToggleControl = _wp$components.ToggleControl,\n IconButton = _wp$components.IconButton,\n withSpokenMessages = _wp$components.withSpokenMessages;\nvar _wp$keycodes = wp.keycodes,\n LEFT = _wp$keycodes.LEFT,\n RIGHT = _wp$keycodes.RIGHT,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n BACKSPACE = _wp$keycodes.BACKSPACE,\n ENTER = _wp$keycodes.ENTER;\nvar _wp$url = wp.url,\n prependHTTP = _wp$url.prependHTTP,\n safeDecodeURI = _wp$url.safeDecodeURI,\n filterURLForDisplay = _wp$url.filterURLForDisplay;\nvar _wp$richText = wp.richText,\n create = _wp$richText.create,\n insert = _wp$richText.insert,\n isCollapsed = _wp$richText.isCollapsed,\n applyFormat = _wp$richText.applyFormat,\n getTextContent = _wp$richText.getTextContent,\n slice = _wp$richText.slice;\n\n\nvar stopKeyPropagation = function stopKeyPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat(_ref) {\n\tvar url = _ref.url,\n\t linkid = _ref.linkid,\n\t text = _ref.text;\n\n\tvar format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl: url,\n\t\t\tlinkid: linkid.toString()\n\t\t}\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput(props, state) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nvar LinkEditor = function LinkEditor(_ref2) {\n\tvar value = _ref2.value,\n\t onChangeInputValue = _ref2.onChangeInputValue,\n\t onKeyDown = _ref2.onKeyDown,\n\t submitLink = _ref2.submitLink,\n\t invalidLink = _ref2.invalidLink,\n\t resetInvalidLink = _ref2.resetInvalidLink,\n\t autocompleteRef = _ref2.autocompleteRef;\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'form',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover',\n\t\t\t\tonKeyPress: stopKeyPropagation,\n\t\t\t\tonKeyDown: onKeyDown,\n\t\t\t\tonSubmit: submitLink\n\t\t\t},\n\t\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__url_input__[\"a\" /* default */], {\n\t\t\t\tvalue: value,\n\t\t\t\tonChange: onChangeInputValue,\n\t\t\t\tautocompleteRef: autocompleteRef,\n\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\tresetInvalidLink: resetInvalidLink\n\t\t\t}),\n\t\t\twp.element.createElement(IconButton, { icon: 'editor-break', label: __('Apply'), type: 'submit' })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\n\t);\n};\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewerUrl = function LinkViewerUrl(_ref3) {\n\tvar url = _ref3.url;\n\n\tvar prependedURL = prependHTTP(url);\n\tvar linkClassName = __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': !Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(prependedURL)\n\t});\n\n\tif (!url) {\n\t\treturn wp.element.createElement('span', { className: linkClassName });\n\t}\n\n\treturn wp.element.createElement(\n\t\tExternalLink,\n\t\t{\n\t\t\tclassName: linkClassName,\n\t\t\thref: url\n\t\t},\n\t\tfilterURLForDisplay(safeDecodeURI(url))\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nvar LinkViewer = function LinkViewer(_ref4) {\n\tvar url = _ref4.url,\n\t editLink = _ref4.editLink;\n\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\twp.element.createElement(\n\t\t\t'div',\n\t\t\t{\n\t\t\t\tclassName: 'editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content',\n\t\t\t\tonKeyPress: stopKeyPropagation\n\t\t\t},\n\t\t\twp.element.createElement(LinkViewerUrl, { url: url }),\n\t\t\twp.element.createElement(IconButton, { icon: 'edit', label: __('Edit'), onClick: editLink })\n\t\t)\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\n\nvar InlineAffiliateLinkUI = function (_Component) {\n\t_inherits(InlineAffiliateLinkUI, _Component);\n\n\tfunction InlineAffiliateLinkUI() {\n\t\t_classCallCheck(this, InlineAffiliateLinkUI);\n\n\t\tvar _this = _possibleConstructorReturn(this, (InlineAffiliateLinkUI.__proto__ || Object.getPrototypeOf(InlineAffiliateLinkUI)).apply(this, arguments));\n\n\t\t_this.editLink = _this.editLink.bind(_this);\n\t\t_this.submitLink = _this.submitLink.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.onChangeInputValue = _this.onChangeInputValue.bind(_this);\n\t\t_this.onClickOutside = _this.onClickOutside.bind(_this);\n\t\t_this.resetState = _this.resetState.bind(_this);\n\t\t_this.autocompleteRef = createRef();\n\t\t_this.resetInvalidLink = _this.resetInvalidLink.bind(_this);\n\n\t\t_this.state = {\n\t\t\tinputValue: '',\n\t\t\tlinkid: 0,\n\t\t\tpost: null,\n\t\t\tinvalidLink: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n * \n * @since 3.6\n * \n * @param {Object} event Event object.\n */\n\n\n\t_createClass(InlineAffiliateLinkUI, [{\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tif ([LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER].indexOf(event.keyCode) > -1) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to set state when input value is changed.\n * \n * @since 3.6\n * \n * @param {*} inputValue \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'onChangeInputValue',\n\t\tvalue: function onChangeInputValue(inputValue) {\n\t\t\tvar post = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar linkid = post ? post.id : 0;\n\t\t\tthis.setState({ inputValue: inputValue, linkid: linkid, post: post });\n\t\t}\n\n\t\t/**\n * Callback to set state when edit affiliate link (already inserted) is triggered.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'editLink',\n\t\tvalue: function editLink(event) {\n\t\t\tthis.setState({ editLink: true });\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n * Callback to apply the affiliate link format to the selected text or position in the active block.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'submitLink',\n\t\tvalue: function submitLink(event) {\n\t\t\tvar _props = this.props,\n\t\t\t isActive = _props.isActive,\n\t\t\t value = _props.value,\n\t\t\t onChange = _props.onChange,\n\t\t\t speak = _props.speak;\n\t\t\tvar _state = this.state,\n\t\t\t inputValue = _state.inputValue,\n\t\t\t linkid = _state.linkid,\n\t\t\t post = _state.post;\n\n\t\t\tvar url = prependHTTP(inputValue);\n\t\t\tvar selectedText = getTextContent(slice(value));\n\t\t\tvar format = createLinkFormat({\n\t\t\t\turl: url,\n\t\t\t\tlinkid: linkid,\n\t\t\t\ttext: selectedText\n\t\t\t});\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif (!linkid || !post) {\n\t\t\t\tthis.setState({ invalidLink: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCollapsed(value) && !isActive) {\n\t\t\t\tvar toInsert = applyFormat(create({ text: post.title }), format, 0, url.length);\n\t\t\t\tonChange(insert(value, toInsert));\n\t\t\t} else {\n\t\t\t\tonChange(applyFormat(value, format));\n\t\t\t}\n\n\t\t\tthis.resetState();\n\n\t\t\tif (!Object(__WEBPACK_IMPORTED_MODULE_1__utils__[\"a\" /* isValidHref */])(url)) {\n\t\t\t\tspeak(__('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');\n\t\t\t} else if (isActive) {\n\t\t\t\tspeak(__('Link edited.'), 'assertive');\n\t\t\t} else {\n\t\t\t\tspeak(__('Link inserted'), 'assertive');\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Callback to run when users clicks outside the popover UI.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onClickOutside',\n\t\tvalue: function onClickOutside(event) {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tvar autocompleteElement = this.autocompleteRef.current;\n\t\t\tif (autocompleteElement && autocompleteElement.contains(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.resetState();\n\t\t}\n\n\t\t/**\n * Reset state callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetState',\n\t\tvalue: function resetState() {\n\t\t\tthis.props.stopAddingLink();\n\t\t\tthis.setState({ inputValue: '', editLink: false });\n\t\t\tthis.resetInvalidLink();\n\t\t}\n\n\t\t/**\n * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'resetInvalidLink',\n\t\tvalue: function resetInvalidLink() {\n\t\t\tthis.setState({ invalidLink: false });\n\t\t}\n\n\t\t/**\n * Component render method.\n *\n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props2 = this.props,\n\t\t\t isActive = _props2.isActive,\n\t\t\t _props2$activeAttribu = _props2.activeAttributes,\n\t\t\t url = _props2$activeAttribu.url,\n\t\t\t linkid = _props2$activeAttribu.linkid,\n\t\t\t addingLink = _props2.addingLink,\n\t\t\t anchorRect = _props2.anchorRect,\n\t\t\t value = _props2.value,\n\t\t\t onChange = _props2.onChange;\n\n\n\t\t\tif (!isActive && !addingLink) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar _state2 = this.state,\n\t\t\t inputValue = _state2.inputValue,\n\t\t\t invalidLink = _state2.invalidLink;\n\n\t\t\tvar showInput = isShowingInput(this.props, this.state);\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_2__url_popover__[\"a\" /* default */],\n\t\t\t\t{\n\t\t\t\t\tonClickOutside: this.onClickOutside,\n\t\t\t\t\tonClose: this.resetState,\n\t\t\t\t\tfocusOnMount: showInput ? 'firstElement' : false,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tanchorRect: anchorRect\n\t\t\t\t},\n\t\t\t\tshowInput ? wp.element.createElement(LinkEditor, {\n\t\t\t\t\tvalue: inputValue,\n\t\t\t\t\tonChangeInputValue: this.onChangeInputValue,\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\tsubmitLink: this.submitLink,\n\t\t\t\t\tautocompleteRef: this.autocompleteRef,\n\t\t\t\t\tupdateLinkId: this.updateLinkId,\n\t\t\t\t\tinvalidLink: invalidLink,\n\t\t\t\t\tresetInvalidLink: this.resetInvalidLink\n\t\t\t\t}) : wp.element.createElement(LinkViewer, {\n\t\t\t\t\turl: url,\n\t\t\t\t\teditLink: this.editLink\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn InlineAffiliateLinkUI;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(InlineAffiliateLinkUI));\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isValidHref;\nvar _lodash = lodash,\n startsWith = _lodash.startsWith;\nvar _wp$url = wp.url,\n getProtocol = _wp$url.getProtocol,\n isValidProtocol = _wp$url.isValidProtocol,\n getAuthority = _wp$url.getAuthority,\n isValidAuthority = _wp$url.isValidAuthority,\n getPath = _wp$url.getPath,\n isValidPath = _wp$url.isValidPath,\n getQueryString = _wp$url.getQueryString,\n isValidQueryString = _wp$url.isValidQueryString,\n getFragment = _wp$url.getFragment,\n isValidFragment = _wp$url.isValidFragment;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\n\nfunction isValidHref(href) {\n\tif (!href) {\n\t\treturn false;\n\t}\n\n\tvar trimmedHref = href.trim();\n\n\tif (!trimmedHref) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif (/^\\S+:/.test(trimmedHref)) {\n\t\tvar protocol = getProtocol(trimmedHref);\n\t\tif (!isValidProtocol(protocol)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif (startsWith(protocol, 'http') && !/^https?:\\/\\/[^\\/\\s]/i.test(trimmedHref)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar authority = getAuthority(trimmedHref);\n\t\tif (!isValidAuthority(authority)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar path = getPath(trimmedHref);\n\t\tif (path && !isValidPath(path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar queryString = getQueryString(trimmedHref);\n\t\tif (queryString && !isValidQueryString(queryString)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar fragment = getFragment(trimmedHref);\n\t\tif (fragment && !isValidFragment(fragment)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif (startsWith(trimmedHref, '#') && !isValidFragment(trimmedHref)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _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; }; }();\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar __ = wp.i18n.__;\nvar Component = wp.element.Component;\nvar _wp$components = wp.components,\n Popover = _wp$components.Popover,\n IconButton = _wp$components.IconButton;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLPopover = function (_Component) {\n\t_inherits(ThirstyURLPopover, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tfunction ThirstyURLPopover() {\n\t\t_classCallCheck(this, ThirstyURLPopover);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLPopover.__proto__ || Object.getPrototypeOf(ThirstyURLPopover)).apply(this, arguments));\n\n\t\t_this.toggleSettingsVisibility = _this.toggleSettingsVisibility.bind(_this);\n\n\t\t_this.state = {\n\t\t\tisSettingsExpanded: false\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component constructor.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLPopover, [{\n\t\tkey: 'toggleSettingsVisibility',\n\t\tvalue: function toggleSettingsVisibility() {\n\t\t\tthis.setState({\n\t\t\t\tisSettingsExpanded: !this.state.isSettingsExpanded\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _props = this.props,\n\t\t\t children = _props.children,\n\t\t\t renderSettings = _props.renderSettings,\n\t\t\t invalidLink = _props.invalidLink,\n\t\t\t _props$position = _props.position,\n\t\t\t position = _props$position === undefined ? 'bottom center' : _props$position,\n\t\t\t _props$focusOnMount = _props.focusOnMount,\n\t\t\t focusOnMount = _props$focusOnMount === undefined ? 'firstElement' : _props$focusOnMount,\n\t\t\t popoverProps = _objectWithoutProperties(_props, ['children', 'renderSettings', 'invalidLink', 'position', 'focusOnMount']);\n\n\t\t\tvar isSettingsExpanded = this.state.isSettingsExpanded;\n\n\n\t\t\tvar showSettings = !!renderSettings && isSettingsExpanded;\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\tPopover,\n\t\t\t\t_extends({\n\t\t\t\t\tclassName: 'ta-url-popover editor-url-popover block-editor-url-popover',\n\t\t\t\t\tfocusOnMount: focusOnMount,\n\t\t\t\t\tposition: position\n\t\t\t\t}, popoverProps),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row' },\n\t\t\t\t\tchildren,\n\t\t\t\t\t!!renderSettings && wp.element.createElement(IconButton, {\n\t\t\t\t\t\tclassName: 'editor-url-popover__settings-toggle',\n\t\t\t\t\t\ticon: 'ellipsis',\n\t\t\t\t\t\tlabel: __('Link Settings'),\n\t\t\t\t\t\tonClick: this.toggleSettingsVisibility,\n\t\t\t\t\t\t'aria-expanded': isSettingsExpanded\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\tshowSettings && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'editor-url-popover__row editor-url-popover__settings' },\n\t\t\t\t\trenderSettings()\n\t\t\t\t),\n\t\t\t\tinvalidLink && wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ 'class': 'ta-invalid-link' },\n\t\t\t\t\t__('Invalid affiliate link')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn ThirstyURLPopover;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (ThirstyURLPopover);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_classnames__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view__);\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar __ = wp.i18n.__;\nvar _lodash = lodash,\n throttle = _lodash.throttle;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n createRef = _wp$element.createRef;\nvar _wp$keycodes = wp.keycodes,\n UP = _wp$keycodes.UP,\n DOWN = _wp$keycodes.DOWN,\n ENTER = _wp$keycodes.ENTER,\n TAB = _wp$keycodes.TAB;\nvar _wp$components = wp.components,\n Spinner = _wp$components.Spinner,\n withSpokenMessages = _wp$components.withSpokenMessages,\n Popover = _wp$components.Popover;\nvar withInstanceId = wp.compose.withInstanceId;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\n\nvar stopEventPropagation = function stopEventPropagation(event) {\n\treturn event.stopPropagation();\n};\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\n\nvar ThirstyURLInput = function (_Component) {\n\t_inherits(ThirstyURLInput, _Component);\n\n\t/**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tfunction ThirstyURLInput(_ref) {\n\t\tvar autocompleteRef = _ref.autocompleteRef;\n\n\t\t_classCallCheck(this, ThirstyURLInput);\n\n\t\tvar _this = _possibleConstructorReturn(this, (ThirstyURLInput.__proto__ || Object.getPrototypeOf(ThirstyURLInput)).apply(this, arguments));\n\n\t\t_this.onChange = _this.onChange.bind(_this);\n\t\t_this.onKeyDown = _this.onKeyDown.bind(_this);\n\t\t_this.autocompleteRef = autocompleteRef || createRef();\n\t\t_this.inputRef = createRef();\n\t\t_this.updateSuggestions = throttle(_this.updateSuggestions.bind(_this), 200);\n\n\t\t_this.suggestionNodes = [];\n\n\t\t_this.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null\n\t\t};\n\t\treturn _this;\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\n\n\t_createClass(ThirstyURLInput, [{\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _state = this.state,\n\t\t\t showSuggestions = _state.showSuggestions,\n\t\t\t selectedSuggestion = _state.selectedSuggestion;\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded\n\n\t\t\tif (showSuggestions && selectedSuggestion !== null && !this.scrollingIntoView) {\n\t\t\t\tthis.scrollingIntoView = true;\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1_dom_scroll_into_view___default()(this.suggestionNodes[selectedSuggestion], this.autocompleteRef.current, {\n\t\t\t\t\tonlyScrollIfNeeded: true\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_this2.scrollingIntoView = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tdelete this.suggestionsRequest;\n\t\t}\n\n\t\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\n\t}, {\n\t\tkey: 'bindSuggestionNode',\n\t\tvalue: function bindSuggestionNode(index) {\n\t\t\tvar _this3 = this;\n\n\t\t\treturn function (ref) {\n\t\t\t\t_this3.suggestionNodes[index] = ref;\n\t\t\t};\n\t\t}\n\n\t\t/**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\n\t}, {\n\t\tkey: 'updateSuggestions',\n\t\tvalue: function updateSuggestions(value) {\n\t\t\tvar _this4 = this;\n\n\t\t\t// Show the suggestions after typing at least 2 characters\n\t\t\t// and also for URLs\n\t\t\tif (value.length < 2 || /^https?:/.test(value)) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tshowSuggestions: false,\n\t\t\t\t\tselectedSuggestion: null,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowSuggestions: true,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: true\n\t\t\t});\n\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"action\", \"search_affiliate_links_query\");\n\t\t\tformData.append(\"keyword\", value);\n\t\t\tformData.append(\"paged\", 1);\n\t\t\tformData.append(\"gutenberg\", true);\n\n\t\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n\t\t\t// to filter results with category value. This is to prepare next update to add category filter.\n\t\t\tvar request = fetch(ajaxurl, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData\n\t\t\t});\n\n\t\t\trequest.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function (response) {\n\n\t\t\t\tif (!response.affiliate_links) return;\n\n\t\t\t\tvar posts = response.affiliate_links;\n\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif (_this4.suggestionsRequest !== request) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_this4.setState({\n\t\t\t\t\tposts: posts,\n\t\t\t\t\tloading: false\n\t\t\t\t});\n\n\t\t\t\tif (!!posts.length) {\n\t\t\t\t\t_this4.props.debouncedSpeak(sprintf(_n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', posts.length), posts.length), 'assertive');\n\t\t\t\t} else {\n\t\t\t\t\t_this4.props.debouncedSpeak(__('No results.'), 'assertive');\n\t\t\t\t}\n\t\t\t}).catch(function () {\n\t\t\t\tif (_this4.suggestionsRequest === request) {\n\t\t\t\t\t_this4.setState({\n\t\t\t\t\t\tloading: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.suggestionsRequest = request;\n\t\t}\n\n\t\t/**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onChange',\n\t\tvalue: function onChange(event) {\n\t\t\tthis.props.resetInvalidLink();\n\t\t\tvar inputValue = event.target.value;\n\t\t\tthis.props.onChange(inputValue);\n\t\t\tthis.updateSuggestions(inputValue);\n\t\t}\n\n\t\t/**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\n\t}, {\n\t\tkey: 'onKeyDown',\n\t\tvalue: function onKeyDown(event) {\n\t\t\tvar _state2 = this.state,\n\t\t\t showSuggestions = _state2.showSuggestions,\n\t\t\t selectedSuggestion = _state2.selectedSuggestion,\n\t\t\t posts = _state2.posts,\n\t\t\t loading = _state2.loading;\n\t\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\n\t\t\tif (!showSuggestions || !posts.length || loading) {\n\t\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\t\tswitch (event.keyCode) {\n\t\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t\t// position.\n\t\t\t\t\tcase UP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (0 !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t\t// last position.\n\t\t\t\t\tcase DOWN:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.props.value.length !== event.target.selectionStart) {\n\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\t\t\tevent.target.setSelectionRange(this.props.value.length, this.props.value.length);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar post = this.state.posts[this.state.selectedSuggestion];\n\n\t\t\tswitch (event.keyCode) {\n\t\t\t\tcase UP:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar previousIndex = !selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: previousIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar nextIndex = selectedSuggestion === null || selectedSuggestion === posts.length - 1 ? 0 : selectedSuggestion + 1;\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tselectedSuggestion: nextIndex\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase TAB:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\t\t\tthis.props.speak(__('Link selected'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase ENTER:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.state.selectedSuggestion !== null) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tthis.selectLink(post);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'selectLink',\n\t\tvalue: function selectLink(post) {\n\t\t\tthis.props.onChange(post.link, post);\n\t\t\tthis.setState({\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tshowSuggestions: false\n\t\t\t});\n\t\t}\n\n\t\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\n\t}, {\n\t\tkey: 'handleOnClick',\n\t\tvalue: function handleOnClick(post) {\n\t\t\tthis.selectLink(post);\n\t\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t\tthis.inputRef.current.focus();\n\t\t}\n\n\t\t/**\n * Component render method.\n * \n * @since 3.6\n */\n\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this5 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$value = _props.value,\n\t\t\t value = _props$value === undefined ? '' : _props$value,\n\t\t\t _props$autoFocus = _props.autoFocus,\n\t\t\t autoFocus = _props$autoFocus === undefined ? true : _props$autoFocus,\n\t\t\t instanceId = _props.instanceId,\n\t\t\t invalidLink = _props.invalidLink;\n\t\t\tvar _state3 = this.state,\n\t\t\t showSuggestions = _state3.showSuggestions,\n\t\t\t posts = _state3.posts,\n\t\t\t selectedSuggestion = _state3.selectedSuggestion,\n\t\t\t loading = _state3.loading;\n\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: 'editor-url-input block-editor-url-input' },\n\t\t\t\twp.element.createElement('input', {\n\t\t\t\t\tautoFocus: autoFocus,\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\t'aria-label': __('URL'),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tonChange: this.onChange,\n\t\t\t\t\tonInput: stopEventPropagation,\n\t\t\t\t\tplaceholder: __('Paste URL or type to search'),\n\t\t\t\t\tonKeyDown: this.onKeyDown,\n\t\t\t\t\trole: 'combobox',\n\t\t\t\t\t'aria-expanded': showSuggestions,\n\t\t\t\t\t'aria-autocomplete': 'list',\n\t\t\t\t\t'aria-owns': 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t'aria-activedescendant': selectedSuggestion !== null ? 'editor-url-input-suggestion-' + instanceId + '-' + selectedSuggestion : undefined,\n\t\t\t\t\tref: this.inputRef\n\t\t\t\t}),\n\t\t\t\tloading && wp.element.createElement(Spinner, null),\n\t\t\t\tshowSuggestions && !!posts.length && !invalidLink && wp.element.createElement(\n\t\t\t\t\tPopover,\n\t\t\t\t\t{ position: 'bottom', noArrow: true, focusOnMount: false },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclassName: 'editor-url-input__suggestions block-editor-url-input__suggestions',\n\t\t\t\t\t\t\tid: 'editor-url-input-suggestions-' + instanceId,\n\t\t\t\t\t\t\tref: this.autocompleteRef,\n\t\t\t\t\t\t\trole: 'listbox'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tposts.map(function (post, index) {\n\t\t\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t\t\t'button',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkey: post.id,\n\t\t\t\t\t\t\t\t\trole: 'option',\n\t\t\t\t\t\t\t\t\ttabIndex: '-1',\n\t\t\t\t\t\t\t\t\tid: 'block-editor-url-input-suggestion-' + instanceId + '-' + index,\n\t\t\t\t\t\t\t\t\tref: _this5.bindSuggestionNode(index),\n\t\t\t\t\t\t\t\t\tclassName: __WEBPACK_IMPORTED_MODULE_0_classnames___default()('editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this5.handleOnClick(post);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'aria-selected': index === selectedSuggestion\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tpost.title || __('(no title)')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t}\n\t}]);\n\n\treturn ThirstyURLInput;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (withSpokenMessages(withInstanceId(ThirstyURLInput)));\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(15);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar util = __webpack_require__(16);\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// gutenberg-support.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d99a01d6a74ed422ed81","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classnames/index.js\n// module id = 0\n// module chunks = 0","import registerBlocks from \"./blocks\";\nimport registerFormats from \"./formats\";\n\nimport \"./assets/styles/index.scss\";\n\nregisterBlocks();\nregisterFormats();\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import * as taimage from \"./ta-image\";\n\nconst { registerBlockType } = wp.blocks;\n\n/**\n * Register gutenberg blocks.\n * \n * @since 3.6\n */\nexport default function registerBlocks() {\n\n [\n taimage\n ].forEach( ( block ) => {\n if ( ! block ) return;\n\n const { name , settings } = block;\n registerBlockType( name , settings );\n } );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/index.js","import classnames from \"classnames\";\n\nconst { Fragment } = wp.element;\nconst { __ } = wp.i18n;\nconst { createBlock, getBlockAttributes, getPhrasingContentSchema } = wp.blocks;\nconst { RichText } = wp.editor;\nconst { Path , SVG } = wp.components;\n\nimport edit from \"./edit\";\n\nexport const name = 'ta/image';\n\nconst blockAttributes = {\n\turl: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'src',\n\t},\n\talt: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'img',\n\t\tattribute: 'alt',\n\t\tdefault: '',\n\t},\n\tcaption: {\n\t\ttype: 'string',\n\t\tsource: 'html',\n\t\tselector: 'figcaption',\n\t},\n\tid: {\n\t\ttype: 'number',\n\t},\n\talign: {\n\t\ttype: 'string',\n\t},\n\twidth: {\n\t\ttype: 'number',\n\t},\n\theight: {\n\t\ttype: 'number',\n\t},\n\tlinkid: {\n\t\ttype: 'number',\n\t},\n\thref: {\n\t\ttype: 'string',\n\t\tsource: 'attribute',\n\t\tselector: 'ta',\n\t\tattribute: 'href'\n\t},\n\taffiliateLink: {\n\t\ttype: 'object'\n\t}\n};\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt' ],\n\t\tclasses: [ 'alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\\d+$/ ],\n\t},\n};\n\nconst schema = {\n\tfigure: {\n\t\trequire: [ 'ta' , 'img' ],\n\t\tchildren: {\n\t\t\tta: {\n\t\t\t\tattributes: [ 'href', 'linkid' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: getPhrasingContentSchema(),\n\t\t\t},\n\t\t},\n\t},\n};\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif (\n\t\tfirstElementChild &&\n\t\tfirstElementChild.nodeName === 'A'\n\t) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nexport const settings = {\n\ttitle: __( 'ThirstyAffiliates Image' ),\n\n\tdescription: __( 'Insert an image with an affiliate link to make a visual statement.' ),\n\n\ticon: <SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><Path d=\"M0,0h24v24H0V0z\" fill=\"none\" /><Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" /><Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" /></SVG>,\n\n\tcategory: 'common',\n\n\tkeywords: [\n\t\t'img', // \"img\" is not translated as it is intended to reflect the HTML <img> tag.\n\t\t__( 'photo' ),\n\t\t__( 'affiliate' )\n\t],\n\n\tattributes: blockAttributes,\n\n\tgetEditWrapperProps( attributes ) {\n\t\tconst { align, width } = attributes;\n\t\tif ( 'left' === align || 'center' === align || 'right' === align || 'wide' === align || 'full' === align ) {\n\t\t\treturn { 'data-align': align, 'data-resized': !! width };\n\t\t}\n\t},\n\n\tedit,\n\n\tsave( { attributes } ) {\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tid,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\n\t\tconst classes = classnames( {\n\t\t\t[ `align${ align }` ]: align,\n\t\t\t'is-resized': width || height,\n\t\t} );\n\n\t\tconst image = (\n\t\t\t<img\n\t\t\t\tsrc={ url }\n\t\t\t\talt={ alt }\n\t\t\t\tclassName={ id ? `wp-image-${ id }` : null }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t/>\n\t\t);\n\n\t\tconst figure = (\n\t\t\t<Fragment>\n\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t{ image }\n\t\t\t\t</ta>\n\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t</Fragment>\n\t\t);\n\n\t\tif ( 'left' === align || 'right' === align || 'center' === align ) {\n\t\t\treturn (\n\t\t\t\t<div className='wp-block-image'>\n\t\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t\t{ figure }\n\t\t\t\t\t</figure>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<figure className={ `wp-block-image ${classes}` }>\n\t\t\t\t{ figure }\n\t\t\t</figure>\n\t\t);\n\t}\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/index.js","import classnames from \"classnames\";\n\nconst { get , isEmpty , map , last , pick , compact } = lodash;\nconst { getPath } = wp.url;\nconst { __, sprintf } = wp.i18n;\nconst { Component, Fragment , createRef } = wp.element;\nconst { getBlobByURL, revokeBlobURL, isBlobURL } = wp.blob;\nconst { Placeholder , Button , ButtonGroup , IconButton , PanelBody , ResizableBox , SelectControl , Spinner , TextControl , TextareaControl , Toolbar , withNotices , ToggleControl , Popover } = wp.components;\nconst { withSelect } = wp.data;\nconst { RichText , BlockControls , InspectorControls , MediaUpload , MediaUploadCheck , MediaPlaceholder , BlockAlignmentToolbar , mediaUpload } = wp.editor;\nconst { withViewportMatch } = wp.viewport;\nconst { compose } = wp.compose;\n\nimport { createUpgradedEmbedBlock } from \"./util\";\nimport ImageSize from \"./image-size\";\nimport ThirstyURLInput from './search-input';\n\n/**\n * Module constants\n */\nconst MIN_SIZE = 20;\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst NEW_TAB_REL = 'noreferrer noopener';\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nexport const pickRelevantMediaFiles = ( image ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url = get( image, [ 'sizes', 'large', 'url' ] ) || get( image, [ 'media_details', 'sizes', 'large', 'source_url' ] ) || image.url;\n\treturn imageProps;\n};\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily\n * while the image is being uploaded and will not have an id yet allocated.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the URL a Blob URL\n */\nconst isTemporaryImage = ( id, url ) => ! id && isBlobURL( url );\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no id\n * and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nconst isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\nclass ImageEdit extends Component {\n\tconstructor( { attributes } ) {\n\t\tsuper( ...arguments );\n\t\tthis.updateAlt = this.updateAlt.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.onImageClick = this.onImageClick.bind( this );\n\t\tthis.onSelectImage = this.onSelectImage.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.updateWidth = this.updateWidth.bind( this );\n\t\tthis.updateHeight = this.updateHeight.bind( this );\n\t\tthis.updateDimensions = this.updateDimensions.bind( this );\n\t\tthis.getFilename = this.getFilename.bind( this );\n\t\tthis.toggleIsEditing = this.toggleIsEditing.bind( this );\n\t\tthis.onImageError = this.onImageError.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\t\tthis.updateImageSelection = this.updateImageSelection.bind( this );\n\t\tthis.onSelectAffiliateImage = this.onSelectAffiliateImage.bind( this );\n\t\tthis.editAFfiliateImage = this.editAFfiliateImage.bind( this );\n\n\t\tthis.state = {\n\t\t\tcaptionFocused: false,\n\t\t\tisEditing: ! attributes.url,\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tshowSuggestions : false,\n\t\t\timageSelection : [],\n\t\t\taffiliateLink : null\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes, noticeOperations } = this.props;\n\t\tconst { id, url = '' } = attributes;\n\n\t\tif ( isTemporaryImage( id, url ) ) {\n\t\t\tconst file = getBlobByURL( url );\n\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ image ] ) => {\n\t\t\t\t\t\tsetAttributes( pickRelevantMediaFiles( image ) );\n\t\t\t\t\t},\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t\tonError: ( message ) => {\n\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\tthis.setState( { isEditing: true } );\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { id: prevID, url: prevURL = '' } = prevProps.attributes;\n\t\tconst { id, url = '' } = this.props.attributes;\n\n\t\tif ( isTemporaryImage( prevID, prevURL ) && ! isTemporaryImage( id, url ) ) {\n\t\t\trevokeBlobURL( url );\n\t\t}\n\n\t\tif ( ! this.props.isSelected && prevProps.isSelected && this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSelectImage( media ) {\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tthis.props.setAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { affiliateLink } = this.state;\n\n\t\tthis.setState( {\n\t\t\tisEditing: false,\n\t\t} );\n\n\t\tthis.props.setAttributes( {\n\t\t\t...pickRelevantMediaFiles( media ),\n\t\t\tlinkid: affiliateLink.id,\n\t\t\thref: affiliateLink.link,\n\t\t\taffiliateLink : affiliateLink,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tonImageError( url ) {\n\t\t// Check if there's an embed block that handles this URL.\n\t\tconst embedBlock = createUpgradedEmbedBlock(\n\t\t\t{ attributes: { url } }\n\t\t);\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tthis.props.onReplace( embedBlock );\n\t\t}\n\t}\n\n\tonFocusCaption() {\n\t\tif ( ! this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonImageClick() {\n\t\tif ( this.state.captionFocused ) {\n\t\t\tthis.setState( {\n\t\t\t\tcaptionFocused: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tupdateAlt( newAlt ) {\n\t\tthis.props.setAttributes( { alt: newAlt } );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = [ 'wide', 'full' ].indexOf( nextAlign ) !== -1 ?\n\t\t\t{ width: undefined, height: undefined } :\n\t\t\t{};\n\t\tthis.props.setAttributes( { ...extraUpdatedAttributes, align: nextAlign } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( { url, width: undefined, height: undefined } );\n\t}\n\n\tupdateWidth( width ) {\n\t\tthis.props.setAttributes( { width: parseInt( width, 10 ) } );\n\t}\n\n\tupdateHeight( height ) {\n\t\tthis.props.setAttributes( { height: parseInt( height, 10 ) } );\n\t}\n\n\tupdateDimensions( width = undefined, height = undefined ) {\n\t\treturn () => {\n\t\t\tthis.props.setAttributes( { width, height } );\n\t\t};\n\t}\n\n\tgetFilename( url ) {\n\t\tconst path = getPath( url );\n\t\tif ( path ) {\n\t\t\treturn last( path.split( '/' ) );\n\t\t}\n\t}\n\n\tgetLinkDestinationOptions() {\n\t\treturn [\n\t\t\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n\t\t\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t\t\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t\t\t{ value: LINK_DESTINATION_CUSTOM, label: __( 'Custom URL' ) },\n\t\t];\n\t}\n\n\ttoggleIsEditing() {\n\t\tthis.setState( {\n\t\t\tisEditing: ! this.state.isEditing,\n\t\t} );\n\t}\n\n\tgetImageSizeOptions() {\n\t\tconst { imageSizes, image } = this.props;\n\t\treturn compact( map( imageSizes, ( { name, slug } ) => {\n\t\t\tconst sizeUrl = get( image, [ 'media_details', 'sizes', slug, 'source_url' ] );\n\t\t\tif ( ! sizeUrl ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: sizeUrl,\n\t\t\t\tlabel: name,\n\t\t\t};\n\t\t} ) );\n\t}\n\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\tupdateImageSelection( imageSelection , affiliateLink ) {\n\t\tthis.setState({\n\t\t\timageSelection,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\tonSelectAffiliateImage( image ) {\n\n\t\tif ( isExternalImage( image.id, image.src ) ) {\n\t\t\timage.url = image.src;\n\t\t\tthis.onSelectImage( image );\n\t\t} else {\n\t\t\tconst request = wp.apiFetch( {\n\t\t\t\tpath: wp.url.addQueryArgs( '/wp/v2/media/' + image.id , {\n\t\t\t\t\tcontext: 'edit',\n\t\t\t\t\t_locale: 'user'\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\trequest.then( (media) => {\n\t\t\t\tmedia.url = media.source_url;\n\t\t\t\tthis.onSelectImage( media );\n\t\t\t} );\n\t\t}\n\t}\n\n\teditAFfiliateImage() {\n\n\t\tconst { attributes } = this.props;\n\t\tconst { affiliateLink } = attributes;\n\n\t\tthis.setState({\n\t\t\tisEditing : true,\n\t\t\timageSelection : affiliateLink.images,\n\t\t\taffiliateLink\n\t\t});\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tisEditing,\n\t\t\timageSelection,\n\t\t\taffiliateLink,\n\t\t} = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tsetAttributes,\n\t\t\tisLargeViewport,\n\t\t\tisSelected,\n\t\t\tclassName,\n\t\t\tmaxWidth,\n\t\t\ttoggleSelection,\n\t\t\tisRTL,\n\t\t} = this.props;\n\t\tconst {\n\t\t\turl,\n\t\t\talt,\n\t\t\tcaption,\n\t\t\talign,\n\t\t\tlinkDestination,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tlinkid,\n\t\t\thref\n\t\t} = attributes;\n\t\tconst toolbarEditButton = (\n\t\t\t<Toolbar>\n\t\t\t\t<IconButton\n\t\t\t\t\tclassName=\"ta-edit-image-button components-icon-button components-toolbar__control\"\n\t\t\t\t\tlabel={ __( 'Edit ThirstyAffiliates Image' ) }\n\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\tonClick={ this.editAFfiliateImage }\n\t\t\t\t/>\n\t\t\t</Toolbar>\n\t\t);\n\n\t\tconst controls = (\n\t\t\t<BlockControls>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t\t{ toolbarEditButton }\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tif ( isEditing ) {\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t{ controls }\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ \"format-image\" }\n\t\t\t\t\t\tlabel={ __( \"ThirstyAffiliates Image\" ) }\n\t\t\t\t\t\tinstructions={ __( \"Search for an affiliate link and select image to insert.\" ) }\n\t\t\t\t\t>\n\n\t\t\t\t\t\t<ThirstyURLInput\n\t\t\t\t\t\t\tupdateImageSelection={ this.updateImageSelection }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ !! imageSelection.length &&\n\t\t\t\t\t\t\t<div className=\"ta-image-sel-wrap\">\n\t\t\t\t\t\t\t\t<h3>{ `${affiliateLink.title} ${ __( 'attached images:' ) }` }</h3>\n\t\t\t\t\t\t\t\t<div className=\"ta-image-selection\">\n\t\t\t\t\t\t\t\t\t{ imageSelection.map( ( image , index ) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => this.onSelectAffiliateImage( image ) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<img src={ image.src } />\n\t\t\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t</Placeholder>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n\n\t\tconst classes = classnames( className, {\n\t\t\t'wp-block-image' : true,\n\t\t\t'is-transient': isBlobURL( url ),\n\t\t\t'is-resized': !! width || !! height,\n\t\t\t'is-focused': isSelected,\n\t\t} );\n\n\t\tconst isResizable = [ 'wide', 'full' ].indexOf( align ) === -1 && isLargeViewport;\n\t\tconst imageSizeOptions = this.getImageSizeOptions();\n\n\t\tconst getInspectorControls = ( imageWidth, imageHeight ) => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image Settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alt Text (Alternative Text)' ) }\n\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\tonChange={ this.updateAlt }\n\t\t\t\t\t\thelp={ __( 'Alternative text describes your image to people who can’t see it. Add a short description with its key details.' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty( imageSizeOptions ) && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image Size' ) }\n\t\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ this.updateImageURL }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && (\n\t\t\t\t\t\t<div className=\"block-library-image__dimensions\">\n\t\t\t\t\t\t\t<p className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t{ __( 'Image Dimensions' ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__width\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\t\tvalue={ width !== undefined ? width : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageWidth }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateWidth }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\tclassName=\"block-library-image__dimensions__height\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\t\t\tvalue={ height !== undefined ? height : '' }\n\t\t\t\t\t\t\t\t\tplaceholder={ imageHeight }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tonChange={ this.updateHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-library-image__dimensions__row\">\n\t\t\t\t\t\t\t\t<ButtonGroup aria-label={ __( 'Image Size' ) }>\n\t\t\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( scale ) => {\n\t\t\t\t\t\t\t\t\t\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\t\t\t\t\t\t\t\t\t\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\t\t\t\t\t\t\t\t\t\tconst isCurrent = width === scaledWidth && height === scaledHeight;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\t\t\tisPrimary={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={ isCurrent }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions( scaledWidth, scaledHeight ) }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ scale }%\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tonClick={ this.updateDimensions() }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\t// Disable reason: Each block can be selected by clicking on it\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{ controls }\n\t\t\t\t<figure className={ classes }>\n\t\t\t\t\t<ImageSize src={ url } dirtynessTrigger={ align }>\n\t\t\t\t\t\t{ ( sizes ) => {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\timageWidthWithinContainer,\n\t\t\t\t\t\t\t\timageHeightWithinContainer,\n\t\t\t\t\t\t\t\timageWidth,\n\t\t\t\t\t\t\t\timageHeight,\n\t\t\t\t\t\t\t} = sizes;\n\n\t\t\t\t\t\t\tconst filename = this.getFilename( url );\n\t\t\t\t\t\t\tlet defaultedAlt;\n\t\t\t\t\t\t\tif ( alt ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = alt;\n\t\t\t\t\t\t\t} else if ( filename ) {\n\t\t\t\t\t\t\t\tdefaultedAlt = sprintf( __( 'This image has an empty alt attribute; its file name is %s' ), filename );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst img = (\n\t\t\t\t\t\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t\t\t\t\t\t// should direct focus to block.\n\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ta linkid={ linkid } href={ href }>\n\t\t\t\t\t\t\t\t\t\t<img src={ url } alt={ defaultedAlt } onClick={ this.onImageClick } onError={ () => this.onImageError( url ) } />\n\t\t\t\t\t\t\t\t\t</ta>\n\t\t\t\t\t\t\t\t\t{ isBlobURL( url ) && <Spinner /> }\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t\t<div style={ { width, height } }>\n\t\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst currentWidth = width || imageWidthWithinContainer;\n\t\t\t\t\t\t\tconst currentHeight = height || imageHeightWithinContainer;\n\n\t\t\t\t\t\t\tconst ratio = imageWidth / imageHeight;\n\t\t\t\t\t\t\tconst minWidth = imageWidth < imageHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\t\t\t\t\t\tconst minHeight = imageHeight < imageWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t\t\t\t\t\t// With the current implementation of ResizableBox, an image needs an explicit pixel value for the max-width.\n\t\t\t\t\t\t\t// In absence of being able to set the content-width, this max-width is currently dictated by the vanilla editor style.\n\t\t\t\t\t\t\t// The following variable adds a buffer to this vanilla style, so 3rd party themes have some wiggleroom.\n\t\t\t\t\t\t\t// This does, in most cases, allow you to scale the image beyond the width of the main column, though not infinitely.\n\t\t\t\t\t\t\t// @todo It would be good to revisit this once a content-width variable becomes available.\n\t\t\t\t\t\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\t\t\t\t\t\tlet showRightHandle = false;\n\t\t\t\t\t\t\tlet showLeftHandle = false;\n\n\t\t\t\t\t\t\t/* eslint-disable no-lonely-if */\n\t\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\t\t\t\t\t\tif ( align === 'center' ) {\n\t\t\t\t\t\t\t\t// When the image is centered, show both handles.\n\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t} else if ( isRTL ) {\n\t\t\t\t\t\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t\t\t\t\t\t// Show the right handle and hide the left handle only when it is aligned left.\n\t\t\t\t\t\t\t\t// Otherwise always show the left handle.\n\t\t\t\t\t\t\t\tif ( align === 'left' ) {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Show the left handle and hide the right handle only when the image is aligned right.\n\t\t\t\t\t\t\t\t// Otherwise always show the right handle.\n\t\t\t\t\t\t\t\tif ( align === 'right' ) {\n\t\t\t\t\t\t\t\t\tshowLeftHandle = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowRightHandle = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* eslint-enable no-lonely-if */\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t{ getInspectorControls( imageWidth, imageHeight ) }\n\t\t\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\t\twidth && height ? {\n\t\t\t\t\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\t\t\t\t} : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\t\t\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\t\t\t\t\t\t\tminHeight={ minHeight }\n\t\t\t\t\t\t\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\t\t\t\t\t\t\tlockAspectRatio\n\t\t\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ img }\n\t\t\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t</ImageSize>\n\t\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tplaceholder={ __( 'Write caption…' ) }\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t\tunstableOnFocus={ this.onFocusCaption }\n\t\t\t\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\t\t\t\tisSelected={ this.state.captionFocused }\n\t\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t</Fragment>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( 'core' );\n\t\tconst { getEditorSettings } = select( 'core/editor' );\n\t\tconst { id } = props.attributes;\n\t\tconst { maxWidth, isRTL, imageSizes } = getEditorSettings();\n\n\t\treturn {\n\t\t\timage: id ? getMedia( id ) : null,\n\t\t\tmaxWidth,\n\t\t\tisRTL,\n\t\t\timageSizes,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithNotices,\n] )( ImageEdit );\n\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/edit.js","const WORDPRESS_EMBED_BLOCK = 'core-embed/wordpress';\n\nconst { includes } = lodash;\nconst { renderToString } = wp.element;\nconst { createBlock } = wp.blocks;\n\n/***\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} attributesFromPreview Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = ( props, attributesFromPreview ) => {\n\tconst { preview, name } = props;\n\tconst { url } = props.attributes;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\tconst matchingBlock = findBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tif ( WORDPRESS_EMBED_BLOCK !== name && DEFAULT_EMBED_BLOCK !== matchingBlock ) {\n\t\t// At this point, we have discovered a more suitable block for this url, so transform it.\n\t\tif ( name !== matchingBlock ) {\n\t\t\treturn createBlock( matchingBlock, { url } );\n\t\t}\n\t}\n\n\tif ( preview ) {\n\t\tconst { html } = preview;\n\n\t\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\t// If this is not the WordPress embed block, transform it into one.\n\t\t\tif ( WORDPRESS_EMBED_BLOCK !== name ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\tWORDPRESS_EMBED_BLOCK,\n\t\t\t\t\t{\n\t\t\t\t\t\turl,\n\t\t\t\t\t\t// By now we have the preview, but when the new block first renders, it\n\t\t\t\t\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t\t\t\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t\t\t\t\t// here so that the initial render works when we switch to the WordPress\n\t\t\t\t\t\t// block. This only affects the WordPress block because it can't be\n\t\t\t\t\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t\t\t\t\t// relies on the preview to set the correct render type.\n\t\t\t\t\t\t...attributesFromPreview,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport const isFromWordPress = ( html ) => {\n\treturn includes( html, 'class=\"wp-embedded-content\" data-secret' );\n};\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/util.js","const { noop } = lodash;\n\nconst { withGlobalEvents } = wp.compose;\nconst { Component } = wp.element;\n\nclass ImageSize extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t};\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\t\tthis.calculateSize = this.calculateSize.bind( this );\n\t}\n\n\tbindContainer( ref ) {\n\t\tthis.container = ref;\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.src !== prevProps.src ) {\n\t\t\tthis.setState( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t} );\n\t\t\tthis.fetchImageSize();\n\t\t}\n\n\t\tif ( this.props.dirtynessTrigger !== prevProps.dirtynessTrigger ) {\n\t\t\tthis.calculateSize();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.fetchImageSize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.image ) {\n\t\t\tthis.image.onload = noop;\n\t\t}\n\t}\n\n\tfetchImageSize() {\n\t\tthis.image = new window.Image();\n\t\tthis.image.onload = this.calculateSize;\n\t\tthis.image.src = this.props.src;\n\t}\n\n\tcalculateSize() {\n\t\tconst maxWidth = this.container.clientWidth;\n\t\tconst exceedMaxWidth = this.image.width > maxWidth;\n\t\tconst ratio = this.image.height / this.image.width;\n\t\tconst width = exceedMaxWidth ? maxWidth : this.image.width;\n\t\tconst height = exceedMaxWidth ? maxWidth * ratio : this.image.height;\n\t\tthis.setState( { width, height } );\n\t}\n\n\trender() {\n\t\tconst sizes = {\n\t\t\timageWidth: this.image && this.image.width,\n\t\t\timageHeight: this.image && this.image.height,\n\t\t\tcontainerWidth: this.container && this.container.clientWidth,\n\t\t\tcontainerHeight: this.container && this.container.clientHeight,\n\t\t\timageWidthWithinContainer: this.state.width,\n\t\t\timageHeightWithinContainer: this.state.height,\n\t\t};\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer }>\n\t\t\t\t{ this.props.children( sizes ) }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withGlobalEvents( {\n\tresize: 'calculateSize',\n} )( ImageSize );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/image-size.js","import classnames from \"classnames\";\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { Spinner, withSpokenMessages, Popover , TextControl } = wp.components;\nconst { withInstanceId } = wp.compose;\n\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\t// this.onChange = this.onChange.bind( this );\n\t\t// this.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.searchAffiliateLinks = this.searchAffiliateLinks.bind( this );\n\t\t// this.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts : [],\n\t\t\tshowSuggestions : false,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : false\n\t\t};\n\t}\n\n\t/**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n\t/**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n\t/**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\t\n\tsearchAffiliateLinks( value ) {\n\n\t\t// Show the suggestions after typing at least 2 characters=\n\t\tif ( value.length < 2 ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState({\n\t\t\tshowSuggestions : true,\n\t\t\tselectedSuggestion : null,\n\t\t\tloading : true\n\t\t});\n\n\t\tconst formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n\t\tformData.append( \"gutenberg\" , true );\n\t\tformData.append( \"with_images\" , true );\n\t\t\n\t\t// We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n\t\t} );\n\t\t\n\t\trequest\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\t/**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\t// this.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: post,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\n\t\tthis.props.updateImageSelection( post.images , post );\n\t}\n\n\t/**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\t// this.inputRef.current.focus();\n\t}\n\n render() {\n const { value = '', autoFocus = true, instanceId } = this.props;\n const { showSuggestions , posts, selectedSuggestion , loading } = this.state;\n \n return (\n <div class=\"edit-search-affiliate-links\">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\t\t\t\tonSubmit={ this.displayAffiliateImages }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclassName=\"ta-search-affiliate-links\"\n\t\t\t\t\t\tplaceholder={ __( \"Type to search affiliate links\" ) }\n\t\t\t\t\t\tonChange={ this.searchAffiliateLinks }\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t\t{ showSuggestions && !! posts.length && \n\t\t\t\t\t\t<Popover position=\"bottom\" focusOnMount={ false }>\n\t\t\t\t\t\t\t<div class=\"affilate-links-suggestions\">\n\t\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\t\tid={ `editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t}\n\t\t\t\t</form>\n </div>\n );\n }\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/blocks/ta-image/search-input.js","import { taLink } from \"./ta-link\";\n\nconst { registerFormatType } = wp.richText;\n\n/**\n * Register custom formats.\n * \n * @since 3.6\n */\nexport default function registerFormats() {\n\n [\n taLink\n ].forEach( ( { name , ...settings } ) => registerFormatType( name , settings ) );\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/index.js","import InlineAffiliateLinkUI from './inline';\n\nconst { __ } = wp.i18n;\nconst { Component , Fragment } = wp.element;\nconst { withSpokenMessages } = wp.components;\nconst { getTextContent , applyFormat , removeFormat , slice } = wp.richText;\nconst { isURL } = wp.url;\nconst { RichTextToolbarButton , RichTextShortcut } = wp.editor;\nconst { Path , SVG } = wp.components;\nconst { getRectangleFromRange } = wp.dom;\n\nconst name = \"ta/link\";\n\n/**\n * Custom Affiliate link format. When applied will wrap selected text with <ta href=\"\" linkid=\"\"></ta> custom element.\n * Custom element is implemented here as we are not allowed to use <a> tag due to Gutenberg limitations.\n * Element is converted to normal <a> tag on frontend via PHP script filtered on 'the_content'.\n * \n * @since 3.6\n */\nexport const taLink = {\n name,\n title : __( \"Affiliate Link\" ),\n tagName : \"ta\",\n className : null,\n attributes : {\n\t\turl : \"href\",\n\t\ttarget : \"target\"\n },\n edit : withSpokenMessages( class LinkEdit extends Component {\n\t\t\n\t\t/**\n\t\t * Component constructor.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tthis.addLink = this.addLink.bind( this );\n\t\t\tthis.stopAddingLink = this.stopAddingLink.bind( this );\n\t\t\tthis.onRemoveFormat = this.onRemoveFormat.bind( this );\n\t\t\tthis.state = {\n\t\t\t\taddingLink: false,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\taddLink() {\n\n\t\t\tconst { value, onChange } = this.props;\n\t\t\tconst text = getTextContent( slice( value ) );\n\n\t\t\tif ( text && isURL( text ) ) {\n\t\t\t\tonChange( applyFormat( value, { type: name, attributes: { url: text } } ) );\n\t\t\t} else {\n\t\t\t\tthis.setState( { addingLink: true } );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Callback to set state to stop adding link status.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tstopAddingLink() {\n\t\t\tthis.setState( { addingLink: false } );\n\t\t}\n\n\t\t/**\n\t\t * Remove format event callback.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\tonRemoveFormat() {\n\t\t\tconst { value , onChange , speak } = this.props;\n\n\t\t\tonChange( removeFormat( value , name ) );\n\t\t\tspeak( __( \"Affiliate Link removed.\" ), \"assertive\" );\n\t\t}\n\n\t\t/**\n\t\t * Get selected anchor text.\n\t\t * \n\t\t * @since 3.9\n\t\t */\n\t\tgetAnchorRect() {\n\n\t\t\tconst selection = window.getSelection();\n\t\t\tconst range = selection.rangeCount > 0 ? selection.getRangeAt( 0 ) : null;\n\n\t\t\tif ( ! range ) return;\n\n\t\t\tlet rect = null;\n\n\t\t\tif ( this.state.addingLink ) {\n\t\t\t\trect = getRectangleFromRange( range );\n\t\t\t} else {\n\n\t\t\t\tlet element = range.startContainer;\n\n\t\t\t\t// If the caret is right before the element, select the next element.\n\t\t\t\telement = element.nextElementSibling || element;\n\n\t\t\t\twhile ( element.nodeType !== window.Node.ELEMENT_NODE ) {\n\t\t\t\t\telement = element.parentNode;\n\t\t\t\t}\n\n\t\t\t\tconst closest = element.closest( 'ta' );\n\t\t\t\tif ( closest ) {\n\t\t\t\t\trect = closest.getBoundingClientRect();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\treturn rect;\n\t\t}\n\n\t\t/**\n\t\t * Component render method.\n\t\t * \n\t\t * @since 3.6\n\t\t */\n\t\trender() {\n\t\t\tconst { isActive , activeAttributes , value , onChange } = this.props;\n\n\t\t\tconst anchorRect = this.getAnchorRect();\n\n\t\t\treturn (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"access\"\n\t\t\t\t\t\tcharacter=\"s\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.addLink }\n\t\t\t\t\t/>\n\t\t\t\t\t<RichTextShortcut\n\t\t\t\t\t\ttype=\"primaryShift\"\n\t\t\t\t\t\tcharacter=\"l\"\n\t\t\t\t\t\tonUse={ this.onRemoveFormat }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon=\"editor-unlink\"\n\t\t\t\t\t\ttitle={ __( 'Remove Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-unlink-button\"\n\t\t\t\t\t\tonClick={ this.onRemoveFormat }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tshortcutType=\"primaryShift\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t{ ! isActive && <RichTextToolbarButton\n\t\t\t\t\t\ticon={ <SVG xmlns=\"http://www.w3.org/2000/svg\" width=\"16.688\" height=\"9.875\" viewBox=\"0 0 16.688 9.875\"><Path id=\"TA.svg\" fill=\"black\" class=\"cls-1\" d=\"M2.115,15.12H4.847L6.836,7.7H9.777l0.63-2.381H1.821L1.177,7.7H4.118Zm4.758,0H9.829l1.177-1.751h3.782l0.238,1.751h2.858L16.357,5.245H13.7Zm5.5-3.866,1.835-2.816,0.35,2.816H12.378Z\" transform=\"translate(-1.188 -5.25)\"/></SVG> }\n\t\t\t\t\t\ttitle={ __( 'Affiliate Link' ) }\n\t\t\t\t\t\tclassName=\"ta-link-button\"\n\t\t\t\t\t\tonClick={ this.addLink }\n\t\t\t\t\t\tshortcutType=\"primary\"\n\t\t\t\t\t\tshortcutCharacter=\"l\"\n\t\t\t\t\t/> }\n\t\t\t\t\t<InlineAffiliateLinkUI\n\t\t\t\t\t\taddingLink={ this.state.addingLink }\n\t\t\t\t\t\tstopAddingLink={ this.stopAddingLink }\n\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\tactiveAttributes={ activeAttributes }\n\t\t\t\t\t\tanchorRect={ anchorRect }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n } )\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/index.js","import classnames from \"classnames\";\nimport { isValidHref } from './utils';\nimport ThirstyURLPopover from './url-popover';\nimport ThirstyURLInput from './url-input';\n\nconst { __ } = wp.i18n;\nconst { Component , createRef } = wp.element;\nconst { ExternalLink , ToggleControl , IconButton , withSpokenMessages } = wp.components;\nconst { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } = wp.keycodes;\nconst { prependHTTP , safeDecodeURI , filterURLForDisplay } = wp.url;\nconst { create , insert , isCollapsed , applyFormat , getTextContent , slice } = wp.richText;\n\nconst stopKeyPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Generates the format object that will be applied to the link text.\n * \n * @since 3.6\n *\n * @param {string} url The href of the link.\n * @param {boolean} linkid Affiliate link ID.\n * @param {Object} text The text that is being hyperlinked.\n *\n * @return {Object} The final format object.\n */\nfunction createLinkFormat( { url , linkid , text } ) {\n\tconst format = {\n\t\ttype: \"ta/link\",\n\t\tattributes: {\n\t\t\turl,\n\t\t\tlinkid : linkid.toString()\n\t\t},\n\t};\n\n\treturn format;\n}\n\n/**\n * Check if input is being show.\n * \n * @since 3.6\n * \n * @param {Object} props Component props.\n * @param {Object} state Component state.\n */\nfunction isShowingInput( props , state ) {\n\treturn props.addingLink || state.editLink;\n}\n\n/**\n * Affiliate Link editor JSX element.\n * \n * @since 3.6\n * \n * @param {Object} param0 Component props (destructred).\n */\nconst LinkEditor = ( { value , onChangeInputValue , onKeyDown , submitLink, invalidLink , resetInvalidLink , autocompleteRef } ) => (\n\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\t<form\n\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content ta-link-search-popover\"\n\t\tonKeyPress={ stopKeyPropagation }\n\t\tonKeyDown={ onKeyDown }\n\t\tonSubmit={ submitLink }\n\t>\n\t\t<ThirstyURLInput\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeInputValue }\n\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\tinvalidLink={ invalidLink }\n\t\t\tresetInvalidLink={ resetInvalidLink }\n\t\t/>\n\t\t<IconButton icon=\"editor-break\" label={ __( 'Apply' ) } type=\"submit\" />\n\t</form>\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n);\n\n/**\n * Affiliate link url viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewerUrl = ( { url } ) => {\n\tconst prependedURL = prependHTTP( url );\n\tconst linkClassName = classnames( 'editor-format-toolbar__link-container-value block-editor-format-toolbar__link-container-value', {\n\t\t'has-invalid-link': ! isValidHref( prependedURL ),\n\t} );\n\n\tif ( ! url ) {\n\t\treturn <span className={ linkClassName }></span>;\n\t}\n\n\treturn (\n\t\t<ExternalLink\n\t\t\tclassName={ linkClassName }\n\t\t\thref={ url }\n\t\t>\n\t\t\t{ filterURLForDisplay( safeDecodeURI( url ) ) }\n\t\t</ExternalLink>\n\t);\n};\n\n/**\n * Affiliate link viewer JSX element.\n * \n * @param {*} param0 Component props (destructred).\n */\nconst LinkViewer = ( { url, editLink } ) => {\n\treturn (\n\t\t// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t<div\n\t\t\tclassName=\"editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content\"\n\t\t\tonKeyPress={ stopKeyPropagation }\n\t\t>\n\t\t\t<LinkViewerUrl url={ url } />\n\t\t\t<IconButton icon=\"edit\" label={ __( 'Edit' ) } onClick={ editLink } />\n\t\t</div>\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\t);\n};\n\n/**\n * Inline affiliate link UI Component.\n * \n * @since 3.6\n * \n * @param {*} param0 Component props (destructred).\n */\nclass InlineAffiliateLinkUI extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.editLink = this.editLink.bind( this );\n\t\tthis.submitLink = this.submitLink.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.onChangeInputValue = this.onChangeInputValue.bind( this );\n\t\tthis.onClickOutside = this.onClickOutside.bind( this );\n\t\tthis.resetState = this.resetState.bind( this );\n\t\tthis.autocompleteRef = createRef();\n\t\tthis.resetInvalidLink = this.resetInvalidLink.bind( this );\n\n\t\tthis.state = {\n\t\t\tinputValue : '',\n\t\t\tlinkid : 0,\n\t\t\tpost : null,\n\t\t\tinvalidLink : false\n\t\t};\n\t}\n\n\t/**\n\t * Stop the key event from propagating up to ObserveTyping.startTypingInTextField.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {Object} event Event object.\n\t */\n\tonKeyDown( event ) {\n\t\tif ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Callback to set state when input value is changed.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} inputValue \n\t * @param {*} post \n\t */\n\tonChangeInputValue( inputValue , post = null ) {\n\t\tconst linkid = post ? post.id : 0;\n\t\tthis.setState( { inputValue , linkid , post } );\n\t}\n\n\t/**\n\t * Callback to set state when edit affiliate link (already inserted) is triggered.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\teditLink( event ) {\n\t\tthis.setState( { editLink: true } );\n\t\tevent.preventDefault();\n\t}\n\n\t/**\n\t * Callback to apply the affiliate link format to the selected text or position in the active block.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tsubmitLink( event ) {\n\t\tconst { isActive, value, onChange, speak } = this.props;\n\t\tconst { inputValue, linkid , post } = this.state;\n\t\tconst url = prependHTTP( inputValue );\n\t\tconst selectedText = getTextContent( slice( value ) );\n\t\tconst format = createLinkFormat( {\n\t\t\turl,\n\t\t\tlinkid,\n\t\t\ttext: selectedText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! linkid || ! post ) {\n\t\t\tthis.setState( { invalidLink : true } )\n\t\t\treturn;\n\t\t} \n\n\t\tif ( isCollapsed( value ) && ! isActive ) {\n\t\t\tconst toInsert = applyFormat( create( { text: post.title } ), format, 0, url.length );\n\t\t\tonChange( insert( value, toInsert ) );\n\t\t} else {\n\t\t\tonChange( applyFormat( value, format ) );\n\t\t}\n\n\t\tthis.resetState();\n\n\t\tif ( ! isValidHref( url ) ) {\n\t\t\tspeak( __( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );\n\t\t} else if ( isActive ) {\n\t\t\tspeak( __( 'Link edited.' ), 'assertive' );\n\t\t} else {\n\t\t\tspeak( __( 'Link inserted' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Callback to run when users clicks outside the popover UI.\n\t * \n\t * @since 3.6\n\t * \n\t * @param {*} event \n\t */\n\tonClickOutside( event ) {\n\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t// so onClickOutside fails to detect that a click on a suggestion occured in the\n\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t// return to avoid the popover being closed.\n\t\tconst autocompleteElement = this.autocompleteRef.current;\n\t\tif ( autocompleteElement && autocompleteElement.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resetState();\n\t}\n\n\t/**\n\t * Reset state callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetState() {\n\t\tthis.props.stopAddingLink();\n\t\tthis.setState( { inputValue : '' , editLink: false } );\n\t\tthis.resetInvalidLink();\n\t}\n\n\t/**\n\t * Reset invalid link state callback. Separated as we need to run this independently from resetState() callback.\n\t * \n\t * @since 3.6\n\t */\n\tresetInvalidLink() {\n\t\tthis.setState( { invalidLink : false } );\n\t}\n\n\t/**\n\t * Component render method.\n\t *\n\t * @since 3.6\n\t */\n\trender() {\n\t\tconst { isActive, activeAttributes: { url , linkid }, addingLink, anchorRect, value, onChange } = this.props;\n\n\t\tif ( ! isActive && ! addingLink ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { inputValue , invalidLink } = this.state;\n\t\tconst showInput = isShowingInput( this.props, this.state );\n\n\t\treturn (\n\t\t\t<ThirstyURLPopover\n\t\t\t\tonClickOutside={ this.onClickOutside }\n\t\t\t\tonClose={ this.resetState }\n\t\t\t\tfocusOnMount={ showInput ? 'firstElement' : false }\n\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\tanchorRect= { anchorRect }\n\t\t\t>\n\t\t\t\t{ showInput ? (\n\t\t\t\t\t<LinkEditor\n\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\tonChangeInputValue={ this.onChangeInputValue }\n\t\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\t\tsubmitLink={ this.submitLink }\n\t\t\t\t\t\tautocompleteRef={ this.autocompleteRef }\n\t\t\t\t\t\tupdateLinkId= { this.updateLinkId }\n\t\t\t\t\t\tinvalidLink={ invalidLink }\n\t\t\t\t\t\tresetInvalidLink={ this.resetInvalidLink }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<LinkViewer\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\teditLink={ this.editLink }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ThirstyURLPopover>\n\t\t);\n\t}\n}\n\nexport default withSpokenMessages( InlineAffiliateLinkUI );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/inline.js","const { startsWith } = lodash;\n\nconst {\n getProtocol,\n\tisValidProtocol,\n\tgetAuthority,\n\tisValidAuthority,\n\tgetPath,\n\tisValidPath,\n\tgetQueryString,\n\tisValidQueryString,\n\tgetFragment,\n\tisValidFragment,\n} = wp.url;\n\n/**\n * Check for issues with the provided href.\n * \n * @since 3.6\n *\n * @param {string} href The href.\n * @return {boolean} Is the href invalid?\n */\nexport function isValidHref( href ) {\n\tif ( ! href ) {\n\t\treturn false;\n\t}\n\n\tconst trimmedHref = href.trim();\n\n\tif ( ! trimmedHref ) {\n\t\treturn false;\n\t}\n\n\t// Does the href start with something that looks like a URL protocol?\n\tif ( /^\\S+:/.test( trimmedHref ) ) {\n\t\tconst protocol = getProtocol( trimmedHref );\n\t\tif ( ! isValidProtocol( protocol ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add some extra checks for http(s) URIs, since these are the most common use-case.\n\t\t// This ensures URIs with an http protocol have exactly two forward slashes following the protocol.\n\t\tif ( startsWith( protocol, 'http' ) && ! /^https?:\\/\\/[^\\/\\s]/i.test( trimmedHref ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst authority = getAuthority( trimmedHref );\n\t\tif ( ! isValidAuthority( authority ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst path = getPath( trimmedHref );\n\t\tif ( path && ! isValidPath( path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst queryString = getQueryString( trimmedHref );\n\t\tif ( queryString && ! isValidQueryString( queryString ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fragment = getFragment( trimmedHref );\n\t\tif ( fragment && ! isValidFragment( fragment ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Validate anchor links.\n\tif ( startsWith( trimmedHref, '#' ) && ! isValidFragment( trimmedHref ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/utils.js","const { __ } = wp.i18n;\nconst { Component } = wp.element;\nconst { Popover , IconButton } = wp.components;\n\n/**\n * Custom URL Popover component.\n * \n * @since 3.6\n */\nclass ThirstyURLPopover extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n */\n\tconstructor() {\n super( ...arguments );\n \n this.toggleSettingsVisibility = this.toggleSettingsVisibility.bind( this );\n\n\t\tthis.state = {\n\t\t\tisSettingsExpanded: false,\n\t\t};\n }\n \n /**\n * Component constructor.\n * \n * @since 3.6\n */\n toggleSettingsVisibility() {\n\t\tthis.setState( {\n\t\t\tisSettingsExpanded: ! this.state.isSettingsExpanded,\n\t\t} );\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\trenderSettings,\n invalidLink,\n\t\t\tposition = 'bottom center',\n\t\t\tfocusOnMount = 'firstElement',\n\t\t\t...popoverProps\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tisSettingsExpanded,\n } = this.state;\n \n const showSettings = !! renderSettings && isSettingsExpanded;\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassName=\"ta-url-popover editor-url-popover block-editor-url-popover\"\n\t\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t\tposition={ position }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t<div className=\"editor-url-popover__row\">\n { children }\n { !! renderSettings && (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tclassName=\"editor-url-popover__settings-toggle\"\n\t\t\t\t\t\t\ticon=\"ellipsis\"\n\t\t\t\t\t\t\tlabel={ __( 'Link Settings' ) }\n\t\t\t\t\t\t\tonClick={ this.toggleSettingsVisibility }\n\t\t\t\t\t\t\taria-expanded={ isSettingsExpanded }\n\t\t\t\t\t\t/>\n ) }\n\t\t\t\t</div>\n { showSettings && (\n\t\t\t\t\t<div className=\"editor-url-popover__row editor-url-popover__settings\">\n\t\t\t\t\t\t{ renderSettings() }\n\t\t\t\t\t</div>\n ) }\n { invalidLink && <div class=\"ta-invalid-link\">{ __( 'Invalid affiliate link' ) }</div> }\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default ThirstyURLPopover;\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-popover.js","import classnames from 'classnames';\nimport scrollIntoView from 'dom-scroll-into-view';\n\nconst { __ } = wp.i18n;\nconst { throttle } = lodash;\nconst { Component , createRef } = wp.element;\nconst { UP, DOWN, ENTER, TAB } = wp.keycodes;\nconst { Spinner, withSpokenMessages, Popover } = wp.components;\nconst { withInstanceId } = wp.compose;\n\n// Since URLInput is rendered in the context of other inputs, but should be\n// considered a separate modal node, prevent keyboard events from propagating\n// as being considered from the input.\nconst stopEventPropagation = ( event ) => event.stopPropagation();\n\n/**\n * Custom URL Input component.\n * \n * @since 3.6\n */\nclass ThirstyURLInput extends Component {\n\n /**\n * Component constructor method.\n * \n * @since 3.6\n * \n * @param {*} param0 \n */\n\tconstructor( { autocompleteRef } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.autocompleteRef = autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = throttle( this.updateSuggestions.bind( this ), 200 );\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.state = {\n\t\t\tposts: [],\n\t\t\tshowSuggestions: false,\n\t\t\tselectedSuggestion: null,\n\t\t};\n\t}\n\n /**\n * Component did update method.\n * \n * @since 3.6\n */\n\tcomponentDidUpdate() {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\t// only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded\n\t\tif ( showSuggestions && selectedSuggestion !== null && ! this.scrollingIntoView ) {\n\t\t\tthis.scrollingIntoView = true;\n\t\t\tscrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current, {\n\t\t\t\tonlyScrollIfNeeded: true,\n\t\t\t} );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.scrollingIntoView = false;\n\t\t\t}, 100 );\n\t\t}\n\t}\n\n /**\n * Component unmount method.\n * \n * @since 3.6\n */\n\tcomponentWillUnmount() {\n\t\tdelete this.suggestionsRequest;\n\t}\n\n /**\n * Bind suggestion to node.\n * \n * @param {*} index \n */\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n /**\n * Callback to show suggestions based on value inputted on search field.\n * \n * @since 3.6\n * \n * @param {*} value \n */\n\tupdateSuggestions( value ) {\n\t\t// Show the suggestions after typing at least 2 characters\n\t\t// and also for URLs\n\t\tif ( value.length < 2 || /^https?:/.test( value ) ) {\n\t\t\tthis.setState( {\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tshowSuggestions: true,\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n const formData = new FormData();\n formData.append( \"action\" , \"search_affiliate_links_query\" );\n formData.append( \"keyword\" , value );\n formData.append( \"paged\" , 1 );\n formData.append( \"gutenberg\" , true );\n \n // We are getting data via the WP AJAX instead of rest API as it is not possible yet\n // to filter results with category value. This is to prepare next update to add category filter.\n const request = fetch( ajaxurl , {\n method : \"POST\",\n body : formData\n } );\n\n request\n .then( response => response.json() )\n .then( ( response ) => {\n\n if ( ! response.affiliate_links ) return;\n\n const posts = response.affiliate_links;\n\n\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\treturn;\n }\n\n\t\t\tthis.setState( {\n\t\t\t\tposts,\n\t\t\t\tloading: false,\n } );\n\n\t\t\tif ( !! posts.length ) {\n\t\t\t\tthis.props.debouncedSpeak( sprintf( _n(\n\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\tposts.length\n\t\t\t\t), posts.length ), 'assertive' );\n\t\t\t} else {\n\t\t\t\tthis.props.debouncedSpeak( __( 'No results.' ), 'assertive' );\n }\n\n\t\t} ).catch( () => {\n\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tthis.suggestionsRequest = request;\n\t}\n\n /**\n * Search input value change event callback method.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonChange( event ) {\n this.props.resetInvalidLink();\n\t\tconst inputValue = event.target.value;\n\t\tthis.props.onChange( inputValue );\n\t\tthis.updateSuggestions( inputValue );\n\t}\n\n /**\n * Keydown event callback. Handles selecting result via keyboard.\n * \n * @since 3.6\n * \n * @param {*} event \n */\n\tonKeyDown( event ) {\n\t\tconst { showSuggestions, selectedSuggestion, posts, loading } = this.state;\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation\n\t\tif ( ! showSuggestions || ! posts.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif ( this.props.value.length !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position\n\t\t\t\t\t\tevent.target.setSelectionRange( this.props.value.length, this.props.value.length );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst post = this.state.posts[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion ? posts.length - 1 : selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = selectedSuggestion === null || ( selectedSuggestion === posts.length - 1 ) ? 0 : selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tthis.selectLink( post );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n /**\n * Set state when an affiliate link is selected.\n * \n * @since 3.6\n * \n * @param {*} post \n */\n\tselectLink( post ) {\n\t\tthis.props.onChange( post.link, post );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n /**\n * Callback handler for when affiliate link is selected.\n * \n * @param {*} post \n */\n\thandleOnClick( post ) {\n\t\tthis.selectLink( post );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n /**\n * Component render method.\n * \n * @since 3.6\n */\n\trender() {\n\t\tconst { value = '', autoFocus = true, instanceId , invalidLink } = this.props;\n\t\tconst { showSuggestions, posts, selectedSuggestion, loading } = this.state;\n\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\treturn (\n\t\t\t<div className=\"editor-url-input block-editor-url-input\">\n\t\t\t\t<input\n\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\t\trequired\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ this.onChange }\n\t\t\t\t\tonInput={ stopEventPropagation }\n\t\t\t\t\tplaceholder={ __( 'Paste URL or type to search' ) }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-expanded={ showSuggestions }\n\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\taria-owns={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\taria-activedescendant={ selectedSuggestion !== null ? `editor-url-input-suggestion-${ instanceId }-${ selectedSuggestion }` : undefined }\n\t\t\t\t\tref={ this.inputRef }\n\t\t\t\t/>\n\n\t\t\t\t{ ( loading ) && <Spinner /> }\n\n\t\t\t\t{ showSuggestions && !! posts.length && ! invalidLink &&\n\t\t\t\t\t<Popover position=\"bottom\" noArrow focusOnMount={ false }>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"editor-url-input__suggestions block-editor-url-input__suggestions\"\n\t\t\t\t\t\t\tid={ `editor-url-input-suggestions-${ instanceId }` }\n\t\t\t\t\t\t\tref={ this.autocompleteRef }\n\t\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ posts.map( ( post, index ) => (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={ post.id }\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t\t\tid={ `block-editor-url-input-suggestion-${ instanceId }-${ index }` }\n\t\t\t\t\t\t\t\t\tref={ this.bindSuggestionNode( index ) }\n\t\t\t\t\t\t\t\t\tclassName={ classnames( 'editor-url-input__suggestion block-editor-url-input__suggestion', {\n\t\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( post ) }\n\t\t\t\t\t\t\t\t\taria-selected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ post.title || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t}\n}\n\nexport default withSpokenMessages( withInstanceId( ThirstyURLInput ) );\n\n\n// WEBPACK FOOTER //\n// ./src/formats/ta-link/url-input.js","'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/index.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dom-scroll-into-view/lib/util.js\n// module id = 16\n// module chunks = 0"],"sourceRoot":""}
|
js/app/gutenberg_support/package-lock.json
CHANGED
@@ -2624,7 +2624,8 @@
|
|
2624 |
"ansi-regex": {
|
2625 |
"version": "2.1.1",
|
2626 |
"bundled": true,
|
2627 |
-
"dev": true
|
|
|
2628 |
},
|
2629 |
"aproba": {
|
2630 |
"version": "1.2.0",
|
@@ -2645,12 +2646,14 @@
|
|
2645 |
"balanced-match": {
|
2646 |
"version": "1.0.0",
|
2647 |
"bundled": true,
|
2648 |
-
"dev": true
|
|
|
2649 |
},
|
2650 |
"brace-expansion": {
|
2651 |
"version": "1.1.11",
|
2652 |
"bundled": true,
|
2653 |
"dev": true,
|
|
|
2654 |
"requires": {
|
2655 |
"balanced-match": "^1.0.0",
|
2656 |
"concat-map": "0.0.1"
|
@@ -2665,17 +2668,20 @@
|
|
2665 |
"code-point-at": {
|
2666 |
"version": "1.1.0",
|
2667 |
"bundled": true,
|
2668 |
-
"dev": true
|
|
|
2669 |
},
|
2670 |
"concat-map": {
|
2671 |
"version": "0.0.1",
|
2672 |
"bundled": true,
|
2673 |
-
"dev": true
|
|
|
2674 |
},
|
2675 |
"console-control-strings": {
|
2676 |
"version": "1.1.0",
|
2677 |
"bundled": true,
|
2678 |
-
"dev": true
|
|
|
2679 |
},
|
2680 |
"core-util-is": {
|
2681 |
"version": "1.0.2",
|
@@ -2792,7 +2798,8 @@
|
|
2792 |
"inherits": {
|
2793 |
"version": "2.0.3",
|
2794 |
"bundled": true,
|
2795 |
-
"dev": true
|
|
|
2796 |
},
|
2797 |
"ini": {
|
2798 |
"version": "1.3.5",
|
@@ -2804,6 +2811,7 @@
|
|
2804 |
"version": "1.0.0",
|
2805 |
"bundled": true,
|
2806 |
"dev": true,
|
|
|
2807 |
"requires": {
|
2808 |
"number-is-nan": "^1.0.0"
|
2809 |
}
|
@@ -2818,6 +2826,7 @@
|
|
2818 |
"version": "3.0.4",
|
2819 |
"bundled": true,
|
2820 |
"dev": true,
|
|
|
2821 |
"requires": {
|
2822 |
"brace-expansion": "^1.1.7"
|
2823 |
}
|
@@ -2825,12 +2834,14 @@
|
|
2825 |
"minimist": {
|
2826 |
"version": "0.0.8",
|
2827 |
"bundled": true,
|
2828 |
-
"dev": true
|
|
|
2829 |
},
|
2830 |
"minipass": {
|
2831 |
"version": "2.2.4",
|
2832 |
"bundled": true,
|
2833 |
"dev": true,
|
|
|
2834 |
"requires": {
|
2835 |
"safe-buffer": "^5.1.1",
|
2836 |
"yallist": "^3.0.0"
|
@@ -2849,6 +2860,7 @@
|
|
2849 |
"version": "0.5.1",
|
2850 |
"bundled": true,
|
2851 |
"dev": true,
|
|
|
2852 |
"requires": {
|
2853 |
"minimist": "0.0.8"
|
2854 |
}
|
@@ -2929,7 +2941,8 @@
|
|
2929 |
"number-is-nan": {
|
2930 |
"version": "1.0.1",
|
2931 |
"bundled": true,
|
2932 |
-
"dev": true
|
|
|
2933 |
},
|
2934 |
"object-assign": {
|
2935 |
"version": "4.1.1",
|
@@ -2941,6 +2954,7 @@
|
|
2941 |
"version": "1.4.0",
|
2942 |
"bundled": true,
|
2943 |
"dev": true,
|
|
|
2944 |
"requires": {
|
2945 |
"wrappy": "1"
|
2946 |
}
|
@@ -3026,7 +3040,8 @@
|
|
3026 |
"safe-buffer": {
|
3027 |
"version": "5.1.1",
|
3028 |
"bundled": true,
|
3029 |
-
"dev": true
|
|
|
3030 |
},
|
3031 |
"safer-buffer": {
|
3032 |
"version": "2.1.2",
|
@@ -3062,6 +3077,7 @@
|
|
3062 |
"version": "1.0.2",
|
3063 |
"bundled": true,
|
3064 |
"dev": true,
|
|
|
3065 |
"requires": {
|
3066 |
"code-point-at": "^1.0.0",
|
3067 |
"is-fullwidth-code-point": "^1.0.0",
|
@@ -3081,6 +3097,7 @@
|
|
3081 |
"version": "3.0.1",
|
3082 |
"bundled": true,
|
3083 |
"dev": true,
|
|
|
3084 |
"requires": {
|
3085 |
"ansi-regex": "^2.0.0"
|
3086 |
}
|
@@ -3124,12 +3141,14 @@
|
|
3124 |
"wrappy": {
|
3125 |
"version": "1.0.2",
|
3126 |
"bundled": true,
|
3127 |
-
"dev": true
|
|
|
3128 |
},
|
3129 |
"yallist": {
|
3130 |
"version": "3.0.2",
|
3131 |
"bundled": true,
|
3132 |
-
"dev": true
|
|
|
3133 |
}
|
3134 |
}
|
3135 |
},
|
2624 |
"ansi-regex": {
|
2625 |
"version": "2.1.1",
|
2626 |
"bundled": true,
|
2627 |
+
"dev": true,
|
2628 |
+
"optional": true
|
2629 |
},
|
2630 |
"aproba": {
|
2631 |
"version": "1.2.0",
|
2646 |
"balanced-match": {
|
2647 |
"version": "1.0.0",
|
2648 |
"bundled": true,
|
2649 |
+
"dev": true,
|
2650 |
+
"optional": true
|
2651 |
},
|
2652 |
"brace-expansion": {
|
2653 |
"version": "1.1.11",
|
2654 |
"bundled": true,
|
2655 |
"dev": true,
|
2656 |
+
"optional": true,
|
2657 |
"requires": {
|
2658 |
"balanced-match": "^1.0.0",
|
2659 |
"concat-map": "0.0.1"
|
2668 |
"code-point-at": {
|
2669 |
"version": "1.1.0",
|
2670 |
"bundled": true,
|
2671 |
+
"dev": true,
|
2672 |
+
"optional": true
|
2673 |
},
|
2674 |
"concat-map": {
|
2675 |
"version": "0.0.1",
|
2676 |
"bundled": true,
|
2677 |
+
"dev": true,
|
2678 |
+
"optional": true
|
2679 |
},
|
2680 |
"console-control-strings": {
|
2681 |
"version": "1.1.0",
|
2682 |
"bundled": true,
|
2683 |
+
"dev": true,
|
2684 |
+
"optional": true
|
2685 |
},
|
2686 |
"core-util-is": {
|
2687 |
"version": "1.0.2",
|
2798 |
"inherits": {
|
2799 |
"version": "2.0.3",
|
2800 |
"bundled": true,
|
2801 |
+
"dev": true,
|
2802 |
+
"optional": true
|
2803 |
},
|
2804 |
"ini": {
|
2805 |
"version": "1.3.5",
|
2811 |
"version": "1.0.0",
|
2812 |
"bundled": true,
|
2813 |
"dev": true,
|
2814 |
+
"optional": true,
|
2815 |
"requires": {
|
2816 |
"number-is-nan": "^1.0.0"
|
2817 |
}
|
2826 |
"version": "3.0.4",
|
2827 |
"bundled": true,
|
2828 |
"dev": true,
|
2829 |
+
"optional": true,
|
2830 |
"requires": {
|
2831 |
"brace-expansion": "^1.1.7"
|
2832 |
}
|
2834 |
"minimist": {
|
2835 |
"version": "0.0.8",
|
2836 |
"bundled": true,
|
2837 |
+
"dev": true,
|
2838 |
+
"optional": true
|
2839 |
},
|
2840 |
"minipass": {
|
2841 |
"version": "2.2.4",
|
2842 |
"bundled": true,
|
2843 |
"dev": true,
|
2844 |
+
"optional": true,
|
2845 |
"requires": {
|
2846 |
"safe-buffer": "^5.1.1",
|
2847 |
"yallist": "^3.0.0"
|
2860 |
"version": "0.5.1",
|
2861 |
"bundled": true,
|
2862 |
"dev": true,
|
2863 |
+
"optional": true,
|
2864 |
"requires": {
|
2865 |
"minimist": "0.0.8"
|
2866 |
}
|
2941 |
"number-is-nan": {
|
2942 |
"version": "1.0.1",
|
2943 |
"bundled": true,
|
2944 |
+
"dev": true,
|
2945 |
+
"optional": true
|
2946 |
},
|
2947 |
"object-assign": {
|
2948 |
"version": "4.1.1",
|
2954 |
"version": "1.4.0",
|
2955 |
"bundled": true,
|
2956 |
"dev": true,
|
2957 |
+
"optional": true,
|
2958 |
"requires": {
|
2959 |
"wrappy": "1"
|
2960 |
}
|
3040 |
"safe-buffer": {
|
3041 |
"version": "5.1.1",
|
3042 |
"bundled": true,
|
3043 |
+
"dev": true,
|
3044 |
+
"optional": true
|
3045 |
},
|
3046 |
"safer-buffer": {
|
3047 |
"version": "2.1.2",
|
3077 |
"version": "1.0.2",
|
3078 |
"bundled": true,
|
3079 |
"dev": true,
|
3080 |
+
"optional": true,
|
3081 |
"requires": {
|
3082 |
"code-point-at": "^1.0.0",
|
3083 |
"is-fullwidth-code-point": "^1.0.0",
|
3097 |
"version": "3.0.1",
|
3098 |
"bundled": true,
|
3099 |
"dev": true,
|
3100 |
+
"optional": true,
|
3101 |
"requires": {
|
3102 |
"ansi-regex": "^2.0.0"
|
3103 |
}
|
3141 |
"wrappy": {
|
3142 |
"version": "1.0.2",
|
3143 |
"bundled": true,
|
3144 |
+
"dev": true,
|
3145 |
+
"optional": true
|
3146 |
},
|
3147 |
"yallist": {
|
3148 |
"version": "3.0.2",
|
3149 |
"bundled": true,
|
3150 |
+
"dev": true,
|
3151 |
+
"optional": true
|
3152 |
}
|
3153 |
}
|
3154 |
},
|
js/app/gutenberg_support/src/blocks/ta-image/edit.js
CHANGED
@@ -268,7 +268,7 @@ class ImageEdit extends Component {
|
|
268 |
this.onSelectImage( image );
|
269 |
} else {
|
270 |
const request = wp.apiFetch( {
|
271 |
-
path: wp.url.addQueryArgs( 'wp/v2/media/' + image.id , {
|
272 |
context: 'edit',
|
273 |
_locale: 'user'
|
274 |
} ),
|
268 |
this.onSelectImage( image );
|
269 |
} else {
|
270 |
const request = wp.apiFetch( {
|
271 |
+
path: wp.url.addQueryArgs( '/wp/v2/media/' + image.id , {
|
272 |
context: 'edit',
|
273 |
_locale: 'user'
|
274 |
} ),
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link:
|
|
4 |
Tags: affiliate, link, affiliate link management, link cloaker, link redirect, shortlink, thirstyaffiliates, thirsty affiliates
|
5 |
Requires at least: 5.0
|
6 |
Requires PHP: 5.6
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag: 3.9.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -159,6 +159,9 @@ See our [Knowledge Base](https://thirstyaffiliates.com/knowledge-base/?utm_sourc
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
162 |
= 3.9.3 =
|
163 |
* Improvement: Add an action hook before the enhanced JavaScript redirect
|
164 |
* Bug Fix: Security fix on the link attachment title
|
4 |
Tags: affiliate, link, affiliate link management, link cloaker, link redirect, shortlink, thirstyaffiliates, thirsty affiliates
|
5 |
Requires at least: 5.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Tested up to: 5.5
|
8 |
+
Stable tag: 3.9.4
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 3.9.4 =
|
163 |
+
* Bug Fix: Conflict with the SmartCrawl Pro plugin
|
164 |
+
|
165 |
= 3.9.3 =
|
166 |
* Improvement: Add an action hook before the enhanced JavaScript redirect
|
167 |
* Bug Fix: Security fix on the link attachment title
|
thirstyaffiliates.php
CHANGED
@@ -3,18 +3,18 @@
|
|
3 |
* Plugin Name: ThirstyAffiliates
|
4 |
* Plugin URI: http://thirstyaffiliates.com/
|
5 |
* Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
|
6 |
-
* Version: 3.9.
|
7 |
-
* Author:
|
8 |
-
* Author URI: https://
|
9 |
* Requires at least: 4.5
|
10 |
-
* Tested up to: 5.
|
11 |
*
|
12 |
* Text Domain: thirstyaffiliates
|
13 |
* Domain Path: /languages/
|
14 |
*
|
15 |
* @package ThirstyAffiliates
|
16 |
* @category Core
|
17 |
-
* @author
|
18 |
*/
|
19 |
|
20 |
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
* Plugin Name: ThirstyAffiliates
|
4 |
* Plugin URI: http://thirstyaffiliates.com/
|
5 |
* Description: ThirstyAffiliates is a revolution in affiliate link management. Collect, collate and store your affiliate links for use in your posts and pages.
|
6 |
+
* Version: 3.9.4
|
7 |
+
* Author: Caseproof
|
8 |
+
* Author URI: https://caseproof.com/
|
9 |
* Requires at least: 4.5
|
10 |
+
* Tested up to: 5.5
|
11 |
*
|
12 |
* Text Domain: thirstyaffiliates
|
13 |
* Domain Path: /languages/
|
14 |
*
|
15 |
* @package ThirstyAffiliates
|
16 |
* @category Core
|
17 |
+
* @author Rymera Web Co
|
18 |
*/
|
19 |
|
20 |
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|