Plugin Directory

Changeset 2493370


Ignore:
Timestamp:
03/11/2021 03:26:27 PM (5 years ago)
Author:
actblue
Message:

Deploy version 1.4.1

Location:
actblue-contributions
Files:
58 added
8 edited

Legend:

Unmodified
Added
Removed
  • actblue-contributions/trunk/actblue-contributions.php

    r2455824 r2493370  
    1515 * Text Domain:      actblue
    1616 * Domain Path:      /languages
    17  * Version:          1.4.0
     17 * Version:          1.4.1
    1818 */
    1919
     
    2626 * Current plugin version.
    2727 */
    28 define( 'ACTBLUE_PLUGIN_VERSION', '1.4.0' );
     28define( 'ACTBLUE_PLUGIN_VERSION', '1.4.1' );
    2929
    3030/**
  • actblue-contributions/trunk/blocks/custom/actblue-buttons/edit.js

    r2436908 r2493370  
    22 * WordPress dependencies
    33 */
    4 import {
    5     __experimentalAlignmentHookSettingsProvider as AlignmentHookSettingsProvider,
    6     InnerBlocks,
    7 } from "@wordpress/block-editor";
     4import { InnerBlocks } from "@wordpress/block-editor";
    85
    96const ALLOWED_BLOCKS = ["actblue/button"];
     
    1310};
    1411
    15 // Inside buttons block alignment options are not supported.
    16 const alignmentHooksSetting = {
    17     isEmbedButton: true,
    18 };
    19 
    2012function ActBlueButtonsEdit({ className }) {
    2113    return (
    2214        <div className={`${className} wp-block-buttons`}>
    23             <AlignmentHookSettingsProvider value={alignmentHooksSetting}>
    24                 <InnerBlocks
    25                     allowedBlocks={ALLOWED_BLOCKS}
    26                     template={BUTTONS_TEMPLATE}
    27                     __experimentalUIParts={UI_PARTS}
    28                     __experimentalMoverDirection="horizontal"
    29                 />
    30             </AlignmentHookSettingsProvider>
     15            <InnerBlocks
     16                allowedBlocks={ALLOWED_BLOCKS}
     17                template={BUTTONS_TEMPLATE}
     18                __experimentalUIParts={UI_PARTS}
     19                __experimentalMoverDirection="horizontal"
     20            />
    3121        </div>
    3222    );
  • actblue-contributions/trunk/blocks/custom/actblue-embed/embed-placeholder.js

    r2435956 r2493370  
    22 * WordPress dependencies
    33 */
    4 import { __, _x } from '@wordpress/i18n';
    5 import { Button, Placeholder, ExternalLink } from '@wordpress/components';
    6 import { BlockIcon } from '@wordpress/block-editor';
     4import { __, _x } from "@wordpress/i18n";
     5import { Button, Placeholder, ExternalLink } from "@wordpress/components";
     6import { BlockIcon } from "@wordpress/block-editor";
    77
    8 const EmbedPlaceholder = ( props ) => {
     8const EmbedPlaceholder = (props) => {
    99    const {
    1010        icon,
     
    1919    return (
    2020        <Placeholder
    21             icon={ <BlockIcon icon={ icon } showColors /> }
    22             label={ label }
     21            icon={<BlockIcon icon={icon} showColors />}
     22            label={label}
    2323            className="wp-block-embed"
    24             instructions={ __(
    25                 'Paste a link to the content you want to display on your site.'
    26             ) }
     24            instructions={__(
     25                "Paste a link to the content you want to display on your site."
     26            )}
    2727        >
    28             <form onSubmit={ onSubmit }>
     28            <form onSubmit={onSubmit}>
    2929                <input
    3030                    type="url"
    31                     value={ value || '' }
     31                    value={value || ""}
    3232                    className="components-placeholder__input"
    33                     aria-label={ label }
    34                     placeholder={ __( 'Enter URL to embed here…' ) }
    35                     onChange={ onChange }
     33                    aria-label={label}
     34                    placeholder={__("Enter URL to embed here…")}
     35                    onChange={onChange}
    3636                />
    3737                <Button isSecondary type="submit">
    38                     { _x( 'Embed', 'button label' ) }
     38                    {_x("Embed", "button label")}
    3939                </Button>
    4040            </form>
    4141            <div className="components-placeholder__learn-more">
    4242                <ExternalLink
    43                     href={ __(
    44                         'https://wordpress.org/support/article/embeds/'
    45                     ) }
     43                    href={__("https://wordpress.org/support/article/embeds/")}
    4644                >
    47                     { __( 'Learn more about embeds' ) }
     45                    {__("Learn more about embeds")}
    4846                </ExternalLink>
    4947            </div>
    50             { cannotEmbed && (
     48            {cannotEmbed && (
    5149                <div className="components-placeholder__error">
    5250                    <div className="components-placeholder__instructions">
    53                         { __( 'Sorry, this content could not be embedded.' ) }
     51                        {__("Sorry, this content could not be embedded.")}
    5452                    </div>
    55                     <Button isSecondary onClick={ tryAgain }>
    56                         { _x( 'Try again', 'button label' ) }
    57                     </Button>{ ' ' }
    58                     <Button isSecondary onClick={ fallback }>
    59                         { _x( 'Convert to link', 'button label' ) }
     53                    <Button isSecondary onClick={tryAgain}>
     54                        {_x("Try again", "button label")}
     55                    </Button>{" "}
     56                    <Button isSecondary onClick={fallback}>
     57                        {_x("Convert to link", "button label")}
    6058                    </Button>
    6159                </div>
    62             ) }
     60            )}
    6361        </Placeholder>
    6462    );
  • actblue-contributions/trunk/build/actblue-contributions.asset.php

    r2455824 r2493370  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => '80922398069bacf48d7c36355be5f6f1');
     1<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'c1198a207793e1bed3645a65e5d32a26');
  • actblue-contributions/trunk/build/actblue-contributions.js

    r2455824 r2493370  
    1 !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}({14:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},29:function(e,t,n){"use strict";n.r(t);var o,r=n(14),u=n.n(r),i=function(e){var t=e.currentTarget,n=t.dataset,o=n.token,r=n.refcode,u=n.amount;o?(window.actblue.requestContribution({token:o,amount:u,refcodes:{refcode:r},onLanded:function(){t.classList.remove("is-style-outline")}}),t.classList.add("is-style-outline"),e.preventDefault()):console.warn("Warning: the ActBlue token for this button is invalid. Please be sure to add the URL to a valid ActBlue embeddable form in the editor.")};o=function(){var e=window.actblue;"object"===u()(e)&&"function"==typeof e.requestContribution?document.querySelectorAll(".js-actblue-donation-button").forEach((function(e){e.addEventListener("click",i)})):console.warn("The actblue.js script is not loaded, but is required.")},"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o,{once:!0})}});
     1!function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=29)}({14:function(e,t){function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=o=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},29:function(e,t,o){"use strict";o.r(t);var n,r=o(14),u=o.n(r),i=function(e){var t=e.currentTarget,o=t.dataset,n=o.token,r=o.refcode,u=o.amount;n?(window.actblue.requestContribution({token:n,amount:u,refcodes:{refcode:r},onLanded:function(){t.classList.remove("is-style-outline")}}),t.classList.add("is-style-outline"),e.preventDefault()):console.warn("Warning: the ActBlue token for this button is invalid. Please be sure to add the URL to a valid ActBlue embeddable form in the editor.")};n=function(){var e=window.actblue;"object"===u()(e)&&"function"==typeof e.requestContribution?document.querySelectorAll(".js-actblue-donation-button").forEach((function(e){e.addEventListener("click",i)})):console.warn("The actblue.js script is not loaded, but is required.")},"loading"!==document.readyState?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}});
  • actblue-contributions/trunk/build/blocks.asset.php

    r2455824 r2493370  
    1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '07a645bab2255b723cf9763d5ca8fd58');
     1<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'e4752652dd4b780de67dfb0aa5135787');
  • actblue-contributions/trunk/build/blocks.js

    r2455824 r2493370  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=30)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===c)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(21);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(23),o=n(24),c=n(25),a=n(27);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(14),o=n(6);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r;!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)o(e,t[r])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var r=/\s+/;function o(e,o){if(o){var c=typeof o;"string"===c?function(e,t){for(var n=t.split(r),o=n.length,c=0;c<o;++c)e[n[c]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===c?function(e,t){for(var r in t)n.call(t,r)&&(e[r]=!!t[r])}(e,o):"number"===c&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var c=new e;t(c,r);var a=[];for(var i in c)c[i]&&a.push(i);return a.join(" ")}}();e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.data},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){var r=n(22);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}}},function(e,t,n){var r=n(26);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"icon",(function(){return J})),n.d(r,"title",(function(){return K})),n.d(r,"name",(function(){return Q})),n.d(r,"settings",(function(){return X}));var o={};n.r(o),n.d(o,"name",(function(){return ae})),n.d(o,"settings",(function(){return ie}));var c={};n.r(c),n.d(c,"name",(function(){return he})),n.d(c,"settings",(function(){return ye}));var a=n(5),i=n(1),l=n(19),u=n.n(l),s=n(10),b=n.n(s),p=n(11),f=n.n(p),d=n(6),m=n.n(d),v=n(12),h=n.n(v),y=n(15),g=n.n(y),O=n(8),j=n.n(O),w=n(0),_=n(3),k=n(2),x=n(9),E=Object(w.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(w.createElement)(x.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),C=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return Object(w.createElement)(w.Fragment,null,Object(w.createElement)(k.BlockControls,null,Object(w.createElement)(_.ToolbarGroup,null,t&&Object(w.createElement)(_.Button,{className:"components-toolbar__control",label:Object(i.__)("Edit URL"),icon:E,onClick:n}))))},S=function(){return Object(w.createElement)("div",{className:"wp-block-embed is-loading"},Object(w.createElement)(_.Spinner,null),Object(w.createElement)("p",null,Object(i.__)("Embedding…")))},B=function(e){var t=e.icon,n=e.label,r=e.value,o=e.onSubmit,c=e.onChange,a=e.cannotEmbed,l=e.fallback,u=e.tryAgain;return Object(w.createElement)(_.Placeholder,{icon:Object(w.createElement)(k.BlockIcon,{icon:t,showColors:!0}),label:n,className:"wp-block-embed",instructions:Object(i.__)("Paste a link to the content you want to display on your site.")},Object(w.createElement)("form",{onSubmit:o},Object(w.createElement)("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:Object(i.__)("Enter URL to embed here…"),onChange:c}),Object(w.createElement)(_.Button,{isSecondary:!0,type:"submit"},Object(i._x)("Embed","button label"))),Object(w.createElement)("div",{className:"components-placeholder__learn-more"},Object(w.createElement)(_.ExternalLink,{href:Object(i.__)("https://wordpress.org/support/article/embeds/")},Object(i.__)("Learn more about embeds"))),a&&Object(w.createElement)("div",{className:"components-placeholder__error"},Object(w.createElement)("div",{className:"components-placeholder__instructions"},Object(i.__)("Sorry, this content could not be embedded.")),Object(w.createElement)(_.Button,{isSecondary:!0,onClick:u},Object(i._x)("Try again","button label"))," ",Object(w.createElement)(_.Button,{isSecondary:!0,onClick:l},Object(i._x)("Convert to link","button label"))))},A=n(16),R=n.n(A);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=j()(e);if(t){var o=j()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g()(this,n)}}var T=function(e){h()(n,e);var t=P(n);function n(){var e;return b()(this,n),(e=t.apply(this,arguments)).hideOverlay=e.hideOverlay.bind(m()(e)),e.state={interactive:!1},e}return f()(n,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"render",value:function(){var e=this.props,t=e.preview,n=(e.url,e.type),r=e.caption,o=e.onCaptionChange,c=e.isSelected,a=e.className,l=(e.icon,e.label,this.state.interactive),u=t.html,s=Object(w.createElement)("div",{className:"wp-block-embed__wrapper"},Object(w.createElement)("div",{dangerouslySetInnerHTML:{__html:u}}),!l&&Object(w.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(w.createElement)("figure",{className:R()(a,"wp-block-embed",{"is-type-video":"video"===n})},s,(!k.RichText.isEmpty(r)||c)&&Object(w.createElement)(k.RichText,{tagName:"figcaption",placeholder:Object(i.__)("Write caption…"),value:r,onChange:o,inlineToolbar:!0}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),n}(w.Component),N=n(7),U=n.n(N),L=n(17),I=n(18),M=n(20),D=n.n(M),G=function(e){var t=e.url,n=D()(e,["url"]),r=[];Object.keys(n).map((function(e){n[e]&&r.push("".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n[e])))}));var o=!!r.length&&r.join("&");return t&&o?"".concat(t,"?").concat(o):t};function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=j()(e);if(t){var o=j()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g()(this,n)}}var F=function(e){h()(n,e);var t=H(n);function n(){var e;return b()(this,n),(e=t.apply(this,arguments)).switchBackToURLInput=e.switchBackToURLInput.bind(m()(e)),e.setUrl=e.setUrl.bind(m()(e)),e.handleIncomingPreview=e.handleIncomingPreview.bind(m()(e)),e.state={editingURL:!1,url:e.props.attributes.url},e.props.preview&&e.handleIncomingPreview(),e}return f()(n,[{key:"handleIncomingPreview",value:function(){(0,this.props.setAttributes)(this.props.attributes)}},{key:"componentDidUpdate",value:function(e){var t=void 0!==this.props.preview,n=void 0!==e.preview,r=e.preview&&this.props.preview&&this.props.preview.html!==e.preview.html||t&&!n,o=this.props.attributes.url!==e.attributes.url;if(r||o){if(this.props.cannotEmbed)return void(this.props.fetching||this.resubmitWithoutTrailingSlash());this.handleIncomingPreview()}}},{key:"resubmitWithoutTrailingSlash",value:function(){this.setState((function(e){return{url:e.url.replace(/\/$/,"")}}),this.setUrl)}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;0===t.indexOf("https://secure.actblue.com")?(this.setState({editingURL:!1}),n({url:t})):console.error("Can not use ActBlue Embed block to embed non-ActBlue urls")}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0}),this.props.clearActBlueSettings()}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=this.props,c=o.fetching,i=o.setAttributes,l=o.isSelected,u=o.preview,s=o.cannotEmbed,b=o.tryAgain;if(c)return Object(w.createElement)(S,null);if(!u||s||r)return Object(w.createElement)(B,{icon:J,label:"ActBlue URL",onSubmit:this.setUrl,value:n,cannotEmbed:s,onChange:function(t){return e.setState({url:t.target.value})},fallback:function(){return function(e,t){var n=Object(w.createElement)("a",{href:e},e);t(Object(a.createBlock)("core/paragraph",{content:Object(w.renderToString)(n)}))}(n,e.props.onReplace)},tryAgain:b});var p=this.props.attributes,f=p.caption,d=p.type,m=U()(this.props.attributes.className,this.props.className);return Object(w.createElement)(w.Fragment,null,Object(w.createElement)(C,{showEditButton:u&&!s,switchBackToURLInput:this.switchBackToURLInput}),Object(w.createElement)(T,{preview:u,className:m,url:n,type:d,caption:f,onCaptionChange:function(e){return i({caption:e})},isSelected:l,icon:J,label:"ActBlue URL"}))}}]),n}(w.Component),V=function(e){h()(n,e);var t=H(n);function n(){var e;return b()(this,n),(e=t.apply(this,arguments)).clearActBlueSettings=e.clearActBlueSettings.bind(m()(e)),e}return f()(n,[{key:"clearActBlueSettings",value:function(){this.props.setAttributes({refcode:""})}},{key:"render",value:function(){var e=this;return Object(w.createElement)(w.Fragment,null,Object(w.createElement)(F,u()({},this.props,{clearActBlueSettings:this.clearActBlueSettings})),Object(w.createElement)(k.InspectorControls,null,Object(w.createElement)(_.PanelBody,{title:Object(i.__)("ActBlue Settings"),className:"actblue-embed-settings__panel"},Object(w.createElement)(_.TextControl,{label:"Refcode",value:this.props.attributes.refcode,onChange:function(t){return e.props.setAttributes({refcode:t})},help:"Add a refcode to this embed form."}))))}}]),n}(w.Component),W=Object(L.compose)(Object(I.withSelect)((function(e,t){var n=t.attributes.url,r=G({url:n,preview:"true"}),o=e("core"),c=o.getEmbedPreview,a=o.isPreviewEmbedFallback,i=o.isRequestingEmbedPreview,l=void 0!==r&&c(r),u=void 0!==r&&a(r),s=void 0!==r&&i(r),b=!!l&&void 0===l.type&&!1===l.html,p=!!l&&l.data&&404===l.data.status,f=!!l&&!b&&!p;return{preview:f?l:void 0,fetching:s,cannotEmbed:void 0!==r&&(!f||u)}})),Object(I.withDispatch)((function(e,t){var n=t.attributes.url,r=e("core/data");return{tryAgain:function(){r.invalidateResolution("core","getEmbedPreview",[n])}}})))(V),Z=n(4),z=n.n(Z),$=function(e){var t=e.attributes,n=t.url,r=t.caption,o=t.type,c=t.refcode;if(!n)return null;var a=R()("wp-block-embed","is-provider-actblue",z()({},"is-type-".concat(o),o));return Object(w.createElement)("figure",{className:a},Object(w.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(G({url:n,refcode:c}),"\n")),!k.RichText.isEmpty(r)&&Object(w.createElement)(k.RichText.Content,{tagName:"figcaption",value:r}))},q={from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&/^\s*(https?:\/\/secure\.actblue\.com\S+)\s*$/i.test(e.textContent)},transform:function(e){return Object(a.createBlock)(Q,{url:e.textContent.trim()})}}]},J=function(){return Object(w.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 46.32 27.69"},Object(w.createElement)(x.Path,{d:"M23.33,27.69l-2.56-6H9.14L6.58,27.62H0L11.91,0h5.95L29.77,27.62H23.33ZM15,8.24l-3.46,8h6.92Zm29.91,7.41A6.26,6.26,0,0,1,46.31,20a7.45,7.45,0,0,1-2,5.12c-1.52,1.73-4.15,2.56-8,2.56h-4.5L24.3,10.11V0H35a16.79,16.79,0,0,1,4.84.69,6.89,6.89,0,0,1,3.05,1.8,7.23,7.23,0,0,1,1.87,4.85,5.61,5.61,0,0,1-2.08,4.84,6.52,6.52,0,0,1-1,.7,4.42,4.42,0,0,1-1,.48A7.09,7.09,0,0,1,44.86,15.65ZM30.46,5.26v6h3a10.15,10.15,0,0,0,3.8-.55,2.41,2.41,0,0,0,1.25-2.42,2.5,2.5,0,0,0-1.18-2.43,8.8,8.8,0,0,0-3.87-.62ZM38.7,21.81A2.68,2.68,0,0,0,40,19.24a2.44,2.44,0,0,0-1.38-2.56,12.08,12.08,0,0,0-4.5-.62H30.46v6.37h4.29A9.89,9.89,0,0,0,38.7,21.81Z",fill:"#00a9e0"}))},K=Object(i.__)("ActBlue Embed"),Q="actblue/embed",X={title:K,icon:J,description:Object(i.__)("Embed an ActBlue contribution form."),category:"embed",responsive:!1,keywords:[],supports:{align:!0},transforms:q,attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},allowResponsive:{type:"boolean",default:!0},refcode:{type:"string"}},edit:W,save:$},Y=["actblue/button"],ee=[["actblue/button"]],te={hasSelectedUI:!1},ne={isEmbedButton:!0};var re=function(e){var t=e.className;return Object(w.createElement)("div",{className:"".concat(t," wp-block-buttons")},Object(w.createElement)(k.__experimentalAlignmentHookSettingsProvider,{value:ne},Object(w.createElement)(k.InnerBlocks,{allowedBlocks:Y,template:ee,__experimentalUIParts:te,__experimentalMoverDirection:"horizontal"})))},oe=function(){return Object(w.createElement)("div",{className:"wp-block-buttons"},Object(w.createElement)(k.InnerBlocks.Content,null))},ce={from:[{type:"block",blocks:["core/buttons"],transform:function(e,t){var n=t.map((function(e){return Object(a.createBlock)("actblue/button",e.attributes)}));return Object(a.createBlock)(ae,{},n)}}],to:[{type:"block",blocks:["core/buttons"],transform:function(e,t){var n=t.map((function(e){return Object(a.createBlock)("core/button",e.attributes)}));return Object(a.createBlock)("core/buttons",e,n)}}]},ae="actblue/buttons",ie={title:Object(i.__)("ActBlue Buttons"),description:Object(i.__)("Prompt visitors to take action with a group of ActBlue donation buttons."),category:"layout",icon:J,keywords:[Object(i.__)("link")],supports:{align:!0,alignWide:!1},edit:re,save:oe,transforms:ce},le=n(13),ue=n.n(le);function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){z()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pe=window.getComputedStyle,fe=Object(_.withFallbackStyles)((function(e,t){var n=t.textColor,r=t.backgroundColor,o=r&&r.color,c=n&&n.color,a=!c&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:o||!e?void 0:pe(e).backgroundColor,fallbackTextColor:c||!a?void 0:pe(a).color}}));function de(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(w.useCallback)((function(e){r({borderRadius:e})}),[r]);return Object(w.createElement)(_.PanelBody,{title:Object(i.__)("Border settings")},Object(w.createElement)(_.RangeControl,{value:n,label:Object(i.__)("Border radius"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:o}))}var me=Object(L.compose)([Object(k.withColors)("backgroundColor",{textColor:"color"}),fe])((function(e){var t,n=e.attributes,r=e.backgroundColor,o=e.textColor,c=e.setBackgroundColor,a=e.setTextColor,l=e.fallbackBackgroundColor,u=e.fallbackTextColor,s=e.setAttributes,b=e.className,p=n.borderRadius,f=n.placeholder,d=n.text,m=n.endpoint,v=n.refcode,h=n.amount,y=Object(w.useState)(!1),g=ue()(y,2),O=g[0],j=g[1],x=Object(w.useState)(""),E=ue()(x,2),C=E[0],S=E[1],B=Object(w.useState)("Connect"),A=ue()(B,2),R=A[0],P=A[1],T=Object(w.useState)(!1),N=ue()(T,2),L=N[0],I=N[1],M=Object(k.__experimentalUseGradient)(),D=M.gradientClass,G=M.gradientValue,H=M.setGradient;return Object(w.createElement)("div",{className:b},Object(w.createElement)(k.RichText,{placeholder:f||Object(i.__)("Add text…"),value:d,onChange:function(e){return s({text:e})},withoutInteractiveFormatting:!0,className:U()("wp-block-button__link",(t={"has-background":r.color||G},z()(t,r.class,!G&&r.class),z()(t,"has-text-color",o.color),z()(t,o.class,o.class),z()(t,D,D),z()(t,"no-border-radius",0===p),t)),style:be(be({},!r.color&&G?{background:G}:{backgroundColor:r.color}),{},{color:o.color,borderRadius:p?p+"px":void 0})}),Object(w.createElement)(k.InspectorControls,null,Object(w.createElement)(_.PanelBody,{title:Object(i.__)("ActBlue Settings"),className:"actblue-button-settings__panel"},Object(w.createElement)(_.TextControl,{label:"Embed URL",value:m,onChange:function(e){return s({endpoint:e})},help:"Use an ActBlue embedded form URL to connect this button."}),Object(w.createElement)(_.Button,{isSecondary:!0,isBusy:O,onClick:function(){if(m){j(!0),S("");var e="https://secure.actblue.com/cf/oembed?url=".concat(m,"&format=json");fetch(e).then((function(e){if(404===e.status)throw new Error("Error: could not find an ActBlue embeddable form at that URL.");return e.json()})).then((function(e){s({token:e.token}),setTimeout((function(){return I(!1)}),2e3),I(!0)})).catch((function(e){console.error(e),s({token:""}),S(e.message)})).finally((function(){P("Connect"),j(!1)}))}},disabled:O||!m},R),Object(w.createElement)("span",{className:U()("actblue-button-settings__success-message",{"actblue-button-settings__success-message--visible":L})},"Success!"),C&&Object(w.createElement)("p",{className:"actblue-button-settings__fetch-message"},C),Object(w.createElement)(_.HorizontalRule,null),Object(w.createElement)(_.TextControl,{label:"Refcode",value:v,onChange:function(e){return s({refcode:e})},help:"Associate contributions made through this button with a refcode."}),Object(w.createElement)(_.TextControl,{type:"number",label:"Amount",value:h?h/100:"",onChange:function(e){return s({amount:e?100*e:void 0})},help:"Set the amount of the contribution in dollars, leave blank to let the donor choose an amount."})),Object(w.createElement)(k.__experimentalPanelColorGradientSettings,{title:Object(i.__)("Background & Text Color"),settings:[{colorValue:o.color,onColorChange:a,label:Object(i.__)("Text color")},{colorValue:r.color,onColorChange:c,gradientValue:G,onGradientChange:H,label:Object(i.__)("Background")}]},Object(w.createElement)(k.ContrastChecker,{isLargeText:!1,textColor:o.color,backgroundColor:r.color,fallbackBackgroundColor:l,fallbackTextColor:u})),Object(w.createElement)(de,{borderRadius:p,setAttributes:s})))})),ve=function(e){var t,n=e.attributes,r=n.amount,o=n.backgroundColor,c=n.borderRadius,a=n.customBackgroundColor,i=n.customGradient,l=n.customTextColor,u=n.endpoint,s=n.gradient,b=n.refcode,p=n.text,f=n.textColor,d=n.title,m=n.token,v=Object(k.getColorClassName)("color",f),h=!i&&Object(k.getColorClassName)("background-color",o),y=Object(k.__experimentalGetGradientClass)(s),g=U()("wp-block-button__link",(t={"has-text-color":f||l},z()(t,v,v),z()(t,"has-background",o||a||i||s),z()(t,h,h),z()(t,"no-border-radius",0===c),z()(t,y,y),t)),O={background:i||void 0,backgroundColor:h||i||s?void 0:a,color:v?void 0:l,borderRadius:c?c+"px":void 0};return Object(w.createElement)("div",{className:"wp-block-button"},Object(w.createElement)(k.RichText.Content,{tagName:"a",className:"".concat(g," js-actblue-donation-button"),href:u,title:d,style:O,value:p,target:"_blank","data-token":m,"data-refcode":b,"data-amount":r,rel:"noopener noreferrer"}))},he="actblue/button",ye={name:he,icon:J,title:"ActBlue Button",description:"Add a button for an ActBlue contribution.",category:"layout",keywords:[Object(i.__)("link")],example:{attributes:{className:"is-style-fill",backgroundColor:"vivid-green-cyan",text:Object(i.__)("Call to Action")}},supports:{align:!1,alignWide:!1},styles:[{name:"fill",label:Object(i.__)("Fill"),isDefault:!0},{name:"outline",label:Object(i.__)("Outline")}],parent:["actblue/buttons"],attributes:{title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},placeholder:{type:"string"},borderRadius:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"},token:{type:"string"},endpoint:{type:"string"},refcode:{type:"string"},amount:{type:"number"}},edit:me,save:ve};[r,o,c].forEach((function(e){var t=e.name,n=e.settings;Object(a.registerBlockType)(t,n)}))}]);
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=30)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var l in n)r.call(n,l)&&n[l]&&e.push(l)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(23),o=r(24),c=r(25),a=r(27);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(14).default,o=r(6);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var r=t.length,n=0;n<r;++n)o(e,t[n])}e.prototype=Object.create(null);var r={}.hasOwnProperty;var n=/\s+/;function o(e,o){if(o){var c=typeof o;"string"===c?function(e,t){for(var r=t.split(n),o=r.length,c=0;c<o;++c)e[r[c]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===c?function(e,t){for(var n in t)r.call(t,n)&&(e[n]=!!t[n])}(e,o):"number"===c&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];var c=new e;t(c,n);var a=[];for(var l in c)c[l]&&a.push(l);return a.join(" ")}}();e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.data},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(22);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw c}}return r}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(26);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"icon",(function(){return J})),r.d(n,"title",(function(){return K})),r.d(n,"name",(function(){return Q})),r.d(n,"settings",(function(){return X}));var o={};r.r(o),r.d(o,"name",(function(){return ce})),r.d(o,"settings",(function(){return ae}));var c={};r.r(c),r.d(c,"name",(function(){return ve})),r.d(c,"settings",(function(){return he}));var a=r(5),l=r(1),i=r(19),u=r.n(i),s=r(10),p=r.n(s),b=r(11),f=r.n(b),d=r(6),m=r.n(d),v=r(12),h=r.n(v),y=r(15),g=r.n(y),O=r(8),x=r.n(O),j=r(0),_=r(3),w=r(2),k=r(9),E=Object(j.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(j.createElement)(k.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),C=function(e){var t=e.showEditButton,r=e.switchBackToURLInput;return Object(j.createElement)(j.Fragment,null,Object(j.createElement)(w.BlockControls,null,Object(j.createElement)(_.ToolbarGroup,null,t&&Object(j.createElement)(_.Button,{className:"components-toolbar__control",label:Object(l.__)("Edit URL"),icon:E,onClick:r}))))},B=function(){return Object(j.createElement)("div",{className:"wp-block-embed is-loading"},Object(j.createElement)(_.Spinner,null),Object(j.createElement)("p",null,Object(l.__)("Embedding…")))},S=function(e){var t=e.icon,r=e.label,n=e.value,o=e.onSubmit,c=e.onChange,a=e.cannotEmbed,i=e.fallback,u=e.tryAgain;return Object(j.createElement)(_.Placeholder,{icon:Object(j.createElement)(w.BlockIcon,{icon:t,showColors:!0}),label:r,className:"wp-block-embed",instructions:Object(l.__)("Paste a link to the content you want to display on your site.")},Object(j.createElement)("form",{onSubmit:o},Object(j.createElement)("input",{type:"url",value:n||"",className:"components-placeholder__input","aria-label":r,placeholder:Object(l.__)("Enter URL to embed here…"),onChange:c}),Object(j.createElement)(_.Button,{isSecondary:!0,type:"submit"},Object(l._x)("Embed","button label"))),Object(j.createElement)("div",{className:"components-placeholder__learn-more"},Object(j.createElement)(_.ExternalLink,{href:Object(l.__)("https://wordpress.org/support/article/embeds/")},Object(l.__)("Learn more about embeds"))),a&&Object(j.createElement)("div",{className:"components-placeholder__error"},Object(j.createElement)("div",{className:"components-placeholder__instructions"},Object(l.__)("Sorry, this content could not be embedded.")),Object(j.createElement)(_.Button,{isSecondary:!0,onClick:u},Object(l._x)("Try again","button label"))," ",Object(j.createElement)(_.Button,{isSecondary:!0,onClick:i},Object(l._x)("Convert to link","button label"))))},A=r(16),R=r.n(A);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x()(e);if(t){var o=x()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g()(this,r)}}var T=function(e){h()(r,e);var t=P(r);function r(){var e;return p()(this,r),(e=t.apply(this,arguments)).hideOverlay=e.hideOverlay.bind(m()(e)),e.state={interactive:!1},e}return f()(r,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"render",value:function(){var e=this.props,t=e.preview,r=(e.url,e.type),n=e.caption,o=e.onCaptionChange,c=e.isSelected,a=e.className,i=(e.icon,e.label,this.state.interactive),u=t.html,s=Object(j.createElement)("div",{className:"wp-block-embed__wrapper"},Object(j.createElement)("div",{dangerouslySetInnerHTML:{__html:u}}),!i&&Object(j.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(j.createElement)("figure",{className:R()(a,"wp-block-embed",{"is-type-video":"video"===r})},s,(!w.RichText.isEmpty(n)||c)&&Object(j.createElement)(w.RichText,{tagName:"figcaption",placeholder:Object(l.__)("Write caption…"),value:n,onChange:o,inlineToolbar:!0}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),r}(j.Component),M=r(7),N=r.n(M),U=r(17),L=r(18),I=r(20),G=r.n(I),D=function(e){var t=e.url,r=G()(e,["url"]),n=[];Object.keys(r).map((function(e){r[e]&&n.push("".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(r[e])))}));var o=!!n.length&&n.join("&");return t&&o?"".concat(t,"?").concat(o):t};function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x()(e);if(t){var o=x()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g()(this,r)}}var H=function(e){h()(r,e);var t=F(r);function r(){var e;return p()(this,r),(e=t.apply(this,arguments)).switchBackToURLInput=e.switchBackToURLInput.bind(m()(e)),e.setUrl=e.setUrl.bind(m()(e)),e.handleIncomingPreview=e.handleIncomingPreview.bind(m()(e)),e.state={editingURL:!1,url:e.props.attributes.url},e.props.preview&&e.handleIncomingPreview(),e}return f()(r,[{key:"handleIncomingPreview",value:function(){(0,this.props.setAttributes)(this.props.attributes)}},{key:"componentDidUpdate",value:function(e){var t=void 0!==this.props.preview,r=void 0!==e.preview,n=e.preview&&this.props.preview&&this.props.preview.html!==e.preview.html||t&&!r,o=this.props.attributes.url!==e.attributes.url;if(n||o){if(this.props.cannotEmbed)return void(this.props.fetching||this.resubmitWithoutTrailingSlash());this.handleIncomingPreview()}}},{key:"resubmitWithoutTrailingSlash",value:function(){this.setState((function(e){return{url:e.url.replace(/\/$/,"")}}),this.setUrl)}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,r=this.props.setAttributes;0===t.indexOf("https://secure.actblue.com")?(this.setState({editingURL:!1}),r({url:t})):console.error("Can not use ActBlue Embed block to embed non-ActBlue urls")}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0}),this.props.clearActBlueSettings()}},{key:"render",value:function(){var e=this,t=this.state,r=t.url,n=t.editingURL,o=this.props,c=o.fetching,l=o.setAttributes,i=o.isSelected,u=o.preview,s=o.cannotEmbed,p=o.tryAgain;if(c)return Object(j.createElement)(B,null);if(!u||s||n)return Object(j.createElement)(S,{icon:J,label:"ActBlue URL",onSubmit:this.setUrl,value:r,cannotEmbed:s,onChange:function(t){return e.setState({url:t.target.value})},fallback:function(){return function(e,t){var r=Object(j.createElement)("a",{href:e},e);t(Object(a.createBlock)("core/paragraph",{content:Object(j.renderToString)(r)}))}(r,e.props.onReplace)},tryAgain:p});var b=this.props.attributes,f=b.caption,d=b.type,m=N()(this.props.attributes.className,this.props.className);return Object(j.createElement)(j.Fragment,null,Object(j.createElement)(C,{showEditButton:u&&!s,switchBackToURLInput:this.switchBackToURLInput}),Object(j.createElement)(T,{preview:u,className:m,url:r,type:d,caption:f,onCaptionChange:function(e){return l({caption:e})},isSelected:i,icon:J,label:"ActBlue URL"}))}}]),r}(j.Component),V=function(e){h()(r,e);var t=F(r);function r(){var e;return p()(this,r),(e=t.apply(this,arguments)).clearActBlueSettings=e.clearActBlueSettings.bind(m()(e)),e}return f()(r,[{key:"clearActBlueSettings",value:function(){this.props.setAttributes({refcode:""})}},{key:"render",value:function(){var e=this;return Object(j.createElement)(j.Fragment,null,Object(j.createElement)(H,u()({},this.props,{clearActBlueSettings:this.clearActBlueSettings})),Object(j.createElement)(w.InspectorControls,null,Object(j.createElement)(_.PanelBody,{title:Object(l.__)("ActBlue Settings"),className:"actblue-embed-settings__panel"},Object(j.createElement)(_.TextControl,{label:"Refcode",value:this.props.attributes.refcode,onChange:function(t){return e.props.setAttributes({refcode:t})},help:"Add a refcode to this embed form."}))))}}]),r}(j.Component),W=Object(U.compose)(Object(L.withSelect)((function(e,t){var r=t.attributes.url,n=D({url:r,preview:"true"}),o=e("core"),c=o.getEmbedPreview,a=o.isPreviewEmbedFallback,l=o.isRequestingEmbedPreview,i=void 0!==n&&c(n),u=void 0!==n&&a(n),s=void 0!==n&&l(n),p=!!i&&void 0===i.type&&!1===i.html,b=!!i&&i.data&&404===i.data.status,f=!!i&&!p&&!b;return{preview:f?i:void 0,fetching:s,cannotEmbed:void 0!==n&&(!f||u)}})),Object(L.withDispatch)((function(e,t){var r=t.attributes.url,n=e("core/data");return{tryAgain:function(){n.invalidateResolution("core","getEmbedPreview",[r])}}})))(V),Z=r(4),z=r.n(Z),$=function(e){var t=e.attributes,r=t.url,n=t.caption,o=t.type,c=t.refcode;if(!r)return null;var a=R()("wp-block-embed","is-provider-actblue",z()({},"is-type-".concat(o),o));return Object(j.createElement)("figure",{className:a},Object(j.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(D({url:r,refcode:c}),"\n")),!w.RichText.isEmpty(n)&&Object(j.createElement)(w.RichText.Content,{tagName:"figcaption",value:n}))},q={from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&/^\s*(https?:\/\/secure\.actblue\.com\S+)\s*$/i.test(e.textContent)},transform:function(e){return Object(a.createBlock)(Q,{url:e.textContent.trim()})}}]},J=function(){return Object(j.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 46.32 27.69"},Object(j.createElement)(k.Path,{d:"M23.33,27.69l-2.56-6H9.14L6.58,27.62H0L11.91,0h5.95L29.77,27.62H23.33ZM15,8.24l-3.46,8h6.92Zm29.91,7.41A6.26,6.26,0,0,1,46.31,20a7.45,7.45,0,0,1-2,5.12c-1.52,1.73-4.15,2.56-8,2.56h-4.5L24.3,10.11V0H35a16.79,16.79,0,0,1,4.84.69,6.89,6.89,0,0,1,3.05,1.8,7.23,7.23,0,0,1,1.87,4.85,5.61,5.61,0,0,1-2.08,4.84,6.52,6.52,0,0,1-1,.7,4.42,4.42,0,0,1-1,.48A7.09,7.09,0,0,1,44.86,15.65ZM30.46,5.26v6h3a10.15,10.15,0,0,0,3.8-.55,2.41,2.41,0,0,0,1.25-2.42,2.5,2.5,0,0,0-1.18-2.43,8.8,8.8,0,0,0-3.87-.62ZM38.7,21.81A2.68,2.68,0,0,0,40,19.24a2.44,2.44,0,0,0-1.38-2.56,12.08,12.08,0,0,0-4.5-.62H30.46v6.37h4.29A9.89,9.89,0,0,0,38.7,21.81Z",fill:"#00a9e0"}))},K=Object(l.__)("ActBlue Embed"),Q="actblue/embed",X={title:K,icon:J,description:Object(l.__)("Embed an ActBlue contribution form."),category:"embed",responsive:!1,keywords:[],supports:{align:!0},transforms:q,attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},allowResponsive:{type:"boolean",default:!0},refcode:{type:"string"}},edit:W,save:$},Y=["actblue/button"],ee=[["actblue/button"]],te={hasSelectedUI:!1};var re=function(e){var t=e.className;return Object(j.createElement)("div",{className:"".concat(t," wp-block-buttons")},Object(j.createElement)(w.InnerBlocks,{allowedBlocks:Y,template:ee,__experimentalUIParts:te,__experimentalMoverDirection:"horizontal"}))},ne=function(){return Object(j.createElement)("div",{className:"wp-block-buttons"},Object(j.createElement)(w.InnerBlocks.Content,null))},oe={from:[{type:"block",blocks:["core/buttons"],transform:function(e,t){var r=t.map((function(e){return Object(a.createBlock)("actblue/button",e.attributes)}));return Object(a.createBlock)(ce,{},r)}}],to:[{type:"block",blocks:["core/buttons"],transform:function(e,t){var r=t.map((function(e){return Object(a.createBlock)("core/button",e.attributes)}));return Object(a.createBlock)("core/buttons",e,r)}}]},ce="actblue/buttons",ae={title:Object(l.__)("ActBlue Buttons"),description:Object(l.__)("Prompt visitors to take action with a group of ActBlue donation buttons."),category:"layout",icon:J,keywords:[Object(l.__)("link")],supports:{align:!0,alignWide:!1},edit:re,save:ne,transforms:oe},le=r(13),ie=r.n(le);function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){z()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe=window.getComputedStyle,be=Object(_.withFallbackStyles)((function(e,t){var r=t.textColor,n=t.backgroundColor,o=n&&n.color,c=r&&r.color,a=!c&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:o||!e?void 0:pe(e).backgroundColor,fallbackTextColor:c||!a?void 0:pe(a).color}}));function fe(e){var t=e.borderRadius,r=void 0===t?"":t,n=e.setAttributes,o=Object(j.useCallback)((function(e){n({borderRadius:e})}),[n]);return Object(j.createElement)(_.PanelBody,{title:Object(l.__)("Border settings")},Object(j.createElement)(_.RangeControl,{value:r,label:Object(l.__)("Border radius"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:o}))}var de=Object(U.compose)([Object(w.withColors)("backgroundColor",{textColor:"color"}),be])((function(e){var t,r=e.attributes,n=e.backgroundColor,o=e.textColor,c=e.setBackgroundColor,a=e.setTextColor,i=e.fallbackBackgroundColor,u=e.fallbackTextColor,s=e.setAttributes,p=e.className,b=r.borderRadius,f=r.placeholder,d=r.text,m=r.endpoint,v=r.refcode,h=r.amount,y=Object(j.useState)(!1),g=ie()(y,2),O=g[0],x=g[1],k=Object(j.useState)(""),E=ie()(k,2),C=E[0],B=E[1],S=Object(j.useState)("Connect"),A=ie()(S,2),R=A[0],P=A[1],T=Object(j.useState)(!1),M=ie()(T,2),U=M[0],L=M[1],I=Object(w.__experimentalUseGradient)(),G=I.gradientClass,D=I.gradientValue,F=I.setGradient;return Object(j.createElement)("div",{className:p},Object(j.createElement)(w.RichText,{placeholder:f||Object(l.__)("Add text…"),value:d,onChange:function(e){return s({text:e})},withoutInteractiveFormatting:!0,className:N()("wp-block-button__link",(t={"has-background":n.color||D},z()(t,n.class,!D&&n.class),z()(t,"has-text-color",o.color),z()(t,o.class,o.class),z()(t,G,G),z()(t,"no-border-radius",0===b),t)),style:se(se({},!n.color&&D?{background:D}:{backgroundColor:n.color}),{},{color:o.color,borderRadius:b?b+"px":void 0})}),Object(j.createElement)(w.InspectorControls,null,Object(j.createElement)(_.PanelBody,{title:Object(l.__)("ActBlue Settings"),className:"actblue-button-settings__panel"},Object(j.createElement)(_.TextControl,{label:"Embed URL",value:m,onChange:function(e){return s({endpoint:e})},help:"Use an ActBlue embedded form URL to connect this button."}),Object(j.createElement)(_.Button,{isSecondary:!0,isBusy:O,onClick:function(){if(m){x(!0),B("");var e="https://secure.actblue.com/cf/oembed?url=".concat(m,"&format=json");fetch(e).then((function(e){if(404===e.status)throw new Error("Error: could not find an ActBlue embeddable form at that URL.");return e.json()})).then((function(e){s({token:e.token}),setTimeout((function(){return L(!1)}),2e3),L(!0)})).catch((function(e){console.error(e),s({token:""}),B(e.message)})).finally((function(){P("Connect"),x(!1)}))}},disabled:O||!m},R),Object(j.createElement)("span",{className:N()("actblue-button-settings__success-message",{"actblue-button-settings__success-message--visible":U})},"Success!"),C&&Object(j.createElement)("p",{className:"actblue-button-settings__fetch-message"},C),Object(j.createElement)(_.HorizontalRule,null),Object(j.createElement)(_.TextControl,{label:"Refcode",value:v,onChange:function(e){return s({refcode:e})},help:"Associate contributions made through this button with a refcode."}),Object(j.createElement)(_.TextControl,{type:"number",label:"Amount",value:h?h/100:"",onChange:function(e){return s({amount:e?100*e:void 0})},help:"Set the amount of the contribution in dollars, leave blank to let the donor choose an amount."})),Object(j.createElement)(w.__experimentalPanelColorGradientSettings,{title:Object(l.__)("Background & Text Color"),settings:[{colorValue:o.color,onColorChange:a,label:Object(l.__)("Text color")},{colorValue:n.color,onColorChange:c,gradientValue:D,onGradientChange:F,label:Object(l.__)("Background")}]},Object(j.createElement)(w.ContrastChecker,{isLargeText:!1,textColor:o.color,backgroundColor:n.color,fallbackBackgroundColor:i,fallbackTextColor:u})),Object(j.createElement)(fe,{borderRadius:b,setAttributes:s})))})),me=function(e){var t,r=e.attributes,n=r.amount,o=r.backgroundColor,c=r.borderRadius,a=r.customBackgroundColor,l=r.customGradient,i=r.customTextColor,u=r.endpoint,s=r.gradient,p=r.refcode,b=r.text,f=r.textColor,d=r.title,m=r.token,v=Object(w.getColorClassName)("color",f),h=!l&&Object(w.getColorClassName)("background-color",o),y=Object(w.__experimentalGetGradientClass)(s),g=N()("wp-block-button__link",(t={"has-text-color":f||i},z()(t,v,v),z()(t,"has-background",o||a||l||s),z()(t,h,h),z()(t,"no-border-radius",0===c),z()(t,y,y),t)),O={background:l||void 0,backgroundColor:h||l||s?void 0:a,color:v?void 0:i,borderRadius:c?c+"px":void 0};return Object(j.createElement)("div",{className:"wp-block-button"},Object(j.createElement)(w.RichText.Content,{tagName:"a",className:"".concat(g," js-actblue-donation-button"),href:u,title:d,style:O,value:b,target:"_blank","data-token":m,"data-refcode":p,"data-amount":n,rel:"noopener noreferrer"}))},ve="actblue/button",he={name:ve,icon:J,title:"ActBlue Button",description:"Add a button for an ActBlue contribution.",category:"layout",keywords:[Object(l.__)("link")],example:{attributes:{className:"is-style-fill",backgroundColor:"vivid-green-cyan",text:Object(l.__)("Call to Action")}},supports:{align:!1,alignWide:!1},styles:[{name:"fill",label:Object(l.__)("Fill"),isDefault:!0},{name:"outline",label:Object(l.__)("Outline")}],parent:["actblue/buttons"],attributes:{title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},placeholder:{type:"string"},borderRadius:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"},token:{type:"string"},endpoint:{type:"string"},refcode:{type:"string"},amount:{type:"number"}},edit:de,save:me};[n,o,c].forEach((function(e){var t=e.name,r=e.settings;Object(a.registerBlockType)(t,r)}))}]);
  • actblue-contributions/trunk/readme.txt

    r2455824 r2493370  
    44Tags: donate,donation,fundraising,giving,charity,nonprofit,contribute,contributions
    55Requires at least: 4.5
    6 Tested up to: 5.6
     6Tested up to: 5.7
    77Requires PHP: 5.6
    8 Stable tag: 1.4.0
     8Stable tag: 1.4.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    102102== Changelog ==
    103103
     104= 1.4.1 =
     105* Compatibility with WordPress 5.7
     106
    104107= 1.4.0 =
    105108* ActBlue buttons can pre-select an amount in the form modal that opens
Note: See TracChangeset for help on using the changeset viewer.