File "unsubscribe-block.min.js"
Full Path: /home/londdqdw/public_html/06/wp-content/plugins/wordpress-popup/inc/providers/gutenberg/js/unsubscribe-block.min.js
File size: 6.69 KB
MIME-type: text/plain
Charset: utf-8
!function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function o(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?s(e):n}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a=wp.blocks,u=a.registerBlockType,l=a.createBlock,c=wp.element,p=c.createElement,b=c.Component,d=c.RawHTML,f=wp.shortcode,h=f.string,m=f.next,k=p("svg",{class:"dashicon",viewBox:"0 0 24 24",width:24,height:24,xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",role:"img"},p("path",{d:"M3.5 8.69063V8C3.5 7.725 3.72375 7.5 4 7.5H16C16.275 7.5 16.5 7.725 16.5 8V8.69063L15.7937 9.26875C16.3312 9.09375 16.8781 9 17.5 9C17.6687 9 17.8344 9.00625 18 9.02187V8C18 6.89531 17.1031 6 16 6H4C2.89531 6 2 6.89531 2 8V16C2 17.1031 2.89531 18 4 18H13.2562C12.8875 17.5531 12.5875 17.0469 12.3469 16.5H4C3.72375 16.5 3.5 16.275 3.5 16V10.6312L7.90937 14.275C9.11562 15.2437 10.8062 15.2594 12.0031 14.325C12.0312 13.4125 12.2812 12.5563 12.7 11.8094L11.1094 13.1156C10.4656 13.6469 9.53437 13.6469 8.89062 13.1156L3.5 8.69063Z"}),p("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22 14.45C22 16.9629 19.9853 19 17.5 19C15.0147 19 13 16.9629 13 14.45C13 11.9371 15.0147 9.9 17.5 9.9C19.9853 9.9 22 11.9371 22 14.45ZM18.6276 12.2782C18.9066 11.9962 19.3588 11.9962 19.6378 12.2782C19.9167 12.5602 19.9167 13.0175 19.6378 13.2996L18.5101 14.4397L19.6479 15.5902C19.9269 15.8722 19.9269 16.3295 19.6479 16.6115C19.369 16.8936 18.9167 16.8936 18.6378 16.6115L17.5 15.4611L16.3622 16.6115C16.0833 16.8936 15.631 16.8936 15.3521 16.6115C15.0731 16.3295 15.0731 15.8722 15.3521 15.5902L16.4898 14.4397L15.3622 13.2996C15.0833 13.0175 15.0833 12.5602 15.3622 12.2782C15.6412 11.9962 16.0934 11.9962 16.3724 12.2782L17.5 13.4184L18.6276 12.2782Z"})),y=function(t){function a(){var t;return e(this,a),(t=o(this,i(a).apply(this,arguments))).update_id=t.update_id.bind(s(s(t))),t.update_skip=t.update_skip.bind(s(s(t))),t.state={loading:!1,markup:""},t}var u,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}(a,t),u=a,(l=[{key:"update_id",value:function(t){this.props.setAttributes({id:t})}},{key:"update_skip",value:function(t){this.props.setAttributes({skipConfirmation:t})}},{key:"preview",value:function(t){var e=this,n=t.id,o=t.skipConfirmation;if(!this.state.loading){this.setState({loading:!0});var i=ajaxurl+"?action=hustle_render_unsubscribe_form&_wpnonce="+hustle_unsubscribe_data.nonce;n&&(i+="&module_ids="+n),o&&(i+="&skip_confirmation="+o),window.fetch(i).then((function(t){return t.json()})).then((function(t){if(t.success){var i=t.data;e.setState({markup:i,loading:!1}),e.update_id(n),e.update_skip(o)}})).catch((function(t){console.log(t)}))}}},{key:"componentDidUpdate",value:function(t){var e=this.props.attributes,n=e.id,o=e.skipConfirmation;t.attributes.id===n&&t.attributes.skipConfirmation===o||this.preview(e)}},{key:"componentDidMount",value:function(){var t=this.props.attributes;this.preview(t)}},{key:"open_settings",value:function(){window.open(hustle_unsubscribe_data.settings_url)}},{key:"render",value:function(){var t=this,e=this.state,n=e.loading,o=e.markup,i=this.props,r=i.attributes,s=i.isSelected,a=r.id,u=r.skipConfirmation,l=hustle_unsubscribe_data.popups,c=hustle_unsubscribe_data.slideins,b=hustle_unsubscribe_data.embeds,f=function(){return React.createElement(React.Fragment,null,React.createElement("optgroup",{label:hustle_unsubscribe_data.l10n.popups},_.map(l,(function(t,e){return React.createElement("option",{value:t.value,key:t.value},t.label)}))),React.createElement("optgroup",{label:hustle_unsubscribe_data.l10n.slideins},_.map(c,(function(t,e){return React.createElement("option",{value:t.value,key:t.value},t.label)}))),React.createElement("optgroup",{label:hustle_unsubscribe_data.l10n.embeds},_.map(b,(function(t,e){return React.createElement("option",{value:t.value,key:t.value},t.label)}))))},h=[s&&p(wp.blockEditor.InspectorControls,{key:"inspector"},p(wp.components.PanelBody,{title:hustle_unsubscribe_data.l10n.modules,initialOpen:!0},p(wp.components.PanelRow,null,p(wp.components.SelectControl,{help:hustle_unsubscribe_data.l10n.block_instruction,value:a,children:React.createElement(f,null),multiple:!0,className:"hustle-unsubscribe-block-settings",onChange:this.update_id})),p(wp.components.PanelRow,null,p(wp.components.CheckboxControl,{label:hustle_unsubscribe_data.l10n.skip_confirmation,checked:u,onChange:this.update_skip})))),p(wp.blockEditor.BlockControls,null,p(wp.components.ToolbarGroup,null,p(wp.components.ToolbarButton,{className:"components-toolbar__control",label:hustle_unsubscribe_data.l10n.customize_settings,icon:"edit",onClick:function(e){return t.open_settings()}})))];return n?[h,p("div",{key:"loading",className:"wp-block-embed is-loading"},p(wp.components.Spinner,null),p("span",null,hustle_unsubscribe_data.l10n.rendering))]:[h,p(d,null,o)]}}])&&n(u.prototype,l),a}(b);u("hustle/unsubscribe",{title:hustle_unsubscribe_data.l10n.block_name,description:hustle_unsubscribe_data.l10n.block_description,icon:k,category:"hustle",keywords:["Hustle",hustle_unsubscribe_data.l10n.block_name],attributes:{id:{type:"array"},skipConfirmation:{type:"bool"}},supports:{customClassName:!1,className:!1,html:!1},transforms:{to:[{type:"block",blocks:["core/shortcode"],transform:function(t){var e=t.id,n=t.skipConfirmation,o={};e&&JSON.stringify([])!==JSON.stringify(e)&&(o.id=e),n&&(o.skip_confirmation=n);var i={tag:hustle_unsubscribe_data.shortcode_tag,attrs:o,type:"single"},r=h(i);return l("core/shortcode",{text:r})}}],from:[{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text;return void 0!==m(hustle_unsubscribe_data.shortcode_tag,e)},transform:function(t){var e=t.text,n=m(hustle_unsubscribe_data.shortcode_tag,e).shortcode.attrs.named,o=n.id,i=n.skip_confirmation;return o=o?o.replace(/\s/g,"").split(","):"",l("hustle/unsubscribe",{id:o,skipConfirmation:"true"===i})}}]},edit:y,save:function(){return null}})}();