Version Description
Download this release
Release Info
Developer | sdixon194 |
Plugin | Jetpack by WordPress.com |
Version | 9.9.1 |
Comparing to | |
See all releases |
Code changes from version 9.9 to 9.9.1
- CHANGELOG.md +22 -0
- _inc/blocks/editor-beta.asset.php +1 -1
- _inc/blocks/editor-beta.js +1 -1
CHANGELOG.md
CHANGED
@@ -2,6 +2,28 @@
|
|
2 |
|
3 |
### This is a list detailing changes for all Jetpack releases.
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
## 9.9 - 2021-07-06
|
6 |
### Major Enhancements
|
7 |
- Carousel: improve carousel usability, performance, accessibility, mobile friendliness.
|
2 |
|
3 |
### This is a list detailing changes for all Jetpack releases.
|
4 |
|
5 |
+
## 9.9.1 - 2021-07-20
|
6 |
+
### Enhancements
|
7 |
+
- Carousel: improve carousel icons.
|
8 |
+
|
9 |
+
### Improved compatibility
|
10 |
+
- Carousel: ensure that arrows look and work correctly in right-to-left languages.
|
11 |
+
|
12 |
+
### Bug fixes
|
13 |
+
- Carousel: prevent comments indicator from bumping icon width of comments button.
|
14 |
+
- Carousel: CSS tweaks to ensure text and comment loader spinners dislay correctly in dark and light theme views.
|
15 |
+
- Carousel: ensures caption is shown in carousel images.
|
16 |
+
- Carousel: ensure carousel CSS doesn't override other non-Jetpack carousel styling.
|
17 |
+
- Widgets: allow the use of widget visibility conditions in gutenberg based widget editing.
|
18 |
+
- Widgets: ensure block previews display in customizer for multiple blocks.
|
19 |
+
|
20 |
+
### Other changes <!-- Non-user-facing changes go here. This section will not be copied to readme.txt. -->
|
21 |
+
- Updated package dependencies.
|
22 |
+
- Compatibility: adds support for block_editor_settings_all when running WordPress 5.8 or higher.
|
23 |
+
- WordPress.com Block Editor: do not use in the upcoming Block-based Widgets Editor
|
24 |
+
- Nav Unification: stores the preferred view after a page switch using the new WP.com quick switcher
|
25 |
+
- Symc: update Sync tests to include case for jetpack_sync_settings options.
|
26 |
+
|
27 |
## 9.9 - 2021-07-06
|
28 |
### Major Enhancements
|
29 |
- Carousel: improve carousel usability, performance, accessibility, mobile friendliness.
|
_inc/blocks/editor-beta.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => 'c48a18ccefc709178a645a0d940f24f9');
|
_inc/blocks/editor-beta.js
CHANGED
@@ -28,4 +28,4 @@
|
|
28 |
object-assign
|
29 |
(c) Sindre Sorhus
|
30 |
@license MIT
|
31 |
-
*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,t){for(var n,i,l=c(e),s=1;s<arguments.length;s++){for(var u in n=Object(arguments[s]))a.call(n,u)&&(l[u]=n[u]);if(r){i=r(n);for(var p=0;p<i.length;p++)o.call(n,i[p])&&(l[i[p]]=n[i[p]])}}return l}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(10),a=n(5),o=n.n(a),c=n(4),i=n.n(c),l=n(32),s={sources:{},default:null},u={getDefaultMediaSource:function(e){var t=null,n=Object.keys(e.sources);if(e.default?t=e.default:null!=n&&n.length&&(t=e.sources[n[0]].id),t)return e.sources[t]},getMediaPlayerState:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.state},getMediaSourceCurrentTime:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.currentTime},getMediaSourceDuration:function(e,t){var n,r;if(!t){var a=u.getDefaultMediaSource(e);return null==a?void 0:a.duration}return null===(n=e.sources)||void 0===n||null===(r=n[t])||void 0===r?void 0:r.duration},getMediaSourceDomReference:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);if(r){var a=null==r?void 0:r.domId;if(a)return document.getElementById(a)}}},p={reducer:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,n=arguments.length>1?arguments[1]:void 0,r=n.id||t.default||(null===(e=Object.keys(t.sources))||void 0===e?void 0:e[0]);switch(n.type){case"REGISTER_MEDIA_SOURCE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()({id:n.id},n.mediaSourceState)))});case"UPDATE_MEDIA_SOURCE_DATA":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()(i()({},t.sources[n.id]),n.data)))});case"UNREGISTER_MEDIA_SOURCE":var a,c=Object.assign({},t);if(c.sources[n.id]&&delete c.sources[n.id],n.id===t.default)c.default=null===(a=Object.keys(t.sources))||void 0===a?void 0:a[0];return c;case"SET_DEFAULT_MEDIA_SOURCE":return i()(i()({},t),{},{default:n.id});case"SET_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:n.state})))});case"TOGGLE_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:t.sources[r].state===l.c?l.b:l.c})))});case"SET_MEDIA_PLAYER_CURRENT_TIME":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{currentTime:n.currentTime})))})}return t},actions:{registerMediaSource:function(e,t){return{type:"REGISTER_MEDIA_SOURCE",id:e,mediaSourceState:t}},updateMediaSourceData:function(e,t){return{type:"UPDATE_MEDIA_SOURCE_DATA",id:e,data:t}},unregisterMediaSource:function(e){return{type:"UNREGISTER_MEDIA_SOURCE",id:e}},setDefaultMediaSource:function(e){return{type:"SET_DEFAULT_MEDIA_SOURCE",id:e}},playMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.c}},toggleMediaSource:function(e){return{type:"TOGGLE_MEDIA_PLAYER_STATE",id:e}},pauseMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.b}},errorMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.a}},setMediaSourceCurrentTime:function(e,t){return{type:"SET_MEDIA_PLAYER_CURRENT_TIME",id:e,currentTime:t}}},selectors:u};if(void 0!==r.createReduxStore){var d=Object(r.createReduxStore)(l.d,p);Object(r.register)(d)}else Object(r.registerStore)(l.d,p)},function(e,t,n){"use strict";var r=n(0);t.a=Object(r.createContext)()},function(e,t,n){},function(e,t){e.exports=window.wp.annotations},function(e,t,n){},function(e,t,n){e.exports=n.p+"images/img-example-after-2cb9a8483c19dddf7fc5655e346718db.png"},function(e,t,n){e.exports=n.p+"images/img-example-before-b9e7b3c4f30c1a6a8fbf99b820b9d8b8.png"},function(e,t,n){e.exports=n.p+"images/upgrade-illustration-4f15d75a961111384b907965c2e4e168.svg"},function(e,t,n){e.exports=n.p+"images/story_example-1-bc142dfce3ff04bbf445a692f1c8b0ca.png"},function(e,t,n){},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(254),t.encode=t.stringify=n(255)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var c=/\+/g;e=e.split(t);var i=1e3;a&&"number"==typeof a.maxKeys&&(i=a.maxKeys);var l=e.length;i>0&&l>i&&(l=i);for(var s=0;s<l;++s){var u,p,d,m,b=e[s].replace(c,"%20"),h=b.indexOf(n);h>=0?(u=b.substr(0,h),p=b.substr(h+1)):(u=b,p=""),d=decodeURIComponent(u),m=decodeURIComponent(p),r(o,d)?Array.isArray(o[d])?o[d].push(m):o[d]=[o[d],m]:o[d]=m}return o}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(a){var o=encodeURIComponent(r(a))+n;return Array.isArray(e[a])?e[a].map((function(e){return o+encodeURIComponent(r(e))})).join(t):o+encodeURIComponent(r(e[a]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))}},function(e,t,n){"use strict";var r="%[a-f0-9]{2}",a=new RegExp(r,"gi"),o=new RegExp("("+r+")+","gi");function c(e,t){try{return decodeURIComponent(e.join(""))}catch(a){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],c(n),c(r))}function i(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(a),n=1;n<t.length;n++)t=(e=c(t,n).join("")).match(a);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch(t){var a=i(r[0]);a!==r[0]&&(n[r[0]]=a)}r=o.exec(e)}n["%C2"]="�";for(var c=Object.keys(n),l=0;l<c.length;l++){var s=c[l];e=e.replace(new RegExp(s,"g"),n[s])}return e}(e)}}},function(e,t,n){"use strict";e.exports=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];var n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),a=Array.isArray(t),o=0;o<r.length;o++){var c=r[o],i=e[c];(a?-1!==t.indexOf(c):t(c,i,e))&&(n[c]=i)}return n}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},function(e,t,n){const r=n(44);e.exports=(e,t,n,a)=>{"string"==typeof n&&(a=n,n=void 0);try{return new r(e,n).inc(t,a).version}catch(o){return null}}},function(e,t,n){const r=n(86),a=n(127);e.exports=(e,t)=>{if(a(e,t))return null;{const n=r(e),a=r(t),o=n.prerelease.length||a.prerelease.length,c=o?"pre":"",i=o?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==a[e])return c+e;return i}}},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).major},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).minor},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).patch},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},function(e,t,n){const r=n(55);e.exports=(e,t,n)=>r(t,e,n)},function(e,t,n){const r=n(55);e.exports=(e,t)=>r(e,t,!0)},function(e,t,n){const r=n(128);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},function(e,t,n){const r=n(128);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},function(e,t,n){const r=n(44),a=n(86),{re:o,t:c}=n(85);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[c.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[c.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[c.COERCERTL].lastIndex=-1}else n=e.match(o[c.COERCE]);return null===n?null:a(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},function(e,t,n){"use strict";const r=n(285),a=Symbol("max"),o=Symbol("length"),c=Symbol("lengthCalculator"),i=Symbol("allowStale"),l=Symbol("maxAge"),s=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),d=Symbol("cache"),m=Symbol("updateAgeOnGet"),b=()=>1;const h=(e,t,n)=>{const r=e[d].get(t);if(r){const t=r.value;if(f(e,t)){if(j(e,r),!e[i])return}else n&&(e[m]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},g=e=>{if(e[o]>e[a])for(let t=e[p].tail;e[o]>e[a]&&null!==t;){const n=t.prev;j(e,t),t=n}},j=(e,t)=>{if(t){const n=t.value;e[s]&&e[s](n.key,n.value),e[o]-=n.length,e[d].delete(n.key),e[p].removeNode(t)}};class v{constructor(e,t,n,r,a){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=a||0}}const O=(e,t,n,r)=>{let a=n.value;f(e,a)&&(j(e,n),e[i]||(a=void 0)),a&&t.call(r,a.value,a.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;const t=e.length||b;if(this[c]="function"!=typeof t?b:t,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[s]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[m]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,g(this)}get max(){return this[a]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=b),e!==this[c]&&(this[c]=e,this[o]=0,this[p].forEach((e=>{e.length=this[c](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[c]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let n=this[p].tail;null!==n;){const r=n.prev;O(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[p].head;null!==n;){const r=n.next;O(this,e,n,t),n=r}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[s]&&this[p]&&this[p].length&&this[p].forEach((e=>this[s](e.key,e.value))),this[d]=new Map,this[p]=new r,this[o]=0}dump(){return this[p].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[c](t,e);if(this[d].has(e)){if(i>this[a])return j(this,this[d].get(e)),!1;const c=this[d].get(e).value;return this[s]&&(this[u]||this[s](e,c.value)),c.now=r,c.maxAge=n,c.value=t,this[o]+=i-c.length,c.length=i,this.get(e),g(this),!0}const m=new v(e,t,i,r,n);return m.length>this[a]?(this[s]&&this[s](e,t),!1):(this[o]+=m.length,this[p].unshift(m),this[d].set(e,this[p].head),g(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!f(this,t)}get(e){return h(this,e,!0)}peek(e){return h(this,e,!1)}pop(){const e=this[p].tail;return e?(j(this,e),e.value):null}del(e){j(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{const e=a-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[d].forEach(((e,t)=>h(this,t,!1)))}}},function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,a=arguments.length;n<a;n++)t.push(arguments[n]);return t}function a(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function c(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=i,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)c(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,a=this.head;null!==a;)n.push(e.call(t,a.value,this)),a=a.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,a=this.tail;null!==a;)n.push(e.call(t,a.value,this)),a=a.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=e(n,r.value,a),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=e(n,r.value,a),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=0,o=this.head;null!==o&&a<e;a++)o=o.next;for(;null!==o&&a<t;a++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=this.length,o=this.tail;null!==o&&a>t;a--)o=o.prev;for(;null!==o&&a>e;a--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r<e;r++)o=o.next;var c=[];for(r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(r=0;r<n.length;r++)o=a(this,o,n[r]);return c},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(286)(r)}catch(l){}},function(e,t,n){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},function(e,t,n){const r=n(56);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},function(e,t,n){const r=n(44),a=n(56);e.exports=(e,t,n)=>{let o=null,c=null,i=null;try{i=new a(t,n)}catch(l){return null}return e.forEach((e=>{i.test(e)&&(o&&-1!==c.compare(e)||(o=e,c=new r(o,n)))})),o}},function(e,t,n){const r=n(44),a=n(56);e.exports=(e,t,n)=>{let o=null,c=null,i=null;try{i=new a(t,n)}catch(l){return null}return e.forEach((e=>{i.test(e)&&(o&&1!==c.compare(e)||(o=e,c=new r(o,n)))})),o}},function(e,t,n){const r=n(44),a=n(56),o=n(102);e.exports=(e,t)=>{e=new a(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let a=0;a<e.set.length;++a){const t=e.set[a];let c=null;t.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":c&&!o(t,c)||(c=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!c||n&&!o(n,c)||(n=c)}return n&&e.test(n)?n:null}},function(e,t,n){const r=n(56);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(n){return null}}},function(e,t,n){const r=n(132);e.exports=(e,t,n)=>r(e,t,">",n)},function(e,t,n){const r=n(132);e.exports=(e,t,n)=>r(e,t,"<",n)},function(e,t,n){const r=n(56);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},function(e,t,n){const r=n(104),a=n(55);e.exports=(e,t,n)=>{const o=[];let c=null,i=null;const l=e.sort(((e,t)=>a(e,t,n)));for(const a of l){r(a,t,n)?(i=a,c||(c=a)):(i&&o.push([c,i]),i=null,c=null)}c&&o.push([c,null]);const s=[];for(const[r,a]of o)r===a?s.push(r):a||r!==l[0]?a?r===l[0]?s.push(`<=${a}`):s.push(`${r} - ${a}`):s.push(`>=${r}`):s.push("*");const u=s.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},function(e,t,n){const r=n(56),a=n(103),{ANY:o}=a,c=n(104),i=n(55),l=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?[new a(">=0.0.0-0")]:[new a(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=[new a(">=0.0.0")]}const r=new Set;let l,p,d,m,b,h,f;for(const a of e)">"===a.operator||">="===a.operator?l=s(l,a,n):"<"===a.operator||"<="===a.operator?p=u(p,a,n):r.add(a.semver);if(r.size>1)return null;if(l&&p){if(d=i(l.semver,p.semver,n),d>0)return null;if(0===d&&(">="!==l.operator||"<="!==p.operator))return null}for(const a of r){if(l&&!c(a,String(l),n))return null;if(p&&!c(a,String(p),n))return null;for(const e of t)if(!c(a,String(e),n))return!1;return!0}let g=!(!p||n.includePrerelease||!p.semver.prerelease.length)&&p.semver,j=!(!l||n.includePrerelease||!l.semver.prerelease.length)&&l.semver;g&&1===g.prerelease.length&&"<"===p.operator&&0===g.prerelease[0]&&(g=!1);for(const a of t){if(f=f||">"===a.operator||">="===a.operator,h=h||"<"===a.operator||"<="===a.operator,l)if(j&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===j.major&&a.semver.minor===j.minor&&a.semver.patch===j.patch&&(j=!1),">"===a.operator||">="===a.operator){if(m=s(l,a,n),m===a&&m!==l)return!1}else if(">="===l.operator&&!c(l.semver,String(a),n))return!1;if(p)if(g&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===g.major&&a.semver.minor===g.minor&&a.semver.patch===g.patch&&(g=!1),"<"===a.operator||"<="===a.operator){if(b=u(p,a,n),b===a&&b!==p)return!1}else if("<="===p.operator&&!c(p.semver,String(a),n))return!1;if(!a.operator&&(p||l)&&0!==d)return!1}return!(l&&h&&!p&&0!==d)&&(!(p&&f&&!l&&0!==d)&&(!j&&!g))},s=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let a=!1;e:for(const r of e.set){for(const e of t.set){const t=l(r,e,n);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(57),a=n.n(r);n(305);a()((function(){var e={sliders:[],OPTIMIZATION_ACCEPTED:1,OPTIMIZATION_WAS_CONSTRAINED:2};function t(e,t){var n=this;this.image=new Image,this.loaded=!1,this.image.onload=function(){n.loaded=!0,t._onLoaded()},this.image.src=e.src,this.image.alt=e.alt||"",this.label=e.label||!1}function n(e,t){e&&e.classList.add(t)}function r(e,t){e&&e.classList.remove(t)}function a(e){return{width:parseInt(window.getComputedStyle(e).width,10),height:parseInt(window.getComputedStyle(e).height,10)}}function o(e,t){var n,r;if("string"==typeof t||"number"==typeof t)n=parseInt(t,10);else{var a=e.getBoundingClientRect(),o={top:a.top+document.body.scrollTop+document.documentElement.scrollTop,left:a.left+document.body.scrollLeft+document.documentElement.scrollLeft},c=e.offsetWidth;n=(((r=t).pageX?r.pageX:r.touches?r.touches[0].pageX:r.clientX+document.body.scrollLeft+document.documentElement.scrollLeft)-o.left)/c*100}return n}function c(e,t,n){var r,a;if("string"==typeof t||"number"==typeof t)r=parseInt(t,10);else{var o=e.getBoundingClientRect(),c={top:o.top+n.body.scrollTop+n.documentElement.scrollTop,left:o.left+n.body.scrollLeft+n.documentElement.scrollLeft},i=e.offsetHeight;r=(((a=t).pageY?a.pageY:a.touches?a.touches[0].pageY:a.clientY+document.body.scrollTop+document.documentElement.scrollTop)-c.top)/i*100}return r}var i={animate:!0,showLabels:!0,makeResponsive:!0};function l(e,n,r){var a,o;for(a in this.element=e,this.options={animate:!0,showLabels:!0,makeResponsive:!0,startingPosition:"50%",mode:"horizontal",callback:null},this.options)a in r&&(this.options[a]=a in i?"string"!=typeof(o=r[a])?Boolean(o):!("false"===o||""===o):r[a]);2===n.length&&(this.imgBefore=new t(n[0],this),this.imgAfter=new t(n[1],this))}l.prototype={updateSlider:function(e,t){var a;a=(a="vertical"===this.options.mode?c(this.slider,e,this.sliderParentDocument):o(this.slider,e)).toFixed(2)+"%";var i=parseFloat(a),l=100-i+"%";i>0&&i<100&&(r(this.handle,"transition"),r(this.rightImage,"transition"),r(this.leftImage,"transition"),this.options.animate&&t&&(n(this.handle,"transition"),n(this.leftImage,"transition"),n(this.rightImage,"transition")),"vertical"===this.options.mode?(this.handle.style.top=a,this.leftImage.style.height=a,this.rightImage.style.height=l):(this.handle.style.left=a,this.leftImage.style.width=a,this.rightImage.style.width=l),this.sliderPosition=a)},getPosition:function(){return this.sliderPosition},displayLabel:function(e,t){var n=document.createElement("div");n.className="jx-label",n.setAttribute("tabindex",0),function(e,t){document.body.textContent?e.textContent=t:e.innerText=t}(n,t),e.appendChild(n)},setStartingPosition:function(e){this.options.startingPosition=e},calculateDims:function(e,t){var n,r=(n=this.imgBefore.image,{width:n.naturalWidth,height:n.naturalHeight,aspect:function(){return this.width/this.height}}).aspect();return e?t=e/r:t&&(e=t*r),{width:e,height:t,ratio:r}},responsivizeIframe:function(e){return e.height<window.innerHeight?e.ratio>=1&&(this.wrapper.style.paddingTop=parseInt((window.innerHeight-e.height)/2)+"px"):e.height>window.innerHeight&&(e=this.calculateDims(0,window.innerHeight),this.wrapper.style.paddingLeft=parseInt((window.innerWidth-e.width)/2)+"px"),e},setWrapperDimensions:function(){var e=a(this.wrapper.parentNode).width,t=a(this.wrapper.parentNode).height,n=this.calculateDims(e,t);window.location===window.parent.location||this.options.makeResponsive||(n=this.responsivizeIframe(n)),this.wrapper.style.height=parseInt(n.height)+"px",this.wrapper.style.width=parseInt(n.width)+"px"},optimizeWrapper:function(t){var n=e.OPTIMIZATION_ACCEPTED;return this.imgBefore.image.naturalWidth>=t&&this.imgAfter.image.naturalWidth>=t?(this.wrapper.style.width=t+"px",n=e.OPTIMIZATION_WAS_CONSTRAINED):this.imgAfter.image.naturalWidth<t?this.wrapper.style.width=this.imgAfter.image.naturalWidth+"px":this.wrapper.style.width=this.imgBefore.image.naturalWidth+"px",this.setWrapperDimensions(),n},_onLoaded:function(){if(this.imgBefore&&!0===this.imgBefore.loaded&&this.imgAfter&&!0===this.imgAfter.loaded){var e;if(this.wrapper=this.element,!this.wrapper||this.wrapper.querySelector(".jx-slider"))return;n(this.wrapper,"juxtapose"),this.wrapper.style.width=this.imgBefore.image.naturalWidth,this.setWrapperDimensions(),this.slider=document.createElement("div"),this.slider.className="jx-slider",this.wrapper.appendChild(this.slider),this.sliderParentDocument=this.wrapper.ownerDocument,"horizontal"!==this.options.mode&&n(this.slider,this.options.mode),this.handle=document.createElement("div"),this.handle.className="jx-handle",this.rightImage=document.createElement("div"),this.rightImage.className="jx-image jx-right",this.rightImage.appendChild(this.imgAfter.image),this.leftImage=document.createElement("div"),this.leftImage.className="jx-image jx-left",this.leftImage.appendChild(this.imgBefore.image),this.slider.appendChild(this.handle),this.slider.appendChild(this.leftImage),this.slider.appendChild(this.rightImage),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.control=document.createElement("div"),this.controller=document.createElement("div"),this.leftArrow.className="jx-arrow jx-left",this.rightArrow.className="jx-arrow jx-right",this.control.className="jx-control",this.controller.className="jx-controller",this.controller.setAttribute("tabindex",0),this.controller.setAttribute("role","slider"),this.controller.setAttribute("aria-valuenow",50),this.controller.setAttribute("aria-valuemin",0),this.controller.setAttribute("aria-valuemax",100),this.controller.setAttribute("aria-label",(null===(e=window.imageCompareHandle)||void 0===e?void 0:e.msg)||"Slide to compare images"),this.handle.appendChild(this.leftArrow),this.handle.appendChild(this.control),this.handle.appendChild(this.rightArrow),this.control.appendChild(this.controller),this._init()}},_init:function(){this.updateSlider(this.options.startingPosition,!1),!0===this.options.showLabels&&(this.imgBefore.label&&this.displayLabel(this.leftImage,this.imgBefore.label),this.imgAfter.label&&this.displayLabel(this.rightImage,this.imgAfter.label));var t=this;window.addEventListener("resize",(function(){t.setWrapperDimensions()})),this.slider.addEventListener("mousedown",(function(e){e.preventDefault(),t.updateSlider(e,!0);var n=!0;this.addEventListener("mousemove",(function(e){e.preventDefault(),n&&t.updateSlider(e,!1)})),this.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation(),n=!1}))})),this.slider.addEventListener("touchstart",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!0),this.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!1)}))})),this.handle.addEventListener("keydown",(function(e){var n=e.which||e.keyCode,r=parseFloat(this.style.left);if(37===n){r-=1;var a=parseFloat(this.style.left)-1;t.updateSlider(a,!1),t.controller.setAttribute("aria-valuenow",r)}if(39===n){r+=1;var o=parseFloat(this.style.left)+1;t.updateSlider(o,!1),t.controller.setAttribute("aria-valuenow",r)}})),this.leftImage.addEventListener("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("90%",!0),t.controller.setAttribute("aria-valuenow",91))})),this.rightImage.addEventListener("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("10%",!0),t.controller.setAttribute("aria-valuenow",10))})),e.sliders.push(this),this.options.callback&&"function"==typeof this.options.callback&&this.options.callback(this)}},e.makeSlider=function(t,r){void 0===r&&(r=e.sliders.length);var a=t,o=a.querySelectorAll("img");if(!(o.length<2)){var c={};return a.getAttribute("data-animate")&&(c.animate=a.getAttribute("data-animate")),a.getAttribute("data-showlabels")&&(c.showLabels=a.getAttribute("data-showlabels")),a.getAttribute("data-startingposition")&&(c.startingPosition=a.getAttribute("data-startingposition")),a.getAttribute("data-mode")&&(c.mode=a.getAttribute("data-mode")),a.getAttribute("data-makeresponsive")&&(c.mode=a.getAttribute("data-makeresponsive")),n(t,"juxtapose-"+r),a.innerHTML?a.innerHTML="":a.innerText="",new e.JXSlider(t,[{src:o[0].src,label:o[0].getAttribute("data-label"),alt:o[0].alt},{src:o[1].src,label:o[1].getAttribute("data-label"),alt:o[1].alt}],c)}},e.scanPage=function(){for(var t=document.querySelectorAll(".juxtapose"),n=0;n<t.length;n++)e.makeSlider(t[n],n)},e.JXSlider=l,window.juxtapose=e,e.scanPage()}))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(30),a=n(320),o=n(324),c=n(325),i=n(333),l=n(347),s=n(360),u=n(174),p=n(166),d={default:n(362),zero:n(363),commonmark:n(364)},m=/^(vbscript|javascript|file|data):/,b=/^data:image\/(gif|png|jpeg|webp);/;function h(e){var t=e.trim().toLowerCase();return!m.test(t)||!!b.test(t)}var f=["http:","https:","mailto:"];function g(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toASCII(t.hostname)}catch(n){}return u.encode(u.format(t))}function j(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toUnicode(t.hostname)}catch(n){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function v(e,t){if(!(this instanceof v))return new v(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new l,this.block=new i,this.core=new c,this.renderer=new o,this.linkify=new s,this.validateLink=h,this.normalizeLink=g,this.normalizeLinkText=j,this.utils=r,this.helpers=r.assign({},a),this.options={},this.configure(e),t&&this.set(t)}v.prototype.set=function(e){return r.assign(this.options,e),this},v.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=d[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},v.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},v.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},v.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},v.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},v.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},v.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},v.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=v},function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')},function(e,t,n){"use strict";var r={};function a(e,t,n){var o,c,i,l,s,u="";for("string"!=typeof t&&(n=t,t=a.defaultChars),void 0===n&&(n=!0),s=function(e){var t,n,a=r[e];if(a)return a;for(a=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?a.push(n):a.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)a[e.charCodeAt(t)]=e[t];return a}(t),o=0,c=e.length;o<c;o++)if(i=e.charCodeAt(o),n&&37===i&&o+2<c&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))u+=e.slice(o,o+3),o+=2;else if(i<128)u+=s[i];else if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&o+1<c&&(l=e.charCodeAt(o+1))>=56320&&l<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}a.defaultChars=";/?:@&=+$,-_.!~*'()#",a.componentChars="-_.!~*'()",e.exports=a},function(e,t,n){"use strict";var r={};function a(e,t){var n;return"string"!=typeof t&&(t=a.defaultChars),n=function(e){var t,n,a=r[e];if(a)return a;for(a=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),a.push(n);for(t=0;t<e.length;t++)a[n=e.charCodeAt(t)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return a}(t),e.replace(/(%[a-f0-9]{2})+/gi,(function(e){var t,r,a,o,c,i,l,s="";for(t=0,r=e.length;t<r;t+=3)(a=parseInt(e.slice(t+1,t+3),16))<128?s+=n[a]:192==(224&a)&&t+3<r&&128==(192&(o=parseInt(e.slice(t+4,t+6),16)))?(s+=(l=a<<6&1984|63&o)<128?"��":String.fromCharCode(l),t+=3):224==(240&a)&&t+6<r&&(o=parseInt(e.slice(t+4,t+6),16),c=parseInt(e.slice(t+7,t+9),16),128==(192&o)&&128==(192&c))?(s+=(l=a<<12&61440|o<<6&4032|63&c)<2048||l>=55296&&l<=57343?"���":String.fromCharCode(l),t+=6):240==(248&a)&&t+9<r&&(o=parseInt(e.slice(t+4,t+6),16),c=parseInt(e.slice(t+7,t+9),16),i=parseInt(e.slice(t+10,t+12),16),128==(192&o)&&128==(192&c)&&128==(192&i))?((l=a<<18&1835008|o<<12&258048|c<<6&4032|63&i)<65536||l>1114111?s+="����":(l-=65536,s+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):s+="�";return s}))}a.defaultChars=";/?:@&=+$,#",a.componentChars="",e.exports=a},function(e,t,n){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(i),s=["%","/","?",";","#"].concat(l),u=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};r.prototype.parse=function(e,t){var n,r,o,i,l,h=e;if(h=h.trim(),!t&&1===e.split("#").length){var f=c.exec(h);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}var g=a.exec(h);if(g&&(o=(g=g[0]).toLowerCase(),this.protocol=g,h=h.substr(g.length)),(t||g||h.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(l="//"===h.substr(0,2))||g&&m[g]||(h=h.substr(2),this.slashes=!0)),!m[g]&&(l||g&&!b[g])){var j,v,O=-1;for(n=0;n<u.length;n++)-1!==(i=h.indexOf(u[n]))&&(-1===O||i<O)&&(O=i);for(-1!==(v=-1===O?h.lastIndexOf("@"):h.lastIndexOf("@",O))&&(j=h.slice(0,v),h=h.slice(v+1),this.auth=j),O=-1,n=0;n<s.length;n++)-1!==(i=h.indexOf(s[n]))&&(-1===O||i<O)&&(O=i);-1===O&&(O=h.length),":"===h[O-1]&&O--;var k=h.slice(0,O);h=h.slice(O),this.parseHost(k),this.hostname=this.hostname||"";var _="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!_){var y=this.hostname.split(/\./);for(n=0,r=y.length;n<r;n++){var E=y[n];if(E&&!E.match(p)){for(var w="",C=0,x=E.length;C<x;C++)E.charCodeAt(C)>127?w+="x":w+=E[C];if(!w.match(p)){var S=y.slice(0,n),N=y.slice(n+1),A=E.match(d);A&&(S.push(A[1]),N.unshift(A[2])),N.length&&(h=N.join(".")+h),this.hostname=S.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var T=h.indexOf("#");-1!==T&&(this.hash=h.substr(T),h=h.slice(0,T));var P=h.indexOf("?");return-1!==P&&(this.search=h.substr(P),h=h.slice(0,P)),h&&(this.pathname=h),b[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(e){var t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,t){if(e&&e instanceof r)return e;var n=new r;return n.parse(e,t),n}},function(e,t,n){"use strict";t.Any=n(175),t.Cc=n(176),t.Cf=n(319),t.P=n(133),t.Z=n(177)},function(e,t){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(e,t,n){"use strict";t.parseLinkLabel=n(321),t.parseLinkDestination=n(322),t.parseLinkTitle=n(323)},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o,c,i=-1,l=e.posMax,s=e.pos;for(e.pos=t+1,r=1;e.pos<l;){if(93===(o=e.src.charCodeAt(e.pos))&&0===--r){a=!0;break}if(c=e.pos,e.md.inline.skipToken(e),91===o)if(c===e.pos-1)r++;else if(n)return e.pos=s,-1}return a&&(i=e.pos),e.pos=s,i}},function(e,t,n){"use strict";var r=n(30).unescapeAll;e.exports=function(e,t,n){var a,o,c=t,i={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t<n;){if(10===(a=e.charCodeAt(t)))return i;if(60===a)return i;if(62===a)return i.pos=t+1,i.str=r(e.slice(c+1,t)),i.ok=!0,i;92===a&&t+1<n?t+=2:t++}return i}for(o=0;t<n&&32!==(a=e.charCodeAt(t))&&!(a<32||127===a);)if(92===a&&t+1<n){if(32===e.charCodeAt(t+1))break;t+=2}else{if(40===a&&++o>32)return i;if(41===a){if(0===o)break;o--}t++}return c===t||0!==o||(i.str=r(e.slice(c,t)),i.lines=0,i.pos=t,i.ok=!0),i}},function(e,t,n){"use strict";var r=n(30).unescapeAll;e.exports=function(e,t,n){var a,o,c=0,i=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=n)return l;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return l;for(t++,40===o&&(o=41);t<n;){if((a=e.charCodeAt(t))===o)return l.pos=t+1,l.lines=c,l.str=r(e.slice(i+1,t)),l.ok=!0,l;if(40===a&&41===o)return l;10===a?c++:92===a&&t+1<n&&(t++,10===e.charCodeAt(t)&&c++),t++}return l}},function(e,t,n){"use strict";var r=n(30).assign,a=n(30).unescapeAll,o=n(30).escapeHtml,c={};function i(){this.rules=r({},c)}c.code_inline=function(e,t,n,r,a){var c=e[t];return"<code"+a.renderAttrs(c)+">"+o(e[t].content)+"</code>"},c.code_block=function(e,t,n,r,a){var c=e[t];return"<pre"+a.renderAttrs(c)+"><code>"+o(e[t].content)+"</code></pre>\n"},c.fence=function(e,t,n,r,c){var i,l,s,u,p,d=e[t],m=d.info?a(d.info).trim():"",b="",h="";return m&&(b=(s=m.split(/(\s+)/g))[0],h=s.slice(2).join("")),0===(i=n.highlight&&n.highlight(d.content,b,h)||o(d.content)).indexOf("<pre")?i+"\n":m?(l=d.attrIndex("class"),u=d.attrs?d.attrs.slice():[],l<0?u.push(["class",n.langPrefix+b]):(u[l]=u[l].slice(),u[l][1]+=" "+n.langPrefix+b),p={attrs:u},"<pre><code"+c.renderAttrs(p)+">"+i+"</code></pre>\n"):"<pre><code"+c.renderAttrs(d)+">"+i+"</code></pre>\n"},c.image=function(e,t,n,r,a){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=a.renderInlineAsText(o.children,n,r),a.renderToken(e,t,n)},c.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},c.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},c.text=function(e,t){return o(e[t].content)},c.html_block=function(e,t){return e[t].content},c.html_inline=function(e,t){return e[t].content},i.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+o(e.attrs[t][0])+'="'+o(e.attrs[t][1])+'"';return r},i.prototype.renderToken=function(e,t,n){var r,a="",o=!1,c=e[t];return c.hidden?"":(c.block&&-1!==c.nesting&&t&&e[t-1].hidden&&(a+="\n"),a+=(-1===c.nesting?"</":"<")+c.tag,a+=this.renderAttrs(c),0===c.nesting&&n.xhtmlOut&&(a+=" /"),c.block&&(o=!0,1===c.nesting&&t+1<e.length&&("inline"===(r=e[t+1]).type||r.hidden||-1===r.nesting&&r.tag===c.tag)&&(o=!1)),a+=o?">\n":">")},i.prototype.renderInline=function(e,t,n){for(var r,a="",o=this.rules,c=0,i=e.length;c<i;c++)void 0!==o[r=e[c].type]?a+=o[r](e,c,t,n,this):a+=this.renderToken(e,c,t);return a},i.prototype.renderInlineAsText=function(e,t,n){for(var r="",a=0,o=e.length;a<o;a++)"text"===e[a].type?r+=e[a].content:"image"===e[a].type&&(r+=this.renderInlineAsText(e[a].children,t,n));return r},i.prototype.render=function(e,t,n){var r,a,o,c="",i=this.rules;for(r=0,a=e.length;r<a;r++)"inline"===(o=e[r].type)?c+=this.renderInline(e[r].children,t,n):void 0!==i[o]?c+=i[e[r].type](e,r,t,n,this):c+=this.renderToken(e,r,t,n);return c},e.exports=i},function(e,t,n){"use strict";var r=n(134),a=[["normalize",n(326)],["block",n(327)],["inline",n(328)],["linkify",n(329)],["replacements",n(330)],["smartquotes",n(331)]];function o(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1])}o.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},o.prototype.State=n(332),e.exports=o},function(e,t,n){"use strict";var r=/\r\n?|\n/g,a=/\0/g;e.exports=function(e){var t;t=(t=e.src.replace(r,"\n")).replace(a,"�"),e.src=t}},function(e,t,n){"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,a=e.tokens;for(n=0,r=a.length;n<r;n++)"inline"===(t=a[n]).type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},function(e,t,n){"use strict";var r=n(30).arrayReplaceAt;function a(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,o,c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k=e.tokens;if(e.md.options.linkify)for(n=0,o=k.length;n<o;n++)if("inline"===k[n].type&&e.md.linkify.pretest(k[n].content))for(h=0,t=(c=k[n].children).length-1;t>=0;t--)if("link_close"!==(l=c[t]).type){if("html_inline"===l.type&&(O=l.content,/^<a[>\s]/i.test(O)&&h>0&&h--,a(l.content)&&h++),!(h>0)&&"text"===l.type&&e.md.linkify.test(l.content)){for(p=l.content,v=e.md.linkify.match(p),s=[],b=l.level,m=0,u=0;u<v.length;u++)f=v[u].url,g=e.md.normalizeLink(f),e.md.validateLink(g)&&(j=v[u].text,j=v[u].schema?"mailto:"!==v[u].schema||/^mailto:/i.test(j)?e.md.normalizeLinkText(j):e.md.normalizeLinkText("mailto:"+j).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+j).replace(/^http:\/\//,""),(d=v[u].index)>m&&((i=new e.Token("text","",0)).content=p.slice(m,d),i.level=b,s.push(i)),(i=new e.Token("link_open","a",1)).attrs=[["href",g]],i.level=b++,i.markup="linkify",i.info="auto",s.push(i),(i=new e.Token("text","",0)).content=j,i.level=b,s.push(i),(i=new e.Token("link_close","a",-1)).level=--b,i.markup="linkify",i.info="auto",s.push(i),m=v[u].lastIndex);m<p.length&&((i=new e.Token("text","",0)).content=p.slice(m),i.level=b,s.push(i)),k[n].children=c=r(c,t,s)}}else for(t--;c[t].level!==l.level&&"link_open"!==c[t].type;)t--}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,a=/\((c|tm|r|p)\)/i,o=/\((c|tm|r|p)\)/gi,c={c:"©",r:"®",p:"§",tm:"™"};function i(e,t){return c[t.toLowerCase()]}function l(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||r||(n.content=n.content.replace(o,i)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function s(e){var t,n,a=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||a||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&a--,"link_close"===n.type&&"auto"===n.info&&a++}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(a.test(e.tokens[t].content)&&l(e.tokens[t].children),r.test(e.tokens[t].content)&&s(e.tokens[t].children))}},function(e,t,n){"use strict";var r=n(30).isWhiteSpace,a=n(30).isPunctChar,o=n(30).isMdAsciiPunct,c=/['"]/,i=/['"]/g;function l(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function s(e,t){var n,c,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w,C,x;for(w=[],n=0;n<e.length;n++){for(c=e[n],m=e[n].level,y=w.length-1;y>=0&&!(w[y].level<=m);y--);if(w.length=y+1,"text"===c.type){p=0,d=(s=c.content).length;e:for(;p<d&&(i.lastIndex=p,u=i.exec(s));){if(k=_=!0,p=u.index+1,E="'"===u[0],h=32,u.index-1>=0)h=s.charCodeAt(u.index-1);else for(y=n-1;y>=0&&("softbreak"!==e[y].type&&"hardbreak"!==e[y].type);y--)if(e[y].content){h=e[y].content.charCodeAt(e[y].content.length-1);break}if(f=32,p<d)f=s.charCodeAt(p);else for(y=n+1;y<e.length&&("softbreak"!==e[y].type&&"hardbreak"!==e[y].type);y++)if(e[y].content){f=e[y].content.charCodeAt(0);break}if(g=o(h)||a(String.fromCharCode(h)),j=o(f)||a(String.fromCharCode(f)),v=r(h),(O=r(f))?k=!1:j&&(v||g||(k=!1)),v?_=!1:g&&(O||j||(_=!1)),34===f&&'"'===u[0]&&h>=48&&h<=57&&(_=k=!1),k&&_&&(k=g,_=j),k||_){if(_)for(y=w.length-1;y>=0&&(b=w[y],!(w[y].level<m));y--)if(b.single===E&&w[y].level===m){b=w[y],E?(C=t.md.options.quotes[2],x=t.md.options.quotes[3]):(C=t.md.options.quotes[0],x=t.md.options.quotes[1]),c.content=l(c.content,u.index,x),e[b.token].content=l(e[b.token].content,b.pos,C),p+=x.length-1,b.token===n&&(p+=C.length-1),d=(s=c.content).length,w.length=y;continue e}k?w.push({token:n,pos:u.index,single:E,level:m}):_&&E&&(c.content=l(c.content,u.index,"’"))}else E&&(c.content=l(c.content,u.index,"’"))}}}}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&c.test(e.tokens[t].content)&&s(e.tokens[t].children,e)}},function(e,t,n){"use strict";var r=n(135);function a(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}a.prototype.Token=r,e.exports=a},function(e,t,n){"use strict";var r=n(134),a=[["table",n(334),["paragraph","reference"]],["code",n(335)],["fence",n(336),["paragraph","reference","blockquote","list"]],["blockquote",n(337),["paragraph","reference","blockquote","list"]],["hr",n(338),["paragraph","reference","blockquote","list"]],["list",n(339),["paragraph","reference","blockquote"]],["reference",n(340)],["heading",n(341),["paragraph","reference","blockquote"]],["lheading",n(342)],["html_block",n(343),["paragraph","reference","blockquote"]],["paragraph",n(345)]];function o(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1],{alt:(a[e][2]||[]).slice()})}o.prototype.tokenize=function(e,t,n){for(var r,a=this.ruler.getRules(""),o=a.length,c=t,i=!1,l=e.md.options.maxNesting;c<n&&(e.line=c=e.skipEmptyLines(c),!(c>=n))&&!(e.sCount[c]<e.blkIndent);){if(e.level>=l){e.line=n;break}for(r=0;r<o&&!a[r](e,c,n,!1);r++);e.tight=!i,e.isEmpty(e.line-1)&&(i=!0),(c=e.line)<n&&e.isEmpty(c)&&(i=!0,c++,e.line=c)}},o.prototype.parse=function(e,t,n,r){var a;e&&(a=new this.State(e,t,n,r),this.tokenize(a,a.line,a.lineMax))},o.prototype.State=n(346),e.exports=o},function(e,t,n){"use strict";var r=n(30).isSpace;function a(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function o(e){var t,n=[],r=0,a=e.length,o=!1,c=0,i="";for(t=e.charCodeAt(r);r<a;)124===t&&(o?(i+=e.substring(c,r-1),c=r):(n.push(i+e.substring(c,r)),i="",c=r+1)),o=92===t,r++,t=e.charCodeAt(r);return n.push(i+e.substring(c)),n}e.exports=function(e,t,n,c){var i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_;if(t+2>n)return!1;if(d=t+1,e.sCount[d]<e.blkIndent)return!1;if(e.sCount[d]-e.blkIndent>=4)return!1;if((s=e.bMarks[d]+e.tShift[d])>=e.eMarks[d])return!1;if(124!==(i=e.src.charCodeAt(s++))&&45!==i&&58!==i)return!1;for(;s<e.eMarks[d];){if(124!==(i=e.src.charCodeAt(s))&&45!==i&&58!==i&&!r(i))return!1;s++}for(m=(l=a(e,t+1)).split("|"),f=[],u=0;u<m.length;u++){if(!(g=m[u].trim())){if(0===u||u===m.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?f.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(l=a(e,t).trim()).indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),0===(b=m.length)||b!==f.length)return!1;if(c)return!0;for(O=e.parentType,e.parentType="table",_=e.md.block.ruler.getRules("blockquote"),(h=e.push("table_open","table",1)).map=j=[t,0],(h=e.push("thead_open","thead",1)).map=[t,t+1],(h=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u<m.length;u++)h=e.push("th_open","th",1),f[u]&&(h.attrs=[["style","text-align:"+f[u]]]),(h=e.push("inline","",0)).content=m[u].trim(),h.children=[],h=e.push("th_close","th",-1);for(h=e.push("tr_close","tr",-1),h=e.push("thead_close","thead",-1),d=t+2;d<n&&!(e.sCount[d]<e.blkIndent);d++){for(k=!1,u=0,p=_.length;u<p;u++)if(_[u](e,d,n,!0)){k=!0;break}if(k)break;if(!(l=a(e,d).trim()))break;if(e.sCount[d]-e.blkIndent>=4)break;for((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),d===t+2&&((h=e.push("tbody_open","tbody",1)).map=v=[t+2,0]),(h=e.push("tr_open","tr",1)).map=[d,d+1],u=0;u<b;u++)h=e.push("td_open","td",1),f[u]&&(h.attrs=[["style","text-align:"+f[u]]]),(h=e.push("inline","",0)).content=m[u]?m[u].trim():"",h.children=[],h=e.push("td_close","td",-1);h=e.push("tr_close","tr",-1)}return v&&(h=e.push("tbody_close","tbody",-1),v[1]=d),h=e.push("table_close","table",-1),j[1]=d,e.parentType=O,e.line=d,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o;if(e.sCount[t]-e.blkIndent<4)return!1;for(a=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;a=++r}return e.line=a,(o=e.push("code_block","code",0)).content=e.getLines(t,a,4+e.blkIndent,!0),o.map=[t,e.line],!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var a,o,c,i,l,s,u,p=!1,d=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(d+3>m)return!1;if(126!==(a=e.src.charCodeAt(d))&&96!==a)return!1;if(l=d,(o=(d=e.skipChars(d,a))-l)<3)return!1;if(u=e.src.slice(l,d),c=e.src.slice(d,m),96===a&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;for(i=t;!(++i>=n)&&!((d=l=e.bMarks[i]+e.tShift[i])<(m=e.eMarks[i])&&e.sCount[i]<e.blkIndent);)if(e.src.charCodeAt(d)===a&&!(e.sCount[i]-e.blkIndent>=4||(d=e.skipChars(d,a))-l<o||(d=e.skipSpaces(d))<m)){p=!0;break}return o=e.sCount[t],e.line=i+(p?1:0),(s=e.push("fence","code",0)).info=c,s.content=e.getLines(t+1,i,o,!0),s.markup=u,s.map=[t,e.line],!0}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w=e.lineMax,C=e.bMarks[t]+e.tShift[t],x=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(C++))return!1;if(a)return!0;for(l=m=e.sCount[t]+1,32===e.src.charCodeAt(C)?(C++,l++,m++,o=!1,O=!0):9===e.src.charCodeAt(C)?(O=!0,(e.bsCount[t]+m)%4==3?(C++,l++,m++,o=!1):o=!0):O=!1,b=[e.bMarks[t]],e.bMarks[t]=C;C<x&&(c=e.src.charCodeAt(C),r(c));)9===c?m+=4-(m+e.bsCount[t]+(o?1:0))%4:m++,C++;for(h=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(O?1:0),u=C>=x,j=[e.sCount[t]],e.sCount[t]=m-l,v=[e.tShift[t]],e.tShift[t]=C-e.bMarks[t],_=e.md.block.ruler.getRules("blockquote"),g=e.parentType,e.parentType="blockquote",d=t+1;d<n&&(E=e.sCount[d]<e.blkIndent,!((C=e.bMarks[d]+e.tShift[d])>=(x=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(C++)||E){if(u)break;for(k=!1,i=0,s=_.length;i<s;i++)if(_[i](e,d,n,!0)){k=!0;break}if(k){e.lineMax=d,0!==e.blkIndent&&(b.push(e.bMarks[d]),h.push(e.bsCount[d]),v.push(e.tShift[d]),j.push(e.sCount[d]),e.sCount[d]-=e.blkIndent);break}b.push(e.bMarks[d]),h.push(e.bsCount[d]),v.push(e.tShift[d]),j.push(e.sCount[d]),e.sCount[d]=-1}else{for(l=m=e.sCount[d]+1,32===e.src.charCodeAt(C)?(C++,l++,m++,o=!1,O=!0):9===e.src.charCodeAt(C)?(O=!0,(e.bsCount[d]+m)%4==3?(C++,l++,m++,o=!1):o=!0):O=!1,b.push(e.bMarks[d]),e.bMarks[d]=C;C<x&&(c=e.src.charCodeAt(C),r(c));)9===c?m+=4-(m+e.bsCount[d]+(o?1:0))%4:m++,C++;u=C>=x,h.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(O?1:0),j.push(e.sCount[d]),e.sCount[d]=m-l,v.push(e.tShift[d]),e.tShift[d]=C-e.bMarks[d]}for(f=e.blkIndent,e.blkIndent=0,(y=e.push("blockquote_open","blockquote",1)).markup=">",y.map=p=[t,0],e.md.block.tokenize(e,t,d),(y=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=w,e.parentType=g,p[1]=e.line,i=0;i<v.length;i++)e.bMarks[i+t]=b[i],e.tShift[i+t]=v[i],e.sCount[i+t]=j[i],e.bsCount[i+t]=h[i];return e.blkIndent=f,!0}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(c=1;s<u;){if((i=e.src.charCodeAt(s++))!==o&&!r(i))return!1;i===o&&c++}return!(c<3)&&(a||(e.line=t+1,(l=e.push("hr","hr",0)).map=[t,e.line],l.markup=Array(c+1).join(String.fromCharCode(o))),!0)}},function(e,t,n){"use strict";var r=n(30).isSpace;function a(e,t){var n,a,o,c;return a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],42!==(n=e.src.charCodeAt(a++))&&45!==n&&43!==n||a<o&&(c=e.src.charCodeAt(a),!r(c))?-1:a}function o(e,t){var n,a=e.bMarks[t]+e.tShift[t],o=a,c=e.eMarks[t];if(o+1>=c)return-1;if((n=e.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=c)return-1;if(!((n=e.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-a>=10)return-1}return o<c&&(n=e.src.charCodeAt(o),!r(n))?-1:o}e.exports=function(e,t,n,r){var c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w,C,x,S,N,A,T,P,I,M=!1,R=!0;if(e.sCount[t]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]<e.blkIndent)return!1;if(r&&"paragraph"===e.parentType&&e.tShift[t]>=e.blkIndent&&(M=!0),(S=o(e,t))>=0){if(d=!0,A=e.bMarks[t]+e.tShift[t],j=Number(e.src.substr(A,S-A-1)),M&&1!==j)return!1}else{if(!((S=a(e,t))>=0))return!1;d=!1}if(M&&e.skipSpaces(S)>=e.eMarks[t])return!1;if(g=e.src.charCodeAt(S-1),r)return!0;for(f=e.tokens.length,d?(I=e.push("ordered_list_open","ol",1),1!==j&&(I.attrs=[["start",j]])):I=e.push("bullet_list_open","ul",1),I.map=h=[t,0],I.markup=String.fromCharCode(g),O=t,N=!1,P=e.md.block.ruler.getRules("list"),y=e.parentType,e.parentType="list";O<n;){for(x=S,v=e.eMarks[O],p=k=e.sCount[O]+S-(e.bMarks[t]+e.tShift[t]);x<v;){if(9===(c=e.src.charCodeAt(x)))k+=4-(k+e.bsCount[O])%4;else{if(32!==c)break;k++}x++}if((u=(i=x)>=v?1:k-p)>4&&(u=1),s=p+u,(I=e.push("list_item_open","li",1)).markup=String.fromCharCode(g),I.map=m=[t,0],C=e.tight,w=e.tShift[t],E=e.sCount[t],_=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=s,e.tight=!0,e.tShift[t]=i-e.bMarks[t],e.sCount[t]=k,i>=v&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!N||(R=!1),N=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=_,e.tShift[t]=w,e.sCount[t]=E,e.tight=C,(I=e.push("list_item_close","li",-1)).markup=String.fromCharCode(g),O=t=e.line,m[1]=O,i=e.bMarks[t],O>=n)break;if(e.sCount[O]<e.blkIndent)break;if(e.sCount[t]-e.blkIndent>=4)break;for(T=!1,l=0,b=P.length;l<b;l++)if(P[l](e,O,n,!0)){T=!0;break}if(T)break;if(d){if((S=o(e,O))<0)break}else if((S=a(e,O))<0)break;if(g!==e.src.charCodeAt(S-1))break}return(I=d?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(g),h[1]=O,e.line=O,e.parentType=y,R&&function(e,t){var n,r,a=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===a&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}(e,f),!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t,n,o){var c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_=0,y=e.bMarks[t]+e.tShift[t],E=e.eMarks[t],w=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(y))return!1;for(;++y<E;)if(93===e.src.charCodeAt(y)&&92!==e.src.charCodeAt(y-1)){if(y+1===E)return!1;if(58!==e.src.charCodeAt(y+1))return!1;break}for(s=e.lineMax,O=e.md.block.ruler.getRules("reference"),h=e.parentType,e.parentType="reference";w<s&&!e.isEmpty(w);w++)if(!(e.sCount[w]-e.blkIndent>3||e.sCount[w]<0)){for(v=!1,p=0,d=O.length;p<d;p++)if(O[p](e,w,s,!0)){v=!0;break}if(v)break}for(E=(j=e.getLines(t,w,e.blkIndent,!1).trim()).length,y=1;y<E;y++){if(91===(c=j.charCodeAt(y)))return!1;if(93===c){b=y;break}(10===c||92===c&&++y<E&&10===j.charCodeAt(y))&&_++}if(b<0||58!==j.charCodeAt(b+1))return!1;for(y=b+2;y<E;y++)if(10===(c=j.charCodeAt(y)))_++;else if(!a(c))break;if(!(f=e.md.helpers.parseLinkDestination(j,y,E)).ok)return!1;if(u=e.md.normalizeLink(f.str),!e.md.validateLink(u))return!1;for(i=y=f.pos,l=_+=f.lines,g=y;y<E;y++)if(10===(c=j.charCodeAt(y)))_++;else if(!a(c))break;for(f=e.md.helpers.parseLinkTitle(j,y,E),y<E&&g!==y&&f.ok?(k=f.str,y=f.pos,_+=f.lines):(k="",y=i,_=l);y<E&&(c=j.charCodeAt(y),a(c));)y++;if(y<E&&10!==j.charCodeAt(y)&&k)for(k="",y=i,_=l;y<E&&(c=j.charCodeAt(y),a(c));)y++;return!(y<E&&10!==j.charCodeAt(y))&&(!!(m=r(j.slice(1,b)))&&(o||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[m]&&(e.env.references[m]={title:k,href:u}),e.parentType=h,e.line=t+_+1),!0))}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(c=1,o=e.src.charCodeAt(++s);35===o&&s<u&&c<=6;)c++,o=e.src.charCodeAt(++s);return!(c>6||s<u&&!r(o))&&(a||(u=e.skipSpacesBack(u,s),(i=e.skipCharsBack(u,35,s))>s&&r(e.src.charCodeAt(i-1))&&(u=i),e.line=t+1,(l=e.push("heading_open","h"+String(c),1)).markup="########".slice(0,c),l.map=[t,e.line],(l=e.push("inline","",0)).content=e.src.slice(s,u).trim(),l.map=[t,e.line],l.children=[],(l=e.push("heading_close","h"+String(c),-1)).markup="########".slice(0,c)),!0)}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o,c,i,l,s,u,p,d,m=t+1,b=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(d=e.parentType,e.parentType="paragraph";m<n&&!e.isEmpty(m);m++)if(!(e.sCount[m]-e.blkIndent>3)){if(e.sCount[m]>=e.blkIndent&&(l=e.bMarks[m]+e.tShift[m])<(s=e.eMarks[m])&&(45===(p=e.src.charCodeAt(l))||61===p)&&(l=e.skipChars(l,p),(l=e.skipSpaces(l))>=s)){u=61===p?1:2;break}if(!(e.sCount[m]<0)){for(a=!1,o=0,c=b.length;o<c;o++)if(b[o](e,m,n,!0)){a=!0;break}if(a)break}}return!!u&&(r=e.getLines(t,m,e.blkIndent,!1).trim(),e.line=m+1,(i=e.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(p),i.map=[t,e.line],(i=e.push("inline","",0)).content=r,i.map=[t,e.line-1],i.children=[],(i=e.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(p),e.parentType=d,!0)}},function(e,t,n){"use strict";var r=n(344),a=n(178).HTML_OPEN_CLOSE_TAG_RE,o=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(a.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var a,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(s))return!1;for(l=e.src.slice(s,u),a=0;a<o.length&&!o[a][0].test(l);a++);if(a===o.length)return!1;if(r)return o[a][2];if(c=t+1,!o[a][1].test(l))for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(s=e.bMarks[c]+e.tShift[c],u=e.eMarks[c],l=e.src.slice(s,u),o[a][1].test(l)){0!==l.length&&c++;break}return e.line=c,(i=e.push("html_block","",0)).map=[t,c],i.content=e.getLines(t,c,e.blkIndent,!0),!0}},function(e,t,n){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,a,o,c,i,l=t+1,s=e.md.block.ruler.getRules("paragraph"),u=e.lineMax;for(i=e.parentType,e.parentType="paragraph";l<u&&!e.isEmpty(l);l++)if(!(e.sCount[l]-e.blkIndent>3||e.sCount[l]<0)){for(r=!1,a=0,o=s.length;a<o;a++)if(s[a](e,l,u,!0)){r=!0;break}if(r)break}return n=e.getLines(t,l,e.blkIndent,!1).trim(),e.line=l,(c=e.push("paragraph_open","p",1)).map=[t,e.line],(c=e.push("inline","",0)).content=n,c.map=[t,e.line],c.children=[],c=e.push("paragraph_close","p",-1),e.parentType=i,!0}},function(e,t,n){"use strict";var r=n(135),a=n(30).isSpace;function o(e,t,n,r){var o,c,i,l,s,u,p,d;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",d=!1,i=l=u=p=0,s=(c=this.src).length;l<s;l++){if(o=c.charCodeAt(l),!d){if(a(o)){u++,9===o?p+=4-p%4:p++;continue}d=!0}10!==o&&l!==s-1||(10!==o&&l++,this.bMarks.push(i),this.eMarks.push(l),this.tShift.push(u),this.sCount.push(p),this.bsCount.push(0),d=!1,u=0,p=0,i=l+1)}this.bMarks.push(c.length),this.eMarks.push(c.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}o.prototype.push=function(e,t,n){var a=new r(e,t,n);return a.block=!0,n<0&&this.level--,a.level=this.level,n>0&&this.level++,this.tokens.push(a),a},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},o.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),a(t));e++);return e},o.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!a(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},o.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,c,i,l,s,u,p,d=e;if(e>=t)return"";for(u=new Array(t-e),o=0;d<t;d++,o++){for(c=0,p=l=this.bMarks[d],s=d+1<t||r?this.eMarks[d]+1:this.eMarks[d];l<s&&c<n;){if(i=this.src.charCodeAt(l),a(i))9===i?c+=4-(c+this.bsCount[d])%4:c++;else{if(!(l-p<this.tShift[d]))break;c++}l++}u[o]=c>n?new Array(c-n+1).join(" ")+this.src.slice(l,s):this.src.slice(l,s)}return u.join("")},o.prototype.Token=r,e.exports=o},function(e,t,n){"use strict";var r=n(134),a=[["text",n(348)],["newline",n(349)],["escape",n(350)],["backticks",n(351)],["strikethrough",n(179).tokenize],["emphasis",n(180).tokenize],["link",n(352)],["image",n(353)],["autolink",n(354)],["html_inline",n(355)],["entity",n(356)]],o=[["balance_pairs",n(357)],["strikethrough",n(179).postProcess],["emphasis",n(180).postProcess],["text_collapse",n(358)]];function c(){var e;for(this.ruler=new r,e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);for(this.ruler2=new r,e=0;e<o.length;e++)this.ruler2.push(o[e][0],o[e][1])}c.prototype.skipToken=function(e){var t,n,r=e.pos,a=this.ruler.getRules(""),o=a.length,c=e.md.options.maxNesting,i=e.cache;if(void 0===i[r]){if(e.level<c)for(n=0;n<o&&(e.level++,t=a[n](e,!0),e.level--,!t);n++);else e.pos=e.posMax;t||e.pos++,i[r]=e.pos}else e.pos=i[r]},c.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),a=r.length,o=e.posMax,c=e.md.options.maxNesting;e.pos<o;){if(e.level<c)for(n=0;n<a&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},c.prototype.parse=function(e,t,n,r){var a,o,c,i=new this.State(e,t,n,r);for(this.tokenize(i),c=(o=this.ruler2.getRules("")).length,a=0;a<c;a++)o[a](i)},c.prototype.State=n(359),e.exports=c},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t){var n,a,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;for(n=e.pending.length-1,a=e.posMax,t||(n>=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),o++;o<a&&r(e.src.charCodeAt(o));)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=n(30).isSpace,a=[],o=0;o<256;o++)a.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){a[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o=e.pos,c=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<c){if((n=e.src.charCodeAt(o))<256&&0!==a[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push("hardbreak","br",0),o++;o<c&&(n=e.src.charCodeAt(o),r(n));)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,a,o,c,i,l,s,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;u<r&&96===e.src.charCodeAt(u);)u++;if(l=(a=e.src.slice(n,u)).length,e.backticksScanned&&(e.backticks[l]||0)<=n)return t||(e.pending+=a),e.pos+=l,!0;for(c=i=u;-1!==(c=e.src.indexOf("`",i));){for(i=c+1;i<r&&96===e.src.charCodeAt(i);)i++;if((s=i-c)===l)return t||((o=e.push("code_inline","code",0)).markup=a,o.content=e.src.slice(u,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=i,!0;e.backticks[s]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=l,!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t){var n,o,c,i,l,s,u,p,d="",m="",b=e.pos,h=e.posMax,f=e.pos,g=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(l=e.pos+1,(i=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((s=i+1)<h&&40===e.src.charCodeAt(s)){for(g=!1,s++;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);if(s>=h)return!1;if(f=s,(u=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok){for(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?s=u.pos:d="",f=s;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);if(u=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<h&&f!==s&&u.ok)for(m=u.str,s=u.pos;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);}(s>=h||41!==e.src.charCodeAt(s))&&(g=!0),s++}if(g){if(void 0===e.env.references)return!1;if(s<h&&91===e.src.charCodeAt(s)?(f=s+1,(s=e.md.helpers.parseLinkLabel(e,s))>=0?c=e.src.slice(f,s++):s=i+1):s=i+1,c||(c=e.src.slice(l,i)),!(p=e.env.references[r(c)]))return e.pos=b,!1;d=p.href,m=p.title}return t||(e.pos=l,e.posMax=i,e.push("link_open","a",1).attrs=n=[["href",d]],m&&n.push(["title",m]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=s,e.posMax=h,!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t){var n,o,c,i,l,s,u,p,d,m,b,h,f,g="",j=e.pos,v=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(s=e.pos+2,(l=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=l+1)<v&&40===e.src.charCodeAt(u)){for(u++;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(u>=v)return!1;for(f=u,(d=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(g=e.md.normalizeLink(d.str),e.md.validateLink(g)?u=d.pos:g=""),f=u;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(d=e.md.helpers.parseLinkTitle(e.src,u,e.posMax),u<v&&f!==u&&d.ok)for(m=d.str,u=d.pos;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);else m="";if(u>=v||41!==e.src.charCodeAt(u))return e.pos=j,!1;u++}else{if(void 0===e.env.references)return!1;if(u<v&&91===e.src.charCodeAt(u)?(f=u+1,(u=e.md.helpers.parseLinkLabel(e,u))>=0?i=e.src.slice(f,u++):u=l+1):u=l+1,i||(i=e.src.slice(s,l)),!(p=e.env.references[r(i)]))return e.pos=j,!1;g=p.href,m=p.title}return t||(c=e.src.slice(s,l),e.md.inline.parse(c,e.md,e.env,h=[]),(b=e.push("image","img",0)).attrs=n=[["src",g],["alt",""]],b.children=h,b.content=c,m&&n.push(["title",m])),e.pos=u,e.posMax=v,!0}},function(e,t,n){"use strict";var r=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,a=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,t){var n,o,c,i,l,s,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(l=e.pos,s=e.posMax;;){if(++u>=s)return!1;if(60===(i=e.src.charCodeAt(u)))return!1;if(62===i)break}return n=e.src.slice(l+1,u),a.test(n)?(o=e.md.normalizeLink(n),!!e.md.validateLink(o)&&(t||((c=e.push("link_open","a",1)).attrs=[["href",o]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(n),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=n.length+2,!0)):!!r.test(n)&&(o=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(o)&&(t||((c=e.push("link_open","a",1)).attrs=[["href",o]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(n),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=n.length+2,!0))}},function(e,t,n){"use strict";var r=n(178).HTML_TAG_RE;e.exports=function(e,t){var n,a,o,c=e.pos;return!!e.md.options.html&&(o=e.posMax,!(60!==e.src.charCodeAt(c)||c+2>=o)&&(!(33!==(n=e.src.charCodeAt(c+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(a=e.src.slice(c).match(r))&&(t||(e.push("html_inline","",0).content=e.src.slice(c,c+a[0].length)),e.pos+=a[0].length,!0))))}},function(e,t,n){"use strict";var r=n(173),a=n(30).has,o=n(30).isValidEntityCode,c=n(30).fromCodePoint,i=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,s,u=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(u))return!1;if(u+1<p)if(35===e.src.charCodeAt(u+1)){if(s=e.src.slice(u).match(i))return t||(n="x"===s[1][0].toLowerCase()?parseInt(s[1].slice(1),16):parseInt(s[1],10),e.pending+=o(n)?c(n):c(65533)),e.pos+=s[0].length,!0}else if((s=e.src.slice(u).match(l))&&a(r,s[1]))return t||(e.pending+=r[s[1]]),e.pos+=s[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,a,o,c,i,l,s,u={},p=t.length;for(n=0;n<p;n++)if((a=t[n]).length=a.length||0,a.close){for(u.hasOwnProperty(a.marker)||(u[a.marker]=[-1,-1,-1]),c=u[a.marker][a.length%3],(r=n-a.jump-1)<-1&&(r=-1),i=r;r>c;r-=o.jump+1)if((o=t[r]).marker===a.marker&&o.open&&o.end<0&&(l=!1,(o.close||a.open)&&(o.length+a.length)%3==0&&(o.length%3==0&&a.length%3==0||(l=!0)),!l)){s=r>0&&!t[r-1].open?t[r-1].jump+1:0,a.jump=n-r+s,a.open=!1,o.end=n,o.jump=s,o.close=!1,i=-1;break}-1!==i&&(u[a.marker][(a.length||0)%3]=i)}}e.exports=function(e){var t,n=e.tokens_meta,a=e.tokens_meta.length;for(r(0,e.delimiters),t=0;t<a;t++)n[t]&&n[t].delimiters&&r(0,n[t].delimiters)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=0,a=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)a[t].nesting<0&&r--,a[t].level=r,a[t].nesting>0&&r++,"text"===a[t].type&&t+1<o&&"text"===a[t+1].type?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}},function(e,t,n){"use strict";var r=n(135),a=n(30).isWhiteSpace,o=n(30).isPunctChar,c=n(30).isMdAsciiPunct;function i(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}i.prototype.pushPending=function(){var e=new r("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},i.prototype.push=function(e,t,n){this.pending&&this.pushPending();var a=new r(e,t,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),a.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(a),this.tokens_meta.push(o),a},i.prototype.scanDelims=function(e,t){var n,r,i,l,s,u,p,d,m,b=e,h=!0,f=!0,g=this.posMax,j=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;b<g&&this.src.charCodeAt(b)===j;)b++;return i=b-e,r=b<g?this.src.charCodeAt(b):32,p=c(n)||o(String.fromCharCode(n)),m=c(r)||o(String.fromCharCode(r)),u=a(n),(d=a(r))?h=!1:m&&(u||p||(h=!1)),u?f=!1:p&&(d||m||(f=!1)),t?(l=h,s=f):(l=h&&(!f||p),s=f&&(!h||m)),{can_open:l,can_close:s,length:i}},i.prototype.Token=r,e.exports=i},function(e,t,n){"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function a(e){return Object.prototype.toString.call(e)}function o(e){return"[object Function]"===a(e)}function c(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var i={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var l={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},s="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=n(361)(e.__opts__),r=e.__tlds__.slice();function i(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");var l=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===a(n))return!function(e){return"[object RegExp]"===a(e)}(n.validate)?o(n.validate)?r.validate=n.validate:s(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?s(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===a(e)}(n)?s(t,n):l.push(t)}})),l.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(c).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var n=e.__index__,r=e.__last_index__,a=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=a,this.text=a,this.url=a}function d(e,t){var n=new p(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function m(e,t){if(!(this instanceof m))return new m(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||i.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},i,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},l,e),this.__compiled__={},this.__tlds__=s,this.__tlds_replaced__=!1,this.re={},u(this)}m.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},m.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},m.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,a,o,c,i,l;if(this.re.schema_test.test(e))for((i=this.re.schema_search).lastIndex=0;null!==(t=i.exec(e));)if(a=this.testSchemaAt(e,t[2],i.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+a;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,c=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&c>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=c)),this.__index__>=0},m.prototype.pretest=function(e){return this.re.pretest.test(e)},m.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},m.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(d(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(d(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},m.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},m.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},m.prototype.onCompile=function(){},e.exports=m},function(e,t,n){"use strict";e.exports=function(e){var t={};t.src_Any=n(175).source,t.src_Cc=n(176).source,t.src_Z=n(177).source,t.src_P=n(133).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+"[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"save",(function(){return Dt})),n.d(r,"attributes",(function(){return Ft})),n.d(r,"support",(function(){return zt}));var a={};n.r(a),n.d(a,"save",(function(){return Tn})),n.d(a,"attributes",(function(){return Pn})),n.d(a,"supports",(function(){return In}));var o={};n.r(o),n.d(o,"save",(function(){return _r})),n.d(o,"attributes",(function(){return Er})),n.d(o,"supports",(function(){return wr})),n.d(o,"migrate",(function(){return Cr}));var c=n(20),i=n(4),l=n.n(i),s=n(5),u=n.n(s),p=n(0),d=n(1),m=n(11),b=n(3),h=n(2),f=n(19),g=n.n(f),j=n(12),v=n.n(j),O=n(15),k=n.n(O),_=n(7),y=n.n(_),E=n(13),w=n.n(E),C=n(14),x=n.n(C),S=n(6),N=n(51),A=[{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Original","image style","jetpack"),value:void 0},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Black and White","image style","jetpack"),value:"black-and-white"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),title:Object(d._x)("Sepia","image style","jetpack"),value:"sepia"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:"1977",value:"1977"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Clarendon","image style","jetpack"),value:"clarendon"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0z"}),Object(p.createElement)(h.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:Object(d._x)("Gingham","image style","jetpack"),value:"gingham"}],T=Object(d.__)("Pick an image filter","jetpack");function P(e){var t=e.value,n=e.onChange;return Object(p.createElement)(h.Dropdown,{position:"bottom right",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(p.createElement)(h.Toolbar,{controls:[{onClick:t,extraProps:{"aria-haspopup":"true","aria-expanded":n},title:T,tooltip:T,icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"}))}]})},renderContent:function(e){var r=e.onClose;return Object(p.createElement)(h.NavigableMenu,{className:"tiled-gallery__filter-picker-menu"},A.map((function(e){var a,o=e.icon,c=e.title,i=e.value;return Object(p.createElement)(h.MenuItem,{className:t===i?"is-active":void 0,icon:o,isSelected:t===i,key:i||"original",onClick:(a=i,function(){n(t===a?void 0:a),r()}),role:"menuitemcheckbox"},c)})))}})}var I=n(8),M=n.n(I),R=n(24),B=n(29),L=n(10),D=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})),F=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})),z=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})),U=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})),V=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"})),G=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"img",Object(p.createRef)()),u()(y()(e),"onImageClick",(function(){e.props.isSelected||e.props.onSelect()})),u()(y()(e),"onImageKeyDown",(function(t){e.img.current===document.activeElement&&e.props.isSelected&&[R.BACKSPACE,R.DELETE].includes(t.keyCode)&&e.props.onRemove()})),e}return k()(n,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.alt,n=e.height,r=e.image,a=e.link,o=e.url,c=e.width;if(r){var i={};!t&&r.alt_text&&(i.alt=r.alt_text),!n&&r.media_details&&r.media_details.height&&(i.height=+r.media_details.height),!a&&r.link&&(i.link=r.link),!o&&r.source_url&&(i.url=r.source_url),!c&&r.media_details&&r.media_details.width&&(i.width=+r.media_details.width),Object.keys(i).length&&this.props.setAttributes(i)}}},{key:"render",value:function(){var e,t=this.props,n=t["aria-label"],r=t.alt,a=t.columns,o=t.height,c=t.id,i=t.imageFilter,l=t.isFirstItem,s=t.isLastItem,m=t.isSelected,b=t.link,f=t.linkTo,g=t.onMoveBackward,j=t.onMoveForward,v=t.onRemove,O=t.origUrl,k=t.showMovers,_=t.srcSet,y=t.url,E=t.width;switch(f){case"media":e=y;break;case"attachment":e=b}var w=Object(B.isBlobURL)(O),C=Object(p.createElement)(p.Fragment,null,Object(p.createElement)("img",{alt:r,"aria-label":n,"data-height":o,"data-id":c,"data-link":b,"data-url":O,"data-width":E,onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,ref:this.img,src:w?void 0:y,srcSet:w?void 0:_,tabIndex:"0",style:w?{backgroundImage:"url(".concat(O,")")}:void 0}),w&&Object(p.createElement)(h.Spinner,null));return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({"is-selected":m,"is-transient":w},"filter__".concat(i),!!i))},k&&Object(p.createElement)("div",{className:"tiled-gallery__item__move-menu"},Object(p.createElement)(h.Button,{icon:1===a?U:D,onClick:l?void 0:g,className:"tiled-gallery__item__move-backward",label:Object(d.__)("Move image backward","jetpack"),"aria-disabled":l,disabled:!m}),Object(p.createElement)(h.Button,{icon:1===a?z:F,onClick:s?void 0:j,className:"tiled-gallery__item__move-forward",label:Object(d.__)("Move image forward","jetpack"),"aria-disabled":s,disabled:!m})),Object(p.createElement)("div",{className:"tiled-gallery__item__inline-menu"},Object(p.createElement)(h.Button,{icon:V,onClick:v,className:"tiled-gallery__item__remove",label:Object(d.__)("Remove image","jetpack"),disabled:!m})),e?Object(p.createElement)("a",null,C):C)}}]),n}(p.Component),H=Object(L.withSelect)((function(e,t){var n=e("core").getMedia,r=t.id;return{image:r?n(r):null}}))(G);function q(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s,"data-amp-layout":"responsive"});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}var W=n(65),$=n.n(W),K=n(72);function Z(e){var t=e.children,n=e.width,r=n?{flexBasis:"".concat(n,"%")}:void 0;return Object(p.createElement)("div",{className:"tiled-gallery__col",style:r},t)}function Y(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function J(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}var X=n(114);function Q(e){var t=e.height,n=e.width;return t&&n?n/t:1}var ee=Oe([2,1,2],5),te=ke([_e,_e,ye,_e,_e]),ne=ke([_e,_e,_e,ye,_e,_e,_e]),re=Oe([3,1,3],5),ae=ke([ye,_e,_e,ye]),oe=Oe([1,2,1],5),ce=ke([ye,_e,_e,_e]),ie=Oe([1,3],3),le=ke([_e,_e,_e,ye]),se=Oe([3,1],3),ue=ke([we(1.6),Object(b.overEvery)(Ee(.9),we(2)),Object(b.overEvery)(Ee(.9),we(2))]),pe=Oe([1,2],3),de=Oe([1,1,1,1,1],1),me=Oe([1,1,1,1],1),be=Oe([1,1,1],3),he=ke([Object(b.overEvery)(Ee(.9),we(2)),Object(b.overEvery)(Ee(.9),we(2)),we(1.6)]),fe=Oe([2,1],3),ge=ke([function(e){return e>=2}]);function je(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&be(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function ve(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return me(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function Oe(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function ke(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function _e(e){return e>=1&&e<2}function ye(e){return e<1}function Ee(e){return function(t){return t>=e}}function we(e){return function(t){return t<e}}var Ce=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),u()(y()(e),"ro",null),u()(y()(e),"handleGalleryResize",(function(t){e.pendingRaf&&(cancelAnimationFrame(e.pendingRaf),e.pendingRaf=null),e.pendingRaf=requestAnimationFrame((function(){var n,r=$()(t);try{var a=function(){var t=n.value,r=t.contentRect,a=t.target,o=r.width,c=[];Object(X.a)(a).forEach((function(e){c.push(Object(X.b)(e,o))})),void 0!==e.props.onResize&&e.props.onResize(c)};for(r.s();!(n=r.n()).done;)a()}catch(o){r.e(o)}finally{r.f()}}))})),e}return k()(n,[{key:"componentDidMount",value:function(){this.observeResize()}},{key:"componentWillUnmount",value:function(){this.unobserveResize()}},{key:"componentDidUpdate",value:function(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}},{key:"triggerResize",value:function(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}},{key:"observeResize",value:function(){this.triggerResize(),this.ro=new K.a(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}},{key:"unobserveResize",value:function(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=e.columnWidths,i=function(e){return Object(b.map)(e,Q)}(r),l="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(i,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&te(r)&&ee(n)?[2,1,2]:r.length>15&&ne(r)&&re(n)?[3,1,3]:5!==r.length&&ae(r)&&oe(n)?[1,2,1]:ce(r)&&ie(n)?[1,3]:le(r)&&se(n)?[3,1]:ue(r)&&pe(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&de(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:ve(n,r)?[1,1,1,1]:je(n,r,t)?[1,1,1]:he(r)&&fe(n)?[2,1]:ge(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(i,{isWide:["full","wide"].includes(t)}),s=0;return Object(p.createElement)(Y,{galleryRef:this.gallery},l.map((function(e,t){return Object(p.createElement)(J,{key:t},e.map((function(e,n){var r=o.slice(s,s+e);return s+=e,Object(p.createElement)(Z,{key:n,width:c?c[t][n]:void 0},r)})))})))}}]),n}(p.Component),xe=n(28);function Se(e){var t=e.columns,n=e.renderedImages,r=Math.min(xe.h,t),a=n.length%r;return Object(p.createElement)(Y,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(J,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Z,{key:t},e)})))})))}var Ne=n(90),Ae=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.isSave,i=n.linkTo,l=n.layoutStyle,s=n.onMoveBackward,u=n.onMoveForward,m=n.onRemoveImage,b=n.onSelectImage,h=n.selectedImage,f=n.setImageAttributes,g=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),j=c?q:H,v=Object(Ne.b)(e,{layoutStyle:l}),O=v.src,k=v.srcSet;return Object(p.createElement)(j,{alt:e.alt,"aria-label":g,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:h===t,key:t,link:e.link,linkTo:i,onMoveBackward:c?void 0:s(t),onMoveForward:c?void 0:u(t),onRemove:c?void 0:m(t),onSelect:c?void 0:b(t),origUrl:e.url,setAttributes:c?void 0:f(t),showMovers:o.length>1,srcSet:k,url:O,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=e.onResize,s=e.isSave,d=e.columnWidths,m=Object(Ne.a)(c)?Se:Ce,b=this.props.images.map(this.renderImage,this),h=c!==xe.c?Math.min(i,xe.i):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(h),h>0))},Object(p.createElement)(m,{align:t,columns:a,columnWidths:s?d:void 0,images:o,layoutStyle:c,renderedImages:b,onResize:s?void 0:l}),n)}}]),n}(p.Component),Te=n(42),Pe=n(73),Ie=[{value:"attachment",label:Object(d.__)("Attachment Page","jetpack")},{value:"media",label:Object(d.__)("Media File","jetpack")},{value:"none",label:Object(d.__)("None","jetpack")}];function Me(e){return Math.min(3,e.images.length)}var Re=function(e){var t=Object(b.pick)(e,[["alt"],["id"],["link"]]);return t.url=Object(b.get)(e,["sizes","large","url"])||Object(b.get)(e,["media_details","sizes","large","source_url"])||e.url,t},Be=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"state",{selectedImage:null,changed:void 0===e.props.attributes.columnWidths}),u()(y()(e),"addFiles",(function(t){var n=e.props.attributes.images||[],r=e.props.noticeOperations;Object(N.mediaUpload)({allowedTypes:xe.a,filesList:t,onFileChange:function(t){var r=t.map((function(e){return Re(e)}));e.setAttributes({images:n.concat(r)})},onError:r.createErrorNotice}),e.setState({changed:!0})})),u()(y()(e),"onRemoveImage",(function(t){return function(){var n=Object(b.filter)(e.props.attributes.images,(function(e,n){return t!==n})),r=e.props.attributes.columns;e.setState({selectedImage:null,changed:!0}),e.setAttributes({images:n,columns:r?Math.min(n.length,r):r})}})),u()(y()(e),"onSelectImage",(function(t){return function(){e.state.selectedImage!==t&&e.setState({selectedImage:t})}})),u()(y()(e),"onSelectImages",(function(t){var n=e.props.attributes.columns;e.setAttributes({columns:n?Math.min(t.length,n):n,images:t.map((function(e){return Re(e)}))}),e.setState({changed:!0})})),u()(y()(e),"onMove",(function(t,n){var r=g()(e.props.attributes.images);r.splice(n,1,e.props.attributes.images[t]),r.splice(t,1,e.props.attributes.images[n]),e.setState({selectedImage:n,changed:!0}),e.setAttributes({images:r})})),u()(y()(e),"onMoveForward",(function(t){return function(){t!==e.props.attributes.images.length-1&&e.onMove(t,t+1)}})),u()(y()(e),"onMoveBackward",(function(t){return function(){0!==t&&e.onMove(t,t-1)}})),u()(y()(e),"onResize",(function(t){e.state.changed&&e.setAttributes({columnWidths:t})})),u()(y()(e),"setColumnsNumber",(function(t){return e.setAttributes({columns:t})})),u()(y()(e),"setRoundedCorners",(function(t){return e.setAttributes({roundedCorners:t})})),u()(y()(e),"setImageAttributes",(function(t){return function(n){var r=e.props.attributes.images;r[t]&&e.setAttributes({images:[].concat(g()(r.slice(0,t)),[l()(l()({},r[t]),n)],g()(r.slice(t+1)))})}})),u()(y()(e),"setLinkTo",(function(t){return e.setAttributes({linkTo:t})})),u()(y()(e),"uploadFromFiles",(function(t){return e.addFiles(t.target.files)})),e}return k()(n,[{key:"setAttributes",value:function(e){if(e.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');e.images&&(e=l()(l()({},e),{},{ids:e.images.map((function(e){var t=e.id;return parseInt(t,10)}))})),this.props.setAttributes(e)}},{key:"render",value:function(){var e=this,t=this.state.selectedImage,n=this.props,r=n.attributes,a=n.isSelected,o=n.className,c=n.noticeOperations,i=n.noticeUI,l=n.setAttributes,s=r.align,u=r.columns,m=void 0===u?Me(r):u,b=r.imageFilter,f=r.images,g=r.linkTo,j=r.roundedCorners,v=Object(p.createElement)(h.DropZone,{onFilesDrop:this.addFiles}),O=Object(p.createElement)(S.BlockControls,null,!!f.length&&Object(p.createElement)(p.Fragment,null,Object(p.createElement)(h.ToolbarGroup,null,Object(p.createElement)(h.ToolbarItem,null,(function(){return Object(p.createElement)(S.MediaUpload,{onSelect:e.onSelectImages,allowedTypes:xe.a,multiple:!0,gallery:!0,value:f.map((function(e){return e.id})),render:function(e){var t=e.open;return Object(p.createElement)(Pe.a,{label:Object(d.__)("Edit Gallery","jetpack"),onClick:t})}})}))),Object(p.createElement)(P,{value:b,onChange:function(t){l({imageFilter:t}),e.setState({selectedImage:null})}})));if(0===f.length)return Object(p.createElement)(p.Fragment,null,O,Object(p.createElement)(S.MediaPlaceholder,{icon:Object(p.createElement)(S.BlockIcon,{icon:Wr}),className:o,labels:{title:Object(d.__)("Tiled Gallery","jetpack"),name:Object(d.__)("images","jetpack")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:xe.a,multiple:!0,notices:i,onError:c.createErrorNotice}));var k=Object(Te.a)(xe.g,r.className);return Object(p.createElement)(p.Fragment,null,O,Object(p.createElement)(S.InspectorControls,null,Object(p.createElement)(h.PanelBody,{title:Object(d.__)("Tiled Gallery settings","jetpack")},["columns","circle","square"].includes(k)&&f.length>1&&Object(p.createElement)(h.RangeControl,{label:Object(d.__)("Columns","jetpack"),value:m,onChange:this.setColumnsNumber,min:1,max:Math.min(xe.h,f.length)}),k!==xe.c&&Object(p.createElement)(h.RangeControl,{label:Object(d.__)("Rounded corners","jetpack"),value:j,onChange:this.setRoundedCorners,min:0,max:xe.i}),Object(p.createElement)(h.SelectControl,{label:Object(d.__)("Link To","jetpack"),value:g,onChange:this.setLinkTo,options:Ie}))),i,Object(p.createElement)(Ae,{align:s,className:o,columns:m,imageFilter:b,images:f,layoutStyle:k,linkTo:g,onMoveBackward:this.onMoveBackward,onMoveForward:this.onMoveForward,onRemoveImage:this.onRemoveImage,onSelectImage:this.onSelectImage,onResize:this.onResize,roundedCorners:j,selectedImage:a?t:null,setImageAttributes:this.setImageAttributes},v,a&&Object(p.createElement)("div",{className:"tiled-gallery__add-item"},Object(p.createElement)(h.FormFileUpload,{multiple:!0,isLarge:!0,className:"tiled-gallery__add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},Object(d.__)("Upload an image","jetpack")))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.isSelected||null===t.selectedImage?null:{selectedImage:null}}}]),n}(p.Component),Le=Object(h.withNotices)(Be);var De=n(23),Fe=n(16),ze=n(58),Ue=(n(378),n(34)),Ve=n.n(Ue),Ge=n(70),He=n(39);function qe(e){var t,n=e["aria-label"],r=e.alt,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,u=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var d=Object(p.createElement)("img",{alt:r,"aria-label":n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":u,src:s});return Object(p.createElement)("figure",{className:"tiled-gallery__item"},t?Object(p.createElement)("a",{href:t},d):d)}function We(e){var t=e.children;return Object(p.createElement)("div",{className:"tiled-gallery__col"},t)}function $e(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Ke(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}var Ze=n(9),Ye=n.n(Ze),Je="rectangular",Xe=[{isDefault:!0,name:Je},{name:"circle"},{name:"square"},{name:"columns"}];function Qe(e,t){var n=(t-e.reduce((function(e,t){return e+t}),0))/e.length;return e.map((function(e){return e+n}))}function et(e,t){!function(e,t,n){var r=Ye()(t,2),a=r[0],o=r[1],c=1/a*(n-4*(e.childElementCount-1)-o);!function(e,t){var n=t.rawHeight,r=t.rowWidth,a=nt(e),o=a.map((function(e){return(n-4*(e.childElementCount-1))*at(e)[0]})),c=Qe(o,r);a.forEach((function(e,t){var r=o[t],a=c[t];!function(e,t){var n=t.colHeight,r=t.width,a=t.rawWidth,o=Qe(rt(e).map((function(e){return a/ot(e)})),n);Array.from(e.children).forEach((function(e,t){var n=o[t];e.setAttribute("style","height:".concat(n,"px;width:").concat(r,"px;"))}))}(e,{colHeight:n-4*(e.childElementCount-1),width:a,rawWidth:r})}))}(e,{rawHeight:c,rowWidth:n-4*(e.childElementCount-1)})}(e,function(e){return nt(e).map(at).reduce((function(e,t){var n=Ye()(e,2),r=n[0],a=n[1],o=Ye()(t,2);return[r+o[0],a+o[1]]}),[0,0])}(e),t)}function tt(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function nt(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function rt(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function at(e){var t=rt(e),n=t.length,r=1/t.map(ot).reduce((function(e,t){return e+1/t}),0);return[r,r*n||1]}function ot(e){var t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}function ct(e){var t=e.height,n=e.width;return t&&n?n/t:1}var it=xt([2,1,2],5),lt=St([Nt,Nt,At,Nt,Nt]),st=St([Nt,Nt,Nt,At,Nt,Nt,Nt]),ut=xt([3,1,3],5),pt=St([At,Nt,Nt,At]),dt=xt([1,2,1],5),mt=St([At,Nt,Nt,Nt]),bt=xt([1,3],3),ht=St([Nt,Nt,Nt,At]),ft=xt([3,1],3),gt=St([Pt(1.6),Object(b.overEvery)(Tt(.9),Pt(2)),Object(b.overEvery)(Tt(.9),Pt(2))]),jt=xt([1,2],3),vt=xt([1,1,1,1,1],1),Ot=xt([1,1,1,1],1),kt=xt([1,1,1],3),_t=St([Object(b.overEvery)(Tt(.9),Pt(2)),Object(b.overEvery)(Tt(.9),Pt(2)),Pt(1.6)]),yt=xt([2,1],3),Et=St([function(e){return e>=2}]);function wt(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&kt(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function Ct(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return Ot(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function xt(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function St(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function Nt(e){return e>=1&&e<2}function At(e){return e<1}function Tt(e){return function(t){return t>=e}}function Pt(e){return function(t){return t<e}}var It=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),u()(y()(e),"ro",null),u()(y()(e),"handleGalleryResize",(function(t){e.pendingRaf&&(cancelAnimationFrame(e.pendingRaf),e.pendingRaf=null),e.pendingRaf=requestAnimationFrame((function(){var e,n=$()(t);try{var r=function(){var t=e.value,n=t.contentRect,r=t.target,a=n.width;tt(r).forEach((function(e){return et(e,a)}))};for(n.s();!(e=n.n()).done;)r()}catch(a){n.e(a)}finally{n.f()}}))})),e}return k()(n,[{key:"componentDidMount",value:function(){this.observeResize()}},{key:"componentWillUnmount",value:function(){this.unobserveResize()}},{key:"componentDidUpdate",value:function(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}},{key:"triggerResize",value:function(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}},{key:"observeResize",value:function(){this.triggerResize(),this.ro=new K.a(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}},{key:"unobserveResize",value:function(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=function(e){return Object(b.map)(e,ct)}(r),i="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(c,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&<(r)&&it(n)?[2,1,2]:r.length>15&&st(r)&&ut(n)?[3,1,3]:5!==r.length&&pt(r)&&dt(n)?[1,2,1]:mt(r)&&bt(n)?[1,3]:ht(r)&&ft(n)?[3,1]:gt(r)&&jt(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&vt(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:Ct(n,r)?[1,1,1,1]:wt(n,r,t)?[1,1,1]:_t(r)&&yt(n)?[2,1]:Et(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(c,{isWide:["full","wide"].includes(t)}),l=0;return Object(p.createElement)($e,{galleryRef:this.gallery},i.map((function(e,t){return Object(p.createElement)(Ke,{key:t},e.map((function(e,t){var n=o.slice(l,l+e);return l+=e,Object(p.createElement)(We,{key:t},n)})))})))}}]),n}(p.Component);function Mt(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)($e,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Ke,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(We,{key:t},e)})))})))}var Rt=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"photonize",value:function(e){var t=e.height,n=e.width,r=e.url;if(r){if(Object(B.isBlobURL)(r)||/^https?:\/\/localhost/.test(r))return r;var a=r.split("?",1)[0],o=function(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}(r)?Lt:Ge.a;if(Bt(this.props.layoutStyle)&&n&&t){var c=Math.min(2e3,n,t);return o(a,{resize:"".concat(c,",").concat(c)})}return o(a)}}},{key:"renderImage",value:function(e,t){var n=this.props,r=n.images,a=n.linkTo,o=n.selectedImage,c=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,r.length);return Object(p.createElement)(qe,{alt:e.alt,"aria-label":c,height:e.height,id:e.id,origUrl:e.url,isSelected:o===t,key:t,link:e.link,linkTo:a,url:this.photonize(e),width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=Bt(c)?Mt:It,l=this.props.images.map(this.renderImage,this);return Object(p.createElement)("div",{className:r},Object(p.createElement)(i,{align:t,columns:a,images:o,layoutStyle:c,renderedImages:l}),n)}}]),n}(p.Component);function Bt(e){return["circle","square"].includes(e)}function Lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}function Dt(e){var t=e.attributes,n=t.images;if(!n.length)return null;var r=t.align,a=t.className,o=t.columns,c=void 0===o?function(e){return Math.min(3,e.images.length)}(t):o,i=t.linkTo;return Object(p.createElement)(Rt,{align:r,className:a,columns:c,images:n,layoutStyle:Object(Te.a)(Xe,a),linkTo:i})}var Ft={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Je),type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},caption:{selector:"figcaption",source:"html",type:"string"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"}},zt={align:["center","wide","full"],customClassName:!1,html:!1},Ut=2e3,Vt="circle",Gt="rectangular",Ht=[{isDefault:!0,name:Gt},{name:Vt},{name:"square"},{name:"columns"}];function qt(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}function Wt(e){var t=e.children;return Object(p.createElement)("div",{className:"tiled-gallery__col"},t)}function $t(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Kt(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}function Zt(e){var t=e.height,n=e.width;return t&&n?n/t:1}var Yt=gn([2,1,2],5),Jt=jn([vn,vn,On,vn,vn]),Xt=jn([vn,vn,vn,On,vn,vn,vn]),Qt=gn([3,1,3],5),en=jn([On,vn,vn,On]),tn=gn([1,2,1],5),nn=jn([On,vn,vn,vn]),rn=gn([1,3],3),an=jn([vn,vn,vn,On]),on=gn([3,1],3),cn=jn([yn(1.6),Object(b.overEvery)(kn(.9),yn(2)),Object(b.overEvery)(kn(.9),yn(2))]),ln=gn([1,2],3),sn=gn([1,1,1,1,1],1),un=gn([1,1,1,1],1),pn=gn([1,1,1],3),dn=jn([Object(b.overEvery)(kn(.9),yn(2)),Object(b.overEvery)(kn(.9),yn(2)),yn(1.6)]),mn=gn([2,1],3),bn=jn([function(e){return e>=2}]);function hn(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&pn(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function fn(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return un(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function gn(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function jn(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function vn(e){return e>=1&&e<2}function On(e){return e<1}function kn(e){return function(t){return t>=e}}function yn(e){return function(t){return t<e}}var En=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),e}return k()(n,[{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=function(e){return Object(b.map)(e,Zt)}(r),i="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(c,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&Jt(r)&&Yt(n)?[2,1,2]:r.length>15&&Xt(r)&&Qt(n)?[3,1,3]:5!==r.length&&en(r)&&tn(n)?[1,2,1]:nn(r)&&rn(n)?[1,3]:an(r)&&on(n)?[3,1]:cn(r)&&ln(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&sn(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:fn(n,r)?[1,1,1,1]:hn(n,r,t)?[1,1,1]:dn(r)&&mn(n)?[2,1]:bn(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(c,{isWide:["full","wide"].includes(t)}),l=0;return Object(p.createElement)($t,{galleryRef:this.gallery},i.map((function(e,t){return Object(p.createElement)(Kt,{key:t},e.map((function(e,t){var n=o.slice(l,l+e);return l+=e,Object(p.createElement)(Wt,{key:t},n)})))})))}}]),n}(p.Component);function wn(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)($t,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Kt,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Wt,{key:t},e)})))})))}function Cn(e){return["circle","square"].includes(e)}function xn(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}function Sn(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}function Nn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}var An=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.linkTo,i=n.layoutStyle,l=n.selectedImage,s=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.height||!e.url||!e.width)return{};if(Object(B.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};var n,r=e.url.split("?",1)[0],a=e.height,o=e.width,c=t.layoutStyle,i=Sn(r)||!0===xn()?Nn:Ge.a;if(Cn(c)&&o&&a){var l=Math.min(Ut,o,a);n=i(r,{resize:"".concat(l,",").concat(l)})}else n=i(r);var s,u=300,p=600;if(Cn(c)){var d=Math.min(p,o,a),m=Math.min(Ut,o,a);s=Object(b.range)(d,m,u).map((function(e){var t=i(r,{resize:"".concat(e,",").concat(e),strip:"info"});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}else{var h=Math.min(p,o),f=Math.min(Ut,o);s=Object(b.range)(h,f,u).map((function(e){var t=i(r,{strip:"info",width:e});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}return Object.assign({src:n},s&&{srcSet:s})}(e,{layoutStyle:i}),m=u.src,h=u.srcSet;return Object(p.createElement)(qt,{alt:e.alt,"aria-label":s,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:l===t,key:t,link:e.link,linkTo:c,origUrl:e.url,showMovers:o.length>1,srcSet:h,url:m,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=Cn(c)?wn:En,s=this.props.images.map(this.renderImage,this),d=c!==Vt?Math.min(i,20):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(d),d>0))},Object(p.createElement)(l,{align:t,columns:a,images:o,layoutStyle:c,renderedImages:s}),n)}}]),n}(p.Component);function Tn(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?function(e){return Math.min(3,e.images.length)}(t):c,l=t.linkTo,s=t.roundedCorners;return Object(p.createElement)(An,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(Ht,o),linkTo:l,roundedCorners:s})}var Pn={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Gt),type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},In={align:["center","wide","full"],customClassName:!1,html:!1},Mn=2e3,Rn="circle",Bn="rectangular",Ln=[{isDefault:!0,name:Bn},{name:Rn},{name:"square"},{name:"columns"}];function Dn(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}function Fn(e){var t=e.children,n=e.width,r=Math.pow(10,12),a=Math.round(n*r)/r,o=n?{flexBasis:"".concat(a,"%")}:void 0;return Object(p.createElement)("div",{className:"tiled-gallery__col",style:o},t)}function zn(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Un(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}function Vn(e){var t=e.height,n=e.width;return t&&n?n/t:1}var Gn=sr([2,1,2],5),Hn=ur([pr,pr,dr,pr,pr]),qn=ur([pr,pr,pr,dr,pr,pr,pr]),Wn=sr([3,1,3],5),$n=ur([dr,pr,pr,dr]),Kn=sr([1,2,1],5),Zn=ur([dr,pr,pr,pr]),Yn=sr([1,3],3),Jn=ur([pr,pr,pr,dr]),Xn=sr([3,1],3),Qn=ur([br(1.6),Object(b.overEvery)(mr(.9),br(2)),Object(b.overEvery)(mr(.9),br(2))]),er=sr([1,2],3),tr=sr([1,1,1,1,1],1),nr=sr([1,1,1,1],1),rr=sr([1,1,1],3),ar=ur([Object(b.overEvery)(mr(.9),br(2)),Object(b.overEvery)(mr(.9),br(2)),br(1.6)]),or=sr([2,1],3),cr=ur([function(e){return e>=2}]);function ir(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&rr(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function lr(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return nr(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function sr(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function ur(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function pr(e){return e>=1&&e<2}function dr(e){return e<1}function mr(e){return function(t){return t>=e}}function br(e){return function(t){return t<e}}var hr=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),e}return k()(n,[{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=e.columnWidths,i=function(e){return Object(b.map)(e,Vn)}(r),l="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(i,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&Hn(r)&&Gn(n)?[2,1,2]:r.length>15&&qn(r)&&Wn(n)?[3,1,3]:5!==r.length&&$n(r)&&Kn(n)?[1,2,1]:Zn(r)&&Yn(n)?[1,3]:Jn(r)&&Xn(n)?[3,1]:Qn(r)&&er(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&tr(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:lr(n,r)?[1,1,1,1]:ir(n,r,t)?[1,1,1]:ar(r)&&or(n)?[2,1]:cr(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(i,{isWide:["full","wide"].includes(t)}),s=0;return Object(p.createElement)(zn,{galleryRef:this.gallery},l.map((function(e,t){return Object(p.createElement)(Un,{key:t},e.map((function(e,n){var r=o.slice(s,s+e);return s+=e,Object(p.createElement)(Fn,{key:n,width:c?c[t][n]:void 0},r)})))})))}}]),n}(p.Component);function fr(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)(zn,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Un,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Fn,{key:t},e)})))})))}function gr(e){return["circle","square"].includes(e)}function jr(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}function vr(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}function Or(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}var kr=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.isSave,i=n.linkTo,l=n.layoutStyle,s=n.onMoveBackward,u=n.onMoveForward,m=n.onRemoveImage,h=n.onSelectImage,f=n.selectedImage,g=n.setImageAttributes,j=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.height||!e.url||!e.width)return{};if(Object(B.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};var n,r=e.url.split("?",1)[0],a=e.height,o=e.width,c=t.layoutStyle,i=vr(r)||!0===jr()?Or:Ge.a;if(gr(c)&&o&&a){var l=Math.min(Mn,o,a);n=i(r,{resize:"".concat(l,",").concat(l)})}else n=i(r);var s,u=300,p=600;if(gr(c)){var d=Math.min(p,o,a),m=Math.min(Mn,o,a);s=Object(b.range)(d,m,u).map((function(e){var t=i(r,{resize:"".concat(e,",").concat(e),strip:"info"});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}else{var h=Math.min(p,o),f=Math.min(Mn,o);s=Object(b.range)(h,f,u).map((function(e){var t=i(r,{strip:"info",width:e});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}return Object.assign({src:n},s&&{srcSet:s})}(e,{layoutStyle:l}),O=v.src,k=v.srcSet;return Object(p.createElement)(Dn,{alt:e.alt,"aria-label":j,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:i,onMoveBackward:c?void 0:s(t),onMoveForward:c?void 0:u(t),onRemove:c?void 0:m(t),onSelect:c?void 0:h(t),origUrl:e.url,setAttributes:c?void 0:g(t),showMovers:o.length>1,srcSet:k,url:O,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=e.onResize,s=e.isSave,d=e.columnWidths,m=gr(c)?fr:hr,b=this.props.images.map(this.renderImage,this),h=c!==Rn?Math.min(i,20):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(h),h>0))},Object(p.createElement)(m,{align:t,columns:a,columnWidths:s?d:void 0,images:o,layoutStyle:c,renderedImages:b,onResize:s?void 0:l}),n)}}]),n}(p.Component);function _r(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?function(e){return Math.min(3,e.images.length)}(t):c,l=t.linkTo,s=t.roundedCorners,u=t.columnWidths;return Object(p.createElement)(kr,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(Ln,o),linkTo:l,roundedCorners:s,columnWidths:u})}var yr,Er={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Bn),type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},wr={align:["center","wide","full"],customClassName:!1,html:!1},Cr=function(e){var t=Math.pow(10,5);return l()(l()({},e),{},{columnWidths:e.columnWidths.map((function(e){return e.map((function(e){return Math.round(e*t)/t}))}))})},xr=[o,a,r],Sr=n(200),Nr=n.n(Sr),Ar=n(201),Tr=n.n(Ar),Pr=n(202),Ir=n.n(Pr),Mr=n(203),Rr=n.n(Mr),Br=n(204),Lr=n.n(Br),Dr=n(205),Fr=n.n(Dr),zr=(yr={},u()(yr,xe.e,Object(d._x)("Tiled mosaic","Tiled gallery layout","jetpack")),u()(yr,xe.c,Object(d._x)("Circles","Tiled gallery layout","jetpack")),u()(yr,xe.d,Object(d._x)("Tiled columns","Tiled gallery layout","jetpack")),u()(yr,xe.f,Object(d._x)("Square tiles","Tiled gallery layout","jetpack")),yr),Ur=xe.g.map((function(e){return l()(l()({},e),{},{label:zr[e.name]})}));function Vr(e){return Object(b.filter)(e,(function(e){var t=e.id,n=e.url;return t&&n}))}var Gr={align:{default:"center",type:"string"},className:{default:"is-style-".concat(xe.e),type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},Hr={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:Nr.a,width:160,height:95},{alt:"",link:"",url:Tr.a,width:160,height:107},{alt:"",link:"",url:Ir.a,width:304,height:203},{alt:"",link:"",url:Rr.a,width:312,height:207},{alt:"",link:"",url:Lr.a,width:152,height:101},{alt:"",link:"",url:Fr.a,width:152,height:105}],linkTo:"none"},qr="tiled-gallery",Wr=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",width:24,height:24},Object(p.createElement)(h.Path,{fill:"currentColor",d:"M19 5v2h-4V5h4M9 5v6H5V5h4m10 8v6h-4v-6h4M9 17v2H5v-2h4M21 3h-8v6h8V3zM11 3H3v10h8V3zm10 8h-8v10h8V11zm-10 4H3v6h8v-6z"})),$r={attributes:Gr,category:Object(ze.a)("media","layout"),description:Object(d.__)("Display multiple images in an elegantly organized tiled layout.","jetpack")+(Object(De.c)()?"":" "+Object(d.__)("Serves images using Jetpack's fast global network of servers.","jetpack")),icon:{src:Wr,foreground:Object(Fe.a)()},keywords:[Object(d._x)("columns","block search term","jetpack"),Object(d._x)("images","block search term","jetpack"),Object(d._x)("photos","block search term","jetpack"),Object(d._x)("pictures","block search term","jetpack"),Object(d._x)("square","block search term","jetpack"),Object(d._x)("circle","block search term","jetpack"),Object(d._x)("mosaic","block search term","jetpack")],styles:Ur,supports:{align:["center","wide","full"],customClassName:!1,html:!1},title:Object(d.__)("Tiled Gallery","jetpack"),transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:function(e){return Vr(e).length>0},transform:function(e){var t=Vr(e);return Object(m.createBlock)("jetpack/".concat(qr),{images:t.map((function(e){return{id:e.id,url:e.url,alt:e.alt}})),ids:t.map((function(e){return e.id}))})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:function(e){var t=Vr(e.images);return t.length>0?Object(m.createBlock)("jetpack/".concat(qr),{images:t.map((function(e){return{id:e.id,url:e.url,alt:e.alt}})),ids:t.map((function(e){return e.id}))}):Object(m.createBlock)("jetpack/".concat(qr))}}],to:[{type:"block",blocks:["core/gallery"],transform:function(e){var t=e.images,n=e.ids,r=e.columns,a=e.linkTo;return Object(m.createBlock)("core/gallery",{images:t,ids:n,columns:r,imageCrop:!0,linkTo:a})}},{type:"block",blocks:["core/image"],transform:function(e){var t=e.align,n=e.images;return n.length>0?n.map((function(e){var n=e.id,r=e.url,a=e.alt;return Object(m.createBlock)("core/image",{align:t,id:n,url:r,alt:a})})):Object(m.createBlock)("core/image")}}]},edit:Le,save:function(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?Me(t):c,l=t.linkTo,s=t.roundedCorners,u=t.columnWidths;return Object(p.createElement)(Ae,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(xe.g,o),linkTo:l,roundedCorners:s,columnWidths:u})},deprecated:xr,example:{attributes:Hr}};Object(c.a)(qr,$r)},function(e,t,n){"use strict";n.r(t);n(48),n(165);var r=n(4),a=n.n(r),o=n(26),c=n.n(o),i=n(22),l=n.n(i),s=n(10),u=n(1),p=(n(158),n(39)),d=n(45),m=n(23);function b(){var e=Object(d.a)();return void 0!==typeof window&&window.location&&e?Object(m.c)()||Object(m.a)()?"https://wordpress.com/plans/my-plan/".concat(e):"".concat(window.location.protocol,"//").concat(e.replace("::","/"),"/wp-admin/admin.php?page=jetpack#/my-plan"):null}if(c()(regeneratorRuntime.mark((function e(){var t,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===typeof window||!window.location){e.next=16;break}if(!new URLSearchParams(window.location.search).get("plan_upgraded")){e.next=16;break}if(t=null,e.prev=4,!Object(m.c)()){e.next=7;break}return e.abrupt("break",16);case 7:return e.next=9,l()({path:"/jetpack/v4/site"});case 9:n=e.sent,r=JSON.parse(n.data),t=r.plan.product_name;case 12:return e.prev=12,o=b(),Object(s.dispatch)("core/notices").createNotice("success",t?Object(u.sprintf)(Object(u.__)("Congratulations! Your site is now on the %s plan.","jetpack"),t):Object(u.__)("Congratulations! Your site is now on a paid plan.","jetpack"),a()({isDismissible:!0},o&&{actions:[{url:b(),label:Object(u.__)("View my plan","jetpack")}]})),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[4,,12,16]])})))(),void 0!==typeof window&&window.location){var h=Object(p.parse)(window.location.href,!0).query;h.stripe_connect_success?Object(s.dispatch)("core/notices").createNotice("success",Object(u.__)("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):h.stripe_connect_cancelled&&Object(s.dispatch)("core/notices").createNotice("error",Object(u.__)("You cancelled connecting your site to Stripe.","jetpack"))}var f=n(21),g=n.n(f),j=n(19),v=n.n(j),O=n(0),k=n(31),_=n(6),y=n(61),E=n(9),w=n.n(E),C=n(33),x=n(12),S=n.n(x),N=n(15),A=n.n(N),T=n(7),P=n.n(T),I=n(13),M=n.n(I),R=n(14),B=n.n(R),L=n(5),D=n.n(L),F=n(3),z=n(8),U=n.n(z),V=n(17),G=n(2),H=n(24),q=n(88),W="google_photos",$="pexels",K="recent",Z="/",Y=[{value:K,label:Object(u.__)("Photos","jetpack")},{value:Z,label:Object(u.__)("Albums","jetpack")}],J=[{value:"",label:Object(u.__)("All categories","jetpack")},{value:"animals",label:Object(u.__)("Animals","jetpack")},{value:"arts",label:Object(u.__)("Arts","jetpack")},{value:"birthdays",label:Object(u.__)("Birthdays","jetpack")},{value:"cityscapes",label:Object(u.__)("Cityscapes","jetpack")},{value:"crafts",label:Object(u.__)("Crafts","jetpack")},{value:"fashion",label:Object(u.__)("Fashion","jetpack")},{value:"food",label:Object(u.__)("Food","jetpack")},{value:"flowers",label:Object(u.__)("Flowers","jetpack")},{value:"gardens",label:Object(u.__)("Gardens","jetpack")},{value:"holidays",label:Object(u.__)("Holidays","jetpack")},{value:"houses",label:Object(u.__)("Houses","jetpack")},{value:"landmarks",label:Object(u.__)("Landmarks","jetpack")},{value:"landscapes",label:Object(u.__)("Landscapes","jetpack")},{value:"night",label:Object(u.__)("Night","jetpack")},{value:"people",label:Object(u.__)("People","jetpack")},{value:"pets",label:Object(u.__)("Pets","jetpack")},{value:"selfies",label:Object(u.__)("Selfies","jetpack")},{value:"sport",label:Object(u.__)("Sport","jetpack")},{value:"travel",label:Object(u.__)("Travel","jetpack")},{value:"weddings",label:Object(u.__)("Weddings","jetpack")}],X=["mountain","ocean","river","clouds","pattern","abstract","sky"],Q="ANY",ee="LAST_7_DAYS",te="LAST_30_DAYS",ne="LAST_6_MONTHS",re="LAST_12_MONTHS",ae="CUSTOM",oe=[{value:Q,label:Object(u.__)("Any time","jetpack")},{value:ee,label:Object(u.__)("Last 7 days","jetpack")},{value:te,label:Object(u.__)("Last 30 days","jetpack")},{value:ne,label:Object(u.__)("Last 6 months","jetpack")},{value:re,label:Object(u.__)("Last 12 months","jetpack")},{value:ae,label:Object(u.__)("Specific Month/Year","jetpack")}],ce=(new Date).getFullYear(),ie=[{label:Object(u.__)("Any Month","jetpack"),value:-1}].concat(v()(Object(F.map)(Object(F.range)(0,12),(function(e){return{label:Object(q.dateI18n)("F",new Date(0,e)),value:e}}))));function le(){return Object(V.createHigherOrderComponent)((function(e){var t=function(t){M()(r,t);var n=B()(r);function r(e){var t;return S()(this,r),t=n.call(this,e),D()(P()(t),"contentRef",(function(e){e?(t.contentElement=e,t.modalElement=e.closest(".jetpack-external-media-browser"),t.modalElement&&t.modalElement.addEventListener("keydown",t.stopArrowKeysPropagation)):t.modalElement&&(t.modalElement.removeEventListener("keydown",t.stopArrowKeysPropagation),t.modalElement=null,t.contentElement=null)})),D()(P()(t),"stopArrowKeysPropagation",(function(e){[H.UP,H.DOWN,H.LEFT,H.RIGHT].includes(e.keyCode)&&!e.target.classList.contains("jetpack-external-media-browser__media__item")&&e.stopPropagation()})),D()(P()(t),"setAuthenticated",(function(e){return t.setState({isAuthenticated:e})})),D()(P()(t),"getMedia",(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.state.isLoading||(n&&t.props.noticeOperations.removeAllNotices(),t.setState({account:n?t.defaultAccount:t.state.account,isLoading:!0,media:n?[]:t.state.media,nextHandle:!n&&t.state.nextHandle},(function(){return t.getMediaRequest(e)})))})),D()(P()(t),"handleApiError",(function(e){var n;"authorization_required"!==e.code?(null!==(n=e.errors)&&void 0!==n&&n.length&&(e={code:e.errors[0].error,message:e.errors[0].message}),t.props.noticeOperations.createErrorNotice("internal_server_error"===e.code?"Internal server error":e.message),t.setState({isLoading:!1,isCopying:!1})):t.setState({isAuthenticated:!1,isLoading:!1,isCopying:!1})})),D()(P()(t),"getMediaRequest",(function(e){var n=t.state,r=n.nextHandle,a=n.media;if(!1===r&&a.length>0)t.setState({isLoading:!1});else{var o=t.getRequestUrl(e);t.setAuthenticated(!0),l()({path:o,method:"GET",parse:void 0===window.wpcomFetch}).then((function(e){t.setState({account:e.meta.account,media:t.mergeMedia(a,e.media),nextHandle:e.meta.next_page,isLoading:!1})})).catch(t.handleApiError)}})),D()(P()(t),"copyMedia",(function(e,n,r){var a;t.setState({isCopying:e}),t.props.noticeOperations.removeAllNotices(),t.modalElement&&t.modalElement.focus(),l()({path:n,method:"POST",data:{external_ids:e.map((function(e){return e.guid})),media:e.map((function(e){return{guid:e.guid,caption:e.caption,title:e.title}})),service:r,post_id:null!==(a=t.props.postId)&&void 0!==a?a:0}}).then((function(e){e.media&&(e=e.media.map((function(e){return{alt:e.alt,caption:e.caption,id:e.ID,type:"image",url:e.URL}})));var n=t.props,r=n.value,a=n.addToGallery,o=n.multiple?e:e[0],c=e.find((function(e){return e.errors}));if(c){var i=c.errors,l=Object.keys(i)[0];t.handleApiError({code:l,message:i[l]})}else t.props.onClose(),t.props.onSelect(a?r.concat(e):o)})).catch(t.handleApiError)})),D()(P()(t),"onChangePath",(function(e,n){t.setState({path:e},n)})),t.defaultAccount={image:"",name:""},t.state={account:t.defaultAccount,media:[],nextHandle:!1,isLoading:!1,isCopying:null,isAuthenticated:!0,path:{ID:K}},t}return A()(r,[{key:"mergeMedia",value:function(e,t){return Object(F.uniqBy)(e.concat(t),"ID")}},{key:"getRequestUrl",value:function(e){var t=this.state.nextHandle;return t?e+"&page_handle="+encodeURIComponent(t):e}},{key:"render",value:function(){var t=this.state,n=t.account,r=t.isAuthenticated,a=t.isCopying,o=t.isLoading,c=t.media,i=t.nextHandle,l=t.path,s=this.props,p=s.allowedTypes,d=s.multiple,m=void 0!==d&&d,b=s.noticeUI,h=s.onClose,f=a?Object(u.__)("Inserting media","jetpack"):Object(u.__)("Select media","jetpack"),g=a?Object(u.__)("When the media is finished copying and inserting, you will be returned to the editor.","jetpack"):Object(u.__)("Select the media you would like to insert into the editor.","jetpack"),j="jetpack-external-media-browser__description",v=U()({"jetpack-external-media-browser":!0,"jetpack-external-media-browser--is-copying":a});return Object(O.createElement)(G.Modal,{onRequestClose:h,title:f,aria:{describedby:j},className:v},Object(O.createElement)("div",{ref:this.contentRef},b,Object(O.createElement)("p",{id:j,className:"jetpack-external-media-browser--visually-hidden"},g),Object(O.createElement)(e,{account:n,getMedia:this.getMedia,copyMedia:this.copyMedia,isCopying:a,isLoading:o,media:c,pageHandle:i,allowedTypes:p,isAuthenticated:r,setAuthenticated:this.setAuthenticated,multiple:m,path:l,onChangePath:this.onChangePath})))}}]),r}(O.Component);return Object(s.withSelect)((function(e){return{postId:e("core/editor").getCurrentPostId()}}))(Object(G.withNotices)(t))}))}var se=n(110),ue=function(e,t){var n,r=new se.a;r.open(e,null,"toolbar=0,location=0,status=0,menubar=0,"+r.getScreenCenterSpecs(780,700)),r.once("close",(function(){var e={};n&&n.keyring_id&&(e.keyring_id=Number(n.keyring_id),e.id_token=n.id_token,e.user=n.user),t(e)})),r.on("message",(function(e){return n=e}))},pe=n(27),de={list:"/wpcom/v2/external-media/list/",copy:Object(m.c)()?"/rest/v1.1/external-media-upload?service=":"/wpcom/v2/external-media/copy/",connection:"/wpcom/v2/external-media/connection/"};function me(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de[e]?Object(pe.addQueryArgs)(de[e]+t,n):null}var be=Object(O.memo)((function(){return Object(O.createElement)(O.Fragment,null,Object(O.createElement)(C.e,null),Object(O.createElement)("p",null,Object(u.__)("To show your Google Photos library you need to connect your Google account.","jetpack")),Object(O.createElement)("p",null,Object(u.__)("You can remove the connection in either of these places:","jetpack")),Object(O.createElement)("ul",null,Object(O.createElement)("li",null,Object(O.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://myaccount.google.com/security"},Object(u.__)("Google Security page","jetpack"))),Object(O.createElement)("li",null,Object(O.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://wordpress.com/marketing/connections/"},Object(u.__)("WordPress.com Connections","jetpack")))))}));var he=Object(O.memo)((function(){return Object(O.createElement)("p",null,Object(u.__)("Awaiting authorization","jetpack"))}));var fe=function(e){var t=e.setAuthenticated,n=Object(O.useState)(!1),r=w()(n,2),a=r[0],o=r[1],c=Object(O.useCallback)((function(){o(!0),l()({path:me("connection",W)}).then((function(e){if(e.error)throw e.message;ue(e.connect_URL,(function(){o(!1),t(!0)}))})).catch((function(){o(!1)}))}),[t]);return Object(O.createElement)("div",{className:"jetpack-external-media-auth"},a?Object(O.createElement)(he,null):Object(O.createElement)(be,null),Object(O.createElement)(G.Button,{isPrimary:!0,disabled:a,onClick:c},Object(u.__)("Authorize","jetpack")))};var ge=Object(O.memo)((function(){var e="jetpack-external-media-browser__media__item jetpack-external-media-browser__media__placeholder";return Object(O.createElement)(O.Fragment,null,Object(O.createElement)("div",{className:e}),Object(O.createElement)("div",{className:e}),Object(O.createElement)("div",{className:e}))}));var je=function(e){var t=e.item,n=e.focus,r=e.isSelected,a=e.isCopying,o=void 0!==a&&a,c=t.thumbnails,i=t.caption,l=t.name,s=t.title,p=t.type,d=t.children,m=void 0===d?0:d,b=c.medium,h=void 0===b?null:b,f=c.fmt_hd,g=void 0===f?null:f,j=s||i||l,v=U()({"jetpack-external-media-browser__media__item":!0,"jetpack-external-media-browser__media__item__selected":r,"jetpack-external-media-browser__media__folder":"folder"===p,"is-transient":o}),k=Object(O.useRef)(null);return Object(O.useEffect)((function(){n&&k.current.focus()}),[n]),Object(O.createElement)("li",{ref:k,className:v,onClick:o?void 0:function(t){var n=e.item,r=e.index;e.onClick&&e.onClick(t,{item:n,index:r})},onKeyDown:o?void 0:function(t){var n=e.item,r=e.index;e.onKeyDown&&e.onKeyDown(t,{item:n,index:r})},role:"checkbox",tabIndex:"0","aria-checked":!!r,"aria-disabled":!!o},r&&o&&Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator"},Object(O.createElement)(G.Spinner,null),Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator__label"},Object(u.__)("Inserting Image…","jetpack"))),Object(O.createElement)("img",{src:h||g,alt:j}),"folder"===p&&Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__info"},Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__name"},l),Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__count"},m)))},ve=Object(O.memo)((function(){return Object(O.createElement)("div",{className:"jetpack-external-media-browser__empty"},Object(O.createElement)("p",null,Object(u.__)("Sorry, but nothing matched your search criteria.","jetpack")))}));var Oe=function(e){var t=e.media,n=e.isCopying,r=e.isLoading,a=e.pageHandle,o=e.className,c=e.multiple,i=e.setPath,l=e.nextPage,s=e.onCopy,p=Object(O.useState)([]),d=w()(p,2),m=d[0],b=d[1],h=Object(O.useState)(-1),f=w()(h,2),g=f[0],j=f[1],v=Object(O.useRef)(-1),k=Object(O.useRef)(null),_=Object(O.useCallback)((function(e){var t=[e];"folder"===e.type?i(e.ID):c?(t=m.slice(0,9).concat(e),m.find((function(t){return e.ID===t.ID}))&&(t=m.filter((function(t){return t.ID!==e.ID})))):1===m.length&&e.ID===m[0].ID&&(t=[]),b(t)}),[m,c,i]),y=Object(O.useCallback)((function(){s(m)}),[m,s]),E=t.filter((function(e){return"folder"!==e.type})).length>0,C=U()({"jetpack-external-media-browser__media":!0,"jetpack-external-media-browser__media__loading":r}),x=U()(D()({"jetpack-external-media-browser":!0},o,!0)),S=function(){var e=1,t=k.current.children;if(t.length>0)for(var n=t[0].offsetTop;e<t.length&&t[e].offsetTop===n;)++e;v.current=e},N=Object(F.debounce)(S,400);Object(O.useEffect)((function(){return window.addEventListener("resize",N),function(){window.removeEventListener("resize",N)}}),[]),Object(O.useEffect)((function(){t.length&&-1===v.current&&S()}),[t]);var A=function(e,t){var n=t.item;_(n)},T=function(e,n){var r=n.item,a=n.index;[H.LEFT,H.RIGHT,H.UP,H.DOWN].includes(e.keyCode)?function(e,n){switch(e){case H.LEFT:n>=1&&j(n-1);break;case H.RIGHT:n<t.length&&j(n+1);break;case H.UP:n>=v.current&&j(n-v.current);break;case H.DOWN:n<t.length-v.current&&j(n+v.current)}}(e.keyCode,a):H.SPACE===e.keyCode?(_(r),e.preventDefault()):H.ENTER===e.keyCode&&_(r),[H.LEFT,H.RIGHT,H.UP,H.DOWN,H.SPACE,H.ENTER].includes(e.keyCode)&&e.stopPropagation()};return Object(O.createElement)("div",{className:x},Object(O.createElement)("ul",{ref:k,className:C},t.map((function(e,t){return Object(O.createElement)(je,{item:e,index:t,key:e.ID,onClick:A,onKeyDown:T,focus:t===g,isSelected:m.find((function(t){return t.ID===e.ID})),isCopying:n})})),0===t.length&&!r&&Object(O.createElement)(ve,null),r&&Object(O.createElement)(ge,null),a&&!r&&Object(O.createElement)(G.Button,{isSecondary:!0,className:"jetpack-external-media-browser__loadmore",disabled:r||n,onClick:function(){t.length&&j(t.length),l()}},Object(u.__)("Load More","jetpack"))),E&&Object(O.createElement)((function(){var e=0===m.length||n,t=n?Object(u.__)("Inserting…","jetpack"):Object(u.__)("Select","jetpack");return Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__toolbar"},Object(O.createElement)(G.Button,{isPrimary:!0,isBusy:n,disabled:e,onClick:y},t))}),null))},ke=n(111);function _e(e){var t=e.value,n=e.updateFilter;return Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Category","jetpack"),value:t,options:J,onChange:n})}function ye(e){var t=e.value,n=e.updateFilter,r=(null==t?void 0:t.range)||Q,a=Object(O.useState)(-1),o=w()(a,2),c=o[0],i=o[1],l=Object(O.useState)(ce),s=w()(l,2),p=s[0],d=s[1];return Object(O.createElement)("div",{className:"jetpack-external-media-date-filter"},Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Filter by time period","jetpack"),value:r,options:oe,onChange:function(e){return n({range:e})}}),r===ae&&Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Month","jetpack"),value:c,options:ie,onChange:i}),Object(O.createElement)(ke.a,{className:"components-base-control",label:Object(u.__)("Year","jetpack"),value:p,min:1970,onChange:d}),Object(O.createElement)(G.Button,{isSecondary:!0,disabled:(null==t?void 0:t.month)===c&&(null==t?void 0:t.year)===p,onClick:function(){n({range:r,month:c,year:p})}},Object(u.__)("Apply","jetpack"))))}function Ee(){return Object(O.createElement)("span",null,Object(u.__)("Favorites","jetpack"))}function we(e){var t=e.value,n=e.updateFilter,r=[{label:Object(u.__)("All","jetpack"),value:""},{label:Object(u.__)("Images","jetpack"),value:"photo"},{label:Object(u.__)("Videos","jetpack"),value:"video"}];return Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Type","jetpack"),value:t,options:r,onChange:n})}function Ce(e){var t=e.children,n=e.removeFilter,r=e.isRemovable,a=void 0!==r&&r;return Object(O.createElement)("div",{className:"jetpack-external-media-googlephotos-filter"},t,!!a&&Object(O.createElement)(G.Button,{onClick:n,isSmall:!0},Object(u.__)("Remove Filter","jetpack")))}var xe=function(e){var t=e.filters,n=e.setFilters,r=e.canChangeMedia,o=Object.keys(t).filter((function(e){return r||"mediaType"!==e})).map((function(e){return Object(O.createElement)(Ce,{key:e,removeFilter:function(){return n(Object(F.omit)(t,e))}},(r=e,o=t[e],c=function(r){return n(function(e,t,n){var r=a()(a()({},e),{},D()({},t,n));return"mediaType"===t&&"video"===n?delete r.category:"category"===t&&"video"===r.mediaType&&delete r.mediaType,r}(t,e,r))},"category"===r?Object(O.createElement)(_e,{value:o,updateFilter:c}):"date"===r?Object(O.createElement)(ye,{value:o,updateFilter:c}):"favorite"===r?Object(O.createElement)(Ee,{value:o}):"mediaType"===r?Object(O.createElement)(we,{value:o,updateFilter:c}):null));var r,o,c}));return 0===o.length?null:o},Se=[{label:Object(u.__)("Category","jetpack"),value:"category"},{label:Object(u.__)("Date","jetpack"),value:"date"},{label:Object(u.__)("Favorites","jetpack"),value:"favorite"},{label:Object(u.__)("Media Type","jetpack"),value:"mediaType"}];function Ne(e){return Se.filter((function(t){return void 0===e[t.value]}))}function Ae(e){var t=Ne(e);return t.length>0?t[0].value:""}var Te=function(e){var t=Object(O.useState)(Ae([])),n=w()(t,2),r=n[0],o=n[1],c=e.isLoading,i=e.isCopying,l=e.filters,s=e.canChangeMedia,p=function(e,t){return t?e:e.filter((function(e){return"mediaType"!==e.value}))}(Ne(l),s);return 0===p.length?null:Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Filters","jetpack"),value:r,disabled:c||i,options:p,onChange:o}),Object(O.createElement)(G.Button,{disabled:c||i,isSecondary:!0,isSmall:!0,onClick:function(){var t,n,c=(t=l,n=r,a()(a()({},t),{},D()({},n,"favorite"===n||"")));e.setFilters(c),o(Ae(c))}},Object(u.__)("Add Filter","jetpack")))},Pe=function(e){var t=e.setAuthenticated,n=Object(O.useState)(!1),r=w()(n,2),a=r[0],o=r[1],c=Object(O.useCallback)((function(){o(!0),l()({method:"DELETE",path:me("connection",W)}).then((function(){return t(!1)})).catch((function(){return o(!1)}))}),[t]);return Object(O.createElement)(G.Button,{isSecondary:!0,className:"jetpack-external-media-browser__disconnect",onClick:c,disabled:a,isBusy:a},Object(u.__)("Disconnect from Google Photos","jetpack"))},Ie=function(e){var t=e.account,n=e.setAuthenticated,r=t||{},a=r.image,o=r.name;return Object(O.createElement)("div",{className:"jetpack-external-media-header__account"},Object(O.createElement)("div",{className:"jetpack-external-media-header__account-info"},a&&Object(O.createElement)("img",{className:"jetpack-external-media-header__account-image",src:a,alt:"",height:"18",width:"18"}),o&&Object(O.createElement)("div",{className:"jetpack-external-media-header__account-name"},o)),Object(O.createElement)(Pe,{setAuthenticated:n}))};var Me=Object(O.memo)((function(e){var t=e.path,n=e.setPath;return Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.Button,{isTertiary:!0,onClick:function(){return n(Z)}},Object(u.__)("Albums","jetpack")),"→ ",t.name)})),Re=n(54),Be=n.n(Re),Le=Be()();var De=function(e){var t,n=e.account,r=e.allowedTypes,a=e.copyMedia,o=e.getMedia,c=e.isCopying,i=e.isLoading,l=e.media,s=e.multiple,p=e.onChangePath,d=e.pageHandle,m=e.path,b=e.setAuthenticated,h=e.showAdditionalFilters,f=void 0!==h&&h,g=(t=r)&&1===t.length&&"image"===t[0],j=Object(O.useState)(g?{mediaType:"photo",date:{range:Q}}:{date:{range:Q}}),v=w()(j,2),k=v[0],_=v[1],y=Object(O.useRef)(""),E=Object(O.useRef)(""),C=m.ID===K?function(e){var t=e.mediaType,n=e.category,r=e.favorite,a=e.date,o=[];if(t&&o.push("mediaType="+t),n&&"video"!==t&&o.push("categoryInclude="+n),void 0!==r&&o.push("feature=favorite"),a){var c=null,i=null;switch(a.range){case ee:c=Be()(Le).subtract(7,"days"),i=Le;break;case te:c=Be()(Le).subtract(30,"days"),i=Le;break;case ne:c=Be()(Le).subtract(6,"months"),i=Le;break;case re:c=Be()(Le).subtract(1,"year"),i=Le;break;case ae:var l=parseInt(a.month),s=parseInt(a.year);isNaN(l)||isNaN(s)||(-1===l?(c=Be()([s,0]),i=Be()(c).endOf("year")):(c=Be()([s,l]),i=Be()(c).endOf("month")))}var u=c?c.format("YYYY-MM-DD"):"0000-00-00",p=i?i.format("YYYY-MM-DD"):"0000-00-00";o.push("dateRange=".concat(u,":").concat(p))}return o.length>0?o:null}(k):null,x={number:20,path:m.ID};C&&(x.filter=C);var S=me("list",W,x),N=Object(O.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o(S,t)}),[o,S]),A=Object(O.useCallback)((function(e){var t=l.find((function(t){return t.ID===e}));E.current=m,p(t||{ID:e})}),[l,p,E,m]),T=Object(O.useCallback)((function(e){a(e,me("copy",W),W)}),[a]);return Object(O.useEffect)((function(){y!==S&&(y.current=S,N({},m!==E.current))}),[y,S,N,m]),Object(O.createElement)("div",{className:"jetpack-external-media-wrapper__google"},Object(O.createElement)("div",{className:"jetpack-external-media-header__view"},Object(O.createElement)(G.SelectControl,{className:"jetpack-external-media-header__select",label:Object(u.__)("View","jetpack"),value:m.ID!==K?Z:K,disabled:i||c,options:Y,onChange:A}),f&&m.ID===K&&Object(O.createElement)(Te,{filters:k,isLoading:i,setFilters:_,canChangeMedia:!g}),Object(O.createElement)("div",{className:"jetpack-external-media-header__filter"},m.ID===K&&Object(O.createElement)(xe,{filters:k,isLoading:i,setFilters:_,canChangeMedia:!g}),m.ID!==K&&m.ID!==Z&&Object(O.createElement)(Me,{path:m,setPath:A})),(!i||l.length>0)&&Object(O.createElement)(Ie,{account:n,setAuthenticated:b})),Object(O.createElement)(Oe,{className:"jetpack-external-media-browser__google",key:S,media:l,isCopying:c,isLoading:i,nextPage:N,onCopy:T,pageHandle:d,multiple:s,setPath:A}))};var Fe=le()((function(e){return e.isAuthenticated?Object(O.createElement)(De,e):Object(O.createElement)(fe,e)}));var ze=le()((function(e){var t=e.media,n=e.isCopying,r=e.isLoading,a=e.pageHandle,o=e.multiple,c=e.copyMedia,i=e.getMedia,l=Object(O.useState)(Object(F.sample)(X)),s=w()(l,2),p=s[0],d=s[1],m=Object(O.useState)(""),b=w()(m,2),h=b[0],f=b[1],g=Object(O.useCallback)((function(e){c(e,me("copy",$),$)}),[c]),j=Object(O.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p&&i(me("list",$,{number:20,path:"recent",search:p}),t)}),[i,p]),v=Object(O.useRef)(),k=Object(O.useCallback)((function(e){e.preventDefault(),f(p),j(e,!0),v.current=p}),[j,p]);Object(O.useEffect)(j,[j]);var _=Object(O.useRef)(null);return Object(O.useEffect)((function(){if(_.current){var e=Array.from(_.current.elements).find((function(e){return"search"===e.type}));e&&(e.focus(),e.select())}}),[]),Object(O.createElement)("div",{className:"jetpack-external-media-wrapper__pexels"},Object(O.createElement)("form",{ref:_,className:"jetpack-external-media-header__pexels",onSubmit:k},Object(O.createElement)(G.TextControl,{"aria-label":Object(u.__)("Search","jetpack"),type:"search",value:p,onChange:d,disabled:!!n}),Object(O.createElement)(G.Button,{isPrimary:!0,onClick:k,type:"submit",disabled:!p.length||p===v.current||n},Object(u.__)("Search","jetpack"))),Object(O.createElement)(Oe,{key:h,className:"jetpack-external-media-browser__pexels",media:t,isCopying:n,isLoading:r,nextPage:j,onCopy:g,pageHandle:a,multiple:o}))})),Ue=[{id:W,label:Object(u.__)("Google Photos","jetpack"),icon:Object(O.createElement)(C.d,{className:"components-menu-items__item-icon"}),keyword:"google photos"},{id:$,label:Object(u.__)("Pexels Free Photos","jetpack"),icon:Object(O.createElement)(C.h,{className:"components-menu-items__item-icon"}),keyword:"pexels"}];var Ve=n(59),Ge=Object(O.createElement)(Ve.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(O.createElement)(Ve.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var He=function(e){var t=e.originalButton,n=void 0===t?null:t,r=e.onClick,a=void 0===r?function(){}:r,o=e.open,c=e.setSource;return Object(O.createElement)(O.Fragment,null,n&&n({open:o}),Ue.map((function(e){var t=e.icon,n=e.id,r=e.label;return Object(O.createElement)(G.MenuItem,{icon:t,key:n,onClick:function(){a(),c(n)}},r)})))};var qe=function(e){var t=e.mediaProps,n=e.open,r=e.setSelectedSource,a=e.isFeatured,o=e.isReplace,c=e.hasImage,i=t.render,l=a,s=!1,p=!a;if(o)return Object(O.createElement)(He,{originalButton:i,open:n,setSource:r});var d=Object(u.__)("Select Image","jetpack");return t.multiple&&(d=Object(u.__)("Select Images","jetpack")),t.allowedTypes.length>1&&(d=Object(u.__)("Select Media","jetpack")),a&&(d=Object(u.__)("Replace Image","jetpack"),l=!1,p=!1,s=!0),Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.Dropdown,{position:"bottom right",contentClassName:"jetpack-external-media-button-menu__options",renderToggle:function(e){var t=e.isOpen,n=e.onToggle,r=i&&i({open:n});return a&&c||r&&"string"!=typeof r.props.children?r:Object(O.createElement)(G.Button,{isPrimary:l,isSecondary:s,isTertiary:p,className:"jetpack-external-media-button-menu","aria-haspopup":"true","aria-expanded":t,onClick:n},d)},renderContent:function(e){var t=e.onClose;return Object(O.createElement)(G.NavigableMenu,{"aria-label":d},Object(O.createElement)(G.MenuGroup,null,Object(O.createElement)(G.MenuItem,{icon:Ge,onClick:function(){t(),n()}},Object(u.__)("Media Library","jetpack")),Object(O.createElement)(He,{open:n,setSource:r,onClick:t})))}}))},We=function(e){return e.unstableFeaturedImageFlow||e.modalClass&&-1!==e.modalClass.indexOf("featured-image")},$e=function(e){return void 0===e.multiple&&!We(e)};var Ke=function(e){var t,n=e.mediaProps,r=Object(O.useState)(null),a=w()(r,2),o=a[0],c=a[1],i=(t=o)===$?ze:t===W?Fe:null;return Object(O.createElement)("div",{onClick:function(e){return e.stopPropagation()}},Object(O.createElement)(qe,g()({},e,{setSelectedSource:c,isReplace:$e(n),isFeatured:We(n),hasImage:n.value>0})),i&&Object(O.createElement)(i,g()({onClose:function(e){e&&(e.stopPropagation(),e.target.closest(".jetpack-external-media-header__dropdown"))||c(null)}},n)))};n(256);if(Object(y.a)()&&"function"==typeof _.useBlockEditContext){Object(k.addFilter)("editor.MediaUpload","external-media/replace-media-upload",(function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=t.render;if(function(e,t){return["core/cover","core/image","core/gallery","core/media-text","jetpack/image-compare","jetpack/slideshow","jetpack/story","jetpack/tiled-gallery"].indexOf(e)>-1&&-1===t.toString().indexOf("coblocks")}(n,r)||function(e){return e.unstableFeaturedImageFlow||e.modalClass&&e.modalClass.indexOf("featured-image")>-1}(t)){var a=t.allowedTypes,o=t.gallery,c=void 0!==o&&o,i=t.value,l=void 0===i?[]:i;a.indexOf("image")>-1&&!(c&&l.length>0)&&(r=function(e){return Object(O.createElement)(Ke,g()({},e,{mediaProps:t}))})}return Object(O.createElement)(e,g()({},t,{render:r}))}}),100),Object(k.addFilter)("blocks.registerBlockType","external-media/individual-blocks",(function(e,t){return"core/image"!==t?e:a()(a()({},e),{},{keywords:[].concat(v()(e.keywords),v()(Ue.map((function(e){return e.keyword}))))})}))}var Ze=n(16),Ye={name:"facebook",title:"Facebook",icon:{src:"facebook",foreground:Object(Ze.a)()},keywords:[Object(u._x)("social","block search term","jetpack")],description:Object(u.__)("Embed a Facebook post.","jetpack"),patterns:[/^https?:\/\/www\.facebook.com\/.+/i],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}};Object(k.addFilter)("blocks.registerBlockType","reactivateFacebookEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations)return e;var n=e.variations.filter((function(e){return e.name!==Ye.name}));return e.variations=[].concat(v()(n),[Ye]),e}));var Je=n(46);var Xe={name:"instagram",title:"Instagram",icon:{src:"instagram",foreground:Object(Ze.a)()},keywords:[Object(u._x)("image","block search term","jetpack"),Object(u._x)("social","block search term","jetpack")],description:Object(u.__)("Embed an Instagram post.","jetpack"),patterns:[/^https?:\/\/(www\.)?instagr(\.am|am\.com)\/.+/i],attributes:{providerNameSlug:"instagram",responsive:!0}};Object(k.addFilter)("blocks.registerBlockType","reactivateInstagramEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations||!Object(F.get)(Object(Je.a)(),["jetpack","is_active"],!1))return e;var n=e.variations.filter((function(e){return e.name!==Xe.name}));return e.variations=[].concat(v()(n),[Xe]),e}));var Qe=n(11),et={name:"loom",title:"Loom",icon:C.g,keywords:[Object(u.__)("video","jetpack")],description:Object(u.__)("Embed a Loom video.","jetpack"),patterns:[/^https?:\/\/(www\.)?loom\.com\/share\/.+/i],attributes:{providerNameSlug:"loom",responsive:!0}};Object(Qe.registerBlockVariation)("core/embed",et);var tt=n(57),nt=n.n(tt),rt=n(41),at=n(122),ot=(n(258),function(e){var t=e.align,n=e.className,r=e.title,a=e.description,o=e.buttonText,c=e.visible,i=void 0===c||c,l=e.context,s=e.checkoutUrl,p=e.goToCheckoutPage,d=e.isRedirecting,m=void 0!==d&&d,b=U()(n,"jetpack-upgrade-plan-banner",{"wp-block":"editor-canvas"===l,"block-editor-block-list__block":"editor-canvas"===l,"jetpack-upgrade-plan__hidden":!i}),h=Object(u.__)("Redirecting…","jetpack");return Object(O.createElement)("div",{className:b,"data-align":t},Object(O.createElement)("div",{className:"jetpack-upgrade-plan-banner__wrapper"},r&&Object(O.createElement)("strong",{className:U()("banner-title",D()({},"".concat(n,"__title"),n))},r),a&&Object(O.createElement)("span",{className:"".concat(n,"__description banner-description")},a),Object(O.createElement)(G.Button,{href:m?null:s,onClick:p,target:"_top",className:U()("is-primary",{"jetpack-upgrade-plan__hidden":!s}),isBusy:m},m?h:o)))}),ct=Object(u.__)("Premium Block","jetpack"),it=Object(u.__)("Upgrade your plan to use this premium block","jetpack"),lt=Object(u.__)("Upgrade","jetpack"),st=function(e){var t=e.onRedirect,n=e.align,r=e.className,a=e.title,o=void 0===a?ct:a,c=e.description,i=void 0===c?it:c,l=e.buttonText,s=void 0===l?lt:l,u=e.visible,p=void 0===u||u,d=e.requiredPlan,m=e.context,b=Object(at.a)(d,t),h=w()(b,3),f=h[0],g=h[1],j=h[2];return Object(O.createElement)(ot,{align:n,buttonText:s,checkoutUrl:f,className:r,context:m,description:i,goToCheckoutPage:g,isRedirecting:j,title:o,visible:p})},ut=Object(O.createContext)(),pt=function(e){var t=e.onBannerVisibilityChange,n=e.onChildBannerVisibilityChange,r=e.hasParentBanner,a=e.children;return Object(O.createElement)(ut.Provider,{value:{onBannerVisibilityChange:t,onChildBannerVisibilityChange:n,hasParentBanner:r},children:a})},dt=n(62),mt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n,r=t||{},a=r.name,o=r.className,c=r.clientId,i=r.isSelected,l=r.attributes,u=r.setAttributes,p=Object(O.useContext)(ut)||{},d=p.onChildBannerVisibilityChange,m=p.hasParentBanner,b=Object(rt.a)(a);if(!b)return Object(O.createElement)(e,t);var h=Object(rt.d)(a),f=Object(rt.c)(a),j=Object(O.useState)(!h),v=w()(j,2),k=v[0],_=v[1],y=Object(O.useState)(!1),E=w()(y,2),C=E[0],x=E[1],S=Object(O.useState)(!1),N=w()(S,2),A=N[0],T=N[1],P="editor-canvas",I=Object(s.useSelect)((function(e){return e("core/block-editor").hasSelectedInnerBlock(c,!0)}),[]),M=(i||I)&&k&&!A,R=Object(O.useMemo)((function(){return{plan:b,blockName:a,context:P}}),[b,a,P]);Object(O.useEffect)((function(){M&&x(!0)}),[M,x]),Object(O.useEffect)((function(){!C&&M&&function(e){var t=e.plan,n=e.blockName,r=e.context;dt.a.tracks.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:t,block:n,context:r})}(R)}),[C,R,M]),Object(O.useEffect)((function(){return _(!h)}),[l,_,h]),Object(O.useEffect)((function(){u({shouldDisplayFrontendBanner:!m})}),[u,m]),Object(O.useEffect)((function(){d&&d(M||A)}),[M,A,d]);var B=U()(o,{"is-upgradable":M});return Object(O.createElement)(pt,{onBannerVisibilityChange:_,onChildBannerVisibilityChange:T,hasParentBanner:!0},Object(O.createElement)(st,{className:"is-".concat(t.name.replace(/\//,"-"),"-paid-block"),title:null,align:null==t||null===(n=t.attributes)||void 0===n?void 0:n.align,visible:M,description:null==f?void 0:f.description,requiredPlan:b,context:P,onRedirect:function(){return function(e){var t=e.plan,n=e.blockName,r=e.context;dt.a.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:t,block:n,context:r})}(R)}}),Object(O.createElement)(e,g()({},t,{className:B})))}}),"withUpgradeBanner"),bt=n(121);n(259);function ht(){return Object(F.get)(Object(Je.a)(),["allowedMimeTypes"],[])}function ft(e,t){if(!e||!t)return!1;if(!ht())return!1;var n,r,a=(n=t)?Object(F.pickBy)(ht(),(function(e){return Object(F.startsWith)(e,"".concat(n,"/"))})):{},o=(r=a)?Object(F.flatten)(Object(F.map)(Object(F.keys)(r),(function(e){return e.split("|")}))):[];if("string"==typeof e){var c=e.split(".").pop();return c&&o.includes(c)}return"object"==typeof e&&(e.type&&Object(F.values)(a).includes(e.type))}var gt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=Object(rt.c)(n);if(null==r||!r.mediaPlaceholder||!Object(rt.e)(n))return Object(O.createElement)(e,t);var a=r.fileType,o=t.onError,c=Object(O.useContext)(ut).onBannerVisibilityChange,i=Object(O.useCallback)((function(e){return c((null==e?void 0:e.length)&&ft(e[0],a))}),[a,c]),l=Object(O.useCallback)((function(e){var t,n,r=null==e||null===(t=e[0])||void 0===t||null===(n=t.props)||void 0===n?void 0:n.children;return ft(r,a)?i([r]):o(e)}),[i,a,o]);return Object(O.createElement)("div",{className:"paid-block-media-placeholder"},Object(O.createElement)(e,g()({},t,{onFilesPreUpload:i,onError:l})))}}),"withMediaPlaceholderUpgradable"),jt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=Object(rt.c)(n),a=Object(O.useRef)();if(null==r||!r.mediaReplaceFlow||!Object(rt.e)(n))return Object(O.createElement)(e,t);var o=r.fileType,c=Object(O.useContext)(ut).onBannerVisibilityChange;return Object(O.createElement)(e,g()({},t,{onFilesUpload:function(e){a.current=null!=e&&e.length?e[0]:null,c((null==e?void 0:e.length)&&ft(e[0],o))},createNotice:function(e,n,r){if(ft(a.current,o))return a.current=null,null;t.createNotice(e,n,r)}}))}}),"withMediaReplaceFlowUpgradable"),vt=[];Object(k.addFilter)("blocks.registerBlockType","jetpack/paid-block",(function(e,t){return Object(rt.e)(t)&&(vt.includes(t)||vt.push(t),e.keywords=Object(F.uniq)([].concat(v()(e.keywords),["premium",Object(u.__)("premium","jetpack")])),Object(rt.d)(t)||(e.icon=Object(bt.a)(e.icon)),e.attributes.shouldDisplayFrontendBanner||(e.attributes.shouldDisplayFrontendBanner={type:"boolean",default:!0})),e})),Object(k.addFilter)("editor.BlockListBlock","jetpack/paid-block-with-warning",mt),Object(k.addFilter)("editor.MediaPlaceholder","jetpack/paid-block-media-placeholder",gt),Object(k.addFilter)("editor.MediaReplaceFlow","jetpack/paid-block-media-placeholder",jt),nt()((function(){Object(rt.f)()&&document.body.classList.add("jetpack-enable-upgrade-nudge")}));n(260),n(261),n(241);if("object"==typeof window&&"object"==typeof window.Jetpack_Editor_Initial_State&&"object"==typeof window.Jetpack_Editor_Initial_State.tracksUserData&&void 0!==window.Jetpack_Editor_Initial_State.wpcomBlogId){var Ot=window.Jetpack_Editor_Initial_State.tracksUserData,kt=Ot.userid,_t=Ot.username;dt.a.initialize(kt,_t,{blog_id:window.Jetpack_Editor_Initial_State.wpcomBlogId})}},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(4),o=n.n(a),c=n(0),i=n(1),l=n(11),s=n(2),u=n(6),p=(n(269),n(9)),d=n.n(p),m=n(3),b=n(8),h=n.n(b),f=n(68),g=n.n(f),j=n(17),v=n(10),O=n(24),k=n(50),_=n(23),y=n(25),E=n(16),w=Object(m.compact)([{name:"contact-form",title:Object(i.__)("Contact Form","jetpack"),description:Object(i.__)("Add a contact form to your page.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M21.99 8c0-.72-.37-1.35-.94-1.7l-8.04-4.71c-.62-.37-1.4-.37-2.02 0L2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zm-11.05 4.34l-7.2-4.5 7.25-4.25c.62-.37 1.4-.37 2.02 0l7.25 4.25-7.2 4.5c-.65.4-1.47.4-2.12 0z"}),48,48,"-4 -4 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-textarea",{}],["jetpack/button",{text:Object(i.__)("Contact Us","jetpack"),element:"button"}]]},!Object(_.c)()&&{name:"newsletter-form",title:Object(i.__)("Newsletter Sign-up","jetpack"),description:Object(i.__)("A simple way to collect information from folks visiting your site.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M37.9999 7.59998C49.3999 7.59998 68.3999 26.6 68.3999 26.6V68.4H7.59985V26.6C7.59985 26.6 26.5999 7.59998 37.9999 7.59998ZM64.5999 63.536L50.4259 52.44L64.5999 41.8L62.9659 40.394L54.3779 45.334L55.2899 28.956L21.9639 26.98L20.2159 44.232L12.6539 40.622L11.3999 41.8L25.5739 52.44L12.5019 63.27L14.0219 64.904L37.9999 49.4L62.8139 65.17L64.5999 63.536Z"}),48,48,"-6 -6 92 92"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-consent",{}],["jetpack/button",{text:Object(i.__)("Subscribe","jetpack"),element:"button"}]]},{name:"rsvp-form",title:Object(i.__)("RSVP Form","jetpack"),description:Object(i.__)("Add an RSVP form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M10 9V7.41c0-.89-1.08-1.34-1.71-.71L3.7 11.29c-.39.39-.39 1.02 0 1.41l4.59 4.59c.63.63 1.71.19 1.71-.7V14.9c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:Object(i.__)("Attending?","jetpack"),required:!0,options:[Object(i.__)("Yes","jetpack"),Object(i.__)("No","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Other Details","jetpack")}],["jetpack/button",{text:Object(i.__)("Send RSVP","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new RSVP from your website","jetpack")}},{name:"registration-form",title:Object(i.__)("Registration Form","jetpack"),description:Object(i.__)("Add a Registration form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M11.34 15.02c.39.39 1.02.39 1.41 0l6.36-6.36c.39-.39.39-1.02 0-1.41L14.16 2.3c-.38-.4-1.01-.4-1.4-.01L6.39 8.66c-.39.39-.39 1.02 0 1.41l4.95 4.95zm2.12-10.61L17 7.95l-4.95 4.95-3.54-3.54 4.95-4.95zm6.95 11l-2.12-2.12c-.18-.18-.44-.29-.7-.29h-.27l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2h-.42c-.27 0-.52.11-.71.29l-2.12 2.12c-.37.38-.58.89-.58 1.42V20c0 1.1.9 2 2 2h14c1.1 0 2-.89 2-2v-3.17c0-.53-.21-1.04-.59-1.42z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{label:Object(i.__)("Phone Number","jetpack")}],["jetpack/field-select",{label:Object(i.__)("How did you hear about us?","jetpack"),options:[Object(i.__)("Search Engine","jetpack"),Object(i.__)("Social Media","jetpack"),Object(i.__)("TV","jetpack"),Object(i.__)("Radio","jetpack"),Object(i.__)("Friend or Family","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Other Details","jetpack")}],["jetpack/button",{text:Object(i.__)("Send","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new registration from your website","jetpack")}},{name:"appointment-form",title:Object(i.__)("Appointment Form","jetpack"),description:Object(i.__)("Add an Appointment booking form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V8c0-.55-.45-1-1-1s-1 .45-1 1v2H2c-.55 0-1 .45-1 1s.45 1 1 1h2v2c0 .55.45 1 1 1s1-.45 1-1v-2h2c.55 0 1-.45 1-1s-.45-1-1-1H6zm9 4c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{required:!0}],["jetpack/field-date",{label:Object(i.__)("Date","jetpack"),required:!0}],["jetpack/field-radio",{label:Object(i.__)("Time","jetpack"),required:!0,options:[Object(i.__)("Morning","jetpack"),Object(i.__)("Afternoon","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Notes","jetpack")}],["jetpack/button",{text:Object(i.__)("Book Appointment","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new appointment booked from your website","jetpack")}},{name:"feedback-form",title:Object(i.__)("Feedback Form","jetpack"),description:Object(i.__)("Add a Feedback form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.03 0 3.8-1.11 4.75-2.75.19-.33-.05-.75-.44-.75H7.69c-.38 0-.63.42-.44.75.95 1.64 2.72 2.75 4.75 2.75z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:Object(i.__)("Please rate our website","jetpack"),required:!0,options:[Object(i.__)("1 - Very Bad","jetpack"),Object(i.__)("2 - Poor","jetpack"),Object(i.__)("3 - Average","jetpack"),Object(i.__)("4 - Good","jetpack"),Object(i.__)("5 - Excellent","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("How could we improve?","jetpack")}],["jetpack/button",{text:Object(i.__)("Send Feedback","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("New feedback received from your website","jetpack")}}]),C=n(22),x=n.n(C),S=n(94),N=n.n(S),A=function(e){var t=e.error;return Object(c.createElement)(s.Notice,{isDismissible:!1,status:"error"},Object(c.createInterpolateElement)(Object(i.__)('The CRM Jetpack Form extension failed to activate. The error message was "<error />".',"jetpack"),{error:Object(c.createElement)("span",null,t)}))},T=function(e){var t=e.isActivatingExt,n=e.setIsActivatingExt,r=e.extActivationError,a=function(e,t,n,r){return function(){t(void 0),e(!0),x()({path:"/jetpack/v4/jetpack_crm",method:"POST",data:{extension:"jetpackforms"}}).then((function(e){if("success"!==e.code)throw new Error(e.code);var t=Object.assign({},n);t.jp_form_ext_enabled=!0,r(t)})).catch((function(e){t(e.message)})).finally((function(){e(!1)}))}}(n,e.setExtActivationError,e.crmData,e.setCRMData);return t?Object(c.createElement)(s.Spinner,null):r?Object(c.createElement)(A,{error:r}):Object(c.createElement)(s.Button,{isSecondary:!0,onClick:a},Object(i.__)("Enable Jetpack Forms Extension","jetpack"))},P=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("A site administrator must enable the CRM Jetpack Forms extension.","jetpack"))},I=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("You can integrate this contact form with Jetpack CRM by enabling Jetpack CRM's Jetpack Forms extension.","jetpack"))},M=function(e){var t=e.isActivatingExt,n=e.setIsActivatingExt,r=e.extActivationError,a=e.setExtActivationError,o=e.crmData,i=e.setCRMData;return o.can_activate_extension?Object(c.createElement)("div",null,Object(c.createElement)(I,null),Object(c.createElement)("br",null),Object(c.createElement)(T,{isActivatingExt:t,setIsActivatingExt:n,extActivationError:r,setExtActivationError:a,crmData:o,setCRMData:i})):Object(c.createElement)(P,null)},R=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),B=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("The Jetpack CRM is installed but has an invalid version.","jetpack"))},L=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("The Zero BS CRM plugin is now Jetpack CRM. Update to the latest version to integrate your contact form with your CRM.","jetpack"))},D=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(c.createInterpolateElement)(Object(i.__)("You can save contacts from Jetpack contact forms in Jetpack CRM. Learn more at <a>jetpackcrm.com</a>","jetpack"),{a:Object(c.createElement)(s.ExternalLink,{href:"https://jetpackcrm.com"})}))},F=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("You already have the Jetpack CRM plugin installed, but it's not activated. Activate the Jetpack CRM plugin to save contacts from this contact form in your Jetpack CRM.","jetpack"))},z=function(e){var t=e.crmData,n=e.setCRMData,r=e.jetpackCRM,a=e.setAttributes,o=Object(c.useState)(!1),l=d()(o,2),u=l[0],p=l[1],m=Object(c.useState)(!1),b=d()(m,2),h=b[0],f=b[1];return t.jp_form_ext_enabled?N.a.satisfies(N.a.coerce(t.crm_version),"3.0.19 - 4.0.0")?Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("Contacts from this form will be stored in Jetpack CRM.","jetpack")):Object(c.createElement)(s.ToggleControl,{className:"jetpack-contact-form__crm_toggle",label:Object(i.__)("Jetpack CRM","jetpack"),checked:r,onChange:function(e){return a({jetpackCRM:e})},help:Object(i.__)("Store contact form submissions in your CRM.","jetpack")}):Object(c.createElement)(M,{isActivatingExt:u,setIsActivatingExt:p,extActivationError:h,setExtActivationError:f,crmData:t,setCRMData:n})},U=function(e){var t=e.crmData,n=e.setCRMData,r=e.jetpackCRM,a=e.setAttributes,o=N.a.coerce(t.crm_version);if(t.crm_installed&&!o)return Object(c.createElement)(B,null);if(t.crm_installed&&N.a.lt(o,"3.0.19"))return Object(c.createElement)(L,null);var i=R.NOT_INSTALLED;return t.crm_active?i=R.ACTIVE:t.crm_installed&&(i=R.INSTALLED),Object(c.createElement)("div",{"aria-live":"polite"},R.ACTIVE===i&&Object(c.createElement)(z,{crmData:t,setCRMData:n,jetpackCRM:r,setAttributes:a}),R.INSTALLED===i&&Object(c.createElement)(F,null),R.NOT_INSTALLED===i&&Object(c.createElement)(D,null))},V=function(e){var t=e.isFetchingCRMData,n=e.hasCRMDataError,r=e.crmData,a=e.setCRMData,o=e.jetpackCRM,i=e.setAttributes;return t?Object(c.createElement)(s.Spinner,null):n?null:Object(c.createElement)(U,{crmData:r,setCRMData:a,jetpackCRM:o,setAttributes:i})},G=function(e){var t=e.jetpackCRM,n=e.setAttributes,r=Object(c.useState)(!0),a=d()(r,2),o=a[0],l=a[1],u=Object(c.useState)(!1),p=d()(u,2),m=p[0],b=p[1],h=Object(c.useState)(),f=d()(h,2),g=f[0],j=f[1];return Object(c.useEffect)((function(){x()({path:"/jetpack/v4/jetpack_crm"}).then((function(e){if(e.error)throw e.message;b(!1),j(e)})).catch((function(){return b(!0)})).finally((function(){return l(!1)}))}),[]),Object(c.createElement)(s.PanelBody,{title:Object(i.__)("CRM Integration","jetpack"),initialOpen:!1},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)(V,{isFetchingCRMData:o,hasCRMDataError:m,crmData:g,setCRMData:j,jetpackCRM:t,setAttributes:n})))},H=n(26),q=n.n(H),W=function(){var e,t,n=(e=Object(v.useSelect)((function(e){return e("core/block-editor").getSelectedBlock()}),[]),t=Object(v.useDispatch)("core/block-editor").insertBlock,{insertConsentBlock:Object(c.useCallback)(q()(regeneratorRuntime.mark((function n(){var r,a,o,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return-1===(a=(null!==(r=e.innerBlocks)&&void 0!==r?r:[]).findIndex((function(e){return"jetpack/button"===e.name})))&&(a=(null!==(o=e.innerBlocks)&&void 0!==o?o:[]).length),n.next=4,Object(l.createBlock)("jetpack/field-consent");case 4:return c=n.sent,n.next=7,t(c,a,e.clientId,!1);case 7:case"end":return n.stop()}}),n)}))),[t,e.clientId,e.innerBlocks])}).insertConsentBlock;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("p",null,Object(i.__)("You’re already collecting email contacts. Why not make sure you have permission to email them too?","jetpack")),Object(c.createElement)(s.Button,{isSecondary:!0,onClick:n,style:{marginBottom:"1em"}},Object(i.__)("Add email permission request","jetpack")),Object(c.createElement)("br",null))},$=function(){var e=Object(v.useSelect)((function(e){return e("core/block-editor").getSelectedBlock()}),[]);return Object(c.useMemo)((function(){return t=e.innerBlocks,n=t.some((function(e){return"jetpack/field-email"===e.name})),r=t.some((function(e){return"jetpack/field-consent"===e.name})),!!n&&!r;var t,n,r}),[e.innerBlocks])?Object(c.createElement)(W,null):null};function K(){return(K=q()(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins"});case 5:return t=e.sent,e.abrupt("return",t);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function Z(_x){return Y.apply(this,arguments)}function Y(){return(Y=q()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins",method:"POST",data:{slug:t,status:"active",source:"block-editor"}});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function J(e){return X.apply(this,arguments)}function X(){return(X=q()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins/".concat(t),method:"POST",data:{status:"active",source:"block-editor"}});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}var Q=function(e){var t=e.error;return Object(c.createElement)(s.Notice,{isDismissible:!1,status:"error"},Object(c.createInterpolateElement)(Object(i.__)("The plugin failed to install. <b /> Please check the <a>plugin information</a> for detailed requirements.","jetpack"),{a:Object(c.createElement)(s.ExternalLink,{href:"https://wordpress.org/plugins/creative-mail-by-constant-contact"}),b:Object(c.createElement)("span",null,t)}))},ee=n(46),te=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),ne=function(e){var t=e.isActivating?Object(i.__)("Activating…","jetpack"):Object(i.__)("Installing…","jetpack");return Object(c.createElement)(s.Button,{isSecondary:!0,icon:Object(c.createElement)(s.Icon,{style:{animation:"rotation 2s infinite linear"},icon:"update"}),disabled:!0,"aria-label":t},t)},re=function(e){var t=e.installAndActivateCreativeMailPlugin,n=e.isInstalling;return Object(c.createElement)("p",null,Object(c.createElement)("em",{style:{color:"rgba(38, 46, 57, 0.7)"}},Object(i.__)("To start sending email campaigns, install the Creative Mail plugin for WordPress.","jetpack"),Object(c.createElement)("br",null),n&&Object(c.createElement)(ne,null),!n&&Object(c.createElement)(s.Button,{isSecondary:!0,onClick:t},Object(i.__)("Install Creative Mail plugin","jetpack"))))},ae=function(e){var t=e.activateCreativeMailPlugin,n=e.isInstalling;return Object(c.createElement)("p",null,Object(c.createElement)("em",null,Object(i.__)("To start sending email campaigns, activate the Creative Mail plugin for WordPress.","jetpack")),Object(c.createElement)("br",null),n&&Object(c.createElement)(ne,{isActivating:!0}),!n&&Object(c.createElement)(s.Button,{isSecondary:!0,onClick:t},Object(i.__)("Activate Creative Mail Plugin","jetpack")))},oe=function(){return Object(c.createElement)("p",null,Object(c.createElement)("em",null,Object(i.__)("You’re all setup for email marketing with Creative Mail.","jetpack"),Object(c.createElement)("br",null),Object(c.createElement)(s.ExternalLink,{href:(e=Object(m.get)(Object(ee.a)(),"adminUrl",!1),"".concat(e,"admin.php?page=creativemail"))},Object(i.__)("Open Creative Mail settings","jetpack"))));var e},ce=function(e){var t=e.pluginState,n=e.onCreativeMailPluginClick,r=e.isInstalling;return Object(c.createElement)("div",{"aria-live":"polite"},te.ACTIVE===t&&Object(c.createElement)(oe,null),te.INSTALLED===t&&Object(c.createElement)(ae,{activateCreativeMailPlugin:function(){return n(J,"creative-mail-by-constant-contact/creative-mail-plugin")},isInstalling:r}),te.NOT_INSTALLED===t&&Object(c.createElement)(re,{installAndActivateCreativeMailPlugin:function(){return n(Z,"creative-mail-by-constant-contact")},isInstalling:r}))},ie="".concat("creative-mail-by-constant-contact/creative-mail-plugin",".php"),le=function(e){var t=e.pluginState,n=e.setPluginState,r=Object(c.useState)(),a=d()(r,2),o=a[0],i=a[1],l=Object(c.useState)(!1),s=d()(l,2),u=s[0],p=function(e,t,n){return Object(c.useCallback)((function(r,a){e(void 0),t(!0),r(a).then((function(){n(te.ACTIVE)})).catch((function(t){e(t)})).finally((function(){return t(!1)}))}),[t,e,n])}(i,s[1],n);return o?Object(c.createElement)(Q,{error:o}):Object(c.createElement)(ce,{pluginState:t,onCreativeMailPluginClick:p,isInstalling:u})},se=function(e){var t=e.isFetchingPlugins,n=e.hasError,r=e.pluginState,a=e.setPluginState;return t?Object(c.createElement)(s.Spinner,null):n?null:Object(c.createElement)(le,{pluginState:r,setPluginState:a})},ue=function(){var e=Object(c.useState)(!0),t=d()(e,2),n=t[0],r=t[1],a=Object(c.useState)(!1),o=d()(a,2),i=o[0],l=o[1],s=Object(c.useState)(te.NOT_INSTALLED),u=d()(s,2),p=u[0],b=u[1];return Object(c.useEffect)((function(){(function(){return K.apply(this,arguments)})().then((function(e){l(!1),Object(m.get)(e,ie)&&(Object(m.get)(e,[ie,"active"])?b(te.ACTIVE):b(te.INSTALLED))})).catch((function(){return l(!0)})).finally((function(){return r(!1)}))}),[b,r,l]),Object(c.createElement)(se,{isFetchingPlugins:n,hasError:i,pluginState:p,setPluginState:b})},pe=function(){return Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Newsletter Integration","jetpack"),initialOpen:!1},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)($,null),Object(c.createElement)(ue,null)))},de=["jetpack/markdown","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/file","core/html","core/separator","core/spacer","core/subhead","core/table","core/verse","core/video"];var me=Object(j.compose)([Object(v.withSelect)((function(e,t){var n=e("core/blocks"),r=n.getBlockType,a=n.getBlockVariations,o=n.getDefaultBlockVariation,c=e("core/block-editor").getBlocks,i=e("core/editor").getEditedPostAttribute,l=e("core"),s=l.getSite,u=l.getUser,p=c(t.clientId),d=i("author"),b=d&&u(d)&&u(d).email,h=i("title");return{blockType:r&&r(t.name),defaultVariation:o&&o(t.name,"block"),variations:a&&a(t.name,"block"),innerBlocks:p,hasInnerBlocks:p.length>0,siteTitle:Object(m.get)(s&&s(),["title"]),postTitle:h,postAuthorEmail:b}})),Object(v.withDispatch)((function(e){var t=e("core/block-editor");return{replaceInnerBlocks:t.replaceInnerBlocks,selectBlock:t.selectBlock}})),j.withInstanceId])((function(e){var t=e.attributes,n=e.setAttributes,r=e.siteTitle,a=e.postTitle,o=e.postAuthorEmail,p=e.hasInnerBlocks,b=e.replaceInnerBlocks,f=e.selectBlock,j=e.clientId,v=e.instanceId,y=e.className,E=e.blockType,C=e.variations,x=e.defaultVariation,S=t.to,N=t.subject,A=t.customThankyou,T=t.customThankyouHeading,P=t.customThankyouMessage,I=t.customThankyouRedirect,M=t.jetpackCRM,R=Object(c.useState)(!1),B=d()(R,2),L=B[0],D=B[1],F=h()(y,"jetpack-contact-form"),z=function e(t){return Object(m.map)(t,(function(t){var n=d()(t,3),r=n[0],a=n[1],o=n[2],c=void 0===o?[]:o;return Object(l.createBlock)(r,a,e(c))}))},U=function(e){e.attributes&&n(e.attributes),e.innerBlocks&&b(j,z(e.innerBlocks)),f(j)};Object(c.useEffect)((function(){p||l.registerBlockVariation||U(w[0])})),Object(c.useEffect)((function(){(void 0===S&&o&&n({to:o}),void 0===N&&void 0!==r&&void 0!==a)&&n({subject:"["+r+"] "+a})}),[S,o,N,r,a,n]);var V=function(e){return 0!==(e=e.trim()).length&&(!g.a.validate(e)&&{email:e})},H=function(e){if(0===e.target.value.length)return D(!1),void n({to:o});var t=e.target.value.split(",").map(V).filter(Boolean);t&&t.length&&D(t)},q=function(e){D(!1),n({to:e.trim()})},W=function(){var e=void 0!==S?S:"",t=void 0!==N?N:"";return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.TextControl,{"aria-describedby":"contact-form-".concat(v,"-email-").concat(L&&L.length>0?"error":"help"),label:Object(i.__)("Email address to send to","jetpack"),placeholder:Object(i.__)("name@example.com","jetpack"),onKeyDown:function(e){"Enter"===event.key&&(e.preventDefault(),e.stopPropagation())},value:e,onBlur:H,onChange:q,help:Object(i.__)("You can enter multiple email addresses separated by commas.","jetpack")}),Object(c.createElement)(k.a,{isError:!0,id:"contact-form-".concat(v,"-email-error")},function(){if(L){if(1===L.length)return L[0]&&L[0].email?Object(i.sprintf)(Object(i.__)("%s is not a valid email address.","jetpack"),L[0].email):L[0];if(2===L.length)return Object(i.sprintf)(Object(i.__)("%1$s and %2$s are not a valid email address.","jetpack"),L[0].email,L[1].email);var e=L.map((function(e){return e.email}));return Object(i.sprintf)(Object(i.__)("%s are not a valid email address.","jetpack"),e.join(", "))}return null}()),Object(c.createElement)(s.TextControl,{label:Object(i.__)("Email subject line","jetpack"),value:t,placeholder:Object(i.__)("Enter a subject","jetpack"),onChange:function(e){return n({subject:e})},help:Object(i.__)("Choose a subject line that you recognize as an email from your website.","jetpack")}),Object(c.createElement)(s.SelectControl,{label:Object(i.__)("On Submission","jetpack"),value:A,options:[{label:Object(i.__)("Show a summary of submitted fields","jetpack"),value:""},{label:Object(i.__)("Show a custom text message","jetpack"),value:"message"},{label:Object(i.__)("Redirect to another webpage","jetpack"),value:"redirect"}],onChange:function(e){return n({customThankyou:e})}}),"redirect"!==A&&Object(c.createElement)(s.TextControl,{label:Object(i.__)("Message Heading","jetpack"),value:T,placeholder:Object(i.__)("Message Sent","jetpack"),onChange:function(e){return n({customThankyouHeading:e})}}),"message"===A&&Object(c.createElement)(s.TextareaControl,{label:Object(i.__)("Message Text","jetpack"),value:P,placeholder:Object(i.__)("Thank you for your submission!","jetpack"),onChange:function(e){return n({customThankyouMessage:e})}}),"redirect"===A&&Object(c.createElement)(s.BaseControl,{label:Object(i.__)("Redirect Address","jetpack"),id:"contact-form-".concat(v,"-thankyou-url")},Object(c.createElement)(u.URLInput,{id:"contact-form-".concat(v,"-thankyou-url"),value:I,className:"jetpack-contact-form__thankyou-redirect-url",onChange:function(e){return n({customThankyouRedirect:e})}})))};return!p&&l.registerBlockVariation?Object(c.createElement)("div",{className:F},Object(c.createElement)(u.__experimentalBlockVariationPicker,{icon:Object(m.get)(E,["icon","src"]),label:Object(m.get)(E,["title"]),instructions:Object(i.__)("Please select which type of form you'd like to add, or create your own using the skip option.","jetpack"),variations:C,allowSkip:!0,onSelect:function(){U(arguments.length>0&&void 0!==arguments[0]?arguments[0]:x)}})):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(u.BlockControls,null,Object(c.createElement)(s.ToolbarGroup,null,Object(c.createElement)(s.ToolbarItem,null,(function(){return Object(c.createElement)(s.Dropdown,{position:"bottom right",className:"jetpack-contact-form-settings-selector",contentClassName:"jetpack-contact-form__popover",renderToggle:function(e){return function(e,t){return Object(c.createElement)(s.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:Object(i.__)("Edit Form Settings","jetpack"),onClick:t,onKeyDown:function(n){e||n.keyCode!==O.DOWN||(n.preventDefault(),n.stopPropagation(),t())},icon:Object(c.createElement)(s.Icon,{icon:"edit"})})}(e.isOpen,e.onToggle)},renderContent:function(){return W()}})})))),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Form Settings","jetpack")},W()),!Object(_.c)()&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(G,{jetpackCRM:M,setAttributes:n}),Object(c.createElement)(pe,null))),Object(c.createElement)("div",{className:F},Object(c.createElement)(u.InnerBlocks,{allowedBlocks:de,templateInsertUpdatesSelection:!1})))})),be={subject:{type:"string"},to:{type:"string"},customThankyou:{type:"string",default:""},customThankyouHeading:{type:"string",default:Object(i.__)("Message Sent","jetpack")},customThankyouMessage:{type:"string",default:""},customThankyouRedirect:{type:"string",default:""},jetpackCRM:{type:"boolean",default:!0}},he=["submit_button_text","has_form_settings_set","submitButtonText","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor","submitButtonClasses","hasFormSettingsSet"],fe=[{attributes:o()({submit_button_text:{type:"string",default:Object(i.__)("Submit","jetpack")},has_form_settings_set:{type:"string",default:null},submitButtonText:{type:"string",default:Object(i.__)("Submit","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"}},be),migrate:function(e,t){var n=Object(m.omit)(e,he),r={text:e.submitButtonText||e.submit_button_text||Object(i.__)("Submit","jetpack"),backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,customBackgroundColor:e.customBackgroundButtonColor,customTextColor:e.customTextButtonColor};return[n,t.concat(Object(l.createBlock)("jetpack/button",o()({element:"button"},r)))]},isEligible:function(e){return!(!e.has_form_settings_set&&!e.hasFormSettingsSet)},save:u.InnerBlocks.Content}],ge=function(e,t,n){var r=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,'="([^"]*)"'),"im"));if(r&&r.length)return r[1];var a=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,"='([^']*)'"),"im"));if(a&&a.length)return a[1];var o=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,"=([^\\s]*)\\s"),"im"));return!(!o||!o.length)&&o[1]},je={root:{},innerBlocks:[]},ve={from:[{type:"raw",priority:1,isMatch:function(e){return!("P"!==e.nodeName||!(/\[contact-form(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[contact-field(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[\/contact-form]/g.test(e.textContent)))},transform:function(e){var t,n,r=e.textContent.replace("<br>","");if(r.includes("[contact-form")&&(je.root={},je.innerBlocks=[],je.root=(n={to:ge("contact-form","to",t=r),subject:ge("contact-form","subject",t),submitButtonText:ge("contact-form","submit_button_text",t)},{blockName:"jetpack/contact-form",attrs:Object(m.pickBy)(n,m.identity)})),r.includes("[contact-field")){var a=r.match(/(\[contact-field[\s\S]*?\/?])/g);a&&a.length>0&&a.forEach((function(e){je.innerBlocks.push(function(e){var t,n,r,a={label:ge("contact-field","label",e),placeholder:ge("contact-field","placeholder",e),required:ge("contact-field","required",e),options:ge("contact-field","options",e)},o=(t=ge("contact-field","type",e),(r={text:"".concat(n="jetpack","/field-text"),url:"".concat(n,"/field-text"),textarea:"".concat(n,"/field-textarea"),radio:"".concat(n,"/field-radio"),checkbox:"".concat(n,"/field-checkbox"),"checkbox-multiple":"".concat(n,"/field-checkbox-multiple"),select:"".concat(n,"/field-select"),email:"".concat(n,"/field-email"),name:"".concat(n,"/field-name"),default:"".concat(n,"/field-text")})[t]?r[t]:r.default);return a.options&&(a.options=a.options.split(",")),Object(l.createBlock)(o,Object(m.pickBy)(a,m.identity))}(e))}))}return!!r.includes("[/contact-form]")&&(je.innerBlocks.push(Object(l.createBlock)("jetpack/button",{element:"button",text:je.root.attrs.submitButtonText||Object(i.__)("Contact Us","jetpack")})),Object(l.createBlock)(je.root.blockName,je.root.attrs,je.innerBlocks))}}]},Oe=n(21),ke=n.n(Oe),_e=n(31),ye=n(47);function Ee(e){var t=e.setAttributes,n=e.width;return Object(c.createElement)(s.BaseControl,{label:Object(i.__)("Field Width","jetpack"),help:Object(i.__)("Adjust the width of the field to include multiple fields on a single line.","jetpack"),className:"jetpack-field-label__width"},Object(c.createElement)(s.ButtonGroup,{"aria-label":Object(i.__)("Field Width","jetpack")},[25,50,75,100].map((function(e){return Object(c.createElement)(s.Button,{key:e,isSmall:!0,isPrimary:e===n,onClick:function(){return t({width:e})}},e,"%")}))))}function we(e){var t=e.setAttributes,n=e.id;return Object(c.createElement)(s.TextControl,{label:Object(i.__)("Unique CSS ID","jetpack"),value:n,onChange:function(e){return t({id:e})},help:Object(i.__)("A unique ID that can be used in CSS or as an anchor.","jetpack")})}var Ce=function(e){var t=e.setAttributes,n=e.width,r=e.id,a=e.required;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(u.BlockControls,null,Object(c.createElement)(s.ToolbarGroup,null,Object(c.createElement)(s.ToolbarButton,{title:Object(i.__)("Required","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{d:"M8.23118 8L16 16M8 16L15.7688 8 M6.5054 11.893L17.6567 11.9415M12.0585 17.6563L12 6.5",stroke:"currentColor"})),onClick:function(){t({required:!a})},className:a?"is-pressed":void 0}))),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Field Settings","jetpack")},Object(c.createElement)(s.ToggleControl,{label:Object(i.__)("Field is required","jetpack"),className:"jetpack-field-label__required",checked:a,onChange:function(e){return t({required:e})},help:Object(i.__)("Does this field have to be completed for the form to be submitted?","jetpack")}),Object(c.createElement)(Ee,{setAttributes:t,width:n}))),Object(c.createElement)(u.InspectorAdvancedControls,null,Object(c.createElement)(we,{setAttributes:t,id:r})))};function xe(e){var t=e.id,n=e.type,r=e.required,a=e.label,o=e.setAttributes,l=e.placeholder,u=e.width;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"jetpack-field"},Object(c.createElement)(ye.a,{required:r,label:a,setAttributes:o}),Object(c.createElement)(s.Disabled,null,Object(c.createElement)(s.TextControl,{type:n,placeholder:l,value:l,onChange:function(e){return o({placeholder:e})},title:Object(i.__)("Set the placeholder text","jetpack")}))),Object(c.createElement)(Ce,{id:t,required:r,width:u,setAttributes:o}))}var Se=Object(j.createHigherOrderComponent)((function(e){return function(t){if(t.name.indexOf("jetpack/field")>-1){var n=t.attributes.width?"jetpack-field__width-"+t.attributes.width:"";return Object(c.createElement)(e,ke()({},t,{className:n}))}return Object(c.createElement)(e,t)}}),"withCustomClassName");function Ne(e){var t=e.id,n=e.required,r=e.label,a=e.setAttributes,o=e.placeholder,l=e.width;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"jetpack-field"},Object(c.createElement)(ye.a,{required:n,label:r,setAttributes:a}),Object(c.createElement)(s.Disabled,null,Object(c.createElement)(s.TextareaControl,{placeholder:o,value:o,onChange:function(e){return a({placeholder:e})},title:Object(i.__)("Set the placeholder text","jetpack")}))),Object(c.createElement)(Ce,{id:t,required:n,setAttributes:a,width:l}))}Object(_e.addFilter)("editor.BlockListBlock","jetpack/contact-form",Se);var Ae=Object(j.withInstanceId)((function(e){var t=e.id,n=e.instanceId,r=e.required,a=e.label,o=e.setAttributes,l=e.width,p=e.defaultValue;return Object(c.createElement)(s.BaseControl,{id:"jetpack-field-checkbox-".concat(n),className:"jetpack-field jetpack-field-checkbox",label:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("input",{className:"jetpack-field-checkbox__checkbox",type:"checkbox",disabled:!0,checked:p}),Object(c.createElement)(ye.a,{required:r,label:a,setAttributes:o}),Object(c.createElement)(Ce,{id:t,required:r,width:l,setAttributes:o}),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Checkbox Settings","jetpack")},Object(c.createElement)(s.ToggleControl,{label:Object(i.__)("Checked by default","jetpack"),checked:p,onChange:function(e){return o({defaultValue:e?"true":""})}}))))})})),Te=n(12),Pe=n.n(Te),Ie=n(15),Me=n.n(Ie),Re=n(7),Be=n.n(Re),Le=n(13),De=n.n(Le),Fe=n(14),ze=n.n(Fe),Ue=function(e){De()(n,e);var t=ze()(n);function n(){var e;Pe()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).onChangeOption=e.onChangeOption.bind(Be()(e)),e.onKeyPress=e.onKeyPress.bind(Be()(e)),e.onDeleteOption=e.onDeleteOption.bind(Be()(e)),e.textInput=Object(c.createRef)(),e}return Me()(n,[{key:"componentDidMount",value:function(){this.props.isInFocus&&this.textInput.current.focus()}},{key:"componentDidUpdate",value:function(){this.props.isInFocus&&this.textInput.current.focus()}},{key:"onChangeOption",value:function(e){this.props.onChangeOption(this.props.index,e.target.value)}},{key:"onKeyPress",value:function(e){return"Enter"===e.key?(this.props.onAddOption(this.props.index),void e.preventDefault()):"Backspace"===e.key&&""===e.target.value?(this.props.onChangeOption(this.props.index),void e.preventDefault()):void 0}},{key:"onDeleteOption",value:function(){this.props.onChangeOption(this.props.index)}},{key:"render",value:function(){var e=this.props,t=e.isSelected,n=e.option,r=e.type;return Object(c.createElement)("li",{className:"jetpack-option"},r&&"select"!==r&&Object(c.createElement)("input",{className:"jetpack-option__type",type:r,disabled:!0}),Object(c.createElement)("input",{type:"text",className:"jetpack-option__input",value:n,placeholder:Object(i.__)("Write option…","jetpack"),onChange:this.onChangeOption,onKeyDown:this.onKeyPress,ref:this.textInput}),t&&Object(c.createElement)(s.Button,{className:"jetpack-option__remove",icon:"trash",label:Object(i.__)("Remove option","jetpack"),onClick:this.onDeleteOption}))}}]),n}(c.Component);var Ve=Object(j.withInstanceId)((function(e){var t=e.id,n=e.type,r=e.instanceId,a=e.required,o=e.label,l=e.setAttributes,u=e.isSelected,p=e.width,m=e.options,b=Object(c.useState)(null),h=d()(b,2),f=h[0],g=h[1],j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=m.slice(0);null===t?(n.splice(e,1),e>0&&g(e-1)):(n.splice(e,1,t),g(e)),l({options:n})},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=m.slice(0),n=0;"object"==typeof e?(t.push(""),n=t.length-1):(t.splice(e+1,0,""),n=e+1),g(n),l({options:t})};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.BaseControl,{id:"jetpack-field-multiple-".concat(r),className:"jetpack-field jetpack-field-multiple",label:Object(c.createElement)(ye.a,{required:a,label:o,setAttributes:l,isSelected:u,resetFocus:function(){return g(null)}})},Object(c.createElement)("ol",{className:"jetpack-field-multiple__list",id:"jetpack-field-multiple-".concat(r)},m.map((function(e,t){return Object(c.createElement)(Ue,{type:n,key:t,option:e,index:t,onChangeOption:j,onAddOption:v,isInFocus:t===f&&u,isSelected:u})}))),u&&Object(c.createElement)(s.Button,{className:"jetpack-field-multiple__add-option",icon:"insert",label:Object(i.__)("Insert option","jetpack"),onClick:v},Object(i.__)("Add option","jetpack"))),Object(c.createElement)(Ce,{id:t,required:a,setAttributes:l,width:p}))})),Ge=Object(j.withInstanceId)((function(e){var t,n=e.id,r=e.instanceId,a=e.width,o=e.consentType,l=e.implicitConsentMessage,p=e.explicitConsentMessage,d=e.setAttributes;return Object(c.createElement)(s.BaseControl,{id:"jetpack-field-consent-".concat(r),className:"jetpack-field jetpack-field-consent",label:Object(c.createElement)(c.Fragment,null,"explicit"===o&&Object(c.createElement)("input",{className:"jetpack-field-consent__checkbox",type:"checkbox",disabled:!0}),Object(c.createElement)(ye.a,{required:!1,label:null!==(t={implicit:l,explicit:p}[o])&&void 0!==t?t:"",setAttributes:d,labelFieldName:"".concat(o,"ConsentMessage"),placeholder:Object(i.sprintf)(Object(i.__)("Add %s consent message…","jetpack"),o)}),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Field Settings","jetpack")},Object(c.createElement)(Ee,{setAttributes:d,width:a}))),Object(c.createElement)(u.InspectorAdvancedControls,null,Object(c.createElement)(we,{setAttributes:d,id:n})),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Consent Settings","jetpack")},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)(s.SelectControl,{label:Object(i.__)("Permission to email","jetpack"),value:o,options:[{label:Object(i.__)("Mention that you can email","jetpack"),value:"implicit"},{label:Object(i.__)("Add a privacy checkbox","jetpack"),value:"explicit"}],onChange:function(e){return d({consentType:e})}})))))})})),He=Object(y.a)(Object(c.createElement)(s.Path,{d:"M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"})),qe={title:Object(i.__)("Form","jetpack"),description:Object(i.__)("A simple way to get feedback from folks visiting your site.","jetpack"),icon:{src:He,foreground:Object(E.a)()},keywords:[Object(i._x)("email","block search term","jetpack"),Object(i._x)("feedback","block search term","jetpack"),Object(i._x)("contact form","block search term","jetpack")],supports:{html:!1},attributes:be,edit:me,save:u.InnerBlocks.Content,variations:w,category:"grow",transforms:ve,deprecated:fe},We={category:"grow",parent:["jetpack/contact-form"],supports:{reusable:!1,html:!1},attributes:{label:{type:"string",default:null},required:{type:"boolean",default:!1},options:{type:"array",default:[]},defaultValue:{type:"string",default:""},placeholder:{type:"string",default:""},id:{type:"string",default:""},width:{type:"number",default:100}},transforms:{to:[{type:"block",blocks:["jetpack/field-text"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-text",e)}},{type:"block",blocks:["jetpack/field-name"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-name",e)}},{type:"block",blocks:["jetpack/field-email"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-email",e)}},{type:"block",blocks:["jetpack/field-url"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-url",e)}},{type:"block",blocks:["jetpack/field-date"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-date",e)}},{type:"block",blocks:["jetpack/field-telephone"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-telephone",e)}},{type:"block",blocks:["jetpack/field-textarea"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-textarea",e)}},{type:"block",blocks:["jetpack/field-checkbox-multiple"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-checkbox-multiple",e)}},{type:"block",blocks:["jetpack/field-radio"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-radio",e)}},{type:"block",blocks:["jetpack/field-select"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-select",e)}},{type:"block",blocks:["jetpack/field-consent"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-consent",e)}}]},save:function(){return null},example:{}},$e=function(e){var t=e.attributes,n=e.name;return null===t.label?Object(l.getBlockType)(n).title:t.label},Ke=function(e){return function(t){return Object(c.createElement)(xe,{type:e,label:$e(t),required:t.attributes.required,setAttributes:t.setAttributes,isSelected:t.isSelected,defaultValue:t.attributes.defaultValue,placeholder:t.attributes.placeholder,id:t.attributes.id,width:t.attributes.width})}},Ze=function(e){return function(t){return Object(c.createElement)(Ve,{label:$e(t),required:t.attributes.required,options:t.attributes.options,setAttributes:t.setAttributes,type:e,isSelected:t.isSelected,id:t.attributes.id,width:t.attributes.width})}},Ye=[{name:"field-text",settings:o()(o()({},We),{},{title:Object(i.__)("Text","jetpack"),description:Object(i.__)("When you need just a small amount of text, add a text input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),edit:Ke("text")})},{name:"field-name",settings:o()(o()({},We),{},{title:Object(i.__)("Name","jetpack"),description:Object(i.__)("Introductions are important. Add an input for folks to add their name.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})),edit:Ke("text")})},{name:"field-email",settings:o()(o()({},We),{},{title:Object(i.__)("Email","jetpack"),keywords:[Object(i.__)("e-mail","jetpack"),Object(i.__)("mail","jetpack"),"email"],description:Object(i.__)("Want to reply to folks? Add an email address input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),edit:Ke("email")})},{name:"field-url",settings:o()(o()({},We),{},{title:Object(i.__)("Website","jetpack"),keywords:["url",Object(i.__)("internet page","jetpack"),"link"],description:Object(i.__)("Add an address input for a website.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6z"})),edit:Ke("url")})},{name:"field-date",settings:o()(o()({},We),{},{title:Object(i.__)("Date Picker","jetpack"),keywords:[Object(i.__)("Calendar","jetpack"),Object(i._x)("day month year","block search term","jetpack")],description:Object(i.__)("The best way to set a date. Add a date picker.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V9h14v10zm0-12H5V5h14v2zM7 11h5v5H7z"})),edit:Ke("text")})},{name:"field-telephone",settings:o()(o()({},We),{},{title:Object(i.__)("Phone Number","jetpack"),keywords:[Object(i.__)("Phone","jetpack"),Object(i.__)("Cellular phone","jetpack"),Object(i.__)("Mobile","jetpack")],description:Object(i.__)("Add a phone number input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),edit:Ke("tel")})},{name:"field-textarea",settings:o()(o()({},We),{},{title:Object(i.__)("Message","jetpack"),keywords:[Object(i.__)("Textarea","jetpack"),"textarea",Object(i.__)("Multiline text","jetpack")],description:Object(i.__)("Let folks speak their mind. This text box is great for longer responses.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),edit:function(e){return Object(c.createElement)(Ne,{label:$e(e),required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,placeholder:e.attributes.placeholder,id:e.attributes.id,width:e.attributes.width})}})},{name:"field-checkbox",settings:o()(o()({},We),{},{title:Object(i.__)("Checkbox","jetpack"),keywords:[Object(i.__)("Confirm","jetpack"),Object(i.__)("Accept","jetpack")],description:Object(i.__)("Add a single checkbox.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})),edit:function(e){return Object(c.createElement)(Ae,{label:e.attributes.label,required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,id:e.attributes.id,width:e.attributes.width})},attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:""}})})},{name:"field-consent",settings:o()(o()({},We),{},{title:Object(i.__)("Consent","jetpack"),keywords:[Object(i.__)("Consent","jetpack")],description:Object(i.__)("Ask for consent","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"m81 370h142v40h-142zm0-39h142v-40h-142zm0-79h245v-40h-245zm378 260h-40c0-40.253906-32.746094-73-73-73s-73 32.746094-73 73h-40c0-42.085938 23.128906-78.867188 57.34375-98.3125-11.40625-13.023438-18.34375-30.054688-18.34375-48.6875 0-40.804688 33.195312-74 74-74s74 33.195312 74 74c0 18.632812-6.9375 35.664062-18.34375 48.6875 34.214844 19.445312 57.34375 56.226562 57.34375 98.3125zm-113-113c18.746094 0 34-15.253906 34-34s-15.253906-34-34-34-34 15.253906-34 34 15.253906 34 34 34zm-286 73h138.316406c-3.460937 12.757812-5.316406 26.164062-5.316406 40h-133c-33.085938 0-60-26.914062-60-60v-392c0-33.085938 26.914062-60 60-60h203.757812l142.132813 142.855469v125.210937c-12.042969-7.476562-25.453125-12.765625-39.890625-15.324218v-81.632813h-71.109375c-33.085937 0-60-26.914063-60-60v-71.109375h-174.890625c-11.027344 0-20 8.972656-20 20v392c0 11.027344 8.972656 20 20 20zm234.890625-340.890625h42.972656l-62.972656-63.234375v43.234375c0 11.03125 8.96875 20 20 20zm0 0"}),24,25,"-26 0 512 512"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:Object(i.__)("Consent","jetpack")},consentType:{type:"string",default:"implicit"},implicitConsentMessage:{type:"string",default:Object(i.__)("By submitting your information, you're giving us permission to email you. You may unsubscribe at any time.","jetpack")},explicitConsentMessage:{type:"string",default:Object(i.__)("Can we send you an email from time to time?","jetpack")}}),edit:function(e){var t=e.attributes,n=e.isSelected,r=e.setAttributes,a=t.id,o=t.width,i=t.consentType,l=t.implicitConsentMessage,s=t.explicitConsentMessage;return Object(c.createElement)(Ge,{id:a,isSelected:n,width:o,consentType:i,implicitConsentMessage:l,explicitConsentMessage:s,setAttributes:r})}})},{name:"field-checkbox-multiple",settings:o()(o()({},We),{},{title:Object(i.__)("Checkbox Group","jetpack"),keywords:[Object(i.__)("Choose Multiple","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("People love options. Add several checkbox items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})),edit:Ze("checkbox"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Choose several"}})})},{name:"field-radio",settings:o()(o()({},We),{},{title:Object(i.__)("Radio","jetpack"),keywords:[Object(i.__)("Choose","jetpack"),Object(i.__)("Select","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("Inspired by radios, only one radio item can be selected at a time. Add several radio button items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Object(c.createElement)(s.Circle,{cx:"12",cy:"12",r:"5"}))),edit:Ze("radio"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Choose one"}})})},{name:"field-select",settings:o()(o()({},We),{},{title:Object(i.__)("Select","jetpack"),keywords:[Object(i.__)("Choose","jetpack"),Object(i.__)("Dropdown","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("Compact, but powerful. Add a select box with several items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M3 17h18v2H3zm16-5v1H5v-1h14m2-2H3v5h18v-5zM3 6h18v2H3z"})),edit:Ze("select"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Select one"}})})}];Object(r.a)("contact-form",qe,Ye)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i={subscribePlaceholder:{type:"string",default:Object(o.__)("Email Address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},buttonWidth:{type:"string"},submitButtonText:{type:"string",default:Object(o.__)("Subscribe","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"string"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},l=n(3),s={attributes:{subscribeButton:{type:"string",default:Object(o.__)("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1}},migrate:function(e){return{submitButtonText:e.subscribeButton,showSubscribersTotal:e.showSubscribersTotal}},isEligible:function(e){return!(!e.hasOwnProperty("subscribeButton")||!Object(l.isEmpty)(e.subscribeButton))},save:function(e){var t=e.attributes;return Object(a.createElement)(a.RawHTML,null,'[jetpack_subscription_form show_subscribers_total="'.concat(t.showSubscribersTotal,'" show_only_email_and_button="true"]'))}};var u={attributes:{subscribePlaceholder:{type:"string",default:Object(o.__)("Email Address","jetpack")},subscribeButton:{type:"string",default:Object(o.__)("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},submitButtonText:{type:"string",default:Object(o.__)("Subscribe","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"}},migrate:function(e){return{subscribePlaceholder:e.subscribePlaceholder,showSubscribersTotal:e.showSubscribersTotal,buttonOnNewLine:!0,submitButtonText:e.submitButtonText,buttonBackgroundColor:e.backgroundButtonColor?e.backgroundButtonColor:"primary",customButtonBackgroundColor:e.customBackgroundButtonColor,textColor:e.textButtonColor?e.textButtonColor:"background",customTextColor:e.customTextButtonColor}},save:function(e){var t=e.attributes,n=t.showSubscribersTotal,r=t.submitButtonClasses,o=t.customBackgroundButtonColor,c=t.customTextButtonColor,i=t.submitButtonText;return Object(a.createElement)(a.RawHTML,null,'[jetpack_subscription_form show_only_email_and_button="true" custom_background_button_color="'.concat(o,'" custom_text_button_color="').concat(c,'" submit_button_text="').concat(i,'" submit_button_classes="').concat(r,'" show_subscribers_total="').concat(n,'" ]'))}},p=n(4),d=n.n(p),m={subscribePlaceholder:{type:"string",default:Object(o.__)("Enter your email address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},submitButtonText:{type:"string",default:Object(o.__)("Sign Up","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"number"},customFontSize:{type:"number"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},b=n(6),h=n(8),f=n.n(h);function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.subscribePlaceholder,o=t.showSubscribersTotal,c=t.buttonOnNewLine,i=t.submitButtonText,l=t.emailFieldBackgroundColor,s=t.customEmailFieldBackgroundColor,u=t.emailFieldGradient,p=t.customEmailFieldGradient,d=t.buttonBackgroundColor,h=t.customButtonBackgroundColor,g=t.buttonGradient,j=t.customButtonGradient,v=t.textColor,O=t.customTextColor,k=t.fontSize,_=t.customFontSize,y=t.borderRadius,E=t.borderWeight,w=t.borderColor,C=t.customBorderColor,x=t.padding,S=t.spacing,N=!!b.__experimentalGetGradientClass,A=Object(b.getColorClassName)("color",v),T=Object(b.getFontSizeClass)(k),P=Object(b.getColorClassName)("border-color",w),I=Object(b.getColorClassName)("background-color",d),M=N?Object(b.__experimentalGetGradientClass)(g):void 0,R=Object(b.getColorClassName)("background-color",l),B=N?Object(b.__experimentalGetGradientClass)(u):void 0,L=f()(0===y?"no-border-radius":void 0,T,P),D=f()(L,v?"has-text-color":void 0,A,d||g?"has-background":void 0,I,M),F=f()(L,R,B),z=!R&&p?p:s,U=!I&&j?j:h,V=function(){return f()(e,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},G=r,H=i;return"check-text-defaults"===n&&(G=r===m.subscribePlaceholder.default?"Enter your email address":r,H=i===m.submitButtonText.default?"Sign Up":i),Object(a.createElement)("div",{className:V()},Object(a.createElement)(a.RawHTML,null,'\n\t\t\t[jetpack_subscription_form\n\t\t\t\tsubscribe_placeholder="'.concat(G,'"\n\t\t\t\tshow_subscribers_total="').concat(o,'"\n\t\t\t\tbutton_on_newline="').concat(c,'"\n\t\t\t\tsubmit_button_text="').concat(H,'"\n\t\t\t\tcustom_background_emailfield_color="').concat(z,'"\n\t\t\t\tcustom_background_button_color="').concat(U,'"\n\t\t\t\tcustom_text_button_color="').concat(O,'"\n\t\t\t\tcustom_font_size="').concat(_||16,'"\n\t\t\t\tcustom_border_radius="').concat(y||0,'"\n\t\t\t\tcustom_border_weight="').concat(E||1,'"\n\t\t\t\tcustom_border_color="').concat(C,'"\n\t\t\t\tcustom_padding="').concat(x||15,'"\n\t\t\t\tcustom_spacing="').concat(S||10,'"\n\t\t\t\tsubmit_button_classes="').concat(D,'"\n\t\t\t\temail_field_classes="').concat(F,'"\n\t\t\t\tshow_only_email_and_button="true"\n\t\t\t]')))}var j=[{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){var t=e.className,n=e.attributes,r=n.subscribePlaceholder,o=n.showSubscribersTotal,c=n.buttonOnNewLine,i=n.submitButtonText,s=n.emailFieldBackgroundColor,u=n.customEmailFieldBackgroundColor,p=n.emailFieldGradient,d=n.customEmailFieldGradient,h=n.buttonBackgroundColor,g=n.customButtonBackgroundColor,j=n.buttonGradient,v=n.customButtonGradient,O=n.textColor,k=n.customTextColor,_=n.fontSize,y=n.customFontSize,E=n.borderRadius,w=n.borderWeight,C=n.borderColor,x=n.customBorderColor,S=n.padding,N=n.spacing,A=!!b.__experimentalGetGradientClass,T=Object(b.getColorClassName)("color",O),P=Object(b.getFontSizeClass)(_),I=Object(b.getColorClassName)("border-color",C),M=Object(b.getColorClassName)("background-color",h),R=A?Object(b.__experimentalGetGradientClass)(j):void 0,B=Object(b.getColorClassName)("background-color",s),L=A?Object(b.__experimentalGetGradientClass)(p):void 0,D=f()(0===E?"no-border-radius":void 0,P,I),F=f()(D,O?"has-text-color":void 0,T,h||j?"has-background":void 0,M,R),z=f()(D,B,L),U=!B&&d?d:u,V=!M&&v?v:g,G={subscribe_placeholder:r!==m.subscribePlaceholder.default?r:void 0,show_subscribers_total:o,button_on_newline:c,submit_button_text:i!==m.submitButtonText.default?i:void 0,custom_background_emailfield_color:U,custom_background_button_color:V,custom_text_button_color:k,custom_font_size:y||16,custom_border_radius:E||0,custom_border_weight:w||1,custom_border_color:x,custom_padding:S||15,custom_spacing:N||10,submit_button_classes:F,email_field_classes:z,show_only_email_and_button:!0},H=Object(l.reduce)(G,(function(e,t,n){return void 0===t?e:e+" ".concat(n,'="').concat(t,'"')}),"");return Object(a.createElement)("div",{className:f()(t,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)(a.RawHTML,null,"[jetpack_subscription_form".concat(H,"]")))}},{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){return g(e.className,e.attributes,"check-text-defaults")}},{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){return g(e.className,e.attributes)}},u,s],v=n(5),O=n.n(v),k=n(9),_=n.n(k),y=n(22),E=n.n(y),w=n(17),C=(n(240),n(43)),x="16px",S=n(108);function N(e){var t=e.buttonBackgroundColor,n=e.borderColor,r=e.buttonGradient,i=e.borderRadius,l=e.borderWeight,s=e.buttonOnNewLine,u=e.emailFieldBackgroundColor,p=e.fallbackButtonBackgroundColor,d=e.fallbackTextColor,m=e.fontSize,h=e.isGradientAvailable,f=e.padding,g=e.setAttributes,j=e.setButtonBackgroundColor,v=e.setTextColor,O=e.showSubscribersTotal,k=e.spacing,_=e.subscriberCount,y=e.textColor,E=e.buttonWidth;return Object(a.createElement)(a.Fragment,null,h&&Object(a.createElement)(b.__experimentalPanelColorGradientSettings,{title:Object(o.__)("Color Settings","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:t.color,onColorChange:j,gradientValue:r.gradientValue,onGradientChange:r.setGradient,label:Object(o.__)("Button Background Color","jetpack")},{colorValue:y.color,onColorChange:v,label:Object(o.__)("Button Text Color","jetpack")},{colorValue:n.color,onColorChange:function(e){g({borderColor:e,customBorderColor:e})},label:Object(o.__)("Border Color","jetpack")}],initialOpen:!0},Object(a.createElement)(b.ContrastChecker,{fontSize:m.size,textColor:y.color,backgroundColor:u.color,fallbackButtonBackgroundColor:p,fallbackTextColor:d})),!h&&Object(a.createElement)(b.PanelColorSettings,{title:Object(o.__)("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:t.color,onChange:j,label:Object(o.__)("Button Background Color","jetpack")},{value:y.color,onChange:v,label:Object(o.__)("Button Text Color","jetpack")},{value:n.color,onColorChange:function(e){g({borderColor:e,customBorderColor:e})},label:Object(o.__)("Border Color","jetpack")}],initialOpen:!1},Object(a.createElement)(b.ContrastChecker,{fontSize:m.size,textColor:y.color,backgroundColor:u.color,fallbackButtonBackgroundColor:p,fallbackTextColor:d})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Text Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},Object(a.createElement)(b.FontSizePicker,{withSlider:!0,value:m.size,onChange:function(e){var t=e||x;g({fontSize:t,customFontSize:t})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Border Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},Object(a.createElement)(c.RangeControl,{value:i,label:Object(o.__)("Border Radius","jetpack"),min:0,max:50,initialPosition:0,allowReset:!0,onChange:function(e){return g({borderRadius:e})}}),Object(a.createElement)(c.RangeControl,{value:l,label:Object(o.__)("Border Weight","jetpack"),min:0,max:15,initialPosition:1,allowReset:!0,onChange:function(e){return g({borderWeight:e})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Spacing Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},Object(a.createElement)(c.RangeControl,{value:f,label:Object(o.__)("Space Inside","jetpack"),min:5,max:50,initialPosition:15,allowReset:!0,onChange:function(e){return g({padding:e})}}),Object(a.createElement)(c.RangeControl,{value:k,label:Object(o.__)("Space Between","jetpack"),min:0,max:50,initialPosition:10,allowReset:!0,onChange:function(e){return g({spacing:e})}}),Object(a.createElement)(S.a,{width:E,onChange:function(e){return g({buttonWidth:e})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Display Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Show subscriber count","jetpack"),checked:O,onChange:function(){g({showSubscribersTotal:!O})},help:function(){if(!_||_<1)return Object(o.__)("This will remain hidden on your website until you have at least one subscriber.","jetpack")}}),Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Place button on new line","jetpack"),checked:s,onChange:function(){g({buttonOnNewLine:!s})}})))}var A=window.getComputedStyle,T=!!b.__experimentalUseGradient,P=Object(c.withFallbackStyles)((function(e,t){var n=t.buttonBackgroundColor,r=t.textColor,a=n&&n.color,o=r&&r.color,c=e.querySelector(".wp-block-jetpack-subscriptions__button");return{fallbackButtonBackgroundColor:a||!e?void 0:c&&A(c).backgroundColor,fallbackTextColor:o||!e?void 0:c&&A(c).color}}));var I=Object(w.compose)([Object(b.withColors)({emailFieldBackgroundColor:"backgroundColor"},{buttonBackgroundColor:"backgroundColor"},{textColor:"color"},"borderColor"),Object(b.withFontSizes)("fontSize"),P])((function(e){var t,n,r,s=e.className,u=e.attributes,p=e.setAttributes,m=e.emailFieldBackgroundColor,h=e.buttonBackgroundColor,g=e.setButtonBackgroundColor,j=e.fallbackButtonBackgroundColor,v=e.textColor,k=e.fallbackTextColor,y=e.setTextColor,w=e.borderColor,S=e.fontSize,A=Object(C.a)(i,u);Object(l.isEqual)(A,u)||p(A);var P,I,M=A.borderRadius,R=A.borderWeight,B=A.buttonWidth,L=A.padding,D=A.spacing,F=A.submitButtonText,z=A.subscribePlaceholder,U=A.showSubscribersTotal,V=A.buttonOnNewLine,G=Object(a.useState)(""),H=_()(G,2),q=H[0],W=H[1],$=Object(a.useState)(""),K=_()($,2),Z=K[0],Y=K[1],J=T?Object(b.__experimentalUseGradient)({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}):{},X=T?Object(b.__experimentalUseGradient)({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}):{},Q=(t={"no-border-radius":0===M},O()(t,S.class,S.class),O()(t,"has-text-color",v.color),O()(t,v.class,v.class),t),ee=d()(d()({},Q),{},(n={"has-background":m.color||J.gradientValue},O()(n,m.class,!J.gradientValue&&m.class),O()(n,J.gradientClass,J.gradientClass),n)),te=d()(d()({},Q),{},(r={"has-background":h.color||X.gradientValue},O()(r,h.class,!X.gradientValue&&h.class),O()(r,X.gradientClass,X.gradientClass),r)),ne=function(e){return e||10},re={color:v.color,borderColor:w.color,borderRadius:M?M+"px":"0px",borderWidth:R?R+"px":"1px",fontSize:S.size?S.size:x,padding:(P=L,I=P||15,I+"px "+Math.round(1.5*I)+"px "+I+"px "+Math.round(1.5*I)+"px")},ae=d()(d()({},re),!m.color&&J.gradientValue?{background:J.gradientValue}:{backgroundColor:m.color}),oe=d()(d()(d()(d()({},re),!h.color&&X.gradientValue?{background:X.gradientValue}:{backgroundColor:h.color}),V?{marginTop:ne(D)+"px"}:{marginLeft:ne(D)+"px"}),{},{width:B});return Object(a.useEffect)((function(){E()({path:"/wpcom/v2/subscribers/count"}).then((function(e){e.hasOwnProperty("count")?(W(Object(o.sprintf)(Object(o._n)("Join %s other subscriber","Join %s other subscribers",e.count,"jetpack"),e.count)),Y(e.count)):(W(Object(o.__)("Subscriber count unavailable","jetpack")),Y(0))}))}),[]),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(b.InspectorControls,null,Object(a.createElement)(N,{buttonBackgroundColor:h,borderColor:w,buttonGradient:X,borderRadius:M,borderWeight:R,buttonOnNewLine:V,emailFieldBackgroundColor:m,fallbackButtonBackgroundColor:j,fallbackTextColor:k,fontSize:S,isGradientAvailable:T,padding:L,setAttributes:p,setButtonBackgroundColor:g,setTextColor:y,showSubscribersTotal:U,spacing:D,subscriberCount:Z,textColor:v,buttonWidth:B})),Object(a.createElement)("div",{className:f()(s,"wp-block-jetpack-subscriptions__supports-newline",V?"wp-block-jetpack-subscriptions__use-newline":void 0,U?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form"},Object(a.createElement)(c.TextControl,{placeholder:z,disabled:!0,className:f()(ee,"wp-block-jetpack-subscriptions__textfield"),style:ae}),Object(a.createElement)(b.RichText,{className:f()(te,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:function(e){return p({submitButtonText:e})},style:oe,value:F,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),U&&Object(a.createElement)("p",{className:"wp-block-jetpack-subscriptions__subscount"},q)))}));var M=n(16),R=Object(a.createElement)(c.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(c.Rect,{x:"4.75",y:"6.75",width:"14.5",height:"10.5",rx:"1.25",stroke:Object(M.a)(),strokeWidth:"1.5",fill:"none"}),Object(a.createElement)(c.Path,{d:"M19 7L13.3609 12.2363C12.5935 12.9489 11.4065 12.9489 10.6391 12.2363L5 7",stroke:Object(M.a)(),strokeWidth:"1.5",strokeLinejoin:"bevel",fill:"none"})),B={title:Object(o.__)("Subscription Form","jetpack"),description:Object(a.createElement)("p",null,Object(o.__)("A form enabling readers to get notifications when new posts are published from this site.","jetpack")),icon:{src:R,foreground:Object(M.a)()},category:"grow",keywords:[Object(o._x)("subscribe","block search term","jetpack"),Object(o._x)("join","block search term","jetpack"),Object(o._x)("follow","block search term","jetpack")],attributes:i,edit:I,save:function(e){var t=e.className,n=e.attributes,r=n.subscribePlaceholder,o=n.showSubscribersTotal,c=n.buttonOnNewLine,s=n.submitButtonText,u=n.emailFieldBackgroundColor,p=n.customEmailFieldBackgroundColor,d=n.emailFieldGradient,m=n.customEmailFieldGradient,h=n.buttonBackgroundColor,g=n.customButtonBackgroundColor,j=n.buttonGradient,v=n.customButtonGradient,O=n.textColor,k=n.customTextColor,_=n.fontSize,y=n.customFontSize,E=n.borderRadius,w=n.borderWeight,C=n.borderColor,S=n.customBorderColor,N=n.padding,A=n.spacing,T=n.buttonWidth,P=!!b.__experimentalGetGradientClass,I=Object(b.getColorClassName)("color",O),M=Object(b.getFontSizeClass)(_),R=Object(b.getColorClassName)("border-color",C),B=Object(b.getColorClassName)("background-color",h),L=P?Object(b.__experimentalGetGradientClass)(j):void 0,D=Object(b.getColorClassName)("background-color",u),F=P?Object(b.__experimentalGetGradientClass)(d):void 0,z=f()(0===E?"no-border-radius":void 0,M,R),U=f()(z,O?"has-text-color":void 0,I,h||j?"has-background":void 0,B,L),V=f()(z,D,F),G=!D&&m?m:p,H=!B&&v?v:g,q=T||void 0,W={subscribe_placeholder:r!==i.subscribePlaceholder.default?r:void 0,show_subscribers_total:o,button_on_newline:c,submit_button_text:s!==i.submitButtonText.default?s:void 0,custom_background_emailfield_color:G,custom_background_button_color:H,custom_text_button_color:k,custom_font_size:y||x,custom_border_radius:E||0,custom_border_weight:w||1,custom_border_color:S,custom_button_width:q,custom_padding:N||15,custom_spacing:A||10,submit_button_classes:U,email_field_classes:V,show_only_email_and_button:!0},$=Object(l.reduce)(W,(function(e,t,n){return void 0===t?e:e+" ".concat(n,'="').concat(t,'"')}),"");return Object(a.createElement)("div",{className:f()(t,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)(a.RawHTML,null,"[jetpack_subscription_form".concat($,"]")))},example:{attributes:{}},deprecated:j};Object(r.a)("subscriptions",B)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(21),c=n.n(o),i=n(9),l=n.n(i),s=n(0),u=n(10),p=n(4),d=n.n(p),m=n(8),b=n.n(m),h=n(5),f=n.n(h),g=n(53),j=n(6),v=n(2),O=n(24),k=n(37),_=n(45),y=function(e){var t=e.attributes,n=e.setAttributes,r=t.currency,o=t.monthlyDonation,c=t.annualDonation,i=t.showCustomAmount,l=function(e,r){var a={"1 month":"monthlyDonation","1 year":"annualDonation"}[e],o=t[a];n(f()({},a,d()(d()({},o),{},{show:r})))};return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.BlockControls,null,Object(s.createElement)(v.ToolbarGroup,null,Object(s.createElement)(v.ToolbarItem,null,(function(){return Object(s.createElement)(v.Dropdown,{contentClassName:"jetpack-donations__currency-popover",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(s.createElement)(v.Button,{className:"jetpack-donations__currency-toggle",icon:Object(s.createElement)(s.Fragment,null,g.a[r].symbol+" - "+r,Object(s.createElement)(v.Dashicon,{icon:"arrow-down"})),label:Object(a.__)("Change currency","jetpack"),onClick:t,onKeyDown:function(e){n||e.keyCode!==O.DOWN||(e.preventDefault(),e.stopPropagation(),t())}})},renderContent:function(e){var t=e.onClose;return Object(s.createElement)(v.MenuGroup,null,Object.keys(k.b).map((function(e){return Object(s.createElement)(v.MenuItem,{isSelected:e===r,onClick:function(){n({currency:e}),t()},key:"jetpack-donations-currency-".concat(e)},g.a[e].symbol+" - "+e)})))}})})))),Object(s.createElement)(j.InspectorControls,null,Object(s.createElement)(v.PanelBody,{title:Object(a.__)("Settings","jetpack")},Object(s.createElement)(v.ToggleControl,{checked:o.show,onChange:function(e){return l("1 month",e)},label:Object(a.__)("Show monthly donations","jetpack")}),Object(s.createElement)(v.ToggleControl,{checked:c.show,onChange:function(e){return l("1 year",e)},label:Object(a.__)("Show annual donations","jetpack")}),Object(s.createElement)(v.ToggleControl,{checked:i,onChange:function(e){return n({showCustomAmount:e})},label:Object(a.__)("Show custom amount option","jetpack")}),Object(s.createElement)(v.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(Object(_.a)())},Object(a.__)("View donation earnings","jetpack")))))},E=n(19),w=n.n(E),C=n(35),x=function(e){var t=e.className,n=void 0===t?null:t,r=e.currency,a=void 0===r?null:r,o=e.defaultValue,c=void 0===o?null:o,i=e.disabled,u=void 0!==i&&i,p=e.label,d=void 0===p?"":p,m=e.onChange,h=void 0===m?null:m,f=e.value,v=void 0===f?"":f,O=Object(s.useState)(Object(C.a)(v,a,{symbol:""})),_=l()(O,2),y=_[0],E=_[1],w=Object(s.useState)(!1),x=l()(w,2),S=x[0],N=x[1],A=Object(s.useState)(!1),T=l()(A,2),P=T[0],I=T[1],M=Object(s.useRef)(null),R=Object(s.useCallback)((function(e){if(E(e),h){var t=Object(k.e)(e,a);t&&t>=Object(k.d)(a)?(h(t),I(!1)):e&&I(!0)}}),[a,h]),B=function(){M.current&&(M.current.focus(),N(!0))};return Object(s.useEffect)((function(){M.current&&M.current.addEventListener("blur",(function(){return N(!1)}))}),[M]),Object(s.useEffect)((function(){S||y||R(Object(C.a)(c,a,{symbol:""}))}),[a,c,y,S,R]),Object(s.useEffect)((function(){S||P||E(Object(C.a)(v,a,{symbol:""}))}),[a,S,P,R,v]),Object(s.createElement)("div",{className:b()("donations__amount",n,{"has-focus":S,"has-error":P}),role:"button",tabIndex:0,onClick:B,onKeyDown:B},g.a[a].symbol,u?Object(s.createElement)("div",{className:"donations__amount-value"},Object(C.a)(v||c,a,{symbol:""})):Object(s.createElement)(j.RichText,{allowedFormats:[],"aria-label":d,keepPlaceholderOnFocus:!0,multiline:!1,onChange:function(e){return R(e)},placeholder:Object(C.a)(c,a,{symbol:""}),ref:M,value:y,withoutInteractiveFormatting:!0}))},S=function(e){var t=e.activeTab,n=e.attributes,r=e.setAttributes,o=n.currency,c=n.oneTimeDonation,i=n.monthlyDonation,p=n.annualDonation,m=n.showCustomAmount,b=n.chooseAmountText,h=n.customAmountText,g={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"},v=function(e){return n[g[t]][e]},O=function(e,a){var o=g[t],c=n[o];r(f()({},o,d()(d()({},c),{},f()({},e,a))))},_=Object(s.useState)(o),y=l()(_,2),E=y[0],C=y[1],S=Object(k.d)(o),N=Object(s.useMemo)((function(){return[10*S,30*S,200*S]}),[S]);Object(s.useEffect)((function(){E!==o&&(C(o),r({oneTimeDonation:d()(d()({},c),{},{amounts:N}),monthlyDonation:d()(d()({},i),{},{amounts:N}),annualDonation:d()(d()({},p),{},{amounts:N})}))}),[o,E,N,c,i,p,r]);var A=v("amounts"),T=Object(u.useSelect)((function(e){return e("core/rich-text").getFormatTypes()}),[]).map((function(e){return e.name})).filter((function(e){return"core/link"!==e}));return Object(s.createElement)("div",{className:"donations__tab"},Object(s.createElement)(j.RichText,{tagName:"h4",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("heading"),onChange:function(e){return O("heading",e)}}),Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:b,onChange:function(e){return r({chooseAmountText:e})}}),Object(s.createElement)("div",{className:"donations__amounts"},A.map((function(e,t){return Object(s.createElement)(x,{currency:o,defaultValue:N[t],label:Object(a.sprintf)(Object(a.__)("Tier %d","jetpack"),t+1),key:"jetpack-donations-amount-".concat(t),onChange:function(e){return function(e,t){var n=w()(A);n[t]=e,O("amounts",n)}(e,t)},value:e})}))),m&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:h,onChange:function(e){return r({customAmountText:e})}}),Object(s.createElement)(x,{currency:o,label:Object(a.__)("Custom amount","jetpack"),defaultValue:100*Object(k.d)(o),className:"donations__custom-amount",disabled:!0})),Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("extraText"),onChange:function(e){return O("extraText",e)}}),Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper"},Object(s.createElement)(j.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("buttonText"),onChange:function(e){return t=e,void r({oneTimeDonation:d()(d()({},c),{},{buttonText:t}),monthlyDonation:d()(d()({},i),{},{buttonText:t}),annualDonation:d()(d()({},p),{},{buttonText:t})});var t},allowedFormats:T})))},N=n(186),A=n.n(N),T=n(62),P=(n(298),n(80));function I(e){var t=e.blockName,n=e.buttonLabel,r=e.href,a=e.icon,o=e.onClick,c=e.subtitle,i=e.title,l=e.className,u=Object(P.a)(r).autosaveAndRedirect;return Object(s.createElement)(j.Warning,{actions:r&&[Object(s.createElement)(v.Button,{href:r,onClick:function(e){e.preventDefault(),o(t),u(e)},target:"_top",isSecondary:!0,isLarge:!0},n)],className:b()(l,"jetpack-block-nudge wp-block")},Object(s.createElement)("span",{className:"jetpack-block-nudge__info"},a,Object(s.createElement)("span",{className:"jetpack-block-nudge__text-container"},Object(s.createElement)("span",{className:"jetpack-block-nudge__title"},i),c&&Object(s.createElement)("span",{className:"jetpack-block-nudge__message"},c))))}var M=n(91),R=(n(299),function(e){var t=e.blockName,n=e.url;return Object(s.createElement)(I,{className:"jetpack-stripe-nudge__banner",buttonLabel:Object(a.__)("Connect","jetpack"),icon:Object(s.createElement)(A.a,{className:"jetpack-stripe-nudge__icon",size:18,"aria-hidden":"true",role:"img",focusable:"false"}),href:n,onClick:function(){T.a.tracks.recordEvent("jetpack_editor_block_stripe_connect_click",{block:t})},title:Object(a.__)("Connect to Stripe to use this block on your site","jetpack"),subtitle:Object(a.__)("This block will be hidden from your visitors until you connect to Stripe.","jetpack")})}),B=function(e){var t=e.blockName,n=e.postId,r=e.stripeConnectUrl,a=Object(M.a)(n,r);return a?Object(s.createElement)(R,{blockName:t,url:a}):null},L=function(e){var t=e.attributes,n=e.className,r=e.products,o=e.setAttributes,c=e.shouldUpgrade,i=e.stripeConnectUrl,p=t.oneTimeDonation,m=t.monthlyDonation,h=t.annualDonation,f=Object(s.useState)("one-time"),g=l()(f,2),j=g[0],v=g[1],O=Object(u.useSelect)((function(e){return e("core/editor").getCurrentPostId()}),[]),k=Object(s.useCallback)((function(e){return j===e}),[j]),_=d()(d()({"one-time":{title:Object(a.__)("One-Time","jetpack")}},m.show&&{"1 month":{title:Object(a.__)("Monthly","jetpack")}}),h.show&&{"1 year":{title:Object(a.__)("Yearly","jetpack")}});return Object(s.useEffect)((function(){p.planId===r["one-time"]&&m.planId===r["1 month"]&&h.planId===r["1 year"]||o({oneTimeDonation:d()(d()({},p),{},{planId:r["one-time"]}),monthlyDonation:d()(d()({},m),{},{planId:r["1 month"]}),annualDonation:d()(d()({},h),{},{planId:r["1 year"]})})}),[p,m,h,o,r]),Object(s.useEffect)((function(){!m.show&&k("1 month")&&v("one-time"),!h.show&&k("1 year")&&v("one-time")}),[m,h,v,k]),Object(s.createElement)("div",{className:n},!c&&i&&Object(s.createElement)(B,{blockName:"donations",postId:O,stripeConnectUrl:i}),Object(s.createElement)("div",{className:"donations__container"},Object.keys(_).length>1&&Object(s.createElement)("div",{className:"donations__nav"},Object.entries(_).map((function(e){var t=l()(e,2),n=t[0],r=t[1].title;return Object(s.createElement)("div",{role:"button",tabIndex:0,className:b()("donations__nav-item",{"is-active":k(n)}),onClick:function(){return v(n)},onKeyDown:function(){return v(n)},key:"jetpack-donations-nav-item-".concat(n," ")},r)}))),Object(s.createElement)("div",{className:"donations__content"},Object(s.createElement)(S,{activeTab:j,attributes:t,setAttributes:o}))),Object(s.createElement)(y,e))},D=function(e){var t=e.className,n=e.error;return Object(s.createElement)(v.Placeholder,{icon:"lock",label:Object(a.__)("Donations","jetpack"),instructions:n,className:t})},F=n(26),z=n.n(F),U=n(22),V=n.n(U),G=function(){var e=z()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,V()({path:"/wpcom/v2/memberships/products",method:"POST",data:{type:"donation",currency:t}});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0.message));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(_x){return e.apply(this,arguments)}}(),H=n(39),q=n(27),W=function(){var e=z()(regeneratorRuntime.mark((function e(){var t,n,r,a,o,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:null,n=Object(H.parse)(window.location.href,!0),r=n.query,a=Object(q.addQueryArgs)("/wpcom/v2/memberships/status",d()({source:"https://wordpress.com"===r.origin?"gutenberg-wpcom":"gutenberg"},t&&{type:t})),e.prev=3,e.next=6,V()({path:a,method:"GET"});case 6:return o=e.sent,e.abrupt("return",o);case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject(e.t0.message));case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}(),$=function(e){var t=e.attributes,n=e.className,r=e.setAttributes,o=t.currency,i=Object(s.useState)(""),p=l()(i,2),d=p[0],m=p[1],b=Object(s.useState)(!1),h=l()(b,2),f=h[0],g=h[1],j=Object(s.useState)(!1),v=l()(j,2),O=v[0],k=v[1],_=Object(s.useState)([]),y=l()(_,2),E=y[0],w=y[1],C=Object(u.useSelect)((function(e){return e("core/editor").getCurrentPost()}),[]);Object(s.useEffect)((function(){r({fallbackLinkUrl:C.link})}),[C.link,r]);var x=function(e){m(e)},S=function(e){return e.reduce((function(e,t){var n=t.id,r=t.currency,a=t.type,c=t.interval;return r===o&&"donation"===a&&(e[c]=n),e}),{})},N=function(e){if(!e&&"object"!=typeof e||e.errors)m(Object(a.__)("Could not load data from WordPress.com.","jetpack"));else{g(e.should_upgrade_to_access_memberships),k(e.connect_url);var t,n,r=S(e.products);if(t=r,(n=Object.keys(t)).includes("one-time")&&n.includes("1 month")&&n.includes("1 year"))w(r);else e.should_upgrade_to_access_memberships||e.connect_url?w({"one-time":-1,"1 month":-1,"1 year":-1}):G(o).then((function(e){return w(S(e))}),x)}};return Object(s.useEffect)((function(){W("donation").then(N,x)}),[o]),d?Object(s.createElement)(D,{className:n,error:d}):Object(s.createElement)(L,c()({},e,{products:E,shouldUpgrade:f,stripeConnectUrl:O}))},K=function(e){var t=e.attributes,n=t.fallbackLinkUrl,r=t.oneTimeDonation,a=t.monthlyDonation,o=t.annualDonation;return r&&r.show&&r.planId&&-1!==r.planId?Object(s.createElement)("div",null,Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:r.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:r.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:r.buttonText}),a.show&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:a.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:a.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:a.buttonText})),o.show&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:o.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:o.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:o.buttonText}))):null},Z={attributes:{currency:{type:"string",default:"USD"},oneTimeDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a one-time donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate","jetpack")}},monthlyDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a monthly donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate monthly","jetpack")}},annualDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a yearly donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate yearly","jetpack")}},showCustomAmount:{type:"boolean",default:!0},chooseAmountText:{type:"string",default:Object(a.__)("Choose an amount","jetpack")},customAmountText:{type:"string",default:Object(a.__)("Or enter a custom amount","jetpack")}},supports:{html:!1},save:function(e){var t=e.attributes,n=t.currency,r=t.oneTimeDonation,o=t.monthlyDonation,c=t.annualDonation,i=t.showCustomAmount,u=t.chooseAmountText,p=t.customAmountText;if(!r||!r.show||-1===r.planId)return null;var m=d()(d()({"one-time":{title:Object(a.__)("One-Time","jetpack")}},o.show&&{"1 month":{title:Object(a.__)("Monthly","jetpack")}}),c.show&&{"1 year":{title:Object(a.__)("Yearly","jetpack")}});return Object(s.createElement)("div",null,Object(s.createElement)("div",{className:"donations__container"},Object.keys(m).length>1&&Object(s.createElement)("div",{className:"donations__nav"},Object.entries(m).map((function(e){var t=l()(e,2),n=t[0],r=t[1].title;return Object(s.createElement)("div",{role:"button",tabIndex:0,className:"donations__nav-item",key:"jetpack-donations-nav-item-".concat(n," "),"data-interval":n},r)}))),Object(s.createElement)("div",{className:"donations__content"},Object(s.createElement)("div",{className:"donations__tab"},Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__one-time-item",value:r.heading}),o.show&&Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__monthly-item",value:o.heading}),c.show&&Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__annual-item",value:c.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:u}),Object(s.createElement)("div",{className:"donations__amounts donations__one-time-item"},r.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),o.show&&Object(s.createElement)("div",{className:"donations__amounts donations__monthly-item"},o.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),c.show&&Object(s.createElement)("div",{className:"donations__amounts donations__annual-item"},c.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),i&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.RichText.Content,{tagName:"p",value:p}),Object(s.createElement)("div",{className:"donations__amount donations__custom-amount"},g.a[n].symbol,Object(s.createElement)("div",{className:"donations__amount-value","data-currency":n,"data-empty-text":Object(C.a)(100*Object(k.d)(n),n,{symbol:""})}))),Object(s.createElement)("div",{className:"donations__separator"},"——"),Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__one-time-item",value:r.extraText}),o.show&&Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__monthly-item",value:o.extraText}),c.show&&Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__annual-item",value:c.extraText}),Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__one-time-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__one-time-item",value:r.buttonText})),o.show&&Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__monthly-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__monthly-item",value:o.buttonText})),c.show&&Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__annual-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__annual-item",value:c.buttonText}))))))}},Y=n(33),J=(n(300),{title:Object(a.__)("Donations","jetpack"),description:Object(a.__)("Collect one-time, monthly, or annually recurring donations.","jetpack"),icon:Y.c,category:"earn",keywords:[Object(a.__)("Donations","jetpack")],supports:{html:!1},edit:$,save:K,example:{},deprecated:[Z]});Object(r.a)("donations",J)},function(e,t,n){"use strict";n.r(t);var r=n(19),a=n.n(r),o=n(9),c=n.n(o),i=n(4),l=n.n(i),s=n(21),u=n.n(s),p=n(0),d=n(2),m=n(29),b=n(11),h=n(51),f=n(6),g=n(31),j=n(17),v=n(1),O=n(3),k=n(26),_=n.n(k),y=n(12),E=n.n(y),w=n(15),C=n.n(w),x=n(7),S=n.n(x),N=n(13),A=n.n(N),T=n(14),P=n.n(T),I=n(5),M=n.n(I),R=n(22),B=n.n(R),L=n(10),D=n(8),F=n.n(D),z=function(e){var t=e.text;return Object(p.createElement)("div",{className:"wp-block-embed is-loading"},Object(p.createElement)(d.Spinner,null),Object(p.createElement)("p",null,t))},U=n(27),V=function(e,t){var n=t.autoplay,r=t.controls,a=t.loop,o=t.muted,c=t.playsinline,i=t.poster,s=t.preload,u=t.seekbarColor,p=t.seekbarPlayedColor,d=t.seekbarLoadingColor;if(!e)return null;var m=l()(l()(l()(l()(l()(l()(l()(l()(l()(l()({},n&&{autoPlay:!0}),!r&&{controls:!1}),a&&{loop:!0}),o&&{muted:!0,persistVolume:!1}),c&&{playsinline:!0}),i&&{posterUrl:i}),"none"!==s&&{preloadContent:s}),""!==u&&{sbc:u}),""!==p&&{sbpc:p}),""!==d&&{sblc:d});return Object(U.addQueryArgs)("https://videopress.com/v/".concat(e),m)},G=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],H=function(e){var t=G.reduce((function(e,t){return e[t.className]=!1,e}),{"wp-has-aspect-ratio":!1});return F()(e,t)};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return H(t);var r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;var a=r.body.querySelector("iframe");if(a&&a.height&&a.width)for(var o=(a.width/a.height).toFixed(2),c=0;c<G.length;c++){var i=G[c];if(o>=i.ratio)return F()(H(t),i.className,"wp-has-aspect-ratio")}return t}n(18);var W=function(e){A()(n,e);var t=P()(n);function n(){var e;E()(this,n),e=t.apply(this,arguments),M()(S()(e),"handleChangeSeekbarColor",(function(t){e.setState({seekbarColor:t})})),M()(S()(e),"handleChangeSeekbarLoadingColor",(function(t){e.setState({seekbarLoadingColor:t})})),M()(S()(e),"handleChangeSeekbarPlayedColor",(function(t){e.setState({seekbarPlayedColor:t})})),M()(S()(e),"saveColors",(function(){var t=e.state,n=t.seekbarColor,r=t.seekbarLoadingColor,a=t.seekbarPlayedColor;(0,e.props.setAttributes)({seekbarColor:n,seekbarLoadingColor:r,seekbarPlayedColor:a})}));var r=e.props.attributes,a=r.seekbarColor,o=r.seekbarPlayedColor,c=r.seekbarLoadingColor;return e.state={seekbarColor:a,seekbarPlayedColor:o,seekbarLoadingColor:c},e}return C()(n,[{key:"render",value:function(){var e=this.state,t=e.seekbarColor,n=e.seekbarPlayedColor,r=e.seekbarLoadingColor;return Object(p.createElement)(f.PanelColorSettings,{title:Object(v.__)("Progress Colors","jetpack"),initialOpen:!1,colorSettings:[{value:t,onChange:this.handleChangeSeekbarColor,label:Object(v.__)("Main","jetpack")},{value:r,onChange:this.handleChangeSeekbarLoadingColor,label:Object(v.__)("Loaded","jetpack")},{value:n,onChange:this.handleChangeSeekbarPlayedColor,label:Object(v.__)("Progress","jetpack")}]},Object(p.createElement)(d.Button,{isDefault:!0,onClick:this.saveColors},Object(v.__)("Save colors","jetpack")))}}]),n}(p.Component),$=["image"],K=function(e){var t=e.html,n=e.scripts,r=e.interactive,a=e.caption,o=e.isSelected,c=e.hideOverlay,i=e.attributes,l=e.setAttributes,s=i.align,u=i.className,m=i.videoPressClassNames,b=Object(f.useBlockProps)({className:F()("wp-block-video",u,m,M()({},"align".concat(s),s))});return Object(p.createElement)("figure",b,Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},Object(p.createElement)(d.SandBox,{html:t,scripts:n,type:m})),!r&&Object(p.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:c}),(!f.RichText.isEmpty(a)||o)&&Object(p.createElement)(f.RichText,{tagName:"figcaption",placeholder:Object(v.__)("Write caption…","jetpack"),value:a,onChange:function(e){return l({caption:e})},inlineToolbar:!0}))},Z=Object(j.createHigherOrderComponent)(Object(j.compose)([Object(L.withSelect)((function(e,t){var n=t.attributes,r=n.autoplay,a=n.controls,o=n.guid,c=n.loop,i=n.muted,l=n.playsinline,s=n.poster,u=n.preload,p=n.seekbarColor,d=n.seekbarLoadingColor,b=n.seekbarPlayedColor,h=n.src,f=e("core"),g=f.getEmbedPreview,j=f.isRequestingEmbedPreview,v=V(o,{autoplay:r,controls:a,loop:c,muted:i,playsinline:l,poster:s,preload:u,seekbarColor:p,seekbarLoadingColor:d,seekbarPlayedColor:b}),O=!!v&&g(v);return{isFetchingPreview:!!v&&j(v),isUploading:Object(m.isBlobURL)(h),preview:O,url:v}})),Object(L.withDispatch)((function(e){return{invalidateCachedEmbedPreview:function(t){e("core/data").invalidateResolution("core","getEmbedPreview",[t])}}})),j.withInstanceId,function(e){return function(t){A()(o,t);var n,r,a=P()(o);function o(){var e;return E()(this,o),e=a.apply(this,arguments),M()(S()(e),"hideOverlay",(function(){e.setState({interactive:!0})})),M()(S()(e),"setRating",_()(regeneratorRuntime.mark((function t(){var n,r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(O.get)(e.props,"attributes.id"),t.next=3,e.requestMedia(n);case 3:r=t.sent,(a=Object(O.get)(r,"jetpack_videopress.rating"))&&e.setState({rating:a});case 6:case"end":return t.stop()}}),t)})))),M()(S()(e),"fallbackToCore",(function(){e.props.setAttributes({guid:void 0}),e.setState({fallback:!0})})),M()(S()(e),"setGuid",_()(regeneratorRuntime.mark((function t(){var n,r,a,o,c,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.props,r=n.attributes,a=n.setAttributes,o=r.id){t.next=5;break}return a({guid:void 0}),t.abrupt("return");case 5:return t.prev=5,t.next=8,e.requestMedia(o);case 8:if(null!==(c=t.sent)){t.next=11;break}return t.abrupt("return");case 11:(i=Object(O.get)(c,"jetpack_videopress.guid"))?a({guid:i}):e.fallbackToCore(),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(5),e.setState({isFetchingMedia:!1}),e.fallbackToCore();case 19:case"end":return t.stop()}}),t,null,[[5,15]])})))),M()(S()(e),"requestMedia",function(){var t=_()(regeneratorRuntime.mark((function t(n){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return",null);case 2:if(null===e.state.media||e.state.lastRequestedMediaId!==n){t.next=4;break}return t.abrupt("return",e.state.media);case 4:return e.setState({isFetchingMedia:!0}),t.next=7,B()({path:"/wp/v2/media/".concat(n)}).catch((function(){return e.setState({fallback:!0}),null})).finally((function(){e.setState({isFetchingMedia:!1})}));case 7:if(r=t.sent,a=e.props.attributes.id,n===a){t.next=11;break}return t.abrupt("return",null);case 11:return e.setState({media:r,lastRequestedMediaId:n}),t.abrupt("return",r);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),M()(S()(e),"switchToEditing",(function(){e.props.setAttributes({id:void 0,guid:void 0,src:void 0})})),M()(S()(e),"onSelectPoster",(function(t){(0,e.props.setAttributes)({poster:t.url})})),M()(S()(e),"onRemovePoster",(function(){(0,e.props.setAttributes)({poster:""}),e.posterImageButton.current.focus()})),M()(S()(e),"toggleAttribute",(function(t){return function(n){e.props.setAttributes(M()({},t,n))}})),M()(S()(e),"getAutoplayHelp",(function(e){return e?Object(v.__)("Note: Autoplaying videos may cause usability issues for some visitors.","jetpack"):null})),M()(S()(e),"onChangeRating",(function(t){var n=e.props.attributes.id,r=e.state.rating;if(n&&-1!==Object(O.indexOf)(["G","PG-13","R-17","X-18"],t)){e.setState({isUpdatingRating:!0,rating:t});var a=function(){return e.setState({rating:r})};B()({path:"/wpcom/v2/videopress/meta",method:"POST",data:{id:n,rating:t}}).then((function(e){status in e&&200!==e.status&&a()})).catch((function(){return a()})).finally((function(){return e.setState({isUpdatingRating:!1})}))}})),e.state={media:null,isFetchingMedia:!1,fallback:!1,interactive:!1,rating:null,lastRequestedMediaId:null,isUpdatingRating:!1},e.posterImageButton=Object(p.createRef)(),e}return C()(o,[{key:"componentDidMount",value:(r=_()(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.attributes.guid){e.next=4;break}return e.next=4,this.setGuid();case 4:this.setRating();case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=_()(regeneratorRuntime.mark((function e(t){var n,r,a,o,c,i,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props,r=n.attributes,a=n.invalidateCachedEmbedPreview,o=n.preview,c=n.setAttributes,i=n.url,r.id===t.attributes.id){e.next=5;break}return e.next=4,this.setGuid();case 4:this.setRating();case 5:i&&i!==t.url&&a(i),o&&(l=q(o.html,F()("wp-block-embed","is-type-video","is-provider-videopress"),!0),c({videoPressClassNames:l}));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"render",value:function(){var t=this,n=this.props,r=n.attributes,a=n.instanceId,o=n.isFetchingPreview,c=n.isUploading,i=n.preview,l=n.setAttributes,s=this.state,m=s.fallback,b=s.isFetchingMedia,h=s.isUpdatingRating,g=s.interactive,j=s.rating,O=r.autoplay,k=r.caption,_=r.controls,y=r.loop,E=r.muted,w=r.playsinline,C=r.poster,x=r.preload,S="video-block__poster-image-description-".concat(a),N=Object(p.createElement)(p.Fragment,null,Object(p.createElement)(f.BlockControls,null,Object(p.createElement)(d.ToolbarGroup,null,Object(p.createElement)(d.ToolbarButton,{className:"components-icon-button components-toolbar__control",label:Object(v.__)("Edit video","jetpack"),onClick:this.switchToEditing,icon:"edit"}))),Object(p.createElement)(f.InspectorControls,null,Object(p.createElement)(d.PanelBody,{title:Object(v.__)("Video Settings","jetpack")},Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Autoplay","jetpack"),onChange:this.toggleAttribute("autoplay"),checked:O,help:this.getAutoplayHelp}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Loop","jetpack"),onChange:this.toggleAttribute("loop"),checked:y}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:E}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Playback Controls","jetpack"),onChange:this.toggleAttribute("controls"),checked:_}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Play Inline","jetpack"),onChange:this.toggleAttribute("playsinline"),checked:w}),Object(p.createElement)(d.SelectControl,{label:Object(v.__)("Preload","jetpack"),value:x,onChange:function(e){return l({preload:e})},options:[{value:"auto",label:Object(v._x)("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:Object(v._x)("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:Object(v._x)("None","VideoPress preload setting","jetpack")}]}),Object(p.createElement)(f.MediaUploadCheck,null,Object(p.createElement)(d.BaseControl,{className:"editor-video-poster-control",label:Object(v.__)("Poster Image","jetpack")},Object(p.createElement)(f.MediaUpload,{title:Object(v.__)("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:$,render:function(e){var n=e.open;return Object(p.createElement)(d.Button,{isDefault:!0,onClick:n,ref:t.posterImageButton,"aria-describedby":S},C?Object(v.__)("Replace image","jetpack"):Object(v.__)("Select Poster Image","jetpack"))}}),Object(p.createElement)("p",{id:S,hidden:!0},C?Object(v.sprintf)(Object(v.__)("The current poster image url is %s","jetpack"),C):Object(v.__)("There is no poster image currently selected","jetpack")),!!C&&Object(p.createElement)(d.Button,{onClick:this.onRemovePoster,isLink:!0,isDestructive:!0},Object(v.__)("Remove Poster Image","jetpack"))))),Object(p.createElement)(W,{attributes:r,setAttributes:l}),Object(p.createElement)(d.PanelBody,{title:Object(v.__)("Video File Settings","jetpack")},Object(p.createElement)(d.SelectControl,{label:Object(v._x)("Rating","The age rating for this video.","jetpack"),value:j,disabled:b||h,options:[{label:Object(v._x)("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:Object(v._x)("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:Object(v._x)("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"},{label:Object(v._x)("X",'Video rating for "Explicit" content.',"jetpack"),value:"X-18"}],onChange:this.onChangeRating}))));if(c)return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(z,{text:Object(v.__)("Uploading…","jetpack")}));if(b||o)return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(z,{text:Object(v.__)("Generating preview…","jetpack")}));if(m||!i)return Object(p.createElement)(e,this.props);var A=i.html,T=i.scripts;return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(K,u()({},this.props,{hideOverlay:this.hideOverlay,html:A,scripts:T,interactive:g,caption:k})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),o}(p.Component)}]),"withVideoPressEdit"),Y=Object(j.createHigherOrderComponent)((function(e){return function(t){var n=t.attributes,r=(n=void 0===n?{}:n).autoplay,a=n.caption,o=n.controls,c=n.guid,i=n.loop,l=n.muted,s=n.playsinline,u=n.poster,d=n.preload,m=n.videoPressClassNames,b=n.className,h=n.align,g=n.seekbarColor,j=n.seekbarPlayedColor,v=n.seekbarLoadingColor,O=f.useBlockProps.save({className:F()("wp-block-video",b,m,M()({},"align".concat(h),h))});if(!c)return e(t);var k=V(c,{autoplay:r,controls:o,loop:i,muted:l,playsinline:s,poster:u,preload:d,seekbarColor:g,seekbarPlayedColor:j,seekbarLoadingColor:v});return Object(p.createElement)("figure",O,Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(k,"\n")),!f.RichText.isEmpty(a)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:a}))}}),"withVideoPressSave"),J=n(49);var X={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"}},support:{reusable:!1},save:function(e){var t=e.attributes,n=t.caption,r=t.guid;if(!r)return null;var a="https://videopress.com/v/".concat(r);return Object(p.createElement)("figure",{className:"wp-block-embed is-type-video is-provider-videopress"},Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(a,"\n")),!f.RichText.isEmpty(n)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:n}))},isDeprecation:!0};var Q=n(136),ee=n.n(Q),te=n(95),ne=n.n(te),re=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],ae={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsInline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"},videoPressClassNames:{type:"string"},align:{type:"wide"}},support:{reusable:!1},isEligible:function(e){var t=e.videoPressClassNames;return e.guid&&void 0===t},migrate:function(e){var t=e.className,n=e.videoPressClassNames;return l()(l()({},e),function(e,t){var n=re.reduce((function(e,t){return e[t.className]=!1,e}),{"wp-has-aspect-ratio":!1}),r=ee()(e,l()(l()({},n),{},{"wp-block-embed":!1,"is-type-video":!1,"is-provider-videopress":!1})),a=new ne.a(r),o=ee()(e,t);return a.forEach((function(e){o=o.replace(e,"")})),{className:r,videoPressClassNames:o.trim()}}(t,n))},save:function(e){var t=e.attributes,n=(t=void 0===t?{}:t).autoplay,r=t.caption,a=t.controls,o=t.guid,c=t.loop,i=t.muted,s=t.poster,u=t.preload,d=t.videoPressClassNames;if(!o)return null;var m=function(e,t){var n=t.autoplay,r=t.controls,a=t.loop,o=t.muted,c=t.poster,i=t.preload;if(!e)return null;var s=l()(l()(l()(l()(l()(l()({},n&&{autoPlay:!0}),!r&&{controls:!1}),a&&{loop:!0}),o&&{muted:!0,persistVolume:!1}),c&&{posterUrl:c}),"none"!==i&&{preloadContent:i});return Object(U.addQueryArgs)("https://videopress.com/v/".concat(e),s)}(o,{autoplay:n,controls:a,loop:c,muted:i,poster:s,preload:u});return Object(p.createElement)("figure",{className:d},Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(m,"\n")),!f.RichText.isEmpty(r)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:r}))},isDeprecation:!0},oe=n(23),ce=n(107),ie=(n(379),Object(j.createHigherOrderComponent)((function(e){return function(t){return"core/video"!==Object(f.useBlockEditContext)().name?Object(p.createElement)(e,t):Object(p.createElement)(e,u()({},t,{disableDropZone:!0,className:"no-videopress-media-placeholder"}),Object(p.createElement)(d.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Object(v.__)("Media Library","jetpack")),Object(p.createElement)(d.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Object(v.__)("Upload","jetpack")))}}),"videoPressNoPlanMediaPlaceholder")),le=function(e,t,n){var r;return"core/video"!==t.name||!n.guid||(null===(r=n.className)||void 0===r?void 0:r.indexOf("wp-block-video"))>=0||n.videoPressClassNames||(e.className=e.className.replace("wp-block-video","").trim()),e};Object(g.addFilter)("blocks.registerBlockType","jetpack/videopress",(function(e,t){if("core/video"!==t||e.isDeprecation)return e;var n=e.attributes,r=e.deprecated,o=e.edit,i=e.save,s=e.supports,u=e.transforms,p=Object(J.a)("videopress"),d=p.available,f=p.unavailableReason;return(Object(oe.c)()||Object(oe.a)())&&["missing_plan","unknown"].includes(f)&&(Object(g.addFilter)("editor.MediaPlaceholder","jetpack/videopress",ie),Object(g.addFilter)("editor.BlockListBlock","jetpack/videopress-with-has-warning-is-interactive-class-names",Object(ce.a)("core/video"))),Object(g.addFilter)("blocks.getSaveContent.extraProps","jetpack/videopress",le,20),d||["missing_plan","missing_module","unknown"].includes(f)?l()(l()({},e),{},{attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsinline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},seekbarPlayedColor:{type:"string",default:""},seekbarLoadingColor:{type:"string",default:""},seekbarColor:{type:"string",default:""},src:{type:"string"},videoPressClassNames:{type:"string"}},transforms:l()(l()({},u),{},{from:[{type:"files",isMatch:function(e){return Object(O.every)(e,(function(e){return 0===e.type.indexOf("video/")}))},priority:9,transform:function(e,t){var n=[];return e.forEach((function(e){var r=Object(b.createBlock)("core/video",{src:Object(m.createBlobURL)(e)});Object(h.mediaUpload)({filesList:[e],onFileChange:function(e){var n=c()(e,1)[0],a=n.id,o=n.url;t(r.clientId,{id:a,src:o})},allowedTypes:["video"]}),n.push(r)})),n}}]}),supports:l()(l()({},s),{},{reusable:!1}),edit:Z(o),save:Y(i),deprecated:[].concat(a()(r||[]),[{attributes:n,isEligible:function(e){return!e.guid},save:i,supports:s,isDeprecation:!0},ae,X])}):e}),5)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(6),i=n(2),l=n(8),s=n.n(l),u=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],p=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]],d=function(e){var t=e.isSelected;return Object(a.createElement)("div",{className:s()({"jetpack-contact-info-block":!0,"is-selected":t})},Object(a.createElement)(c.InnerBlocks,{allowedBlocks:u,templateLock:!1,template:p}))},m=n(25),b=(n(297),n(216),n(12)),h=n.n(b),f=n(15),g=n.n(f),j=n(7),v=n.n(j),O=n(13),k=n.n(O),_=n(14),y=n.n(_),E=function(e){var t=e.attributes,n=t.address,r=t.addressLine2,o=t.addressLine3,c=t.city,i=t.region,l=t.postal,s=t.country;return Object(a.createElement)(a.Fragment,null,n&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address1"},n),r&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address2"},r),o&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address3"},o),c&&!(i||l)&&Object(a.createElement)("div",{className:"jetpack-address__city"},c),c&&(i||l)&&Object(a.createElement)("div",null,[Object(a.createElement)("span",{className:"jetpack-address__city"},c),", ",Object(a.createElement)("span",{className:"jetpack-address__region"},i)," ",Object(a.createElement)("span",{className:"jetpack-address__postal"},l)]),!c&&(i||l)&&Object(a.createElement)("div",null,[Object(a.createElement)("span",{className:"jetpack-address__region"},i)," ",Object(a.createElement)("span",{className:"jetpack-address__postal"},l)]),s&&Object(a.createElement)("div",{className:"jetpack-address__country"},s))},w=function(e){var t=e.attributes,n=t.address,r=t.addressLine2,a=t.addressLine3,o=t.city,c=t.region,i=t.postal,l=t.country,s=n?"".concat(n,","):"",u=r?"".concat(r,","):"",p=a?"".concat(a,","):"",d=o?"+".concat(o,","):"",m=c?"+".concat(c,","):"";m=i?"".concat(m,"+").concat(i):m;var b=l?"+".concat(l):"";return"https://www.google.com/maps/search/".concat(s).concat(u).concat(p).concat(d).concat(m).concat(b).replace(" ","+")},C=function(e){return[(t=e.attributes).address,t.addressLine2,t.addressLine3,t.city,t.region,t.postal,t.country].some((function(e){return""!==e}))&&Object(a.createElement)("div",{className:e.className},e.attributes.linkToGoogleMaps&&Object(a.createElement)("a",{href:w(e),target:"_blank",rel:"noopener noreferrer",title:Object(o.__)("Open address in Google Maps","jetpack")},Object(a.createElement)(E,e)),!e.attributes.linkToGoogleMaps&&Object(a.createElement)(E,e));var t},x=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).preventEnterKey=e.preventEnterKey.bind(v()(e)),e}return g()(n,[{key:"preventEnterKey",value:function(e){"Enter"!==e.key||e.preventDefault()}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.address,r=t.addressLine2,l=t.addressLine3,u=t.city,p=t.region,d=t.postal,m=t.country,b=t.linkToGoogleMaps,h=e.isSelected,f=e.setAttributes,g=[n,r,l,u,p,d,m].some((function(e){return""!==e})),j=s()({"jetpack-address-block":!0,"is-selected":h}),v=Object(a.createElement)(i.ToggleControl,{label:Object(o.__)("Link address to Google Maps","jetpack"),checked:b,onChange:function(e){return f({linkToGoogleMaps:e})}});return Object(a.createElement)("div",{className:j},!h&&g&&C(this.props),(h||!g)&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(c.PlainText,{value:n,placeholder:Object(o.__)("Street Address","jetpack"),"aria-label":Object(o.__)("Street Address","jetpack"),onChange:function(e){return f({address:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:r,placeholder:Object(o.__)("Address Line 2","jetpack"),"aria-label":Object(o.__)("Address Line 2","jetpack"),onChange:function(e){return f({addressLine2:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:l,placeholder:Object(o.__)("Address Line 3","jetpack"),"aria-label":Object(o.__)("Address Line 3","jetpack"),onChange:function(e){return f({addressLine3:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:u,placeholder:Object(o.__)("City","jetpack"),"aria-label":Object(o.__)("City","jetpack"),onChange:function(e){return f({city:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:p,placeholder:Object(o.__)("State/Province/Region","jetpack"),"aria-label":Object(o.__)("State/Province/Region","jetpack"),onChange:function(e){return f({region:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:d,placeholder:Object(o.__)("Postal/Zip Code","jetpack"),"aria-label":Object(o.__)("Postal/Zip Code","jetpack"),onChange:function(e){return f({postal:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:m,placeholder:Object(o.__)("Country","jetpack"),"aria-label":Object(o.__)("Country","jetpack"),onChange:function(e){return f({country:e})},onKeyDown:this.preventEnterKey}),v))}}]),n}(a.Component),S={title:Object(o.__)("Address","jetpack"),description:Object(o.__)("Lets you add a physical address with Schema markup.","jetpack"),keywords:[Object(o._x)("location","block search term","jetpack"),Object(o._x)("direction","block search term","jetpack"),Object(o._x)("place","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),Object(a.createElement)(i.Circle,{cx:"12",cy:"9",r:"2.5"}))),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:x,save:C},N=n(68),A=n.n(N),T=function(e){var t=e.attributes.email,n=e.className;return t&&Object(a.createElement)("div",{className:n},t.split(/(\s+)/).map((function(e,t){var n=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&A.a.validate(n)?e===n?Object(a.createElement)("a",{href:"mailto:".concat(e),key:t},e):Object(a.createElement)(a.Fragment,{key:t},Object(a.createElement)("a",{href:"mailto:".concat(e),key:t},n),Object(a.createElement)(a.Fragment,null,e.slice(-(e.length-n.length)))):Object(a.createElement)(a.Fragment,{key:t},e)})))},P=function(e,t,n,r,o){var i=t.isSelected,l=t.attributes[e];return Object(a.createElement)("div",{className:"jetpack-".concat(e,i?"-block is-selected":"-block")},!i&&""!==l&&r(t),(i||""===l)&&Object(a.createElement)(c.PlainText,{value:l,placeholder:n,"aria-label":n,onChange:o}))},I=function(e){var t=e.setAttributes;return P("email",e,Object(o.__)("Email","jetpack"),T,(function(e){return t({email:e})}))},M={title:Object(o.__)("Email Address","jetpack"),description:Object(o.__)("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",Object(o._x)("message","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(i.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),category:"grow",attributes:{email:{type:"string",default:""}},edit:I,save:T,parent:["jetpack/contact-info"]};var R=function(e){var t=e.attributes.phone,n=e.className;return t&&Object(a.createElement)("div",{className:n},function(e){var t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;var n=e.indexOf(t[0]),r=n?e.substring(n-1):e,o=n?e.substring(0,n):"",c=r.replace(/\D/g,"");return/[0-9/+/(]/.test(r[0])?(o=o.slice(0,-1),"+"===r[0]&&(c="+"+c)):r=r.substring(1),[o.trim()?Object(a.createElement)("span",{key:"phonePrefix",className:"phone-prefix"},o):null,Object(a.createElement)("a",{key:"phoneNumber",href:"tel:".concat(c)},r)]}(t))},B=function(e){var t=e.setAttributes;return P("phone",e,Object(o.__)("Phone number","jetpack"),R,(function(e){return t({phone:e})}))},L={title:Object(o.__)("Phone Number","jetpack"),description:Object(o.__)("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[Object(o._x)("mobile","block search term","jetpack"),Object(o._x)("telephone","block search term","jetpack"),Object(o._x)("cell","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(i.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:B,save:R},D=n(16),F=Object(m.a)(Object(a.createElement)(i.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 9c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm6 10H6v-1.53c0-2.5 3.97-3.58 6-3.58s6 1.08 6 3.58V18zm-9.69-2h7.38c-.69-.56-2.38-1.12-3.69-1.12s-3.01.56-3.69 1.12z"})),z={title:Object(o.__)("Contact Info","jetpack"),description:Object(o.__)("Lets you add an email address, phone number, and physical address with improved markup for better SEO results.","jetpack"),keywords:[Object(o._x)("email","block search term","jetpack"),Object(o._x)("phone","block search term","jetpack"),Object(o._x)("address","block search term","jetpack")],icon:{src:F,foreground:Object(D.a)()},category:"grow",supports:{align:["wide","full"],html:!1},attributes:{},edit:d,save:function(e){var t=e.className;return Object(a.createElement)("div",{className:t},Object(a.createElement)(c.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"jetpack/email",attributes:{email:"hello@yourjetpack.blog"}},{name:"jetpack/phone",attributes:{phone:"123-456-7890"}},{name:"jetpack/address",attributes:{address:"987 Photon Drive",city:"Speedyville",region:"CA",postal:"12345",country:"USA"}}]}},U=[{name:"address",settings:S},{name:"email",settings:M},{name:"phone",settings:L}];Object(r.a)("contact-info",z,U)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(38),o=n(12),c=n.n(o),i=n(15),l=n.n(i),s=n(7),u=n.n(s),p=n(13),d=n.n(p),m=n(14),b=n.n(m),h=n(5),f=n.n(h),g=n(0),j=n(22),v=n.n(j),O=n(1),k=n(2),_=n(6),y=(n(308),n(19)),E=n.n(y),w=n(8),C=n.n(w),x=n(3),S=n(24),N=n(17);function A(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=[],r=0;r<e.length;r++){var a=e[r],o=a.keywords,c=void 0===o?[]:o;if("string"==typeof a.label&&(c=[].concat(E()(c),[a.label])),n.push(a),n.length===t)break}return n}var T=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"select",(function(t){(e.props.completer.getOptionCompletion||{})(t),e.reset()})),f()(u()(e),"reset",(function(){e.setState(e.constructor.getInitialState())})),f()(u()(e),"onChange",(function(t){var n=e.props.completer,r=e.state.options;if(t){n&&(n.isDebounced?e.debouncedLoadOptions(n,t):e.loadOptions(n,t));var a=n?A(r):[];n&&e.setState({selectedIndex:0,filteredOptions:a,query:t})}else e.reset()})),f()(u()(e),"onKeyDown",(function(t){var n=e.state,r=n.isOpen,a=n.selectedIndex,o=n.filteredOptions;if(r){var c;switch(t.keyCode){case S.UP:c=(0===a?o.length:a)-1,e.setState({selectedIndex:c});break;case S.DOWN:c=(a+1)%o.length,e.setState({selectedIndex:c});break;case S.ENTER:e.select(o[a]);break;case S.LEFT:case S.RIGHT:case S.ESCAPE:return void e.reset();default:return}t.preventDefault(),t.stopPropagation()}})),e.debouncedLoadOptions=Object(x.debounce)(e.loadOptions,250),e.state=e.constructor.getInitialState(),e}return l()(n,[{key:"componentWillUnmount",value:function(){this.debouncedLoadOptions.cancel()}},{key:"handleFocusOutside",value:function(){this.reset()}},{key:"loadOptions",value:function(e,t){var n=this,r=e.options,a=this.activePromise=Promise.resolve("function"==typeof r?r(t):r).then((function(t){var r;if(a===n.activePromise){var o=t.map((function(t,n){return{key:"".concat(n),value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[]}})),c=A(o),i=c.length===n.state.filteredOptions.length?n.state.selectedIndex:0;n.setState((r={},f()(r,"options",o),f()(r,"filteredOptions",c),f()(r,"selectedIndex",i),f()(r,"isOpen",c.length>0),r)),n.announce(c)}}))}},{key:"announce",value:function(e){var t=this.props.debouncedSpeak;t&&(e.length?t(Object(O.sprintf)(Object(O._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,"jetpack","jetpack"),e.length),"assertive"):t(Object(O.__)("No results.","jetpack"),"assertive"))}},{key:"render",value:function(){var e=this,t=this.onChange,n=this.onKeyDown,r=this.props,a=r.children,o=r.instanceId,c=r.completer,i=this.state,l=i.selectedIndex,s=i.filteredOptions,u=(s[l]||{}).key,p=void 0===u?"":u,d=c.className,m=s.length>0,b=m?"components-autocomplete-listbox-".concat(o):null,h=m?"components-autocomplete-item-".concat(o,"-").concat(p):null;return Object(g.createElement)("div",{className:"components-autocomplete"},a({isExpanded:m,listBoxId:b,activeId:h,onChange:t,onKeyDown:n}),m&&Object(g.createElement)(k.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0},Object(g.createElement)("div",{id:b,role:"listbox",className:"components-autocomplete__results"},Object(x.map)(s,(function(t,n){return Object(g.createElement)(k.Button,{key:t.key,id:"components-autocomplete-item-".concat(o,"-").concat(t.key),role:"option","aria-selected":n===l,disabled:t.isDisabled,className:C()("components-autocomplete__result",d,{"is-selected":n===l}),onClick:function(){return e.select(t)}},t.label)})))))}}],[{key:"getInitialState",value:function(){return{selectedIndex:0,query:void 0,filteredOptions:[],isOpen:!1}}}]),n}(g.Component),P=Object(N.compose)([k.withSpokenMessages,N.withInstanceId,k.withFocusOutside])(T),I=Object(O.__)("Add a marker…","jetpack"),M=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"getOptionCompletion",(function(t){var n=t.value,r={placeTitle:n.text,title:n.text,caption:n.place_name,id:n.id,coordinates:{longitude:n.geometry.coordinates[0],latitude:n.geometry.coordinates[1]}};return e.props.onAddPoint(r),n.text})),f()(u()(e),"search",(function(t){var n=e.props,r=n.apiKey,a=n.onError,o="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURI(t)+".json?access_token="+r;return new Promise((function(e,t){var n=new XMLHttpRequest;n.open("GET",o),n.onload=function(){if(200===n.status){var r=JSON.parse(n.responseText);e(r.features)}else{var o=JSON.parse(n.responseText);a(o.statusText,o.responseJSON.message),t(new Error("Mapbox Places Error"))}},n.send()}))})),f()(u()(e),"onReset",(function(){e.textRef.current.value=null})),e.textRef=Object(g.createRef)(),e.containerRef=Object(g.createRef)(),e.state={isEmpty:!0},e.autocompleter={name:"placeSearch",options:e.search,isDebounced:!0,getOptionLabel:function(e){return Object(g.createElement)("span",null,e.place_name)},getOptionKeywords:function(e){return[e.place_name]},getOptionCompletion:e.getOptionCompletion},e}return l()(n,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.containerRef.current.querySelector("input").focus()}),50)}},{key:"render",value:function(){var e=this,t=this.props.label;return Object(g.createElement)("div",{ref:this.containerRef},Object(g.createElement)(k.BaseControl,{label:t,className:"components-location-search"},Object(g.createElement)(P,{completer:this.autocompleter,onReset:this.onReset},(function(t){var n=t.isExpanded,r=t.listBoxId,a=t.activeId,o=t.onChange,c=t.onKeyDown;return Object(g.createElement)(k.TextControl,{placeholder:I,ref:e.textRef,onChange:o,"aria-expanded":n,"aria-owns":r,"aria-activedescendant":a,onKeyDown:c})}))))}}]),n}(g.Component);M.defaultProps={onError:function(){}};var R=M,B=function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.onAddPoint,r=e.onError,a=e.apiKey;return Object(g.createElement)(k.Button,{className:"component__add-point"},Object(O.__)("Add marker","jetpack"),Object(g.createElement)(k.Popover,{className:"component__add-point__popover",position:"bottom center"},Object(g.createElement)(k.Button,{className:"component__add-point__close",onClick:t},Object(g.createElement)(k.Dashicon,{icon:"no"})),Object(g.createElement)(R,{onAddPoint:n,label:Object(O.__)("Add a location","jetpack"),apiKey:a,onError:r})))}}]),n}(g.Component);B.defaultProps={onAddPoint:function(){},onClose:function(){},onError:function(){}};var L=B,D=n(155),F=(n(309),function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"onDeletePoint",(function(t){var n=parseInt(t.target.getAttribute("data-id")),r=e.props,a=r.points,o=r.onChange,c=a.slice(0);c.splice(n,1),o(c)})),e.state={selectedCell:null},e}return l()(n,[{key:"setMarkerField",value:function(e,t,n){var r=this.props,a=r.points,o=r.onChange,c=a.slice(0);c[n][e]=t,o(c)}},{key:"render",value:function(){var e=this,t=this.props.points.map((function(t,n){return Object(g.createElement)(k.PanelBody,{title:t.placeTitle,key:t.id,initialOpen:!1},Object(g.createElement)(k.TextControl,{label:"Marker Title",value:t.title,onChange:function(t){return e.setMarkerField("title",t,n)}}),Object(g.createElement)(k.TextareaControl,{label:"Marker Caption",value:t.caption,rows:"3",onChange:function(t){return e.setMarkerField("caption",t,n)}}),Object(g.createElement)(k.Button,{"data-id":n,onClick:e.onDeletePoint,className:"component__locations__delete-btn"},Object(g.createElement)(k.Dashicon,{icon:"trash",size:"15"})," Delete Marker"))}));return Object(g.createElement)("div",{className:"component__locations"},Object(g.createElement)(k.Panel,{className:"component__locations__panel"},t))}}]),n}(g.Component));F.defaultProps={points:Object.freeze([]),onChange:function(){}};var z=F,U=function(e){var t=e.attributes,n=e.setAttributes,r=e.state,o=e.setState,c=e.context,i=e.mapRef,l=e.instanceId,s=e.minHeight,u=e.removeAPIKey,p=e.updateAPIKey,d=e.setPointVisibility;return"toolbar"===c?Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.BlockAlignmentToolbar,{value:t.align,onChange:function(e){n({align:e}),setTimeout(i.current.sizeMap,0)},controls:["center","wide","full"]}),Object(g.createElement)(k.ToolbarGroup,null,Object(g.createElement)(k.ToolbarButton,{icon:a.a.markerIcon,label:Object(O.__)("Add a marker","jetpack"),onClick:d}))):Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.PanelColorSettings,{title:Object(O.__)("Colors","jetpack"),initialOpen:!0,colorSettings:[{value:t.markerColor,onChange:function(e){return n({markerColor:e})},label:Object(O.__)("Marker Color","jetpack")}]}),Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Map Settings","jetpack")},Object(g.createElement)(k.BaseControl,{label:Object(O.__)("Height in pixels","jetpack"),id:"block-jetpack-map-height-input-".concat(l)},Object(g.createElement)("input",{type:"number",id:"block-jetpack-map-height-input-".concat(l),className:"wp-block-jetpack-map__height_input",onChange:function(e){n({mapHeight:e.target.value}),e.target!==document.activeElement&&setTimeout(i.current.sizeMap,0)},onBlur:function(e){var r=t.mapHeight,a=parseInt(e.target.value,10);isNaN(a)?a=null:null==r?a=i.current.mapRef.current.offsetHeight:a<s&&(a=s),n({mapHeight:a}),setTimeout(i.current.sizeMap,0)},value:t.mapHeight||"",min:s,step:"10"})),Object(g.createElement)(k.RangeControl,{label:Object(O.__)("Zoom level","jetpack"),help:t.points.length>1&&Object(O.__)("The default zoom level cannot be changed when there are two or more markers on the map.","jetpack"),disabled:t.points.length>1,value:t.zoom,onChange:function(e){n({zoom:e}),setTimeout(i.current.updateZoom,0)},min:0,max:22}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Show street names","jetpack"),checked:t.mapDetails,onChange:function(e){return n({mapDetails:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Scroll to zoom","jetpack"),help:Object(O.__)("Allow the map to capture scrolling, and zoom in or out.","jetpack"),checked:t.scrollToZoom,onChange:function(e){return n({scrollToZoom:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Show Fullscreen Button","jetpack"),help:Object(O.__)("Allow your visitors to display the map in fullscreen.","jetpack"),checked:t.showFullscreenButton,onChange:function(e){return n({showFullscreenButton:e})}})),t.points.length?Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Markers","jetpack"),initialOpen:!1},Object(g.createElement)(z,{points:t.points,onChange:function(e){n({points:e})}})):null,Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Mapbox Access Token","jetpack"),initialOpen:!1},Object(g.createElement)(k.TextControl,{help:"wpcom"===r.apiKeySource&&Object(g.createElement)(g.Fragment,null,Object(O.__)("You can optionally enter your own access token.","jetpack")," ",Object(g.createElement)(k.ExternalLink,{href:"https://account.mapbox.com/access-tokens/"},Object(O.__)("Find it on Mapbox","jetpack"))),label:Object(O.__)("Mapbox Access Token","jetpack"),value:r.apiKeyControl,onChange:function(e){return o({apiKeyControl:e})}}),Object(g.createElement)(k.ButtonGroup,null,Object(g.createElement)(k.Button,{type:"button",onClick:p,disabled:!r.apiKeyControl||r.apiKeyControl===r.apiKey},Object(O.__)("Update Token","jetpack")),Object(g.createElement)(k.Button,{type:"button",onClick:u,disabled:"wpcom"===r.apiKeySource,isSecondary:!0},Object(O.__)("Remove Token","jetpack")))))},V=n(191),G=n.n(V),H=n(10),q=n(42),W={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},$=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"addPoint",(function(t){var n=e.props,r=n.attributes,a=n.setAttributes,o=r.points,c=o.slice(0),i=!1;o.map((function(e){e.id===t.id&&(i=!0)})),i||(c.push(t),a({points:c}),e.setState({addPointVisibility:!1}))})),f()(u()(e),"setPointVisibility",(function(){e.setState({addPointVisibility:!0})})),f()(u()(e),"updateAPIKeyControl",(function(t){e.setState({apiKeyControl:t.target.value})})),f()(u()(e),"updateAPIKey",(function(){var t=e.props.noticeOperations,n=e.state.apiKeyControl;t.removeAllNotices(),n&&e.apiCall(n,"POST")})),f()(u()(e),"removeAPIKey",(function(){e.apiCall(null,"DELETE")})),f()(u()(e),"onError",(function(t,n){var r=e.props.noticeOperations;r.removeAllNotices(),r.createErrorNotice(n)})),f()(u()(e),"onMapResize",(function(t,n,r,a){var o=e.props,c=o.onResizeStop,i=o.setAttributes;c(),i({mapHeight:parseInt(e.mapRef.current.mapRef.current.offsetHeight+a.height,10)}),setTimeout(e.mapRef.current.sizeMap,0)})),e.state={addPointVisibility:!1,apiState:0},e.mapRef=Object(g.createRef)(),e}return l()(n,[{key:"apiCall",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=this.props.noticeOperations,a="/wpcom/v2/service-api-keys/mapbox",o=t?{path:a,method:n,data:{service_api_key:t}}:{path:a,method:n};this.setState({apiRequestOutstanding:!0},(function(){v()(o).then((function(t){var n=t.service_api_key,a=t.service_api_key_source;r.removeAllNotices();var o=n?2:1,c="wpcom"===a?"":n;e.setState({apiState:o,apiKey:n,apiKeyControl:c,apiKeySource:a,apiRequestOutstanding:!1})}),(function(t){var n=t.message;e.onError(null,n),e.setState({apiState:1,apiRequestOutstanding:!1})}))}))}},{key:"componentDidMount",value:function(){this.apiCall()}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.setAttributes,o=t.attributes,c=t.noticeUI,i=t.notices,l=t.isSelected,s=t.instanceId,u=t.onResizeStart,p=o.mapDetails,d=o.points,m=o.zoom,b=o.mapCenter,h=o.markerColor,f=o.preview,j=o.mapHeight,v=o.showFullscreenButton,y=this.state,E=y.addPointVisibility,w=y.apiKey,C=y.apiKeyControl,x=y.apiState,S=y.apiRequestOutstanding,N=Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.BlockControls,null,Object(g.createElement)(U,{attributes:o,setAttributes:r,state:this.state,setPointVisibility:this.setPointVisibility,context:"toolbar",mapRef:this.mapRef})),Object(g.createElement)(_.InspectorControls,null,Object(g.createElement)(U,{attributes:o,setAttributes:r,state:this.state,setState:this.setState,mapRef:this.mapRef,instanceId:s,minHeight:400,removeAPIKey:this.removeAPIKey,updateAPIKey:this.updateAPIKey}))),A=Object(g.createElement)(k.Placeholder,{icon:a.a.icon},Object(g.createElement)(k.Spinner,null)),T=Object(g.createElement)(g.Fragment,null,Object(O.__)("To use the map block, you need an Access Token.","jetpack"),Object(g.createElement)("br",null),Object(g.createElement)(k.ExternalLink,{href:"https://www.mapbox.com"},Object(O.__)("Create an account or log in to Mapbox.","jetpack")),Object(g.createElement)("br",null),Object(O.__)("Locate and copy the default access token. Then, paste it into the field below.","jetpack")),P=Object(g.createElement)(k.Placeholder,{icon:a.a.icon,label:Object(O.__)("Map","jetpack"),notices:i,instructions:T},Object(g.createElement)(g.Fragment,null,Object(g.createElement)("form",null,Object(g.createElement)("input",{type:"text",className:"components-placeholder__input",disabled:S,placeholder:Object(O.__)("Paste Token Here","jetpack"),value:C,onChange:this.updateAPIKeyControl}),Object(g.createElement)(k.Button,{isSecondary:!0,disabled:S||!C||C.length<1,onClick:this.updateAPIKey},Object(O.__)("Set Token","jetpack"))))),I=l&&d.length<=1,M=Object(q.a)(a.a.styles,o.className),R=Object(g.createElement)(g.Fragment,null,N,Object(g.createElement)("div",{className:n},Object(g.createElement)(k.ResizableBox,{size:{height:j||"auto",width:"100%"},grid:[10,10],showHandle:l,minHeight:400,enable:W,onResizeStart:u,onResizeStop:this.onMapResize},Object(g.createElement)("div",{className:"wp-block-jetpack-map__map_wrapper"},Object(g.createElement)(D.a,{ref:this.mapRef,scrollToZoom:I,showFullscreenButton:v,mapStyle:M||"default",mapDetails:p,mapHeight:j,points:d,zoom:m,mapCenter:b,markerColor:h,onSetZoom:function(e){r({zoom:e})},admin:!0,apiKey:w,onSetPoints:function(e){return r({points:e})},onSetMapCenter:function(e){return r({mapCenter:e})},onMapLoaded:function(){return e.setState({addPointVisibility:!d.length})},onMarkerClick:function(){return e.setState({addPointVisibility:!1})},onError:this.onError},l&&E&&Object(g.createElement)(L,{onAddPoint:this.addPoint,onClose:function(){return e.setState({addPointVisibility:!1})},apiKey:w,onError:this.onError,tagName:"AddPoint"})))))),B=a.a.styles.find((function(e){return e.name===M})),F=Object(g.createElement)("div",null,Object(g.createElement)("img",{alt:Object(O.__)("Map Preview","jetpack"),src:B?B.preview:G.a}));return Object(g.createElement)(g.Fragment,null,c,f&&F,!f&&0===x&&A,!f&&1===x&&P,!f&&2===x&&R)}}]),n}(g.Component),K=Object(N.compose)([k.withNotices,Object(H.withDispatch)((function(e){var t=e("core/block-editor").toggleSelection;return{onResizeStart:function(){return t(!1)},onResizeStop:function(){return t(!0)}}}))])($),Z=function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.className,r=e.mapDetails,o=e.points,c=e.zoom,i=e.mapCenter,l=e.markerColor,s=e.scrollToZoom,u=e.mapHeight,p=e.showFullscreenButton,d=Object(q.a)(a.a.styles,n),m=o.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),b=t?"align".concat(t):null;return Object(g.createElement)("div",{className:b,"data-map-style":d,"data-map-details":r,"data-points":JSON.stringify(o),"data-zoom":c,"data-map-center":JSON.stringify(i),"data-marker-color":l,"data-scroll-to-zoom":s||null,"data-map-height":u||null,"data-show-fullscreen-button":p||null},o.length>0&&Object(g.createElement)("ul",null,m))}}]),n}(g.Component),Y=n(4),J=n.n(Y),X=n(34),Q=n.n(X),ee={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"}},migrate:function(e){var t=((e.className||"").replace(/is-style-[^ ]+/,"")+" is-style-".concat(e.mapStyle)).replace(/\s+/g," ").trim(),n=(e.mapStyle,Q()(e,["mapStyle"]));return J()(J()({},n),{},{showFullscreenButton:!0,className:t})},save:function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.mapStyle,r=e.mapDetails,a=e.points,o=e.zoom,c=e.mapCenter,i=e.markerColor,l=e.scrollToZoom,s=e.mapHeight,u=a.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),p=t?"align".concat(t):null;return Object(g.createElement)("div",{className:p,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(a),"data-zoom":o,"data-map-center":JSON.stringify(c),"data-marker-color":i,"data-scroll-to-zoom":l||null,"data-map-height":s||null},a.length>0&&Object(g.createElement)("ul",null,u))}}]),n}(g.Component)},te={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"},showFullscreenButton:{type:"boolean",default:!0}},migrate:function(e){var t=((e.className||"").replace(/is-style-[^ ]+/,"")+" is-style-".concat(e.mapStyle)).replace(/\s+/g," ").trim(),n=(e.mapStyle,Q()(e,["mapStyle"]));return J()(J()({},n),{},{className:t})},save:function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.mapStyle,r=e.mapDetails,a=e.points,o=e.zoom,c=e.mapCenter,i=e.markerColor,l=e.scrollToZoom,s=e.mapHeight,u=e.showFullscreenButton,p=a.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),d=t?"align".concat(t):null;return Object(g.createElement)("div",{className:d,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(a),"data-zoom":o,"data-map-center":JSON.stringify(c),"data-marker-color":i,"data-scroll-to-zoom":l||null,"data-map-height":s||null,"data-show-fullscreen-button":u||null},a.length>0&&Object(g.createElement)("ul",null,p))}}]),n}(g.Component)},ne=(n(235),n(310),n(16)),re=a.a.name,ae={title:a.a.title,icon:{src:a.a.icon,foreground:Object(ne.a)()},category:a.a.category,keywords:a.a.keywords,description:a.a.description,attributes:a.a.attributes,supports:a.a.supports,styles:a.a.styles,getEditWrapperProps:function(e){var t=e.align;if(-1!==a.a.validAlignments.indexOf(t))return{"data-align":t}},edit:K,save:Z,example:a.a.example,deprecated:[te,ee]};Object(r.a)(re,ae)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i="jp_pay_product",l="USD",s=[l,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"],u=n(23),p=n(16),d=n(4),m=n.n(d),b=n(12),h=n.n(b),f=n(15),g=n.n(f),j=n(7),v=n.n(j),O=n(13),k=n.n(O),_=n(14),y=n.n(_),E=n(5),w=n.n(E),C=n(8),x=n.n(C),S=n(68),N=n.n(S),A=n(3),T=n(53),P=n(17),I=n(10),M=n(6),R=n(50),B=(n(373),n(193)),L=n.n(B),D=n(194),F=n.n(D),z=function(e){var t=e.title,n=void 0===t?"":t,r=e.content,c=void 0===r?"":r,i=e.formattedPrice,l=void 0===i?"":i,s=e.multiple,u=void 0!==s&&s,p=e.featuredMediaUrl,d=void 0===p?null:p,m=e.featuredMediaTitle,b=void 0===m?null:m;return Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper"},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},d&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("figure",{className:"jetpack-simple-payments-image"},Object(a.createElement)("img",{src:d,alt:b}))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},n&&Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,n)),c&&Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,c)),l&&Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,l)),Object(a.createElement)("div",{className:"jetpack-simple-payments-purchase-box"},u&&Object(a.createElement)("div",{className:"jetpack-simple-payments-items"},Object(a.createElement)("input",{className:"jetpack-simple-payments-items-number",readOnly:!0,type:"number",value:"1"})),Object(a.createElement)("div",{className:"jetpack-simple-payments-button"},Object(a.createElement)("img",{alt:Object(o.__)("Pay with PayPal","jetpack"),src:L.a,srcSet:"".concat(F.a," 2x")}))))))},U=n(73),V=function(e){return function(t){return e({featuredMediaId:Object(A.get)(t,"id",0),featuredMediaUrl:Object(A.get)(t,"url",null),featuredMediaTitle:Object(A.get)(t,"title",null)})}},G=function(e){var t=e.featuredMediaId,n=e.featuredMediaUrl,r=e.featuredMediaTitle,i=e.setAttributes;return t?Object(a.createElement)("div",null,Object(a.createElement)(a.Fragment,null,Object(a.createElement)(M.BlockControls,null,Object(a.createElement)(c.ToolbarGroup,null,Object(a.createElement)(c.ToolbarItem,null,(function(){return Object(a.createElement)(M.MediaUpload,{onSelect:V(i),allowedTypes:["image"],value:t,render:function(e){var t=e.open;return Object(a.createElement)(U.a,{label:Object(o.__)("Edit Image","jetpack"),onClick:t})}})})),Object(a.createElement)(c.ToolbarButton,{icon:"trash",title:Object(o.__)("Remove Image","jetpack"),onClick:function(){return i({featuredMediaId:null,featuredMediaUrl:null,featuredMediaTitle:null})}}))),Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:n,alt:r})))):Object(a.createElement)(M.MediaPlaceholder,{icon:Object(a.createElement)(M.BlockIcon,{icon:"format-image"}),labels:{title:Object(o.__)("Product Image","jetpack")},accept:"image/*",allowedTypes:["image"],onSelect:V(i)})},H=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},q=function(){var e,t,n,r,a,o,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",i=null===(e=window)||void 0===e||null===(t=e.window)||void 0===t?void 0:t.navigator;return null!=i&&null!==(n=i.languages)&&void 0!==n&&n.length?i.languages[0]:null!==(r=null!==(a=null!==(o=null==i?void 0:i.userLanguage)&&void 0!==o?o:null==i?void 0:i.language)&&void 0!==a?a:null==i?void 0:i.browserLanguage)&&void 0!==r?r:c},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Object(T.b)(t),a=r.precision,o=r.symbol,c=e.toFixed(a);return n?"".concat(c," ").concat(Object(A.trimEnd)(o,".")):c},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!window.Intl||"function"!=typeof Intl.NumberFormat)return W(e,t,n);var r,a=Object(I.select)("core/block-editor").getSettings(),o=a.siteLocale,c=[o,q(),"en-US"],i={};n&&(i={style:"currency",currency:t});for(var l=0,s=c;l<s.length;l++){r=s[l];try{return Intl.NumberFormat(r,i).format(e)}catch(u){continue}}return W(e,t,n)};function K(e){var t=e.setAttributes,n=e.postLinkText;return Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Settings","jetpack"),initialOpen:!1},Object(a.createElement)(c.BaseControl,{label:Object(o.__)("Purchase link text","jetpack"),help:Object(o.__)("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},Object(a.createElement)(c.TextControl,{placeholder:Object(o.__)("Click here to purchase","jetpack"),onChange:function(e){return t({postLinkText:e})},value:n})))}var Z=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),w()(v()(e),"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),w()(v()(e),"shouldInjectPaymentAttributes",!!e.props.attributes.productId),w()(v()(e),"validateAttributes",(function(){var t=e.validatePrice(),n=e.validateTitle(),r=e.validateEmail(),a=e.validateCurrency();return t&&n&&r&&a})),w()(v()(e),"validateCurrency",(function(){var t=e.props.attributes.currency;return s.includes(t)})),w()(v()(e),"validatePrice",(function(){var t=e.props.attributes,n=t.currency,r=t.price,a=Object(T.b)(n).precision;return r&&0!==parseFloat(r)?Number.isNaN(parseFloat(r))?(e.setState({fieldPriceError:Object(o.__)("Invalid price","jetpack")}),!1):parseFloat(r)<0?(e.setState({fieldPriceError:Object(o.__)("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):H(r)>a?0===a?(e.setState({fieldPriceError:Object(o.__)("We know every penny counts, but prices in this currency can’t contain decimal values.","jetpack")}),!1):(e.setState({fieldPriceError:Object(o.sprintf)(Object(o._n)("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",a,"jetpack"),a)}),!1):(e.state.fieldPriceError&&e.setState({fieldPriceError:null}),!0):(e.setState({fieldPriceError:Object(o.__)("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),w()(v()(e),"validateEmail",(function(){var t=e.props.attributes.email;return t?N.a.validate(t)?(e.state.fieldEmailError&&e.setState({fieldEmailError:null}),!0):(e.setState({fieldEmailError:Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),t)}),!1):(e.setState({fieldEmailError:Object(o.__)("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),w()(v()(e),"validateTitle",(function(){return e.props.attributes.title?(e.state.fieldTitleError&&e.setState({fieldTitleError:null}),!0):(e.setState({fieldTitleError:Object(o.__)("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),w()(v()(e),"handleEmailChange",(function(t){e.props.setAttributes({email:t}),e.setState({fieldEmailError:null})})),w()(v()(e),"handleContentChange",(function(t){e.props.setAttributes({content:t})})),w()(v()(e),"handlePriceChange",(function(t){t=parseFloat(t),isNaN(t)?e.props.setAttributes({price:void 0}):e.props.setAttributes({price:t}),e.setState({fieldPriceError:null})})),w()(v()(e),"handleCurrencyChange",(function(t){e.props.setAttributes({currency:t})})),w()(v()(e),"handleMultipleChange",(function(t){e.props.setAttributes({multiple:!!t})})),w()(v()(e),"handleTitleChange",(function(t){e.props.setAttributes({title:t}),e.setState({fieldTitleError:null})})),w()(v()(e),"getCurrencyList",s.map((function(e){var t=Object(T.b)(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(A.trimEnd)(t,"."))}}))),w()(v()(e),"renderSettings",(function(){return Object(a.createElement)(M.InspectorControls,null,Object(a.createElement)(K,{postLinkText:e.props.attributes.postLinkText,setAttributes:e.props.setAttributes}))})),e}return g()(n,[{key:"componentDidMount",value:function(){this.injectPaymentAttributes();var e=this.props,t=e.attributes,n=e.hasPublishAction,r=e.postLinkUrl,a=e.setAttributes,c=e.isPostEditor;(!t.productId&&n||!c)&&this.saveProduct();var i=r&&r!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&a(m()(m()({},i&&{postLinkUrl:r}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.hasPublishAction,r=t.isSelected,a=t.postLinkUrl,c=t.setAttributes;Object(A.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&n&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();var i=a&&a!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&c(m()(m()({},i&&{postLinkUrl:a}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"injectPaymentAttributes",value:function(){var e=this.props,t=e.simplePayment,n=e.featuredMedia;if(this.shouldInjectPaymentAttributes&&!Object(A.isEmpty)(t)){var r=this.props,a=r.attributes,o=r.setAttributes,c=a.content,i=a.currency,l=a.email,s=a.featuredMediaId,u=a.featuredMediaUrl,p=a.featuredMediaTitle,d=a.multiple,m=a.price,b=a.title;o({content:Object(A.get)(t,["content","raw"],c),currency:Object(A.get)(t,["meta","spay_currency"],i),email:Object(A.get)(t,["meta","spay_email"],l),featuredMediaId:Object(A.get)(t,["featured_media"],s),featuredMediaUrl:Object(A.get)(n,"url",u),featuredMediaTitle:Object(A.get)(n,"title",p),multiple:Boolean(Object(A.get)(t,["meta","spay_multiple"],Boolean(d))),price:Object(A.get)(t,["meta","spay_price"],m||void 0),title:Object(A.get)(t,["title","raw"],b)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}}},{key:"toApi",value:function(){var e=this.props.attributes,t=e.content,n=e.currency,r=e.email,a=e.featuredMediaId,o=e.multiple,c=e.price,i=e.productId;return{id:i,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:c},status:i?"publish":"draft",title:e.title}}},{key:"saveProduct",value:function(){var e=this;if(!this.state.isSavingProduct){var t=this.props,n=t.attributes,r=t.setAttributes,a=n.email,c=Object(I.dispatch)("core").saveEntityRecord;this.setState({isSavingProduct:!0},(function(){c("postType",i,e.toApi()).then((function(e){return e&&r({productId:e.id}),e})).catch((function(t){if(t&&t.data){var n=t.data.key;e.setState({fieldEmailError:"spay_email"===n?Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),a):null,fieldPriceError:"spay_price"===n?Object(o.__)("Invalid price.","jetpack"):null})}})).finally((function(){e.setState({isSavingProduct:!1})}))}))}}},{key:"render",value:function(){var e=this.state,t=e.fieldEmailError,n=e.fieldPriceError,r=e.fieldTitleError,i=this.props,l=i.attributes,s=i.instanceId,u=i.isSelected,p=i.setAttributes,d=i.simplePayment,m=l.content,b=l.currency,h=l.email,f=l.featuredMediaId,g=l.featuredMediaUrl,j=l.featuredMediaTitle,v=l.multiple,O=l.price,k=l.productId,_=l.title,y=k&&Object(A.isEmpty)(d);if(!u&&y)return Object(a.createElement)("div",{className:"simple-payments__loading"},Object(a.createElement)(z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!u&&h&&O&&_&&!t&&!n&&!r)return Object(a.createElement)(z,{"aria-busy":"false",content:m,featuredMediaUrl:g,featuredMediaTitle:j,formattedPrice:$(O,b),multiple:v,title:_});var E=y?c.Disabled:"div";return Object(a.createElement)(E,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),Object(a.createElement)(G,{featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:j,setAttributes:p}),Object(a.createElement)("div",null,Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-title-error"),className:x()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:Object(o.__)("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:Object(o.__)("Item name","jetpack"),required:!0,type:"text",value:_}),Object(a.createElement)(R.a,{id:"".concat(s,"-title-error"),isError:!0},r),Object(a.createElement)(c.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:Object(o.__)("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:Object(o.__)("Describe your item in a few words","jetpack"),"aria-label":Object(o.__)("Describe your item in a few words","jetpack"),value:m}),Object(a.createElement)("div",{className:"simple-payments__price-container"},Object(a.createElement)(c.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:Object(o.__)("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:b}),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-price-error"),className:x()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":n}),label:Object(o.__)("Price","jetpack"),onChange:this.handlePriceChange,placeholder:$(0,b,!1),required:!0,step:"1",type:"number",value:O||""}),Object(a.createElement)(R.a,{id:"".concat(s,"-price-error"),isError:!0},n)),Object(a.createElement)("div",{className:"simple-payments__field-multiple"},Object(a.createElement)(c.ToggleControl,{checked:Boolean(v),label:Object(o.__)("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-email-").concat(t?"error":"help"),className:x()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":t}),label:Object(o.__)("Email","jetpack"),onChange:this.handleEmailChange,placeholder:Object(o.__)("Email","jetpack"),required:!0,type:"text",value:h}),Object(a.createElement)(R.a,{id:"".concat(s,"-email-error"),isError:!0},t),Object(a.createElement)(R.a,{id:"".concat(s,"-email-help")},Object(o.__)("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",Object(a.createElement)(c.ExternalLink,{href:"https://www.paypal.com/"},Object(o.__)("Create one on PayPal","jetpack")))))}}]),n}(a.Component),Y=Object(I.withSelect)((function(e,t){var n=e("core"),r=n.getEntityRecord,a=n.getMedia,o=e("core/editor"),c=o.isSavingPost,l=o.getCurrentPost,s=t.attributes,u=s.productId,p=s.featuredMediaId,d=u?Object(A.pick)(r("postType",i,u),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,m=l();return{hasPublishAction:!!Object(A.get)(m,["_links","wp:action-publish"]),isSaving:!!c(),simplePayment:d,featuredMedia:p?a(p):null,postLinkUrl:null==m?void 0:m.link,isPostEditor:Object.keys(l()).length>0}})),J=Object(P.compose)(Y,P.withInstanceId)(Z);var X={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:function(e){var t=e.attributes.productId;return t?Object(a.createElement)(a.RawHTML,null,'[simple-payment id="'.concat(t,'"]')):null}},Q=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),w()(v()(e),"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),w()(v()(e),"shouldInjectPaymentAttributes",!!e.props.attributes.productId),w()(v()(e),"validateAttributes",(function(){var t=e.validatePrice(),n=e.validateTitle(),r=e.validateEmail(),a=e.validateCurrency();return t&&n&&r&&a})),w()(v()(e),"validateCurrency",(function(){var t=e.props.attributes.currency;return s.includes(t)})),w()(v()(e),"validatePrice",(function(){var t=e.props.attributes,n=t.currency,r=t.price,a=Object(T.b)(n).precision;return r&&0!==parseFloat(r)?Number.isNaN(parseFloat(r))?(e.setState({fieldPriceError:Object(o.__)("Invalid price","jetpack")}),!1):parseFloat(r)<0?(e.setState({fieldPriceError:Object(o.__)("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):H(r)>a?0===a?(e.setState({fieldPriceError:Object(o.__)("We know every penny counts, but prices in this currency can’t contain decimal values.","jetpack")}),!1):(e.setState({fieldPriceError:Object(o.sprintf)(Object(o._n)("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",a,"jetpack"),a)}),!1):(e.state.fieldPriceError&&e.setState({fieldPriceError:null}),!0):(e.setState({fieldPriceError:Object(o.__)("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),w()(v()(e),"validateEmail",(function(){var t=e.props.attributes.email;return t?N.a.validate(t)?(e.state.fieldEmailError&&e.setState({fieldEmailError:null}),!0):(e.setState({fieldEmailError:Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),t)}),!1):(e.setState({fieldEmailError:Object(o.__)("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),w()(v()(e),"validateTitle",(function(){return e.props.attributes.title?(e.state.fieldTitleError&&e.setState({fieldTitleError:null}),!0):(e.setState({fieldTitleError:Object(o.__)("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),w()(v()(e),"handleEmailChange",(function(t){e.props.setAttributes({email:t}),e.setState({fieldEmailError:null})})),w()(v()(e),"handleContentChange",(function(t){e.props.setAttributes({content:t})})),w()(v()(e),"handlePriceChange",(function(t){t=parseFloat(t),isNaN(t)?e.props.setAttributes({price:void 0}):e.props.setAttributes({price:t}),e.setState({fieldPriceError:null})})),w()(v()(e),"handleCurrencyChange",(function(t){e.props.setAttributes({currency:t})})),w()(v()(e),"handleMultipleChange",(function(t){e.props.setAttributes({multiple:!!t})})),w()(v()(e),"handleTitleChange",(function(t){e.props.setAttributes({title:t}),e.setState({fieldTitleError:null})})),w()(v()(e),"getCurrencyList",s.map((function(e){var t=Object(T.b)(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(A.trimEnd)(t,"."))}}))),w()(v()(e),"renderSettings",(function(){return Object(a.createElement)(M.InspectorControls,null,Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Settings","jetpack"),initialOpen:!1},Object(a.createElement)(c.BaseControl,{label:Object(o.__)("Purchase link text","jetpack"),help:Object(o.__)("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},Object(a.createElement)(c.TextControl,{placeholder:Object(o.__)("Click here to purchase","jetpack"),onChange:function(t){return e.props.setAttributes({postLinkText:t})},value:e.props.attributes.postLinkText}))))})),e}return g()(n,[{key:"componentDidMount",value:function(){this.injectPaymentAttributes();var e=this.props,t=e.attributes,n=e.hasPublishAction,r=e.postLinkUrl,a=e.setAttributes;!t.productId&&n&&this.saveProduct();var c=r&&r!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(c||i)&&a(m()(m()({},c&&{postLinkUrl:r}),i&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.hasPublishAction,r=t.isSelected,a=t.postLinkUrl,c=t.setAttributes;Object(A.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&n&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();var i=a&&a!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&c(m()(m()({},i&&{postLinkUrl:a}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"injectPaymentAttributes",value:function(){var e=this.props,t=e.simplePayment,n=e.featuredMedia;if(this.shouldInjectPaymentAttributes&&!Object(A.isEmpty)(t)){var r=this.props,a=r.attributes,o=r.setAttributes,c=a.content,i=a.currency,l=a.email,s=a.featuredMediaId,u=a.featuredMediaUrl,p=a.featuredMediaTitle,d=a.multiple,m=a.price,b=a.title;o({content:Object(A.get)(t,["content","raw"],c),currency:Object(A.get)(t,["meta","spay_currency"],i),email:Object(A.get)(t,["meta","spay_email"],l),featuredMediaId:Object(A.get)(t,["featured_media"],s),featuredMediaUrl:Object(A.get)(n,"url",u),featuredMediaTitle:Object(A.get)(n,"title",p),multiple:Boolean(Object(A.get)(t,["meta","spay_multiple"],Boolean(d))),price:Object(A.get)(t,["meta","spay_price"],m||void 0),title:Object(A.get)(t,["title","raw"],b)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}}},{key:"toApi",value:function(){var e=this.props.attributes,t=e.content,n=e.currency,r=e.email,a=e.featuredMediaId,o=e.multiple,c=e.price,i=e.productId;return{id:i,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:c},status:i?"publish":"draft",title:e.title}}},{key:"saveProduct",value:function(){var e=this;if(!this.state.isSavingProduct){var t=this.props,n=t.attributes,r=t.setAttributes,a=n.email,c=Object(I.dispatch)("core").saveEntityRecord;this.setState({isSavingProduct:!0},(function(){c("postType",i,e.toApi()).then((function(e){return e&&r({productId:e.id}),e})).catch((function(t){if(t&&t.data){var n=t.data.key;e.setState({fieldEmailError:"spay_email"===n?Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),a):null,fieldPriceError:"spay_price"===n?Object(o.__)("Invalid price.","jetpack"):null})}})).finally((function(){e.setState({isSavingProduct:!1})}))}))}}},{key:"render",value:function(){var e=this.state,t=e.fieldEmailError,n=e.fieldPriceError,r=e.fieldTitleError,i=this.props,l=i.attributes,s=i.instanceId,u=i.isSelected,p=i.setAttributes,d=i.simplePayment,m=l.content,b=l.currency,h=l.email,f=l.featuredMediaId,g=l.featuredMediaUrl,j=l.featuredMediaTitle,v=l.multiple,O=l.price,k=l.productId,_=l.title,y=k&&Object(A.isEmpty)(d);if(!u&&y)return Object(a.createElement)("div",{className:"simple-payments__loading"},Object(a.createElement)(z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!u&&h&&O&&_&&!t&&!n&&!r)return Object(a.createElement)(z,{"aria-busy":"false",content:m,featuredMediaUrl:g,featuredMediaTitle:j,formattedPrice:W(O,b),multiple:v,title:_});var E=y?c.Disabled:"div";return Object(a.createElement)(E,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),Object(a.createElement)(G,{featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:j,setAttributes:p}),Object(a.createElement)("div",null,Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-title-error"),className:x()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:Object(o.__)("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:Object(o.__)("Item name","jetpack"),required:!0,type:"text",value:_}),Object(a.createElement)(R.a,{id:"".concat(s,"-title-error"),isError:!0},r),Object(a.createElement)(c.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:Object(o.__)("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:Object(o.__)("Describe your item in a few words","jetpack"),value:m}),Object(a.createElement)("div",{className:"simple-payments__price-container"},Object(a.createElement)(c.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:Object(o.__)("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:b}),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-price-error"),className:x()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":n}),label:Object(o.__)("Price","jetpack"),onChange:this.handlePriceChange,placeholder:W(0,b,!1),required:!0,step:"1",type:"number",value:O||""}),Object(a.createElement)(R.a,{id:"".concat(s,"-price-error"),isError:!0},n)),Object(a.createElement)("div",{className:"simple-payments__field-multiple"},Object(a.createElement)(c.ToggleControl,{checked:Boolean(v),label:Object(o.__)("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-email-").concat(t?"error":"help"),className:x()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":t}),label:Object(o.__)("Email","jetpack"),onChange:this.handleEmailChange,placeholder:Object(o.__)("Email","jetpack"),required:!0,type:"text",value:h}),Object(a.createElement)(R.a,{id:"".concat(s,"-email-error"),isError:!0},t),Object(a.createElement)(R.a,{id:"".concat(s,"-email-help")},Object(o.__)("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",Object(a.createElement)(c.ExternalLink,{href:"https://www.paypal.com/"},Object(o.__)("Create one on PayPal","jetpack")))))}}]),n}(a.Component),ee=Object(I.withSelect)((function(e,t){var n=e("core"),r=n.getEntityRecord,a=n.getMedia,o=e("core/editor"),c=o.isSavingPost,l=o.getCurrentPost,s=t.attributes,u=s.productId,p=s.featuredMediaId,d=u?Object(A.pick)(r("postType",i,u),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,m=l();return{hasPublishAction:!!Object(A.get)(m,["_links","wp:action-publish"]),isSaving:!!c(),simplePayment:d,featuredMedia:p?a(p):null,postLinkUrl:m.link}})),te=Object(P.compose)(ee,P.withInstanceId)(Q);var ne=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"})),re=Object(u.c)()||Object(u.a)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/",ae={title:Object(o.__)("Pay with PayPal","jetpack"),description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),Object(a.createElement)("p",null,Object(o.__)("Good for collecting donations or payments for products and services.","jetpack")),Object(a.createElement)(c.ExternalLink,{href:re},Object(o.__)("Support reference","jetpack"))),icon:{src:ne,foreground:Object(p.a)()},category:"earn",keywords:[Object(o._x)("buy","block search term","jetpack"),Object(o._x)("commerce","block search term","jetpack"),Object(o._x)("products","block search term","jetpack"),Object(o._x)("purchase","block search term","jetpack"),Object(o._x)("sell","block search term","jetpack"),Object(o._x)("shop","block search term","jetpack"),Object(o._x)("simple","block search term","jetpack"),Object(o._x)("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:Object(o.__)("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:function(e){var t=e.named.id;if(t){var n=parseInt(t,10);return n||void 0}}}}}]},edit:te,save:function(e){var t=e.attributes,n=t.content,r=t.currency,o=t.featuredMediaUrl,c=t.featuredMediaTitle,i=t.postLinkUrl,l=t.postLinkText,s=t.price,u=t.productId,p=t.title;return u?Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper jetpack-simple-payments-".concat(u)},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},o&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("div",{className:"jetpack-simple-payments-image"},Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:o,alt:c})))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,p)),Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,n)),Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,W(s,r))),Object(a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},l)))):null},supports:{className:!1,customClassName:!1,html:!1,reusable:!1}},oe=n(195),ce=n.n(oe),ie=(n(374),Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}))),le=Object(u.c)()||Object(u.a)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/",se={title:Object(o.__)("Pay with PayPal","jetpack"),description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),Object(a.createElement)("p",null,Object(o.__)("Good for collecting donations or payments for products and services.","jetpack")),Object(a.createElement)(c.ExternalLink,{href:le},Object(o.__)("Support reference","jetpack"))),icon:{src:ie,foreground:Object(p.a)()},category:"earn",keywords:[Object(o._x)("buy","block search term","jetpack"),Object(o._x)("commerce","block search term","jetpack"),Object(o._x)("products","block search term","jetpack"),Object(o._x)("purchase","block search term","jetpack"),Object(o._x)("sell","block search term","jetpack"),Object(o._x)("shop","block search term","jetpack"),Object(o._x)("simple","block search term","jetpack"),Object(o._x)("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:Object(o.__)("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:function(e){var t=e.named.id;if(t){var n=parseInt(t,10);return n||void 0}}}}}]},edit:J,save:function(e){var t=e.attributes,n=t.content,r=t.currency,o=t.featuredMediaUrl,c=t.featuredMediaTitle,i=t.postLinkUrl,l=t.postLinkText,s=t.price,u=t.productId,p=t.title;return u?Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper jetpack-simple-payments-".concat(u)},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},o&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("div",{className:"jetpack-simple-payments-image"},Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:o,alt:c})))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,p)),Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,n)),Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,$(s,r))),Object(a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},l)))):null},example:{attributes:{price:25,title:Object(o.__)("Jetpack t-shirt","jetpack"),content:Object(o.__)("Take flight in ultimate comfort with this stylish t-shirt featuring the Jetpack logo.","jetpack"),email:"jetpack@jetpack.com",featuredMediaUrl:ce.a}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},deprecated:[X,ae]};Object(r.a)("simple-payments",se)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(36),c={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string"},placeholder:{type:"string"},url:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string",validator:o.a},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:o.a},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"}},i=n(4),l=n.n(i),s=n(5),u=n.n(s),p=n(0),d=n(8),m=n.n(d),b=n(6),h=n(17),f=n(3),g=n(2),j=Object(g.withFallbackStyles)((function(e,t){var n=t.backgroundColor,r=t.textColor,a=Object(f.get)(n,"color"),o=!Object(f.get)(r,"color")&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:a||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:r||!o?void 0:getComputedStyle(o).color}})),v=!!b.__experimentalUseGradient;function O(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(p.useCallback)((function(e){return r({borderRadius:e})}),[r]);return Object(p.createElement)(g.PanelBody,{title:Object(a.__)("Border Settings","jetpack")},Object(p.createElement)(g.RangeControl,{allowReset:!0,initialPosition:5,label:Object(a.__)("Border radius","jetpack"),max:50,min:0,onChange:o,value:n}))}function k(e){var t=e.isGradientAvailable,n=e.backgroundColor,r=e.fallbackBackgroundColor,o=e.fallbackTextColor,c=e.gradientValue,i=e.setBackgroundColor,l=e.setGradient,s=e.setTextColor,u=e.textColor,d=Object(p.createElement)(b.ContrastChecker,{backgroundColor:n.color,fallbackBackgroundColor:r,fallbackTextColor:o,isLargeText:!1,textColor:u.color});return t?Object(p.createElement)(b.__experimentalPanelColorGradientSettings,{settings:[{colorValue:u.color,label:Object(a.__)("Text Color","jetpack"),onColorChange:s},{colorValue:n.color,gradientValue:c,label:Object(a.__)("Background","jetpack"),onColorChange:i,onGradientChange:l}],title:Object(a.__)("Background & Text Color","jetpack")},d):Object(p.createElement)(b.PanelColorSettings,{colorSettings:[{value:u.color,onChange:s,label:Object(a.__)("Text Color","jetpack")},{value:n.color,onChange:i,label:Object(a.__)("Background","jetpack")}],title:Object(a.__)("Background & Text Color","jetpack")},d)}var _=n(108);function y(e){var t=e.attributes,n=e.backgroundColor,r=e.fallbackBackgroundColor,a=e.fallbackTextColor,o=e.setAttributes,c=e.setBackgroundColor,i=e.setTextColor,l=e.textColor,s=e.gradientValue,u=e.setGradient,d=e.isGradientAvailable,m=t.align,b=t.borderRadius,h=t.width;return Object(p.createElement)(p.Fragment,null,Object(p.createElement)(k,{backgroundColor:n,fallbackBackgroundColor:r,fallbackTextColor:a,gradientValue:s,setBackgroundColor:c,setGradient:u,setTextColor:i,textColor:l,isGradientAvailable:d}),Object(p.createElement)(O,{borderRadius:b,setAttributes:o}),Object(p.createElement)(_.b,{align:m,width:h,onChange:function(e){return o({width:e})}}))}var E=n(10);n(263);var w=Object(h.compose)(Object(b.withColors)({backgroundColor:"background-color"},{textColor:"color"}),j)((function(e){var t,n,r,o=e.attributes,c=e.backgroundColor,i=e.className,s=e.clientId,d=e.setAttributes,h=e.textColor,g=o.align,j=o.borderRadius,O=o.element,k=o.placeholder,_=o.text,w=o.width,C=(n=g,r=Object(p.useRef)(),Object(p.useEffect)((function(){r.current=n}),[n]),r.current);!function(e){var t=e.attributes,n=e.clientId,r=e.setAttributes,a=t.passthroughAttributes,o=Object(E.useSelect)((function(e){var r=e("core/block-editor"),o=(0,r.getBlockAttributes)((0,r.getBlockRootClientId)(n))||{},c=Object(f.mapValues)(a,(function(e){return o[e]}));return{attributesToSync:Object(f.pickBy)(c,(function(e,n){return e!==t[n]}))}})).attributesToSync;Object(p.useEffect)((function(){Object(f.isEmpty)(o)||r(o)}),[o,r])}({attributes:o,clientId:s,setAttributes:d}),Object(p.useEffect)((function(){C!==g&&("left"===g||"right"===g)&&null!=w&&w.includes("%")&&d({width:void 0})}),[g,C,d,w]);var x=v?Object(b.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},S=x.gradientClass,N=x.gradientValue,A=x.setGradient,T=m()("wp-block-button",i),P=m()("wp-block-button__link",(t={"has-background":c.color||N},u()(t,c.class,!N&&c.class),u()(t,"has-text-color",h.color),u()(t,h.class,h.class),u()(t,S,S),u()(t,"no-border-radius",0===j),u()(t,"has-custom-width",!!w),t)),I=l()(l()({},!c.color&&N?{background:N}:{backgroundColor:c.color}),{},{color:h.color,borderRadius:j?j+"px":void 0,width:w});return Object(p.createElement)("div",{className:T},Object(p.createElement)(b.RichText,{allowedFormats:"input"===O?[]:void 0,className:P,disableLineBreaks:"input"===O,onChange:function(e){var t="input"===O?e.replace(/<br>/gim," "):e;d({text:t})},placeholder:k||Object(a.__)("Add text…","jetpack"),style:I,value:_,withoutInteractiveFormatting:!0}),Object(p.createElement)(b.InspectorControls,null,Object(p.createElement)(y,l()({gradientValue:N,setGradient:A,isGradientAvailable:v},e))))})),C=Object(p.createElement)(g.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(g.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"}));var x=n(58),S={title:Object(a.__)("Button","jetpack"),icon:C,category:Object(x.a)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"]},styles:[{name:"fill",label:Object(a.__)("Fill","jetpack"),isDefault:!0},{name:"outline",label:Object(a.__)("Outline","jetpack")}],attributes:c,edit:w,save:function(e){var t,n=e.attributes,r=e.blockName,a=e.uniqueId,o=n.backgroundColor,c=n.borderRadius,i=n.className,l=n.customBackgroundColor,s=n.customGradient,d=n.customTextColor,h=n.gradient,f=n.saveInPostContent,g=n.text,j=n.textColor,O=n.url,k=n.width;if(!f)return null;var _=Object(b.getColorClassName)("background-color",o),y=v?Object(b.__experimentalGetGradientClass)(h):void 0,E=Object(b.getColorClassName)("color",j),w=m()("wp-block-button","jetpack-submit-button",i,u()({},"wp-block-jetpack-".concat(r),r)),C=m()("wp-block-button__link",(t={"has-text-color":j||d},u()(t,E,E),u()(t,"has-background",o||h||l||s),u()(t,_,_),u()(t,y,y),u()(t,"no-border-radius",0===c),u()(t,"has-custom-width",!!k),t)),x={background:s||void 0,backgroundColor:_||s||h?void 0:l,color:E?void 0:d,borderRadius:c?c+"px":void 0,width:k};return Object(p.createElement)("div",{className:w},Object(p.createElement)(b.RichText.Content,{className:C,"data-id-attr":a||"placeholder",href:O,id:a,rel:"noopener noreferrer",role:"button",style:x,tagName:"a",target:"_blank",value:g}))}};Object(r.a)("button",S)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(11),i=n(10),l=n(3),s=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],u=s.map((function(e){return e.value})),p={name:"button",label:Object(o.__)("Button (210 x 113 pixels)","jetpack")},d=function(e){return Object(l.compact)([{name:"standard",label:Object(o.__)("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:Object(o.__)("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:Object(o.__)("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&p])},m=function(e){return d(e).map((function(e){return e.name}))},b=Object(i.select)("core/block-editor").getSettings().siteLocale,h=!Object(l.isEmpty)(b)&&u.includes(b)?b:"en-US",f={rid:{default:[],type:"array"},style:{default:"standard",type:"string",validValues:m()},iframe:{default:!0,type:"boolean"},domain:{default:"com",type:"string"},lang:{default:h,type:"string",validValues:u},newtab:{default:!1,type:"boolean"},negativeMargin:{default:!1,type:"boolean"}},g={attributes:f,supports:{align:!0,html:!1},save:function(e){var t=e.attributes.rid;return Object(a.createElement)(a.Fragment,null,t.map((function(e){return Object(a.createElement)("a",{href:"https://www.opentable.com/restref/client/?rid=".concat(e)},"https://www.opentable.com/restref/client/?rid=".concat(e))})))}},j=n(4),v=n.n(j),O={attributes:f,migrate:function(e){var t=e.style,n=e.className,r="standard"===t?"":"is-style-".concat(t);return v()(v()({},e),{},{className:n?"".concat(n," ").concat(r):r})},isEligible:function(e){var t=e.style,n=e.className;return!(!t||"standard"===t)&&(!n||-1===n.indexOf("is-style-"))},save:function(e){var t=e.attributes.rid;return Object(a.createElement)("div",null,t.map((function(e){return Object(a.createElement)("a",{href:"https://www.opentable.com/restref/client/?rid=".concat(e)},"https://www.opentable.com/restref/client/?rid=".concat(e))})))}},k=n(5),_=n.n(k),y=n(9),E=n.n(y),w=(n(169),n(8)),C=n.n(w),x=n(6),S=n(2),N=(n(181),Object(a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 16",fill:"none",height:"16",width:"22"},Object(a.createElement)(S.Path,{d:"m1.997 5.982c-.39457-.00039-.7804.11622-1.108699.33511-.328295.21888-.584312.5302-.735674.89459-.15136174.36439-.1912714.76548-.1146819 1.15254.0765899.38707.2662379.74274.5449639 1.02202.278726.27929.634011.46965 1.020921.54702.38692.07732.78809.03826 1.15278-.11238.36469-.15063.67652-.40602.89606-.73387.21954-.32786.33693-.71345.33733-1.10803v-.002c.001-1.1-.89-1.994-1.992-1.995zm12.006 3.988c-.3946.0004-.7805-.11625-1.1088-.33517-.3283-.21893-.5843-.53031-.7357-.89476-.1513-.36444-.1912-.76558-.1145-1.15268s.2664-.74276.5453-1.022c.2788-.27925.6342-.46953 1.0211-.54679.387-.07725.7882-.038 1.1529.11278.3647.15079.6764.40634.8959.73432.2194.32799.3366.71369.3368 1.1083v.003c.0003.52814-.2092 1.03477-.5824 1.4085s-.8795.58397-1.4076.5845zm0-9.96999843c-1.5777-.0009886-3.1203.46588743-4.43262 1.34158843-1.31236.8757-2.33558 2.1209-2.94025 3.57813-.60467 1.45722-.76365 3.06103-.45683 4.60861.30683 1.54757 1.06567 2.96947 2.18058 4.08577 1.1149 1.1163 2.53582 1.8769 4.08302 2.1856 1.5472.3088 3.1512.1518 4.6091-.451 1.458-.6028 2.7045-1.6245 3.5819-2.9358.8773-1.3112 1.3461-2.8532 1.3471-4.4309v-.005c.0008-2.11466-.8384-4.14304-2.3331-5.63899-1.4946-1.495952-3.5222-2.3369478-5.6369-2.33800843z"}))),A=n(23),T=n(21),P=n.n(T),I=/^\s*(http[s]?:\/\/|\<script)/;function M(e){var t=Object(a.useState)(""),n=E()(t,2),r=n[0],c=n[1],i=function(e,t){var n=Object(a.useState)([]),r=E()(n,2),o=r[0],c=r[1],i=Object(a.useCallback)(Object(l.throttle)((function(){fetch("https://www.opentable.com/widget/reservation/restaurant-search?pageSize="+t+"&query="+encodeURIComponent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).then((function(e){return e.json()})).then((function(e){return c(Object(l.unionBy)(o,e.items,"rid"))}))}),500),[o]);return Object(a.useEffect)((function(){Object(l.isEmpty)(e)||I.test(e)||i(e)}),[e]),o}(r,20),s=Object(a.useState)(e.rids||[]),u=E()(s,2),p=u[0],d=u[1],m=/^(\d+)$|\(\#(\d+)\)$/,b=i.filter((function(e){return p.indexOf(e.rid.toString())<0})).map((function(e){return e.name+" (#".concat(e.rid,")")})),h=Object(a.createElement)(S.FormTokenField,P()({value:p,suggestions:b,saveTransform:function(e){return I.test(e)?"":e.trim()},onInputChange:c,maxSuggestions:20,label:Object(o._n)("Restaurant","Restaurants",p.length,"jetpack")},e,{onChange:function(t){var n=t.map((function(e){var t=m.exec(e);return t[1]||t[2]}));d(n),e.onChange&&e.onChange(n)}}));return Object(a.createElement)("div",{className:"wp-block-jetpack-opentable-restaurant-picker"},e.onSubmit?Object(a.createElement)("form",{onSubmit:function(t){t.preventDefault(),e.onSubmit(Object(l.isEmpty)(p)?r:p)}},h,Object(a.createElement)(S.Button,{isSecondary:!0,type:"submit"},Object(o.__)("Embed","jetpack"))):h)}var R=n(43),B=n(42),L=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,D=/restref=([0-9]+)&/,F=/rid=([0-9]+)&/,z=function(e){if(e)return function(e){if(e){var t="";if((t=0===e.indexOf("http")?new URL(e):new URL("http:"+e)).host&&-1!==t.host.indexOf("opentable")&&t.search){var n=new URLSearchParams(t.search),r=n.get("theme");"button"===n.get("type")&&(r=n.get("type"));var a=n.getAll("rid");if(a&&0!==a.length||(a=n.getAll("restref")),a&&0!==a.length){var o={};a&&(o.rid=a);var c=n.get("domain");c&&(o.domain=c);var i=n.get("iframe");i&&(o.iframe=i);var l=n.get("lang");l&&(o.lang=l);var s=n.get("newtab");return s&&(o.newtab=s),r&&(o.style=r),o}}}}(function(e){var t=e.match(L);return t&&t[1]?t[1]:D.test(e)||F.test(e)?e:void 0}(e))};var U=Object(S.withNotices)((function(e){var t,n=e.attributes,r=e.className,i=e.clientId,b=e.isSelected,h=e.name,g=e.noticeOperations,j=e.noticeUI,v=e.setAttributes,O=Object(c.getBlockDefaultClassName)(h),k=Object(R.a)(f,n);Object(l.isEqual)(k,n)||v(k);var y,w,T=n.align,P=n.rid,I=n.iframe,L=n.domain,D=n.lang,F=n.newtab,U=n.negativeMargin,V=Object(l.isEmpty)(P),G=Object(B.a)(d(),n.className),H=Object(B.a)(d(P),n.className),q=(y=H,w=Object(a.useRef)(),Object(a.useEffect)((function(){w.current=y}),[y]),w.current),W=Object(l.isEqual)(P,["1"]);Object(a.useEffect)((function(){if(g.removeAllNotices(),!V&&!W&&"wide"===H&&"wide"!==T&&"full"!==T){var e=Object(a.createElement)(a.Fragment,null,Object(o.__)('With the OpenTable block you may encounter display issues if you use its "wide" style with anything other than "wide" or "full" alignment. The wide display style may also not work well on smaller screens.',"jetpack"));g.createNotice({status:"warning",content:e})}}),[W,T,V,P,H]),Object(a.useEffect)((function(){"button"===G&&Array.isArray(P)&&P.length>1&&v({className:"",style:""})}),[P,G,v]),Object(a.useEffect)((function(){b&&(Array.isArray(P)&&P.length>1?Object(c.unregisterBlockStyle)("jetpack/opentable",["button"]):Object(c.registerBlockStyle)("jetpack/opentable",p))}),[b,P]),Object(a.useEffect)((function(){"wide"===q&&"wide"===T&&v({align:""}),"wide"===H&&q&&H!==q&&v({align:"wide"}),v({style:H})}),[H]);var $,K,Z,Y,J,X=m(P),Q=function(e){return P.length>1?["multi","button"!==e?e:"standard"]:["button"===e?"button":"standard","button"===e?"standard":e]},ee=function(e){Array.isArray(e)?v({rid:e,style:e.length>1&&"button"===H?"standard":H}):function(e){var t=z(e);t||(g.removeAllNotices(),g.createErrorNotice(Object(a.createElement)(a.Fragment,null,Object(a.createElement)("strong",null,Object(o.__)("We ran into an issue","jetpack")),Object(a.createElement)("br",null),Object(o.__)("Please ensure this embed matches the one from your OpenTable account","jetpack"))));var n=Object(R.a)(f,t);v(n),g.removeAllNotices()}(e)},te=Object(a.createElement)(a.Fragment,null,Object(a.createElement)(x.InspectorAdvancedControls,null,Object(a.createElement)(S.ToggleControl,{label:Object(o.__)("Load the widget in an iFrame (Recommended)","jetpack"),checked:I,onChange:function(){return v({iframe:!I})},className:"is-opentable"}),"button"===H&&Object(a.createElement)(S.ToggleControl,{label:Object(o.__)("Remove button margin","jetpack"),checked:U,onChange:function(){return v({negativeMargin:!U})}})),Object(a.createElement)(x.InspectorControls,null,Object(a.createElement)(S.PanelBody,{title:Object(o.__)("Settings","jetpack")},Object(a.createElement)(M,{rids:P,onChange:ee}),Object(a.createElement)(S.SelectControl,{label:Object(o.__)("Language","jetpack"),value:D,onChange:function(e){return v({lang:e})},options:s}),Object(a.createElement)(S.ToggleControl,{label:Object(o.__)("Open in a new window","jetpack"),checked:F,onChange:function(){return v({newtab:!F})}})))),ne=Object(A.c)()||Object(A.a)()?"https://en.support.wordpress.com/wordpress-editor/blocks/opentable-block/":"https://jetpack.com/support/jetpack-blocks/opentable-block/",re=Object(a.createElement)(S.Placeholder,{label:Object(o.__)("OpenTable Reservation","jetpack"),icon:Object(a.createElement)(x.BlockIcon,{icon:N}),instructions:Object(o.__)("Enter your restaurant name, or paste an OpenTable Reservation Widget embed code.","jetpack"),notices:j},Object(a.createElement)(M,{rids:P,onSubmit:ee}),Object(a.createElement)("div",{className:"".concat(O,"-placeholder-links")},Object(a.createElement)(S.ExternalLink,{href:"https://restaurant.opentable.com/get-started/"},Object(o.__)("Sign up for OpenTable","jetpack")),Object(a.createElement)(S.ExternalLink,{href:ne},Object(o.__)("Learn more","jetpack")))),ae=C()(r,(t={},_()(t,"is-style-".concat(H),!V&&X.includes(H)&&-1===r.indexOf("is-style")),_()(t,"is-placeholder",V),_()(t,"is-multi","multi"===Q(H)[0]),_()(t,"align".concat(T),T),_()(t,"has-no-margin",U),t));return Object(a.createElement)(a.Fragment,null,j,Object(a.createElement)("div",{className:ae},!V&&te,V?re:(K=Q($||H),Z=E()(K,2),Y=Z[0],J=Z[1],Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"".concat(O,"-overlay")}),Object(a.createElement)("iframe",{title:Object(o.sprintf)(Object(o.__)("Open Table Preview %s","jetpack"),i),scrolling:"no",src:"https://www.opentable.com/widget/reservation/canvas?rid=".concat(Object(l.join)(P,"%2C"),"&type=").concat(Y,"&theme=").concat(J,"&overlay=false&domain=").concat(L,"&lang=").concat(D&&u.includes(D)?D:"en-US","&newtab=").concat(F,"&disablega=true")})))))})),V=n(16),G=(n(165),n(236),{title:Object(o.__)("OpenTable","jetpack"),description:Object(o.__)("Allow visitors to book a reservation with OpenTable","jetpack"),icon:{src:N,foreground:Object(V.a)()},category:"earn",keywords:[Object(o._x)("booking","block search term","jetpack"),Object(o._x)("reservation","block search term","jetpack"),Object(o._x)("restaurant","block search term","jetpack")],supports:{align:!0,html:!1},edit:U,save:function(e){var t=e.attributes.rid;return Object(a.createElement)("div",null,t.map((function(e,t){return Object(a.createElement)("a",{href:"https://www.opentable.com/restref/client/?rid=".concat(e),key:"".concat(e,"-").concat(t)},"https://www.opentable.com/restref/client/?rid=".concat(e))})))},attributes:f,styles:d(),example:{attributes:{rid:["1"],style:"standard",iframe:!0,domain:"com",lang:"en-US",newtab:!1,negativeMargin:!1}},transforms:{from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&0===e.textContent.indexOf("http")&&(F.test(e.textContent)||D.test(e.textContent))},transform:function(e){var t=z(e.textContent);return Object(c.createBlock)("jetpack/opentable",t)}}]},deprecated:[g,O]});Object(r.a)("opentable",G)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(11),l=n(9),s=n.n(l),u=n(6),p=n(27);function d(e){if(!_.test(e))return"";var t=Object(p.getPath)(e);return t?t.startsWith("pin/")?"embedPin":t.match(/^([^/]+)\/?$/)?"embedUser":t.match(/^([^/]+)\/([^/]+)\/?$/)?"embedBoard":"":""}function m(e){var t=e.setEditingState;return Object(a.createElement)(c.ToolbarGroup,null,Object(a.createElement)(c.ToolbarButton,{className:"components-toolbar__control",label:Object(o.__)("Edit URL","jetpack"),icon:"edit",onClick:function(){return t(!0)}}))}function b(){return Object(a.createElement)("div",{className:"wp-block-embed is-loading"},Object(a.createElement)(c.Spinner,null),Object(a.createElement)("p",null,Object(o.__)("Embedding…","jetpack")))}function h(e){var t=e.className,n=e.onSubmit,r=e.noticeUI,i=e.url,l=e.setUrl;return Object(a.createElement)("div",{className:t},Object(a.createElement)(c.Placeholder,{label:Object(o.__)("Pinterest","jetpack"),icon:Object(a.createElement)(u.BlockIcon,{icon:w}),notices:r},Object(a.createElement)("form",{onSubmit:function(e){e.preventDefault(),n()}},Object(a.createElement)("input",{type:"url",value:i,className:"components-placeholder__input","aria-label":Object(o.__)("Pinterest URL","jetpack"),placeholder:Object(o.__)("Enter URL to embed here…","jetpack"),onChange:function(e){return l(e.target.value)}}),Object(a.createElement)(c.Button,{isSecondary:!0,type:"submit"},Object(o._x)("Embed","button label","jetpack")))))}function f(e){var t=e.fallbackUrl,n=e.onClick;return Object(a.createElement)(a.Fragment,null,Object(o.__)("Sorry, this content could not be embedded.","jetpack")," ",Object(a.createElement)(c.Button,{isLink:!0,onClick:function(){var e=Object(a.createElement)("a",{href:t},t);n(Object(i.createBlock)("core/paragraph",{content:Object(a.renderToString)(e)}))}},Object(o._x)("Convert block to link","button label","jetpack")))}var g=n(81),j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=Object(a.useState)(!1),n=s()(t,2),r=n[0],o=n[1],c=Object(a.useState)(e),i=s()(c,2),l=i[0],u=i[1],p=Object(a.useState)(!1),d=s()(p,2),m=d[0],b=d[1];return Object(a.useEffect)((function(){l&&l!==y&&(o(!0),Object(g.a)(l).then((function(e){o(!1),u(e),b(!1)})).catch((function(){o(!1),u(l||void 0),b(!0)})))}),[l]),{isFetching:r,pinterestUrl:l,hasTestUrlError:m,testUrl:u}};var v=Object(c.withNotices)((function(e){var t=e.attributes,n=e.isSelected,r=e.className,o=e.noticeOperations,i=e.noticeUI,l=e.setAttributes,p=e.onReplace,g=t.url,v=j(),O=v.isFetching,k=v.pinterestUrl,_=v.testUrl,y=v.hasTestUrlError,E=Object(a.useState)(!1),w=s()(E,2),C=w[0],x=w[1],S=Object(a.useState)(""),N=s()(S,2),A=N[0],T=N[1],P=Object(a.useState)(!1),I=s()(P,2),M=I[0],R=I[1],B=Object(a.useCallback)((function(){return Object(a.createElement)(f,{fallbackUrl:A,onClick:p})}),[y]),L=function(){x(!0)};if(Object(a.useEffect)((function(){g&&_(g)}),[]),Object(a.useEffect)((function(){!n&&C&&x(!1)}),[n,C]),Object(a.useEffect)((function(){l({url:k}),o.removeAllNotices(),k&&T(k),y&&o.createErrorNotice(B())}),[k,y,l,B]),O)return Object(a.createElement)(b,null);var D=d(g);if(M||!g||g&&!D)return Object(a.createElement)(h,{className:r,onSubmit:function(){O||(_(A),R(!1))},noticeUI:i,url:A,setUrl:T});var F="<a data-pin-do='".concat(D,"' href='").concat(g,"'></a>");return Object(a.createElement)("div",{className:r},Object(a.createElement)(u.BlockControls,null,Object(a.createElement)(m,{setEditingState:R})),Object(a.createElement)("div",null,Object(a.createElement)(c.SandBox,{html:F,scripts:["https://assets.pinterest.com/js/pinit.js"],onFocus:L}),!C&&Object(a.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:L})))}));var O=n(16),k={attributes:{url:{type:"string"}},supports:{align:!1,html:!1},save:function(e){var t=e.attributes,n=e.className,r=t.url;return d(r)?Object(a.createElement)("div",{className:n},Object(a.createElement)("a",{"data-pin-do":d(r),href:r})):null}},_=/^\s*https?:\/\/(?:www\.)?(?:[a-z]{2}\.)?(?:pinterest\.[a-z.]+|pin\.it)\/([^/]+)(\/[^/]+)?/i,y="https://pinterest.com/anapinskywalker/",E=Object(o.__)("Pinterest","jetpack"),w=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Rect,{x:"0",fill:"none",width:"24",height:"24"}),Object(a.createElement)(c.G,null,Object(a.createElement)(c.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.236,2.636,7.855,6.356,9.312c-0.087-0.791-0.166-2.005,0.035-2.869c0.182-0.78,1.173-4.971,1.173-4.971s-0.299-0.599-0.299-1.484c0-1.39,0.806-2.429,1.809-2.429c0.853,0,1.265,0.641,1.265,1.409c0,0.858-0.546,2.141-0.828,3.329c-0.236,0.996,0.499,1.807,1.481,1.807c1.777,0,3.144-1.874,3.144-4.579c0-2.394-1.72-4.068-4.177-4.068c-2.845,0-4.515,2.134-4.515,4.34c0,0.859,0.331,1.781,0.744,2.282c0.082,0.099,0.094,0.186,0.069,0.287C8.18,14.682,8.011,15.361,7.978,15.5c-0.044,0.183-0.145,0.222-0.334,0.134c-1.249-0.581-2.03-2.407-2.03-3.874c0-3.154,2.292-6.051,6.607-6.051c3.469,0,6.165,2.472,6.165,5.775c0,3.446-2.173,6.22-5.189,6.22c-1.013,0-1.966-0.526-2.292-1.148c0,0-0.501,1.909-0.623,2.377c-0.226,0.869-0.835,1.957-1.243,2.622C9.975,21.844,10.969,22,12,22c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2z"}))),C={title:E,description:Object(o.__)("Embed a Pinterest pin, board, or user.","jetpack"),icon:{src:w,foreground:Object(O.a)()},category:"embed",keywords:[Object(o._x)("social","block search term","jetpack"),Object(o._x)("pinboard","block search term","jetpack"),Object(o._x)("pins","block search term","jetpack")],supports:{align:!1,html:!1},attributes:{url:{type:"string"}},edit:v,save:function(e){var t=e.attributes.url;return Object(a.createElement)("a",{href:t},t)},transforms:{from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&_.test(e.textContent)},transform:function(e){return Object(i.createBlock)("jetpack/pinterest",{url:e.textContent.trim()})}}]},example:{attributes:{url:y}},deprecated:[k]};Object(r.a)("pinterest",C)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c={accessToken:{type:"string"},instagramUser:{type:"string"},columns:{type:"number",default:3,min:1,max:6},count:{type:"number",default:9,min:1,max:30},spacing:{type:"number",default:10,min:0,max:50},isStackedOnMobile:{type:"boolean",default:!0}},i=n(19),l=n.n(i),s=n(5),u=n.n(s),p=n(9),d=n.n(p),m=n(8),b=n.n(m),h=n(3),f=n(6),g=n(2),j="jetpack-new-instagram-connection",v=n(43),O=n(110),k=n(22),_=n.n(k),y=n(61);var E=n(10),w=n(27);function C(e){var t=e.src,n=e.alt,r=e.spacing,o=Object(a.useState)(!1),c=d()(o,2),i=c[0],l=c[1],s=Object(a.useState)("auto"),u=d()(s,2),p=u[0],m=u[1],h=Object(a.useRef)(),f=function(){l(!0),m("auto")};Object(a.useEffect)((function(){var e=t;if(e){var n=new window.Image;n.src=e,n.onload=f}h.current&&m(h.current.parentNode.getBoundingClientRect().width)}),[t]);var g=-1*r,j=b()("wp-block-jetpack-instagram-gallery__placeholder",{"is-loaded":i}),v=i?{margin:g}:{margin:g,height:p},O=b()({"is-loaded":i});return Object(a.createElement)("span",{style:v,className:j},Object(a.createElement)("img",{alt:n,className:O,ref:h,src:t}))}function x(e){var t,n=e.accountImageTotal,r=e.attributes,c=e.currentUserConnected,i=e.disconnectFromService,l=e.shouldRenderSidebarNotice,s=e.setAttributes,u=r.accessToken,p=r.columns,d=r.count,m=r.instagramUser,b=r.isStackedOnMobile,h=r.spacing;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(g.PanelBody,{title:Object(o.__)("Account Settings","jetpack")},Object(a.createElement)(g.PanelRow,null,Object(a.createElement)("span",null,Object(o.__)("Account","jetpack")),Object(a.createElement)(g.ExternalLink,{href:"https://www.instagram.com/".concat(m,"/")},"@",m)),c&&Object(a.createElement)(g.PanelRow,null,Object(a.createElement)(g.Button,{isDestructive:!0,isLink:!0,onClick:function(){return i(u)}},Object(o.__)("Disconnect your account","jetpack")))),Object(a.createElement)(g.PanelBody,{title:Object(o.__)("Display Settings","jetpack")},l?(t=n?Object(o.sprintf)(Object(o._n)("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",n,"jetpack"),n):Object(o.__)("There are currently no posts in your Instagram account.","jetpack"),Object(a.createElement)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice"},Object(a.createElement)(g.Notice,{isDismissible:!1,status:"info"},t))):null,Object(a.createElement)(g.RangeControl,{label:Object(o.__)("Number of Posts","jetpack"),value:d,onChange:function(e){return s({count:e})},min:1,max:30}),Object(a.createElement)(g.RangeControl,{label:Object(o.__)("Number of Columns","jetpack"),value:p,onChange:function(e){return s({columns:e})},min:1,max:6}),Object(a.createElement)(g.RangeControl,{label:Object(o.__)("Image Spacing (px)","jetpack"),value:h,onChange:function(e){return s({spacing:e})},min:0,max:50}),Object(a.createElement)(g.ToggleControl,{label:Object(o.__)("Stack on mobile","jetpack"),checked:b,onChange:function(){return s({isStackedOnMobile:!b})}})))}n(306);var S=Object(g.withNotices)((function(e){var t=e.attributes,n=e.className,r=e.isSelected,i=e.noticeOperations,s=e.noticeUI,p=e.setAttributes,m=t.accessToken,k=t.align,S=t.columns,N=t.count,A=t.isStackedOnMobile,T=t.spacing;Object(a.useEffect)((function(){var e=Object(v.a)(c,t);Object(h.isEqual)(e,t)||p(e)}),[t,p]);var P,I,M,R=Object(a.useState)(m),B=d()(R,2),L=B[0],D=B[1],F=function(){var e=Object(E.useSelect)((function(e){return{isAutoDraft:"auto-draft"===e("core/editor").getCurrentPost().status}})).isAutoDraft,t=Object(E.useDispatch)("core/editor").savePost,n=Object(a.useState)(),r=d()(n,2),o=r[0],c=r[1],i=Object(a.useState)(!1),l=d()(i,2),s=l[0],u=l[1],p=Object(y.a)();return Object(a.useEffect)((function(){p||o||s||(e?t():(u(!0),_()({path:Object(w.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then((function(e){c(e),u(!1)}))))}),[p,e,s,t,o]),{isRequestingWpcomConnectUrl:s,wpcomConnectUrl:o}}(),z=F.isRequestingWpcomConnectUrl,U=F.wpcomConnectUrl,V=function(e){var t=e.accessToken,n=e.noticeOperations,r=e.setAttributes,c=e.setSelectedAccount,i=Object(a.useState)([]),l=d()(i,2),s=l[0],u=l[1],p=Object(a.useState)(!1),m=d()(p,2),b=m[0],f=m[1];return Object(a.useEffect)((function(){t&&(n.removeAllNotices(),f(!0),_()({path:Object(w.addQueryArgs)("/wpcom/v2/instagram-gallery/gallery",{access_token:t,count:30})}).then((function(e){var t=e.external_name,a=e.images;if(f(!1),!a||!Object(h.isArray)(a))return n.createErrorNotice(Object(o.__)("An error occurred. Please try again later.","jetpack")),u([]),r({accessToken:void 0,instagramUser:void 0}),void c(void 0);Object(h.isEmpty)(a)&&n.createErrorNotice(Object(o.__)("No images were found in your Instagram account.","jetpack")),r({instagramUser:t}),u(a)})).catch((function(){f(!1),u([]),r({accessToken:void 0,instagramUser:void 0}),c(void 0)})))}),[t,r,c]),{images:s,isLoadingGallery:b,setImages:u}}({accessToken:m,noticeOperations:i,setAttributes:p,setSelectedAccount:D}),G=V.images,H=V.isLoadingGallery,q=V.setImages,W=function(e){var t=e.accessToken,n=e.noticeOperations,r=e.selectedAccount,c=e.setAttributes,i=e.setImages,l=e.setSelectedAccount,s=Object(a.useState)(!1),u=d()(s,2),p=u[0],m=u[1],b=Object(a.useState)(!1),f=d()(b,2),g=f[0],v=f[1],k=Object(a.useState)([]),E=d()(k,2),w=E[0],C=E[1],x=Object(y.a)();return Object(a.useEffect)((function(){!t&&x&&(v(!0),_()({path:"/wpcom/v2/instagram-gallery/connections"}).then((function(e){v(!1),C(e)})).catch((function(){v(!1),C([])})))}),[t,x]),Object(a.useEffect)((function(){j===r||Object(h.find)(w,{token:r})||l(void 0)}),[r,l,w]),{connectToService:function(){n.removeAllNotices(),m(!0),_()({path:"/wpcom/v2/instagram-gallery/connect-url"}).then((function(e){var t=new O.a;t.open(e,"connect-to-instagram-popup","toolbar=0,location=0,menubar=0,"+t.getScreenCenterSpecs(700,700)),t.on("message",(function(e){var t=e.keyring_id;if(m(!1),t){var n=t.toString();c({accessToken:n}),l(n)}})),t.on("close",(function(e){"connect-to-instagram-popup"===e&&m(!1)}))})).catch((function(){n.createErrorNotice(Object(o.__)("An error occurred. Please try again later.","jetpack")),m(!1)}))},disconnectFromService:function(){n.removeAllNotices(),c({accessToken:void 0,instagramUser:void 0}),i([])},isConnecting:p,isRequestingUserConnections:g,userConnections:w}}({accessToken:m,noticeOperations:i,selectedAccount:L,setAttributes:p,setImages:q,setSelectedAccount:D}),$=W.connectToService,K=W.disconnectFromService,Z=W.isConnecting,Y=W.isRequestingUserConnections,J=W.userConnections,X=Object(y.a)(),Q=N>G.length?G.length:N,ee=!H&&(!m||Object(h.isEmpty)(G)),te=!ee,ne=m&&H&&Object(h.isEmpty)(G),re=!ee&&!ne,ae=b()(n,u()({},"align".concat(k),k)),oe=b()("wp-block-jetpack-instagram-gallery__grid","wp-block-jetpack-instagram-gallery__grid-columns-".concat(S),{"is-stacked-on-mobile":A}),ce=u()({gridGap:T},"--latest-instagram-posts-spacing",T?"".concat(T,"px"):void 0),ie={padding:T},le=function(){L&&j!==L?p({accessToken:L,instagramUser:Object(h.find)(J,{token:L}).username}):$()};return Object(a.createElement)("div",{className:ae},ee&&Object(a.createElement)(g.Placeholder,{icon:"instagram",instructions:X?Y||J.length?void 0:Object(o.__)("Connect to Instagram to start sharing your images.","jetpack"):Object(o.__)("First, you'll need to connect your WordPress.com account.","jetpack"),label:Object(o.__)("Latest Instagram Posts","jetpack"),notices:s},X?(P=J.length>0,I=[].concat(l()(Object(h.map)(J,(function(e){return{label:"@".concat(e.username),value:e.token}}))),[{label:Object(o.__)("Add a new account","jetpack"),value:j}]),M=Z||Y||P&&!L,Object(a.createElement)("div",null,P&&Object(a.createElement)(g.RadioControl,{label:Object(o.__)("Select your Instagram account:","jetpack"),onChange:function(e){return D(e)},options:I,selected:L}),j===L&&Object(a.createElement)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions"},Object(o.__)("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")),Object(a.createElement)(g.Button,{disabled:M,isPrimary:!0,onClick:le},Z&&Object(o.__)("Connecting…","jetpack"),Y&&Object(o.__)("Loading your connections…","jetpack"),!Z&&!Y&&Object(o.__)("Connect to Instagram","jetpack")))):Object(a.createElement)(g.Button,{disabled:z||!U,href:U,isSecondary:!0},Object(o.__)("Connect to WordPress.com","jetpack"))),ne&&Object(a.createElement)("div",{className:"wp-block-embed is-loading"},Object(a.createElement)(g.Spinner,null),Object(a.createElement)("p",null,Object(o.__)("Embedding…","jetpack"))),re&&Object(a.createElement)("div",{className:oe,style:ce},Object(h.times)(r?N:Q,(function(e){return Object(a.createElement)("span",{className:b()("wp-block-jetpack-instagram-gallery__grid-post"),key:e,style:ie},function(e){if(G[e]){var n=G[e];return Object(a.createElement)(C,{alt:n.title||n.url,src:n.url,attributes:t,spacing:T})}return Object(a.createElement)("img",{alt:Object(o.__)("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMyc2tBwAEOgG/c94mJwAAAABJRU5ErkJggg=="})}(e))}))),te&&Object(a.createElement)(f.InspectorControls,null,Object(a.createElement)(x,{accountImageTotal:G.length,attributes:t,currentUserConnected:X,disconnectFromService:K,shouldRenderSidebarNotice:te&&!ne&&G.length<N,setAttributes:p})))})),N=n(16),A={title:Object(o.__)("Latest Instagram Posts","jetpack"),description:Object(o.__)("Display an automatically updating list of the latest posts from your Instagram feed.","jetpack"),icon:{src:"instagram",foreground:Object(N.a)()},category:"embed",keywords:[Object(o._x)("images","block search term","jetpack"),Object(o._x)("photos","block search term","jetpack"),Object(o._x)("pictures","block search term","jetpack")],supports:{align:!0,html:!1},attributes:c,edit:S,save:function(e){var t=e.attributes.instagramUser;return t&&Object(a.createElement)("div",null,Object(a.createElement)("a",{href:"https://www.instagram.com/".concat(t,"/"),rel:"noopener noreferrer",target:"_blank"},"https://www.instagram.com/".concat(t,"/")))}};Object(r.a)("instagram-gallery",A)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(11),c=n(36),i={backgroundColor:{type:"string",default:"ffffff",validator:c.a},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:c.a},textColor:{type:"string",default:"4D5055",validator:c.a},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:function(e){return!e||e.startsWith("https://calendly.com/")}}},l=n(4),s=n.n(l),u=n(34),p=n.n(u),d=n(0),m={attributes:{backgroundColor:{type:"string",default:"ffffff",validator:c.a},submitButtonText:{type:"string",default:Object(a.__)("Schedule time with me","jetpack")},submitButtonTextColor:{type:"string"},submitButtonBackgroundColor:{type:"string"},submitButtonClasses:{type:"string"},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:c.a},textColor:{type:"string",default:"4D5055",validator:c.a},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:function(e){return!e||e.startsWith("https://calendly.com/")}},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string",validator:c.a},customTextButtonColor:{type:"string",validator:c.a}},migrate:function(e){e.submitButtonText,e.submitButtonTextColor,e.submitButtonBackgroundColor,e.submitButtonClasses,e.backgroundButtonColor,e.textButtonColor,e.customBackgroundButtonColor,e.customTextButtonColor;var t,n=p()(e,["submitButtonText","submitButtonTextColor","submitButtonBackgroundColor","submitButtonClasses","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor"]),r={text:(t=e).submitButtonText||Object(a.__)("Schedule time with me","jetpack"),textColor:t.submitButtonTextColor||t.textButtonColor,customTextColor:t.customTextButtonColor,backgroundColor:t.submitButtonBackgroundColor||t.backgroundButtonColor,customBackgroundColor:t.customBackgroundButtonColor,url:t.url};return[n,[Object(o.createBlock)("jetpack/button",s()({element:"a",uniqueId:"calendly-widget-id"},r))]]},save:function(e){var t=e.attributes.url;return Object(d.createElement)("a",{href:t},t)}},b=n(9),h=n.n(b),f=(n(169),n(3)),g=n(184),j=n.n(g),v=n(6),O=n(2),k=n(10),_=(n(170),n(215),Object(d.createElement)(O.SVG,{height:"24",viewBox:"0 0 23 24",width:"23",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:"M19,1h-2.3v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H8.6v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H4C1.8,1,0,2.8,0,5 v15c0,2.2,1.8,4,4,4h15c2.2,0,4-1.8,4-4V5C23,2.8,21.2,1,19,1z M21,20c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V5c0-1.1,0.9-2,2-2h2.6 v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3h6.1v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3H19c1.1,0,2,0.9,2,2V20z M13.9,14.8l1.4,1.4 c-0.9,0.9-2.1,1.3-3.5,1.3c-2.4,0-4.5-2.1-4.5-4.7s2.1-4.7,4.5-4.7c1.4,0,2.5,0.4,3.4,1.1L14,10.9c-0.5-0.4-1.2-0.6-2.1-0.6 c-1.2,0-2.5,1.1-2.5,2.7c0,1.6,1.3,2.7,2.5,2.7C12.7,15.5,13.4,15.3,13.9,14.8z"}))),y=n(43),E=/(^|\/\/)(calendly\.com[^"']*)/i,w=function(e){if(e){var t=function(e){var t=e.match(E);if(t)return"https://"+t[2]}(e);if(t){var n=function(e){var t={},n=new URL(e);if(t.url=n.origin+n.pathname,!n.search)return t;var r=new URLSearchParams(n.search),a=r.get("background_color"),o=r.get("primary_color"),c=r.get("text_color"),i=/^[A-Za-z0-9]{6}$/;return r.get("hide_event_type_details")&&(t.hideEventTypeDetails=r.get("hide_event_type_details")),a&&a.match(i)&&(t.backgroundColor=a),o&&o.match(i)&&(t.primaryColor=o),c&&c.match(i)&&(t.textColor=c),t}(t),r=function(e){return e.indexOf("data-url")>0?"inline":e.indexOf("initPopupWidget")>0||e.indexOf("initBadgeWidget")>0?"link":void 0}(e);if(r&&(n.style=r),"link"===r){n.buttonAttributes={};var a=function(e){var t=e.match(/false;">([^<]+)<\//);return t||(t=e.match(/text: '([^']*?)'/))?t[1]:void 0}(e);a&&(n.buttonAttributes.text=a);var o=function(e){var t=e.match(/textColor: '([^']*?)'/);if(t)return t[1]}(e);o&&(n.buttonAttributes.textColor=void 0,n.buttonAttributes.customTextColor=o);var c=function(e){var t=e.match(/color: '([^']*?)'/);if(t)return t[1]}(e);c&&(n.buttonAttributes.backgroundColor=void 0,n.buttonAttributes.customBackgroundColor=c)}return n}}},C=n(81),x=n(109),S=function(e){var t=e.onEditClick;return Object(d.createElement)(O.ToolbarGroup,null,Object(d.createElement)(O.ToolbarButton,{onClick:function(){return t(!0)}},Object(a.__)("Edit","jetpack")))},N=function(e){var t=e.attributes,n=t.hideEventTypeDetails,r=t.url,o=e.defaultClassName,c=e.embedCode,i=e.parseEmbedCode,l=e.setAttributes,s=e.setEmbedCode;return Object(d.createElement)(d.Fragment,null,Object(d.createElement)(O.PanelBody,{PanelBody:!0,title:Object(a.__)("Calendar settings","jetpack"),initialOpen:!1},Object(d.createElement)("form",{onSubmit:i,className:"".concat(o,"-embed-form-sidebar")},Object(d.createElement)("input",{type:"text",id:"embedCode",onChange:function(e){return s(e.target.value)},placeholder:Object(a.__)("Calendly web address or embed code…","jetpack"),value:c||"",className:"components-placeholder__input"}),Object(d.createElement)("div",null,Object(d.createElement)(O.Button,{isSecondary:!0,type:"submit"},Object(a._x)("Embed","button label","jetpack")))),Object(d.createElement)(O.ToggleControl,{label:Object(a.__)("Hide event type details","jetpack"),checked:n,onChange:function(){return l({hideEventTypeDetails:!n})}})),r&&Object(d.createElement)(O.Notice,{className:"".concat(o,"-color-notice"),isDismissible:!1},Object(d.createElement)(O.ExternalLink,{href:"https://help.calendly.com/hc/en-us/community/posts/360033166114-Embed-Widget-Color-Customization-Available-Now-"},Object(a.__)("Follow these instructions to change the colors in this block.","jetpack"))))},A=function(e){var t=e.attributes,n=e.clientId,r=e.isEditingUrl,o=e.setAttributes,c=e.setIsEditingUrl,i=t.style,l=t.url,s=[{value:"inline",label:Object(a.__)("Inline","jetpack")},{value:"link",label:Object(a.__)("Link","jetpack")}];return Object(d.createElement)(d.Fragment,null,l&&!r&&Object(d.createElement)(v.BlockControls,null,Object(d.createElement)(S,{onEditClick:c})),l&&Object(d.createElement)(x.a,{clientId:n,styleOptions:s,onSelectStyle:o,activeStyle:i,attributes:t,viewportWidth:500}),Object(d.createElement)(v.InspectorControls,null,Object(d.createElement)(N,e)))};var T=Object(O.withNotices)((function(e){var t=e.attributes,n=e.className,r=e.clientId,c=e.name,l=e.noticeOperations,u=e.noticeUI,p=e.setAttributes,m=Object(o.getBlockDefaultClassName)(c),b=Object(y.a)(i,t);Object(f.isEqual)(b,t)||p(b);var g=b.backgroundColor,E=b.hideEventTypeDetails,x=b.primaryColor,S=b.textColor,N=b.style,T=b.url,P=Object(d.useState)(T),R=h()(P,2),B=R[0],L=R[1],D=Object(d.useState)(!1),F=h()(D,2),z=F[0],U=F[1],V=Object(d.useState)(!1),G=h()(V,2),H=G[0],q=G[1],W=Object(d.useState)({}),$=h()(W,2),K=$[0],Z=$[1],Y=function(){l.removeAllNotices(),l.createErrorNotice(Object(a.__)("Your calendar couldn't be embedded. Please double check your URL or code.","jetpack"))};Object(d.useEffect)((function(){T&&I!==T&&"link"!==N&&Object(C.a)(T,q).catch((function(){p({url:void 0}),Y()}))}),[]);var J,X=function(e){if(e){e.preventDefault();var t=w(B);if(t){if(t.buttonAttributes&&"link"===t.style){var n=Object(k.select)("core/editor").getBlocksByClientId(r);n.length&&n[0].innerBlocks.forEach((function(e){Object(k.dispatch)("core/editor").updateBlockAttributes(e.clientId,t.buttonAttributes)})),Z(t.buttonAttributes)}Object(C.a)(t.url,q).then((function(){var e=Object(y.a)(i,t);p(e),U(!1),l.removeAllNotices()})).catch((function(){p({url:void 0}),Y()}))}else Y()}else Y()},Q=Object(d.createElement)("div",{className:"wp-block-embed is-loading"},Object(d.createElement)(O.Spinner,null),Object(d.createElement)("p",null,Object(a.__)("Embedding…","jetpack"))),ee=Object(d.createElement)(O.Placeholder,{label:Object(a.__)("Calendly","jetpack"),instructions:Object(a.__)("Enter your Calendly web address or embed code below.","jetpack"),icon:Object(d.createElement)(v.BlockIcon,{icon:_}),notices:u},Object(d.createElement)("form",{onSubmit:X},Object(d.createElement)("input",{type:"text",id:"embedCode",onChange:function(e){return L(e.target.value)},placeholder:Object(a.__)("Calendly web address or embed code…","jetpack"),value:B||"",className:"components-placeholder__input"}),Object(d.createElement)("div",null,Object(d.createElement)(O.Button,{isSecondary:!0,type:"submit"},Object(a._x)("Embed","button label","jetpack")))),Object(d.createElement)("div",{className:"".concat(m,"-learn-more")},Object(d.createElement)(O.ExternalLink,{href:"https://help.calendly.com/hc/en-us/articles/223147027-Embed-options-overview"},Object(a.__)("Need help finding your embed code?","jetpack")))),te=Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",{className:"".concat(m,"-overlay")}),Object(d.createElement)("iframe",{src:(J=j.a.stringify({embed_domain:"wordpress.com",embed_type:"Inline",hide_event_type_details:E?1:0,background_color:g,primary_color:x,text_color:S}),"".concat(T,"?").concat(J)),width:"100%",height:"100%",frameBorder:"0","data-origwidth":"100%","data-origheight":"100%",title:"Calendly"})),ne=Object(d.createElement)(v.InnerBlocks,{template:[[M.name,s()(s()(s()({},M.attributes),K),{},{passthroughAttributes:{url:"url"}})]],templateLock:"all"});if(H)return Q;var re=n;return T&&!z&&(re+=" calendly-style-".concat(N)),Object(d.createElement)("div",{className:re},Object(d.createElement)(A,s()(s()({},e),{},{defaultClassName:m,embedCode:B,isEditingUrl:z,parseEmbedCode:X,setEmbedCode:L,setIsEditingUrl:U})),T&&!z?"inline"===N?te:ne:ee)}));var P=n(16),I="https://calendly.com/wordpresscom/jetpack-block-example",M={name:"jetpack/button",attributes:{element:"a",text:Object(a.__)("Schedule time with me","jetpack"),uniqueId:"calendly-widget-id",url:I}},R={title:Object(a.__)("Calendly","jetpack"),description:Object(a.__)("Embed a calendar for customers to schedule appointments","jetpack"),icon:{src:_,foreground:Object(P.a)()},category:"grow",keywords:[Object(a._x)("calendar","block search term","jetpack"),Object(a._x)("schedule","block search term","jetpack"),Object(a._x)("appointments","block search term","jetpack"),Object(a._x)("events","block search term","jetpack"),Object(a._x)("dates","block search term","jetpack")],supports:{align:!0,alignWide:!1,html:!1},edit:T,save:function(){return Object(d.createElement)("div",null,Object(d.createElement)(v.InnerBlocks.Content,null))},attributes:i,example:{attributes:{hideEventTypeDetails:!1,style:"inline",url:I},innerBlocks:[M]},transforms:{from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&E.test(e.textContent)},transform:function(e){var t=w(e.textContent);return Object(o.createBlock)("jetpack/calendly",t)}}]},deprecated:[m]};Object(r.a)("calendly",R)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(11),l={url:{type:"string",validator:function(e){return!e||e.startsWith("http")}},eventId:{type:"number"},style:{type:"string",default:"inline"}},s=n(4),u=n.n(s),p=n(5),d=n.n(p),m=n(8),b=n.n(m),h=n(6),f=n(3),g=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];var j=[{attributes:{url:{type:"string",validator:function(e){return!e||e.startsWith("http")}},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:Object(o._x)("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:function(e){var t=e.className,n=e.style;n||(n=e.useModal?"modal":"inline");var r=u()(u()({},Object(f.omit)(e,["useModal"].concat(g))),{},{className:t&&t.replace("is-style-outline",""),style:n}),a=Object(f.pick)(e,g);return[r,[Object(i.createBlock)("jetpack/button",u()(u()({element:"a",text:a.text||Object(o._x)("Register","verb: e.g. register for an event.","jetpack")},a),{},{uniqueId:"eventbrite-widget-id",className:t&&-1!==t.indexOf("is-style-outline")?"is-style-outline":""}))]]},save:function(e){var t=e.attributes,n=t.eventId,r=t.useModal,o=t.url,c=t.style;if(n)return r||"modal"===c?function(e){var t,n=e.backgroundColor,r=e.borderRadius,o=e.customBackgroundColor,c=e.customTextColor,i=e.eventId,l=e.text,s=e.textColor,u=e.url,p=Object(h.getColorClassName)("color",s),m=Object(h.getColorClassName)("background-color",n),f=b()("wp-block-button__link",(t={"has-text-color":s||c},d()(t,p,p),d()(t,"has-background",n||o),d()(t,m,m),d()(t,"no-border-radius",0===r),t)),g={backgroundColor:m?void 0:o,color:p?void 0:c,borderRadius:r?r+"px":void 0};return Object(a.createElement)("div",{className:"wp-block-button"},Object(a.createElement)(h.RichText.Content,{className:f,href:u,id:"eventbrite-widget-".concat(i),rel:"noopener noreferrer",role:"button",style:g,tagName:"a",target:"_blank",value:l}))}(t):o&&Object(a.createElement)("a",{className:"eventbrite__direct-link",href:o},o)},isEligible:function(e,t){return("modal"===e.style||e.useModal)&&(Object(f.isEmpty)(t)||Object(f.some)(Object(f.pick)(e,g),Boolean))}}],v=n(12),O=n.n(v),k=n(15),_=n.n(k),y=n(7),E=n.n(y),w=n(13),C=n.n(w),x=n(14),S=n.n(x);function N(e,t){var n=Object(a.createElement)("a",{href:e},e);t(Object(i.createBlock)("core/paragraph",{content:Object(a.renderToString)(n)}))}function A(e){if(!e)return null;var t=e.match(/(\d+)\/?(?:\?[^\/]*)?\s*$/);return t&&t[1]?parseInt(t[1],10):null}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e&&"string"==typeof e?e.trim():null}var P=n(43),I=n(23),M=n(187),R=n.n(M),B=n(109),L=n(81),D=function(e){var t=e.setEditingUrl;return Object(a.createElement)(c.ToolbarGroup,null,Object(a.createElement)(c.ToolbarButton,{className:"components-toolbar__control",label:Object(o.__)("Edit URL","jetpack"),icon:"edit",onClick:function(){return t(!0)}}))},F=(n(301),function(e){C()(n,e);var t=S()(n);function n(){var e;O()(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),d()(E()(e),"state",{editedUrl:e.props.attributes.url||"",editingUrl:!1,isResolvingUrl:!1}),d()(E()(e),"setUrl",(function(t){var n=e.props,r=n.attributes,a=n.noticeOperations,o=n.setAttributes,c=r.style;if(t&&q!==t&&"modal"!==c){var i={eventId:A(t),url:t};Object(L.a)(i.url,e.setIsResolvingUrl).then((function(t){var n=Object(P.a)(l,u()(u()({},i),{},{url:t}));o(n),e.setState({editedUrl:t}),a.removeAllNotices()})).catch((function(){o({eventId:void 0,url:void 0}),e.setErrorNotice()}))}})),d()(E()(e),"setIsResolvingUrl",(function(t){return e.setState({isResolvingUrl:t})})),d()(E()(e),"setEditingUrl",(function(t){return e.setState({editingUrl:t})})),d()(E()(e),"setErrorNotice",(function(){var t=e.props,n=t.noticeOperations,r=t.onReplace,i=e.state.editedUrl;n.removeAllNotices(),n.createErrorNotice(Object(a.createElement)(a.Fragment,null,Object(o.__)("Sorry, this content could not be embedded.","jetpack")," ",Object(a.createElement)(c.Button,{isLink:!0,onClick:function(){return N(i,r)}},Object(o._x)("Convert block to link","button label","jetpack"))))})),d()(E()(e),"submitForm",(function(t){t&&t.preventDefault(),e.setUrl(T(e.state.editedUrl)),e.setState({editingUrl:!1})})),d()(E()(e),"cannotEmbed",(function(){var t=e.props.attributes.url;return!e.state.isResolvingUrl&&t&&!G.test(t)})),e}return _()(n,[{key:"componentDidMount",value:function(){var e=this.props.attributes.url;this.setUrl(e)}},{key:"renderLoading",value:function(){return Object(a.createElement)("div",{className:"wp-block-embed is-loading"},Object(a.createElement)(c.Spinner,null),Object(a.createElement)("p",null,Object(o.__)("Embedding…","jetpack")))}},{key:"renderInspectorControls",value:function(){var e=this.props.attributes.style,t=this.props,n=t.attributes,r=t.clientId,c=t.setAttributes,i=[{value:"inline",label:Object(o.__)("In-page Embed","jetpack"),preview:Object(a.createElement)("div",{className:"block-editor-block-preview__container"},Object(a.createElement)("img",{src:R.a,alt:Object(o.__)("In page Eventbrite checkout example","jetpack")}))},{value:"modal",label:Object(o.__)("Button & Modal","jetpack")}];return Object(a.createElement)(B.a,{title:Object(o._x)("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:r,styleOptions:i,onSelectStyle:c,activeStyle:e,attributes:n,viewportWidth:130})}},{key:"renderEditEmbed",value:function(){var e=this,t=this.props,n=t.className,r=t.noticeUI,i=this.state.editedUrl,l=Object(I.c)()||Object(I.a)()?"http://support.wordpress.com/wordpress-editor/blocks/eventbrite-block/":"https://jetpack.com/support/jetpack-blocks/eventbrite-block/";return Object(a.createElement)("div",{className:n},Object(a.createElement)(c.Placeholder,{label:Object(o.__)("Eventbrite Checkout","jetpack"),instructions:Object(o.__)("Paste a link to an Eventbrite event to embed ticket checkout.","jetpack"),icon:Object(a.createElement)(h.BlockIcon,{icon:$}),notices:r},Object(a.createElement)("form",{onSubmit:this.submitForm},Object(a.createElement)("input",{type:"url",value:i,className:"components-placeholder__input","aria-label":Object(o.__)("Eventbrite URL","jetpack"),placeholder:Object(o.__)("Enter an event URL to embed here…","jetpack"),onChange:function(t){return e.setState({editedUrl:t.target.value})}}),Object(a.createElement)(c.Button,{isSecondary:!0,type:"submit"},Object(o._x)("Embed","submit button label","jetpack"))),Object(a.createElement)("div",{className:"components-placeholder__learn-more"},Object(a.createElement)(c.ExternalLink,{href:l},Object(o.__)("Learn more about Eventbrite embeds","jetpack")))))}},{key:"renderInlinePreview",value:function(){var e=this.props.className,t=this.props.attributes.eventId;if(t){var n="eventbrite-widget-".concat(t),r="\n\t\t\t<script src=\"https://www.eventbrite.com/static/widgets/eb_widgets.js\"><\/script>\n\t\t\t<style>\n\t\t\t\t/* Prevent scrollbar on the embed preview */\n\t\t\t\tbody {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t}\n\t\t\t\t/* Eventbrite embeds have a CSS height transition on loading, which causes <Sandbox>\n\t\t\t\tto not recognise the resizing. We need to disable that transition. */\n\t\t\t\t* {\n\t\t\t\t\ttransition: none !important;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<script>\n\t\t\t\twindow.EBWidgets.createWidget({\n\t\t\t\t\twidgetType: 'checkout',\n\t\t\t\t\teventId: ".concat(t,",\n\t\t\t\t\tiframeContainerId: '").concat(n,"',\n\t\t\t\t});\n\t\t\t<\/script>\n\t\t\t<div id=\"").concat(n,'"></div>\n\t\t');return Object(a.createElement)("div",{className:e},Object(a.createElement)(c.SandBox,{html:r}),Object(a.createElement)("div",{className:"block-library-embed__interactive-overlay"}))}}},{key:"render",value:function(){var e=this.props.attributes,t=e.url,n=e.style,r=this.state,o=r.editingUrl;return r.isResolvingUrl?this.renderLoading():o||!t||this.cannotEmbed()?this.renderEditEmbed():Object(a.createElement)(a.Fragment,null,this.renderInspectorControls(),Object(a.createElement)(h.BlockControls,null,Object(a.createElement)(D,{setEditingUrl:this.setEditingUrl})),"modal"===n?Object(a.createElement)(h.InnerBlocks,{template:[[V.name,V.attributes]],templateLock:"all"}):this.renderInlinePreview())}}]),n}(a.Component)),z=Object(c.withNotices)(F);var U=n(16),V={name:"jetpack/button",attributes:{element:"a",text:Object(o._x)("Register","verb: e.g. register for an event.","jetpack"),uniqueId:"eventbrite-widget-id"}},G=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^\/]*?(\d+)\/?(?:\?[^\/]*)?\s*$/i,H=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^\/]*)?\s*$/i,q="https://www.eventbrite.com/e/test-event-tickets-123456789",W=Object(o.__)("Eventbrite Checkout","jetpack"),$=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Rect,{x:"0",fill:"none",width:"24",height:"24"}),Object(a.createElement)(c.G,{id:"eventbrite-icon"},Object(a.createElement)(c.Path,{d:"M18.041,3.931L5.959,3C4.325,3,3,4.325,3,5.959v12.083C3,19.675,4.325,21,5.959,21l12.083-0.931C19.699,19.983,21,18.744,21,17.11V6.89C21,5.256,19.741,4.027,18.041,3.931zM16.933,8.17c-0.082,0.215-0.192,0.432-0.378,0.551c-0.188,0.122-0.489,0.132-0.799,0.132c-1.521,0-3.062-0.048-4.607-0.048c-0.152,0.708-0.304,1.416-0.451,2.128c0.932-0.004,1.873,0.005,2.81,0.005c0.726,0,1.462-0.069,1.586,0.525c0.04,0.189-0.001,0.426-0.052,0.615c-0.105,0.38-0.258,0.676-0.625,0.783c-0.185,0.054-0.408,0.058-0.646,0.058c-1.145,0-2.345,0.017-3.493,0.02c-0.169,0.772-0.328,1.553-0.489,2.333c1.57-0.005,3.067-0.041,4.633-0.058c0.627-0.007,1.085,0.194,1.009,0.85c-0.031,0.262-0.098,0.497-0.211,0.725c-0.102,0.208-0.248,0.376-0.488,0.452c-0.237,0.075-0.541,0.064-0.862,0.078c-0.304,0.014-0.614,0.008-0.924,0.016c-0.309,0.009-0.619,0.022-0.919,0.022c-1.253,0-2.429,0.08-3.683,0.073c-0.603-0.004-1.014-0.249-1.124-0.757c-0.059-0.273-0.018-0.58,0.036-0.841c0.541-2.592,1.083-5.176,1.629-7.763c0.056-0.265,0.114-0.511,0.225-0.714C9.279,7.051,9.534,6.834,9.9,6.735c0.368-0.099,0.883-0.047,1.344-0.047c0.305,0,0.612,0.008,0.914,0.016c0.925,0.026,1.817,0.03,2.747,0.053c0.304,0.007,0.615,0.016,0.915,0.016c0.621,0,1.17,0.073,1.245,0.614C17.104,7.675,17.014,7.954,16.933,8.17z"}))),K={title:W,description:Object(o.__)("Embed Eventbrite event details and ticket checkout.","jetpack"),icon:{src:$,foreground:Object(U.a)()},category:"embed",keywords:[Object(o._x)("events","block search term","jetpack"),Object(o._x)("tickets","block search term","jetpack")],supports:{html:!1,align:!0},attributes:l,edit:z,save:function(e){var t=e.attributes,n=t.eventId,r=t.style,o=t.url;if(n)return"modal"===r?Object(a.createElement)("div",null,Object(a.createElement)(h.InnerBlocks.Content,null)):o&&Object(a.createElement)("a",{className:"eventbrite__direct-link",href:o},o)},transforms:{from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&(G.test(e.textContent)||H.test(e.textContent))},transform:function(e){return Object(i.createBlock)("jetpack/eventbrite",{url:e.textContent.trim()})}}]},example:{attributes:{url:q,eventId:123456789,style:"modal"},innerBlocks:[V]},deprecated:j};Object(r.a)("eventbrite",K)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(9),l=n.n(i),s=n(8),u=n.n(s),p=n(6),d="t1PkR1Vq0mzHueIFBvZSZErgFs9NBmYW",m=function(e){return"https://api.giphy.com/v1/gifs/search?q=".concat(encodeURIComponent(e),"&api_key=").concat(encodeURIComponent(d),"&limit=10")},b=function(e){return"https://api.giphy.com/v1/gifs/".concat(encodeURIComponent(e),"?api_key=").concat(encodeURIComponent(d))},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=e.split(t);return n[n.length-1]},f=function(e){return"".concat(Math.floor(e.images.original.height/e.images.original.width*100),"%")},g=function(e){return null==e?void 0:e.embed_url},j=function(e){return{giphyUrl:g(e),paddingTop:f(e)}};var v=Object(a.forwardRef)((function(e,t){var n=e.onSubmit,r=e.onChange,i=e.value,l=void 0===i?"":i;return Object(a.createElement)("form",{className:"wp-block-jetpack-gif_input-container",onSubmit:n},Object(a.createElement)("input",{type:"text",className:"wp-block-jetpack-gif_input components-placeholder__input",placeholder:Object(o.__)("Enter search terms, e.g. cat…","jetpack"),value:l,onChange:r,ref:t,"aria-labelledby":"wp-block-jetpack-gif_search-button"}),Object(a.createElement)(c.Button,{id:"wp-block-jetpack-gif_search-button",isSecondary:!0,type:"submit"},Object(o.__)("Search","jetpack")))}));function O(){return Object(a.createElement)(p.InspectorControls,null,Object(a.createElement)(c.PanelBody,{className:"components-panel__body-gif-branding"},Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 202 22"},Object(a.createElement)(c.Path,{d:"M4.6 5.9H0v10h1.6v-3.1h3c4.8 0 4.8-6.9 0-6.9zm0 5.4h-3v-4h3c2.6.1 2.6 4 0 4zM51.2 12.3c2-.3 2.7-1.7 2.7-3.1 0-1.7-1.2-3.3-3.5-3.3h-4.6v10h1.6v-3.4h2.1l3 3.4h1.9l-.2-.3-3-3.3zM47.4 11V7.4h3c1.3 0 1.9.9 1.9 1.8s-.6 1.8-1.9 1.8h-3zM30.6 13.6L28 5.9h-1.1l-2.5 7.7-2.6-7.7H20l3.7 10H25l1.4-3.5L27.5 9l1.1 3.4 1.3 3.5h1.4l3.5-10h-1.7z"}),Object(a.createElement)(c.Path,{d:"M14.4 5.7c-3 0-5.1 2.2-5.1 5.2 0 2.6 1.6 5.1 5.1 5.1 3.5 0 5.1-2.5 5.1-5.2-.1-2.6-1.7-5.1-5.1-5.1zm-.1 8.9c-2.5 0-3.5-1.9-3.5-3.7 0-2.2 1.2-3.8 3.5-3.8 2.4 0 3.5 2 3.5 3.8.1 2-1 3.7-3.5 3.7zM57.7 11.6h5.5v-1.5h-5.5V7.4h5.7V5.9h-7.3v10h7.3v-1.6h-5.7zM38 14.3v-2.7h5.5v-1.5H38V7.4h5.7V5.9h-7.3v10h7.3v-1.6zM93 10.3l-2.7-4.4h-1.9V6l3.8 5.8v4.1h1.6v-4.1l4-5.8v-.1h-2zM69.3 5.9h-3.8v10h3.8c3.5 0 5.1-2.5 5-5.1-.1-2.5-1.6-4.9-5-4.9zm0 8.4h-2.2V7.4h2.2c2.3 0 3.4 1.7 3.4 3.4s-1 3.5-3.4 3.5zM86.3 10.7c.9-.4 1.4-1.1 1.4-2 0-2-1.5-2.8-3.4-2.8h-4.6v10h4.6c2 0 3.7-.7 3.7-2.8 0-.8-.5-2-1.7-2.4zm-5-3.4h3c1.2 0 1.8.7 1.8 1.4 0 .8-.6 1.3-1.8 1.3h-3V7.3zm3 7.1h-3v-2.9h3c.9 0 2.1.5 2.1 1.6 0 1-1.2 1.3-2.1 1.3zM113.9 13.3h5.3V16c-1.2.9-2.9 1.1-4 1.1-4.2 0-5.6-3.3-5.6-6 0-4.1 2.2-6.1 5.6-6.1 1.4 0 3.2.4 4.8 1.8l3.4-3.4C120.7.6 118.1 0 115.2 0c-7.8 0-11.4 5.6-11.4 11s3.1 10.9 11.4 10.9c4 0 7.6-1.4 8.9-4.1V8.6h-10.2v4.7zM171.9 8.5h-7.4V.6h-5.9v20.8h5.9v-7.8h7.4v7.8h5.9V.6h-5.9zM195.1.6l-4.5 7.1-4.3-7.1h-6.6v.2l7.9 12.3v8.3h5.9v-8.3L201.8.9V.6zM127.4.6h5.9v20.8h-5.9zM147.6.6h-10.1v20.8h5.9v-5.6h4.2c5.6-.1 8.3-3.4 8.3-7.6.1-4.1-2.7-7.6-8.3-7.6zm0 10.2h-4.2V5.6h4.2c1.6 0 2.5 1.2 2.5 2.6 0 1.4-.9 2.6-2.5 2.6z"}))))}var k=n(26),_=n.n(k),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=Object(a.useState)(!1),n=l()(t,2),r=n[0],o=n[1],c=Object(a.useState)(e),i=l()(c,2),s=i[0],u=i[1],p=Object(a.useState)(""),d=l()(p,2),m=d[0],b=d[1];return Object(a.useEffect)((function(){m&&function(){var e=_()(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.next=3,fetch(m).then((function(e){return!!e.ok&&e})).catch((function(){return!1}));case 3:if(!(t=e.sent)){e.next=11;break}return e.next=7,t.json();case 7:n=e.sent,r=void 0!==n.data.images?[n.data]:n.data,r[0].images&&u(r);case 11:o(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}),[m]),{isFetching:r,giphyData:s,fetchGiphyData:b}};var E=function(e){var t=e.attributes,n=e.setAttributes,r=e.className,i=e.isSelected,s=t.align,d=t.caption,f=t.giphyUrl,g=t.searchText,k=t.paddingTop,_=u()(r,"align".concat(s)),E=Object(a.useState)(!1),w=l()(E,2),S=w[0],N=w[1],A=Object(a.createRef)(),T=y(),P=T.isFetching,I=T.giphyData,M=T.fetchGiphyData,R=function(){A.current.focus(),N(!1)};Object(a.useEffect)((function(){I&&I[0]&&n(j(I[0]))}),[I,n]);var B=function(e){e.preventDefault(),t.searchText&&!P&&M(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=null,n=/^https?:\/\/(media\.|i\.)?giphy\.com\/(embed|gifs|media)?\/?([-\w]*)(\/giphy)?(\.gif)?$/,r=(e=e.trim()).match(n);return r&&r[3]&&(t=h(r[3],"-")),t?b(t):m(e)}(t.searchText))},L=function(e){return n({searchText:e.target.value})};return Object(a.createElement)("div",{className:_},Object(a.createElement)(O,null),f?Object(a.createElement)("figure",null,i&&Object(a.createElement)(v,{onSubmit:B,onChange:L,value:g,ref:A}),i&&I&&I.length>1&&Object(a.createElement)("div",{className:"wp-block-jetpack-gif_thumbnails-container"},I.map((function(e){var t={backgroundImage:"url(".concat(e.images.downsized_still.url,")")};return Object(a.createElement)("button",{className:"wp-block-jetpack-gif_thumbnail-container",key:e.id,onClick:function(t){t.preventDefault(),function(e){n(j(e))}(e)},style:t})}))),Object(a.createElement)("div",{className:"wp-block-jetpack-gif-wrapper",style:{paddingTop:k}},Object(a.createElement)("div",{className:"wp-block-jetpack-gif_cover",onClick:R,onKeyDown:R,role:"button",tabIndex:"0"}),Object(a.createElement)("iframe",{src:f,title:g})),(!p.RichText.isEmpty(d)||i)&&!!f&&Object(a.createElement)(p.RichText,{className:"wp-block-jetpack-gif-caption gallery-caption",inlineToolbar:!0,isSelected:S,unstableOnFocus:function(){return N(!1)},onChange:function(e){return n({caption:e})},placeholder:Object(o.__)("Write caption…","jetpack"),tagName:"figcaption",value:d})):Object(a.createElement)(c.Placeholder,{className:"wp-block-jetpack-gif_placeholder",icon:x,label:C,instructions:Object(o.__)("Search for a term or paste a Giphy URL","jetpack")},Object(a.createElement)(v,{onSubmit:B,onChange:L,value:g,ref:A})))},w=n(16),C=(n(233),n(302),Object(o.__)("GIF","jetpack")),x=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5l-2-2zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54L16.5 18zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12 19.3 8.89zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9z"})),S={title:C,icon:{src:x,foreground:Object(w.a)()},category:"embed",keywords:[Object(o._x)("animated","block search term","jetpack"),Object(o._x)("giphy","block search term","jetpack"),Object(o._x)("image","block search term","jetpack")],description:Object(o.__)("Search for and insert an animated image.","jetpack"),attributes:{align:{type:"string",default:"center"},caption:{type:"string"},giphyUrl:{type:"string"},searchText:{type:"string"},paddingTop:{type:"string",default:"56.2%"}},supports:{html:!1,align:!0},edit:E,save:function(){return null},example:{attributes:{align:"center",giphyUrl:"https://giphy.com/embed/fxKWgoOG9hzPPkE1oc",paddingTop:"100%",searchText:"WordPress"}}};Object(r.a)("gif",S)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(6),i=n(2),l=n(4),s=n.n(l),u=n(3),p=n(11),d=["submitButtonText","backgroundButtonColor","textButtonColor","submitButtonClasses","customBackgroundButtonColor","customTextButtonColor"],m={attributes:{emailPlaceholder:{type:"string",default:Object(o.__)("Enter your email","jetpack")},submitButtonText:{type:"string",default:Object(o.__)("Join my email list","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},submitButtonClasses:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},consentText:{type:"string",default:Object(o.__)("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack")},interests:{type:"array",default:[]},processingLabel:{type:"string",default:Object(o.__)("Processing…","jetpack")},signupFieldTag:{type:"string"},signupFieldValue:{type:"string"},successLabel:{type:"string",default:Object(o.__)("Success! You're on the list.","jetpack")},errorLabel:{type:"string",default:Object(o.__)("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},preview:{type:"boolean",default:!1}},migrate:function(e){var t,n=Object(u.omit)(e,d),r={text:(t=e).submitButtonText||Object(o.__)("Join my email list","jetpack"),textColor:t.textButtonColor,customTextColor:t.customTextButtonColor,backgroundColor:t.backgroundButtonColor,customBackgroundColor:t.customBackgroundButtonColor};return[n,[Object(p.createBlock)("jetpack/button",s()({element:"button",uniqueId:"mailchimp-widget-id"},r))]]},isEligible:function(e,t){return Object(u.isEmpty)(t)||Object(u.some)(Object(u.pick)(e,d),Boolean)},save:function(){return null}},b=n(12),h=n.n(b),f=n(7),g=n.n(f),j=n(13),v=n.n(j),O=n(14),k=n.n(O),_=n(5),y=n.n(_),E=n(22),w=n.n(E),C=n(8),x=n.n(C),S=n(27),N=n(19),A=n.n(N),T=n(15),P=n.n(T),I=function(e){v()(n,e);var t=k()(n);function n(){var e;h()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),y()(g()(e),"state",{interest_categories:[]}),y()(g()(e),"retrieveGroups",(function(){w()({method:"GET",path:"/wpcom/v2/mailchimp/groups"}).then((function(t){var n=t.interest_categories;e.setState({interest_categories:n})}))})),y()(g()(e),"render",(function(){var t=e.state.interest_categories,n=e.props,r=n.interests,o=n.onChange;return Object(a.createElement)(a.Fragment,null,t&&(t||[]).map((function(e){return e.interests.map((function(e){return Object(a.createElement)(i.CheckboxControl,{label:e.name,value:e.id,checked:r.includes(e.id),onChange:function(t){return o(e.id,t)},key:e.id})}))})))})),e}return P()(n,[{key:"componentDidMount",value:function(){this.retrieveGroups()}}]),n}(a.Component),M=I;I.defaultProps={interests:[],onChange:function(){return null}};var R="processing",B="success",L="error";function D(e){var t=e.auditionNotification,n=e.clearAudition,r=e.setAttributes,c=e.emailPlaceholder,l=e.processingLabel,s=e.successLabel,u=e.errorLabel,p=e.interests,d=e.signupFieldTag,m=e.signupFieldValue,b=e.connectURL;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.PanelBody,{title:Object(o.__)("Text Elements","jetpack")},Object(a.createElement)(i.TextControl,{label:Object(o.__)("Email Placeholder","jetpack"),value:c,onChange:function(e){r({emailPlaceholder:e}),n()}})),Object(a.createElement)(i.PanelBody,{title:Object(o.__)("Notifications","jetpack")},Object(a.createElement)(i.TextControl,{label:Object(o.__)("Processing text","jetpack"),value:l,onChange:function(e){r({processingLabel:e}),t(R)}}),Object(a.createElement)(i.TextControl,{label:Object(o.__)("Success text","jetpack"),value:s,onChange:function(e){r({successLabel:e}),t(B)}}),Object(a.createElement)(i.TextControl,{label:Object(o.__)("Error text","jetpack"),value:u,onChange:function(e){r({errorLabel:e}),t(L)}})),Object(a.createElement)(i.PanelBody,{title:Object(o.__)("Mailchimp Groups","jetpack")},Object(a.createElement)(M,{interests:p,onChange:function(e,t){var n=A()(new Set([].concat(A()(p),[e]))).filter((function(n){return!(n===e&&!t)&&n}));r({interests:n})}}),Object(a.createElement)(i.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/"},Object(o.__)("Learn about groups","jetpack"))),Object(a.createElement)(i.PanelBody,{title:Object(o.__)("Signup Location Tracking","jetpack")},Object(a.createElement)(i.TextControl,{label:Object(o.__)("Signup Field Tag","jetpack"),placeholder:Object(o.__)("SIGNUP","jetpack"),value:d,onChange:function(e){return r({signupFieldTag:e})}}),Object(a.createElement)(i.TextControl,{label:Object(o.__)("Signup Field Value","jetpack"),placeholder:Object(o.__)("website","jetpack"),value:m,onChange:function(e){return r({signupFieldValue:e})}}),Object(a.createElement)(i.ExternalLink,{href:"https://mailchimp.com/help/determine-webpage-signup-location/"},Object(o.__)("Learn about signup location tracking","jetpack"))),Object(a.createElement)(i.PanelBody,{title:Object(o.__)("Mailchimp Connection","jetpack")},Object(a.createElement)(i.ExternalLink,{href:b},Object(o.__)("Manage Connection","jetpack"))))}var F=n(61),z=function(e){v()(n,e);var t=k()(n);function n(){var e;return h()(this,n),e=t.apply(this,arguments),y()(g()(e),"componentDidMount",(function(){e.apiCall()})),y()(g()(e),"onError",(function(t){var n=e.props.noticeOperations;n.removeAllNotices(),n.createErrorNotice(t)})),y()(g()(e),"apiCall",(function(){var t=Object(F.a)();if(t){var n={path:"/wpcom/v2/mailchimp",method:"GET"};w()(n).then((function(n){var r=n.connect_url,a="connected"===n.code?1:2;e.setState({currentUserConnected:t,connected:a,connectURL:r})}),(function(n){e.setState({currentUserConnected:t,connected:2,connectURL:null}),e.onError(n.message)}))}else w()({path:Object(S.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then((function(n){var r=n;e.setState({currentUserConnected:t,connected:2,connectURL:r})}))})),y()(g()(e),"auditionNotification",(function(t){e.setState({audition:t}),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(e.clearAudition,3e3)})),y()(g()(e),"clearAudition",(function(){e.setState({audition:null})})),y()(g()(e),"labelForAuditionType",(function(t){var n=e.props.attributes,r=n.processingLabel,a=n.successLabel,o=n.errorLabel;return t===R?r:t===B?a:t===L?o:null})),y()(g()(e),"roleForAuditionType",(function(e){return e===L?"alert":"status"})),y()(g()(e),"render",(function(){var t=e.props,n=t.attributes,r=t.className,l=t.notices,s=t.noticeUI,u=t.setAttributes,p=e.state,d=p.audition,m=p.connected,b=p.connectURL,h=p.currentUserConnected,f=n.emailPlaceholder,g=n.consentText,j=n.interests,v=n.processingLabel,O=n.successLabel,k=n.errorLabel,_=n.preview,E=n.signupFieldTag,w=n.signupFieldValue,C="wp-block-jetpack-mailchimp",S=Object(a.createElement)(i.Placeholder,{icon:G,notices:l},Object(a.createElement)(i.Spinner,null)),N=Object(a.createElement)(i.Placeholder,{className:"wp-block-jetpack-mailchimp",icon:G,label:Object(o.__)("Mailchimp","jetpack"),notices:l,instructions:Object(o.__)("You need to connect your Mailchimp account and choose a list in order to start collecting Email subscribers.","jetpack")},Object(a.createElement)(i.Button,{isSecondary:!0,isLarge:!0,href:b,target:"_blank"},Object(o.__)("Set up Mailchimp form","jetpack")),Object(a.createElement)("div",{className:"".concat(C,"-recheck")},Object(a.createElement)(i.Button,{isLink:!0,onClick:e.apiCall},Object(o.__)("Re-check Connection","jetpack")))),A=Object(a.createElement)(i.Placeholder,{className:"wp-block-jetpack-mailchimp",icon:G,label:Object(o.__)("Mailchimp","jetpack"),notices:l,instructions:Object(o.__)("First, you'll need to connect your WordPress.com account.","jetpack")},Object(a.createElement)(i.Button,{isSecondary:!0,isLarge:!0,href:b},Object(o.__)("Connect to WordPress.com","jetpack"))),T=Object(a.createElement)(c.InspectorControls,null,Object(a.createElement)(D,{auditionNotification:e.auditionNotification,clearAudition:e.clearAudition,emailPlaceholder:f,processingLabel:v,successLabel:O,errorLabel:k,interests:j,setAttributes:e.props.setAttributes,signupFieldTag:E,signupFieldValue:w,connectURL:b})),P=x()(r,y()({},"".concat(C,"_notication-audition"),d)),I=Object(a.createElement)("div",{className:P},Object(a.createElement)(i.TextControl,{"aria-label":f,className:"wp-block-jetpack-mailchimp_text-input",disabled:!0,onChange:function(){return!1},placeholder:f,title:Object(o.__)("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),Object(a.createElement)(c.InnerBlocks,{template:[[H.name,H.attributes]],templateLock:"all"}),Object(a.createElement)(c.RichText,{tagName:"p",placeholder:Object(o.__)("Write consent text","jetpack"),value:g,onChange:function(e){return u({consentText:e})},inlineToolbar:!0}),d&&Object(a.createElement)("div",{className:"".concat(C,"_notification ").concat(C,"_").concat(d),role:e.roleForAuditionType(d)},e.labelForAuditionType(d))),M=I;return Object(a.createElement)(a.Fragment,null,s,_&&M,!_&&0===m&&S,!_&&2===m&&h&&N,!_&&2===m&&!h&&A,!_&&1===m&&T,!_&&1===m&&I)})),e.state={audition:null,connected:0,connectURL:null,currentUserConnected:null},e.timeout=null,e}return n}(a.Component),U=Object(i.withNotices)(z),V=(n(307),n(16)),G=Object(a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(i.G,{transform:"translate(-45.478101,-100.73059)"},Object(a.createElement)(i.G,{transform:"matrix(0.26458333,0,0,0.26458333,15.6741,59.72)"},Object(a.createElement)(i.Path,{d:"m 176.433,197.529 c 0.657,-0.078 1.286,-0.082 1.865,0 0.335,-0.768 0.392,-2.091 0.091,-3.532 -0.447,-2.142 -1.053,-3.438 -2.305,-3.236 -1.252,0.202 -1.298,1.754 -0.85,3.895 0.252,1.205 0.7,2.235 1.199,2.873"}),Object(a.createElement)(i.Path,{d:"m 165.688,199.224 c 0.895,0.393 1.446,0.654 1.661,0.426 0.139,-0.142 0.097,-0.413 -0.117,-0.762 -0.442,-0.721 -1.351,-1.453 -2.316,-1.864 -1.972,-0.849 -4.325,-0.567 -6.14,0.737 -0.599,0.439 -1.167,1.047 -1.086,1.416 0.026,0.119 0.116,0.209 0.326,0.239 0.494,0.056 2.22,-0.816 4.209,-0.938 1.403,-0.086 2.566,0.353 3.462,0.746"}),Object(a.createElement)(i.Path,{d:"m 163.887,200.252 c -1.167,0.184 -1.81,0.569 -2.223,0.926 -0.352,0.308 -0.57,0.649 -0.568,0.888 0.001,0.114 0.05,0.18 0.089,0.213 0.053,0.047 0.116,0.073 0.192,0.073 0.263,0 0.854,-0.237 0.854,-0.237 1.623,-0.581 2.694,-0.51 3.755,-0.39 0.586,0.066 0.864,0.102 0.992,-0.099 0.038,-0.058 0.084,-0.183 -0.033,-0.373 -0.273,-0.443 -1.451,-1.192 -3.057,-1.001"}),Object(a.createElement)(i.Path,{d:"m 172.805,204.025 c 0.792,0.389 1.664,0.236 1.948,-0.341 0.284,-0.577 -0.128,-1.361 -0.92,-1.75 -0.792,-0.389 -1.664,-0.236 -1.948,0.341 -0.284,0.578 0.128,1.361 0.92,1.75"}),Object(a.createElement)(i.Path,{d:"m 177.896,199.576 c -0.643,-0.011 -1.177,0.695 -1.192,1.578 -0.015,0.883 0.495,1.606 1.138,1.617 0.643,0.011 1.177,-0.695 1.192,-1.578 0.015,-0.882 -0.495,-1.606 -1.138,-1.617"}),Object(a.createElement)(i.Path,{d:"m 134.683,215.485 c -0.16,-0.201 -0.423,-0.14 -0.678,-0.08 -0.178,0.042 -0.379,0.088 -0.6,0.085 -0.473,-0.009 -0.874,-0.211 -1.099,-0.557 -0.293,-0.45 -0.276,-1.121 0.047,-1.889 l 0.151,-0.344 c 0.516,-1.158 1.379,-3.095 0.41,-4.941 -0.73,-1.39 -1.92,-2.255 -3.351,-2.437 -1.374,-0.174 -2.788,0.335 -3.69,1.33 -1.423,1.57 -1.646,3.707 -1.371,4.462 0.101,0.276 0.259,0.353 0.373,0.369 0.242,0.032 0.6,-0.144 0.824,-0.747 l 0.064,-0.196 c 0.1,-0.319 0.286,-0.913 0.591,-1.389 0.368,-0.574 0.94,-0.969 1.612,-1.114 0.684,-0.147 1.384,-0.016 1.97,0.368 0.997,0.652 1.381,1.874 0.955,3.039 -0.22,0.603 -0.578,1.756 -0.499,2.703 0.16,1.917 1.339,2.687 2.398,2.769 1.03,0.039 1.75,-0.54 1.932,-0.962 0.107,-0.25 0.017,-0.402 -0.042,-0.467"}),Object(a.createElement)(i.Path,{d:"m 144.475,180.275 c 3.36,-3.882 7.495,-7.257 11.2,-9.152 0.128,-0.066 0.264,0.073 0.195,0.199 -0.294,0.533 -0.861,1.674 -1.04,2.539 -0.028,0.135 0.119,0.236 0.233,0.159 2.305,-1.571 6.314,-3.255 9.831,-3.471 0.151,-0.009 0.224,0.184 0.104,0.277 -0.535,0.41 -1.12,0.978 -1.547,1.552 -0.073,0.098 -0.004,0.238 0.118,0.239 2.469,0.018 5.95,0.882 8.219,2.155 0.153,0.086 0.044,0.383 -0.128,0.344 -3.433,-0.787 -9.052,-1.384 -14.89,0.04 -5.211,1.271 -9.189,3.234 -12.09,5.344 -0.147,0.107 -0.323,-0.087 -0.204,-0.224 z m 16.732,37.612 0.001,0.002 0.002,0.004 z m 13.854,1.635 c 0.1,-0.042 0.168,-0.155 0.157,-0.268 -0.014,-0.139 -0.138,-0.24 -0.277,-0.226 0,0 -7.169,1.061 -13.942,-1.418 0.738,-2.398 2.699,-1.532 5.664,-1.293 5.344,0.319 10.134,-0.462 13.674,-1.478 3.067,-0.88 7.096,-2.616 10.225,-5.086 1.055,2.318 1.428,4.87 1.428,4.87 0,0 0.817,-0.146 1.5,0.274 0.645,0.397 1.118,1.222 0.795,3.356 -0.658,3.986 -2.352,7.222 -5.2,10.199 -1.734,1.866 -3.838,3.488 -6.246,4.668 -1.279,0.672 -2.64,1.253 -4.079,1.722 -10.736,3.507 -21.726,-0.348 -25.268,-8.626 -0.283,-0.622 -0.522,-1.274 -0.71,-1.955 -1.509,-5.455 -0.228,-12 3.778,-16.12 v -0.002 c 0.247,-0.262 0.499,-0.571 0.499,-0.96 0,-0.325 -0.207,-0.668 -0.386,-0.912 -1.402,-2.033 -6.257,-5.497 -5.282,-12.201 0.7,-4.816 4.912,-8.208 8.839,-8.007 l 0.995,0.057 c 1.702,0.101 3.186,0.319 4.587,0.378 2.345,0.102 4.453,-0.239 6.951,-2.32 0.842,-0.702 1.518,-1.311 2.661,-1.504 0.12,-0.021 0.419,-0.128 1.016,-0.1 0.61,0.033 1.19,0.2 1.711,0.547 2.002,1.332 2.286,4.559 2.39,6.919 0.059,1.347 0.222,4.607 0.278,5.543 0.127,2.14 0.69,2.441 1.828,2.816 0.64,0.211 1.234,0.368 2.11,0.614 2.65,0.744 4.221,1.499 5.212,2.469 0.591,0.606 0.866,1.25 0.951,1.864 0.312,2.28 -1.77,5.096 -7.283,7.655 -6.026,2.797 -13.337,3.505 -18.388,2.942 l -1.77,-0.2 c -4.04,-0.544 -6.345,4.677 -3.92,8.255 1.563,2.306 5.82,3.806 10.079,3.807 9.765,0.001 17.271,-4.169 20.063,-7.77 l 0.223,-0.318 c 0.138,-0.207 0.024,-0.321 -0.147,-0.204 -2.281,1.561 -12.413,7.758 -23.251,5.893 0,0 -1.317,-0.217 -2.519,-0.684 -0.955,-0.372 -2.955,-1.292 -3.198,-3.343 8.746,2.705 14.253,0.148 14.253,0.148 z m -48.039,-20.785 c -3.042,0.591 -5.723,2.315 -7.362,4.697 -0.98,-0.817 -2.805,-2.399 -3.128,-3.016 -2.617,-4.97 2.856,-14.632 6.68,-20.089 9.45,-13.485 24.25,-23.692 31.101,-21.84 1.114,0.315 4.803,4.592 4.803,4.592 0,0 -6.849,3.8 -13.2,9.097 -8.558,6.589 -15.022,16.166 -18.895,26.559 z m 5.111,22.805 c -0.46,0.079 -0.93,0.11 -1.404,0.098 -4.577,-0.123 -9.52,-4.243 -10.011,-9.129 -0.543,-5.401 2.217,-9.557 7.103,-10.543 0.584,-0.118 1.29,-0.186 2.051,-0.146 2.738,0.15 6.772,2.252 7.693,8.216 0.816,5.282 -0.48,10.659 -5.432,11.503 z m 61.996,-9.564 c -0.039,-0.139 -0.295,-1.072 -0.646,-2.197 -0.351,-1.126 -0.714,-1.917 -0.714,-1.917 1.408,-2.107 1.433,-3.992 1.245,-5.059 -0.2,-1.323 -0.751,-2.45 -1.861,-3.616 -1.11,-1.165 -3.381,-2.359 -6.572,-3.255 l -1.674,-0.465 c -0.008,-0.069 -0.088,-3.947 -0.16,-5.612 -0.053,-1.204 -0.156,-3.083 -0.739,-4.933 -0.695,-2.505 -1.905,-4.697 -3.416,-6.099 4.17,-4.322 6.773,-9.084 6.766,-13.168 -0.012,-7.855 -9.659,-10.232 -21.548,-5.309 l -2.519,1.069 c -0.011,-0.011 -4.554,-4.468 -4.622,-4.528 -13.555,-11.823 -55.935,35.284 -42.386,46.725 l 2.961,2.509 c -0.768,1.99 -1.07,4.27 -0.823,6.721 0.316,3.149 1.94,6.167 4.573,8.499 2.499,2.214 5.785,3.616 8.973,3.613 5.273,12.151 17.321,19.605 31.447,20.025 15.153,0.45 27.873,-6.66 33.203,-19.432 0.349,-0.896 1.828,-4.935 1.828,-8.501 0,-3.583 -2.026,-5.068 -3.316,-5.068"})))),H={name:"jetpack/button",attributes:{element:"button",text:Object(o.__)("Join my email list","jetpack"),uniqueId:"mailchimp-widget-id"}},q={title:Object(o.__)("Mailchimp","jetpack"),icon:{src:G,foreground:Object(V.a)()},description:Object(o.__)("A form enabling readers to join a Mailchimp list.","jetpack"),category:"grow",keywords:[Object(o._x)("email","block search term","jetpack"),Object(o._x)("subscription","block search term","jetpack"),Object(o._x)("newsletter","block search term","jetpack")],attributes:{emailPlaceholder:{type:"string",default:Object(o.__)("Enter your email","jetpack")},consentText:{type:"string",default:Object(o.__)("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack")},interests:{type:"array",default:[]},processingLabel:{type:"string",default:Object(o.__)("Processing…","jetpack")},signupFieldTag:{type:"string"},signupFieldValue:{type:"string"},successLabel:{type:"string",default:Object(o.__)("Success! You're on the list.","jetpack")},errorLabel:{type:"string",default:Object(o.__)("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},preview:{type:"boolean",default:!1}},edit:U,save:function(){return Object(a.createElement)(c.InnerBlocks.Content,null)},example:{attributes:{preview:!0},innerBlocks:[H]},deprecated:[m]};Object(r.a)("mailchimp",q)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o={revueUsername:{type:"string"},emailLabel:{type:"string",default:Object(a.__)("Email address","jetpack")},emailPlaceholder:{type:"string",default:Object(a.__)("Enter your email address","jetpack")},firstNameLabel:{type:"string",default:Object(a.__)("First name","jetpack")},firstNamePlaceholder:{type:"string",default:Object(a.__)("Enter your first name","jetpack")},firstNameShow:{type:"boolean",default:!0},lastNameLabel:{type:"string",default:Object(a.__)("Last name","jetpack")},lastNamePlaceholder:{type:"string",default:Object(a.__)("Enter your last name","jetpack")},lastNameShow:{type:"boolean",default:!0}},c=n(4),i=n.n(c),l=n(0),s=n(3),u=n(11),p=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius","gradient","customGradient"],d={attributes:{revueUsername:{type:"string"},text:{type:"string",default:Object(a._x)("Subscribe","verb: e.g. subscribe to a newsletter.","jetpack")},emailLabel:{type:"string",default:Object(a.__)("Email address","jetpack")},emailPlaceholder:{type:"string",default:Object(a.__)("Enter your email address","jetpack")},firstNameLabel:{type:"string",default:Object(a.__)("First name","jetpack")},firstNamePlaceholder:{type:"string",default:Object(a.__)("Enter your first name","jetpack")},firstNameShow:{type:"boolean",default:!0},lastNameLabel:{type:"string",default:Object(a.__)("Last name","jetpack")},lastNamePlaceholder:{type:"string",default:Object(a.__)("Enter your last name","jetpack")},lastNameShow:{type:"boolean",default:!0},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},migrate:function(e){var t=Object(s.omit)(e,p),n=Object(s.pick)(e,p);return[t,[Object(u.createBlock)("jetpack/button",i()({element:"button",text:n.text||"Subscribe"},n))]]},isEligible:function(e,t){return Object(s.isEmpty)(t)||Object(s.some)(Object(s.pick)(e,p),Boolean)},save:function(e){var t=e.attributes.revueUsername,n="https://www.getrevue.co/profile/".concat(t);return Object(l.createElement)("div",null,Object(l.createElement)("a",{href:n},n))}},m=n(9),b=n.n(m),h=n(6),f=n(2),g=n(47),j=Object(l.createElement)(f.SVG,{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)(f.G,{fillRule:"nonzero"},Object(l.createElement)(f.Path,{d:"M16.8452322,23.2301186 C13.9471277,22.2565366 12.0226052,20.2188069 10.6188359,16.5961763 C10.2565728,15.6225943 9.87166831,14.4905223 9.80374399,14.1056178 C9.66789534,13.4037331 9.6452539,13.3810917 8.96601067,13.6075061 C7.8792215,13.9697691 7.76601429,14.1282592 7.35846835,15.758443 C6.724508,18.2490015 6.45281071,18.7244718 5.56979451,18.8829619 C5.09432424,18.9735276 4.5735711,18.9282447 4.27923236,18.7697547 C3.84904498,18.5433402 3.8037621,18.3848502 3.93961075,17.501834 C4.00753507,16.9584394 4.41508101,15.3056142 4.82262695,13.8339205 C5.8414918,10.2792143 6.11318909,8.98865211 6.29432062,7.1094125 C6.43016927,5.63771883 6.47545215,5.50187018 7.08677106,5.20753145 C7.92450438,4.79998551 8.80752058,5.09432424 9.19242508,5.88677468 C9.44148093,6.38488639 9.39619805,6.90563953 8.96601067,8.98865211 C8.67167193,10.3924215 8.51318185,11.5244935 8.62638905,11.5244935 C9.12450076,11.5244935 11.2754377,10.2565728 12.0452467,9.50940525 C13.8339205,7.83393861 14.2641079,5.77356748 13.2905259,3.82640354 C12.5886412,2.4226342 11.6150593,1.94716393 9.78110255,2.08301258 C6.97356385,2.28678555 4.43772245,4.25659092 3.01131166,7.35846835 C2.21886123,9.05657643 2.19621978,9.07921787 1.49433511,8.94336923 C-1.74339096,8.28676744 0.63396035,3.39621616 5.29809721,1.19999638 C8.39997464,-0.294338734 11.5018521,-0.362263057 14.0829764,0.950940525 C17.0716466,2.51319996 18.0225871,5.93205756 16.2791961,8.96601067 C15.5999529,10.1433656 14.2641079,11.3886449 12.9509043,12.0678881 C12.5433584,12.2716611 12.2037367,12.5207169 12.2037367,12.6339241 C12.2037367,12.9509043 13.2678845,15.9395745 13.6301475,16.6641006 C14.3093908,17.9773042 16.2339133,19.8112609 17.4565511,20.377297 C18.8829619,21.0112573 21.4640861,21.0791816 23.0263456,20.5131456 L23.9772861,20.1508826 L23.9772861,20.7169186 C23.9772861,21.5320105 23.3433258,22.3471023 22.3018195,22.8904969 C21.147106,23.4791744 18.1584357,23.6603059 16.8452322,23.2301186 Z"}))),v=n(43),O=n(23);n(371),n(238);var k=n(16);var _={name:"jetpack/button",attributes:{element:"button",text:Object(a._x)("Subscribe","verb: e.g. subscribe to a newsletter.","jetpack")}},y={title:Object(a.__)("Revue","jetpack"),description:Object(a.__)("Add a subscription form for your Revue newsletter.","jetpack"),icon:{src:j,foreground:Object(k.a)()},category:"grow",keywords:[Object(a._x)("email","block search term","jetpack"),Object(a._x)("subscription","block search term","jetpack"),Object(a._x)("newsletter","block search term","jetpack"),Object(a._x)("mailing list","block search term","jetpack")],supports:{html:!1},attributes:o,edit:function(e){var t=e.attributes,n=e.className,r=e.setAttributes;Object(l.useEffect)((function(){var e=Object(v.a)(o,t);Object(s.isEqual)(e,t)||r(e)}),[t,r]);var c=t.revueUsername,i=t.emailLabel,u=t.emailPlaceholder,p=t.firstNameLabel,d=t.firstNamePlaceholder,m=t.firstNameShow,k=t.lastNameLabel,y=t.lastNamePlaceholder,E=t.lastNameShow,w=Object(l.useState)(""),C=b()(w,2),x=C[0],S=C[1];Object(l.useEffect)((function(){!x&&c&&S(c)}),[]);var N=Object(O.c)()||Object(O.a)()?"http://support.wordpress.com/wordpress-editor/blocks/revue-block/":"https://jetpack.com/support/jetpack-blocks/revue-block/";return Object(l.createElement)("div",{className:n},!c&&Object(l.createElement)(f.Placeholder,{icon:Object(l.createElement)(h.BlockIcon,{icon:j}),instructions:Object(a.__)("Enter your Revue username.","jetpack"),label:Object(a.__)("Revue","jetpack")},Object(l.createElement)("form",{onSubmit:function(e){e.preventDefault(),r({revueUsername:x.trim()})}},Object(l.createElement)("input",{className:"components-placeholder__input",onChange:function(e){return S(e.target.value.trim())},placeholder:Object(a.__)("Enter your Revue username here…","jetpack"),type:"text",value:x}),Object(l.createElement)("div",null,Object(l.createElement)(f.Button,{disabled:!x,isDefault:!0,isLarge:!0,isSecondary:!0,type:"submit"},Object(a.__)("Add Form","jetpack")))),Object(l.createElement)("div",{className:"components-placeholder__learn-more"},Object(l.createElement)(f.ExternalLink,{href:N},Object(a.__)("Need help finding your Revue username?","jetpack")))),c&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(h.InspectorControls,null,Object(l.createElement)(f.PanelBody,{title:Object(a.__)("Settings","jetpack")},Object(l.createElement)(f.ToggleControl,{label:Object(a.__)("Show first name field.","jetpack"),checked:m,onChange:function(){return r({firstNameShow:!m})}}),Object(l.createElement)(f.ToggleControl,{label:Object(a.__)("Show last name field.","jetpack"),checked:E,onChange:function(){return r({lastNameShow:!E})}}),Object(l.createElement)(f.TextControl,{label:Object(a.__)("Revue Username","jetpack"),onChange:function(e){S(e.trim()),r({revueUsername:e.trim()})},value:c}))),Object(l.createElement)(f.TextControl,{label:Object(l.createElement)(g.a,{label:i,labelFieldName:"emailLabel",required:!0,setAttributes:r}),onChange:function(e){return r({emailPlaceholder:e})},placeholder:u,value:u}),m&&Object(l.createElement)(f.TextControl,{label:Object(l.createElement)(g.a,{label:p,labelFieldName:"firstNameLabel",setAttributes:r}),onChange:function(e){return r({firstNamePlaceholder:e})},placeholder:d,value:d}),E&&Object(l.createElement)(f.TextControl,{label:Object(l.createElement)(g.a,{label:k,labelFieldName:"lastNameLabel",setAttributes:r}),onChange:function(e){return r({lastNamePlaceholder:e})},placeholder:y,value:y}),Object(l.createElement)(h.InnerBlocks,{template:[[_.name,_.attributes]],templateLock:"all"})))},save:function(e){var t=e.attributes.revueUsername,n="https://www.getrevue.co/profile/".concat(t);return Object(l.createElement)("div",null,Object(l.createElement)(h.InnerBlocks.Content,null),Object(l.createElement)("a",{className:"wp-block-jetpack-revue__fallback",href:n},n))},example:{attributes:{revueUsername:"example"},innerBlocks:[_]},deprecated:[d]};Object(r.a)("revue",y)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(4),l=n.n(i),s=n(19),u=n.n(s),p=n(12),d=n.n(p),m=n(15),b=n.n(m),h=n(7),f=n.n(h),g=n(13),j=n.n(g),v=n(14),O=n.n(v),k=n(5),_=n.n(k),y=n(17),E=n(3),w=n(29),C=n(10),x=n(6),S=n(51),N=n(73);function A(e){var t=e.attributes,n=t.autoplay,r=t.delay,i=t.effect,l=t.images,s=t.sizeSlug,u=e.imageSizeOptions,p=e.onChangeImageSize,d=e.setAttributes,m="undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,b=[{label:Object(o._x)("Slide","Slideshow transition effect","jetpack"),value:"slide"},{label:Object(o._x)("Fade","Slideshow transition effect","jetpack"),value:"fade"}];return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Autoplay","jetpack")},Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Autoplay","jetpack"),help:Object(o.__)("Autoplay between slides","jetpack"),checked:n,onChange:function(e){d({autoplay:e})}}),n&&Object(a.createElement)(c.RangeControl,{label:Object(o.__)("Delay between transitions (in seconds)","jetpack"),value:r,onChange:function(e){d({delay:e})},min:1,max:5}),n&&m&&Object(a.createElement)("span",null,Object(o.__)("The Reduce Motion accessibility option is selected, therefore autoplay will be disabled in this browser.","jetpack"))),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Effects","jetpack")},Object(a.createElement)(c.SelectControl,{label:Object(o.__)("Transition effect","jetpack"),value:i,onChange:function(e){d({effect:e})},options:b})),!Object(E.isEmpty)(l)&&!Object(E.isEmpty)(u)&&Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Image Settings","jetpack")},Object(a.createElement)(c.SelectControl,{label:Object(o.__)("Image Size","jetpack"),value:s,options:u,onChange:p})))}function T(e){var t=e.allowedMediaTypes,n=e.attributes.images,r=e.onSelectImages;return Object(a.createElement)(a.Fragment,null,!!n.length&&Object(a.createElement)(c.ToolbarGroup,null,Object(a.createElement)(c.ToolbarItem,null,(function(){return Object(a.createElement)(x.MediaUpload,{onSelect:r,allowedTypes:t,multiple:!0,gallery:!0,value:n.map((function(e){return e.id})),render:function(e){var t=e.open;return Object(a.createElement)(N.a,{label:Object(o.__)("Edit Slideshow","jetpack"),onClick:t})}})}))))}var P=n(8),I=n.n(P),M=n(72),R=n(154),B=n(71),L=function(e){j()(n,e);var t=O()(n);function n(e){var r;return d()(this,n),r=t.call(this,e),_()(f()(r),"pendingRequestAnimationFrame",null),_()(f()(r),"resizeObserver",null),_()(f()(r),"initializeResizeObserver",(function(e){r.clearResizeObserver(),r.resizeObserver=new M.a((function(){r.clearPendingRequestAnimationFrame(),r.pendingRequestAnimationFrame=requestAnimationFrame((function(){Object(B.d)(e),e.update()}))})),r.resizeObserver.observe(e.el)})),_()(f()(r),"clearPendingRequestAnimationFrame",(function(){r.pendingRequestAnimationFrame&&(cancelAnimationFrame(r.pendingRequestAnimationFrame),r.pendingRequestAnimationFrame=null)})),_()(f()(r),"clearResizeObserver",(function(){r.resizeObserver&&(r.resizeObserver.disconnect(),r.resizeObserver=null)})),_()(f()(r),"prefersReducedMotion",(function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches})),_()(f()(r),"buildSwiper",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Object(R.a)(r.slideshowRef.current,{autoplay:!(!r.props.autoplay||r.prefersReducedMotion())&&{delay:1e3*r.props.delay,disableOnInteraction:!1},effect:r.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:r.btnNextRef.current,prevEl:r.btnPrevRef.current},pagination:{clickable:!0,el:r.paginationRef.current,type:"bullets"}},{init:B.b,imagesReady:B.d,paginationRender:B.c,transitionEnd:B.a})})),r.slideshowRef=Object(a.createRef)(),r.btnNextRef=Object(a.createRef)(),r.btnPrevRef=Object(a.createRef)(),r.paginationRef=Object(a.createRef)(),r}return b()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.onError;this.buildSwiper().then((function(t){e.swiperInstance=t,e.initializeResizeObserver(t)})).catch((function(){t(Object(o.__)("The Swiper library could not be loaded.","jetpack"))}))}},{key:"componentWillUnmount",value:function(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}},{key:"componentDidUpdate",value:function(e){var t,n=this,r=this.props,a=r.align,c=r.autoplay,i=r.delay,l=r.effect,s=r.images,u=r.onError;(a===e.align&&Object(E.isEqual)(s,e.images)||this.swiperInstance&&this.swiperInstance.update(),l!==e.effect||c!==e.autoplay||i!==e.delay||s!==e.images)&&(t=this.swiperIndex?s.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((function(e){n.swiperInstance=e,n.initializeResizeObserver(e)})).catch((function(){u(Object(o.__)("The Swiper library could not be loaded.","jetpack"))})))}},{key:"render",value:function(){var e,t;if(null===(e=this.props)||void 0===e||null===(t=e.images)||void 0===t||!t.length)return null;var n=this.props,r=n.autoplay,o=n.className,i=n.delay,l=n.effect,s=n.images;return Object(a.createElement)("div",{className:o,"data-autoplay":r||null,"data-delay":r?i:null,"data-effect":l},Object(a.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},Object(a.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},s.map((function(e){var t=e.alt,n=e.caption,r=e.id,o=e.url;return Object(a.createElement)("li",{className:I()("wp-block-jetpack-slideshow_slide","swiper-slide",Object(w.isBlobURL)(o)&&"is-transient"),key:r||o},Object(a.createElement)("figure",null,Object(a.createElement)("img",{alt:t,className:"wp-block-jetpack-slideshow_image wp-image-".concat(r),"data-id":r,src:o}),Object(w.isBlobURL)(o)&&Object(a.createElement)(c.Spinner,null),n&&Object(a.createElement)(x.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:n})))}))),Object(a.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),Object(a.createElement)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),Object(a.createElement)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),Object(a.createElement)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})))}}]),n}(a.Component);_()(L,"defaultProps",{effect:"slide"});var D=L,F=(n(375),["image"]),z=function(e,t){var n=Object(E.pick)(e,["alt","id","link","caption"]);return n.url=Object(E.get)(e,["sizes",t,"url"])||Object(E.get)(e,["media_details","sizes",t,"source_url"])||e.url,n},U=function(e){j()(n,e);var t=O()(n);function n(){var e;return d()(this,n),e=t.apply(this,arguments),_()(f()(e),"onSelectImages",(function(t){var n=e.props.attributes.sizeSlug,r=t.map((function(e){return z(e,n)}));e.setAttributes({images:r})})),_()(f()(e),"onRemoveImage",(function(t){return function(){var n=Object(E.filter)(e.props.attributes.images,(function(e,n){return t!==n}));e.setState({selectedImage:null}),e.setAttributes({images:n})}})),_()(f()(e),"addFiles",(function(t){var n=e.props.attributes.images||[],r=e.props.attributes.sizeSlug,a=e.props,o=a.lockPostSaving,c=a.unlockPostSaving,i=a.noticeOperations,l="slideshowBlockLock";o(l),Object(S.mediaUpload)({allowedTypes:F,filesList:t,onFileChange:function(t){var a=t.map((function(e){return z(e,r)}));e.setAttributes({images:[].concat(u()(n),u()(a))}),a.every((function(e){return Object(w.isBlobURL)(e.url)}))||c(l)},onError:i.createErrorNotice})})),_()(f()(e),"uploadFromFiles",(function(t){return e.addFiles(t.target.files)})),_()(f()(e),"updateImagesSize",(function(t){var n=e.props.attributes.images,r=e.props.resizedImages,a=n.map((function(e){var n=r.find((function(t){var n=t.id;return parseInt(n,10)===parseInt(e.id,10)})),a=Object(E.get)(n,["sizes",t,"source_url"]);return l()(l()({},e),a&&{url:a})}));e.setAttributes({images:a,sizeSlug:t})})),e.state={selectedImage:null},e}return b()(n,[{key:"componentDidMount",value:function(){var e=this.props.attributes,t=e.ids;e.sizeSlug||this.setAttributes({sizeSlug:t.length?"full":"large"})}},{key:"setAttributes",value:function(e){if(e.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');e.images&&(e=l()(l()({},e),{},{ids:e.images.map((function(e){var t=e.id;return parseInt(t,10)}))})),this.props.setAttributes(e)}},{key:"getImageSizeOptions",value:function(){var e=this.props.imageSizes;return Object(E.map)(e,(function(e){var t=e.name;return{value:e.slug,label:t}}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.attributes,r=t.className,i=t.isSelected,l=t.noticeOperations,s=t.noticeUI,u=n.align,p=n.autoplay,d=n.delay,m=n.effect,b=n.images,h=this.getImageSizeOptions(),f=Object(a.createElement)(a.Fragment,null,Object(a.createElement)(x.InspectorControls,null,Object(a.createElement)(A,{attributes:n,imageSizeOptions:h,onChangeImageSize:this.updateImagesSize,setAttributes:function(t){return e.setAttributes(t)}})),Object(a.createElement)(x.BlockControls,null,Object(a.createElement)(T,{allowedMediaTypes:F,attributes:n,onSelectImages:this.onSelectImages})));return 0===b.length?Object(a.createElement)(a.Fragment,null,f,Object(a.createElement)(x.MediaPlaceholder,{icon:Object(a.createElement)(x.BlockIcon,{icon:ee}),className:r,labels:{title:Object(o.__)("Slideshow","jetpack"),instructions:Object(o.__)("Drag images, upload new ones or select files from your library.","jetpack")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:F,multiple:!0,notices:s,onError:l.createErrorNotice})):Object(a.createElement)(a.Fragment,null,f,s,Object(a.createElement)(D,{align:u,autoplay:p,className:r,delay:d,effect:m,images:b,onError:l.createErrorNotice}),Object(a.createElement)(c.DropZone,{onFilesDrop:this.addFiles}),i&&Object(a.createElement)("div",{className:"wp-block-jetpack-slideshow__add-item"},Object(a.createElement)(c.FormFileUpload,{multiple:!0,isLarge:!0,className:"wp-block-jetpack-slideshow__add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},Object(o.__)("Upload an image","jetpack"))))}}]),n}(a.Component),V=Object(y.compose)(Object(C.withSelect)((function(e,t){return{imageSizes:e("core/editor").getEditorSettings().imageSizes,resizedImages:t.attributes.ids.reduce((function(t,n){var r=e("core").getMedia(n),a=Object(E.get)(r,["media_details","sizes"]);return[].concat(u()(t),[{id:n,sizes:a}])}),[])}})),Object(C.withDispatch)((function(e){var t=e("core/editor");return{lockPostSaving:t.lockPostSaving,unlockPostSaving:t.unlockPostSaving}})),c.withNotices)(U),G=n(11);function H(e){return Object(E.filter)(e,(function(e){var t=e.id,n=e.url;return t&&n}))}var q={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:function(e){return H(e).length>0},transform:function(e){var t=H(e);return Object(G.createBlock)("jetpack/slideshow",{images:t.map((function(e){return{alt:e.alt,caption:e.caption,id:e.id,url:e.url}})),ids:t.map((function(e){return e.id}))})}},{type:"block",blocks:["core/gallery","jetpack/tiled-gallery"],transform:function(e){var t=H(e.images);return t.length>0?Object(G.createBlock)("jetpack/slideshow",{images:t.map((function(e){return{alt:e.alt,caption:e.caption,id:e.id,url:e.url}})),ids:t.map((function(e){return e.id}))}):Object(G.createBlock)("jetpack/slideshow")}}],to:[{type:"block",blocks:["core/gallery"],transform:function(e){var t=e.images,n=e.ids;return Object(G.createBlock)("core/gallery",{images:t,ids:n})}},{type:"block",blocks:["core/image"],transform:function(e){var t=e.images;return t.length>0?t.map((function(e){var t=e.id,n=e.url,r=e.alt,a=e.caption;return Object(G.createBlock)("core/image",{id:t,url:n,alt:r,caption:a})})):Object(G.createBlock)("core/image")}}]},W=n(16),$=n(58),K=n(196),Z=n.n(K),Y=n(197),J=n.n(Y),X=n(198),Q=n.n(X),ee=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},Object(a.createElement)(c.Path,{d:"M21 8V19C21 20.1046 20.1057 21 19.0011 21C15.8975 21 9.87435 21 6 21",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),Object(a.createElement)(c.Rect,{x:"3.75",y:"3.75",width:"13.5",height:"13.5",rx:"0.875",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),Object(a.createElement)(c.Path,{d:"M9 14L12 11L9 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})),te={align:"center",autoplay:!0,ids:[22,23],images:[{alt:"",caption:"",id:22,url:Z.a},{alt:"",caption:"",id:23,url:J.a},{alt:"",caption:"",id:23,url:Q.a}],effect:"slide"},ne={title:Object(o.__)("Slideshow","jetpack"),category:Object($.a)("media","layout"),keywords:[Object(o._x)("image","block search term","jetpack"),Object(o._x)("gallery","block search term","jetpack"),Object(o._x)("slider","block search term","jetpack")],description:Object(o.__)("Add an interactive slideshow.","jetpack"),attributes:{align:{default:"center",type:"string"},autoplay:{type:"boolean",default:!1},delay:{type:"number",default:3},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".swiper-slide",query:{alt:{source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},id:{source:"attribute",selector:"img",attribute:"data-id"},url:{source:"attribute",selector:"img",attribute:"src"}}},effect:{type:"string",default:"slide"},sizeSlug:{type:"string"}},supports:{align:["center","wide","full"],html:!1},icon:{src:ee,foreground:Object(W.a)()},edit:V,save:function(e){var t=e.attributes,n=t.align,r=t.autoplay,o=t.delay,c=t.effect,i=t.images,l=e.className;return Object(a.createElement)(D,{align:n,autoplay:r,className:l,delay:o,effect:c,images:i})},transforms:q,example:{attributes:te}};Object(r.a)("slideshow",ne)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(11),i=n(9),l=n.n(i),s=n(2),u=n(17),p=n(6),d=n(188),m=function(e){var t=e.className,n=e.embedValue,r=e.onChange,c=e.onSubmit;return Object(a.createElement)(s.PanelBody,{title:Object(o.__)("Calendar settings","jetpack"),initialOpen:!1},Object(a.createElement)("form",{onSubmit:c,className:t},Object(a.createElement)("textarea",{type:"text",value:n,className:"components-placeholder__input","aria-label":Object(o.__)("Google Calendar URL or iframe","jetpack"),placeholder:Object(o.__)("Enter URL or iframe to embed here…","jetpack"),onChange:r}),Object(a.createElement)(s.Button,{isSecondary:!0,type:"submit"},Object(o._x)("Embed","button label","jetpack"))))},b=Object(a.createElement)(s.SVG,{height:"23",viewBox:"0 0 24 23",width:"24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(s.Path,{d:"M19.5,23h-15c-2.2,0-4-1.8-4-4V4c0-2.2,1.8-4,4-4h15c2.2,0,4,1.8,4,4v15C23.5,21.2,21.7,23,19.5,23z M4.5,2 c-1.1,0-2,0.9-2,2v15c0,1.1,0.9,2,2,2h15c1.1,0,2-0.9,2-2V4c0-1.1-0.9-2-2-2H4.5z M6.9,3.9L6.9,3.9c0.5,0,0.9,0.4,0.9,0.9V5 c0,0.5-0.4,0.9-0.9,0.9l0,0C6.5,5.9,6.1,5.5,6.1,5V4.7C6.1,4.3,6.5,3.9,6.9,3.9z M17,3.9L17,3.9c0.5,0,0.9,0.4,0.9,0.9V5 c0,0.5-0.4,0.9-0.9,0.9l0,0c-0.5,0-0.9-0.4-0.9-0.9V4.7C16.2,4.3,16.5,3.9,17,3.9z M8.8,17.6c1.8,0,3.2-1,3.2-2.4 c0-1.1-0.7-1.8-1.8-1.9v-0.1c0.9-0.2,1.5-0.9,1.5-1.8c0-1.3-1.2-2.2-2.9-2.2c-1.8,0-2.9,1-3,2.5h1.6c0-0.7,0.6-1.1,1.4-1.1 c0.8,0,1.3,0.4,1.3,1.1c0,0.7-0.5,1.1-1.3,1.1h-1v1.3h1c0.9,0,1.5,0.4,1.5,1.1c0,0.7-0.6,1.2-1.4,1.2c-0.9,0-1.4-0.4-1.5-1.1H5.7 C5.8,16.6,7,17.6,8.8,17.6z M17.6,17.4V9.3h-1.7l-2.1,1.4v1.6l2-1.4h0.1v6.4H17.6z"})),h="s*https?://calendar.google.com/calendar",f=new RegExp("^".concat(h),"i"),g=new RegExp("<iframe((?:\\s+\\w+=(['\"]).*?\\2)*)\\s+src=([\"'])(".concat(h,".*?)\\3((?:\\s+\\w+=(['\"]).*?\\6)*)"),"i"),j=new RegExp("".concat(h,"\\?cid=([-A-Za-z0-9+/]+={0,3})"),"i"),v=/\s+(\w+)=(["'])(.*?)\2/gi;function O(e){var t=j.exec(e);if(t)return"https://calendar.google.com/calendar/embed?src="+encodeURIComponent(atob(t[1]))}function k(e){var t=g.exec(e);if(t){var n={};return t.forEach((function(e,t){if(0!==t)if(f.test(e))n.url=e;else for(var r;null!==(r=v.exec(e));)n[r[1]]=r[3]})),{url:n.url,width:n.width,height:n.height}}}var _=n(23);var y=Object(u.compose)(s.withNotices,Object(d.withViewportMatch)({isMobile:"< small"}))((function(e){var t=e.attributes,n=t.url,r=t.height,i=e.className,u=e.isMobile,d=e.isSelected,h=e.name,v=e.noticeOperations,y=e.noticeUI,E=e.setAttributes,w=Object(a.useState)(n||""),C=l()(w,2),x=C[0],S=C[1],N=Object(a.useState)(!1),A=l()(N,2),T=A[0],P=A[1],I=Object(a.useState)(!1),M=l()(I,2),R=M[0],B=M[1];Object(a.useEffect)((function(){!d&&R&&B(!1)}),[d,R]);var L,D=function(){B(!0)},F=function(e){e&&e.preventDefault();var t,n=(t=x.trim(),g.test(t)?k(t):j.test(t)?{url:O(t)}:{url:t});if(!f.test(n.url))return v.removeAllNotices(),void v.createErrorNotice(Object(o.__)("Your calendar couldn't be embedded. Please double check your URL or Embed Code. Please note, you need to use the 'Public URL' or 'Embed Code', the 'Shareable Link' will not work.","jetpack"));E(n),P(!1),v.removeAllNotices()},z=Object(c.getBlockDefaultClassName)(h),U=u?"300":r,V='<iframe src="'.concat(n,'" style="border:0" scrolling="no" frameborder="0" height="').concat(U,'"></iframe>'),G=Object(a.createElement)(s.ExternalLink,{href:"https://en.support.wordpress.com/google-calendar/"},Object(o.__)("Enable Permissions for the calendar you want to share","jetpack")),H=Object(a.createElement)(p.InspectorControls,null,Object(a.createElement)(m,{className:"".concat(z,"-embed-form-sidebar"),embedValue:x,onChange:function(e){return S(e.target.value)},onSubmit:F}));if(T||!n){var q=Object(_.c)()||Object(_.a)()?"https://en.support.wordpress.com/wordpress-editor/blocks/google-calendar/":"https://jetpack.com/support/jetpack-blocks/google-calendar/";return Object(a.createElement)("div",{className:i},H,Object(a.createElement)(s.Placeholder,{className:i,label:Object(o.__)("Google Calendar","jetpack"),icon:Object(a.createElement)(p.BlockIcon,{icon:b}),instructions:Object(a.createElement)("ol",{className:"".concat(z,"-placeholder-instructions")},Object(a.createElement)("li",null,G),Object(a.createElement)("li",null,Object(o.__)("Paste the embed code you copied from your Google Calendar below","jetpack"))),notices:y},(L="".concat(z,"-embed-form-editor"),Object(a.createElement)("form",{onSubmit:F,className:L},Object(a.createElement)("textarea",{type:"text",value:x,className:"components-placeholder__input","aria-label":Object(o.__)("Google Calendar URL or iframe","jetpack"),placeholder:Object(o.__)("Enter URL or iframe to embed here…","jetpack"),onChange:function(e){return S(e.target.value)}}),Object(a.createElement)(s.Button,{isSecondary:!0,type:"submit"},Object(o._x)("Embed","button label","jetpack")))),Object(a.createElement)("div",{className:"".concat(z,"-placeholder-links")},Object(a.createElement)(s.ExternalLink,{href:q},Object(o.__)("Learn more","jetpack")))))}return Object(a.createElement)("div",{className:i},H,Object(a.createElement)("div",null,Object(a.createElement)(s.SandBox,{html:V,onFocus:D}),!R&&Object(a.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:D})))})),E=(n(303),n(16)),w={title:Object(o.__)("Google Calendar","jetpack"),description:Object(o.__)("Embed a Google Calendar","jetpack"),keywords:[Object(o._x)("events","block search term","jetpack"),Object(o._x)("dates","block search term","jetpack"),Object(o._x)("schedule","block search term","jetpack"),Object(o._x)("appointments","block search term","jetpack")],icon:{src:b,foreground:Object(E.a)()},category:"embed",supports:{align:!0,alignWide:!0,html:!1},attributes:{url:{type:"string"},height:{type:"integer",default:600}},edit:y,save:function(e){var t=e.attributes.url;return Object(a.createElement)("a",{href:t},t)},transforms:{from:[{type:"shortcode",tag:"googleapps",isMatch:function(e){return"calendar"===e.named.domain},attributes:{url:{type:"string",shortcode:function(e){var t=e.named,n=t.domain,r=t.dir,a=t.query;return"https://".concat(n,".google.com/").concat(r,"?").concat(a)}}}},{type:"raw",isMatch:function(e){return"P"===e.nodeName&&f.test(e.textContent)},transform:function(e){return Object(c.createBlock)("jetpack/google-calendar",{url:e.textContent.trim()})}},{type:"raw",isMatch:function(e){return"FIGURE"===e.nodeName&&g.test(e.innerHTML)},transform:function(e){var t=k(e.innerHTML.trim()),n=t.url,r=t.height;return Object(c.createBlock)("jetpack/google-calendar",{url:n,height:r})}}]},example:{attributes:{url:"https://calendar.google.com/calendar/embed?src=jb4bu80jirp0u11a6niie21pp4%40group.calendar.google.com&ctz=America/New_York"}}};Object(r.a)("google-calendar",w)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(2),c=n(6),i=n(1),l=n(16),s=n(4),u=n.n(s),p=n(3),d=n(11),m=["submitButtonText","submitButtonClasses","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor"],b={attributes:{planId:{type:"integer"},submitButtonText:{type:"string"},submitButtonClasses:{type:"string"},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},align:{type:"string"}},migrate:function(e){var t,n=Object(p.omit)(e,m),r={text:(t=e).submitButtonText,textColor:t.textButtonColor,customTextColor:t.customTextButtonColor,backgroundColor:t.backgroundButtonColor,customBackgroundColor:t.customBackgroundButtonColor};return[n,[Object(d.createBlock)("jetpack/button",u()({element:"a",uniqueId:"recurring-payments-id"},r))]]},isEligible:function(e,t){return Object(p.isEmpty)(t)||Object(p.some)(Object(p.pick)(e,m),Boolean)},save:function(){return null}},h=n(26),f=n.n(h),g=n(12),j=n.n(g),v=n(7),O=n.n(v),k=n(13),_=n.n(k),y=n(14),E=n.n(y),w=n(5),C=n.n(w),x=n(8),S=n.n(x),N=n(22),A=n.n(N),T=n(35),P=n(17),I=n(10),M=n(31),R=n(49),B=n(37),L=n(91),D=n(33),F=function(e,t){return Object(T.a)(e,t,{decimal:".",symbol:""})},z=function(e){var t=Object(T.a)(parseFloat(e.price),e.currency);return"1 month"===e.interval?Object(i.sprintf)(Object(i.__)("%s / month","jetpack"),t):"1 year"===e.interval?Object(i.sprintf)(Object(i.__)("%s / year","jetpack"),t):"one-time"===e.interval?t:Object(i.sprintf)(Object(i.__)("%1$s / %2$s","jetpack"),t,e.interval)},U=n(45),V=n(80);function G(e){var t=e.attributes.planId,n=e.products,r=e.setMembershipAmount;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(o.PanelBody,{title:Object(i.__)("Payment plan","jetpack")},Object(a.createElement)(o.SelectControl,{label:Object(i.__)("Payment plan","jetpack"),value:t,onChange:r,options:n.map((function(e){return{label:z(e),value:e.id,key:e.id}}))})),Object(a.createElement)(o.PanelBody,{title:Object(i.__)("Management","jetpack")},Object(a.createElement)(o.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(Object(U.a)())},Object(i.__)("See your earnings, subscriber list, and payment plans.","jetpack"))))}function H(e){var t=e.connected,n=e.connectURL,r=e.hasUpgradeNudge,c=e.shouldUpgrade,l=Object(V.a)(n).autosaveAndRedirect;return Object(a.createElement)(a.Fragment,null,!r&&!c&&!t&&Object(a.createElement)(o.ToolbarGroup,null,Object(a.createElement)(o.ToolbarButton,{icon:D.l,onClick:l,className:"connect-stripe components-tab-button"},Object(i.__)("Connect Stripe","jetpack"))))}var q=function(e){_()(n,e);var t=E()(n);function n(){var e;j()(this,n),e=t.apply(this,arguments),C()(O()(e),"componentDidMount",(function(){e.apiCall()})),C()(O()(e),"onError",(function(t){var n=e.props.noticeOperations;n.removeAllNotices(),n.createErrorNotice(t)})),C()(O()(e),"apiCall",(function(){var t={path:"/wpcom/v2/memberships/status",method:"GET"};A()(t).then((function(t){if(t.errors&&Object.values(t.errors)&&Object.values(t.errors)[0][0])return e.setState({connected:null,connectURL:2}),void e.onError(Object.values(t.errors)[0][0]);var n=t.connect_url,r=t.products,a=t.should_upgrade_to_access_memberships,o=t.upgrade_url,c=t.connected_account_id?1:2;e.setState({connected:c,connectURL:n,shouldUpgrade:a,upgradeURL:o,products:Z(r)})}),(function(t){e.setState({connected:2,connectURL:null}),e.onError(t.message)}))})),C()(O()(e),"handleCurrencyChange",(function(t){var n=e.state.editedProductPrice;Object(B.c)(t,n)||(n=F(Object(B.d)(t),t)),e.setState({editedProductCurrency:t,editedProductPrice:n,editedProductPriceValid:!0})})),C()(O()(e),"handleRenewIntervalChange",(function(t){return e.setState({editedProductRenewInterval:t})})),C()(O()(e),"handlePriceChange",(function(t){var n=parseFloat(t),r=Object(B.c)(e.state.editedProductCurrency,n);e.setState({editedProductPrice:n,editedProductPriceValid:r})})),C()(O()(e),"handleTitleChange",(function(t){return e.setState({editedProductTitle:t,editedProductTitleValid:t.length>0})})),C()(O()(e),"saveProduct",(function(){if(e.state.editedProductTitle&&0!==e.state.editedProductTitle.length)if(e.state.editedProductPrice&&Object(B.c)(e.state.editedProductCurrency,e.state.editedProductPrice)){e.setState({addingMembershipAmount:2});var t={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:e.state.editedProductCurrency,price:e.state.editedProductPrice,title:e.state.editedProductTitle,interval:e.state.editedProductRenewInterval}};A()(t).then((function(t){e.setState({addingMembershipAmount:0,products:e.state.products.concat([{id:t.id,title:t.title,interval:t.interval,price:t.price,currency:t.currency}])}),e.setMembershipAmount(t.id)}),(function(t){e.setState({addingMembershipAmount:1}),e.onError(t.message)}))}else e.setState({editedProductPriceValid:!1});else e.setState({editedProductTitleValid:!1})})),C()(O()(e),"renderAddMembershipAmount",(function(t){if(0===e.state.addingMembershipAmount&&!t)return Object(a.createElement)(o.Button,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({addingMembershipAmount:1})}},Object(i.__)("Add a payment plan","jetpack"));if(2!==e.state.addingMembershipAmount){var n=Object(T.a)(Object(B.d)(e.state.editedProductCurrency),e.state.editedProductCurrency),r=Object(i.sprintf)(Object(i.__)("Minimum allowed price is %s.","jetpack"),n);return Object(a.createElement)("div",null,Object(a.createElement)("div",{className:"membership-button__price-container"},Object(a.createElement)(o.SelectControl,{className:"membership-button__field membership-button__field-currency",label:Object(i.__)("Currency","jetpack"),onChange:e.handleCurrencyChange,options:B.a,value:e.state.editedProductCurrency}),Object(a.createElement)("div",{className:"membership-membership-button__field membership-button__field-price"},Object(a.createElement)(o.TextControl,{label:Object(i.__)("Price","jetpack"),className:S()({"membership-button__field-error":!e.state.editedProductPriceValid}),onChange:e.handlePriceChange,placeholder:n,required:!0,min:"0",step:"1",type:"number",value:e.state.editedProductPrice||""}),Object(a.createElement)("p",null,r))),Object(a.createElement)(o.TextControl,{className:S()({"membership-button__field":!0,"membership-button__field-error":!e.state.editedProductTitleValid}),label:Object(i.__)("Describe your subscription in a few words","jetpack"),onChange:e.handleTitleChange,placeholder:Object(i.__)("Subscription description","jetpack"),value:e.state.editedProductTitle}),Object(a.createElement)(o.SelectControl,{label:Object(i.__)("Renew interval","jetpack"),onChange:e.handleRenewIntervalChange,options:[{label:Object(i.__)("Monthly","jetpack"),value:"1 month"},{label:Object(i.__)("Yearly","jetpack"),value:"1 year"},{label:Object(i.__)("One-Time Payment","jetpack"),value:"one-time"}],value:e.state.editedProductRenewInterval}),Object(a.createElement)("div",null,Object(a.createElement)(o.Button,{isPrimary:!0,isLarge:!0,className:"membership-button__field-button membership-button__add-amount",onClick:e.saveProduct},Object(i.__)("Add this payment plan","jetpack")),Object(a.createElement)(o.Button,{isLarge:!0,className:"membership-button__field-button",onClick:function(){return e.setState({addingMembershipAmount:0})}},Object(i.__)("Cancel","jetpack"))))}})),C()(O()(e),"getFormattedPriceByProductId",(function(t){var n=e.state.products.filter((function(e){return parseInt(e.id)===parseInt(t)})).pop();return Object(T.a)(parseFloat(n.price),n.currency)})),C()(O()(e),"setMembershipAmount",(function(t){var n=e.props,r=n.innerButtons,a=n.updateBlockAttributes,o=n.setAttributes,c=e.props.attributes.planId,l=Object(i.sprintf)(Object(i.__)("%s contribution","jetpack"),e.getFormattedPriceByProductId(t)),s=c?Object(i.sprintf)(Object(i.__)("%s contribution","jetpack"),e.getFormattedPriceByProductId(c)):void 0;return r&&r.length&&r[0].innerBlocks.forEach((function(e){var t=e.attributes.text,n=t===s?l:t;a(e.clientId,{text:n})})),o({planId:parseInt(t)})})),C()(O()(e),"renderMembershipAmounts",(function(){return Object(a.createElement)("div",null,e.state.products.map((function(t){return Object(a.createElement)(o.Button,{className:"membership-button__field-button",isLarge:!0,isSecondary:!0,key:t.id,onClick:function(){return e.setMembershipAmount(t.id)}},z(t))})))})),C()(O()(e),"renderDisclaimer",(function(){return Object(a.createElement)("div",{className:"membership-button__disclaimer"},Object(a.createElement)(o.ExternalLink,{href:"https://wordpress.com/support/wordpress-editor/blocks/payments/#related-fees"},Object(i.__)("Read more about Payments and related fees.","jetpack")))})),C()(O()(e),"renderUpgradeNudges",(function(){var t=e.props.notices;return Object(a.createElement)(a.Fragment,null,!e.hasUpgradeNudge&&e.state.shouldUpgrade&&Object(a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},Object(a.createElement)(o.Placeholder,{icon:Object(a.createElement)(c.BlockIcon,{icon:$}),label:Object(i.__)("Payments","jetpack"),notices:t,instructions:Object(i.__)("You'll need to upgrade your plan to use the Payments block.","jetpack")},Object(a.createElement)(o.Button,{isSecondary:!0,isLarge:!0,href:e.state.upgradeURL,target:"_blank"},Object(i.__)("Upgrade your plan","jetpack")),e.renderDisclaimer())))})),C()(O()(e),"renderPlanNotices",(function(){var t=e.props.notices,n=e.state,r=n.connected,l=n.products;return Object(a.createElement)(a.Fragment,null,(0===r||2===e.state.addingMembershipAmount)&&!e.props.attributes.planId&&Object(a.createElement)(o.Placeholder,{icon:Object(a.createElement)(c.BlockIcon,{icon:$}),notices:t},Object(a.createElement)(o.Spinner,null)),!e.state.shouldUpgrade&&!e.props.attributes.planId&&1===r&&0===l.length&&Object(a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},Object(a.createElement)(o.Placeholder,{icon:Object(a.createElement)(c.BlockIcon,{icon:$}),label:Object(i.__)("Payments","jetpack"),notices:t},Object(a.createElement)("div",{className:"components-placeholder__instructions"},Object(a.createElement)("p",null,Object(i.__)("To use this block, first add at least one payment plan.","jetpack")),e.renderAddMembershipAmount(!0),e.renderDisclaimer()))),!e.state.shouldUpgrade&&!e.props.attributes.planId&&2!==e.state.addingMembershipAmount&&1===r&&l.length>0&&Object(a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},Object(a.createElement)(o.Placeholder,{icon:Object(a.createElement)(c.BlockIcon,{icon:$}),label:Object(i.__)("Payments","jetpack"),notices:t},Object(a.createElement)("div",{className:"components-placeholder__instructions"},Object(a.createElement)("p",null,Object(i.__)("To use this block, select a previously created payment plan.","jetpack")),e.renderMembershipAmounts(),Object(a.createElement)("p",null,Object(i.__)("Or a new one.","jetpack")),e.renderAddMembershipAmount(!1),e.renderDisclaimer()))))})),C()(O()(e),"render",(function(){var t=e.state,n=t.connected,r=t.connectURL,o=t.products,i=Object(M.applyFilters)("jetpack.RecurringPayments.showControls",o.length>0,e.props.clientId),l=Object(a.createElement)(c.InspectorControls,null,Object(a.createElement)(G,{attributes:e.props.attributes,products:o,setMembershipAmount:e.setMembershipAmount})),s=Object(a.createElement)(c.BlockControls,null,Object(a.createElement)(H,{connected:2!==n,connectURL:Object(L.a)(e.props.postId,r),hasUpgradeNudge:e.hasUpgradeNudge,shouldUpgrade:e.state.shouldUpgrade}));return Object(a.createElement)(a.Fragment,null,e.props.noticeUI,!e.isPremiumContentChild&&e.renderUpgradeNudges(),!e.isPremiumContentChild&&e.renderPlanNotices(),i&&l,s,Object(a.createElement)(c.InnerBlocks,{template:[["jetpack/button",{element:"a",uniqueId:"recurring-payments-id"}]],templateLock:"all",__experimentalCaptureToolbars:!0,templateInsertUpdatesSelection:!1}))})),e.state={connected:0,connectURL:null,addingMembershipAmount:0,shouldUpgrade:!1,upgradeURL:"",products:[],editedProductCurrency:"USD",editedProductPrice:F(Object(B.d)("USD"),"USD"),editedProductPriceValid:!0,editedProductTitle:"",editedProductTitleValid:!0,editedProductRenewInterval:"1 month"},e.timeout=null;var r=Object(R.a)("recurring-payments");return e.hasUpgradeNudge=!r.available&&"missing_plan"===r.unavailableReason,e.isPremiumContentChild=e.props.context.isPremiumContentChild||!1,e}return n}(a.Component),W=Object(P.compose)([Object(I.withSelect)((function(e){return{postId:e("core/editor").getCurrentPostId()}})),Object(I.withDispatch)((function(e){var t;return{updateBlockAttributes:e("core/editor").updateBlockAttributes,autosaveAndRedirect:(t=f()(regeneratorRuntime.mark((function t(n,r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.preventDefault(),t.next=3,e("core/editor").savePost();case 3:window.top.location.href=r;case 4:case"end":return t.stop()}}),t)}))),function(_x,e){return t.apply(this,arguments)})}})),o.withNotices])(q),$=(n(368),Object(a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},Object(a.createElement)(o.Rect,{x:"0",fill:"none",width:"24",height:"24"}),Object(a.createElement)(o.G,null,Object(a.createElement)(o.Path,{d:"M20 4H4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2h16c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zm0 2v2H4V6h16zM4 18v-6h16v6H4zm2-4h7v2H6v-2zm9 0h3v2h-3v-2z"})))),K={title:Object(i.__)("Payments","jetpack"),icon:{src:$,foreground:Object(l.a)()},description:Object(i.__)("Button allowing you to sell products and subscriptions.","jetpack"),category:"earn",keywords:[Object(i._x)("sell","block search term","jetpack"),Object(i._x)("subscriptions","block search term","jetpack"),Object(i._x)("product","block search term","jetpack"),"stripe",Object(i._x)("memberships","block search term","jetpack")],usesContext:["isPremiumContentChild"],attributes:{planId:{type:"integer"},align:{type:"string"}},edit:W,save:function(e){var t=e.className;return Object(a.createElement)("div",{className:t},Object(a.createElement)(c.InnerBlocks.Content,null))},supports:{html:!1,align:!0},deprecated:[b]};function Z(e){return e.filter((function(e){return Object(B.c)(e.currency,e.price)}))}Object(r.a)("recurring-payments",K)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(6),l="mrec",s=[{height:250,icon:Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-7-2h2V7h-4v2h2z"})),name:Object(o.__)("Rectangle 300x250","jetpack"),tag:l,width:300,editorPadding:30},{height:90,icon:Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),name:Object(o.__)("Leaderboard 728x90","jetpack"),tag:"leaderboard",width:728,editorPadding:60},{height:50,icon:Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})),name:Object(o.__)("Mobile Leaderboard 320x50","jetpack"),tag:"mobile_leaderboard",width:320,editorPadding:100},{height:600,icon:Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M.04 0h24v24h-24V0z"}),Object(a.createElement)(c.Path,{d:"M19.04 3h-14c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16h-14V5h14v14zm-6-2h2V7h-2v4h-2V7h-2v6h4z"})),name:Object(o.__)("Wide Skyscraper 160x600","jetpack"),tag:"wideskyscraper",width:160,editorPadding:30}],u=Object(o.__)("Pick an ad format","jetpack");function p(e){var t=e.value,n=e.onChange;return Object(a.createElement)(c.Dropdown,{position:"bottom right",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(a.createElement)(c.Toolbar,{controls:[{icon:Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M1 9h2V7H1v2zm0 4h2v-2H1v2zm0-8h2V3c-1.1 0-2 .9-2 2zm8 16h2v-2H9v2zm-8-4h2v-2H1v2zm2 4v-2H1c0 1.1.9 2 2 2zM21 3h-8v6h10V5c0-1.1-.9-2-2-2zm0 14h2v-2h-2v2zM9 5h2V3H9v2zM5 21h2v-2H5v2zM5 5h2V3H5v2zm16 16c1.1 0 2-.9 2-2h-2v2zm0-8h2v-2h-2v2zm-8 8h2v-2h-2v2zm4 0h2v-2h-2v2z"})),title:u,onClick:t,extraProps:{"aria-expanded":n},className:"wp-block-jetpack-wordads__format-picker-icon"}]})},renderContent:function(e){var r=e.onClose;return Object(a.createElement)(c.NavigableMenu,{className:"wp-block-jetpack-wordads__format-picker"},s.map((function(e){var o=e.tag,i=e.name,l=e.icon;return Object(a.createElement)(c.MenuItem,{className:o===t?"is-active":void 0,icon:l,isSelected:o===t,key:o,onClick:function(){n(o),r()},role:"menuitemcheckbox"},i)})))}})}var d=function(e){var t=e.value,n=e.onChange;return Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Visibility","jetpack")},Object(a.createElement)(c.ToggleControl,{className:"jetpack-wordads__mobile-visibility",checked:!!t,label:Object(o.__)("Hide on mobile","jetpack"),help:Object(o.__)("Hides this block for site visitors on mobile devices.","jetpack"),onChange:n}))},m=function(e){var t=e.attributes,n=t.format,r=t.hideMobile,o=e.setAttributes;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.BlockControls,null,Object(a.createElement)(p,{value:n,onChange:function(e){return o({format:e})}})),Object(a.createElement)(i.InspectorControls,null,Object(a.createElement)(d,{value:r,onChange:function(e){return o({hideMobile:!!e})}})))},b=(n(380),n(206)),h=n.n(b),f=n(207),g=n.n(f),j=n(208),v=n.n(j),O=n(209),k=n.n(O),_=function(e){var t=e.attributes,n=e.setAttributes,r=t.format,o=s.find((function(e){return e.tag===r}));return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(m,{attributes:t,setAttributes:n}),Object(a.createElement)("div",{className:"wp-block-jetpack-wordads jetpack-wordads-".concat(r)},Object(a.createElement)("div",{className:"jetpack-wordads__ad",style:{width:o.width,height:o.height,backgroundImage:"url( ".concat(function(e){switch(e){case"leaderboard":return g.a;case"mobile_leaderboard":return v.a;case"wideskyscraper":return k.a;default:return h.a}}(r)," )"),backgroundSize:"cover"}})))},y=n(16),E=Object(o.__)("Ad","jetpack"),w=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{fill:"currentColor",d:"M12,8H4A2,2 0 0,0 2,10V14A2,2 0 0,0 4,16H5V20A1,1 0 0,0 6,21H8A1,1 0 0,0 9,20V16H12L17,20V4L12,8M15,15.6L13,14H4V10H13L15,8.4V15.6M21.5,12C21.5,13.71 20.54,15.26 19,16V8C20.53,8.75 21.5,10.3 21.5,12Z"})),C={title:E,description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Earn income by adding high quality ads to your post","jetpack")),Object(a.createElement)(c.ExternalLink,{href:"https://wordads.co/"},Object(o.__)("Learn all about WordAds","jetpack"))),icon:{src:w,foreground:Object(y.a)()},attributes:{align:{type:"string",default:"center"},format:{type:"string",default:l},hideMobile:{type:"boolean",default:!1}},example:{attributes:{}},category:"earn",keywords:[Object(o._x)("ads","block search term","jetpack"),"WordAds",Object(o._x)("advertisement","block search term","jetpack")],supports:{align:["left","center","right"],alignWide:!1,className:!1,customClassName:!1,html:!1,reusable:!1},edit:_,save:function(){return null}};Object(r.a)("wordads",C)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=(n(262),n(213),n(21)),l=n.n(i),s=n(12),u=n.n(s),p=n(15),d=n.n(p),m=n(7),b=n.n(m),h=n(13),f=n.n(h),g=n(14),j=n.n(g),v=n(5),O=n.n(v),k=n(22),_=n.n(k),y=n(8),E=n.n(y),w=n(88),C=n(6),x=n(4),S=n.n(x),N=n(3),A="09:00",T="17:00",P=function(e){f()(n,e);var t=j()(n);function n(){var e;u()(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),O()(b()(e),"renderInterval",(function(t,n){var r=e.props.day,i=t.opening,l=t.closing;return Object(a.createElement)(a.Fragment,{key:n},Object(a.createElement)("div",{className:"business-hours__row"},Object(a.createElement)("div",{className:E()(r.name,"business-hours__day")},0===n&&e.renderDayToggle()),Object(a.createElement)("div",{className:E()(r.name,"business-hours__hours")},Object(a.createElement)(c.TextControl,{type:"time",label:Object(o.__)("Opening","jetpack"),value:i,className:"business-hours__open",placeholder:A,onChange:function(t){e.setHour(t,"opening",n)}}),Object(a.createElement)(c.TextControl,{type:"time",label:Object(o.__)("Closing","jetpack"),value:l,className:"business-hours__close",placeholder:T,onChange:function(t){e.setHour(t,"closing",n)}})),Object(a.createElement)("div",{className:"business-hours__remove"},r.hours.length>1&&Object(a.createElement)(c.Button,{isSmall:!0,isLink:!0,icon:"trash",label:Object(o.__)("Remove Hours","jetpack"),onClick:function(){e.removeInterval(n)}}))),n===r.hours.length-1&&Object(a.createElement)("div",{className:"business-hours__row business-hours-row__add"},Object(a.createElement)("div",{className:E()(r.name,"business-hours__day")}," "),Object(a.createElement)("div",{className:E()(r.name,"business-hours__hours")},Object(a.createElement)(c.Button,{isLink:!0,label:Object(o.__)("Add Hours","jetpack"),onClick:e.addInterval},Object(o.__)("Add Hours","jetpack"))),Object(a.createElement)("div",{className:"business-hours__remove"}," ")))})),O()(b()(e),"setHour",(function(t,n,r){var a=e.props,o=a.day,c=a.attributes;(0,a.setAttributes)({days:c.days.map((function(e){return e.name===o.name?S()(S()({},e),{},{hours:e.hours.map((function(e,a){return a===r?S()(S()({},e),{},O()({},n,t)):e}))}):e}))})})),O()(b()(e),"toggleClosed",(function(t){var n=e.props,r=n.day,a=n.attributes;(0,n.setAttributes)({days:a.days.map((function(e){if(e.name===r.name){var n=t?[{opening:A,closing:T}]:[];return S()(S()({},e),{},{hours:n})}return e}))})})),O()(b()(e),"addInterval",(function(){var t=e.props,n=t.day,r=t.attributes,a=t.setAttributes,o=r.days;n.hours.push({opening:"",closing:""}),a({days:o.map((function(e){return e.name===n.name?S()(S()({},e),{},{hours:n.hours}):e}))})})),O()(b()(e),"removeInterval",(function(t){var n=e.props,r=n.day,a=n.attributes;(0,n.setAttributes)({days:a.days.map((function(e){return r.name===e.name?S()(S()({},e),{},{hours:e.hours.filter((function(e,n){return t!==n}))}):e}))})})),e}return d()(n,[{key:"isClosed",value:function(){var e=this.props.day;return Object(N.isEmpty)(e.hours)}},{key:"renderDayToggle",value:function(){var e=this.props,t=e.day,n=e.localization;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"business-hours__day-name"},n.days[t.name]),Object(a.createElement)(c.ToggleControl,{label:this.isClosed()?Object(o.__)("Closed","jetpack"):Object(o.__)("Open","jetpack"),checked:!this.isClosed(),onChange:this.toggleClosed}))}},{key:"renderClosed",value:function(){var e=this.props.day;return Object(a.createElement)("div",{className:"business-hours__row business-hours-row__closed"},Object(a.createElement)("div",{className:E()(e.name,"business-hours__day")},this.renderDayToggle()),Object(a.createElement)("div",{className:E()(e.name,"closed","business-hours__hours")}," "),Object(a.createElement)("div",{className:"business-hours__remove"}," "))}},{key:"render",value:function(){var e=this.props.day;return this.isClosed()?this.renderClosed():e.hours.map(this.renderInterval)}}]),n}(a.Component),I=n(9),M=n.n(I),R=function(e){f()(n,e);var t=j()(n);function n(){var e;u()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),O()(b()(e),"renderInterval",(function(t,n){var r=e.props.day.hours;return Object(a.createElement)("span",{key:n},Object(o.sprintf)("%1$s - %2$s",e.formatTime(t.opening),e.formatTime(t.closing)),r.length>1+n&&Object(a.createElement)("span",null,", "))})),e}return d()(n,[{key:"formatTime",value:function(e){var t=this.props.timeFormat,n=e.split(":"),r=M()(n,2),a=r[0],o=r[1],c=new Date;return!(!a||!o)&&(c.setHours(a),c.setMinutes(o),Object(w.date)(t,c))}},{key:"render",value:function(){var e=this,t=this.props,n=t.day,r=t.localization,c=n.hours.filter((function(t){return e.formatTime(t.opening)&&e.formatTime(t.closing)}));return Object(a.createElement)("div",{className:"jetpack-business-hours__item"},Object(a.createElement)("dt",{className:n.name},r.days[n.name]),Object(a.createElement)("dd",null,Object(N.isEmpty)(c)?Object(o._x)("Closed","business is closed on a full day","jetpack"):c.map(this.renderInterval),Object(a.createElement)("br",null)))}}]),n}(a.Component),B={days:{Sun:Object(o.__)("Sunday","jetpack"),Mon:Object(o.__)("Monday","jetpack"),Tue:Object(o.__)("Tuesday","jetpack"),Wed:Object(o.__)("Wednesday","jetpack"),Thu:Object(o.__)("Thursday","jetpack"),Fri:Object(o.__)("Friday","jetpack"),Sat:Object(o.__)("Saturday","jetpack")},startOfWeek:0},L=function(e){f()(n,e);var t=j()(n);function n(){var e;u()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),O()(b()(e),"state",{localization:B,hasFetched:!1}),e}return d()(n,[{key:"componentDidMount",value:function(){this.apiFetch()}},{key:"apiFetch",value:function(){var e=this;this.setState({data:B},(function(){_()({path:"/wpcom/v2/business-hours/localized-week"}).then((function(t){e.setState({localization:t,hasFetched:!0})}),(function(){e.setState({localization:B,hasFetched:!0})}))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.attributes,r=t.className,i=t.isSelected,s=n.days,u=this.state,p=u.localization,d=u.hasFetched,m=p.startOfWeek,b=s.concat(s.slice(0,m)).slice(m);if(!d)return Object(a.createElement)(c.Placeholder,{icon:Object(a.createElement)(C.BlockIcon,{icon:U}),label:Object(o.__)("Loading business hours","jetpack")});if(!i){var h=Object(w.__experimentalGetSettings)().formats.time;return Object(a.createElement)("dl",{className:E()(r,"jetpack-business-hours")},b.map((function(e,t){return Object(a.createElement)(R,{key:t,day:e,localization:p,timeFormat:h})})))}return Object(a.createElement)("div",{className:E()(r,"is-edit")},b.map((function(t,n){return Object(a.createElement)(P,l()({key:n,day:t,localization:p},e.props))})))}}]),n}(a.Component),D=n(25),F=n(16),z=[{name:"Sun",hours:[]},{name:"Mon",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Tue",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Wed",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Thu",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Fri",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Sat",hours:[]}],U=Object(D.a)(Object(a.createElement)(c.Path,{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),V={title:Object(o.__)("Business Hours","jetpack"),description:Object(o.__)("Display opening hours for your business.","jetpack"),icon:{src:U,foreground:Object(F.a)()},category:"grow",supports:{html:!0},keywords:[Object(o._x)("opening hours","block search term","jetpack"),Object(o._x)("closing time","block search term","jetpack"),Object(o._x)("schedule","block search term","jetpack"),Object(o._x)("working day","block search term","jetpack")],attributes:{days:{type:"array",default:z}},edit:function(e){return Object(a.createElement)(L,e)},save:function(){return null},example:{attributes:{days:z}}};Object(r.a)("business-hours",V)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=(n(311),n(23)),l=n(12),s=n.n(l),u=n(15),p=n.n(u),d=n(7),m=n.n(d),b=n(13),h=n.n(b),f=n(14),g=n.n(f),j=n(5),v=n.n(j),O=n(8),k=n.n(O),_=n(6),y=n(17),E=n(10),w=n(192),C=new(n.n(w).a),x=function(e){"A"===e.target.nodeName&&(window.confirm(Object(o.__)("Are you sure you wish to leave this page?","jetpack"))||e.preventDefault())},S=function(e){var t=e.className,n=e.source,r=void 0===n?"":n;return Object(a.createElement)(a.RawHTML,{className:t,onClick:x},r.length?C.render(r):"")},N="editor",A="preview",T=function(e){h()(n,e);var t=g()(n);function n(){var e;s()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),v()(m()(e),"input",null),v()(m()(e),"state",{activePanel:N}),v()(m()(e),"bindInput",(function(t){e.input=t})),v()(m()(e),"updateSource",(function(t){return e.props.setAttributes({source:t})})),v()(m()(e),"handleKeyDown",(function(t){var n=e.props,r=n.attributes,a=n.removeBlock,o=r.source;8===t.keyCode&&""===o&&(a(),t.preventDefault())})),v()(m()(e),"toggleMode",(function(t){return function(){return e.setState({activePanel:t})}})),e}return p()(n,[{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.state.activePanel===A&&this.toggleMode(N)(),!e.isSelected&&this.props.isSelected&&this.state.activePanel===N&&this.input&&this.input.focus()}},{key:"isEmpty",value:function(){var e=this.props.attributes.source;return!e||""===e.trim()}},{key:"renderToolbarButton",value:function(e,t){var n=this.state.activePanel,r=this.props.className,o=k()(r,"components-button components-tab-button",{"is-pressed":n===e});return Object(a.createElement)("button",{className:o,onClick:this.toggleMode(e)},Object(a.createElement)("span",null,t))}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.className,r=e.isSelected,c=t.source,i=this.state.activePanel;return!r&&this.isEmpty()?Object(a.createElement)("p",{className:"".concat(n,"__placeholder")},Object(o.__)("Write your _Markdown_ **here**…","jetpack")):Object(a.createElement)("div",{className:n},Object(a.createElement)(_.BlockControls,null,Object(a.createElement)("div",{className:"components-toolbar"},this.renderToolbarButton(N,Object(o.__)("Markdown","jetpack")),this.renderToolbarButton(A,Object(o.__)("Preview","jetpack")))),i!==A&&r?Object(a.createElement)(_.PlainText,{className:"".concat(n,"__editor"),onChange:this.updateSource,onKeyDown:this.handleKeyDown,"aria-label":Object(o.__)("Markdown","jetpack"),innerRef:this.bindInput,value:c}):Object(a.createElement)(S,{className:"".concat(n,"__preview"),source:c}))}}]),n}(a.Component),P=Object(y.compose)([Object(E.withSelect)((function(e){return{currentBlockId:e("core/block-editor").getSelectedBlockClientId()}})),Object(E.withDispatch)((function(e,t){var n=t.currentBlockId;return{removeBlock:function(){return e("core/block-editor").removeBlocks(n)}}}))])(T),I=n(16),M=n(58),R=Object(o.__)("Try Markdown","jetpack"),B=Object(o.__)("Markdown is a text formatting syntax that is converted into HTML. You can _emphasize_ text or **make it strong** with just a few characters.","jetpack"),L=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 208 128"},Object(a.createElement)(c.Rect,{width:"198",height:"118",x:"5",y:"5",ry:"10",stroke:"currentColor",strokeWidth:"10",fill:"none"}),Object(a.createElement)(c.Path,{d:"M30 98v-68h20l20 25 20-25h20v68h-20v-39l-20 25-20-25v39zM155 98l-30-33h20v-35h20v35h20z"})),D=Object(i.c)()||Object(i.a)()?"https://en.support.wordpress.com/markdown-quick-reference/":"https://jetpack.com/support/jetpack-blocks/markdown-block/",F={title:Object(o.__)("Markdown","jetpack"),description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Use regular characters and punctuation to style text, links, and lists.","jetpack")),Object(a.createElement)(c.ExternalLink,{href:D},Object(o.__)("Support reference","jetpack"))),icon:{src:L,foreground:Object(I.a)()},category:Object(M.a)("text","formatting"),keywords:[Object(o._x)("formatting","block search term","jetpack"),Object(o._x)("syntax","block search term","jetpack"),Object(o._x)("markup","block search term","jetpack")],attributes:{source:{type:"string"}},supports:{html:!1},edit:P,save:function(e){var t=e.attributes,n=e.className;return Object(a.createElement)(S,{className:n,source:t.source})},example:{attributes:{source:"## ## ".concat(R,"\n\n").concat(B)}}};Object(r.a)("markdown",F)},function(e,t,n){"use strict";n.r(t);var r,a=n(20),o=n(1),c=n(0),i=n(3),l=n(6),s=n(2),u=n(24),p=function(e){var t,n=e.id,r=e.setRating,a=e.children;return Object(c.createElement)("span",{className:"jetpack-ratings-button",tabIndex:0,role:"button",onKeyDown:(t=n,function(e){return e.keyCode===u.ENTER?r(t):null}),onClick:function(e){return function(){return r(e)}}(n)},a)},d=n(16),m=(n(367),n(237),{title:Object(o.__)("Star Rating","jetpack"),description:Object(o.__)("Rate movies, books, songs, recipes — anything you can put a number on.","jetpack"),icon:{src:function(){return Object(c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)(s.Path,{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}))},foreground:Object(d.a)()},keywords:[Object(o._x)("star","block search term","jetpack"),Object(o._x)("rating","block search term","jetpack"),Object(o._x)("review","block search term","jetpack")],category:"widgets",example:{},styles:[{name:"filled",label:Object(o._x)("Filled","block style","jetpack"),isDefault:!0},{name:"outlined",label:Object(o._x)("Outlined","block style","jetpack")}],attributes:{rating:{type:"number",default:1},maxRating:{type:"number",default:5},color:{type:"string"},align:{type:"string",default:"left"}},edit:function(e){return function(t){var n=t.className,r=t.setAttributes,a=t.attributes,u=a.align,d=a.color,m=a.rating,b=a.maxRating,h=function(e){e===m?Math.ceil(m)===m&&(e-=.5):.5===m&&1===e&&(e=0),r({rating:e})};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.BlockControls,null,Object(c.createElement)(l.AlignmentToolbar,{value:u,onChange:function(e){return r({align:e})}})),Object(c.createElement)("div",{className:n,style:{textAlign:u}},Object(i.range)(1,b+1).map((function(t){return Object(c.createElement)(p,{key:t,id:t,setRating:h},Object(c.createElement)("span",null,Object(c.createElement)(e,{className:m>=t-.5?null:"is-rating-unfilled",color:d})),Object(c.createElement)("span",null,Object(c.createElement)(e,{className:m>=t?null:"is-rating-unfilled",color:d})))}))),Object(c.createElement)(l.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(o.__)("Settings","jetpack")},Object(c.createElement)(s.RangeControl,{label:Object(o.__)("Highest rating","jetpack"),value:b,onChange:function(e){return r({maxRating:e})},min:2,max:10}),Object(c.createElement)(l.PanelColorSettings,{title:Object(o.__)("Color Settings","jetpack"),initialOpen:!0,colorSettings:[{value:d,onChange:function(e){return r({color:e})},label:Object(o.__)("Color","jetpack")}]}))))}}((function(e){var t=function(e){return e&&e.color?e.color:"currentColor"}(e),n=function(e){return e&&e.className?e.className:""}(e);return Object(c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",color:t},Object(c.createElement)(s.Path,{className:n,fill:t,stroke:t,d:"M12,17.3l6.2,3.7l-1.6-7L22,9.2l-7.2-0.6L12,2L9.2,8.6L2,9.2L7.5,14l-1.6,7L12,17.3z"}))})),save:(r="★",function(e){var t=e.className,n=e.attributes,a=n.align,o=n.rating,l=n.color;return Object(c.createElement)("figure",{className:t,style:{textAlign:a}},Object(i.range)(1,o+1).map((function(e){return Object(c.createElement)("span",{key:e,style:{color:l}},r)})))})});Object(a.a)("rating-star",m)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(12),l=n.n(i),s=n(15),u=n.n(s),p=n(13),d=n.n(p),m=n(14),b=n.n(m),h=n(6),f=n(3),g=n(10),j=n(17);function v(e){var t=e.attributes,n=e.setAttributes,r=t.displayContext,i=t.displayDate,l=t.displayThumbnails,s=t.postsToShow;return Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Related Posts Settings","jetpack")},Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Display thumbnails","jetpack"),checked:l,onChange:function(e){return n({displayThumbnails:e})}}),Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Display date","jetpack"),checked:i,onChange:function(e){return n({displayDate:e})}}),Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Display context (category or tag)","jetpack"),checked:r,onChange:function(e){return n({displayContext:e})}}),Object(a.createElement)(c.RangeControl,{label:Object(o.__)("Number of posts","jetpack"),value:s,onChange:function(e){return n({postsToShow:Math.min(e,6)})},min:1,max:6}))}function O(e){var t=e.attributes,n=e.setAttributes,r=t.postLayout,i=[{icon:"grid-view",title:Object(o.__)("Grid View","jetpack"),onClick:function(){return n({postLayout:"grid"})},isActive:"grid"===r},{icon:"list-view",title:Object(o.__)("List View","jetpack"),onClick:function(){return n({postLayout:"list"})},isActive:"list"===r}];return Object(a.createElement)(c.Toolbar,{controls:i})}function k(e){return Object(a.createElement)("div",{className:"jp-related-posts-i2__post",id:e.id,"aria-labelledby":e.id+"-heading"},Object(a.createElement)("strong",{id:e.id+"-heading",className:"jp-related-posts-i2__post-link"},e.isInSiteEditor?Object(o.__)("Preview unavailable in site editor.","jetpack"):Object(o.__)("Preview unavailable: you haven't published enough posts with similar content.","jetpack")),e.displayThumbnails&&Object(a.createElement)("figure",{className:"jp-related-posts-i2__post-image-placeholder","aria-label":Object(o.__)("Placeholder image","jetpack")},Object(a.createElement)(c.SVG,{className:"jp-related-posts-i2__post-image-placeholder-square",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 350 200"},Object(a.createElement)("title",null,Object(o.__)("Grey square","jetpack")),Object(a.createElement)(c.Path,{d:"M0 0h350v200H0z",fill:"#8B8B96","fill-opacity":".1"})),Object(a.createElement)(c.SVG,{className:"jp-related-posts-i2__post-image-placeholder-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(a.createElement)("title",null,Object(o.__)("Icon for image","jetpack")),Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))),e.displayDate&&Object(a.createElement)("div",{className:"jp-related-posts-i2__post-date has-small-font-size"},Object(o.__)("August 3, 2018","jetpack")),e.displayContext&&Object(a.createElement)("div",{className:"jp-related-posts-i2__post-context has-small-font-size"},Object(o.__)("In “Uncategorized”","jetpack")))}function _(e){return Object(a.createElement)("div",{className:"jp-related-posts-i2__post",id:e.id,"aria-labelledby":e.id+"-heading"},Object(a.createElement)("a",{className:"jp-related-posts-i2__post-link",id:e.id+"-heading",href:e.post.url,rel:"nofollow noopener noreferrer",target:"_blank"},e.post.title),e.displayThumbnails&&e.post.img&&e.post.img.src&&Object(a.createElement)("a",{className:"jp-related-posts-i2__post-img-link",href:e.post.url},Object(a.createElement)("img",{className:"jp-related-posts-i2__post-img",src:e.post.img.src,alt:e.post.title,rel:"nofollow noopener noreferrer",target:"_blank"})),e.displayDate&&Object(a.createElement)("div",{className:"jp-related-posts-i2__post-date has-small-font-size"},e.post.date),e.displayContext&&Object(a.createElement)("div",{className:"jp-related-posts-i2__post-context has-small-font-size"},e.post.context))}function y(e){var t="jp-related-posts-i2__row",n=0,r=e.posts.length>3;switch(e.posts.length){case 2:case 4:case 5:n=2;break;default:n=3}return Object(a.createElement)("div",null,Object(a.createElement)("div",{className:t,"data-post-count":e.posts.slice(0,n).length},e.posts.slice(0,n)),r&&Object(a.createElement)("div",{className:t,"data-post-count":e.posts.slice(n).length},e.posts.slice(n)))}var E=function(e){d()(n,e);var t=b()(n);function n(){return l()(this,n),t.apply(this,arguments)}return u()(n,[{key:"render",value:function(){for(var e=this.props,t=e.attributes,n=e.className,r=e.posts,o=e.setAttributes,c=e.instanceId,i=e.isInSiteEditor,l=t.displayContext,s=t.displayDate,u=t.displayThumbnails,p=t.postLayout,d=t.postsToShow,m="jp-relatedposts-i2",b=[],f=0;f<d;f++)r[f]?b.push(Object(a.createElement)(_,{id:"related-posts-".concat(c,"-post-").concat(f),key:m+"-"+f,post:r[f],displayThumbnails:u,displayDate:s,displayContext:l})):b.push(Object(a.createElement)(k,{id:"related-posts-".concat(c,"-post-").concat(f),key:"related-post-placeholder-"+f,displayThumbnails:u,displayDate:s,displayContext:l,isInSiteEditor:i}));return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(h.InspectorControls,null,Object(a.createElement)(v,{attributes:t,setAttributes:o})),Object(a.createElement)(h.BlockControls,null,Object(a.createElement)(O,{attributes:t,setAttributes:o})),Object(a.createElement)("div",{className:n,id:"related-posts-".concat(c)},Object(a.createElement)("div",{className:m,"data-layout":p},Object(a.createElement)(y,{posts:b}))))}}]),n}(a.Component),w=Object(j.compose)(j.withInstanceId,Object(g.withSelect)((function(e){var t=(0,e("core/editor").getCurrentPost)();return{posts:Object(f.get)(t,"jetpack-related-posts",[]),isInSiteEditor:Object(f.isEmpty)(t)}})))(E),C=(n(369),n(16)),x=Object(a.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(c.G,{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square"},Object(a.createElement)(c.Path,{d:"M4,4 L4,19 M4,4 L19,4 M4,9 L19,9 M4,14 L19,14 M4,19 L19,19 M9,4 L9,19 M19,4 L19,19"}))),S={title:Object(o.__)("Related Posts","jetpack"),icon:{src:x,foreground:Object(C.a)()},category:"embed",keywords:[Object(o._x)("similar content","block search term","jetpack"),Object(o._x)("linked","block search term","jetpack"),Object(o._x)("connected","block search term","jetpack")],attributes:{postLayout:{type:"string",default:"grid"},displayDate:{type:"boolean",default:!0},displayThumbnails:{type:"boolean",default:!1},displayContext:{type:"boolean",default:!1},postsToShow:{type:"number",default:3}},supports:{html:!1,multiple:!1,reusable:!1},transforms:{from:[{type:"shortcode",tag:"jetpack-related-posts"}]},edit:w,save:function(){return null},example:{attributes:{postLayout:"grid",displayDate:!0,displayThumbnails:!0,displayContext:!1,postsToShow:2}}};Object(r.a)("related-posts",S)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i=n(25),l=n(12),s=n.n(l),u=n(15),p=n.n(u),d=n(7),m=n.n(d),b=n(13),h=n.n(b),f=n(14),g=n.n(f),j=n(5),v=n.n(j),O=n(6),k=n(10),_=n(8),y=n.n(_),E=n(60),w=[{value:E.b,label:Object(o.__)("Show after threshold","jetpack")},{value:E.c,label:Object(o.__)("Show before threshold","jetpack")}],C=function(e){h()(n,e);var t=g()(n);function n(){var e;s()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),v()(m()(e),"state",{isThresholdValid:!0}),v()(m()(e),"setCriteria",(function(t){return e.props.setAttributes({criteria:t})})),v()(m()(e),"setThreshold",(function(t){if(/^\d+$/.test(t)&&+t>0)return e.props.setAttributes({threshold:+t}),void e.setState({isThresholdValid:!0});e.setState({isThresholdValid:!1})})),e}return p()(n,[{key:"getNoticeLabel",value:function(){return this.props.attributes.criteria===E.b?1===this.props.attributes.threshold?Object(o.__)("This block will only appear to people who have visited this page more than once.","jetpack"):Object(o.sprintf)(Object(o._n)("This block will only appear to people who have visited this page more than %d time.","This block will only appear to people who have visited this page more than %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold):1===this.props.attributes.threshold?Object(o.__)("This block will only appear to people who are visiting this page for the first time.","jetpack"):Object(o.sprintf)(Object(o._n)("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold)}},{key:"render",value:function(){return Object(a.createElement)("div",{className:y()(this.props.className,{"wp-block-jetpack-repeat-visitor--is-unselected":!this.props.isSelected})},Object(a.createElement)(c.Placeholder,{icon:N,label:Object(o.__)("Repeat Visitor","jetpack"),className:"wp-block-jetpack-repeat-visitor-placeholder"},Object(a.createElement)(c.TextControl,{className:"wp-block-jetpack-repeat-visitor-threshold",defaultValue:this.props.attributes.threshold,help:this.state.isThresholdValid?"":Object(o.__)("Please enter a valid number.","jetpack"),label:Object(o.__)("Visit count threshold","jetpack"),min:"1",onChange:this.setThreshold,pattern:"[0-9]",type:"number"}),Object(a.createElement)(c.RadioControl,{label:Object(o.__)("Visibility","jetpack"),selected:this.props.attributes.criteria,options:w,onChange:this.setCriteria})),Object(a.createElement)(c.Notice,{status:"info",isDismissible:!1},this.getNoticeLabel()),Object(a.createElement)(O.InnerBlocks,null))}}]),n}(a.Component),x=Object(k.withSelect)((function(e,t){var n=e("core/block-editor"),r=n.isBlockSelected,a=n.hasSelectedInnerBlock;return{isSelected:r(t.clientId)||a(t.clientId)}}))(C),S=n(16),N=(n(370),Object(i.a)(Object(a.createElement)(c.Path,{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}))),A={attributes:{criteria:{type:"string",default:E.b},threshold:{type:"number",default:E.d}},category:"widgets",description:Object(o.__)("Control block visibility based on how often a visitor has viewed the page.","jetpack"),icon:{src:N,foreground:Object(S.a)()},keywords:[Object(o._x)("return","block search term","jetpack"),Object(o._x)("visitors","block search term","jetpack"),Object(o._x)("visibility","block search term","jetpack")],supports:{html:!1},title:Object(o.__)("Repeat Visitor","jetpack"),edit:x,save:function(e){var t=e.className;return Object(a.createElement)("div",{className:t},Object(a.createElement)(O.InnerBlocks.Content,null))},example:{attributes:{criteria:E.b,threshold:E.d},innerBlocks:[{name:"core/paragraph",attributes:{content:Object(o.__)("This block will only appear to a visitor who visited the page three or more times.","jetpack")}}]}};Object(r.a)("repeat-visitor",A)},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(417);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,c){if(c!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){},function(e,t){e.exports=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}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"setConnectionTestResults",(function(){return p})),n.d(r,"refreshConnectionTestResults",(function(){return d})),n.d(r,"fetchFromAPI",(function(){return m})),n.d(r,"refreshTweets",(function(){return b})),n.d(r,"setTweets",(function(){return h})),n.d(r,"getTwitterCards",(function(){return f})),n.d(r,"setTwitterCards",(function(){return g}));var a={};n.r(a),n.d(a,"getFailedConnections",(function(){return W})),n.d(a,"getMustReauthConnections",(function(){return $})),n.d(a,"getTweetTemplate",(function(){return K})),n.d(a,"getTweetStorm",(function(){return Z})),n.d(a,"getFirstTweet",(function(){return Y})),n.d(a,"getLastTweet",(function(){return J})),n.d(a,"getSupportedBlockType",(function(){return X})),n.d(a,"getTweetsForBlock",(function(){return Q})),n.d(a,"getTwitterCardForURLs",(function(){return ee})),n.d(a,"twitterCardIsCached",(function(){return te})),n.d(a,"getShareMessage",(function(){return ne})),n.d(a,"getShareMessageMaxLength",(function(){return re})),n.d(a,"isTweetStorm",(function(){return ae})),n.d(a,"getBoundariesForBlock",(function(){return oe})),n.d(a,"getBoundaryStyleSelectors",(function(){return ie})),n.d(a,"checkForTagsInContentAttributes",(function(){return le})),n.d(a,"getPopoverWarnings",(function(){return se})),n.d(a,"isSelectedTweetBoundary",(function(){return ue})),n.d(a,"contentAttributesChanged",(function(){return pe}));var o=n(0),c=n(1),i=n(2),l=n(74),s=n(51),u=(n(411),n(10));function p(e){return{type:"SET_CONNECTION_TEST_RESULTS",results:e}}function d(){return{type:"REFRESH_CONNECTION_TEST_RESULTS"}}function m(e){return{type:"FETCH_FROM_API",path:e}}function b(){return{type:"REFRESH_TWEETS"}}function h(e){return{type:"SET_TWEETS",tweets:e}}function f(e){var t=Object(u.select)("jetpack/publicize").twitterCardIsCached;return{type:"GET_TWITTER_CARDS",urls:e.filter((function(e){return!t(e)}))}}function g(e){return{type:"SET_TWITTER_CARDS",cards:e}}var j,v,O=n(4),k=n.n(O),_=n(19),y=n.n(_),E=n(3);function w(e){return[e]}function C(){var e={clear:function(){e.head=null}};return e}function x(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}j={},v="undefined"!=typeof WeakMap;var S=function(e,t){var n,r;function a(){n=v?new WeakMap:C()}function o(){var n,a,o,c,i,l=arguments.length;for(c=new Array(l),o=0;o<l;o++)c[o]=arguments[o];for(i=t.apply(null,c),(n=r(i)).isUniqueByDependants||(n.lastDependants&&!x(i,n.lastDependants,0)&&n.clear(),n.lastDependants=i),a=n.head;a;){if(x(a.args,c,1))return a!==n.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n.head,a.prev=null,n.head.prev=a,n.head=a),a.val;a=a.next}return a={val:e.apply(null,c)},c[0]=null,a.args=c,n.head&&(n.head.prev=a,a.next=n.head),n.head=a,a.val}return t||(t=w),r=v?function(e){var t,r,a,o,c,i=n,l=!0;for(t=0;t<e.length;t++){if(r=e[t],!(c=r)||"object"!=typeof c){l=!1;break}i.has(r)?i=i.get(r):(a=new WeakMap,i.set(r,a),i=a)}return i.has(j)||((o=C()).isUniqueByDependants=l,i.set(j,o)),i.get(j)}:function(){return n},o.getDependants=t,o.clear=a,a(),o},N=n(17),A=n(31),T=n(12),P=n.n(T),I=n(15),M=n.n(I),R=n(13),B=n.n(R),L=n(14),D=n.n(L),F=(n(244),n(33)),z=(n(182),function(e){B()(n,e);var t=D()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isTweetStorm,n=e.updateTweets;t&&n()}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.boundaries,r=t.childProps,a=t.currentAnnotations,o=t.isTweetStorm,c=t.updateAnnotations,i=t.updateTweets,l=t.supportedBlockType,s=t.contentAttributesChanged;o&&l&&(s(e.childProps,r)&&i(),a.length===n.filter((function(e){return["normal","line-break"].includes(e.type)})).length&&Object(E.isEqual)(e.boundaries,n)||c())}},{key:"render",value:function(){var e=this.props,t=e.ChildEdit,n=e.childProps,r=e.isTweetStorm,a=e.isSelectedTweetBoundary,c=e.boundaryStylesSelectors,l=e.popoverWarnings;return r?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(t,n),a&&Object(o.createElement)("div",{className:"jetpack-publicize-twitter__tweet-divider"},Object(o.createElement)("div",{className:"jetpack-publicize-twitter__tweet-divider-icon"},Object(o.createElement)(F.i,{serviceName:"twitter"})),l.length>0&&Object(o.createElement)(i.Popover,{className:"jetpack-publicize-twitter__tweet-divider-popover",focusOnMount:!1,position:"bottom center"},Object(o.createElement)("ol",null,l.map((function(e,t){return Object(o.createElement)("li",{key:"jetpack-publicize-twitter__tweet-divider-popover-warning-".concat(t)},e)}))))),c&&Object(o.createElement)("style",{type:"text/css"},c.map((function(e){return"".concat(e,'::after {\n\t\t\t\t\t\t\t\tcontent: "";\n\t\t\t\t\t\t\t\tbackground: #0009;\n\t\t\t\t\t\t\t\twidth: 3px;\n\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\tmargin: 0 1px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.is-dark-theme ').concat(e,"::after {\n\t\t\t\t\t\t\t\tbackground: #fff9;\n\t\t\t\t\t\t\t}")})))):Object(o.createElement)(t,n)}}]),n}(o.Component)),U=Object(N.compose)([Object(u.withSelect)((function(e,t){var n=t.childProps,r=e("jetpack/publicize"),a=r.isTweetStorm,o=r.getPopoverWarnings,c=r.getBoundariesForBlock,i=r.getBoundaryStyleSelectors,l=r.isSelectedTweetBoundary,s=r.getSupportedBlockType,u=r.contentAttributesChanged,p=e("core/annotations").__experimentalGetAllAnnotationsForBlock(n.clientId);return{isTweetStorm:a(),isSelectedTweetBoundary:l(n),boundaries:c(n.clientId),boundaryStylesSelectors:i(n.clientId),popoverWarnings:o(n),currentAnnotations:p,supportedBlockType:s(n.name),contentAttributesChanged:u}})),Object(u.withDispatch)((function(e,t,n){var r=t.childProps,a=n.select;return{updateTweets:function(){return e("jetpack/publicize").refreshTweets()},updateAnnotations:function(){var t=a("jetpack/publicize"),n=t.contentAttributesChanged,o=(0,t.getTweetsForBlock)(r.clientId);o&&0!==o.length&&(n(o.reduce((function(e,t){return e||t.blocks.find((function(e){return e.clientId===r.clientId}))}),!1),r)||(a("core/annotations").__experimentalGetAllAnnotationsForBlock(r.clientId).forEach((function(t){["jetpack-tweetstorm","jetpack-tweetstorm-line-break"].includes(t.source)&&e("core/annotations").__experimentalRemoveAnnotation(t.id)})),o.filter((function(e){return e.boundary})).map((function(e){return e.boundary})).forEach((function(t){var n=t.container,a=t.type,o=t.start,c=t.end;"normal"===a?e("core/annotations").__experimentalAddAnnotation({blockClientId:r.clientId,source:"jetpack-tweetstorm",richTextIdentifier:n,range:{start:o,end:c}}):"line-break"===a&&e("core/annotations").__experimentalAddAnnotation({blockClientId:r.clientId,source:"jetpack-tweetstorm-line-break",richTextIdentifier:n,range:{start:o,end:c}})}))))}}}))])(z),V={"core/gallery":{contentAttributes:["images"]},"core/heading":{contentAttributes:["content"]},"core/image":{contentAttributes:["alt","url"]},"core/list":{contentAttributes:["values"]},"core/paragraph":{contentAttributes:["content"]},"core/quote":{contentAttributes:["value","citation"]},"core/separator":{contentAttributes:[]},"core/spacer":{contentAttributes:[]},"core/verse":{contentAttributes:["content"]},"core/video":{contentAttributes:["src"]},"core/embed":{contentAttributes:["url"]},"jetpack/gif":{contentAttributes:["giphyUrl"]}},G=["core/column","core/columns","core/group"];Object(A.addFilter)("blocks.registerBlockType","jetpack/publishing-tweetstorms",(function(e){var t=e.edit;return k()(k()({},e),{},{edit:function(e){return Object(o.createElement)(U,{ChildEdit:t,childProps:e})}})}));var H=Object(N.compose)([Object(u.withSelect)((function(e){return{isTweetStorm:e("jetpack/publicize").isTweetStorm(),isTyping:e("core/block-editor").isTyping()}}))])((function(e){var t=e.isTweetStorm,n=e.isTyping;return t?document.body.classList.add("jetpack-tweetstorm"):document.body.classList.remove("jetpack-tweetstorm"),t&&n?document.body.classList.add("jetpack-tweetstorm-is-typing"):document.body.classList.remove("jetpack-tweetstorm-is-typing"),null})),q="\n\n"+Object(c.__)("A thread ⬇️","jetpack");function W(e){return e.connections.filter((function(e){return!1===e.test_success}))}function $(e){return e.connections.filter((function(e){return"must_reauth"===e.test_success})).map((function(e){return e.service_name}))}function K(e){var t,n=null===(t=e.connections)||void 0===t?void 0:t.find((function(e){return"twitter"===e.service_name}));return{date:Date.now(),name:(null==n?void 0:n.profile_display_name)||Object(c.__)("Account Name","jetpack"),profileImage:(null==n?void 0:n.profile_picture)||"https://abs.twimg.com/sticky/default_profile_images/default_profile_bigger.png",screenName:(null==n?void 0:n.display_name)||""}}function Z(e){var t=K(e),n=[Y(e)].concat(y()(e.tweets.slice(0,100).map((function(n){return k()(k()({},t),{},{text:n.text,media:n.media,tweet:n.tweet,urls:n.urls,card:ee(e,n.urls)})}))));return n.length>1&&n.push(J(e)),n}function Y(e){var t,n,r,a;if(Object(u.select)("core")){var o=K(e),i=Object(u.select)("core").getMedia,l=Object(u.select)("core/editor").getEditedPostAttribute,s=l("featured_media"),p=l("link"),d=s&&i(s),m=(null==d||null===(t=d.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(r=n.large)||void 0===r?void 0:r.source_url)||(null==d?void 0:d.source_url);return k()(k()({},o),{},{text:ne()+" ".concat(p),urls:[p],card:{title:l("title"),description:(null===(a=l("meta"))||void 0===a?void 0:a.advanced_seo_description)||l("excerpt")||l("content").split("\x3c!--more")[0]||Object(c.__)("Visit the post for more.","jetpack"),url:p,image:m,type:m?"summary_large_image":"summary"}})}}function J(e){if(Object(u.select)("core/editor")){var t=(0,Object(u.select)("core/editor").getEditedPostAttribute)("link"),n=e.tweets.length>100?Object(c.__)("The rest of this thread can be read here:","jetpack"):Object(c.__)("This thread can be read here:","jetpack");return k()(k()({},Y(e)),{},{text:"".concat(n," ").concat(t)})}}function X(e,t){if(V[t])return V[t]}var Q=S((function(e,t){return e.tweets.filter((function(e){return!!e.blocks.find((function(e){return e.clientId===t}))}))}),(function(e){return[e.tweets]}));function ee(e,t){if(t)return t.reduce((function(t,n){return t||(e.twitterCards[n]&&!e.twitterCards[n].error?k()({url:n},e.twitterCards[n]):void 0)}),void 0)}function te(e,t){return!!e.twitterCards[t]}function ne(){var e=Object(u.select)("core/editor").getEditedPostAttribute,t=e("meta"),n=e("title"),r=Object(E.get)(t,["jetpack_publicize_message"],""),a=Object(E.get)(t,["jetpack_publicize_hasEditedShareMessage"],!1);return r?r.substr(0,re()):a&&""===r?"":n?n.substr(0,re())+(ae()?q:""):""}function re(){return ae()?255-q.length:255}function ae(){var e;return!(null===(e=Object(u.select)("core/editor").getEditedPostAttribute("meta"))||void 0===e||!e.jetpack_is_tweetstorm)}var oe=S((function(e,t){if(!ae())return[];var n=Q(e,t);return n&&0!==n.length?n.filter((function(e){return e.boundary})).map((function(e){return e.boundary})):[]}),(function(e){return[e.tweets]}));function ce(e,t){if("block-".concat(t)===e.id)return"#block-".concat(t);var n=e.parentNode,r=Array.prototype.indexOf.call(n.children,e);return ce(n,t)+" > :nth-child( ".concat(r+1," )")}var ie=S((function(e,t){var n=oe(e,t),r=document.getElementById("block-".concat(t));return n.filter((function(e){return"end-of-line"===e.type})).map((function(e){if(!r)return!1;var n=r.getElementsByTagName("li").item(e.line);return!!n&&ce(n,t)})).filter((function(e){return!!e}))}),(function(e){return[e.tweets]}));function le(e,t,n){var r;if(0===n.length)return!1;if(null===(r=X(0,t.name))||void 0===r||!r.contentAttributes)return!1;var a=new RegExp("<(".concat(n.join("|"),")( |>|/>)"),"gi");return X(0,t.name).contentAttributes.reduce((function(e,n){return!!e||a.test(t.attributes[n])}),!1)}var se=S((function(e,t){var n=Object(u.select)("core/block-editor"),r=n.isTyping,a=n.isDraggingBlocks,o=n.isMultiSelecting,i=n.hasMultiSelection,l=n.isCaretWithinFormattedText;if(!ae())return[];if(r()||a()||o()||i()||l())return[];var s=[];return X(0,t.name)||G[t.name]?("core/gallery"===t.name&&t.attributes.images.length>4&&s.push(Object(c.__)("Twitter displays the first four images.","jetpack")),le(0,t,["strong","bold","em","i","sup","sub","span","s"])&&s.push(Object(c.__)("Twitter removes all text formatting.","jetpack")),le(0,t,["a"])&&s.push(Object(c.__)("Links will be posted seperately.","jetpack"))):s.push(Object(c.__)("This block is not exportable to Twitter","jetpack")),s}),(function(e){return[e.tweets]}));function ue(e,t){var n=Object(u.select)("core/block-editor").isBlockSelected;if(!ae())return!1;var r=X(0,t.name),a=Q(e,t.clientId);if(!a||0===a.length)return!1;var o=a[a.length-1];return n(t.clientId)&&!r||o.blocks[o.blocks.length-1].clientId===t.clientId&&a.some((function(e){return e.blocks.some((function(e){return n(e.clientId)}))}))}function pe(e,t,n){var r=X(0,n.name);if(!r)return!1;var a=r.contentAttributes;return!Object(E.isEqual)(a.map((function(e){return{attribute:e,content:t.attributes[e]}})),a.map((function(e){return{attribute:e,content:n.attributes[e]}})))}var de=n(120),me=n.n(de),be=n(26),he=n.n(be),fe=n(22),ge=n.n(fe),je=n(11);function ve(){return(ve=he()(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ge()({path:"/wpcom/v2/publicize/connection-test-results"});case 3:return t=e.sent,e.abrupt("return",Object(u.dispatch)("jetpack/publicize").setConnectionTestResults(t));case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var Oe=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=Object(u.select)("jetpack/publicize"),r=n.getSupportedBlockType;return Object(E.flatMap)(t,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(t.name)||t.name.startsWith("core-embed/")?t:G.includes(t.name)?e(t.innerBlocks):[]}))};function ke(){return(ke=he()(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object(u.select)("core/editor").getBlocks(),n=Oe(t),e.prev=2,e.next=5,ge()({path:"/wpcom/v2/tweetstorm/parse",data:{blocks:n.map((function(e){return{attributes:e.attributes,block:Object(je.serialize)(e),clientId:e.clientId}}))},method:"POST"});case 5:return r=e.sent,a=Object(E.flatMap)(r,(function(e){return e.urls})),Object(u.dispatch)("jetpack/publicize").getTwitterCards(a),e.abrupt("return",Object(u.dispatch)("jetpack/publicize").setTweets(r));case 11:e.prev=11,e.t0=e.catch(2);case 13:case"end":return e.stop()}}),e,null,[[2,11]])})))).apply(this,arguments)}function _e(){return(_e=he()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.urls.length){e.next=2;break}return e.abrupt("return",Object(u.dispatch)("jetpack/publicize").setTwitterCards([]));case 2:return e.prev=2,e.next=5,ge()({path:"/wpcom/v2/tweetstorm/generate-cards",data:{urls:t.urls},method:"POST"});case 5:return n=e.sent,e.abrupt("return",Object(u.dispatch)("jetpack/publicize").setTwitterCards(n));case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}var ye={REFRESH_CONNECTION_TEST_RESULTS:function(){return ve.apply(this,arguments)},REFRESH_TWEETS:Object(E.throttle)((function(){return ke.apply(this,arguments)}),2e3,{leading:!0,trailing:!0}),GET_TWITTER_CARDS:function(_x){return _e.apply(this,arguments)}};var Ee,we,Ce,xe,Se,Ne={FETCH_FROM_API:function(e){var t=e.path;return ge()({path:t})}},Ae={connections:[],tweets:[],twitterCards:[]},Te=Object(u.registerStore)("jetpack/publicize",{actions:r,controls:Ne,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ae,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CONNECTION_TEST_RESULTS":return k()(k()({},e),{},{connections:t.results});case"REFRESH_CONNECTION_TEST_RESULTS":return k()(k()({},e),{},{connections:[]});case"SET_TWEETS":return k()(k()({},e),{},{tweets:t.tweets});case"GET_TWITTER_CARDS":var n={};return t.urls.forEach((function(e){return n[e]={error:"loading"}})),k()(k()({},e),{},{twitterCards:k()(k()({},e.twitterCards),n)});case"SET_TWITTER_CARDS":return k()(k()({},e),{},{twitterCards:k()(k()({},e.twitterCards),t.cards)})}return e},selectors:a});Ee=Te,Ce=[me()(ye)],xe=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},Se={getState:Ee.getState,dispatch:function(){return xe.apply(void 0,arguments)}},we=Ce.map((function(e){return e(Se)})),xe=E.flowRight.apply(void 0,y()(we))(Ee.dispatch),Ee.dispatch=xe;var Pe=n(79),Ie=n(7),Me=n.n(Ie),Re=n(5),Be=n.n(Re),Le=function(e){B()(n,e);var t=D()(n);function n(){var e;P()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),Be()(Me()(e),"refreshConnectionClick",(function(t){var n=t.target,r=n.href,a=n.title;t.preventDefault();var o=window.open(r,a,""),c=window.setInterval((function(){!1!==o.closed&&(window.clearInterval(c),e.props.refreshConnections())}),500)})),e}return M()(n,[{key:"componentDidMount",value:function(){this.props.refreshConnections()}},{key:"renderRefreshableConnections",value:function(){var e=this,t=this.props.failedConnections.filter((function(e){return e.can_refresh}));return t.length?Object(o.createElement)(i.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},Object(o.createElement)("p",null,Object(c.__)("Before you hit Publish, please refresh the following connection(s) to make sure we can Publicize your post:","jetpack")),t.map((function(t){return Object(o.createElement)(i.Button,{href:t.refresh_url,isSmall:!0,key:t.id,onClick:e.refreshConnectionClick,title:t.refresh_text},t.refresh_text)}))):null}},{key:"renderNonRefreshableConnections",value:function(){var e=this.props.failedConnections.filter((function(e){return!e.can_refresh}));return e.length?e.map((function(e){return Object(o.createElement)(i.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},Object(o.createElement)("p",null,e.test_message))})):null}},{key:"render",value:function(){return Object(o.createElement)(o.Fragment,null,this.renderRefreshableConnections(),this.renderNonRefreshableConnections())}}]),n}(o.Component),De=Object(N.compose)([Object(u.withSelect)((function(e){return{failedConnections:e("jetpack/publicize").getFailedConnections()}})),Object(u.withDispatch)((function(e){return{refreshConnections:e("jetpack/publicize").refreshConnectionTestResults}}))])(Le),Fe=n(8),ze=n.n(Fe),Ue=n(45),Ve=function(e){B()(n,e);var t=D()(n);function n(){var e;P()(this,n);for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l];return e=t.call.apply(t,[this].concat(a)),Be()(Me()(e),"maybeDisplayLinkedInNotice",(function(){return e.connectionNeedsReauth()&&Object(o.createElement)(i.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},Object(o.createElement)("p",null,Object(c.__)("Your LinkedIn connection needs to be reauthenticated to continue working – head to Sharing to take care of it.","jetpack")),Object(o.createElement)(i.ExternalLink,{href:"https://wordpress.com/marketing/connections/".concat(Object(Ue.a)())},Object(c.__)("Go to Sharing settings","jetpack")))})),Be()(Me()(e),"connectionNeedsReauth",(function(){return Object(E.includes)(e.props.mustReauthConnections,e.props.name)})),Be()(Me()(e),"onConnectionChange",(function(){var t=e.props.id;e.props.toggleConnection(t)})),e}return M()(n,[{key:"connectionIsFailing",value:function(){var e=this.props,t=e.failedConnections,n=e.name;return t.some((function(e){return e.service_name===n}))}},{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.enabled,r=e.id,a=e.label,c=e.name,l="connection-"+c+"-"+r,s=c.replace("_","-"),u=Object(o.createElement)(i.FormToggle,{id:l,className:"jetpack-publicize-connection-toggle",checked:n,onChange:this.onConnectionChange});return(t||this.connectionIsFailing()||this.connectionNeedsReauth())&&(u=Object(o.createElement)(i.Disabled,null,u)),Object(o.createElement)("li",null,this.maybeDisplayLinkedInNotice(),Object(o.createElement)("div",{className:"publicize-jetpack-connection-container"},Object(o.createElement)("label",{htmlFor:l,className:"jetpack-publicize-connection-label"},Object(o.createElement)(F.i,{serviceName:s,className:"jetpack-publicize-gutenberg-social-icon"}),Object(o.createElement)("span",{className:"jetpack-publicize-connection-label-copy"},a)),u))}}]),n}(o.Component),Ge=Object(u.withSelect)((function(e){return{failedConnections:e("jetpack/publicize").getFailedConnections(),mustReauthConnections:e("jetpack/publicize").getMustReauthConnections()}}))(Ve),He=function(e){B()(n,e);var t=D()(n);function n(){var e;P()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),Be()(Me()(e),"settingsClick",(function(t){var n=e.getButtonLink(),r=e.props.refreshCallback;t.preventDefault();var a=window.open(n,"",""),o=window.setInterval((function(){!1!==a.closed&&(window.clearInterval(o),r())}),500)})),e}return M()(n,[{key:"getButtonLink",value:function(){var e=Object(Ue.a)();return e?"https://wordpress.com/marketing/connections/".concat(e):"options-general.php?page=sharing&publicize_popup=true"}},{key:"render",value:function(){var e=ze()("jetpack-publicize-add-connection-container",this.props.className);return Object(o.createElement)("div",{className:e},Object(o.createElement)(i.ExternalLink,{onClick:this.settingsClick},Object(c.__)("Connect an account","jetpack")))}}]),n}(o.Component),qe=function(e){B()(n,e);var t=D()(n);function n(){var e;P()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),Be()(Me()(e),"state",{hasEditedShareMessage:!1}),Be()(Me()(e),"fieldId",Object(E.uniqueId)("jetpack-publicize-message-field-")),Be()(Me()(e),"onMessageChange",(function(t){var n=e.props.messageChange;e.setState({hasEditedShareMessage:true}),n(t,true)})),e}return M()(n,[{key:"isDisabled",value:function(){return this.props.connections.every((function(e){return!e.toggleable}))}},{key:"render",value:function(){var e=this.props,t=e.connections,n=e.toggleConnection,r=e.refreshCallback,a=e.shareMessage,i=e.maxLength,l=i-a.length,s=ze()("jetpack-publicize-character-count",{"wpas-twitter-length-limit":l<=0});return Object(o.createElement)("div",{id:"publicize-form"},Object(o.createElement)("ul",{className:"jetpack-publicize__connections-list"},t.map((function(e){var t=e.display_name,r=e.enabled,a=e.id,c=e.service_name,i=e.toggleable;return Object(o.createElement)(Ge,{disabled:!i,enabled:r,key:a,id:a,label:t,name:c,toggleConnection:n})}))),Object(o.createElement)(He,{refreshCallback:r}),t.some((function(e){return e.enabled}))&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("label",{className:"jetpack-publicize-message-note",htmlFor:this.fieldId},Object(c.__)("Customize your message","jetpack")),Object(o.createElement)("div",{className:"jetpack-publicize-message-box"},Object(o.createElement)("textarea",{id:this.fieldId,value:a,onChange:this.onMessageChange,disabled:this.isDisabled(),maxLength:i,placeholder:Object(c.__)("Write a message for your audience here. If you leave this blank, we'll use an excerpt of the post content as the message.","jetpack"),rows:4}),Object(o.createElement)("div",{className:s},Object(c.sprintf)(Object(c._n)("%d character remaining","%d characters remaining",l,"jetpack"),l)))))}}]),n}(o.Component),We=Object(N.compose)([Object(u.withSelect)((function(e){return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),shareMessage:e("jetpack/publicize").getShareMessage(),maxLength:e("jetpack/publicize").getShareMessageMaxLength()}})),Object(u.withDispatch)((function(e,t){var n=t.connections;return{toggleConnection:function(t){var r=n.map((function(e){return k()(k()({},e),{},{enabled:e.id===t?!e.enabled:e.enabled})}));e("core/editor").editPost({jetpack_publicize_connections:r})},messageChange:function(t,n){e("core/editor").editPost({meta:{jetpack_publicize_message:t.target.value,jetpack_publicize_hasEditedShareMessage:n}})}}}))])(qe),$e=Object(N.compose)([Object(u.withSelect)((function(e){var t=e("jetpack/publicize"),n=t.isTweetStorm,r=t.getTweetStorm;return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),isTweetStorm:n(),tweetStormLength:r().length}})),Object(u.withDispatch)((function(e){return{setTweetstorm:function(t){e("core/editor").editPost({meta:{jetpack_is_tweetstorm:t}}),t?e("jetpack/publicize").refreshTweets():(e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm"),e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm-line-break"))}}}))])((function(e){var t=e.connections,n=e.isTweetStorm,r=e.tweetStormLength,a=e.setTweetstorm,l=e.prePublish;if(null==t||!t.some((function(e){return"twitter"===e.service_name&&e.enabled})))return null;var s=function(e,t){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("strong",null,e),Object(o.createElement)("br",null),t)},u=[];return r>=102?u.push({id:"jetpack-publicize-twitter-tweetstorm-too-long",status:"error",content:Object(c.__)("Only the first 100 tweets of this post will be published in the Twitter thread.","jetpack"),isDismissible:!1}):r>=22?u.push({id:"jetpack-publicize-twitter-tweetstorm-a-bit-long",status:"warning",content:Object(c.__)("This post will create a Twitter thread more than 20 tweets long.","jetpack"),isDismissible:!1}):l&&r<=2&&u.push({id:"jetpack-publicize-twitter-tweetstorm-too-short",status:"warning",content:Object(c.__)("None of the content in this post could be transformed into tweets, it may be better to share as a single tweet.","jetpack"),isDismissible:!1}),Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h3",{className:"jetpack-publicize-twitter-options__heading"},Object(c.__)("Twitter settings","jetpack")),Object(o.createElement)(i.RadioControl,{className:"jetpack-publicize-twitter-options__type",selected:n?"tweetstorm":"single",options:[{label:s(Object(c.__)("Single Tweet","jetpack"),Object(c.__)("Share a link to this post to Twitter.","jetpack")),value:"single"},{label:s(Object(c.__)("Twitter Thread","jetpack"),Object(c.__)("Share the content of this post as a Twitter thread.","jetpack")),value:"tweetstorm"}],onChange:function(e){a("tweetstorm"===e)}}),n&&Object(o.createElement)(i.NoticeList,{className:"jetpack-publicize-twitter-options__notices",notices:u}))})),Ke=Object(N.compose)([Object(u.withSelect)((function(e){return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections")}})),Object(u.withDispatch)((function(e){return{refreshConnections:e("core/editor").refreshPost}}))])((function(e){var t=e.connections,n=e.refreshConnections,r=e.prePublish;return Object(o.createElement)(o.Fragment,null,t&&t.some((function(e){return e.enabled}))&&Object(o.createElement)(De,null),Object(o.createElement)("div",null,Object(c.__)("Connect and select the accounts where you'd like to share your post.","jetpack")),t&&t.length>0&&Object(o.createElement)(We,{refreshCallback:n}),Object(o.createElement)($e,{prePublish:r}),t&&0===t.length&&Object(o.createElement)(He,{className:"jetpack-publicize-add-connection-wrapper",refreshCallback:n}))})),Ze={render:function(){return Object(o.createElement)(s.PostTypeSupportCheck,{supportKeys:"publicize"},Object(o.createElement)(H,null),Object(o.createElement)(Pe.a,null,Object(o.createElement)(i.PanelBody,{title:Object(c.__)("Share this post","jetpack")},Object(o.createElement)(Ke,null))),Object(o.createElement)(l.PluginPrePublishPanel,{initialOpen:!0,id:"publicize-title",title:Object(o.createElement)("span",{id:"publicize-defaults",key:"publicize-title-span"},Object(c.__)("Share this post","jetpack"))},Object(o.createElement)(Ke,{prePublish:!0})))}},Ye=n(69);Object(Ye.a)("publicize",Ze)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(27),c=n(36),i={url:{type:"string",validator:o.isUrl},selectedEpisodes:{type:"array",default:[]},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeTitle:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:c.a},hexPrimaryColor:{type:"string",validator:c.a},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:c.a},hexSecondaryColor:{type:"string",validator:c.a},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:c.a},hexBackgroundColor:{type:"string",validator:c.a},exampleFeedData:{type:"object"}},l={attributes:{url:{type:"string",validator:o.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:c.a},hexPrimaryColor:{type:"string",validator:c.a},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:c.a},hexSecondaryColor:{type:"string",validator:c.a},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:c.a},hexBackgroundColor:{type:"string",validator:c.a},exampleFeedData:{type:"object"}},supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:function(){return null}},s=n(5),u=n.n(s),p=n(4),d=n.n(p),m=n(34),b=n.n(m),h=n(9),f=n.n(h),g=n(0),j=n(67),v=n.n(j),O=n(3),k=n(2),_=n(17),y=n(6),E=n(10),w=n(11),C=n(43),x=(n(243),Object(g.createElement)(k.SVG,{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},Object(g.createElement)(k.G,null,Object(g.createElement)(k.Rect,{fill:"none",height:"24",width:"24"}),Object(g.createElement)(k.Rect,{fill:"none",height:"24",width:"24"}),Object(g.createElement)(k.Rect,{fill:"none",height:"24",width:"24"})),Object(g.createElement)(k.G,null,Object(g.createElement)(k.G,null),Object(g.createElement)(k.G,null,Object(g.createElement)(k.G,{transform:"matrix(1 0 0 1 144 120)"},Object(g.createElement)(k.Path,{d:"M-122-114h-5v8.18c-0.31-0.11-0.65-0.18-1-0.18c-1.66,0-3,1.34-3,3s1.34,3,3,3s3-1.34,3-3v-9h3V-114 L-122-114z M-129-114h-12v2h12V-114L-129-114z M-129-110h-12v2h12V-110L-129-110z M-133-106h-8v2h8V-106L-133-106z M-129-103 c0-0.55,0.45-1,1-1c0.55,0,1,0.45,1,1s-0.45,1-1,1C-128.55-102-129-102.45-129-103z"})))))),S=n(23),N=n(211),A=n(83),T=n(26),P=n.n(T),I="podcast-feed",M="embed-block",R=n(22),B=n.n(R),L=function(){var e=P()(regeneratorRuntime.mark((function e(t){var n,r,a,c,i,l,s,p,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url,r=t.guids,a=void 0===r?[]:r,c=t.fetchEpisodeOptions,i=void 0!==c&&c,e.prev=1,e.next=4,B()({path:Object(o.addQueryArgs)("/wpcom/v2/podcast-player",u()({url:n,guids:a},"episode-options",i))});case 4:l=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),s=e.t0;case 10:if(!l){e.next=12;break}return e.abrupt("return",{type:I,data:l});case 12:return e.prev=12,e.next=15,B()({path:Object(o.addQueryArgs)("/oembed/1.0/proxy",{url:n})});case 15:p=e.sent,e.next=20;break;case 18:e.prev=18,e.t1=e.catch(12);case 20:if(d='<a href="'+n+'">'+n+"</a>",!p||p.html===d){e.next=23;break}return e.abrupt("return",{type:M});case 23:throw s;case 24:case"end":return e.stop()}}),e,null,[[1,7],[12,18]])})));return function(_x){return e.apply(this,arguments)}}(),D="EDIT_URL",F="FINISH_EDITING",z="START_EDITING",U="SELECT_EPISODE",V="FEED_RECEIVED",G="CLEAR_FEED",H="MAKE_INTERACTIVE",q="PREVENT_INTERACTIONS",W="START_FETCH",$="CHECK_URL",K=function(e,t){switch(t.type){case D:return d()(d()({},e),{},{editedUrl:t.payload});case z:return d()(d()({},e),{},{isEditing:!0,isLoading:!1});case F:return d()(d()({},e),{},{editedUrl:t.payload,isEditing:!1});case V:return d()(d()({},e),{},{isLoading:!1,feedData:t.payload});case G:return d()(d()({},e),{},{feedData:{}});case H:return d()(d()({},e),{},{isInteractive:!0});case q:return d()(d()({},e),{},{isInteractive:!1});case W:return d()(d()({},e),{},{isLoading:!0});case U:return d()(d()({},e),{},{selectedGuid:t.payload});case $:return d()(d()({},e),{},{selectedGuid:null,feedData:{},checkUrl:t.payload});default:return d()({},e)}},Z=Object(k.withFallbackStyles)((function(e,t){var n=t.textColor,r=t.backgroundColor,a=r&&r.color,o=n&&n.color;return{fallbackBackgroundColor:a||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:o||!e?void 0:getComputedStyle(e).color}})),Y=n(64),J=v()("jetpack:podcast-player:edit"),X=Object(S.c)()||Object(S.a)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",Q=Object(_.compose)([Object(E.withDispatch)((function(e,t){var n=t.clientId,r=t.attributes;return{replaceWithEmbedBlock:function(){e("core/block-editor").replaceBlock(n,Object(w.createBlock)("core/embed",{url:r.url}))}}})),Object(y.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),k.withNotices,_.withInstanceId,Z])((function(e){var t,n,r=e.instanceId,c=e.className,l=e.attributes,s=e.setAttributes,p=e.noticeOperations,m=p.createErrorNotice,h=p.removeAllNotices,j=e.noticeUI,v=e.primaryColor,_=e.setPrimaryColor,E=e.secondaryColor,w=e.setSecondaryColor,S=e.fallbackTextColor,T=e.backgroundColor,P=e.setBackgroundColor,R=e.fallbackBackgroundColor,B=e.isSelected,Z=e.replaceWithEmbedBlock,Q=Object(C.a)(i,l),ee=Q.url,te=Q.selectedEpisodes,ne=Q.itemsToShow,re=Q.showCoverArt,ae=Q.showEpisodeTitle,oe=Q.showEpisodeDescription,ce=Q.exampleFeedData,ie="jetpack-podcast-player-block-".concat(r),le=Object(g.useState)(!1),se=f()(le,2),ue=se[0],pe=se[1],de=Object(g.useRef)(),me=Object(g.useReducer)(K,{editedUrl:ee||"",isEditing:!ee&&!ce,isLoading:!1,feedData:ce||{},isInteractive:!1,selectedGuid:null==te||null===(t=te[0])||void 0===t?void 0:t.guid,checkUrl:ee||""}),be=f()(me,2),he=be[0],fe=he.selectedGuid,ge=he.checkUrl,je=b()(he,["selectedGuid","checkUrl"]),ve=be[1],Oe=Object(g.useMemo)((function(){return Object(O.debounce)((function(e){var t;ve({type:W}),null===(t=de.current)||void 0===t||t.cancel(),de.current=Object(A.c)(L(d()(d()({},e),{},{fetchEpisodeOptions:!0}))),de.current.promise.then((function(t){if(h(),null!=t&&t.isCanceled)J("Block was unmounted during fetch",t);else switch(null==t?void 0:t.type){case I:return s({url:e.url,selectedEpisodes:e.guids.map((function(e){return{guid:e}}))}),ve({type:V,payload:t.data});case M:return Z()}}),(function(e){null!=e&&e.isCanceled?J("Block was unmounted during fetch",e):(J("feed error",e),h(),m(e.message||Object(a.__)("Your podcast couldn't be embedded. Please double check your URL.","jetpack")),ve({type:z}))}))}),300)}),[Z,s,m,h]);Object(g.useEffect)((function(){return function(){var e,t;null==de||null===(e=de.current)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e)}}),[]);var ke=Object(g.useCallback)((function(e){null===e||ue||(Object(Y.c)(["link#mediaelement-css","link#wp-mediaelement-css"],e),pe(!0))}),[ue]);Object(g.useEffect)((function(){if(""!==ge)return Oe({url:ge,guids:fe?[fe]:[]}),function(){var e,t;return null==de||null===(e=de.current)||void 0===e||null===(t=e.cancel)||void 0===t?void 0:t.call(e)}}),[Oe,ge,fe]),Object(g.useEffect)((function(){fe&&1!==ne&&s({itemsToShow:1})}),[fe,ne,s]),Object(g.useEffect)((function(){!B&&je.isInteractive&&ve({type:q})}),[B,je.isInteractive]);if(je.isEditing)return Object(g.createElement)(k.Placeholder,{icon:Object(g.createElement)(y.BlockIcon,{icon:x}),label:Object(a.__)("Podcast Player","jetpack"),instructions:Object(a.__)("Enter your podcast RSS feed URL.","jetpack"),className:"jetpack-podcast-player__placeholder"},Object(g.createElement)("form",{onSubmit:function(e){if(e.preventDefault(),""!==je.editedUrl){var t,n=Object(o.prependHTTP)(je.editedUrl);if(Object(o.isURL)(n))n===ge?(ve({type:G}),Oe({url:ge,guids:null!==(t=te[0])&&void 0!==t&&t.guid?[te[0].guid]:[]})):ve({type:$,payload:n}),ve({type:F,payload:n});else m(Object(a.__)("Your podcast couldn't be embedded. Please double check your URL.","jetpack"))}}},j,Object(g.createElement)(k.TextControl,{type:"text",inputMode:"url",placeholder:Object(a.__)("Enter URL here…","jetpack"),value:je.editedUrl,className:"components-placeholder__input",onChange:function(e){return ve({type:D,payload:e})}}),Object(g.createElement)(k.Button,{isPrimary:!0,type:"submit"},Object(a.__)("Embed","jetpack"))),Object(g.createElement)("div",{className:"components-placeholder__learn-more"},Object(g.createElement)(k.ExternalLink,{href:X},Object(a.__)("Learn more about embeds","jetpack"))));if(null===(n=je.feedData.tracks)||void 0===n||!n.length)return Object(g.createElement)(k.Placeholder,{icon:Object(g.createElement)(y.BlockIcon,{icon:x}),label:Object(a.__)("Podcast Player","jetpack"),instructions:Object(a.__)("Loading podcast feed…","jetpack")},Object(g.createElement)(k.Spinner,null));var _e=function(e,t){return function(n){s(u()({},e,n)),t(n)}};return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(y.BlockControls,null,Object(g.createElement)(k.ToolbarGroup,null,Object(g.createElement)(k.ToolbarButton,{"aria-label":Object(a.__)("Edit Podcast Feed URL","jetpack"),onClick:function(){return ve({type:z})}},Object(a.__)("Replace","jetpack")))),Object(g.createElement)(y.InspectorControls,null,Object(g.createElement)(k.PanelBody,{title:Object(a.__)("Podcast settings","jetpack")},(k.ComboboxControl||0===te.length)&&Object(g.createElement)(k.RangeControl,{label:Object(a.__)("Number of items","jetpack"),value:ne,onChange:function(e){return s({itemsToShow:fe?1:e})},min:1,max:10,required:!0,disabled:!!fe}),k.ComboboxControl&&Object(g.createElement)(k.ComboboxControl,{className:"jetpack-podcast-player__episode-selector",value:fe,onChange:function(e){return ve({type:U,payload:e})},options:je.feedData.options||[],label:Object(a.__)("Episode","jetpack"),onFilterValueChange:O.noop}),Object(g.createElement)(k.ToggleControl,{label:Object(a.__)("Show Cover Art","jetpack"),checked:re,onChange:function(e){return s({showCoverArt:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(a.__)("Show Episode Title","jetpack"),checked:ae,onChange:function(e){return s({showEpisodeTitle:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(a.__)("Show Episode Description","jetpack"),checked:oe,onChange:function(e){return s({showEpisodeDescription:e})}})),Object(g.createElement)(y.PanelColorSettings,{title:Object(a.__)("Color Settings","jetpack"),colorSettings:[{value:v.color,onChange:_e("hexPrimaryColor",_),label:Object(a.__)("Primary Color","jetpack")},{value:E.color,onChange:_e("hexSecondaryColor",w),label:Object(a.__)("Secondary Color","jetpack")},{value:T.color,onChange:_e("hexBackgroundColor",P),label:Object(a.__)("Background Color","jetpack")}]},Object(g.createElement)(y.ContrastChecker,{isLargeText:!1,textColor:E.color,backgroundColor:T.color,fallbackBackgroundColor:R,fallbackTextColor:S}))),Object(g.createElement)("div",{id:ie,className:c,ref:ke},Object(g.createElement)(N.a,{playerId:ie,attributes:Q,tracks:je.feedData.tracks,cover:je.feedData.cover,title:je.feedData.title,link:je.feedData.link}),!je.isInteractive&&!je.isLoading&&Object(g.createElement)("div",{className:"jetpack-podcast-player__interactive-overlay",onMouseUp:function(){return ve({type:H})}}),je.isLoading&&Object(g.createElement)("div",{className:"jetpack-podcast-player__loading-overlay"},Object(g.createElement)(k.Spinner,null))))}));var ee=n(16),te=(n(366),"podcast-player"),ne=("jetpack/".concat(te),{title:Object(a.__)("Podcast Player","jetpack"),description:Object(a.__)("Select and play episodes from a single podcast.","jetpack"),icon:{src:x,foreground:Object(ee.a)()},category:"embed",keywords:[Object(a._x)("audio","block search term","jetpack"),Object(a._x)("embed","block search term","jetpack")],supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},edit:Q,save:function(e){var t=e.attributes.url;if(t&&""!==t)return Object(g.createElement)("a",{className:"jetpack-podcast-player__direct-link",href:t},t)},attributes:i,example:{attributes:{customPrimaryColor:Object(ee.a)(),hexPrimaryColor:Object(ee.a)(),exampleFeedData:{title:Object(a.__)("Jetpack Example Podcast","jetpack"),link:"https://jetpack.com",cover:"https://jetpackme.files.wordpress.com/2020/05/jetpack-example-podcast-cover.png?w=160",tracks:[{id:"3",title:Object(a.__)("3. Our third episode","jetpack"),duration:"14:58"},{id:"2",title:Object(a.__)("2. Interview with a special guest","jetpack"),duration:"19:17"},{id:"1",title:Object(a.__)("1. Welcome to Example Podcast","jetpack"),duration:"11:25"}]}}},deprecated:[l]});Object(r.a)(te,ne)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(6),i=n(2);var l=n(16),s=Object(a.createElement)(i.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(a.createElement)(i.Path,{fill:Object(l.a)(),d:"M24,11.6909333 C24,18.1477333 18.7256,23.3818667 12.2181333,23.3818667 C10.1522667,23.3818667 8.21146667,22.8538667 6.52293333,21.9272 L0,24 L2.12666667,17.7274667 C1.05386667,15.9658667 0.436,13.8997333 0.436,11.6909333 C0.436,5.23413333 5.71093333,0 12.2181333,0 C18.7261333,0 24,5.23413333 24,11.6909333 Z M12.2181333,1.86186667 C6.75573333,1.86186667 2.31253333,6.2712 2.31253333,11.6909333 C2.31253333,13.8416 3.0136,15.8333333 4.19946667,17.4536 L2.96186667,21.104 L6.76853333,19.8941333 C8.33253333,20.9210667 10.2061333,21.52 12.2184,21.52 C17.68,21.52 22.124,17.1112 22.124,11.6914667 C22.124,6.27173333 17.6802667,1.86186667 12.2181333,1.86186667 Z M18.1677333,14.3834667 C18.0949333,14.2642667 17.9026667,14.1922667 17.6141333,14.0490667 C17.3250667,13.9058667 15.9048,13.2122667 15.6408,13.1170667 C15.376,13.0216 15.1829333,12.9736 14.9906667,13.2602667 C14.7984,13.5472 14.2448,14.1922667 14.076,14.3834667 C13.9074667,14.5752 13.7392,14.5992 13.4501333,14.4557333 C13.1616,14.3125333 12.2312,14.0096 11.128,13.0336 C10.2696,12.2741333 9.68986667,11.3365333 9.52133333,11.0493333 C9.35306667,10.7626667 9.50373333,10.6077333 9.648,10.4650667 C9.77813333,10.3365333 9.93706667,10.1304 10.0813333,9.9632 C10.2261333,9.79573333 10.2741333,9.67653333 10.3698667,9.48506667 C10.4666667,9.29386667 10.4184,9.12666667 10.3458667,8.98293333 C10.2738667,8.83973333 9.69573333,7.4296 9.4552,6.85573333 C9.21466667,6.2824 8.9744,6.37786667 8.8056,6.37786667 C8.63733333,6.37786667 8.44453333,6.35386667 8.252,6.35386667 C8.05946667,6.35386667 7.7464,6.4256 7.4816,6.71226667 C7.21706667,6.9992 6.4712,7.69253333 6.4712,9.1024 C6.4712,10.5125333 7.5056,11.8749333 7.6504,12.0658667 C7.79466667,12.2568 9.64773333,15.2445333 12.5837333,16.392 C15.52,17.5389333 15.52,17.1562667 16.0496,17.1082667 C16.5786667,17.0605333 17.7578667,16.4152 17.9994667,15.7464 C18.2394667,15.0765333 18.2394667,14.5029333 18.1677333,14.3834667 Z"})),u=n(121),p=[{isDefault:!0,name:"whatsapp-button",title:Object(o.__)("WhatsApp Button","jetpack"),description:Object(o.__)("Let your visitors send you messages on WhatsApp with the tap of a button.","jetpack"),icon:Object(u.b)("send-a-message",s),innerBlocks:[["jetpack/whatsapp-button",{}]]}],d=n(25),m=(n(412),{title:Object(o.__)("Send A Message","jetpack"),description:Object(o.__)("Let your visitors send you messages with the tap of a button.","jetpack"),icon:{src:Object(d.a)(Object(a.createElement)(i.Path,{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"})),foreground:Object(l.a)()},category:"grow",keywords:[Object(o._x)("whatsapp","keyword","jetpack"),Object(o._x)("messenger","keyword","jetpack"),Object(o._x)("contact","keyword","jetpack"),Object(o._x)("support","keyword","jetpack")],supports:{html:!1},attributes:{},edit:function(e){var t=e.className;return Object(a.createElement)("div",{className:t},Object(a.createElement)(c.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]}))},save:function(e){return Object(a.createElement)("div",{className:e.className},Object(a.createElement)(c.InnerBlocks.Content,null))},variations:p,example:{}}),b={countryCode:{type:"string"},phoneNumber:{type:"string"},firstMessage:{type:"string",default:Object(o.__)("Hi, I got your WhatsApp information from your website.","jetpack")},buttonText:{type:"array",source:"children",selector:"a.whatsapp-block__button",default:Object(o.__)("Chat on WhatsApp","jetpack")},backgroundColor:{type:"string",default:"#25D366"},colorClass:{type:"string",default:"dark"},openInNewTab:{type:"boolean",default:!1}},h=n(26),f=n.n(h),g=n(8),j=n.n(g),v=n(10),O=[{code:"US",label:"🇺🇸 +1",value:"1US"},{code:"CA",label:"🇨🇦 +1",value:"1CA"},{code:"BS",label:"🇧🇸 +1242",value:"1242BS"},{code:"BB",label:"🇧🇧 +1246",value:"1246BB"},{code:"AI",label:"🇦🇮 +1264",value:"1264AI"},{code:"AG",label:"🇦🇬 +1268",value:"1268AG"},{code:"VG",label:"🇻🇬 +1284",value:"1284VG"},{code:"VI",label:"🇻🇮 +1340",value:"1340VI"},{code:"BM",label:"🇧🇲 +1441",value:"1441BM"},{code:"GD",label:"🇬🇩 +1473",value:"1473GD"},{code:"TC",label:"🇹🇨 +1649",value:"1649TC"},{code:"MS",label:"🇲🇸 +1664",value:"1664MS"},{code:"MP",label:"🇲🇵 +1670",value:"1670MP"},{code:"GU",label:"🇬🇺 +1671",value:"1671GU"},{code:"AS",label:"🇦🇸 +1684",value:"1684AS"},{code:"LC",label:"🇱🇨 +1758",value:"1758LC"},{code:"DM",label:"🇩🇲 +1767",value:"1767DM"},{code:"VC",label:"🇻🇨 +1784",value:"1784VC"},{code:"DO",label:"🇩🇴 +1849",value:"1849DO"},{code:"TT",label:"🇹🇹 +1868",value:"1868TT"},{code:"KN",label:"🇰🇳 +1869",value:"1869KN"},{code:"JM",label:"🇯🇲 +1876",value:"1876JM"},{code:"PR",label:"🇵🇷 +1939",value:"1939PR"},{code:"EG",label:"🇪🇬 +20",value:"20EG"},{code:"MA",label:"🇲🇦 +212",value:"212MA"},{code:"DZ",label:"🇩🇿 +213",value:"213DZ"},{code:"TN",label:"🇹🇳 +216",value:"216TN"},{code:"LY",label:"🇱🇾 +218",value:"218LY"},{code:"GM",label:"🇬🇲 +220",value:"220GM"},{code:"SN",label:"🇸🇳 +221",value:"221SN"},{code:"MR",label:"🇲🇷 +222",value:"222MR"},{code:"ML",label:"🇲🇱 +223",value:"223ML"},{code:"GN",label:"🇬🇳 +224",value:"224GN"},{code:"CI",label:"🇨🇮 +225",value:"225CI"},{code:"BF",label:"🇧🇫 +226",value:"226BF"},{code:"NE",label:"🇳🇪 +227",value:"227NE"},{code:"TG",label:"🇹🇬 +228",value:"228TG"},{code:"BJ",label:"🇧🇯 +229",value:"229BJ"},{code:"MU",label:"🇲🇺 +230",value:"230MU"},{code:"LR",label:"🇱🇷 +231",value:"231LR"},{code:"SL",label:"🇸🇱 +232",value:"232SL"},{code:"GH",label:"🇬🇭 +233",value:"233GH"},{code:"NG",label:"🇳🇬 +234",value:"234NG"},{code:"TD",label:"🇹🇩 +235",value:"235TD"},{code:"CF",label:"🇨🇫 +236",value:"236CF"},{code:"CM",label:"🇨🇲 +237",value:"237CM"},{code:"CV",label:"🇨🇻 +238",value:"238CV"},{code:"ST",label:"🇸🇹 +239",value:"239ST"},{code:"GQ",label:"🇬🇶 +240",value:"240GQ"},{code:"GA",label:"🇬🇦 +241",value:"241GA"},{code:"CG",label:"🇨🇬 +242",value:"242CG"},{code:"CD",label:"🇨🇩 +243",value:"243CD"},{code:"AO",label:"🇦🇴 +244",value:"244AO"},{code:"GW",label:"🇬🇼 +245",value:"245GW"},{code:"IO",label:"🇮🇴 +246",value:"246IO"},{code:"SC",label:"🇸🇨 +248",value:"248SC"},{code:"SD",label:"🇸🇩 +249",value:"249SD"},{code:"RW",label:"🇷🇼 +250",value:"250RW"},{code:"ET",label:"🇪🇹 +251",value:"251ET"},{code:"SO",label:"🇸🇴 +252",value:"252SO"},{code:"DJ",label:"🇩🇯 +253",value:"253DJ"},{code:"KE",label:"🇰🇪 +254",value:"254KE"},{code:"TZ",label:"🇹🇿 +255",value:"255TZ"},{code:"UG",label:"🇺🇬 +256",value:"256UG"},{code:"BI",label:"🇧🇮 +257",value:"257BI"},{code:"MZ",label:"🇲🇿 +258",value:"258MZ"},{code:"ZM",label:"🇿🇲 +260",value:"260ZM"},{code:"MG",label:"🇲🇬 +261",value:"261MG"},{code:"YT",label:"🇾🇹 +262",value:"262YT"},{code:"RE",label:"🇷🇪 +262",value:"262RE"},{code:"ZW",label:"🇿🇼 +263",value:"263ZW"},{code:"NA",label:"🇳🇦 +264",value:"264NA"},{code:"MW",label:"🇲🇼 +265",value:"265MW"},{code:"LS",label:"🇱🇸 +266",value:"266LS"},{code:"BW",label:"🇧🇼 +267",value:"267BW"},{code:"SZ",label:"🇸🇿 +268",value:"268SZ"},{code:"KM",label:"🇰🇲 +269",value:"269KM"},{code:"ZA",label:"🇿🇦 +27",value:"27ZA"},{code:"SH",label:"🇸🇭 +290",value:"290SH"},{code:"ER",label:"🇪🇷 +291",value:"291ER"},{code:"AW",label:"🇦🇼 +297",value:"297AW"},{code:"FO",label:"🇫🇴 +298",value:"298FO"},{code:"GL",label:"🇬🇱 +299",value:"299GL"},{code:"GR",label:"🇬🇷 +30",value:"30GR"},{code:"NL",label:"🇳🇱 +31",value:"31NL"},{code:"BE",label:"🇧🇪 +32",value:"32BE"},{code:"FR",label:"🇫🇷 +33",value:"33FR"},{code:"ES",label:"🇪🇸 +34",value:"34ES"},{code:"KY",label:"🇰🇾 +345",value:"345KY"},{code:"GI",label:"🇬🇮 +350",value:"350GI"},{code:"PT",label:"🇵🇹 +351",value:"351PT"},{code:"LU",label:"🇱🇺 +352",value:"352LU"},{code:"IE",label:"🇮🇪 +353",value:"353IE"},{code:"IS",label:"🇮🇸 +354",value:"354IS"},{code:"AL",label:"🇦🇱 +355",value:"355AL"},{code:"MT",label:"🇲🇹 +356",value:"356MT"},{code:"FI",label:"🇫🇮 +358",value:"358FI"},{code:"BG",label:"🇧🇬 +359",value:"359BG"},{code:"HU",label:"🇭🇺 +36",value:"36HU"},{code:"LT",label:"🇱🇹 +370",value:"370LT"},{code:"LV",label:"🇱🇻 +371",value:"371LV"},{code:"EE",label:"🇪🇪 +372",value:"372EE"},{code:"MD",label:"🇲🇩 +373",value:"373MD"},{code:"AM",label:"🇦🇲 +374",value:"374AM"},{code:"BY",label:"🇧🇾 +375",value:"375BY"},{code:"AD",label:"🇦🇩 +376",value:"376AD"},{code:"MC",label:"🇲🇨 +377",value:"377MC"},{code:"SM",label:"🇸🇲 +378",value:"378SM"},{code:"VA",label:"🇻🇦 +379",value:"379VA"},{code:"UA",label:"🇺🇦 +380",value:"380UA"},{code:"RS",label:"🇷🇸 +381",value:"381RS"},{code:"ME",label:"🇲🇪 +382",value:"382ME"},{code:"XK",label:"🇽🇰 +383",value:"383XK"},{code:"HR",label:"🇭🇷 +385",value:"385HR"},{code:"SI",label:"🇸🇮 +386",value:"386SI"},{code:"BA",label:"🇧🇦 +387",value:"387BA"},{code:"MK",label:"🇲🇰 +389",value:"389MK"},{code:"IT",label:"🇮🇹 +39",value:"39IT"},{code:"RO",label:"🇷🇴 +40",value:"40RO"},{code:"CH",label:"🇨🇭 +41",value:"41CH"},{code:"CZ",label:"🇨🇿 +420",value:"420CZ"},{code:"SK",label:"🇸🇰 +421",value:"421SK"},{code:"LI",label:"🇱🇮 +423",value:"423LI"},{code:"AT",label:"🇦🇹 +43",value:"43AT"},{code:"IM",label:"🇮🇲 +44",value:"44IM"},{code:"GG",label:"🇬🇬 +44",value:"44GG"},{code:"JE",label:"🇯🇪 +44",value:"44JE"},{code:"GB",label:"🇬🇧 +44",value:"44GB"},{code:"DK",label:"🇩🇰 +45",value:"45DK"},{code:"SE",label:"🇸🇪 +46",value:"46SE"},{code:"NO",label:"🇳🇴 +47",value:"47NO"},{code:"SJ",label:"🇸🇯 +47",value:"47SJ"},{code:"PL",label:"🇵🇱 +48",value:"48PL"},{code:"DE",label:"🇩🇪 +49",value:"49DE"},{code:"FK",label:"🇫🇰 +500",value:"500FK"},{code:"GS",label:"🇬🇸 +500",value:"500GS"},{code:"BZ",label:"🇧🇿 +501",value:"501BZ"},{code:"GT",label:"🇬🇹 +502",value:"502GT"},{code:"SV",label:"🇸🇻 +503",value:"503SV"},{code:"HN",label:"🇭🇳 +504",value:"504HN"},{code:"NI",label:"🇳🇮 +505",value:"505NI"},{code:"CR",label:"🇨🇷 +506",value:"506CR"},{code:"PA",label:"🇵🇦 +507",value:"507PA"},{code:"PM",label:"🇵🇲 +508",value:"508PM"},{code:"HT",label:"🇭🇹 +509",value:"509HT"},{code:"PE",label:"🇵🇪 +51",value:"51PE"},{code:"MX",label:"🇲🇽 +52",value:"52MX"},{code:"CU",label:"🇨🇺 +53",value:"53CU"},{code:"CY",label:"🇨🇾 +537",value:"537CY"},{code:"AR",label:"🇦🇷 +54",value:"54AR"},{code:"BR",label:"🇧🇷 +55",value:"55BR"},{code:"CL",label:"🇨🇱 +56",value:"56CL"},{code:"CO",label:"🇨🇴 +57",value:"57CO"},{code:"VE",label:"🇻🇪 +58",value:"58VE"},{code:"BL",label:"🇧🇱 +590",value:"590BL"},{code:"MF",label:"🇲🇫 +590",value:"590MF"},{code:"GP",label:"🇬🇵 +590",value:"590GP"},{code:"BO",label:"🇧🇴 +591",value:"591BO"},{code:"GY",label:"🇬🇾 +592",value:"592GY"},{code:"EC",label:"🇪🇨 +593",value:"593EC"},{code:"GF",label:"🇬🇫 +594",value:"594GF"},{code:"PY",label:"🇵🇾 +595",value:"595PY"},{code:"MQ",label:"🇲🇶 +596",value:"596MQ"},{code:"SR",label:"🇸🇷 +597",value:"597SR"},{code:"UY",label:"🇺🇾 +598",value:"598UY"},{code:"MY",label:"🇲🇾 +60",value:"60MY"},{code:"CC",label:"🇨🇨 +61",value:"61CC"},{code:"AU",label:"🇦🇺 +61",value:"61AU"},{code:"CX",label:"🇨🇽 +61",value:"61CX"},{code:"ID",label:"🇮🇩 +62",value:"62ID"},{code:"PH",label:"🇵🇭 +63",value:"63PH"},{code:"NZ",label:"🇳🇿 +64",value:"64NZ"},{code:"SG",label:"🇸🇬 +65",value:"65SG"},{code:"TH",label:"🇹🇭 +66",value:"66TH"},{code:"TL",label:"🇹🇱 +670",value:"670TL"},{code:"NF",label:"🇳🇫 +672",value:"672NF"},{code:"BN",label:"🇧🇳 +673",value:"673BN"},{code:"NR",label:"🇳🇷 +674",value:"674NR"},{code:"PG",label:"🇵🇬 +675",value:"675PG"},{code:"TO",label:"🇹🇴 +676",value:"676TO"},{code:"SB",label:"🇸🇧 +677",value:"677SB"},{code:"VU",label:"🇻🇺 +678",value:"678VU"},{code:"FJ",label:"🇫🇯 +679",value:"679FJ"},{code:"PW",label:"🇵🇼 +680",value:"680PW"},{code:"WF",label:"🇼🇫 +681",value:"681WF"},{code:"CK",label:"🇨🇰 +682",value:"682CK"},{code:"NU",label:"🇳🇺 +683",value:"683NU"},{code:"WS",label:"🇼🇸 +685",value:"685WS"},{code:"KI",label:"🇰🇮 +686",value:"686KI"},{code:"NC",label:"🇳🇨 +687",value:"687NC"},{code:"TV",label:"🇹🇻 +688",value:"688TV"},{code:"PF",label:"🇵🇫 +689",value:"689PF"},{code:"TK",label:"🇹🇰 +690",value:"690TK"},{code:"FM",label:"🇫🇲 +691",value:"691FM"},{code:"MH",label:"🇲🇭 +692",value:"692MH"},{code:"RU",label:"🇷🇺 +7",value:"7RU"},{code:"KZ",label:"🇰🇿 +77",value:"77KZ"},{code:"JP",label:"🇯🇵 +81",value:"81JP"},{code:"KR",label:"🇰🇷 +82",value:"82KR"},{code:"VN",label:"🇻🇳 +84",value:"84VN"},{code:"KP",label:"🇰🇵 +850",value:"850KP"},{code:"HK",label:"🇭🇰 +852",value:"852HK"},{code:"MO",label:"🇲🇴 +853",value:"853MO"},{code:"KH",label:"🇰🇭 +855",value:"855KH"},{code:"LA",label:"🇱🇦 +856",value:"856LA"},{code:"CN",label:"🇨🇳 +86",value:"86CN"},{code:"PN",label:"🇵🇳 +872",value:"872PN"},{code:"BD",label:"🇧🇩 +880",value:"880BD"},{code:"TW",label:"🇹🇼 +886",value:"886TW"},{code:"TR",label:"🇹🇷 +90",value:"90TR"},{code:"IN",label:"🇮🇳 +91",value:"91IN"},{code:"PK",label:"🇵🇰 +92",value:"92PK"},{code:"AF",label:"🇦🇫 +93",value:"93AF"},{code:"LK",label:"🇱🇰 +94",value:"94LK"},{code:"MM",label:"🇲🇲 +95",value:"95MM"},{code:"MV",label:"🇲🇻 +960",value:"960MV"},{code:"LB",label:"🇱🇧 +961",value:"961LB"},{code:"JO",label:"🇯🇴 +962",value:"962JO"},{code:"SY",label:"🇸🇾 +963",value:"963SY"},{code:"IQ",label:"🇮🇶 +964",value:"964IQ"},{code:"KW",label:"🇰🇼 +965",value:"965KW"},{code:"SA",label:"🇸🇦 +966",value:"966SA"},{code:"YE",label:"🇾🇪 +967",value:"967YE"},{code:"OM",label:"🇴🇲 +968",value:"968OM"},{code:"PS",label:"🇵🇸 +970",value:"970PS"},{code:"AE",label:"🇦🇪 +971",value:"971AE"},{code:"IL",label:"🇮🇱 +972",value:"972IL"},{code:"BH",label:"🇧🇭 +973",value:"973BH"},{code:"QA",label:"🇶🇦 +974",value:"974QA"},{code:"BT",label:"🇧🇹 +975",value:"975BT"},{code:"MN",label:"🇲🇳 +976",value:"976MN"},{code:"NP",label:"🇳🇵 +977",value:"977NP"},{code:"IR",label:"🇮🇷 +98",value:"98IR"},{code:"TJ",label:"🇹🇯 +992",value:"992TJ"},{code:"TM",label:"🇹🇲 +993",value:"993TM"},{code:"AZ",label:"🇦🇿 +994",value:"994AZ"},{code:"GE",label:"🇬🇪 +995",value:"995GE"},{code:"KG",label:"🇰🇬 +996",value:"996KG"},{code:"UZ",label:"🇺🇿 +998",value:"998UZ"}],k=n(9),_=n.n(k),y=n(24),E=n(50),w="#25D366",C="#465B64";function x(e){var t=e.attributes,n=e.setAttributes,r=e.context,l=t.countryCode,s=t.phoneNumber,u=t.firstMessage,p=t.openInNewTab,m=t.backgroundColor,b=Object(a.useState)(!0),h=_()(b,2),f=h[0],g=h[1],j=function(){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.BaseControl,{label:Object(o.__)("Phone Number","jetpack"),help:Object(o.__)("Enter the phone number you use for WhatsApp and would like to be contacted on.","jetpack"),className:"jetpack-whatsapp-button__phonenumber"},Object(a.createElement)(i.SelectControl,{label:Object(o.__)("Country code","jetpack"),value:l,onChange:function(e){return n({countryCode:e})},options:O,hideLabelFromVision:!0}),Object(a.createElement)(i.TextControl,{placeholder:Object(o.__)("Your phone number…","jetpack"),onChange:function(e){n({phoneNumber:e}),0===e.length&&g(!0),e.length>2&&g(function(e){var t=RegExp(/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/,"g");return!(void 0===e||e.length<1)&&t.test(l.replace(/\D/g,"")+e)}(e))},value:s}),!f&&Object(a.createElement)(E.a,{isError:!0,className:"jetpack-whatsapp-error"},Object(o.__)("Please enter a valid phone number.","jetpack"))),"inspector"===r&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.TextareaControl,{label:Object(o.__)("Default First Message","jetpack"),help:Object(o.__)("The default first message that will be sent by visitors when using this button.","jetpack"),value:u,onChange:function(e){return n({firstMessage:e})}}),Object(a.createElement)(i.ToggleControl,{label:Object(o.__)("Open in new tab","jetpack"),checked:p,onChange:function(e){return n({openInNewTab:e})},help:Object(o.__)("When the button is tapped, should a new tab be opened if the visitor does not have WhatsApp installed?","jetpack")})))};return"toolbar"===r?Object(a.createElement)(i.ToolbarGroup,null,Object(a.createElement)(i.Dropdown,{position:"bottom right",className:"jetpack-whatsapp-button-settings-selector",contentClassName:"jetpack-whatsapp-button__popover",renderToggle:function(e){return function(e,t){return Object(a.createElement)(i.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:Object(o.__)("WhatsApp Button Settings","jetpack"),onClick:t,onKeyDown:function(n){e||n.keyCode!==y.DOWN||(n.preventDefault(),n.stopPropagation(),t())},icon:Object(d.a)(Object(a.createElement)(i.Path,{d:"M10.82 12.49c.02-.16.04-.32.04-.49 0-.17-.02-.33-.04-.49l1.08-.82c.1-.07.12-.21.06-.32l-1.03-1.73c-.06-.11-.2-.15-.31-.11l-1.28.5c-.27-.2-.56-.36-.87-.49l-.2-1.33c0-.12-.11-.21-.24-.21H5.98c-.13 0-.24.09-.26.21l-.2 1.32c-.31.12-.6.3-.87.49l-1.28-.5c-.12-.05-.25 0-.31.11l-1.03 1.73c-.06.12-.03.25.07.33l1.08.82c-.02.16-.03.33-.03.49 0 .17.02.33.04.49l-1.09.83c-.1.07-.12.21-.06.32l1.03 1.73c.06.11.2.15.31.11l1.28-.5c.27.2.56.36.87.49l.2 1.32c.01.12.12.21.25.21h2.06c.13 0 .24-.09.25-.21l.2-1.32c.31-.12.6-.3.87-.49l1.28.5c.12.05.25 0 .31-.11l1.03-1.73c.06-.11.04-.24-.06-.32l-1.1-.83zM7 13.75c-.99 0-1.8-.78-1.8-1.75s.81-1.75 1.8-1.75 1.8.78 1.8 1.75S8 13.75 7 13.75zM18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"}))})}(e.isOpen,e.onToggle)},renderContent:j})):Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.PanelBody,{title:Object(o.__)("WhatsApp Button Settings","jetpack"),initialOpen:!0},j()),Object(a.createElement)(c.PanelColorSettings,{title:Object(o.__)("Color Settings","jetpack"),initialOpen:!1,colorSettings:[{value:m,onChange:function(e){return function(e){if(n({backgroundColor:e}),void 0===e||e===w||e===C)return n({colorClass:"dark"});n({colorClass:"light"})}(e)},label:Object(o.__)("Background Color","jetpack"),disableCustomColors:!0,colors:[{name:Object(o._x)("WhatsApp Green","background color name","jetpack"),slug:"whatsapp-green",color:w},{name:Object(o._x)("WhatsApp Dark","background color name","jetpack"),slug:"whatsapp-dark",color:C},{name:Object(o._x)("WhatsApp Light","background color name","jetpack"),slug:"whatsapp-light",color:"#F4F4F4"},{name:Object(o._x)("White","background color name","jetpack"),slug:"whatsapp-white",color:"#FFFFFF"}]}]}))}n(372);var S={attributes:b,supports:{html:!1,reusable:!1},save:function(e){var t,n=e.attributes,r=e.className,o=n.countryCode,i=n.phoneNumber,l=n.firstMessage,s=n.colorClass,u=n.buttonText,p=n.backgroundColor,d=n.openInNewTab?"_blank":"_self",m=o&&i?o.replace(/\D+/g,"")+i.replace(/\D+/g,""):"",b=j()(r,s?"is-color-"+s:void 0,u.length?void 0:"has-no-text");return Object(a.createElement)("div",{className:b},Object(a.createElement)("a",{className:"whatsapp-block__button",href:(t=A+m,""!==l&&(t+="&text="+encodeURIComponent(l)),t),style:{backgroundColor:p},target:d,rel:"noopener noreferrer"},Object(a.createElement)(c.RichText.Content,{value:u})))}},N=(n(413),Object(o.__)("WhatsApp Button","jetpack")),A="https://api.whatsapp.com/send?phone=",T=(Object(o.__)("Chat on WhatsApp","jetpack"),Object(o.__)("Hi, I got your WhatsApp information from your website.","jetpack"),{title:N,description:Object(o.__)("Let your visitors send you a message on WhatsApp with the tap of a button.","jetpack"),icon:{src:s,foreground:Object(l.a)()},category:"grow",parent:["jetpack/send-a-message"],keywords:[Object(o._x)("whatsapp","keyword","jetpack"),Object(o._x)("messenger","keyword","jetpack"),Object(o._x)("contact","keyword","jetpack"),Object(o._x)("support","keyword","jetpack")],supports:{html:!1,reusable:!1,align:["left","center","right"]},attributes:b,edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className,o=e.clientId,i=t.countryCode,l=t.buttonText,s=t.colorClass,u=t.backgroundColor,p=Object(v.useDispatch)("core/block-editor").selectBlock,d=Object(a.useCallback)(f()(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n({countryCode:"1"}),e.next=3,fetch("https://public-api.wordpress.com/geo/").then((function(e){return!!e.ok&&e})).catch((function(){return!1}));case 3:if(!(t=e.sent)){e.next=9;break}return e.next=7,t.json();case 7:r=e.sent,O.forEach((function(e){e.code===r.country_short&&n({countryCode:e.value})}));case 9:case"end":return e.stop()}}),e)}))),[n]);return Object(a.useEffect)((function(){void 0===i&&(d(),p(o))}),[o,i,d,p]),Object(a.createElement)("div",{className:j()(r,s?"is-color-"+s:void 0)},Object(a.createElement)(c.BlockControls,null,Object(a.createElement)(x,{context:"toolbar",setAttributes:n,attributes:t})),Object(a.createElement)(c.InspectorControls,null,Object(a.createElement)(x,{context:"inspector",setAttributes:n,attributes:t})),Object(a.createElement)(c.RichText,{placeholder:l.default,keepPlaceholderOnFocus:!0,value:l,onChange:function(e){return n({buttonText:e})},withoutInteractiveFormatting:!0,allowedFormats:[],className:"whatsapp-block__button",tagName:"a",preserveWhiteSpace:!1,style:{backgroundColor:u,color:"dark"===s?"#fff":"#465B64"}}))},save:function(e){var t,n=e.attributes,r=e.className,o=n.countryCode,i=n.phoneNumber,l=n.firstMessage,s=n.buttonText,u=n.backgroundColor,p=n.colorClass,d=n.openInNewTab,m=o&&i?o.replace(/\D+/g,"")+i.replace(/\D+/g,""):"",b=j()(r,p?"is-color-"+p:void 0,s.length?void 0:"has-no-text"),h=d?"_blank":"_self";return Object(a.createElement)("div",{className:b},Object(a.createElement)("a",{className:"whatsapp-block__button",href:(t=A+m,""!==l&&(t+="&text="+encodeURIComponent(l)),t),style:{backgroundColor:u,color:"dark"===p?"#fff":"#465B64"},target:h,rel:"noopener noreferrer"},Object(a.createElement)(c.RichText.Content,{value:s})))},example:{attributes:{countryCode:"1",phoneNumber:"555-123-4567"}},deprecated:[S]});Object(r.a)("send-a-message",m,[{name:"whatsapp-button",settings:T}])},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(82),o=n(9),c=n.n(o),i=n(1),l=n(2),s=n(74),u=n(79),p=n(21),d=n.n(p),m=n(40),b=n.n(m),h=n(18),f=n.n(h),g=n(3),j=function(e){return function(t){return t.length<=e&&t}},v=function(e,t){return function(n){var r=n.slice(0,t),a=r.lastIndexOf(" ");return a>e&&a<t&&r.slice(0,a).concat("…")}},O=function(e){return function(t){return t.slice(0,e).concat("…")}},k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return Object(g.find)(t,(function(t){return!1!==t(e)}))(e)}},_=function(e){return e?e.replace(/(<([^>]+)>)/gi,""):""},y=(n(418),160),E=k(j(63),v(23,73),O(63)),w=k(j(y),v(80,170),O(y));function C(e){var t=e.description,n=e.title,r=e.url;return f.a.createElement("div",{className:"search-preview"},f.a.createElement("div",{className:"search-preview__display"},f.a.createElement("div",{className:"search-preview__url"},function(e){var t=e.replace(/^[^/]+[/]*/,"").split("/").join(" › ");return k(j(68),O(68))(t)}(r)," ▾"),f.a.createElement("div",{className:"search-preview__title"},E(n)),f.a.createElement("div",{className:"search-preview__description"},w(_(t)))))}C.propTypes={title:b.a.string,url:b.a.string,description:b.a.string},C.defaultProps={title:"",url:"",description:""};var x=n(76),S=n.n(x),N=n(77),A=n.n(N),T=n(78),P=n.n(T),I=n(98),M=n.n(I),R=(n(420),function(e){return e&&e.replace(/^[^/]+[/]*/,"").replace(/\/.*$/,"")}),B=k(j(80),O(80)),L=k(j(200),O(200)),D=function(e){P()(n,e);var t=M()(n);function n(){return S()(this,n),t.apply(this,arguments)}return A()(n,[{key:"render",value:function(){var e=this.props,t=e.url,n=e.type,r=e.title,a=e.description,o=e.image,c=e.author;return f.a.createElement("div",{className:"facebook-preview facebook-preview__".concat(n)},f.a.createElement("div",{className:"facebook-preview__content"},f.a.createElement("div",{className:"facebook-preview__image"},o&&f.a.createElement("img",{alt:"Facebook Preview Thumbnail",src:o})),f.a.createElement("div",{className:"facebook-preview__body"},f.a.createElement("div",{className:"facebook-preview__url"},Object(g.compact)([R(t),c]).join(" | ")),f.a.createElement("div",{className:"facebook-preview__title"},B(r||"")),f.a.createElement("div",{className:"facebook-preview__description"},L(_(a))))))}}]),n}(h.PureComponent);D.propTypes={url:b.a.string,type:b.a.string,title:b.a.string,description:b.a.string,image:b.a.string,author:b.a.string};var F=D,z=n(97),U=n.n(z),V=n(92),G=n.n(V),H=n(8),q=n.n(H),W=n(54),$=n.n(W),__=(n(245),i.__),K=k(j(200),O(200)),Z=function(e){P()(n,e);var t=M()(n);function n(){return S()(this,n),t.apply(this,arguments)}return A()(n,[{key:"renderSidebar",value:function(e,t){return f.a.createElement("div",{className:"twitter-preview__sidebar"},f.a.createElement("div",{className:"twitter-preview__profile-image"},f.a.createElement("img",{alt:__("Twitter profile image"),src:e})),!t&&f.a.createElement("div",{className:"twitter-preview__connector"}))}},{key:"renderHeader",value:function(e,t,n){return f.a.createElement("div",{className:"twitter-preview__header"},f.a.createElement("span",{className:"twitter-preview__name"},e),f.a.createElement("span",{className:"twitter-preview__screen-name"},t),f.a.createElement("span",{className:"twitter-preview__date"},$()(n).format("MMM D")))}},{key:"renderText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.url||"",a=e.endsWith(r)?e.substr(0,e.lastIndexOf(r)):e,o=t.reduce((function(e,t){return e.replace(new RegExp("\\("+t+"\\)","g"),'(<a href="'.concat(t,'">').concat(t,"</a>)"))}),_(a).replace(new RegExp("\\n","g"),"<br/>"));return f.a.createElement("div",{className:"twitter-preview__text",dangerouslySetInnerHTML:{__html:o}})}},{key:"renderMedia",value:function(e){if(e){var t=e.filter((function(e){return e.type.startsWith("image/")||e.type.startsWith("video/")})).filter((function(e,t,n){return 0===t||!n[0].type.startsWith("video/")&&"image/gif"!==n[0].type&&(!e.type.startsWith("video/")&&"image/gif"!==e.type)})).slice(0,4),n=t.length>0&&t[0].type.startsWith("video/"),r=q()(["twitter-preview__media","twitter-preview__media-children-"+t.length]);if(0!==t.length)return f.a.createElement("div",{className:r},n&&t.map((function(e,t){return f.a.createElement("video",{key:"twitter-preview__media-item-".concat(t),controls:!0},f.a.createElement("source",{src:e.url,type:e.type})," ")})),!n&&t.map((function(e,t){return f.a.createElement("img",{key:"twitter-preview__media-item-".concat(t),alt:e.alt,src:e.url})})))}}},{key:"renderQuoteTweet",value:function(e){if(e)return f.a.createElement("div",{className:"twitter-preview__quote-tweet"},f.a.createElement(l.SandBox,{html:'<blockquote class="twitter-tweet" data-conversation="none" data-dnt="true"><a href="'.concat(e,'"></a></blockquote>'),scripts:["https://platform.twitter.com/widgets.js"],title:"Embedded tweet",onFocus:this.hideOverlay}),f.a.createElement("div",{className:"twitter-preview__quote-tweet-overlay"}))}},{key:"renderCard",value:function(e){if(e){var t=e.description,n=e.image,r=e.title,a=e.type,o=e.url,c=q()("twitter-preview__card-".concat(a),{"twitter-preview__card-has-image":!!n});return f.a.createElement("div",{className:"twitter-preview__card"},f.a.createElement("div",{className:c},n&&f.a.createElement("img",{className:"twitter-preview__card-image",src:n,alt:""}),f.a.createElement("div",{className:"twitter-preview__card-body"},f.a.createElement("div",{className:"twitter-preview__card-title"},r),f.a.createElement("div",{className:"twitter-preview__card-description"},K(_(t))),f.a.createElement("div",{className:"twitter-preview__card-url"},f.a.createElement("svg",{viewBox:"0 0 24 24"},f.a.createElement("g",null,f.a.createElement("path",{d:"M11.96 14.945c-.067 0-.136-.01-.203-.027-1.13-.318-2.097-.986-2.795-1.932-.832-1.125-1.176-2.508-.968-3.893s.942-2.605 2.068-3.438l3.53-2.608c2.322-1.716 5.61-1.224 7.33 1.1.83 1.127 1.175 2.51.967 3.895s-.943 2.605-2.07 3.438l-1.48 1.094c-.333.246-.804.175-1.05-.158-.246-.334-.176-.804.158-1.05l1.48-1.095c.803-.592 1.327-1.463 1.476-2.45.148-.988-.098-1.975-.69-2.778-1.225-1.656-3.572-2.01-5.23-.784l-3.53 2.608c-.802.593-1.326 1.464-1.475 2.45-.15.99.097 1.975.69 2.778.498.675 1.187 1.15 1.992 1.377.4.114.633.528.52.928-.092.33-.394.547-.722.547z"}),f.a.createElement("path",{d:"M7.27 22.054c-1.61 0-3.197-.735-4.225-2.125-.832-1.127-1.176-2.51-.968-3.894s.943-2.605 2.07-3.438l1.478-1.094c.334-.245.805-.175 1.05.158s.177.804-.157 1.05l-1.48 1.095c-.803.593-1.326 1.464-1.475 2.45-.148.99.097 1.975.69 2.778 1.225 1.657 3.57 2.01 5.23.785l3.528-2.608c1.658-1.225 2.01-3.57.785-5.23-.498-.674-1.187-1.15-1.992-1.376-.4-.113-.633-.527-.52-.927.112-.4.528-.63.926-.522 1.13.318 2.096.986 2.794 1.932 1.717 2.324 1.224 5.612-1.1 7.33l-3.53 2.608c-.933.693-2.023 1.026-3.105 1.026z"}))),function(e){return e.replace(/^[^/]+[/]*(www\.)?/,"").replace(/\/.*$/,"")}(o||"")))))}}},{key:"renderFooter",value:function(){return f.a.createElement("div",{className:"twitter-preview__footer"},f.a.createElement("span",{className:"twitter-preview__icon-replies"},f.a.createElement("svg",{viewBox:"0 0 24 24"},f.a.createElement("path",{d:"M14.046 2.242l-4.148-.01h-.002c-4.374 0-7.8 3.427-7.8 7.802 0 4.098 3.186 7.206 7.465 7.37v3.828c0 .108.044.286.12.403.142.225.384.347.632.347.138 0 .277-.038.402-.118.264-.168 6.473-4.14 8.088-5.506 1.902-1.61 3.04-3.97 3.043-6.312v-.017c-.006-4.367-3.43-7.787-7.8-7.788zm3.787 12.972c-1.134.96-4.862 3.405-6.772 4.643V16.67c0-.414-.335-.75-.75-.75h-.396c-3.66 0-6.318-2.476-6.318-5.886 0-3.534 2.768-6.302 6.3-6.302l4.147.01h.002c3.532 0 6.3 2.766 6.302 6.296-.003 1.91-.942 3.844-2.514 5.176z"}))),f.a.createElement("span",{className:"twitter-preview__icon-retweets"},f.a.createElement("svg",{viewBox:"0 0 24 24"},f.a.createElement("path",{d:"M23.77 15.67c-.292-.293-.767-.293-1.06 0l-2.22 2.22V7.65c0-2.068-1.683-3.75-3.75-3.75h-5.85c-.414 0-.75.336-.75.75s.336.75.75.75h5.85c1.24 0 2.25 1.01 2.25 2.25v10.24l-2.22-2.22c-.293-.293-.768-.293-1.06 0s-.294.768 0 1.06l3.5 3.5c.145.147.337.22.53.22s.383-.072.53-.22l3.5-3.5c.294-.292.294-.767 0-1.06zm-10.66 3.28H7.26c-1.24 0-2.25-1.01-2.25-2.25V6.46l2.22 2.22c.148.147.34.22.532.22s.384-.073.53-.22c.293-.293.293-.768 0-1.06l-3.5-3.5c-.293-.294-.768-.294-1.06 0l-3.5 3.5c-.294.292-.294.767 0 1.06s.767.293 1.06 0l2.22-2.22V16.7c0 2.068 1.683 3.75 3.75 3.75h5.85c.414 0 .75-.336.75-.75s-.337-.75-.75-.75z"}))),f.a.createElement("span",{className:"twitter-preview__icon-likes"},f.a.createElement("svg",{viewBox:"0 0 24 24"},f.a.createElement("path",{d:"M12 21.638h-.014C9.403 21.59 1.95 14.856 1.95 8.478c0-3.064 2.525-5.754 5.403-5.754 2.29 0 3.83 1.58 4.646 2.73.814-1.148 2.354-2.73 4.645-2.73 2.88 0 5.404 2.69 5.404 5.755 0 6.376-7.454 13.11-10.037 13.157H12zM7.354 4.225c-2.08 0-3.903 1.988-3.903 4.255 0 5.74 7.034 11.596 8.55 11.658 1.518-.062 8.55-5.917 8.55-11.658 0-2.267-1.823-4.255-3.903-4.255-2.528 0-3.94 2.936-3.952 2.965-.23.562-1.156.562-1.387 0-.014-.03-1.425-2.965-3.954-2.965z"}))),f.a.createElement("span",{className:"twitter-preview__icon-share"},f.a.createElement("svg",{viewBox:"0 0 24 24"},f.a.createElement("path",{d:"M17.53 7.47l-5-5c-.293-.293-.768-.293-1.06 0l-5 5c-.294.293-.294.768 0 1.06s.767.294 1.06 0l3.72-3.72V15c0 .414.336.75.75.75s.75-.336.75-.75V4.81l3.72 3.72c.146.147.338.22.53.22s.384-.072.53-.22c.293-.293.293-.767 0-1.06z"}),f.a.createElement("path",{d:"M19.708 21.944H4.292C3.028 21.944 2 20.916 2 19.652V14c0-.414.336-.75.75-.75s.75.336.75.75v5.652c0 .437.355.792.792.792h15.416c.437 0 .792-.355.792-.792V14c0-.414.336-.75.75-.75s.75.336.75.75v5.652c0 1.264-1.028 2.292-2.292 2.292z"}))))}},{key:"render",value:function(){var e=this.props,t=e.isLast,n=e.profileImage,r=e.name,a=e.screenName,o=e.date,c=e.text,i=e.media,l=e.tweet,s=e.urls,u=e.card;return f.a.createElement("div",{className:"twitter-preview__container"},this.renderSidebar(n,t),f.a.createElement("div",{className:"twitter-preview__main"},this.renderHeader(r,a,o),f.a.createElement("div",{className:"twitter-preview__content"},this.renderText(c,s,u),this.renderMedia(i),this.renderQuoteTweet(l),this.renderCard(u)),this.renderFooter()))}}]),n}(h.PureComponent);Z.propTypes={tweets:b.a.array,isLast:b.a.bool,profileImage:b.a.string,name:b.a.string,screenName:b.a.string,date:b.a.number,text:b.a.string,media:b.a.array,tweet:b.a.string,urls:b.a.array,card:b.a.object};var Y=function(e){P()(n,e);var t=M()(n);function n(){return S()(this,n),t.apply(this,arguments)}return A()(n,[{key:"render",value:function(){var e=this.props.tweets||[{text:"",media:[],card:G()(G()({},this.props),{},{type:"large_image_summary"===this.props.type?"summary_large_image":this.props.type}),date:Date.now(),name:"Account Name",profileImage:"https://abs.twimg.com/sticky/default_profile_images/default_profile_bigger.png",screenName:"@account"}];return f.a.createElement("div",{className:"twitter-preview"},e&&e.map((function(t,n){return f.a.createElement(Z,U()({key:"twitter-preview__tweet-".concat(n),isLast:n+1===e.length},t))})))}}]),n}(h.PureComponent);Y.propTypes={tweets:b.a.array};var J=Y,X=[{title:Object(i.__)("Google Search","jetpack"),icon:"google",name:"google",preview:C},{title:Object(i.__)("Facebook","jetpack"),icon:"facebook",name:"facebook",preview:function(e){return Object(r.createElement)(F,d()({type:"article"},e))}},{title:Object(i.__)("Twitter","jetpack"),icon:"twitter",name:"twitter",preview:function(e){return Object(r.createElement)(J,e)}}],Q=n(33),ee=function(e){var t=e.openModal,n=e.showUpgradeNudge,a=n?Object(i.__)("Learn more","jetpack"):Object(i.__)("Preview","jetpack"),o=n?Object(i.__)("Learn more about paid plans","jetpack"):Object(i.__)("Open Social Previews","jetpack");return Object(r.createElement)("div",{className:"jetpack-social-previews__panel"},Object(r.createElement)("p",null,Object(i.__)("Preview what this will look like on social networks and Google search.","jetpack")),n&&Object(r.createElement)("p",null,Object(i.__)("Business or eCommerce plan required.","jetpack")),Object(r.createElement)("div",{className:"jetpack-gutenberg-social-icons"},X.map((function(e){return Object(r.createElement)(Q.i,{key:e.icon,serviceName:e.icon,className:"jetpack-social-previews__icon"})}))),Object(r.createElement)(l.Button,{isSecondary:!0,onClick:t,label:o},a))},te=n(4),ne=n.n(te),re=n(10),ae=n(62),oe=n(248),ce=n.n(oe),ie=n(122),le=n(49);function se(){var e,t,n=null===(e=Object(le.a)(de))||void 0===e||null===(t=e.details)||void 0===t?void 0:t.required_plan,a=Object(ie.a)(n,(function(){ae.a.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:n,block:de})})),o=c()(a,3),s=o[0],u=o[1],p=o[2],d=p?Object(i.__)("Redirecting…","jetpack"):Object(i.__)("Upgrade","jetpack");return Object(r.createElement)("div",{className:"jetpack-social-previews__modal-upgrade"},Object(r.createElement)("img",{className:"jetpack-social-previews__upgrade-illustration",src:ce.a,width:"351",height:"264",alt:""}),Object(r.createElement)("div",{className:"jetpack-social-previews__upgrade-description"},Object(r.createElement)("h2",{className:"jetpack-social-previews__upgrade-heading"},Object(i.__)("Upgrade to a Business plan to unlock the power of our SEO tools","jetpack")),Object(r.createElement)("ul",{className:"jetpack-social-previews__upgrade-feature-list"},Object(r.createElement)("li",null,Object(i.__)("Preview your site’s content as it will appear on Facebook, Twitter, and the WordPress.com Reader.","jetpack")),Object(r.createElement)("li",null,Object(i.__)("Control how page titles will appear on Google search results and social networks.","jetpack")),Object(r.createElement)("li",null,Object(i.__)("Customize your front page metadata to change how your site appears to search engines.","jetpack"))),Object(r.createElement)(l.Button,{href:s,isPrimary:!0,label:Object(i.__)("Purchase a Business plan to access social previews","jetpack"),onClick:u,target:"_top",isBusy:p},d)))}n(421);var ue,pe=Object(re.withSelect)((function(e,t){var n;if(t.showUpgradeNudge)return{};var r,a,o,c,l=e("core"),s=l.getMedia,u=l.getUser,p=e("core/editor"),d=p.getCurrentPost,m=p.getEditedPostAttribute,b=e("jetpack/publicize"),h=b.getTweetTemplate,f=b.getTweetStorm,g=b.getShareMessage,j=b.isTweetStorm,v=m("featured_media"),O=m("author"),k=O&&u(O),_={post:d(),title:m("title"),description:(null===(n=m("meta"))||void 0===n?void 0:n.advanced_seo_description)||m("excerpt")||m("content").split("\x3c!--more")[0]||Object(i.__)("Visit the post for more.","jetpack"),url:m("link"),author:null==k?void 0:k.name,image:!!v&&(r=s(v),r?(null===(a=r.media_details)||void 0===a||null===(o=a.sizes)||void 0===o||null===(c=o.large)||void 0===c?void 0:c.source_url)||r.source_url:null)},y=[];return j()?y=f():y.push(ne()(ne()({},h()),{},{text:g(),card:ne()(ne()({},_),{},{type:_.image?"summary_large_image":"summary"})})),ne()(ne()({},_),{},{tweets:y,isTweetStorm:j()})}))((function(e){var t=e.onClose,n=e.showUpgradeNudge,a=e.image,o=e.title,c=e.description,s=e.url,u=e.author,p=e.isTweetStorm,d=e.tweets,m=X.map((function(e){return ne()(ne()({},e),{},{title:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Q.i,{serviceName:e.icon}),e.title)})}));return Object(r.createElement)(l.Modal,{onRequestClose:t,title:Object(i.__)("Social Previews","jetpack"),className:"jetpack-social-previews__modal"},n?Object(r.createElement)(se,null):Object(r.createElement)(l.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:m,initialTabName:p?"twitter":null,orientation:"vertical"},(function(e){return Object(r.createElement)("div",null,Object(r.createElement)(e.preview,{title:o,description:c,url:s,author:u,image:a,isTweetStorm:p,tweets:d}))})))})),de=(n(422),"social-previews"),me={render:function(){return Object(r.createElement)(be,null)}},be=function(e){var t=e.showUpgradeNudge,n=Object(r.useState)(!1),a=c()(n,2),o=a[0],p=a[1];return Object(r.createElement)(r.Fragment,null,o&&Object(r.createElement)(pe,{showUpgradeNudge:t,onClose:function(){return p(!1)}}),Object(r.createElement)(u.a,null,Object(r.createElement)(l.PanelBody,{title:Object(i.__)("Social Previews","jetpack")},Object(r.createElement)(ee,{openModal:function(){return p(!0)},showUpgradeNudge:t}))),Object(r.createElement)(s.PluginPrePublishPanel,{title:Object(i.__)("Social Previews","jetpack")},Object(r.createElement)(ee,{openModal:function(){return p(!0)},showUpgradeNudge:t})))},he=n(23),fe=n(69);Object(fe.a)(de,me),!(null===(ue=Object(le.a)("social-previews"))||void 0===ue?void 0:ue.available)&&Object(he.c)()&&Object(a.registerPlugin)("jetpack-".concat(de,"-upgrade-nudge"),{render:function(){return Object(r.createElement)(be,{showUpgradeNudge:!0})}})},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(9),c=n.n(o),i=n(0),l=n(6),s=n(2),u=n(17),p=n(90);function d(e){var t=e.attributes,n=e.setAttributes,r=t.orientation;return Object(i.createElement)(s.PanelBody,{title:Object(a.__)("Orientation","jetpack")},Object(i.createElement)(s.RadioControl,{selected:r||"horizontal",options:[{label:Object(a.__)("Side by side","jetpack"),value:"horizontal"},{label:Object(a.__)("Above and below","jetpack"),value:"vertical"}],onChange:function(e){return n({orientation:e})}}))}var m=Object(u.compose)([s.withNotices])((function(e){var t=e.image,n=e.noticeOperations,r=e.noticeUI,a=e.onChange,o=e.placeHolderLabel,c=Object(i.createElement)("img",{id:t.id,src:t.url,alt:t.alt}),s=Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.MediaPlaceholder,{labels:{title:o},accept:"image/*",allowedTypes:["image"],onSelect:a,onError:function(e){return n.createErrorNotice(e)},notices:r}));return t&&t.url?c:s})),b=function(e,t,n){Object(i.useEffect)((function(){var r=setTimeout((function(){return e(n)}),t);return function(){return clearTimeout(r)}}),[n])},h=(n(409),n(304),function(e){var t=e.attributes,n=e.className,r=e.clientId,o=e.isSelected,h=e.setAttributes,f=t.imageBefore,g=t.imageAfter,j=t.caption,v=t.orientation,O=null,k=null,_=Object(i.useRef)();if(u.useResizeObserver){var y=Object(u.useResizeObserver)(),E=c()(y,2);O=E[0],k=E[1],b((function(e){e>0&&"undefined"!=typeof juxtapose&&juxtapose.sliders&&juxtapose.sliders.forEach((function(t){t.wrapper.parentElement.id===r&&t.optimizeWrapper(e)}))}),200,k.width)}var w=f&&f.url&&g&&g.url?"image-compare__comparison juxtapose":"image-compare__placeholder";return Object(i.useLayoutEffect)((function(){f.url&&g.url&&"undefined"!=typeof juxtapose&&juxtapose.makeSlider(null==_?void 0:_.current)}),[f,g,v]),Object(i.createElement)("figure",{className:n,id:r},O,Object(i.createElement)(l.InspectorControls,{key:"controls"},Object(i.createElement)(d,{attributes:t,setAttributes:h})),Object(i.createElement)("div",{ref:_,className:w,"data-mode":v||"horizontal"},Object(i.createElement)(s.Placeholder,{label:null},Object(i.createElement)("div",{className:"image-compare__image-before"},Object(i.createElement)(m,{image:{id:f.id,url:f.url,alt:f.alt},placeHolderLabel:Object(a.__)("Image before","jetpack"),onChange:function(e){if("image"===e.media_type||"image"===e.type){var t,n,r=Object(p.b)(e).src,a=e.alt,o=e.id,c=e.media_details,i=null!==(t=null==c?void 0:c.width)&&void 0!==t?t:e.width,l=null!==(n=null==c?void 0:c.height)&&void 0!==n?n:e.height;h({imageBefore:{id:o,url:r||e.url,alt:a,width:i,height:l}})}}})),Object(i.createElement)("div",{className:"image-compare__image-after"},Object(i.createElement)(m,{image:{id:g.id,url:g.url,alt:g.alt},placeHolderLabel:Object(a.__)("Image after","jetpack"),onChange:function(e){if("image"===e.media_type||"image"===e.type){var t,n,r=Object(p.b)(e).src,a=e.alt,o=e.id,c=e.media_details,i=null!==(t=null==c?void 0:c.width)&&void 0!==t?t:e.width,l=null!==(n=null==c?void 0:c.height)&&void 0!==n?n:e.height;h({imageAfter:{id:o,url:r||e.url,alt:a,width:i,height:l}})}}})))),(!l.RichText.isEmpty(j)||o&&f.url&&g.url)&&Object(i.createElement)(l.RichText,{tagName:"figcaption",placeholder:Object(a.__)("Write caption","jetpack"),value:j,onChange:function(e){return h({caption:e})},inlineToolbar:!0}))}),f=Object(i.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(s.Path,{d:"M21 4h-6v1.5h6c.3 0 .5.2.5.5v.4l-3.6 3.5L15 8.1v1.8l2.6 1.7c.1.1.3.1.4.1.2 0 .4-.1.5-.2l3-2.9V18c0 .3-.2.5-.5.5h-6V20h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM1 6v12c0 1.1.9 2 2 2h10.5V4H3c-1.1 0-2 .9-2 2zm11 12.5H3c-.3 0-.5-.2-.5-.5v-1.4L5 14.7l1.5-1.1.1-.1 3 1.9c.1.1.3.1.4.1.2 0 .4-.1.5-.2L12 14v4.5zm0-6.6l-2.1 2L7 12c-.1-.1-.3-.1-.4-.1h-.1c-.1 0-.3.1-.4.1l-1.1.9-2.5 1.8V6c0-.3.2-.5.5-.5h9v6.4z"})),g=function(e){var t=e.attributes,n=e.className,r=t.imageBefore,a=t.imageAfter,o=t.caption,c=t.orientation;return Object(i.createElement)("figure",{className:n},Object(i.createElement)("div",{className:"juxtapose","data-mode":c||"horizontal"},Object(i.createElement)("img",{id:r.id,src:r.url,alt:r.alt,width:r.width,height:r.height,className:"image-compare__image-before"}),Object(i.createElement)("img",{id:a.id,src:a.url,alt:a.alt,width:a.width,height:a.height,className:"image-compare__image-after"})),!l.RichText.isEmpty(o)&&Object(i.createElement)(l.RichText.Content,{tagName:"figcaption",value:o}))},j=n(246),v=n.n(j),O=n(247),k=n.n(O),_=n(58),y=n(16),E={title:Object(a.__)("Image Compare","jetpack"),description:Object(a.__)("Compare two images with a slider. Works best with images of the same size.","jetpack"),icon:{src:f,foreground:Object(y.a)()},category:Object(_.a)("media","layout"),keywords:[Object(a._x)("juxtapose","block search term","jetpack"),Object(a._x)("photos","block search term","jetpack"),Object(a._x)("pictures","block search term","jetpack"),Object(a._x)("side by side","block search term","jetpack"),Object(a._x)("slider","block search term","jetpack")],attributes:{imageBefore:{type:"object",default:{}},imageAfter:{type:"object",default:{}},caption:{type:"string"},orientation:{type:"string",default:"horizontal"}},example:{attributes:{imageBefore:{id:1,url:k.a,alt:Object(a.__)("Before","jetpack")},imageAfter:{id:2,url:v.a,alt:Object(a.__)("After","jetpack")},caption:Object(a.__)("Example image","jetpack")}},edit:h,save:g};Object(r.a)("image-compare",E)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(0),c=n(8),i=n.n(c),l=n(3),s=n(29),u=n(10),p=n(6),d=n(2),m=n(73),b=function(e){var t=e.allowedMediaTypes,n=e.attributes.mediaFiles,r=e.onSelectMedia;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,!!n.length&&Object(o.createElement)(d.ToolbarGroup,null,Object(o.createElement)(d.ToolbarItem,null,(function(){return Object(o.createElement)(p.MediaUpload,{title:Object(a.__)("Edit Story","jetpack"),onSelect:r,allowedTypes:t,addToGallery:!0,multiple:"add",value:n.map((function(e){return e.id})),render:function(e){var t=e.open;return Object(o.createElement)(m.a,{label:Object(a.__)("Edit Story","jetpack"),onClick:t})}})})))))},h=n(210),f=(n(423),["image","video"]),g=function(e){var t,n,r,a=Object(l.pick)(e,["alt","title","id","link","type","mime","caption","width","height"]);return a.url=Object(l.get)(e,["media_details","original","url"])||Object(l.get)(e,["media_details","videopress","original"])||Object(l.get)(e,["media_details","sizes","large","source_url"])||Object(l.get)(e,["sizes","large","url"])||e.url,a.type=e.media_type||e.type,a.mime=e.mime_type||e.mime,a.title=(null===(t=a.title)||void 0===t?void 0:t.rendered)||a.title,a.width=a.width||(null===(n=e.media_details)||void 0===n?void 0:n.width),a.height=a.height||(null===(r=e.media_details)||void 0===r?void 0:r.height),a},j=Object(d.withNotices)((function(e){var t=e.attributes,n=e.className,r=e.isSelected,c=e.noticeOperations,l=e.noticeUI,d=e.setAttributes,m=t.mediaFiles,j=Object(u.useDispatch)("core/editor"),O=j.lockPostSaving,k=j.unlockPostSaving,_="storyBlockLock",y=function(e){var t=e.map((function(e){return isNaN(e)?e:m.find((function(t){return t.id===e}))||{id:e}})).map(g),n=t.filter((function(e){return!Object(s.isBlobURL)(e.url)}));t.length!==n.length?O(_):k(_),d({mediaFiles:t})},E=Object(o.createElement)(b,{allowedMediaTypes:f,attributes:t,onSelectMedia:y}),w=!!m.length,C=Object(o.createElement)(p.MediaPlaceholder,{addToGallery:w,isAppender:w,className:n,disableMediaButtons:w&&!r,icon:!w&&Object(o.createElement)(p.BlockIcon,{icon:v.a}),labels:{title:!w&&Object(a.__)("Story","jetpack"),instructions:!w&&Object(a.__)("Drag images and videos, upload new ones, or select files from your library.","jetpack")},onSelect:y,accept:f.map((function(e){return e+"/*"})).join(","),allowedTypes:f,multiple:"add",value:m,notices:w?void 0:l,onError:c.createErrorNotice});return w?Object(o.createElement)(o.Fragment,null,E,l,Object(o.createElement)("div",{className:i()("wp-block-jetpack-story","wp-story",n)},Object(o.createElement)(h.a,{slides:m,disabled:!r,showSlideCount:r,shadowDOM:{enabled:!1},playInFullscreen:!1,tapToPlayPause:!1,playOnNextSlide:!1})),r&&C):Object(o.createElement)(o.Fragment,null,E,C)})),v=n(96),O=n(58),k=n(16),_=n(249),y={mediaFiles:[{alt:"",caption:"",mime:"image/jpg",type:"image",id:22,url:n.n(_).a}]},E={title:Object(a.__)("Story","jetpack"),category:Object(O.a)("media","layout"),keywords:[Object(a._x)("story","block search term","jetpack"),Object(a._x)("image","block search term","jetpack"),Object(a._x)("video","block search term","jetpack"),Object(a._x)("gallery","block search term","jetpack")],description:Object(a.__)("Add an interactive story.","jetpack"),attributes:{settings:{type:"object"},mediaFiles:{type:"array",default:[]}},supports:{html:!1},icon:{src:v.a,foreground:Object(k.a)()},edit:j,save:function(e){var t=e.className;return Object(o.createElement)("div",{className:i()("wp-story",t)})},example:{attributes:y}};Object(r.a)("story",E)},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(1),o=n(2),c=n(17),i=n(51),l=n(10),s=n(156),u=Object(l.withSelect)((function(e){return{areLikesEnabled:(0,e("core/editor").getEditedPostAttribute)("jetpack_likes_enabled")}})),p=Object(l.withDispatch)((function(e){return{editPost:e("core/editor").editPost}})),d={render:Object(c.compose)([u,p])((function(e){var t=e.areLikesEnabled,n=e.editPost;return Object(r.createElement)(i.PostTypeSupportCheck,{supportKeys:"jetpack-post-likes"},Object(r.createElement)(s.a,null,Object(r.createElement)(o.CheckboxControl,{label:Object(a.__)("Show likes.","jetpack"),checked:t,onChange:function(e){n({jetpack_likes_enabled:e})}})))}))},m=n(69);Object(m.a)("likes",d)},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(1),o=n(2),c=n(74),i=(n(414),n(79)),l=n(12),s=n.n(l),u=n(15),p=n.n(u),d=n(7),m=n.n(d),b=n(13),h=n.n(b),f=n(14),g=n.n(f),j=n(5),v=n.n(j),O=n(17),k=n(3),_=n(10),y=function(e){h()(n,e);var t=g()(n);function n(){var e;s()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),v()(m()(e),"onMessageChange",(function(t){e.props.updateSeoDescription(t.target.value)})),e}return p()(n,[{key:"render",value:function(){var e=this.props.seoDescription;return Object(r.createElement)("div",{className:"jetpack-seo-message-box"},Object(r.createElement)("textarea",{value:e,onChange:this.onMessageChange,placeholder:Object(a.__)("Write a description…","jetpack"),rows:4}),Object(r.createElement)("div",{className:"jetpack-seo-character-count"},Object(a.sprintf)(Object(a._n)("%d character","%d characters",e.length,"jetpack"),e.length)))}}]),n}(r.Component),E=Object(O.compose)([Object(_.withSelect)((function(e){return{seoDescription:Object(k.get)(e("core/editor").getEditedPostAttribute("meta"),["advanced_seo_description"],"")}})),Object(_.withDispatch)((function(e){return{updateSeoDescription:function(t){e("core/editor").editPost({meta:{advanced_seo_description:t}})}}}))])(y),w={render:function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.a,null,Object(r.createElement)(o.PanelBody,{title:Object(a.__)("SEO Description","jetpack")},Object(r.createElement)(E,null))),Object(r.createElement)(c.PluginPrePublishPanel,{initialOpen:!0,id:"seo-title",title:Object(r.createElement)("span",{id:"seo-defaults",key:"seo-title-span"},Object(a.__)("SEO Description","jetpack"))},Object(r.createElement)(E,null)))}},C=n(69);Object(C.a)("seo",w)},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(1),o=n(2),c=n(17),i=n(51),l=n(10),s=n(156),u=Object(l.withSelect)((function(e){return{isSharingEnabled:(0,e("core/editor").getEditedPostAttribute)("jetpack_sharing_enabled")}})),p=Object(l.withDispatch)((function(e){return{editPost:e("core/editor").editPost}})),d={render:Object(c.compose)([u,p])((function(e){var t=e.isSharingEnabled,n=e.editPost;return Object(r.createElement)(i.PostTypeSupportCheck,{supportKeys:"jetpack-sharing-buttons"},Object(r.createElement)(s.a,null,Object(r.createElement)(o.CheckboxControl,{label:Object(a.__)("Show sharing buttons.","jetpack"),checked:t,onChange:function(e){n({jetpack_sharing_enabled:e})}})))}))},m=n(69);Object(m.a)("sharing",d)},function(e,t,n){"use strict";n.r(t);var r=n(12),a=n.n(r),o=n(15),c=n.n(o),i=n(13),l=n.n(i),s=n(14),u=n.n(s),p=n(0),d=n(1),m=n(3),b=n(2),h=n(10),f=n(7),g=n.n(f),j=n(5),v=n.n(j),O=(n(415),function(e){l()(n,e);var t=u()(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),v()(g()(e),"state",{hasCopied:!1}),v()(g()(e),"onCopy",(function(){return e.setState({hasCopied:!0})})),v()(g()(e),"onFinishCopy",(function(){return e.setState({hasCopied:!1})})),v()(g()(e),"onFocus",(function(e){return e.target.select()})),e}return c()(n,[{key:"render",value:function(){var e=this.props.link,t=this.state.hasCopied;return e?Object(p.createElement)("div",{className:"jetpack-clipboard-input"},Object(p.createElement)(b.TextControl,{readOnly:!0,onFocus:this.onFocus,value:e}),Object(p.createElement)(b.ClipboardButton,{isDefault:!0,onCopy:this.onCopy,onFinishCopy:this.onFinishCopy,text:e},t?Object(d.__)("Copied!","jetpack"):Object(d._x)("Copy","verb","jetpack"))):null}}]),n}(p.Component)),k=n(79),_={render:function(){return Object(p.createElement)(E,null)}},y=function(e){l()(n,e);var t=u()(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props.shortlink;return e?Object(p.createElement)(k.a,null,Object(p.createElement)(b.PanelBody,{title:Object(d.__)("Shortlink","jetpack"),className:"jetpack-shortlinks__panel"},Object(p.createElement)(O,{link:e}))):null}}]),n}(p.Component),E=Object(h.withSelect)((function(e){var t=e("core/editor").getCurrentPost();return{shortlink:Object(m.get)(t,"jetpack_shortlink","")}}))(y),w=n(69);Object(w.a)("shortlinks",_)},function(e,t,n){"use strict";n.r(t);var r=n(4),a=n.n(r),o=n(0),c=n(31),i=n(51),l=n(2),s=n(1),u=n(9),p=n.n(u),d=n(3),m=n(22),b=n.n(m),h=n(27),f=n(11),g=n(10);n(408);var j=function(e){if(e.isDeprecation)return e;if("core/embed"!==e.name)return e;var t=e.edit;return a()(a()({},e),{},{edit:Object(l.withNotices)((function(e){var n=e.noticeOperations,r=e.noticeUI,a=e.onReplace,c=e.attributes.url,u=function(e){var t=e.onReplace,n=Object(o.useState)(!1),r=p()(n,2),a=r[0],c=r[1],i=Object(g.useSelect)((function(e){return e("core/editor").getEditedPostAttribute("jetpack_publicize_connections")}));return{isGatheringStorm:a,unleashStorm:function(e,n){if(!Object(d.isEmpty)(e)){var r=e.match(/^https?:\/\/(?:www\.)?twitter\.com\/([^/]+)\/status\/\d+/);if(!Object(d.isEmpty)(r)){var a=r[1];n.removeAllNotices(),c(!0),b()({path:Object(h.addQueryArgs)("/wpcom/v2/tweetstorm/gather",{url:e})}).then((function(e){c(!1),Object(d.isArray)(e)?Object(d.isEmpty)(e)?n.createErrorNotice(Object(s.__)("We were unable to get any content from this tweet.","jetpack")):(t(e.map((function(e){switch(e.type){case"paragraph":return Object(f.createBlock)("core/paragraph",{content:e.content});case"gallery":return Object(f.createBlock)("core/gallery",{images:e.images});case"image":return Object(f.createBlock)("core/image",{url:e.url,alt:e.alt});case"video":return Object(f.createBlock)("core/video",{src:e.url,caption:e.alt});case"embed":return Object(f.createBlock)("core/embed",{url:e.url})}}))),Object(d.some)(i,(function(e){return"twitter"===e.service_name&&"@".concat(a)===e.display_name}))||Object(g.dispatch)("core/notices").createWarningNotice(Object(s.__)("We were unable to verify that this Twitter thread was published on a Twitter account belonging to you. Please ensure you have permission to reproduce it before publishing.","jetpack")),Object(g.dispatch)("core/notices").createSuccessNotice(Object(s.__)("Twitter thread successfully imported","jetpack"),{type:"snackbar"})):n.createErrorNotice(Object(s.__)("An error occurred. Please try again later.","jetpack"))})).catch((function(e){c(!1),n.createErrorNotice(e.message)}))}}}}}({onReplace:a}),m=u.isGatheringStorm,j=u.unleashStorm;return"twitter"!==e.attributes.providerNameSlug?Object(o.createElement)(t,e):Object(o.createElement)(o.Fragment,null,r,Object(o.createElement)(i.BlockControls,null,Object(o.createElement)(l.ToolbarGroup,{className:"gathering-tweetstorms__embed-toolbar"},Object(o.createElement)(l.ToolbarButton,{className:"gathering-tweetstorms__embed-toolbar-button",onClick:function(){return j(c,n)},label:Object(s.__)("Import the entire Twitter thread directly into this post.","jetpack"),showTooltip:!0,disabled:m||!c},Object(s.__)("Unroll","jetpack")),m&&Object(o.createElement)(l.ToolbarItem,{as:l.Spinner}))),Object(o.createElement)(t,e))}))})};Object(c.addFilter)("blocks.registerBlockType","jetpack/gathering-tweetstorms",j);t.default=j},function(e){e.exports=JSON.parse('{"a":[{"slug":"participant-0","label":"Speaker 1"},{"slug":"participant-1","label":"Speaker 2"},{"slug":"participant-2","label":"Speaker 3"}]}')},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(212);Object(r.a)(a.a,a.b)},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(11),c=n(4),i=n.n(c),l=n(21),s=n.n(l),u=n(9),p=n.n(u),d=n(0),m=n(2),b=n(6),h=n(17),f=n(10),g=n(27),j=n(35),v=n(22),O=n.n(v);function k(){return Object(d.createElement)("div",{className:"premium-content-wrapper"},Object(d.createElement)(b.InnerBlocks,{allowedBlocks:["premium-content/subscriber-view","premium-content/logged-out-view"],templateLock:"all",template:[["premium-content/subscriber-view"],["premium-content/logged-out-view"]],__experimentalCaptureToolbars:!0,templateInsertUpdatesSelection:!1}))}var _=n(529),y=n(59),E=Object(d.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(d.createElement)(y.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"}));function w(e){var t=e.className,n=e.plan,r=e.selectedPlan,a=e.onSelected,o=e.onClose,c=e.getPlanDescription,i=r&&n.id===r.id,l=(i?["is-selected"]:[]).concat([t]).join(" "),s=i?"yes":void 0,u=null;return n&&(u=" "+c(n)),Object(d.createElement)(m.MenuItem,{onClick:function(e){e.preventDefault(),a(n),o()},className:l,key:n.id,value:n.id,selected:i,icon:s},n.title," : ",u)}function C(e){var t=e.plans,n=e.selectedPlan,r=e.onSelected;return Object(d.createElement)(m.MenuGroup,null,t.map((function(t){return Object(d.createElement)(w,s()({},e,{key:t.id,selectedPlan:n,onSelected:r,plan:t}))})))}function x(e){return Object(d.createElement)(m.MenuGroup,null,Object(d.createElement)(m.MenuItem,{onClick:function(t){t.preventDefault(),Object(f.select)("core/edit-post").isEditorSidebarOpened()||Object(f.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block");var n=document.getElementById("new-plan-name");null!==n&&n.focus(),e.onClose()}},Object(a.__)("Add a new subscription","jetpack")))}function S(e){var t=e.selectedPlanId,n=e.onSelected,r=e.plans,o=e.getPlanDescription,c=r.find((function(e){return e.id===t})),i=null;return c&&(i=" "+o(c)),Object(d.createElement)(b.BlockControls,null,Object(d.createElement)(m.ToolbarGroup,null,Object(d.createElement)(m.ToolbarItem,null,(function(){return Object(d.createElement)(m.DropdownMenu,{icon:Object(d.createElement)(d.Fragment,null,Object(d.createElement)(_.a,{icon:E})," ",i&&Object(d.createElement)(d.Fragment,null,i)),label:Object(a.__)("Select a plan","jetpack"),className:"premium-content-toolbar-button"},(function(t){var r=t.onClose;return Object(d.createElement)(d.Fragment,null,Object(d.createElement)(C,s()({},e,{onSelected:n,onClose:r,selectedPlan:c})),Object(d.createElement)(x,s()({},e,{onClose:r})))}))}))))}var N=n(37);function A(e){var t=Object(d.useState)(0),n=p()(t,2),r=n[0],o=n[1],c=e.attributes,i=e.setAttributes,l=e.className,s=e.savePlan,u=e.siteSlug;return Object(d.createElement)(b.InspectorControls,null,u&&Object(d.createElement)(m.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(u),className:"wp-block-premium-content-container---link-to-earn"},Object(a.__)("Manage your subscriptions.","jetpack")),Object(d.createElement)(m.PanelBody,{title:Object(a.__)("Add a new subscription","jetpack"),initialOpen:!0,className:"".concat(l,"---settings-add_plan")},1===r&&Object(d.createElement)(m.Placeholder,{icon:"lock",label:Object(a.__)("Premium Content","jetpack"),instructions:Object(a.__)("Saving plan…","jetpack")},Object(d.createElement)(m.Spinner,null)),0===r&&Object(d.createElement)("div",null,Object(d.createElement)(m.PanelRow,{className:"plan-name"},Object(d.createElement)(m.TextControl,{id:"new-plan-name",label:Object(a.__)("Name","jetpack"),value:c.newPlanName,onChange:function(e){return i({newPlanName:e})}})),Object(d.createElement)(m.PanelRow,{className:"plan-price"},Object(d.createElement)(m.SelectControl,{label:Object(a.__)("Currency","jetpack"),onChange:function(e){return i({newPlanCurrency:e})},value:c.newPlanCurrency,options:N.a}),Object(d.createElement)(m.TextControl,{label:Object(a.__)("Price","jetpack"),value:c.newPlanPrice,onChange:function(e){return i({newPlanPrice:parseFloat(e)})},type:"number"})),Object(d.createElement)(m.PanelRow,{className:"plan-interval"},Object(d.createElement)(m.SelectControl,{label:Object(a.__)("Interval","jetpack"),onChange:function(e){return i({newPlanInterval:e})},value:c.newPlanInterval,options:[{label:Object(a.__)("Month","jetpack"),value:"1 month"},{label:Object(a.__)("Year","jetpack"),value:"1 year"}]})),Object(d.createElement)(m.PanelRow,null,Object(d.createElement)(m.Button,{isSecondary:!0,isLarge:!0,onClick:function(t){t.preventDefault(),o(1),s(e.attributes,(function(e){o(0),e&&(i({newPlanPrice:5}),i({newPlanName:""}))}))}},Object(a.__)("Add subscription","jetpack"))))))}var T={selectedTab:{id:"",className:"",label:Object(d.createElement)(d.Fragment,null)},stripeNudge:null},P=Object(d.createContext)(T),I=n(33),M=n(91),R=(n(441),n(80)),B=[{id:"premium",label:Object(d.createElement)("span",null,Object(a.__)("Subscriber View","jetpack")),className:"wp-premium-content-subscriber-view"},{id:"wall",label:Object(d.createElement)("span",null,Object(a.__)("Non-subscriber View","jetpack")),className:"wp-premium-content-logged-out-view"}],L=[];function D(e){var t=Object(d.useState)(B[1]),n=p()(t,2),r=n[0],o=n[1],c=Object(d.useState)(!1),i=p()(c,2),l=i[0],u=i[1],h=Object(d.useState)(L),f=p()(h,2),v=f[0],_=f[1],y=Object(d.useState)(null),E=p()(y,2),w=E[0],C=E[1],x=Object(d.useState)(0),T=p()(x,2),D=T[0],z=T[1],U=Object(d.useState)(!1),V=p()(U,2),G=V[0],H=V[1],q=Object(d.useState)(""),W=p()(q,2),$=W[0],K=W[1],Z=e.attributes.isPreview;function Y(t,n){if(!t.newPlanName||0===t.newPlanName.length)return F(e,Object(a.__)("Plan requires a name","jetpack")),void n(!1);var r=parseFloat(t.newPlanPrice),o=Object(N.d)(t.newPlanCurrency),c=Object(a.sprintf)(Object(a.__)("Minimum allowed price is %s.","jetpack"),Object(j.a)(o,t.newPlanCurrency));if(r<o)return F(e,c),void n(!1);if(!Object(N.c)(t.newPlanCurrency,r))return F(e,Object(a.__)("Plan requires a valid price","jetpack")),void n(!1);var i={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:t.newPlanCurrency,price:t.newPlanPrice,title:t.newPlanName,interval:t.newPlanInterval}};O()(i).then((function(t){var r={id:t.id,title:t.title,interval:t.interval,price:t.price,currency:t.currency};_(v.concat([r])),J(r),function(e,t){e.createSuccessNotice(t,{type:"snackbar"})}(e,Object(a.__)("Successfully created plan","jetpack")),n&&n(!0)}),(function(){F(e,Object(a.__)("There was an error when adding the plan.","jetpack")),n&&n(!1)}))}function J(t){e.setAttributes({selectedPlanId:t.id})}var X=Object(d.useRef)(null);!function(e,t){function n(n){e.current&&n.target&&n.target instanceof Node&&!e.current.contains(n.target)?t(!1):t(!0)}Object(d.useEffect)((function(){return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}}))}(X,u);var Q=e.isSelected,ee=e.className;Object(d.useEffect)((function(){if(!Z){var t=Object(g.getQueryArg)(window.location.href,"origin"),n={path:Object(g.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t?"gutenberg-wpcom":"gutenberg"}),method:"GET"};O()(n).then((function(t){if(t||"object"==typeof t){if(t.errors&&Object.values(t.errors)&&Object.values(t.errors)[0][0])return z(2),void F(e,Object.values(t.errors)[0][0]);C(Object(M.a)(e.postId,t.connect_url)),H(t.should_upgrade_to_access_memberships),K(t.site_slug),t.products&&0===t.products.length&&!t.should_upgrade_to_access_memberships&&t.connected_account_id?Y({newPlanCurrency:"USD",newPlanPrice:5,newPlanName:Object(a.__)("Monthly Subscription","jetpack"),newPlanInterval:"1 month"},(function(){z(t.connected_account_id?1:2)})):(t.products&&t.products.length>0&&(_(t.products),e.attributes.selectedPlanId||J(t.products[0])),z(t.connected_account_id?1:2))}}),(function(t){C(null),z(2),F(e,t.message)})),setTimeout((function(){return e.selectBlock()}),1e3)}}),[]);var te=Object(R.a)(w).autosaveAndRedirect;return 0!==D||Z?Object(d.createElement)(d.Fragment,null,Object(d.createElement)(b.BlockControls,null,!G&&1!==D&&w&&Object(d.createElement)(m.ToolbarGroup,null,Object(d.createElement)(m.ToolbarButton,{icon:I.l,onClick:te,className:"connect-stripe components-tab-button"},Object(a.__)("Connect Stripe","jetpack"))),Object(d.createElement)(m.ToolbarGroup,null,Object(d.createElement)(m.ToolbarButton,{onClick:function(){o(B[1])},className:"components-tab-button",isPressed:"wp-premium-content-logged-out-view"===r.className},Object(d.createElement)("span",null,Object(a.__)("Visitor View","jetpack"))),Object(d.createElement)(m.ToolbarButton,{onClick:function(){o(B[0])},className:"components-tab-button",isPressed:"wp-premium-content-logged-out-view"!==r.className},Object(d.createElement)("span",null,Object(a.__)("Subscriber View","jetpack"))))),Object(d.createElement)("div",{className:ee,ref:X},(Q||l)&&1===D&&Object(d.createElement)(S,s()({},e,{plans:v,selectedPlanId:e.attributes.selectedPlanId,onSelected:J,getPlanDescription:function(e){var t=Object(j.a)(parseFloat(e.price),e.currency);return"1 month"===e.interval?Object(a.sprintf)(Object(a.__)("%s / month","jetpack"),t):"1 year"===e.interval?Object(a.sprintf)(Object(a.__)("%s / year","jetpack"),t):"one-time"===e.interval?t:Object(a.sprintf)(Object(a.__)("%1$s / %2$s","jetpack"),t,e.interval)}})),(Q||l)&&1===D&&Object(d.createElement)(A,s()({},e,{savePlan:Y,siteSlug:$})),Object(d.createElement)(P.Provider,{value:{selectedTab:r}},Object(d.createElement)(k,null)))):Object(d.createElement)("div",{className:ee,ref:X},Object(d.createElement)(m.Placeholder,{icon:"lock",label:Object(a.__)("Premium Content","jetpack"),instructions:Object(a.__)("Loading data…","jetpack")},Object(d.createElement)(m.Spinner,null)))}function F(e,t){e.createErrorNotice(t,{type:"snackbar"})}var z=Object(h.compose)([Object(f.withSelect)((function(e){return{postId:(0,e("core/editor").getCurrentPostId)()}})),Object(f.withDispatch)((function(e,t){var n=e("core/block-editor"),r=e("core/notices");return{selectBlock:function(){n.selectBlock(t.clientId)},createErrorNotice:r.createErrorNotice,createSuccessNotice:r.createSuccessNotice}}))])((function(e){return Object(d.createElement)(m.Disabled.Consumer,null,(function(t){var n;return Object(d.createElement)(D,s()({},e,{attributes:i()(i()({},e.attributes),{},{isPreview:t||(null===(n=e.attributes)||void 0===n?void 0:n.isPreview)})}))}))}));var U=Object(d.createElement)(m.SVG,{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(m.Path,{d:"M12.7439 14.4271L8.64053 13.165L8.51431 13.8718L8.09208 20.7415C8.06165 21.2365 8.61087 21.5526 9.02363 21.2776L12.7439 18.799L16.7475 21.304C17.1687 21.5676 17.7094 21.2343 17.6631 20.7396L17.0212 13.8718L17.0212 13.165L12.7439 14.4271Z",fill:"black"}),Object(d.createElement)(m.Circle,{cx:"12.7439",cy:"8.69796",r:"5.94466",stroke:"black",strokeWidth:"1.5",fill:"none"}),Object(d.createElement)(m.Path,{d:"M9.71023 8.12461L11.9543 10.3687L15.7776 6.54533",stroke:"black",strokeWidth:"1.5",fill:"none"})),V=function e(t){return 0===t.name.indexOf("premium-content/")||t.innerBlocks.some(e)},G={title:Object(a.__)("Premium Content","jetpack"),description:Object(a.__)("Restrict access to your content for paying subscribers.","jetpack"),icon:U,category:"grow",keywords:[Object(a._x)("paywall","keyword","jetpack"),Object(a._x)("paid","keyword","jetpack"),Object(a._x)("subscribe","keyword","jetpack"),Object(a._x)("membership","keyword","jetpack")],attributes:{newPlanName:{type:"string",default:Object(a.__)("Monthly Subscription","jetpack")},newPlanCurrency:{type:"string",default:"USD"},newPlanPrice:{type:"number",default:5},newPlanInterval:{type:"string",default:"1 month"},selectedPlanId:{type:"number",default:0},isPreview:{type:"boolean",default:!1},isPremiumContentChild:{type:"bool",default:!0}},edit:z,save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-container"},Object(d.createElement)(b.InnerBlocks.Content,null))},providesContext:{"premium-content/planId":"selectedPlanId","premium-content/isPreview":"isPreview",isPremiumContentChild:"isPremiumContentChild"},supports:{html:!1},example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:function(e){if(!e.some(V)&&(t=e[0],!(0,(n=Object(f.select)("core/block-editor")).getBlocksByClientId)((0,n.getBlockParents)(t.clientId)).find((function(e){return 0===e.name.indexOf("premium-content/")})))){var t,n,r=e.map((function(e){return Object(o.createBlock)(e.name,e.attributes,e.innerBlocks)}));return Object(o.createBlock)("premium-content/container",{},[Object(o.createBlock)("premium-content/subscriber-view",{},r),Object(o.createBlock)("premium-content/logged-out-view")])}}}]}};var H=Object(h.compose)(Object(f.withSelect)((function(e){var t=e("core/block-editor"),n=(0,t.getBlockParents)((0,t.getSelectedBlockClientId)());return{parentClientId:n.length?n[n.length-1]:void 0}})))((function(e){var t=e.parentClientId,n=e.isSelected,r=Object(f.useDispatch)("core/block-editor").selectBlock;return Object(d.useEffect)((function(){n&&r(t)}),[r,n,t]),Object(d.createElement)(P.Consumer,null,(function(e){var t=e.selectedTab,n=e.stripeNudge;return Object(d.createElement)("div",{hidden:"premium"===t.id,className:t.className},n,Object(d.createElement)(b.InnerBlocks,{templateLock:!1,templateInsertUpdatesSelection:!1,template:[["core/heading",{content:Object(a.__)("Subscribe to get access","jetpack"),level:3}],["core/paragraph",{content:Object(a.__)("Read more of this content when you subscribe today.","jetpack")}],["premium-content/buttons"]]}))}))}));var q=n(19),W=n.n(q),$=[{attributes:{subscribeButtonText:{type:"string",default:"Subscribe"},loginButtonText:{type:"string",default:"Log In"},buttonClasses:{type:"string",default:""},backgroundButtonColor:{type:"string",default:""},textButtonColor:{type:"string",default:""},customBackgroundButtonColor:{type:"string",default:""},customTextButtonColor:{type:"string",default:""}},isEligible:function(e){return!!e.buttonClasses},migrate:function(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)if(t[n].name&&"premium-content/buttons"===t[n].name)return[e,W()(t)];var r=Object(o.createBlock)("premium-content/buttons",{},[Object(o.createBlock)("jetpack/recurring-payments",{submitButtonText:e.subscribeButtonText,backgroundButtonColor:e.backgroundButtonColor,textButtonColor:e.textButtonColor,customBackgroundButtonColor:e.customBackgroundButtonColor,customTextButtonColor:e.customTextButtonColor}),Object(o.createBlock)("premium-content/login-button",{text:e.loginButtonText,backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,style:{color:{background:e.customBackgroundButtonColor,text:e.customTextButtonColor}}})]);return[e,[].concat(W()(t),[r])]},save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},Object(d.createElement)(b.InnerBlocks.Content,null))}},{attributes:{},supports:{inserter:!1,html:!1},save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-logged-out-view"})}}],K=n(164),Z="premium-content/logged-out-view",Y={title:Object(a.__)("Logged Out View","jetpack"),description:Object(a.__)("The container for all content shown to site visitors who are not subscribers.","jetpack"),icon:U,category:"grow",parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:H,save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-logged-out-view entry-content"},Object(d.createElement)(b.InnerBlocks.Content,null))},deprecated:$},J=Object(f.subscribe)((function(){var e=Object(f.select)("core/rich-text").getFormatType("core/link");if(e){J(),Object(K.unregisterFormatType)("core/link");var t=Object(h.compose)(Object(f.withSelect)((function(e){return{selectedBlock:e("core/block-editor").getSelectedBlock()}})),Object(h.ifCondition)((function(e){return e.selectedBlock&&e.selectedBlock.name!==Z})))(e.edit);Object(K.registerFormatType)("core/link",i()(i()({},e),{},{edit:t}))}}));var X=Object(h.compose)([Object(f.withSelect)((function(e,t){var n=e("core/block-editor"),r=(0,n.getBlockParents)((0,n.getSelectedBlockClientId)());return{parentClientId:r.length?r[r.length-1]:void 0,hasInnerBlocks:!!e("core/block-editor").getBlocksByClientId(t.clientId)[0].innerBlocks.length}}))])((function(e){var t=e.hasInnerBlocks,n=e.parentClientId,r=e.isSelected,o=Object(f.useDispatch)("core/block-editor").selectBlock;return Object(d.useEffect)((function(){r&&o(n)}),[o,r,n]),Object(d.createElement)(P.Consumer,null,(function(e){var n=e.selectedTab,r=e.stripeNudge;return Object(d.createElement)("div",{hidden:"wall"===n.id,className:n.className},r,Object(d.createElement)(b.InnerBlocks,{renderAppender:!t&&b.InnerBlocks.ButtonBlockAppender,templateLock:!1,templateInsertUpdatesSelection:!1,template:[["core/heading",{content:Object(a.__)("Subscriber Content","jetpack"),level:3}],["core/paragraph",{content:Object(a.__)("Add content here that will only be visible to your subscribers.","jetpack")}]]}))}))}));var Q=[{attributes:{},supports:{inserter:!1,html:!1},save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-subscriber-view"})}}],ee={title:Object(a.__)("Subscriber View","jetpack"),description:Object(a.__)("The container for all content shown to subscribers.","jetpack"),icon:U,category:"grow",attributes:{},edit:X,save:function(){return Object(d.createElement)("div",{className:"wp-block-premium-content-subscriber-view entry-content"},Object(d.createElement)(b.InnerBlocks.Content,null))},parent:["premium-content/container"],supports:{inserter:!1,html:!1},deprecated:Q},te=Object(d.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(y.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"})),ne=n(31),re=["core/button","jetpack/recurring-payments","premium-content/login-button"];var ae=Object(h.compose)([Object(f.withSelect)((function(e,t){return{subscribeButton:e("core/block-editor").getBlock(t.clientId).innerBlocks.find((function(e){return"jetpack/recurring-payments"===e.name}))}})),Object(f.withDispatch)((function(e,t){return{setSubscribeButtonPlan:function(n){e("core/block-editor").updateBlockAttributes(t.subscribeButton.clientId,{planId:n})}}}))])((function(e){var t=e.context,n=e.subscribeButton,r=e.setSubscribeButtonPlan,o=t?t["premium-content/planId"]:null,c=!!t&&t["premium-content/isPreview"],i=[["core/button",{element:"a",uniqueId:"recurring-payments-id",text:Object(a.__)("Subscribe","jetpack")}],["premium-content/login-button"]],l=[["jetpack/recurring-payments",{planId:o},[["jetpack/button",{element:"a",uniqueId:"recurring-payments-id",text:Object(a.__)("Subscribe","jetpack")}]]],["premium-content/login-button"]];Object(d.useEffect)((function(){o&&n&&n.attributes.planId!==o&&r(o)}),[o,n,r]),Object(d.useEffect)((function(){n&&Object(ne.addFilter)("jetpack.RecurringPayments.showControls","jetpack/premium-content-hide-recurring-payments-controls",(function(e,t){return t!==n.clientId&&e}))}),[n]);var s=Object(b.useBlockProps)({className:"wp-block-buttons"});return Object(d.createElement)("div",s,Object(d.createElement)(b.InnerBlocks,{allowedBlocks:re,template:c?i:l,templateInsertUpdatesSelection:!1,__experimentalLayout:{type:"default",alignments:[]},__experimentalMoverDirection:"horizontal"}))}));var oe={apiVersion:2,title:Object(a.__)("Premium Content buttons","jetpack"),description:Object(a.__)("Prompt Premium Content visitors to take action with a group of button-style links.","jetpack"),category:"grow",icon:te,supports:{align:!0,alignWide:!1,lightBlockWrapper:!0,inserter:!1},keywords:[Object(a.__)("link","jetpack")],edit:ae,save:function(){var e=b.useBlockProps.save({className:"wp-block-buttons"});return Object(d.createElement)("div",e,Object(d.createElement)(b.InnerBlocks.Content,null))},usesContext:["premium-content/planId","premium-content/isPreview"],deprecated:[{attributes:{},supports:{align:!0,alignWide:!1,lightBlockWrapper:!0,inserter:!1},save:function(){return Object(d.createElement)("div",{className:"wp-block-buttons"},Object(d.createElement)(b.InnerBlocks.Content,null))}}]},ce=n(8),ie=n.n(ce),le=n(5),se=n.n(le),ue=n(3),pe="web"===d.Platform.OS;var de=function e(t){if(!Object(ue.isObject)(t))return t;var n=Object(ue.pickBy)(Object(ue.mapValues)(t,e),ue.identity);return Object(ue.isEqual)(n,{})?void 0:n};function me(e){var t=e.settings,n=e.clientId,r=e.enableContrastChecking,o=void 0===r||r,c=window,i=c.getComputedStyle,l=c.Node,s=Object(d.useState)(),u=p()(s,2),m=u[0],h=u[1],f=Object(d.useState)(),g=p()(f,2),j=g[0],v=g[1],O=pe?Object(a.__)("Color settings","jetpack"):Object(a.__)("Color Settings","jetpack");return Object(d.useEffect)((function(){if(!pe||o){var e=function(e){return document.getElementById("block-"+e)}(n);if(e){v(i(e).color);for(var t=e,r=i(t).backgroundColor;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===l.ELEMENT_NODE;)t=t.parentNode,r=i(t).backgroundColor;h(r)}}})),Object(d.createElement)(b.InspectorControls,null,Object(d.createElement)(b.__experimentalPanelColorGradientSettings,{title:O,initialOpen:!1,settings:t},pe&&o&&Object(d.createElement)(b.ContrastChecker,{backgroundColor:m,textColor:j})))}var be=function(e){var t,n,r,o=e.attributes,c=Object(f.useSelect)((function(e){return e("core/block-editor").getSettings()}),[]),l=c.colors,s=c.gradients,u=Object(d.useRef)(o);Object(d.useEffect)((function(){u.current=o}),[o]);var p,m,h=o.style,g=o.textColor,j=o.backgroundColor,v=o.gradient;p=v?Object(b.getGradientValueBySlug)(s,v):null==h||null===(m=h.color)||void 0===m?void 0:m.gradient;var O=function(t){return function(n){var r,a,o=Object(b.getColorObjectByColorValue)(l,n),c=t+"Color",s=i()(i()({},u.current.style),{},{color:i()(i()({},null===(r=u.current)||void 0===r||null===(a=r.style)||void 0===a?void 0:a.color),{},se()({},t,null!=o&&o.slug?void 0:n))}),p=null!=o&&o.slug?o.slug:void 0,d=se()({style:de(s)},c,p);e.setAttributes(d),u.current=i()(i()({},u.current),d)}};return Object(d.createElement)(me,{enableContrastChecking:!(v||null!=h&&null!==(t=h.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[{label:Object(a.__)("Text Color","jetpack"),onColorChange:O("text"),colorValue:Object(b.getColorObjectByAttributeValues)(l,g,null==h||null===(n=h.color)||void 0===n?void 0:n.text).color},{label:Object(a.__)("Background Color","jetpack"),onColorChange:O("background"),colorValue:Object(b.getColorObjectByAttributeValues)(l,j,null==h||null===(r=h.color)||void 0===r?void 0:r.background).color,gradientValue:p,onGradientChange:function(t){var n,r=Object(b.getGradientSlugByValue)(s,t);if(r){var a,o,c,l=i()(i()({},null===(a=u.current)||void 0===a?void 0:a.style),{},{color:i()(i()({},null===(o=u.current)||void 0===o||null===(c=o.style)||void 0===c?void 0:c.color),{},{gradient:void 0})});n={style:de(l),gradient:r}}else{var p,d,m,h=i()(i()({},null===(p=u.current)||void 0===p?void 0:p.style),{},{color:i()(i()({},null===(d=u.current)||void 0===d||null===(m=d.style)||void 0===m?void 0:m.color),{},{gradient:t})});n={style:de(h),gradient:void 0}}e.setAttributes(n),u.current=i()(i()({},u.current),n)}}]})};function he(e){var t,n,r,a,o,c,i,l,s,u,p,d=e.backgroundColor,m=e.textColor,h=e.gradient,f=e.style,g=Object(b.getColorClassName)("background-color",d),j=Object(b.__experimentalGetGradientClass)(h),v=Object(b.getColorClassName)("color",m),O=ie()(v,j,(o={},se()(o,g,!(null!=f&&null!==(t=f.color)&&void 0!==t&&t.gradient||!g)),se()(o,"has-text-color",m||(null==f||null===(n=f.color)||void 0===n?void 0:n.text)),se()(o,"has-background",d||(null==f||null===(r=f.color)||void 0===r?void 0:r.background)||h||(null==f||null===(a=f.color)||void 0===a?void 0:a.gradient)),o));return{className:O||void 0,style:null!=f&&null!==(c=f.color)&&void 0!==c&&c.background||null!=f&&null!==(i=f.color)&&void 0!==i&&i.text||null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient?{background:null!=f&&null!==(s=f.color)&&void 0!==s&&s.gradient?f.color.gradient:void 0,backgroundColor:null!=f&&null!==(u=f.color)&&void 0!==u&&u.background?f.color.background:void 0,color:null!=f&&null!==(p=f.color)&&void 0!==p&&p.text?f.color.text:void 0}:{}}}function fe(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(d.useCallback)((function(e){r({borderRadius:e})}),[r]);return Object(d.createElement)(m.PanelBody,{title:Object(a.__)("Border settings","jetpack")},Object(d.createElement)(m.RangeControl,{value:n,label:Object(a.__)("Border radius","jetpack"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:o}))}var ge=function(e){var t=e.attributes,n=e.setAttributes,r=e.className,o=t.borderRadius,c=t.text,l=he(t),s=Object(b.useBlockProps)({className:"wp-block-button"});return Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",s,Object(d.createElement)(b.RichText,{placeholder:Object(a.__)("Add text…","jetpack"),value:c,onChange:function(e){return n({text:e})},withoutInteractiveFormatting:!0,className:ie()(r,"wp-block-button__link",l.className,{"no-border-radius":0===o}),style:i()({borderRadius:o?o+"px":void 0},l.style)})),Object(d.createElement)(b.InspectorControls,null,Object(d.createElement)(be,e),Object(d.createElement)(fe,{borderRadius:o,setAttributes:n})))};var je={text:{type:"string",source:"html",selector:"a",default:Object(a.__)("Log in","jetpack")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},ve={attributes:{text:{type:"string",source:"html",selector:"a",default:Object(a.__)("Log in","jetpack")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0,inserter:!1},save:function(e){var t=e.attributes,n=t.borderRadius,r=t.text,a=he(t),o=ie()("wp-block-button__link",a.className,{"no-border-radius":0===n}),c=i()({borderRadius:n?n+"px":void 0},a.style);return Object(d.createElement)("div",{className:"wp-block-button"},Object(d.createElement)(b.RichText.Content,{tagName:"a",className:o,style:c,value:r}))}},Oe={title:Object(a.__)("Premium Content login button","jetpack"),description:Object(a.__)("Prompt subscriber visitors to log in with a button-style link (only visible for logged out users).","jetpack"),category:"grow",attributes:je,icon:te,keywords:[Object(a.__)("link","jetpack")],supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0,inserter:!1},styles:[{name:"fill",label:Object(a.__)("Fill","jetpack"),isDefault:!0},{name:"outline",label:Object(a.__)("Outline","jetpack")}],edit:ge,save:function(e){var t=e.attributes,n=t.borderRadius,r=t.text,a=t.align,o=he(t),c=ie()("wp-block-button","wp-block-premium-content-login-button",{alignleft:"left"===a},{aligncenter:"center"===a},{alignright:"right"===a}),l=ie()("wp-block-button__link",o.className,{"no-border-radius":0===n}),s=i()({borderRadius:n?n+"px":void 0},o.style),u=b.useBlockProps.save({className:c});return Object(d.createElement)("div",u,Object(d.createElement)(b.RichText.Content,{tagName:"a",className:l,style:s,value:r}))},deprecated:[ve]};Object(r.a)("premium-content/container",G,[{name:Z,settings:Y},{name:"premium-content/subscriber-view",settings:ee},{name:"premium-content/buttons",settings:oe},{name:"premium-content/login-button",settings:Oe}],!1)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(11),c=n(4),i=n.n(c),l=n(0),s=n(8),u=n.n(s),p=n(6),d=n(10),m=n(2),b=(n(444),n(5)),h=n.n(b),f=n(9),g=n.n(f),j=n(12),v=n.n(j),O=n(15),k=n.n(O),_=n(13),y=n.n(_),E=n(14),w=n.n(E),C=(n(21),n(59)),x=(Object(l.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(C.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),Object(l.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(C.Path,{d:"M17.5 9a2 2 0 11-4 0 2 2 0 014 0zm-4.25 8v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM8.5 11a2 2 0 100-4 2 2 0 000 4z"})),n(63)),S="is-participant-adding",N="is-participant-selecting",A="was-participant-selected";function T(e){var t=e.participants,n=e.slug,r=e.onSelect;return Object(l.createElement)(m.SelectControl,{label:Object(a.__)("Speaker name","jetpack"),value:n,options:t.map((function(e){var t=e.slug,n=e.label;return{label:Object(x.e)(n),value:t}})),onChange:function(e){return r(Object(x.d)(t,e))}})}var P=Object(m.withFocusOutside)(function(e){y()(n,e);var t=w()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return Object(l.createElement)("div",{className:this.props.className},this.props.children)}}]),n}(l.Component));function I(e){return{name:"jetpack/conversation-participants",triggerPrefix:"",options:e,getOptionLabel:function(e){var t=e.label;return Object(l.createElement)("span",null,Object(x.e)(t))},getOptionKeywords:function(e){return[e.label]},getOptionCompletion:function(e){return{action:"replace",value:e}},popoverProps:{position:"bottom"}}}function M(e){var t=e.className,n=e.label,r=e.participant,o=e.participants,c=e.transcriptRef,s=e.onParticipantChange,d=e.onUpdate,m=void 0===d?function(){}:d,b=e.onSelect,f=e.onAdd,j=e.onClean,v=Object(l.useState)("is-participant-ready"),O=g()(v,2),k=O[0],_=O[1];function y(){if(n){var e=Object(x.c)(o,n);return r&&r.label!==n?e&&e.slug!==r.slug?(_(A),b(e)):(_("was-participant-edited"),m(i()(i()({},r),{},{label:Object(x.e)(n,!0)}))):e?(_(A),b(e)):(f(Object(x.e)(n,!0)),_("was-participant-added"))}}var E=Object(l.useMemo)((function(){return k?k!==S&&k!==N?[]:[I(o)]:[]}),[o,k]);return Object(l.createElement)(P,{className:u()(t,h()({"has-bold-style":null==n?void 0:n.length},k,k)),onFocusOutside:y},Object(l.createElement)(p.RichText,{tagName:"div",value:n,allowedFormats:[],withoutInteractiveFormatting:!0,onChange:function(e){if(null==e||!e.length)return _(S),j();s(e);var t=Object(x.c)(o,e);r?r.label===e?_(N):_("is-participant-editing"):_(t?N:S)},placeholder:Object(a.__)("Speaker","jetpack"),keepPlaceholderOnFocus:!0,onSplit:function(){},onReplace:function(e){setTimeout((function(){var e;return null==c||null===(e=c.current)||void 0===e?void 0:e.focus()}),10);var t=null==e?void 0:e[0];if(t){var n=t.label;return s(n),_(A),b(t)}return y()},autocompleters:E}))}var R=n(3),B=n(111),L=mejs.Utils.secondsToTimeCode,D=mejs.Utils.timeCodeToSeconds;var F=["hour","min","sec"];function z(e,t){var n,r,a,o=null===(n=Object.keys(e))||void 0===n?void 0:n[0];if(!o)return t.join(":");var c,i,l=String((c=e[o],i="hour"===o?23:59,Math.max(0,Math.min(c,i))));return 1===(null===(r=l)||void 0===r?void 0:r.length)?l="0".concat(l):0===(null===(a=l)||void 0===a?void 0:a.length)&&(l="00"),t[F.indexOf(o)]=l,3===t.length&&"00"===t[0]&&t.shift(),t.join(":")}var U=Object(R.debounce)((function(e,t){t(L(e))}),250);function V(e){var t=e.value,n=e.className,r=e.onChange,o=e.shortLabel,c=void 0!==o&&o,i=e.isDisabled,s=void 0!==i&&i,u=e.duration,p=Object(l.useState)(D(t)),d=g()(p,2),b=d[0],h=d[1],f=t.split(":");return f.length<=2&&f.unshift("00"),Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"".concat(n,"__timestamp-controls")},Object(l.createElement)(B.a,{className:"".concat(n,"__timestamp-control__hour"),label:c?Object(a._x)("Hour","hour (short form)","jetpack"):Object(a._x)("Hour","hour (long form)","jetpack"),value:f[0],min:0,max:23,onChange:function(e){return!s&&r(z({hour:e},f))},disabled:s}),Object(l.createElement)(B.a,{className:"".concat(n,"__timestamp-control__minute"),label:c?Object(a._x)("Min","Short for Minute","jetpack"):Object(a.__)("Minute","jetpack"),value:f[1],min:0,max:59,onChange:function(e){return!s&&r(z({min:e},f))},disabled:s}),Object(l.createElement)(B.a,{className:"".concat(n,"__timestamp-control__second"),label:c?Object(a._x)("Sec","Short for Second","jetpack"):Object(a.__)("Second","jetpack"),value:f[2],min:0,max:59,onChange:function(e){return!s&&r(z({sec:e},f))},disabled:s})),Object(l.createElement)(m.RangeControl,{disabled:void 0===u,value:b,className:"".concat(n,"__timestamp-range-control"),min:0,max:u,onChange:function(e){h(e),U(e,r)},withInputField:!1,renderTooltipContent:function(e){return L(e)}}))}function G(e){var t=e.className,n=e.onPlayback,r=e.value;return Object(l.createElement)(m.Button,{className:t,isTertiary:!0,onClick:function(){return n(D(r))}},r)}function H(e){var t=e.className,n=e.currentTime,r=e.isTimestampButtonVisible,a=e.children,o=e.onChange,c=e.onToggle;return Object(l.createElement)(m.Button,{className:t,isSmall:!0,isTertiary:!0,onClick:function(){c(!r),r||o(L(n),o)}},a)}function q(e){var t=e.className,n=e.isSelected,r=e.show,o=e.value,c=e.mediaCurrentTime,i=void 0===c?0:c,s=e.onChange,u=e.onToggle,p=e.onPlayback;return n?r?Object(l.createElement)(l.Fragment,null,Object(l.createElement)(G,{className:"".concat(t,"__timestamp-label"),value:o,onPlayback:p}),Object(l.createElement)(H,{className:"".concat(t,"__timestamp-button"),currentTime:i,onChange:s,onToggle:u,isTimestampButtonVisible:r},Object(a.__)("Remove","jetpack"))):Object(l.createElement)(H,{className:"".concat(t,"__timestamp-button"),currentTime:i,onChange:s,onToggle:u,isTimestampButtonVisible:r},Object(a.__)("Add timestamp","jetpack")):r?Object(l.createElement)(G,{className:"".concat(t,"__timestamp-label"),value:o,onPlayback:p}):null}var W="wp-block-jetpack-dialogue",$=n(242),K=n(32),Z=(n(445),n(33));function Y(e){var t=e.skipForwardTime,n=void 0===t?5:t,r=e.jumpBackTime,o=void 0===r?5:r,c=e.playIcon,i=void 0===c?"controls-play":c,s=e.pauseIcon,p=void 0===s?"controls-pause":s,b=e.jumpBackIcon,h=void 0===b?Z.a:b,f=e.skipForwardIcon,g=void 0===f?Z.b:f,j=e.currenTimeDisplay,v=void 0===j||j,O=e.onTimestampClick,k=Object(d.useSelect)((function(e){var t=e(K.d),n=t.getMediaSourceCurrentTime,r=t.getMediaPlayerState,a=t.getDefaultMediaSource,o=t.getMediaSourceDuration,c=t.getMediaSourceDomReference;return{playerState:r(),mediaCurrentTime:n(),mediaDuration:o(),defaultMediaSource:a(),mediaDomReference:c()}}),[]),_=k.playerState,y=k.mediaCurrentTime,E=k.defaultMediaSource,w=k.mediaDomReference,C=L(y),x=!E,S=Object(d.useDispatch)(K.d),N=S.toggleMediaSource,A=S.setMediaSourceCurrentTime;function T(e){!function(e){w&&(w.currentTime=e),A(E.id,e)}(e),w&&(w.currentTime=e)}return Object(l.createElement)(l.Fragment,null,!1!==o&&Object(l.createElement)(m.ToolbarButton,{icon:h,isDisabled:x,onClick:function(){return T(y-o)},label:Object(a.__)("Jump back","jetpack")}),Object(l.createElement)(m.ToolbarButton,{icon:_===K.b?i:p,isDisabled:x,onClick:function(){N(E.id)},label:Object(a.__)("Play","jetpack")}),n&&Object(l.createElement)(m.ToolbarButton,{icon:g,isDisabled:x,onClick:function(){return T(y+n)},label:Object(a.__)("Skip forward","jetpack")}),v&&Object(l.createElement)(m.ToolbarButton,{className:u()("media-player-control__current-time",{"is-disabled":x}),label:Object(a.__)("Set timestamp","jetpack"),onClick:function(){return O(y)}},C))}function J(e){return Object(l.createElement)(m.ToolbarGroup,{className:"media-player-control__toolbar"},Object(l.createElement)(m.ToolbarItem,null,(function(){return Object(l.createElement)(Y,e)})))}var X="core/paragraph";var Q=n(436),ee=n(212),te=(n(424),{title:Object(a.__)("Dialogue","jetpack"),description:Object(a.__)("Create a dialogue paragraph, setting the participant with an optional timestamp.","jetpack"),parent:["jetpack/".concat(ee.a)],icon:Z.k,category:"layout",edit:function(e){var t=e.className,n=e.attributes,r=e.setAttributes,c=e.context,s=e.onReplace,b=e.mergeBlocks,h=e.isSelected,f=n.content,g=n.label,j=n.slug,v=n.placeholder,O=n.showTimestamp,k=n.timestamp,_=Object(d.useSelect)((function(e){var t=e(K.d),n=t.getDefaultMediaSource,r=t.getMediaSourceCurrentTime,a=t.getMediaSourceDuration,o=t.getMediaSourceDomReference;return{mediaSource:n(),mediaCurrentTime:r(),mediaDuration:a(),mediaDomReference:o(),isMultipleSelection:e("core/block-editor").getMultiSelectedBlocks().length>0}}),[]),y=_.mediaSource,E=_.mediaCurrentTime,w=_.mediaDuration,C=_.mediaDomReference,S=_.isMultipleSelection,N=Object(d.useDispatch)(K.d),A=N.playMediaSource,P=N.setMediaSourceCurrentTime,I=Object(l.useRef)(),R=c["jetpack/conversation-participants"],B=null!=R&&R.length?R:[],D=Object(x.d)(B,j),F=Object(l.useContext)($.a);function z(e){r({timestamp:e})}return Object(l.useEffect)((function(){S||h||D&&D.slug===j&&D.label!==g&&r({label:D.label})}),[D,g,j,S,h,r]),Object(l.createElement)("div",{className:t},Object(l.createElement)(p.BlockControls,null,y&&Object(l.createElement)(J,{onTimestampClick:function(e){r({showTimestamp:!0}),z(L(e))}})),Object(l.createElement)(p.InspectorControls,null,Object(l.createElement)(m.Panel,null,Object(l.createElement)(m.PanelBody,{title:Object(a.__)("Speaker","jetpack")},Object(l.createElement)(T,{className:W,participants:B,slug:j||"",onSelect:r})),!(null==y||!y.title)&&Object(l.createElement)(m.PanelBody,{title:Object(a.__)("Podcast episode","jetpack")},Object(l.createElement)("p",null,y.title)),y&&O&&Object(l.createElement)(m.PanelBody,{title:Object(a.__)("Timestamp","jetpack")},Object(l.createElement)(V,{className:W,value:k,onChange:z,mediaSource:y,duration:w})))),Object(l.createElement)("div",{className:u()("".concat(W,"__meta"),{"has-not-media-source":!y})},Object(l.createElement)(M,{className:"".concat(W,"__participant"),label:g,participant:D,participants:B,transcriptRef:I,onParticipantChange:function(e){r({label:e})},onSelect:function(e){S||r(e)},onClean:function(){r({slug:null,label:""})},onAdd:function(e){var t=F.addNewParticipant({label:e,slug:j});r(t)},onUpdate:function(e){F.updateParticipants(e)}}),y&&Object(l.createElement)(q,{className:W,show:O,isSelected:h,value:k,mediaCurrentTime:E,onChange:z,onToggle:function(e){return r({showTimestamp:e})},onPlayback:function(e){C&&(C.currentTime=e),P(e),A()}})),Object(l.createElement)(p.RichText,{ref:I,identifier:"content",tagName:"p",className:"".concat(W,"__content"),value:f,onChange:function(e){return r({content:e})},onMerge:b,onSplit:function(e){if(null==f||!f.length)return Object(o.createBlock)(X);var t=null!=e&&e.length?n:{};return Object(o.createBlock)("jetpack/dialogue",i()(i()({},t),{},{content:e}))},onReplace:function(e){for(var t,n,r,a,o=arguments.length,c=new Array(o>1?o-1:0),i=1;i<o;i++)c[i-1]=arguments[i];return F?(null===(t=e[0])||void 0===t?void 0:t.name)!==X||(null===(n=e[1])||void 0===n?void 0:n.name)!==X||null!==(r=e[0])&&void 0!==r&&r.attributes.content||null!==(a=e[1])&&void 0!==a&&a.attributes.content?void s.apply(void 0,[e].concat(c)):(Object(d.dispatch)("core/block-editor").selectBlock(e[0].clientId),s.apply(void 0,[[e[0]]].concat(c))):s.apply(void 0,[e].concat(c))},onRemove:s?function(){return s([])}:void 0,placeholder:v||Object(a.__)("Write dialogue…","jetpack"),keepPlaceholderOnFocus:!0}))},save:function(e){var t=e.attributes,n=t.content,r=t.label,a=t.showTimestamp,o=t.timestamp;return Object(l.createElement)("div",null,Object(l.createElement)("div",{className:"".concat(W,"__meta")},Object(l.createElement)(p.RichText.Content,{className:"".concat(W,"__participant has-bold-style"),tagName:"div",value:r}),a&&Object(l.createElement)("div",{className:"".concat(W,"__timestamp-label")},Object(l.createElement)("a",{className:"".concat(W,"__timestamp_link"),href:"#".concat(D(o))},o))),Object(l.createElement)(p.RichText.Content,{className:"".concat(W,"__content"),tagName:"p",value:n}))},attributes:{label:{type:"string",source:"html",selector:".wp-block-jetpack-dialogue__participant"},slug:{type:"string"},timestamp:{type:"string",default:"00:00"},showTimestamp:{type:"boolean",default:!1},placeholder:{type:"string"},content:{type:"string",source:"html",selector:".wp-block-jetpack-dialogue__content"}},usesContext:["jetpack/conversation-participants","jetpack/conversation-showTimestamps"],keywords:[Object(a._x)("dialogue","block search term","jetpack"),Object(a._x)("participant","block search term","jetpack"),Object(a._x)("transcription","block search term","jetpack"),Object(a._x)("speaker","block search term","jetpack")],transforms:{to:[{type:"block",blocks:["core/paragraph"],isMultiBlock:!0,transform:function(e){return e.map((function(e){var t=e.content,n=e.label;return Object(o.createBlock)("core/paragraph",{content:(null!=n&&n.length?"<strong>".concat(n,"</strong>: "):"")+t})}))}}],from:[{type:"block",blocks:["core/paragraph"],isMultiBlock:!0,transform:function(e){return e.map((function(e){var t=e.content;return Object(o.createBlock)("jetpack/dialogue",{participant:Q.a[0],content:t})}))}}]}});Object(r.a)("dialogue",te)},function(e,t,n){"use strict";n.r(t);var r=n(4),a=n.n(r),o=n(9),c=n.n(o),i=n(26),l=n.n(i),s=n(0),u=n(3),p=n(18),d=n(10),m=n(74),b=n(529),h=n(59),f=Object(s.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(h.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),g=n(1),j=n(82),v=n(2),O=(n(158),function(){var e=l()(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=Object(d.subscribe)((function(){Object(d.select)("core/editor").isCleanNewPost()&&(t(),e()),Object(d.select)("core/editor").getBlocks().length>0&&(t(),e())}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),k=n(19),_=n.n(k),y=n(11),E=n(16),w=n(137);function C(e){var t=e.spotifyShowUrl;return[["core/image",{url:e.spotifyImageUrl,linkDestination:"none",href:t,align:"center",width:165,height:40,className:"is-spotify-podcast-badge"}]]}function x(e){var t,n=e.spotifyShowUrl,r=e.spotifyImageUrl,a=e.episodeTrack,o=void 0===a?{}:a,c=e.feedUrl,i=_()(function(e){var t=e.episodeTrack,n=e.feedUrl,r=t.guid;return[["jetpack/podcast-player",{customPrimaryColor:Object(E.a)(),hexPrimaryColor:Object(E.a)(),url:n,selectedEpisodes:r?[{guid:r}]:[],showCoverArt:!1,showEpisodeTitle:!1,showEpisodeDescription:!1}]]}({episodeTrack:o,feedUrl:c}));return n&&r&&i.push.apply(i,_()(C({spotifyShowUrl:n,spotifyImageUrl:r}))),i.push.apply(i,_()(function(e){var t=e.episodeTrack,n=[["core/heading",{level:3,content:Object(g._x)("Summary","noun: summary of a podcast episode","jetpack"),placeholder:Object(g.__)("Podcast episode title","jetpack")}]],r=Object(y.pasteHandler)({HTML:t.description_html,mode:"BLOCKS"});return r.length?n.push.apply(n,_()(r)):n.push(["core/paragraph",{placeholder:Object(g.__)("Podcast episode summary","jetpack")}]),n}({episodeTrack:o}))),i.push.apply(i,_()((t="jetpack/conversation",Object(d.select)("core/blocks").getBlockType(t)?[[t,{participants:[{slug:"participant-0",label:Object(g.__)("Speaker 1","jetpack")},{slug:"participant-1",label:Object(g.__)("Speaker 2","jetpack")},{slug:"participant-2",label:Object(g.__)("Speaker 3","jetpack")}]},[["core/heading",{level:3,content:Object(g.__)("Transcription","jetpack"),placeholder:Object(g.__)("Podcast episode transcription","jetpack")}],["jetpack/dialogue",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack"),slug:"participant-0"}],["jetpack/dialogue",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack"),slug:"participant-1"}],["jetpack/dialogue",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack"),slug:"participant-2"}]]]]:[["core/heading",{level:3,content:Object(g.__)("Transcription","jetpack"),placeholder:Object(g.__)("Podcast episode transcription","jetpack")}],["core/paragraph",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack")}],["core/paragraph",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack")}],["core/paragraph",{placeholder:Object(g.__)("Podcast episode dialogue","jetpack")}]]))),i}function S(e){return Object(w.a)(x(e))}function N(e){if(e.spotifyImageUrl&&e.spotifyShowUrl)return Object(w.a)(_()(C(e)))}var A=n(62);n(440);function T(_x){return P.apply(this,arguments)}function P(){return(P=l()(regeneratorRuntime.mark((function e(t){var n,r,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:r=Object(d.dispatch)("core/block-editor"),a=r.insertBlocks,e.t0=t.tpl,e.next="spotifyBadge"===e.t0?6:"basicEpisode"===e.t0?8:10;break;case 6:return o=N(t),e.abrupt("break",10);case 8:return o=S(t),e.abrupt("break",10);case 10:null!==(n=o)&&void 0!==n&&n.length&&a(o,0,void 0,!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(){return(I=l()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.title){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,O();case 5:Object(d.dispatch)("core/editor").editPost({title:n});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M,R=function(){Object(p.useEffect)((function(){A.a.tracks.recordEvent("jetpack_editor_block_anchor_fm_post_publish_impression")}),[]);var e=Object(p.useCallback)((function(){return A.a.tracks.recordEvent("jetpack_editor_block_anchor_fm_post_publish_click")}),[]);return Object(s.createElement)(m.PluginPostPublishPanel,{className:"anchor-post-publish-outbound-link"},Object(s.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},Object(s.createElement)("strong",null,Object(g.__)("Convert to audio","jetpack"))),Object(s.createElement)("p",null,Object(g.__)("Seamlessly turn this post into a podcast episode with Anchor - and let readers listen to your post.","jetpack")),Object(s.createElement)("div",{role:"link",className:"post-publish-panel__postpublish-buttons",tabIndex:0,onClick:e,onKeyDown:e},Object(s.createElement)(v.Button,{isPrimary:!0,href:"https://anchor.fm/wordpressdotcom",target:"_top"},Object(g.__)("Create a podcast episode","jetpack")," ",Object(s.createElement)(b.a,{icon:f,className:"anchor-post-publish-outbound-link__external_icon"}))))};"object"==typeof(M=window.Jetpack_AnchorFm)&&M.actions.forEach((function(e){var t,n=Object(u.castArray)(e),r=c()(n,2),o=r[0],i=r[1];switch(o){case"insert-spotify-badge":T(a()(a()({},i),{},{tpl:"spotifyBadge"}));break;case"insert-episode-template":T(a()(a()({},i),{},{tpl:"basicEpisode"}));break;case"show-post-publish-outbound-link":Object(j.registerPlugin)("anchor-post-publish-outbound-link",{render:R});break;case"set-episode-title":!function(e){I.apply(this,arguments)}(i);break;case"create-episode-error-notice":t=i,Object(d.dispatch)("core/notices").createNotice("error",Object(g.__)("We couldn't find that episode in your feed. If you just published the episode, please try creating the post again in a few minutes.","jetpack"),{id:"episode-error-notice",actions:[{onClick:function(){window.location.href=t.retry_url},onKeyDown:function(){window.location.href=t.retry_url},label:Object(g.__)("Retry","jetpack")}]})}}))},,,function(e,t,n){},,,,function(e,t,n){var r;!function(a){var o=/^\s+/,c=/\s+$/,i=0,l=a.round,s=a.min,u=a.max,p=a.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,l=null,p=!1,d=!1;"string"==typeof e&&(e=function(e){e=e.replace(o,"").replace(c,"").toLowerCase();var t,n=!1;if(A[e])e=A[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=G.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=G.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=G.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=G.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=G.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=G.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=G.hex8.exec(e))return{r:R(t[1]),g:R(t[2]),b:R(t[3]),a:F(t[4]),format:n?"name":"hex8"};if(t=G.hex6.exec(e))return{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:n?"name":"hex"};if(t=G.hex4.exec(e))return{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),a:F(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=G.hex3.exec(e))return{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==typeof e&&(H(e.r)&&H(e.g)&&H(e.b)?(m=e.r,b=e.g,h=e.b,t={r:255*I(m,255),g:255*I(b,255),b:255*I(h,255)},p=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):H(e.h)&&H(e.s)&&H(e.v)?(r=L(e.s),i=L(e.v),t=function(e,t,n){e=6*I(e,360),t=I(t,100),n=I(n,100);var r=a.floor(e),o=e-r,c=n*(1-t),i=n*(1-o*t),l=n*(1-(1-o)*t),s=r%6;return{r:255*[n,i,c,c,l,n][s],g:255*[l,n,n,i,c,c][s],b:255*[c,c,l,n,n,i][s]}}(e.h,r,i),p=!0,d="hsv"):H(e.h)&&H(e.s)&&H(e.l)&&(r=L(e.s),l=L(e.l),t=function(e,t,n){var r,a,o;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=I(e,360),t=I(t,100),n=I(n,100),0===t)r=a=o=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=c(l,i,e+1/3),a=c(l,i,e),o=c(l,i,e-1/3)}return{r:255*r,g:255*a,b:255*o}}(e.h,r,l),p=!0,d="hsl"),e.hasOwnProperty("a")&&(n=e.a));var m,b,h;return n=P(n),{ok:p,format:e.format||d,r:s(255,u(t.r,0)),g:s(255,u(t.g,0)),b:s(255,u(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=l(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=n.ok,this._tc_id=i++}function m(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,a,o=u(e,t,n),c=s(e,t,n),i=(o+c)/2;if(o==c)r=a=0;else{var l=o-c;switch(a=i>.5?l/(2-o-c):l/(o+c),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:a,l:i}}function b(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,a,o=u(e,t,n),c=s(e,t,n),i=o,l=o-c;if(a=0===o?0:l/o,o==c)r=0;else{switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:a,v:i}}function h(e,t,n,r){var a=[B(l(e).toString(16)),B(l(t).toString(16)),B(l(n).toString(16))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(e,t,n,r){return[B(D(r)),B(l(e).toString(16)),B(l(t).toString(16)),B(l(n).toString(16))].join("")}function g(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.s-=t/100,n.s=M(n.s),d(n)}function j(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.s+=t/100,n.s=M(n.s),d(n)}function v(e){return d(e).desaturate(100)}function O(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.l+=t/100,n.l=M(n.l),d(n)}function k(e,t){t=0===t?0:t||10;var n=d(e).toRgb();return n.r=u(0,s(255,n.r-l(-t/100*255))),n.g=u(0,s(255,n.g-l(-t/100*255))),n.b=u(0,s(255,n.b-l(-t/100*255))),d(n)}function _(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.l-=t/100,n.l=M(n.l),d(n)}function y(e,t){var n=d(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,d(n)}function E(e){var t=d(e).toHsl();return t.h=(t.h+180)%360,d(t)}function w(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+120)%360,s:t.s,l:t.l}),d({h:(n+240)%360,s:t.s,l:t.l})]}function C(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+90)%360,s:t.s,l:t.l}),d({h:(n+180)%360,s:t.s,l:t.l}),d({h:(n+270)%360,s:t.s,l:t.l})]}function x(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+72)%360,s:t.s,l:t.l}),d({h:(n+216)%360,s:t.s,l:t.l})]}function S(e,t,n){t=t||6,n=n||30;var r=d(e).toHsl(),a=360/n,o=[d(e)];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,o.push(d(r));return o}function N(e,t){t=t||6;for(var n=d(e).toHsv(),r=n.h,a=n.s,o=n.v,c=[],i=1/t;t--;)c.push(d({h:r,s:a,v:o})),o=(o+i)%1;return c}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:a.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:a.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:a.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=P(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=b(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=m(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=m(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,a){var o=[B(l(e).toString(16)),B(l(t).toString(16)),B(l(n).toString(16)),B(D(r))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*I(this._r,255))+"%",g:l(100*I(this._g,255))+"%",b:l(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*I(this._r,255))+"%, "+l(100*I(this._g,255))+"%, "+l(100*I(this._b,255))+"%)":"rgba("+l(100*I(this._r,255))+"%, "+l(100*I(this._g,255))+"%, "+l(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(T[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+f(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var a=d(e);n="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(O,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(j,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:L(e[r]));e=n}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:p(),g:p(),b:p()})},d.mix=function(e,t,n){n=0===n?0:n||50;var r=d(e).toRgb(),a=d(t).toRgb(),o=n/100;return d({r:(a.r-r.r)*o+r.r,g:(a.g-r.g)*o+r.g,b:(a.b-r.b)*o+r.b,a:(a.a-r.a)*o+r.a})},d.readability=function(e,t){var n=d(e),r=d(t);return(a.max(n.getLuminance(),r.getLuminance())+.05)/(a.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,n){var r,a,o=d.readability(e,t);switch(a=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},d.mostReadable=function(e,t,n){var r,a,o,c,i=null,l=0;a=(n=n||{}).includeFallbackColors,o=n.level,c=n.size;for(var s=0;s<t.length;s++)(r=d.readability(e,t[s]))>l&&(l=r,i=d(t[s]));return d.isReadable(e,i,{level:o,size:c})||!a?i:(n.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],n))};var A=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T=d.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(A);function P(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=s(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),a.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return s(1,u(0,e))}function R(e){return parseInt(e,16)}function B(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function D(e){return a.round(255*parseFloat(e)).toString(16)}function F(e){return R(e)/255}var z,U,V,G=(U="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",V="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+V),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!G.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,n,t,e))||(e.exports=r)}(Math)},,,,function(e,t,n){n(382),n(403),n(390),n(394),n(383),n(387),n(385),n(395),n(435),n(396),n(400),n(429),n(393),n(431),n(397),n(388),n(404),n(391),n(392),n(426),n(425),n(405),n(401),n(406),n(407),n(398),n(427),n(432),n(433),n(434),n(389),n(399),n(428),n(430),n(384),n(381),n(386),n(402),n(448),n(446),n(442),n(447),e.exports=n(528)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(36),c={backgroundColor:{type:"string",validator:o.a},textColor:{type:"string",validator:o.a},buttonAndLinkColor:{type:"string",validator:o.a},style:{type:"string",default:"small",validValues:["small","large"]},asin:{type:"string"},showImage:{default:!0,type:"boolean"},showTitle:{default:!0,type:"boolean"},showSeller:{default:!1,type:"boolean"},showPrice:{default:!0,type:"boolean"},showPurchaseButton:{default:!0,type:"boolean"}},i=n(9),l=n.n(i),s=n(0),u=n(455),p=n.n(u),d=n(6),m=n(2),b=n(11),h=Object(s.createElement)(m.SVG,{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},Object(s.createElement)(m.Path,{clipRule:"evenodd",d:"m13.958 10.09c0 1.232.029 2.256-.591 3.351-.502.891-1.301 1.438-2.186 1.438-1.214 0-1.922-.924-1.922-2.292 0-2.692 2.415-3.182 4.7-3.182v.685zm3.186 7.705c-.209.189-.512.201-.745.074-1.052-.872-1.238-1.276-1.814-2.106-1.734 1.767-2.962 2.297-5.209 2.297-2.66 0-4.731-1.641-4.731-4.925 0-2.565 1.391-4.309 3.37-5.164 1.715-.754 4.11-.891 5.942-1.095v-.41c0-.753.06-1.642-.383-2.294-.385-.579-1.124-.82-1.775-.82-1.205 0-2.277.618-2.54 1.897-.054.285-.261.567-.549.582l-3.061-.333c-.259-.056-.548-.266-.472-.66.704-3.716 4.06-4.838 7.066-4.838 1.537 0 3.547.41 4.758 1.574 1.538 1.436 1.392 3.352 1.392 5.438v4.923c0 1.481.616 2.13 1.192 2.929.204.287.247.63-.01.839-.647.541-1.794 1.537-2.423 2.099zm3.559 1.988c-2.748 1.472-5.735 2.181-8.453 2.181-4.027 0-7.927-1.393-11.081-3.706-.277002-.202-.481003.154-.251003.416 2.925003 3.326 6.786003 5.326 11.076003 5.326 3.061 0 6.614-1.214 9.066-3.494.406-.377.058-.945-.357-.723zm.67 2.216c-.091.227.104.32.31.147 1.339-1.12 1.685-3.466 1.411-3.804-.272-.336-2.612-.626-4.04.377-.22.154-.182.367.062.337.805-.096 2.595-.312 2.913.098.319.41-.355 2.094-.656 2.845z",fillRule:"evenodd"})),f={products:[{title:"New York Biology Dead Sea Mud Mask for Face and Body - All Natural - Spa Quality Pore Reducer for Acne, Blackheads and Oily Skin - Tightens Skin for A Healthier Complexion - 8.8 oz",asin:"B01NCM25K7",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"New York Biology",detailPageUrl:"https://www.amazon.com/New-York-Biology-Dead-Mask/dp/B01NCM25K7?psc=1&SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B01NCM25K7",listPrice:"$14.95",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:62,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:133,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL.jpg",imageHeightLarge:500,imageWidthLarge:415,authorshipInfo:"New York Biology"},{title:"Face/Off",asin:"B002PT1KH6",productGroup:"Movie",authors:[],artists:[],actors:["John Travolta","Nicolas Cage","Joan Allen","Alessandro Nivola","Gina Gershon"],detailPageUrl:"https://www.amazon.com/Face-Off-John-Travolta/dp/B002PT1KH6?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B002PT1KH6",listPrice:"$9.99",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51TyrHec4QL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:50,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51TyrHec4QL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:107,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51TyrHec4QL.jpg",imageHeightLarge:500,imageWidthLarge:333,authorshipInfo:"Starring John Travolta, Nicolas Cage, Joan Allen, Alessandro Nivola, Gina Gershon"},{title:"PIXNOR Facial Cleansing Brush [Newest 2020], Waterproof Face Spin Brush with 7 Brush Heads for Deep Cleansing, Gentle Exfoliating, Removing Blackhead, Massaging(Pink)",asin:"B077ZW5YQP",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"PIXNOR",detailPageUrl:"https://www.amazon.com/PIXNOR-Cleansing-Waterproof-Exfoliating-Blackhead/dp/B077ZW5YQP?psc=1&SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B077ZW5YQP",listPrice:"$39.99",salePrice:"$22.99",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/41KQCaa1hjL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/41KQCaa1hjL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/41KQCaa1hjL.jpg",imageHeightLarge:500,imageWidthLarge:500,authorshipInfo:"PIXNOR"},{title:"BESTOPE Blackhead Remover Pimple Comedone Extractor Tool Best Acne Removal Kit - Treatment for Blemish, Whitehead Popping, Zit Removing for Risk Free Nose Face Skin with Metal Case",asin:"B019SVHLEY",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"Doctor PimplePopper",detailPageUrl:"https://www.amazon.com/BESTOPE-Blackhead-Remover-Comedone-Extractor/dp/B019SVHLEY?psc=1&SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B019SVHLEY",listPrice:"$7.99",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51QHC5fDdfL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51QHC5fDdfL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51QHC5fDdfL.jpg",imageHeightLarge:500,imageWidthLarge:500,authorshipInfo:"Doctor PimplePopper"},{title:"Welcome to the Jungle",asin:"B004L3L9PM",productGroup:"TV Series Episode Video on Demand",authors:[],artists:[],actors:[],detailPageUrl:"https://www.amazon.com/Welcome-to-the-Jungle/dp/B004L3L9PM?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B004L3L9PM",listPrice:"$2.99",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51KBv1L7lJL._SL75_.jpg",imageHeightSmall:56,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51KBv1L7lJL._SL160_.jpg",imageHeightMedium:120,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51KBv1L7lJL.jpg",imageHeightLarge:375,imageWidthLarge:500,authorshipInfo:""},{title:"Black Charcoal Mask - Face Peel Off Mask with Organic Bamboo and Vitamin C - Deep Cleansing Pore Blackhead Removal and Purifying Black Mask for Men and Women",asin:"B07V1MPG8N",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"O'linear",detailPageUrl:"https://www.amazon.com/Black-Charcoal-Mask-Cleansing-Blackhead/dp/B07V1MPG8N?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07V1MPG8N",listPrice:"$7.49",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51QkF1BReJL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51QkF1BReJL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51QkF1BReJL.jpg",imageHeightLarge:500,imageWidthLarge:500,authorshipInfo:"O'linear"},{title:"Girl, Wash Your Face: Stop Believing the Lies about Who You Are So You Can Become Who You Were Meant to Be",asin:"1400201659",productGroup:"Book",authors:["Rachel Hollis"],artists:[],actors:[],manufacturer:"Thomas Nelson",detailPageUrl:"https://www.amazon.com/Girl-Wash-Your-Face-Believing/dp/1400201659?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1400201659",listPrice:"$11.88",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51uuwa-5OgL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:49,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51uuwa-5OgL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:104,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51uuwa-5OgL.jpg",imageHeightLarge:500,imageWidthLarge:326,authorshipInfo:"By Rachel Hollis"},{title:"Death Dealers",asin:"B07F75BN4W",productGroup:"TV Series Episode Video on Demand",authors:[],artists:[],actors:[],detailPageUrl:"https://www.amazon.com/Death-Dealers/dp/B07F75BN4W?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07F75BN4W",listPrice:"$1.99",authorshipInfo:""},{title:"eDiva Natural Jade Roller- Gua Sha - Lymphatic Drainage Tool for Face, Neck, Body - Anti Aging Treatment - Reduces Wrinkles and Fine Lines",asin:"B07HHF37F7",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"eDiva",detailPageUrl:"https://www.amazon.com/eDiva-Natural-Jade-Roller-Gua/dp/B07HHF37F7?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07HHF37F7",listPrice:"$49.95",salePrice:"$22.95",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/41DWi8-M92L._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/41DWi8-M92L._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/41DWi8-M92L.jpg",imageHeightLarge:500,imageWidthLarge:500,authorshipInfo:"eDiva"},{title:"Pack Leaders",asin:"B071GRS6R9",productGroup:"TV Series Episode Video on Demand",authors:[],artists:[],actors:["McKenzie Westmore","Ve Neill","Glenn Hetrick","Neville Page","Michael Westmore"],detailPageUrl:"https://www.amazon.com/Pack-Leaders/dp/B071GRS6R9?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B071GRS6R9",listPrice:"$2.99",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51rP3BM0oxL._SL75_.jpg",imageHeightSmall:56,imageWidthSmall:75,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51rP3BM0oxL._SL160_.jpg",imageHeightMedium:120,imageWidthMedium:160,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51rP3BM0oxL.jpg",imageHeightLarge:375,imageWidthLarge:500,authorshipInfo:"Starring McKenzie Westmore, Ve Neill, Glenn Hetrick, Neville Page, Michael Westmore"}]};n(451);var g=Object(m.withNotices)((function(e){var t,n,r,o,c,i,u,g,j,v,O=e.attributes,k=O.backgroundColor,_=O.textColor,y=O.buttonAndLinkColor,E=O.asin,w=O.showImage,C=O.showTitle,x=O.showSeller,S=O.showPrice,N=O.showPurchaseButton,A=e.className,T=e.name,P=e.noticeUI,I=e.setAttributes,M=Object(b.getBlockDefaultClassName)(T),R=Object(s.useState)([]),B=l()(R,2),L=B[0],D=B[1],F=/^(\d+)$|\(ASIN:(.+)\)$/,z=Object(s.createElement)(m.Placeholder,{label:Object(a.__)("Amazon","jetpack"),instructions:Object(a.__)("Search by entering an Amazon product name or ID below.","jetpack"),icon:Object(s.createElement)(d.BlockIcon,{icon:h}),notices:P},Object(s.createElement)("form",null,Object(s.createElement)(m.FormTokenField,{value:E,suggestions:L,onInputChange:function(){D(f.products.map((function(e){return"".concat(e.title," (ASIN:").concat(e.asin,")")})))},maxSuggestions:10,label:Object(a.__)("Products","jetpack"),onChange:function(e){var t=e.map((function(e){var t=F.exec(e),n=t[1]||t[2];return f.products.filter((function(e){return e.asin===n}))}));I({asin:t[0][0].asin})}}),Object(s.createElement)(m.Button,{isSecondary:!0,isLarge:!0,type:"submit"},Object(a.__)("Preview","jetpack")))),U=Object(s.createElement)(d.InspectorControls,null,E&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(m.PanelBody,{title:Object(a.__)("Promotion Settings","jetpack")},Object(s.createElement)(m.ToggleControl,{label:Object(a.__)("Show Image","jetpack"),checked:w,onChange:function(){return I({showImage:!w})}}),Object(s.createElement)(m.ToggleControl,{label:Object(a.__)("Show Title","jetpack"),checked:C,onChange:function(){return I({showTitle:!C})}}),Object(s.createElement)(m.ToggleControl,{label:Object(a.__)("Show Author/Seller","jetpack"),checked:x,onChange:function(){return I({showSeller:!x})}}),Object(s.createElement)(m.ToggleControl,{label:Object(a.__)("Show Price","jetpack"),checked:S,onChange:function(){return I({showPrice:!S})}}),Object(s.createElement)(m.ToggleControl,{label:Object(a.__)("Show Purchase Button","jetpack"),checked:N,onChange:function(){return I({showPurchaseButton:!N})}})),Object(s.createElement)(d.PanelColorSettings,{title:Object(a.__)("Color Settings","jetpack"),colorSettings:[{value:k,onChange:function(e){return I({backgroundColor:e})},label:Object(a.__)("Background Color","jetpack")},{value:_,onChange:function(e){return I({textColor:e})},label:Object(a.__)("Text Color","jetpack")},{value:y,onChange:function(e){return I({buttonAndLinkColor:e})},label:Object(a.__)("Button & Link Color","jetpack")}]},Object(s.createElement)(d.ContrastChecker,{isLargeText:!1,textColor:_,backgroundColor:k}))));return Object(s.createElement)("div",{className:A},U,E?(t=f.products.filter((function(e){return e.asin===E}))[0],n=t.title,r=t.detailPageUrl,o=t.listPrice,c=t.imageUrlMedium,i=t.imageWidthMedium,u=t.imageHeightMedium,g="TODO",j=c&&Object(s.createElement)("a",{target:"_blank",href:r,rel:"noopener noreferrer"},Object(s.createElement)("img",{alt:n,src:c,width:i,heigth:u})),v=p.a.mostReadable(y,["#ffffff"],{includeFallbackColors:!0,size:"small"}).toHexString(),E?Object(s.createElement)("div",{style:{backgroundColor:k,color:_,width:i}},w&&j,C&&Object(s.createElement)("div",{className:"".concat(M,"-title")},Object(s.createElement)(m.ExternalLink,{href:r,style:{color:y}},n)),x&&Object(s.createElement)("div",{className:"".concat(M,"-seller")},g),S&&Object(s.createElement)("div",{className:"".concat(M,"-list-price")},o),N&&Object(s.createElement)(m.Button,{href:r,icon:h,isPrimary:!0,className:"".concat(M,"-button"),style:{color:v,backgroundColor:y,borderColor:y}},Object(a.__)("Shop Now","jetpack"))):null):z)})),j=n(16),v={attributes:c,title:Object(a.__)("Amazon","jetpack"),description:Object(a.__)("Promote Amazon products and earn a commission from sales.","jetpack"),icon:{src:h,foreground:Object(j.a)()},category:"earn",keywords:[Object(a.__)("amazon","jetpack"),Object(a.__)("affiliate","jetpack")],supports:{align:!0,alignWide:!1,html:!1},edit:g,save:function(){return null},example:{attributes:{}}};Object(r.a)("amazon",v)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var o=n(0);function c(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}t.a=function(e){var t=e.icon,n=e.size,i=void 0===n?24:n,l=a(e,["icon","size"]);return Object(o.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:i,height:i},l))}}]));
|
28 |
object-assign
|
29 |
(c) Sindre Sorhus
|
30 |
@license MIT
|
31 |
+
*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,t){for(var n,i,l=c(e),s=1;s<arguments.length;s++){for(var u in n=Object(arguments[s]))a.call(n,u)&&(l[u]=n[u]);if(r){i=r(n);for(var p=0;p<i.length;p++)o.call(n,i[p])&&(l[i[p]]=n[i[p]])}}return l}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(10),a=n(5),o=n.n(a),c=n(4),i=n.n(c),l=n(32),s={sources:{},default:null},u={getDefaultMediaSource:function(e){var t=null,n=Object.keys(e.sources);if(e.default?t=e.default:null!=n&&n.length&&(t=e.sources[n[0]].id),t)return e.sources[t]},getMediaPlayerState:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.state},getMediaSourceCurrentTime:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.currentTime},getMediaSourceDuration:function(e,t){var n,r;if(!t){var a=u.getDefaultMediaSource(e);return null==a?void 0:a.duration}return null===(n=e.sources)||void 0===n||null===(r=n[t])||void 0===r?void 0:r.duration},getMediaSourceDomReference:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);if(r){var a=null==r?void 0:r.domId;if(a)return document.getElementById(a)}}},p={reducer:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,n=arguments.length>1?arguments[1]:void 0,r=n.id||t.default||(null===(e=Object.keys(t.sources))||void 0===e?void 0:e[0]);switch(n.type){case"REGISTER_MEDIA_SOURCE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()({id:n.id},n.mediaSourceState)))});case"UPDATE_MEDIA_SOURCE_DATA":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()(i()({},t.sources[n.id]),n.data)))});case"UNREGISTER_MEDIA_SOURCE":var a,c=Object.assign({},t);if(c.sources[n.id]&&delete c.sources[n.id],n.id===t.default)c.default=null===(a=Object.keys(t.sources))||void 0===a?void 0:a[0];return c;case"SET_DEFAULT_MEDIA_SOURCE":return i()(i()({},t),{},{default:n.id});case"SET_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:n.state})))});case"TOGGLE_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:t.sources[r].state===l.c?l.b:l.c})))});case"SET_MEDIA_PLAYER_CURRENT_TIME":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{currentTime:n.currentTime})))})}return t},actions:{registerMediaSource:function(e,t){return{type:"REGISTER_MEDIA_SOURCE",id:e,mediaSourceState:t}},updateMediaSourceData:function(e,t){return{type:"UPDATE_MEDIA_SOURCE_DATA",id:e,data:t}},unregisterMediaSource:function(e){return{type:"UNREGISTER_MEDIA_SOURCE",id:e}},setDefaultMediaSource:function(e){return{type:"SET_DEFAULT_MEDIA_SOURCE",id:e}},playMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.c}},toggleMediaSource:function(e){return{type:"TOGGLE_MEDIA_PLAYER_STATE",id:e}},pauseMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.b}},errorMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.a}},setMediaSourceCurrentTime:function(e,t){return{type:"SET_MEDIA_PLAYER_CURRENT_TIME",id:e,currentTime:t}}},selectors:u};if(void 0!==r.createReduxStore){var d=Object(r.createReduxStore)(l.d,p);Object(r.register)(d)}else Object(r.registerStore)(l.d,p)},function(e,t,n){"use strict";var r=n(0);t.a=Object(r.createContext)()},function(e,t,n){},function(e,t){e.exports=window.wp.annotations},function(e,t,n){},function(e,t,n){e.exports=n.p+"images/img-example-after-2cb9a8483c19dddf7fc5655e346718db.png"},function(e,t,n){e.exports=n.p+"images/img-example-before-b9e7b3c4f30c1a6a8fbf99b820b9d8b8.png"},function(e,t,n){e.exports=n.p+"images/upgrade-illustration-4f15d75a961111384b907965c2e4e168.svg"},function(e,t,n){e.exports=n.p+"images/story_example-1-bc142dfce3ff04bbf445a692f1c8b0ca.png"},function(e,t,n){},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(254),t.encode=t.stringify=n(255)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var c=/\+/g;e=e.split(t);var i=1e3;a&&"number"==typeof a.maxKeys&&(i=a.maxKeys);var l=e.length;i>0&&l>i&&(l=i);for(var s=0;s<l;++s){var u,p,d,m,b=e[s].replace(c,"%20"),h=b.indexOf(n);h>=0?(u=b.substr(0,h),p=b.substr(h+1)):(u=b,p=""),d=decodeURIComponent(u),m=decodeURIComponent(p),r(o,d)?Array.isArray(o[d])?o[d].push(m):o[d]=[o[d],m]:o[d]=m}return o}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(a){var o=encodeURIComponent(r(a))+n;return Array.isArray(e[a])?e[a].map((function(e){return o+encodeURIComponent(r(e))})).join(t):o+encodeURIComponent(r(e[a]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))}},function(e,t,n){"use strict";var r="%[a-f0-9]{2}",a=new RegExp(r,"gi"),o=new RegExp("("+r+")+","gi");function c(e,t){try{return decodeURIComponent(e.join(""))}catch(a){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],c(n),c(r))}function i(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(a),n=1;n<t.length;n++)t=(e=c(t,n).join("")).match(a);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch(t){var a=i(r[0]);a!==r[0]&&(n[r[0]]=a)}r=o.exec(e)}n["%C2"]="�";for(var c=Object.keys(n),l=0;l<c.length;l++){var s=c[l];e=e.replace(new RegExp(s,"g"),n[s])}return e}(e)}}},function(e,t,n){"use strict";e.exports=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];var n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),a=Array.isArray(t),o=0;o<r.length;o++){var c=r[o],i=e[c];(a?-1!==t.indexOf(c):t(c,i,e))&&(n[c]=i)}return n}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},function(e,t,n){const r=n(44);e.exports=(e,t,n,a)=>{"string"==typeof n&&(a=n,n=void 0);try{return new r(e,n).inc(t,a).version}catch(o){return null}}},function(e,t,n){const r=n(86),a=n(127);e.exports=(e,t)=>{if(a(e,t))return null;{const n=r(e),a=r(t),o=n.prerelease.length||a.prerelease.length,c=o?"pre":"",i=o?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==a[e])return c+e;return i}}},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).major},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).minor},function(e,t,n){const r=n(44);e.exports=(e,t)=>new r(e,t).patch},function(e,t,n){const r=n(86);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},function(e,t,n){const r=n(55);e.exports=(e,t,n)=>r(t,e,n)},function(e,t,n){const r=n(55);e.exports=(e,t)=>r(e,t,!0)},function(e,t,n){const r=n(128);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},function(e,t,n){const r=n(128);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},function(e,t,n){const r=n(44),a=n(86),{re:o,t:c}=n(85);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[c.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[c.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[c.COERCERTL].lastIndex=-1}else n=e.match(o[c.COERCE]);return null===n?null:a(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},function(e,t,n){"use strict";const r=n(285),a=Symbol("max"),o=Symbol("length"),c=Symbol("lengthCalculator"),i=Symbol("allowStale"),l=Symbol("maxAge"),s=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),d=Symbol("cache"),m=Symbol("updateAgeOnGet"),b=()=>1;const h=(e,t,n)=>{const r=e[d].get(t);if(r){const t=r.value;if(f(e,t)){if(j(e,r),!e[i])return}else n&&(e[m]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},g=e=>{if(e[o]>e[a])for(let t=e[p].tail;e[o]>e[a]&&null!==t;){const n=t.prev;j(e,t),t=n}},j=(e,t)=>{if(t){const n=t.value;e[s]&&e[s](n.key,n.value),e[o]-=n.length,e[d].delete(n.key),e[p].removeNode(t)}};class v{constructor(e,t,n,r,a){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=a||0}}const O=(e,t,n,r)=>{let a=n.value;f(e,a)&&(j(e,n),e[i]||(a=void 0)),a&&t.call(r,a.value,a.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;const t=e.length||b;if(this[c]="function"!=typeof t?b:t,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[s]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[m]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,g(this)}get max(){return this[a]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=b),e!==this[c]&&(this[c]=e,this[o]=0,this[p].forEach((e=>{e.length=this[c](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[c]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let n=this[p].tail;null!==n;){const r=n.prev;O(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[p].head;null!==n;){const r=n.next;O(this,e,n,t),n=r}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[s]&&this[p]&&this[p].length&&this[p].forEach((e=>this[s](e.key,e.value))),this[d]=new Map,this[p]=new r,this[o]=0}dump(){return this[p].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[c](t,e);if(this[d].has(e)){if(i>this[a])return j(this,this[d].get(e)),!1;const c=this[d].get(e).value;return this[s]&&(this[u]||this[s](e,c.value)),c.now=r,c.maxAge=n,c.value=t,this[o]+=i-c.length,c.length=i,this.get(e),g(this),!0}const m=new v(e,t,i,r,n);return m.length>this[a]?(this[s]&&this[s](e,t),!1):(this[o]+=m.length,this[p].unshift(m),this[d].set(e,this[p].head),g(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!f(this,t)}get(e){return h(this,e,!0)}peek(e){return h(this,e,!1)}pop(){const e=this[p].tail;return e?(j(this,e),e.value):null}del(e){j(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{const e=a-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[d].forEach(((e,t)=>h(this,t,!1)))}}},function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,a=arguments.length;n<a;n++)t.push(arguments[n]);return t}function a(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function c(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=i,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)c(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,a=this.head;null!==a;)n.push(e.call(t,a.value,this)),a=a.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,a=this.tail;null!==a;)n.push(e.call(t,a.value,this)),a=a.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=e(n,r.value,a),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=e(n,r.value,a),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=0,o=this.head;null!==o&&a<e;a++)o=o.next;for(;null!==o&&a<t;a++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=this.length,o=this.tail;null!==o&&a>t;a--)o=o.prev;for(;null!==o&&a>e;a--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r<e;r++)o=o.next;var c=[];for(r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(r=0;r<n.length;r++)o=a(this,o,n[r]);return c},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(286)(r)}catch(l){}},function(e,t,n){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},function(e,t,n){const r=n(56);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},function(e,t,n){const r=n(44),a=n(56);e.exports=(e,t,n)=>{let o=null,c=null,i=null;try{i=new a(t,n)}catch(l){return null}return e.forEach((e=>{i.test(e)&&(o&&-1!==c.compare(e)||(o=e,c=new r(o,n)))})),o}},function(e,t,n){const r=n(44),a=n(56);e.exports=(e,t,n)=>{let o=null,c=null,i=null;try{i=new a(t,n)}catch(l){return null}return e.forEach((e=>{i.test(e)&&(o&&1!==c.compare(e)||(o=e,c=new r(o,n)))})),o}},function(e,t,n){const r=n(44),a=n(56),o=n(102);e.exports=(e,t)=>{e=new a(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let a=0;a<e.set.length;++a){const t=e.set[a];let c=null;t.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":c&&!o(t,c)||(c=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!c||n&&!o(n,c)||(n=c)}return n&&e.test(n)?n:null}},function(e,t,n){const r=n(56);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(n){return null}}},function(e,t,n){const r=n(132);e.exports=(e,t,n)=>r(e,t,">",n)},function(e,t,n){const r=n(132);e.exports=(e,t,n)=>r(e,t,"<",n)},function(e,t,n){const r=n(56);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},function(e,t,n){const r=n(104),a=n(55);e.exports=(e,t,n)=>{const o=[];let c=null,i=null;const l=e.sort(((e,t)=>a(e,t,n)));for(const a of l){r(a,t,n)?(i=a,c||(c=a)):(i&&o.push([c,i]),i=null,c=null)}c&&o.push([c,null]);const s=[];for(const[r,a]of o)r===a?s.push(r):a||r!==l[0]?a?r===l[0]?s.push(`<=${a}`):s.push(`${r} - ${a}`):s.push(`>=${r}`):s.push("*");const u=s.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},function(e,t,n){const r=n(56),a=n(103),{ANY:o}=a,c=n(104),i=n(55),l=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?[new a(">=0.0.0-0")]:[new a(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=[new a(">=0.0.0")]}const r=new Set;let l,p,d,m,b,h,f;for(const a of e)">"===a.operator||">="===a.operator?l=s(l,a,n):"<"===a.operator||"<="===a.operator?p=u(p,a,n):r.add(a.semver);if(r.size>1)return null;if(l&&p){if(d=i(l.semver,p.semver,n),d>0)return null;if(0===d&&(">="!==l.operator||"<="!==p.operator))return null}for(const a of r){if(l&&!c(a,String(l),n))return null;if(p&&!c(a,String(p),n))return null;for(const e of t)if(!c(a,String(e),n))return!1;return!0}let g=!(!p||n.includePrerelease||!p.semver.prerelease.length)&&p.semver,j=!(!l||n.includePrerelease||!l.semver.prerelease.length)&&l.semver;g&&1===g.prerelease.length&&"<"===p.operator&&0===g.prerelease[0]&&(g=!1);for(const a of t){if(f=f||">"===a.operator||">="===a.operator,h=h||"<"===a.operator||"<="===a.operator,l)if(j&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===j.major&&a.semver.minor===j.minor&&a.semver.patch===j.patch&&(j=!1),">"===a.operator||">="===a.operator){if(m=s(l,a,n),m===a&&m!==l)return!1}else if(">="===l.operator&&!c(l.semver,String(a),n))return!1;if(p)if(g&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===g.major&&a.semver.minor===g.minor&&a.semver.patch===g.patch&&(g=!1),"<"===a.operator||"<="===a.operator){if(b=u(p,a,n),b===a&&b!==p)return!1}else if("<="===p.operator&&!c(p.semver,String(a),n))return!1;if(!a.operator&&(p||l)&&0!==d)return!1}return!(l&&h&&!p&&0!==d)&&(!(p&&f&&!l&&0!==d)&&(!j&&!g))},s=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let a=!1;e:for(const r of e.set){for(const e of t.set){const t=l(r,e,n);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(57),a=n.n(r);n(305);a()((function(){var e={sliders:[],OPTIMIZATION_ACCEPTED:1,OPTIMIZATION_WAS_CONSTRAINED:2};function t(e,t){var n=this;this.image=new Image,this.loaded=!1,this.image.onload=function(){n.loaded=!0,t._onLoaded()},this.image.src=e.src,this.image.alt=e.alt||"",this.label=e.label||!1}function n(e,t){e&&e.classList.add(t)}function r(e,t){e&&e.classList.remove(t)}function a(e){return{width:parseInt(window.getComputedStyle(e).width,10),height:parseInt(window.getComputedStyle(e).height,10)}}function o(e,t){var n,r;if("string"==typeof t||"number"==typeof t)n=parseInt(t,10);else{var a=e.getBoundingClientRect(),o={top:a.top+document.body.scrollTop+document.documentElement.scrollTop,left:a.left+document.body.scrollLeft+document.documentElement.scrollLeft},c=e.offsetWidth;n=(((r=t).pageX?r.pageX:r.touches?r.touches[0].pageX:r.clientX+document.body.scrollLeft+document.documentElement.scrollLeft)-o.left)/c*100}return n}function c(e,t,n){var r,a;if("string"==typeof t||"number"==typeof t)r=parseInt(t,10);else{var o=e.getBoundingClientRect(),c={top:o.top+n.body.scrollTop+n.documentElement.scrollTop,left:o.left+n.body.scrollLeft+n.documentElement.scrollLeft},i=e.offsetHeight;r=(((a=t).pageY?a.pageY:a.touches?a.touches[0].pageY:a.clientY+document.body.scrollTop+document.documentElement.scrollTop)-c.top)/i*100}return r}var i={animate:!0,showLabels:!0,makeResponsive:!0};function l(e,n,r){var a,o;for(a in this.element=e,this.options={animate:!0,showLabels:!0,makeResponsive:!0,startingPosition:"50%",mode:"horizontal",callback:null},this.options)a in r&&(this.options[a]=a in i?"string"!=typeof(o=r[a])?Boolean(o):!("false"===o||""===o):r[a]);2===n.length&&(this.imgBefore=new t(n[0],this),this.imgAfter=new t(n[1],this))}l.prototype={updateSlider:function(e,t){var a;a=(a="vertical"===this.options.mode?c(this.slider,e,this.sliderParentDocument):o(this.slider,e)).toFixed(2)+"%";var i=parseFloat(a),l=100-i+"%";i>0&&i<100&&(r(this.handle,"transition"),r(this.rightImage,"transition"),r(this.leftImage,"transition"),this.options.animate&&t&&(n(this.handle,"transition"),n(this.leftImage,"transition"),n(this.rightImage,"transition")),"vertical"===this.options.mode?(this.handle.style.top=a,this.leftImage.style.height=a,this.rightImage.style.height=l):(this.handle.style.left=a,this.leftImage.style.width=a,this.rightImage.style.width=l),this.sliderPosition=a)},getPosition:function(){return this.sliderPosition},displayLabel:function(e,t){var n=document.createElement("div");n.className="jx-label",n.setAttribute("tabindex",0),function(e,t){document.body.textContent?e.textContent=t:e.innerText=t}(n,t),e.appendChild(n)},setStartingPosition:function(e){this.options.startingPosition=e},calculateDims:function(e,t){var n,r=(n=this.imgBefore.image,{width:n.naturalWidth,height:n.naturalHeight,aspect:function(){return this.width/this.height}}).aspect();return e?t=e/r:t&&(e=t*r),{width:e,height:t,ratio:r}},responsivizeIframe:function(e){return e.height<window.innerHeight?e.ratio>=1&&(this.wrapper.style.paddingTop=parseInt((window.innerHeight-e.height)/2)+"px"):e.height>window.innerHeight&&(e=this.calculateDims(0,window.innerHeight),this.wrapper.style.paddingLeft=parseInt((window.innerWidth-e.width)/2)+"px"),e},setWrapperDimensions:function(){var e=a(this.wrapper.parentNode).width,t=a(this.wrapper.parentNode).height,n=this.calculateDims(e,t);window.location===window.parent.location||this.options.makeResponsive||(n=this.responsivizeIframe(n)),this.wrapper.style.height=parseInt(n.height)+"px",this.wrapper.style.width=parseInt(n.width)+"px"},optimizeWrapper:function(t){var n=e.OPTIMIZATION_ACCEPTED;return this.imgBefore.image.naturalWidth>=t&&this.imgAfter.image.naturalWidth>=t?(this.wrapper.style.width=t+"px",n=e.OPTIMIZATION_WAS_CONSTRAINED):this.imgAfter.image.naturalWidth<t?this.wrapper.style.width=this.imgAfter.image.naturalWidth+"px":this.wrapper.style.width=this.imgBefore.image.naturalWidth+"px",this.setWrapperDimensions(),n},_onLoaded:function(){if(this.imgBefore&&!0===this.imgBefore.loaded&&this.imgAfter&&!0===this.imgAfter.loaded){var e;if(this.wrapper=this.element,!this.wrapper||this.wrapper.querySelector(".jx-slider"))return;n(this.wrapper,"juxtapose"),this.wrapper.style.width=this.imgBefore.image.naturalWidth,this.setWrapperDimensions(),this.slider=document.createElement("div"),this.slider.className="jx-slider",this.wrapper.appendChild(this.slider),this.sliderParentDocument=this.wrapper.ownerDocument,"horizontal"!==this.options.mode&&n(this.slider,this.options.mode),this.handle=document.createElement("div"),this.handle.className="jx-handle",this.rightImage=document.createElement("div"),this.rightImage.className="jx-image jx-right",this.rightImage.appendChild(this.imgAfter.image),this.leftImage=document.createElement("div"),this.leftImage.className="jx-image jx-left",this.leftImage.appendChild(this.imgBefore.image),this.slider.appendChild(this.handle),this.slider.appendChild(this.leftImage),this.slider.appendChild(this.rightImage),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.control=document.createElement("div"),this.controller=document.createElement("div"),this.leftArrow.className="jx-arrow jx-left",this.rightArrow.className="jx-arrow jx-right",this.control.className="jx-control",this.controller.className="jx-controller",this.controller.setAttribute("tabindex",0),this.controller.setAttribute("role","slider"),this.controller.setAttribute("aria-valuenow",50),this.controller.setAttribute("aria-valuemin",0),this.controller.setAttribute("aria-valuemax",100),this.controller.setAttribute("aria-label",(null===(e=window.imageCompareHandle)||void 0===e?void 0:e.msg)||"Slide to compare images"),this.handle.appendChild(this.leftArrow),this.handle.appendChild(this.control),this.handle.appendChild(this.rightArrow),this.control.appendChild(this.controller),this._init()}},_init:function(){this.updateSlider(this.options.startingPosition,!1),!0===this.options.showLabels&&(this.imgBefore.label&&this.displayLabel(this.leftImage,this.imgBefore.label),this.imgAfter.label&&this.displayLabel(this.rightImage,this.imgAfter.label));var t=this;window.addEventListener("resize",(function(){t.setWrapperDimensions()})),this.slider.addEventListener("mousedown",(function(e){e.preventDefault(),t.updateSlider(e,!0);var n=!0;this.addEventListener("mousemove",(function(e){e.preventDefault(),n&&t.updateSlider(e,!1)})),this.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation(),n=!1}))})),this.slider.addEventListener("touchstart",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!0),this.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!1)}))})),this.handle.addEventListener("keydown",(function(e){var n=e.which||e.keyCode,r=parseFloat(this.style.left);if(37===n){r-=1;var a=parseFloat(this.style.left)-1;t.updateSlider(a,!1),t.controller.setAttribute("aria-valuenow",r)}if(39===n){r+=1;var o=parseFloat(this.style.left)+1;t.updateSlider(o,!1),t.controller.setAttribute("aria-valuenow",r)}})),this.leftImage.addEventListener("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("90%",!0),t.controller.setAttribute("aria-valuenow",91))})),this.rightImage.addEventListener("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("10%",!0),t.controller.setAttribute("aria-valuenow",10))})),e.sliders.push(this),this.options.callback&&"function"==typeof this.options.callback&&this.options.callback(this)}},e.makeSlider=function(t,r){void 0===r&&(r=e.sliders.length);var a=t,o=a.querySelectorAll("img");if(!(o.length<2)){var c={};return a.getAttribute("data-animate")&&(c.animate=a.getAttribute("data-animate")),a.getAttribute("data-showlabels")&&(c.showLabels=a.getAttribute("data-showlabels")),a.getAttribute("data-startingposition")&&(c.startingPosition=a.getAttribute("data-startingposition")),a.getAttribute("data-mode")&&(c.mode=a.getAttribute("data-mode")),a.getAttribute("data-makeresponsive")&&(c.mode=a.getAttribute("data-makeresponsive")),n(t,"juxtapose-"+r),a.innerHTML?a.innerHTML="":a.innerText="",new e.JXSlider(t,[{src:o[0].src,label:o[0].getAttribute("data-label"),alt:o[0].alt},{src:o[1].src,label:o[1].getAttribute("data-label"),alt:o[1].alt}],c)}},e.scanPage=function(){for(var t=document.querySelectorAll(".juxtapose"),n=0;n<t.length;n++)e.makeSlider(t[n],n)},e.JXSlider=l,window.juxtapose=e,e.scanPage()}))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(30),a=n(320),o=n(324),c=n(325),i=n(333),l=n(347),s=n(360),u=n(174),p=n(166),d={default:n(362),zero:n(363),commonmark:n(364)},m=/^(vbscript|javascript|file|data):/,b=/^data:image\/(gif|png|jpeg|webp);/;function h(e){var t=e.trim().toLowerCase();return!m.test(t)||!!b.test(t)}var f=["http:","https:","mailto:"];function g(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toASCII(t.hostname)}catch(n){}return u.encode(u.format(t))}function j(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toUnicode(t.hostname)}catch(n){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function v(e,t){if(!(this instanceof v))return new v(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new l,this.block=new i,this.core=new c,this.renderer=new o,this.linkify=new s,this.validateLink=h,this.normalizeLink=g,this.normalizeLinkText=j,this.utils=r,this.helpers=r.assign({},a),this.options={},this.configure(e),t&&this.set(t)}v.prototype.set=function(e){return r.assign(this.options,e),this},v.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=d[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},v.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},v.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},v.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},v.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},v.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},v.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},v.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=v},function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')},function(e,t,n){"use strict";var r={};function a(e,t,n){var o,c,i,l,s,u="";for("string"!=typeof t&&(n=t,t=a.defaultChars),void 0===n&&(n=!0),s=function(e){var t,n,a=r[e];if(a)return a;for(a=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?a.push(n):a.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)a[e.charCodeAt(t)]=e[t];return a}(t),o=0,c=e.length;o<c;o++)if(i=e.charCodeAt(o),n&&37===i&&o+2<c&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))u+=e.slice(o,o+3),o+=2;else if(i<128)u+=s[i];else if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&o+1<c&&(l=e.charCodeAt(o+1))>=56320&&l<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}a.defaultChars=";/?:@&=+$,-_.!~*'()#",a.componentChars="-_.!~*'()",e.exports=a},function(e,t,n){"use strict";var r={};function a(e,t){var n;return"string"!=typeof t&&(t=a.defaultChars),n=function(e){var t,n,a=r[e];if(a)return a;for(a=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),a.push(n);for(t=0;t<e.length;t++)a[n=e.charCodeAt(t)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return a}(t),e.replace(/(%[a-f0-9]{2})+/gi,(function(e){var t,r,a,o,c,i,l,s="";for(t=0,r=e.length;t<r;t+=3)(a=parseInt(e.slice(t+1,t+3),16))<128?s+=n[a]:192==(224&a)&&t+3<r&&128==(192&(o=parseInt(e.slice(t+4,t+6),16)))?(s+=(l=a<<6&1984|63&o)<128?"��":String.fromCharCode(l),t+=3):224==(240&a)&&t+6<r&&(o=parseInt(e.slice(t+4,t+6),16),c=parseInt(e.slice(t+7,t+9),16),128==(192&o)&&128==(192&c))?(s+=(l=a<<12&61440|o<<6&4032|63&c)<2048||l>=55296&&l<=57343?"���":String.fromCharCode(l),t+=6):240==(248&a)&&t+9<r&&(o=parseInt(e.slice(t+4,t+6),16),c=parseInt(e.slice(t+7,t+9),16),i=parseInt(e.slice(t+10,t+12),16),128==(192&o)&&128==(192&c)&&128==(192&i))?((l=a<<18&1835008|o<<12&258048|c<<6&4032|63&i)<65536||l>1114111?s+="����":(l-=65536,s+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):s+="�";return s}))}a.defaultChars=";/?:@&=+$,#",a.componentChars="",e.exports=a},function(e,t,n){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(i),s=["%","/","?",";","#"].concat(l),u=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};r.prototype.parse=function(e,t){var n,r,o,i,l,h=e;if(h=h.trim(),!t&&1===e.split("#").length){var f=c.exec(h);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}var g=a.exec(h);if(g&&(o=(g=g[0]).toLowerCase(),this.protocol=g,h=h.substr(g.length)),(t||g||h.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(l="//"===h.substr(0,2))||g&&m[g]||(h=h.substr(2),this.slashes=!0)),!m[g]&&(l||g&&!b[g])){var j,v,O=-1;for(n=0;n<u.length;n++)-1!==(i=h.indexOf(u[n]))&&(-1===O||i<O)&&(O=i);for(-1!==(v=-1===O?h.lastIndexOf("@"):h.lastIndexOf("@",O))&&(j=h.slice(0,v),h=h.slice(v+1),this.auth=j),O=-1,n=0;n<s.length;n++)-1!==(i=h.indexOf(s[n]))&&(-1===O||i<O)&&(O=i);-1===O&&(O=h.length),":"===h[O-1]&&O--;var k=h.slice(0,O);h=h.slice(O),this.parseHost(k),this.hostname=this.hostname||"";var _="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!_){var y=this.hostname.split(/\./);for(n=0,r=y.length;n<r;n++){var E=y[n];if(E&&!E.match(p)){for(var w="",C=0,x=E.length;C<x;C++)E.charCodeAt(C)>127?w+="x":w+=E[C];if(!w.match(p)){var S=y.slice(0,n),N=y.slice(n+1),A=E.match(d);A&&(S.push(A[1]),N.unshift(A[2])),N.length&&(h=N.join(".")+h),this.hostname=S.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var T=h.indexOf("#");-1!==T&&(this.hash=h.substr(T),h=h.slice(0,T));var P=h.indexOf("?");return-1!==P&&(this.search=h.substr(P),h=h.slice(0,P)),h&&(this.pathname=h),b[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(e){var t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,t){if(e&&e instanceof r)return e;var n=new r;return n.parse(e,t),n}},function(e,t,n){"use strict";t.Any=n(175),t.Cc=n(176),t.Cf=n(319),t.P=n(133),t.Z=n(177)},function(e,t){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(e,t,n){"use strict";t.parseLinkLabel=n(321),t.parseLinkDestination=n(322),t.parseLinkTitle=n(323)},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o,c,i=-1,l=e.posMax,s=e.pos;for(e.pos=t+1,r=1;e.pos<l;){if(93===(o=e.src.charCodeAt(e.pos))&&0===--r){a=!0;break}if(c=e.pos,e.md.inline.skipToken(e),91===o)if(c===e.pos-1)r++;else if(n)return e.pos=s,-1}return a&&(i=e.pos),e.pos=s,i}},function(e,t,n){"use strict";var r=n(30).unescapeAll;e.exports=function(e,t,n){var a,o,c=t,i={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t<n;){if(10===(a=e.charCodeAt(t)))return i;if(60===a)return i;if(62===a)return i.pos=t+1,i.str=r(e.slice(c+1,t)),i.ok=!0,i;92===a&&t+1<n?t+=2:t++}return i}for(o=0;t<n&&32!==(a=e.charCodeAt(t))&&!(a<32||127===a);)if(92===a&&t+1<n){if(32===e.charCodeAt(t+1))break;t+=2}else{if(40===a&&++o>32)return i;if(41===a){if(0===o)break;o--}t++}return c===t||0!==o||(i.str=r(e.slice(c,t)),i.lines=0,i.pos=t,i.ok=!0),i}},function(e,t,n){"use strict";var r=n(30).unescapeAll;e.exports=function(e,t,n){var a,o,c=0,i=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=n)return l;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return l;for(t++,40===o&&(o=41);t<n;){if((a=e.charCodeAt(t))===o)return l.pos=t+1,l.lines=c,l.str=r(e.slice(i+1,t)),l.ok=!0,l;if(40===a&&41===o)return l;10===a?c++:92===a&&t+1<n&&(t++,10===e.charCodeAt(t)&&c++),t++}return l}},function(e,t,n){"use strict";var r=n(30).assign,a=n(30).unescapeAll,o=n(30).escapeHtml,c={};function i(){this.rules=r({},c)}c.code_inline=function(e,t,n,r,a){var c=e[t];return"<code"+a.renderAttrs(c)+">"+o(e[t].content)+"</code>"},c.code_block=function(e,t,n,r,a){var c=e[t];return"<pre"+a.renderAttrs(c)+"><code>"+o(e[t].content)+"</code></pre>\n"},c.fence=function(e,t,n,r,c){var i,l,s,u,p,d=e[t],m=d.info?a(d.info).trim():"",b="",h="";return m&&(b=(s=m.split(/(\s+)/g))[0],h=s.slice(2).join("")),0===(i=n.highlight&&n.highlight(d.content,b,h)||o(d.content)).indexOf("<pre")?i+"\n":m?(l=d.attrIndex("class"),u=d.attrs?d.attrs.slice():[],l<0?u.push(["class",n.langPrefix+b]):(u[l]=u[l].slice(),u[l][1]+=" "+n.langPrefix+b),p={attrs:u},"<pre><code"+c.renderAttrs(p)+">"+i+"</code></pre>\n"):"<pre><code"+c.renderAttrs(d)+">"+i+"</code></pre>\n"},c.image=function(e,t,n,r,a){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=a.renderInlineAsText(o.children,n,r),a.renderToken(e,t,n)},c.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},c.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},c.text=function(e,t){return o(e[t].content)},c.html_block=function(e,t){return e[t].content},c.html_inline=function(e,t){return e[t].content},i.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+o(e.attrs[t][0])+'="'+o(e.attrs[t][1])+'"';return r},i.prototype.renderToken=function(e,t,n){var r,a="",o=!1,c=e[t];return c.hidden?"":(c.block&&-1!==c.nesting&&t&&e[t-1].hidden&&(a+="\n"),a+=(-1===c.nesting?"</":"<")+c.tag,a+=this.renderAttrs(c),0===c.nesting&&n.xhtmlOut&&(a+=" /"),c.block&&(o=!0,1===c.nesting&&t+1<e.length&&("inline"===(r=e[t+1]).type||r.hidden||-1===r.nesting&&r.tag===c.tag)&&(o=!1)),a+=o?">\n":">")},i.prototype.renderInline=function(e,t,n){for(var r,a="",o=this.rules,c=0,i=e.length;c<i;c++)void 0!==o[r=e[c].type]?a+=o[r](e,c,t,n,this):a+=this.renderToken(e,c,t);return a},i.prototype.renderInlineAsText=function(e,t,n){for(var r="",a=0,o=e.length;a<o;a++)"text"===e[a].type?r+=e[a].content:"image"===e[a].type&&(r+=this.renderInlineAsText(e[a].children,t,n));return r},i.prototype.render=function(e,t,n){var r,a,o,c="",i=this.rules;for(r=0,a=e.length;r<a;r++)"inline"===(o=e[r].type)?c+=this.renderInline(e[r].children,t,n):void 0!==i[o]?c+=i[e[r].type](e,r,t,n,this):c+=this.renderToken(e,r,t,n);return c},e.exports=i},function(e,t,n){"use strict";var r=n(134),a=[["normalize",n(326)],["block",n(327)],["inline",n(328)],["linkify",n(329)],["replacements",n(330)],["smartquotes",n(331)]];function o(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1])}o.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},o.prototype.State=n(332),e.exports=o},function(e,t,n){"use strict";var r=/\r\n?|\n/g,a=/\0/g;e.exports=function(e){var t;t=(t=e.src.replace(r,"\n")).replace(a,"�"),e.src=t}},function(e,t,n){"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,a=e.tokens;for(n=0,r=a.length;n<r;n++)"inline"===(t=a[n]).type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},function(e,t,n){"use strict";var r=n(30).arrayReplaceAt;function a(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,o,c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k=e.tokens;if(e.md.options.linkify)for(n=0,o=k.length;n<o;n++)if("inline"===k[n].type&&e.md.linkify.pretest(k[n].content))for(h=0,t=(c=k[n].children).length-1;t>=0;t--)if("link_close"!==(l=c[t]).type){if("html_inline"===l.type&&(O=l.content,/^<a[>\s]/i.test(O)&&h>0&&h--,a(l.content)&&h++),!(h>0)&&"text"===l.type&&e.md.linkify.test(l.content)){for(p=l.content,v=e.md.linkify.match(p),s=[],b=l.level,m=0,u=0;u<v.length;u++)f=v[u].url,g=e.md.normalizeLink(f),e.md.validateLink(g)&&(j=v[u].text,j=v[u].schema?"mailto:"!==v[u].schema||/^mailto:/i.test(j)?e.md.normalizeLinkText(j):e.md.normalizeLinkText("mailto:"+j).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+j).replace(/^http:\/\//,""),(d=v[u].index)>m&&((i=new e.Token("text","",0)).content=p.slice(m,d),i.level=b,s.push(i)),(i=new e.Token("link_open","a",1)).attrs=[["href",g]],i.level=b++,i.markup="linkify",i.info="auto",s.push(i),(i=new e.Token("text","",0)).content=j,i.level=b,s.push(i),(i=new e.Token("link_close","a",-1)).level=--b,i.markup="linkify",i.info="auto",s.push(i),m=v[u].lastIndex);m<p.length&&((i=new e.Token("text","",0)).content=p.slice(m),i.level=b,s.push(i)),k[n].children=c=r(c,t,s)}}else for(t--;c[t].level!==l.level&&"link_open"!==c[t].type;)t--}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,a=/\((c|tm|r|p)\)/i,o=/\((c|tm|r|p)\)/gi,c={c:"©",r:"®",p:"§",tm:"™"};function i(e,t){return c[t.toLowerCase()]}function l(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||r||(n.content=n.content.replace(o,i)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function s(e){var t,n,a=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||a||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&a--,"link_close"===n.type&&"auto"===n.info&&a++}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(a.test(e.tokens[t].content)&&l(e.tokens[t].children),r.test(e.tokens[t].content)&&s(e.tokens[t].children))}},function(e,t,n){"use strict";var r=n(30).isWhiteSpace,a=n(30).isPunctChar,o=n(30).isMdAsciiPunct,c=/['"]/,i=/['"]/g;function l(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function s(e,t){var n,c,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w,C,x;for(w=[],n=0;n<e.length;n++){for(c=e[n],m=e[n].level,y=w.length-1;y>=0&&!(w[y].level<=m);y--);if(w.length=y+1,"text"===c.type){p=0,d=(s=c.content).length;e:for(;p<d&&(i.lastIndex=p,u=i.exec(s));){if(k=_=!0,p=u.index+1,E="'"===u[0],h=32,u.index-1>=0)h=s.charCodeAt(u.index-1);else for(y=n-1;y>=0&&("softbreak"!==e[y].type&&"hardbreak"!==e[y].type);y--)if(e[y].content){h=e[y].content.charCodeAt(e[y].content.length-1);break}if(f=32,p<d)f=s.charCodeAt(p);else for(y=n+1;y<e.length&&("softbreak"!==e[y].type&&"hardbreak"!==e[y].type);y++)if(e[y].content){f=e[y].content.charCodeAt(0);break}if(g=o(h)||a(String.fromCharCode(h)),j=o(f)||a(String.fromCharCode(f)),v=r(h),(O=r(f))?k=!1:j&&(v||g||(k=!1)),v?_=!1:g&&(O||j||(_=!1)),34===f&&'"'===u[0]&&h>=48&&h<=57&&(_=k=!1),k&&_&&(k=g,_=j),k||_){if(_)for(y=w.length-1;y>=0&&(b=w[y],!(w[y].level<m));y--)if(b.single===E&&w[y].level===m){b=w[y],E?(C=t.md.options.quotes[2],x=t.md.options.quotes[3]):(C=t.md.options.quotes[0],x=t.md.options.quotes[1]),c.content=l(c.content,u.index,x),e[b.token].content=l(e[b.token].content,b.pos,C),p+=x.length-1,b.token===n&&(p+=C.length-1),d=(s=c.content).length,w.length=y;continue e}k?w.push({token:n,pos:u.index,single:E,level:m}):_&&E&&(c.content=l(c.content,u.index,"’"))}else E&&(c.content=l(c.content,u.index,"’"))}}}}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&c.test(e.tokens[t].content)&&s(e.tokens[t].children,e)}},function(e,t,n){"use strict";var r=n(135);function a(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}a.prototype.Token=r,e.exports=a},function(e,t,n){"use strict";var r=n(134),a=[["table",n(334),["paragraph","reference"]],["code",n(335)],["fence",n(336),["paragraph","reference","blockquote","list"]],["blockquote",n(337),["paragraph","reference","blockquote","list"]],["hr",n(338),["paragraph","reference","blockquote","list"]],["list",n(339),["paragraph","reference","blockquote"]],["reference",n(340)],["heading",n(341),["paragraph","reference","blockquote"]],["lheading",n(342)],["html_block",n(343),["paragraph","reference","blockquote"]],["paragraph",n(345)]];function o(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1],{alt:(a[e][2]||[]).slice()})}o.prototype.tokenize=function(e,t,n){for(var r,a=this.ruler.getRules(""),o=a.length,c=t,i=!1,l=e.md.options.maxNesting;c<n&&(e.line=c=e.skipEmptyLines(c),!(c>=n))&&!(e.sCount[c]<e.blkIndent);){if(e.level>=l){e.line=n;break}for(r=0;r<o&&!a[r](e,c,n,!1);r++);e.tight=!i,e.isEmpty(e.line-1)&&(i=!0),(c=e.line)<n&&e.isEmpty(c)&&(i=!0,c++,e.line=c)}},o.prototype.parse=function(e,t,n,r){var a;e&&(a=new this.State(e,t,n,r),this.tokenize(a,a.line,a.lineMax))},o.prototype.State=n(346),e.exports=o},function(e,t,n){"use strict";var r=n(30).isSpace;function a(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function o(e){var t,n=[],r=0,a=e.length,o=!1,c=0,i="";for(t=e.charCodeAt(r);r<a;)124===t&&(o?(i+=e.substring(c,r-1),c=r):(n.push(i+e.substring(c,r)),i="",c=r+1)),o=92===t,r++,t=e.charCodeAt(r);return n.push(i+e.substring(c)),n}e.exports=function(e,t,n,c){var i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_;if(t+2>n)return!1;if(d=t+1,e.sCount[d]<e.blkIndent)return!1;if(e.sCount[d]-e.blkIndent>=4)return!1;if((s=e.bMarks[d]+e.tShift[d])>=e.eMarks[d])return!1;if(124!==(i=e.src.charCodeAt(s++))&&45!==i&&58!==i)return!1;for(;s<e.eMarks[d];){if(124!==(i=e.src.charCodeAt(s))&&45!==i&&58!==i&&!r(i))return!1;s++}for(m=(l=a(e,t+1)).split("|"),f=[],u=0;u<m.length;u++){if(!(g=m[u].trim())){if(0===u||u===m.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?f.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(l=a(e,t).trim()).indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),0===(b=m.length)||b!==f.length)return!1;if(c)return!0;for(O=e.parentType,e.parentType="table",_=e.md.block.ruler.getRules("blockquote"),(h=e.push("table_open","table",1)).map=j=[t,0],(h=e.push("thead_open","thead",1)).map=[t,t+1],(h=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u<m.length;u++)h=e.push("th_open","th",1),f[u]&&(h.attrs=[["style","text-align:"+f[u]]]),(h=e.push("inline","",0)).content=m[u].trim(),h.children=[],h=e.push("th_close","th",-1);for(h=e.push("tr_close","tr",-1),h=e.push("thead_close","thead",-1),d=t+2;d<n&&!(e.sCount[d]<e.blkIndent);d++){for(k=!1,u=0,p=_.length;u<p;u++)if(_[u](e,d,n,!0)){k=!0;break}if(k)break;if(!(l=a(e,d).trim()))break;if(e.sCount[d]-e.blkIndent>=4)break;for((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),d===t+2&&((h=e.push("tbody_open","tbody",1)).map=v=[t+2,0]),(h=e.push("tr_open","tr",1)).map=[d,d+1],u=0;u<b;u++)h=e.push("td_open","td",1),f[u]&&(h.attrs=[["style","text-align:"+f[u]]]),(h=e.push("inline","",0)).content=m[u]?m[u].trim():"",h.children=[],h=e.push("td_close","td",-1);h=e.push("tr_close","tr",-1)}return v&&(h=e.push("tbody_close","tbody",-1),v[1]=d),h=e.push("table_close","table",-1),j[1]=d,e.parentType=O,e.line=d,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o;if(e.sCount[t]-e.blkIndent<4)return!1;for(a=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;a=++r}return e.line=a,(o=e.push("code_block","code",0)).content=e.getLines(t,a,4+e.blkIndent,!0),o.map=[t,e.line],!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var a,o,c,i,l,s,u,p=!1,d=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(d+3>m)return!1;if(126!==(a=e.src.charCodeAt(d))&&96!==a)return!1;if(l=d,(o=(d=e.skipChars(d,a))-l)<3)return!1;if(u=e.src.slice(l,d),c=e.src.slice(d,m),96===a&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;for(i=t;!(++i>=n)&&!((d=l=e.bMarks[i]+e.tShift[i])<(m=e.eMarks[i])&&e.sCount[i]<e.blkIndent);)if(e.src.charCodeAt(d)===a&&!(e.sCount[i]-e.blkIndent>=4||(d=e.skipChars(d,a))-l<o||(d=e.skipSpaces(d))<m)){p=!0;break}return o=e.sCount[t],e.line=i+(p?1:0),(s=e.push("fence","code",0)).info=c,s.content=e.getLines(t+1,i,o,!0),s.markup=u,s.map=[t,e.line],!0}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w=e.lineMax,C=e.bMarks[t]+e.tShift[t],x=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(C++))return!1;if(a)return!0;for(l=m=e.sCount[t]+1,32===e.src.charCodeAt(C)?(C++,l++,m++,o=!1,O=!0):9===e.src.charCodeAt(C)?(O=!0,(e.bsCount[t]+m)%4==3?(C++,l++,m++,o=!1):o=!0):O=!1,b=[e.bMarks[t]],e.bMarks[t]=C;C<x&&(c=e.src.charCodeAt(C),r(c));)9===c?m+=4-(m+e.bsCount[t]+(o?1:0))%4:m++,C++;for(h=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(O?1:0),u=C>=x,j=[e.sCount[t]],e.sCount[t]=m-l,v=[e.tShift[t]],e.tShift[t]=C-e.bMarks[t],_=e.md.block.ruler.getRules("blockquote"),g=e.parentType,e.parentType="blockquote",d=t+1;d<n&&(E=e.sCount[d]<e.blkIndent,!((C=e.bMarks[d]+e.tShift[d])>=(x=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(C++)||E){if(u)break;for(k=!1,i=0,s=_.length;i<s;i++)if(_[i](e,d,n,!0)){k=!0;break}if(k){e.lineMax=d,0!==e.blkIndent&&(b.push(e.bMarks[d]),h.push(e.bsCount[d]),v.push(e.tShift[d]),j.push(e.sCount[d]),e.sCount[d]-=e.blkIndent);break}b.push(e.bMarks[d]),h.push(e.bsCount[d]),v.push(e.tShift[d]),j.push(e.sCount[d]),e.sCount[d]=-1}else{for(l=m=e.sCount[d]+1,32===e.src.charCodeAt(C)?(C++,l++,m++,o=!1,O=!0):9===e.src.charCodeAt(C)?(O=!0,(e.bsCount[d]+m)%4==3?(C++,l++,m++,o=!1):o=!0):O=!1,b.push(e.bMarks[d]),e.bMarks[d]=C;C<x&&(c=e.src.charCodeAt(C),r(c));)9===c?m+=4-(m+e.bsCount[d]+(o?1:0))%4:m++,C++;u=C>=x,h.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(O?1:0),j.push(e.sCount[d]),e.sCount[d]=m-l,v.push(e.tShift[d]),e.tShift[d]=C-e.bMarks[d]}for(f=e.blkIndent,e.blkIndent=0,(y=e.push("blockquote_open","blockquote",1)).markup=">",y.map=p=[t,0],e.md.block.tokenize(e,t,d),(y=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=w,e.parentType=g,p[1]=e.line,i=0;i<v.length;i++)e.bMarks[i+t]=b[i],e.tShift[i+t]=v[i],e.sCount[i+t]=j[i],e.bsCount[i+t]=h[i];return e.blkIndent=f,!0}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(c=1;s<u;){if((i=e.src.charCodeAt(s++))!==o&&!r(i))return!1;i===o&&c++}return!(c<3)&&(a||(e.line=t+1,(l=e.push("hr","hr",0)).map=[t,e.line],l.markup=Array(c+1).join(String.fromCharCode(o))),!0)}},function(e,t,n){"use strict";var r=n(30).isSpace;function a(e,t){var n,a,o,c;return a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],42!==(n=e.src.charCodeAt(a++))&&45!==n&&43!==n||a<o&&(c=e.src.charCodeAt(a),!r(c))?-1:a}function o(e,t){var n,a=e.bMarks[t]+e.tShift[t],o=a,c=e.eMarks[t];if(o+1>=c)return-1;if((n=e.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=c)return-1;if(!((n=e.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-a>=10)return-1}return o<c&&(n=e.src.charCodeAt(o),!r(n))?-1:o}e.exports=function(e,t,n,r){var c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_,y,E,w,C,x,S,N,A,T,P,I,M=!1,R=!0;if(e.sCount[t]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]<e.blkIndent)return!1;if(r&&"paragraph"===e.parentType&&e.tShift[t]>=e.blkIndent&&(M=!0),(S=o(e,t))>=0){if(d=!0,A=e.bMarks[t]+e.tShift[t],j=Number(e.src.substr(A,S-A-1)),M&&1!==j)return!1}else{if(!((S=a(e,t))>=0))return!1;d=!1}if(M&&e.skipSpaces(S)>=e.eMarks[t])return!1;if(g=e.src.charCodeAt(S-1),r)return!0;for(f=e.tokens.length,d?(I=e.push("ordered_list_open","ol",1),1!==j&&(I.attrs=[["start",j]])):I=e.push("bullet_list_open","ul",1),I.map=h=[t,0],I.markup=String.fromCharCode(g),O=t,N=!1,P=e.md.block.ruler.getRules("list"),y=e.parentType,e.parentType="list";O<n;){for(x=S,v=e.eMarks[O],p=k=e.sCount[O]+S-(e.bMarks[t]+e.tShift[t]);x<v;){if(9===(c=e.src.charCodeAt(x)))k+=4-(k+e.bsCount[O])%4;else{if(32!==c)break;k++}x++}if((u=(i=x)>=v?1:k-p)>4&&(u=1),s=p+u,(I=e.push("list_item_open","li",1)).markup=String.fromCharCode(g),I.map=m=[t,0],C=e.tight,w=e.tShift[t],E=e.sCount[t],_=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=s,e.tight=!0,e.tShift[t]=i-e.bMarks[t],e.sCount[t]=k,i>=v&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!N||(R=!1),N=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=_,e.tShift[t]=w,e.sCount[t]=E,e.tight=C,(I=e.push("list_item_close","li",-1)).markup=String.fromCharCode(g),O=t=e.line,m[1]=O,i=e.bMarks[t],O>=n)break;if(e.sCount[O]<e.blkIndent)break;if(e.sCount[t]-e.blkIndent>=4)break;for(T=!1,l=0,b=P.length;l<b;l++)if(P[l](e,O,n,!0)){T=!0;break}if(T)break;if(d){if((S=o(e,O))<0)break}else if((S=a(e,O))<0)break;if(g!==e.src.charCodeAt(S-1))break}return(I=d?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(g),h[1]=O,e.line=O,e.parentType=y,R&&function(e,t){var n,r,a=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===a&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}(e,f),!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t,n,o){var c,i,l,s,u,p,d,m,b,h,f,g,j,v,O,k,_=0,y=e.bMarks[t]+e.tShift[t],E=e.eMarks[t],w=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(y))return!1;for(;++y<E;)if(93===e.src.charCodeAt(y)&&92!==e.src.charCodeAt(y-1)){if(y+1===E)return!1;if(58!==e.src.charCodeAt(y+1))return!1;break}for(s=e.lineMax,O=e.md.block.ruler.getRules("reference"),h=e.parentType,e.parentType="reference";w<s&&!e.isEmpty(w);w++)if(!(e.sCount[w]-e.blkIndent>3||e.sCount[w]<0)){for(v=!1,p=0,d=O.length;p<d;p++)if(O[p](e,w,s,!0)){v=!0;break}if(v)break}for(E=(j=e.getLines(t,w,e.blkIndent,!1).trim()).length,y=1;y<E;y++){if(91===(c=j.charCodeAt(y)))return!1;if(93===c){b=y;break}(10===c||92===c&&++y<E&&10===j.charCodeAt(y))&&_++}if(b<0||58!==j.charCodeAt(b+1))return!1;for(y=b+2;y<E;y++)if(10===(c=j.charCodeAt(y)))_++;else if(!a(c))break;if(!(f=e.md.helpers.parseLinkDestination(j,y,E)).ok)return!1;if(u=e.md.normalizeLink(f.str),!e.md.validateLink(u))return!1;for(i=y=f.pos,l=_+=f.lines,g=y;y<E;y++)if(10===(c=j.charCodeAt(y)))_++;else if(!a(c))break;for(f=e.md.helpers.parseLinkTitle(j,y,E),y<E&&g!==y&&f.ok?(k=f.str,y=f.pos,_+=f.lines):(k="",y=i,_=l);y<E&&(c=j.charCodeAt(y),a(c));)y++;if(y<E&&10!==j.charCodeAt(y)&&k)for(k="",y=i,_=l;y<E&&(c=j.charCodeAt(y),a(c));)y++;return!(y<E&&10!==j.charCodeAt(y))&&(!!(m=r(j.slice(1,b)))&&(o||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[m]&&(e.env.references[m]={title:k,href:u}),e.parentType=h,e.line=t+_+1),!0))}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t,n,a){var o,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(c=1,o=e.src.charCodeAt(++s);35===o&&s<u&&c<=6;)c++,o=e.src.charCodeAt(++s);return!(c>6||s<u&&!r(o))&&(a||(u=e.skipSpacesBack(u,s),(i=e.skipCharsBack(u,35,s))>s&&r(e.src.charCodeAt(i-1))&&(u=i),e.line=t+1,(l=e.push("heading_open","h"+String(c),1)).markup="########".slice(0,c),l.map=[t,e.line],(l=e.push("inline","",0)).content=e.src.slice(s,u).trim(),l.map=[t,e.line],l.children=[],(l=e.push("heading_close","h"+String(c),-1)).markup="########".slice(0,c)),!0)}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,a,o,c,i,l,s,u,p,d,m=t+1,b=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(d=e.parentType,e.parentType="paragraph";m<n&&!e.isEmpty(m);m++)if(!(e.sCount[m]-e.blkIndent>3)){if(e.sCount[m]>=e.blkIndent&&(l=e.bMarks[m]+e.tShift[m])<(s=e.eMarks[m])&&(45===(p=e.src.charCodeAt(l))||61===p)&&(l=e.skipChars(l,p),(l=e.skipSpaces(l))>=s)){u=61===p?1:2;break}if(!(e.sCount[m]<0)){for(a=!1,o=0,c=b.length;o<c;o++)if(b[o](e,m,n,!0)){a=!0;break}if(a)break}}return!!u&&(r=e.getLines(t,m,e.blkIndent,!1).trim(),e.line=m+1,(i=e.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(p),i.map=[t,e.line],(i=e.push("inline","",0)).content=r,i.map=[t,e.line-1],i.children=[],(i=e.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(p),e.parentType=d,!0)}},function(e,t,n){"use strict";var r=n(344),a=n(178).HTML_OPEN_CLOSE_TAG_RE,o=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(a.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var a,c,i,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(s))return!1;for(l=e.src.slice(s,u),a=0;a<o.length&&!o[a][0].test(l);a++);if(a===o.length)return!1;if(r)return o[a][2];if(c=t+1,!o[a][1].test(l))for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(s=e.bMarks[c]+e.tShift[c],u=e.eMarks[c],l=e.src.slice(s,u),o[a][1].test(l)){0!==l.length&&c++;break}return e.line=c,(i=e.push("html_block","",0)).map=[t,c],i.content=e.getLines(t,c,e.blkIndent,!0),!0}},function(e,t,n){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,a,o,c,i,l=t+1,s=e.md.block.ruler.getRules("paragraph"),u=e.lineMax;for(i=e.parentType,e.parentType="paragraph";l<u&&!e.isEmpty(l);l++)if(!(e.sCount[l]-e.blkIndent>3||e.sCount[l]<0)){for(r=!1,a=0,o=s.length;a<o;a++)if(s[a](e,l,u,!0)){r=!0;break}if(r)break}return n=e.getLines(t,l,e.blkIndent,!1).trim(),e.line=l,(c=e.push("paragraph_open","p",1)).map=[t,e.line],(c=e.push("inline","",0)).content=n,c.map=[t,e.line],c.children=[],c=e.push("paragraph_close","p",-1),e.parentType=i,!0}},function(e,t,n){"use strict";var r=n(135),a=n(30).isSpace;function o(e,t,n,r){var o,c,i,l,s,u,p,d;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",d=!1,i=l=u=p=0,s=(c=this.src).length;l<s;l++){if(o=c.charCodeAt(l),!d){if(a(o)){u++,9===o?p+=4-p%4:p++;continue}d=!0}10!==o&&l!==s-1||(10!==o&&l++,this.bMarks.push(i),this.eMarks.push(l),this.tShift.push(u),this.sCount.push(p),this.bsCount.push(0),d=!1,u=0,p=0,i=l+1)}this.bMarks.push(c.length),this.eMarks.push(c.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}o.prototype.push=function(e,t,n){var a=new r(e,t,n);return a.block=!0,n<0&&this.level--,a.level=this.level,n>0&&this.level++,this.tokens.push(a),a},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},o.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),a(t));e++);return e},o.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!a(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},o.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,c,i,l,s,u,p,d=e;if(e>=t)return"";for(u=new Array(t-e),o=0;d<t;d++,o++){for(c=0,p=l=this.bMarks[d],s=d+1<t||r?this.eMarks[d]+1:this.eMarks[d];l<s&&c<n;){if(i=this.src.charCodeAt(l),a(i))9===i?c+=4-(c+this.bsCount[d])%4:c++;else{if(!(l-p<this.tShift[d]))break;c++}l++}u[o]=c>n?new Array(c-n+1).join(" ")+this.src.slice(l,s):this.src.slice(l,s)}return u.join("")},o.prototype.Token=r,e.exports=o},function(e,t,n){"use strict";var r=n(134),a=[["text",n(348)],["newline",n(349)],["escape",n(350)],["backticks",n(351)],["strikethrough",n(179).tokenize],["emphasis",n(180).tokenize],["link",n(352)],["image",n(353)],["autolink",n(354)],["html_inline",n(355)],["entity",n(356)]],o=[["balance_pairs",n(357)],["strikethrough",n(179).postProcess],["emphasis",n(180).postProcess],["text_collapse",n(358)]];function c(){var e;for(this.ruler=new r,e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);for(this.ruler2=new r,e=0;e<o.length;e++)this.ruler2.push(o[e][0],o[e][1])}c.prototype.skipToken=function(e){var t,n,r=e.pos,a=this.ruler.getRules(""),o=a.length,c=e.md.options.maxNesting,i=e.cache;if(void 0===i[r]){if(e.level<c)for(n=0;n<o&&(e.level++,t=a[n](e,!0),e.level--,!t);n++);else e.pos=e.posMax;t||e.pos++,i[r]=e.pos}else e.pos=i[r]},c.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),a=r.length,o=e.posMax,c=e.md.options.maxNesting;e.pos<o;){if(e.level<c)for(n=0;n<a&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},c.prototype.parse=function(e,t,n,r){var a,o,c,i=new this.State(e,t,n,r);for(this.tokenize(i),c=(o=this.ruler2.getRules("")).length,a=0;a<c;a++)o[a](i)},c.prototype.State=n(359),e.exports=c},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";var r=n(30).isSpace;e.exports=function(e,t){var n,a,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;for(n=e.pending.length-1,a=e.posMax,t||(n>=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),o++;o<a&&r(e.src.charCodeAt(o));)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=n(30).isSpace,a=[],o=0;o<256;o++)a.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){a[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o=e.pos,c=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<c){if((n=e.src.charCodeAt(o))<256&&0!==a[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push("hardbreak","br",0),o++;o<c&&(n=e.src.charCodeAt(o),r(n));)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,a,o,c,i,l,s,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;u<r&&96===e.src.charCodeAt(u);)u++;if(l=(a=e.src.slice(n,u)).length,e.backticksScanned&&(e.backticks[l]||0)<=n)return t||(e.pending+=a),e.pos+=l,!0;for(c=i=u;-1!==(c=e.src.indexOf("`",i));){for(i=c+1;i<r&&96===e.src.charCodeAt(i);)i++;if((s=i-c)===l)return t||((o=e.push("code_inline","code",0)).markup=a,o.content=e.src.slice(u,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=i,!0;e.backticks[s]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=l,!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t){var n,o,c,i,l,s,u,p,d="",m="",b=e.pos,h=e.posMax,f=e.pos,g=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(l=e.pos+1,(i=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((s=i+1)<h&&40===e.src.charCodeAt(s)){for(g=!1,s++;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);if(s>=h)return!1;if(f=s,(u=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok){for(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?s=u.pos:d="",f=s;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);if(u=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<h&&f!==s&&u.ok)for(m=u.str,s=u.pos;s<h&&(o=e.src.charCodeAt(s),a(o)||10===o);s++);}(s>=h||41!==e.src.charCodeAt(s))&&(g=!0),s++}if(g){if(void 0===e.env.references)return!1;if(s<h&&91===e.src.charCodeAt(s)?(f=s+1,(s=e.md.helpers.parseLinkLabel(e,s))>=0?c=e.src.slice(f,s++):s=i+1):s=i+1,c||(c=e.src.slice(l,i)),!(p=e.env.references[r(c)]))return e.pos=b,!1;d=p.href,m=p.title}return t||(e.pos=l,e.posMax=i,e.push("link_open","a",1).attrs=n=[["href",d]],m&&n.push(["title",m]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=s,e.posMax=h,!0}},function(e,t,n){"use strict";var r=n(30).normalizeReference,a=n(30).isSpace;e.exports=function(e,t){var n,o,c,i,l,s,u,p,d,m,b,h,f,g="",j=e.pos,v=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(s=e.pos+2,(l=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=l+1)<v&&40===e.src.charCodeAt(u)){for(u++;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(u>=v)return!1;for(f=u,(d=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(g=e.md.normalizeLink(d.str),e.md.validateLink(g)?u=d.pos:g=""),f=u;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(d=e.md.helpers.parseLinkTitle(e.src,u,e.posMax),u<v&&f!==u&&d.ok)for(m=d.str,u=d.pos;u<v&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);else m="";if(u>=v||41!==e.src.charCodeAt(u))return e.pos=j,!1;u++}else{if(void 0===e.env.references)return!1;if(u<v&&91===e.src.charCodeAt(u)?(f=u+1,(u=e.md.helpers.parseLinkLabel(e,u))>=0?i=e.src.slice(f,u++):u=l+1):u=l+1,i||(i=e.src.slice(s,l)),!(p=e.env.references[r(i)]))return e.pos=j,!1;g=p.href,m=p.title}return t||(c=e.src.slice(s,l),e.md.inline.parse(c,e.md,e.env,h=[]),(b=e.push("image","img",0)).attrs=n=[["src",g],["alt",""]],b.children=h,b.content=c,m&&n.push(["title",m])),e.pos=u,e.posMax=v,!0}},function(e,t,n){"use strict";var r=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,a=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,t){var n,o,c,i,l,s,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(l=e.pos,s=e.posMax;;){if(++u>=s)return!1;if(60===(i=e.src.charCodeAt(u)))return!1;if(62===i)break}return n=e.src.slice(l+1,u),a.test(n)?(o=e.md.normalizeLink(n),!!e.md.validateLink(o)&&(t||((c=e.push("link_open","a",1)).attrs=[["href",o]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(n),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=n.length+2,!0)):!!r.test(n)&&(o=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(o)&&(t||((c=e.push("link_open","a",1)).attrs=[["href",o]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(n),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=n.length+2,!0))}},function(e,t,n){"use strict";var r=n(178).HTML_TAG_RE;e.exports=function(e,t){var n,a,o,c=e.pos;return!!e.md.options.html&&(o=e.posMax,!(60!==e.src.charCodeAt(c)||c+2>=o)&&(!(33!==(n=e.src.charCodeAt(c+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(a=e.src.slice(c).match(r))&&(t||(e.push("html_inline","",0).content=e.src.slice(c,c+a[0].length)),e.pos+=a[0].length,!0))))}},function(e,t,n){"use strict";var r=n(173),a=n(30).has,o=n(30).isValidEntityCode,c=n(30).fromCodePoint,i=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,s,u=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(u))return!1;if(u+1<p)if(35===e.src.charCodeAt(u+1)){if(s=e.src.slice(u).match(i))return t||(n="x"===s[1][0].toLowerCase()?parseInt(s[1].slice(1),16):parseInt(s[1],10),e.pending+=o(n)?c(n):c(65533)),e.pos+=s[0].length,!0}else if((s=e.src.slice(u).match(l))&&a(r,s[1]))return t||(e.pending+=r[s[1]]),e.pos+=s[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,a,o,c,i,l,s,u={},p=t.length;for(n=0;n<p;n++)if((a=t[n]).length=a.length||0,a.close){for(u.hasOwnProperty(a.marker)||(u[a.marker]=[-1,-1,-1]),c=u[a.marker][a.length%3],(r=n-a.jump-1)<-1&&(r=-1),i=r;r>c;r-=o.jump+1)if((o=t[r]).marker===a.marker&&o.open&&o.end<0&&(l=!1,(o.close||a.open)&&(o.length+a.length)%3==0&&(o.length%3==0&&a.length%3==0||(l=!0)),!l)){s=r>0&&!t[r-1].open?t[r-1].jump+1:0,a.jump=n-r+s,a.open=!1,o.end=n,o.jump=s,o.close=!1,i=-1;break}-1!==i&&(u[a.marker][(a.length||0)%3]=i)}}e.exports=function(e){var t,n=e.tokens_meta,a=e.tokens_meta.length;for(r(0,e.delimiters),t=0;t<a;t++)n[t]&&n[t].delimiters&&r(0,n[t].delimiters)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=0,a=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)a[t].nesting<0&&r--,a[t].level=r,a[t].nesting>0&&r++,"text"===a[t].type&&t+1<o&&"text"===a[t+1].type?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}},function(e,t,n){"use strict";var r=n(135),a=n(30).isWhiteSpace,o=n(30).isPunctChar,c=n(30).isMdAsciiPunct;function i(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}i.prototype.pushPending=function(){var e=new r("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},i.prototype.push=function(e,t,n){this.pending&&this.pushPending();var a=new r(e,t,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),a.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(a),this.tokens_meta.push(o),a},i.prototype.scanDelims=function(e,t){var n,r,i,l,s,u,p,d,m,b=e,h=!0,f=!0,g=this.posMax,j=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;b<g&&this.src.charCodeAt(b)===j;)b++;return i=b-e,r=b<g?this.src.charCodeAt(b):32,p=c(n)||o(String.fromCharCode(n)),m=c(r)||o(String.fromCharCode(r)),u=a(n),(d=a(r))?h=!1:m&&(u||p||(h=!1)),u?f=!1:p&&(d||m||(f=!1)),t?(l=h,s=f):(l=h&&(!f||p),s=f&&(!h||m)),{can_open:l,can_close:s,length:i}},i.prototype.Token=r,e.exports=i},function(e,t,n){"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function a(e){return Object.prototype.toString.call(e)}function o(e){return"[object Function]"===a(e)}function c(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var i={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var l={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},s="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=n(361)(e.__opts__),r=e.__tlds__.slice();function i(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");var l=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===a(n))return!function(e){return"[object RegExp]"===a(e)}(n.validate)?o(n.validate)?r.validate=n.validate:s(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?s(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===a(e)}(n)?s(t,n):l.push(t)}})),l.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(c).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var n=e.__index__,r=e.__last_index__,a=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=a,this.text=a,this.url=a}function d(e,t){var n=new p(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function m(e,t){if(!(this instanceof m))return new m(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||i.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},i,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},l,e),this.__compiled__={},this.__tlds__=s,this.__tlds_replaced__=!1,this.re={},u(this)}m.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},m.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},m.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,a,o,c,i,l;if(this.re.schema_test.test(e))for((i=this.re.schema_search).lastIndex=0;null!==(t=i.exec(e));)if(a=this.testSchemaAt(e,t[2],i.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+a;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,c=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&c>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=c)),this.__index__>=0},m.prototype.pretest=function(e){return this.re.pretest.test(e)},m.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},m.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(d(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(d(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},m.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},m.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},m.prototype.onCompile=function(){},e.exports=m},function(e,t,n){"use strict";e.exports=function(e){var t={};t.src_Any=n(175).source,t.src_Cc=n(176).source,t.src_Z=n(177).source,t.src_P=n(133).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+"[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"save",(function(){return Dt})),n.d(r,"attributes",(function(){return Ft})),n.d(r,"support",(function(){return zt}));var a={};n.r(a),n.d(a,"save",(function(){return Tn})),n.d(a,"attributes",(function(){return Pn})),n.d(a,"supports",(function(){return In}));var o={};n.r(o),n.d(o,"save",(function(){return _r})),n.d(o,"attributes",(function(){return Er})),n.d(o,"supports",(function(){return wr})),n.d(o,"migrate",(function(){return Cr}));var c=n(20),i=n(4),l=n.n(i),s=n(5),u=n.n(s),p=n(0),d=n(1),m=n(11),b=n(3),h=n(2),f=n(19),g=n.n(f),j=n(12),v=n.n(j),O=n(15),k=n.n(O),_=n(7),y=n.n(_),E=n(13),w=n.n(E),C=n(14),x=n.n(C),S=n(6),N=n(51),A=[{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Original","image style","jetpack"),value:void 0},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Black and White","image style","jetpack"),value:"black-and-white"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),title:Object(d._x)("Sepia","image style","jetpack"),value:"sepia"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:"1977",value:"1977"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:Object(d._x)("Clarendon","image style","jetpack"),value:"clarendon"},{icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0z"}),Object(p.createElement)(h.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:Object(d._x)("Gingham","image style","jetpack"),value:"gingham"}],T=Object(d.__)("Pick an image filter","jetpack");function P(e){var t=e.value,n=e.onChange;return Object(p.createElement)(h.Dropdown,{position:"bottom right",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(p.createElement)(h.Toolbar,{controls:[{onClick:t,extraProps:{"aria-haspopup":"true","aria-expanded":n},title:T,tooltip:T,icon:Object(p.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(p.createElement)(h.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(p.createElement)(h.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"}))}]})},renderContent:function(e){var r=e.onClose;return Object(p.createElement)(h.NavigableMenu,{className:"tiled-gallery__filter-picker-menu"},A.map((function(e){var a,o=e.icon,c=e.title,i=e.value;return Object(p.createElement)(h.MenuItem,{className:t===i?"is-active":void 0,icon:o,isSelected:t===i,key:i||"original",onClick:(a=i,function(){n(t===a?void 0:a),r()}),role:"menuitemcheckbox"},c)})))}})}var I=n(8),M=n.n(I),R=n(24),B=n(29),L=n(10),D=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})),F=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})),z=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})),U=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})),V=Object(p.createElement)(h.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(h.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"})),G=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"img",Object(p.createRef)()),u()(y()(e),"onImageClick",(function(){e.props.isSelected||e.props.onSelect()})),u()(y()(e),"onImageKeyDown",(function(t){e.img.current===document.activeElement&&e.props.isSelected&&[R.BACKSPACE,R.DELETE].includes(t.keyCode)&&e.props.onRemove()})),e}return k()(n,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.alt,n=e.height,r=e.image,a=e.link,o=e.url,c=e.width;if(r){var i={};!t&&r.alt_text&&(i.alt=r.alt_text),!n&&r.media_details&&r.media_details.height&&(i.height=+r.media_details.height),!a&&r.link&&(i.link=r.link),!o&&r.source_url&&(i.url=r.source_url),!c&&r.media_details&&r.media_details.width&&(i.width=+r.media_details.width),Object.keys(i).length&&this.props.setAttributes(i)}}},{key:"render",value:function(){var e,t=this.props,n=t["aria-label"],r=t.alt,a=t.columns,o=t.height,c=t.id,i=t.imageFilter,l=t.isFirstItem,s=t.isLastItem,m=t.isSelected,b=t.link,f=t.linkTo,g=t.onMoveBackward,j=t.onMoveForward,v=t.onRemove,O=t.origUrl,k=t.showMovers,_=t.srcSet,y=t.url,E=t.width;switch(f){case"media":e=y;break;case"attachment":e=b}var w=Object(B.isBlobURL)(O),C=Object(p.createElement)(p.Fragment,null,Object(p.createElement)("img",{alt:r,"aria-label":n,"data-height":o,"data-id":c,"data-link":b,"data-url":O,"data-width":E,onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,ref:this.img,src:w?void 0:y,srcSet:w?void 0:_,tabIndex:"0",style:w?{backgroundImage:"url(".concat(O,")")}:void 0}),w&&Object(p.createElement)(h.Spinner,null));return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({"is-selected":m,"is-transient":w},"filter__".concat(i),!!i))},k&&Object(p.createElement)("div",{className:"tiled-gallery__item__move-menu"},Object(p.createElement)(h.Button,{icon:1===a?U:D,onClick:l?void 0:g,className:"tiled-gallery__item__move-backward",label:Object(d.__)("Move image backward","jetpack"),"aria-disabled":l,disabled:!m}),Object(p.createElement)(h.Button,{icon:1===a?z:F,onClick:s?void 0:j,className:"tiled-gallery__item__move-forward",label:Object(d.__)("Move image forward","jetpack"),"aria-disabled":s,disabled:!m})),Object(p.createElement)("div",{className:"tiled-gallery__item__inline-menu"},Object(p.createElement)(h.Button,{icon:V,onClick:v,className:"tiled-gallery__item__remove",label:Object(d.__)("Remove image","jetpack"),disabled:!m})),e?Object(p.createElement)("a",null,C):C)}}]),n}(p.Component),H=Object(L.withSelect)((function(e,t){var n=e("core").getMedia,r=t.id;return{image:r?n(r):null}}))(G);function q(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s,"data-amp-layout":"responsive"});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}var W=n(65),$=n.n(W),K=n(72);function Z(e){var t=e.children,n=e.width,r=n?{flexBasis:"".concat(n,"%")}:void 0;return Object(p.createElement)("div",{className:"tiled-gallery__col",style:r},t)}function Y(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function J(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}var X=n(114);function Q(e){var t=e.height,n=e.width;return t&&n?n/t:1}var ee=Oe([2,1,2],5),te=ke([_e,_e,ye,_e,_e]),ne=ke([_e,_e,_e,ye,_e,_e,_e]),re=Oe([3,1,3],5),ae=ke([ye,_e,_e,ye]),oe=Oe([1,2,1],5),ce=ke([ye,_e,_e,_e]),ie=Oe([1,3],3),le=ke([_e,_e,_e,ye]),se=Oe([3,1],3),ue=ke([we(1.6),Object(b.overEvery)(Ee(.9),we(2)),Object(b.overEvery)(Ee(.9),we(2))]),pe=Oe([1,2],3),de=Oe([1,1,1,1,1],1),me=Oe([1,1,1,1],1),be=Oe([1,1,1],3),he=ke([Object(b.overEvery)(Ee(.9),we(2)),Object(b.overEvery)(Ee(.9),we(2)),we(1.6)]),fe=Oe([2,1],3),ge=ke([function(e){return e>=2}]);function je(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&be(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function ve(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return me(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function Oe(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function ke(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function _e(e){return e>=1&&e<2}function ye(e){return e<1}function Ee(e){return function(t){return t>=e}}function we(e){return function(t){return t<e}}var Ce=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),u()(y()(e),"ro",null),u()(y()(e),"handleGalleryResize",(function(t){e.pendingRaf&&(cancelAnimationFrame(e.pendingRaf),e.pendingRaf=null),e.pendingRaf=requestAnimationFrame((function(){var n,r=$()(t);try{var a=function(){var t=n.value,r=t.contentRect,a=t.target,o=r.width,c=[];Object(X.a)(a).forEach((function(e){c.push(Object(X.b)(e,o))})),void 0!==e.props.onResize&&e.props.onResize(c)};for(r.s();!(n=r.n()).done;)a()}catch(o){r.e(o)}finally{r.f()}}))})),e}return k()(n,[{key:"componentDidMount",value:function(){this.observeResize()}},{key:"componentWillUnmount",value:function(){this.unobserveResize()}},{key:"componentDidUpdate",value:function(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}},{key:"triggerResize",value:function(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}},{key:"observeResize",value:function(){this.triggerResize(),this.ro=new K.a(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}},{key:"unobserveResize",value:function(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=e.columnWidths,i=function(e){return Object(b.map)(e,Q)}(r),l="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(i,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&te(r)&&ee(n)?[2,1,2]:r.length>15&&ne(r)&&re(n)?[3,1,3]:5!==r.length&&ae(r)&&oe(n)?[1,2,1]:ce(r)&&ie(n)?[1,3]:le(r)&&se(n)?[3,1]:ue(r)&&pe(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&de(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:ve(n,r)?[1,1,1,1]:je(n,r,t)?[1,1,1]:he(r)&&fe(n)?[2,1]:ge(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(i,{isWide:["full","wide"].includes(t)}),s=0;return Object(p.createElement)(Y,{galleryRef:this.gallery},l.map((function(e,t){return Object(p.createElement)(J,{key:t},e.map((function(e,n){var r=o.slice(s,s+e);return s+=e,Object(p.createElement)(Z,{key:n,width:c?c[t][n]:void 0},r)})))})))}}]),n}(p.Component),xe=n(28);function Se(e){var t=e.columns,n=e.renderedImages,r=Math.min(xe.h,t),a=n.length%r;return Object(p.createElement)(Y,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(J,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Z,{key:t},e)})))})))}var Ne=n(90),Ae=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.isSave,i=n.linkTo,l=n.layoutStyle,s=n.onMoveBackward,u=n.onMoveForward,m=n.onRemoveImage,b=n.onSelectImage,h=n.selectedImage,f=n.setImageAttributes,g=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),j=c?q:H,v=Object(Ne.b)(e,{layoutStyle:l}),O=v.src,k=v.srcSet;return Object(p.createElement)(j,{alt:e.alt,"aria-label":g,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:h===t,key:t,link:e.link,linkTo:i,onMoveBackward:c?void 0:s(t),onMoveForward:c?void 0:u(t),onRemove:c?void 0:m(t),onSelect:c?void 0:b(t),origUrl:e.url,setAttributes:c?void 0:f(t),showMovers:o.length>1,srcSet:k,url:O,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=e.onResize,s=e.isSave,d=e.columnWidths,m=Object(Ne.a)(c)?Se:Ce,b=this.props.images.map(this.renderImage,this),h=c!==xe.c?Math.min(i,xe.i):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(h),h>0))},Object(p.createElement)(m,{align:t,columns:a,columnWidths:s?d:void 0,images:o,layoutStyle:c,renderedImages:b,onResize:s?void 0:l}),n)}}]),n}(p.Component),Te=n(42),Pe=n(73),Ie=[{value:"attachment",label:Object(d.__)("Attachment Page","jetpack")},{value:"media",label:Object(d.__)("Media File","jetpack")},{value:"none",label:Object(d.__)("None","jetpack")}];function Me(e){return Math.min(3,e.images.length)}var Re=function(e){var t=Object(b.pick)(e,[["alt"],["id"],["link"]]);return t.url=Object(b.get)(e,["sizes","large","url"])||Object(b.get)(e,["media_details","sizes","large","source_url"])||e.url,t},Be=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"state",{selectedImage:null,changed:void 0===e.props.attributes.columnWidths}),u()(y()(e),"addFiles",(function(t){var n=e.props.attributes.images||[],r=e.props.noticeOperations;Object(N.mediaUpload)({allowedTypes:xe.a,filesList:t,onFileChange:function(t){var r=t.map((function(e){return Re(e)}));e.setAttributes({images:n.concat(r)})},onError:r.createErrorNotice}),e.setState({changed:!0})})),u()(y()(e),"onRemoveImage",(function(t){return function(){var n=Object(b.filter)(e.props.attributes.images,(function(e,n){return t!==n})),r=e.props.attributes.columns;e.setState({selectedImage:null,changed:!0}),e.setAttributes({images:n,columns:r?Math.min(n.length,r):r})}})),u()(y()(e),"onSelectImage",(function(t){return function(){e.state.selectedImage!==t&&e.setState({selectedImage:t})}})),u()(y()(e),"onSelectImages",(function(t){var n=e.props.attributes.columns;e.setAttributes({columns:n?Math.min(t.length,n):n,images:t.map((function(e){return Re(e)}))}),e.setState({changed:!0})})),u()(y()(e),"onMove",(function(t,n){var r=g()(e.props.attributes.images);r.splice(n,1,e.props.attributes.images[t]),r.splice(t,1,e.props.attributes.images[n]),e.setState({selectedImage:n,changed:!0}),e.setAttributes({images:r})})),u()(y()(e),"onMoveForward",(function(t){return function(){t!==e.props.attributes.images.length-1&&e.onMove(t,t+1)}})),u()(y()(e),"onMoveBackward",(function(t){return function(){0!==t&&e.onMove(t,t-1)}})),u()(y()(e),"onResize",(function(t){e.state.changed&&e.setAttributes({columnWidths:t})})),u()(y()(e),"setColumnsNumber",(function(t){return e.setAttributes({columns:t})})),u()(y()(e),"setRoundedCorners",(function(t){return e.setAttributes({roundedCorners:t})})),u()(y()(e),"setImageAttributes",(function(t){return function(n){var r=e.props.attributes.images;r[t]&&e.setAttributes({images:[].concat(g()(r.slice(0,t)),[l()(l()({},r[t]),n)],g()(r.slice(t+1)))})}})),u()(y()(e),"setLinkTo",(function(t){return e.setAttributes({linkTo:t})})),u()(y()(e),"uploadFromFiles",(function(t){return e.addFiles(t.target.files)})),e}return k()(n,[{key:"setAttributes",value:function(e){if(e.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');e.images&&(e=l()(l()({},e),{},{ids:e.images.map((function(e){var t=e.id;return parseInt(t,10)}))})),this.props.setAttributes(e)}},{key:"render",value:function(){var e=this,t=this.state.selectedImage,n=this.props,r=n.attributes,a=n.isSelected,o=n.className,c=n.noticeOperations,i=n.noticeUI,l=n.setAttributes,s=r.align,u=r.columns,m=void 0===u?Me(r):u,b=r.imageFilter,f=r.images,g=r.linkTo,j=r.roundedCorners,v=Object(p.createElement)(h.DropZone,{onFilesDrop:this.addFiles}),O=Object(p.createElement)(S.BlockControls,null,!!f.length&&Object(p.createElement)(p.Fragment,null,Object(p.createElement)(h.ToolbarGroup,null,Object(p.createElement)(h.ToolbarItem,null,(function(){return Object(p.createElement)(S.MediaUpload,{onSelect:e.onSelectImages,allowedTypes:xe.a,multiple:!0,gallery:!0,value:f.map((function(e){return e.id})),render:function(e){var t=e.open;return Object(p.createElement)(Pe.a,{label:Object(d.__)("Edit Gallery","jetpack"),onClick:t})}})}))),Object(p.createElement)(P,{value:b,onChange:function(t){l({imageFilter:t}),e.setState({selectedImage:null})}})));if(0===f.length)return Object(p.createElement)(p.Fragment,null,O,Object(p.createElement)(S.MediaPlaceholder,{icon:Object(p.createElement)(S.BlockIcon,{icon:Wr}),className:o,labels:{title:Object(d.__)("Tiled Gallery","jetpack"),name:Object(d.__)("images","jetpack")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:xe.a,multiple:!0,notices:i,onError:c.createErrorNotice}));var k=Object(Te.a)(xe.g,r.className);return Object(p.createElement)(p.Fragment,null,O,Object(p.createElement)(S.InspectorControls,null,Object(p.createElement)(h.PanelBody,{title:Object(d.__)("Tiled Gallery settings","jetpack")},["columns","circle","square"].includes(k)&&f.length>1&&Object(p.createElement)(h.RangeControl,{label:Object(d.__)("Columns","jetpack"),value:m,onChange:this.setColumnsNumber,min:1,max:Math.min(xe.h,f.length)}),k!==xe.c&&Object(p.createElement)(h.RangeControl,{label:Object(d.__)("Rounded corners","jetpack"),value:j,onChange:this.setRoundedCorners,min:0,max:xe.i}),Object(p.createElement)(h.SelectControl,{label:Object(d.__)("Link To","jetpack"),value:g,onChange:this.setLinkTo,options:Ie}))),i,Object(p.createElement)(Ae,{align:s,className:o,columns:m,imageFilter:b,images:f,layoutStyle:k,linkTo:g,onMoveBackward:this.onMoveBackward,onMoveForward:this.onMoveForward,onRemoveImage:this.onRemoveImage,onSelectImage:this.onSelectImage,onResize:this.onResize,roundedCorners:j,selectedImage:a?t:null,setImageAttributes:this.setImageAttributes},v,a&&Object(p.createElement)("div",{className:"tiled-gallery__add-item"},Object(p.createElement)(h.FormFileUpload,{multiple:!0,isLarge:!0,className:"tiled-gallery__add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},Object(d.__)("Upload an image","jetpack")))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.isSelected||null===t.selectedImage?null:{selectedImage:null}}}]),n}(p.Component),Le=Object(h.withNotices)(Be);var De=n(23),Fe=n(16),ze=n(58),Ue=(n(378),n(34)),Ve=n.n(Ue),Ge=n(70),He=n(39);function qe(e){var t,n=e["aria-label"],r=e.alt,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,u=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var d=Object(p.createElement)("img",{alt:r,"aria-label":n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":u,src:s});return Object(p.createElement)("figure",{className:"tiled-gallery__item"},t?Object(p.createElement)("a",{href:t},d):d)}function We(e){var t=e.children;return Object(p.createElement)("div",{className:"tiled-gallery__col"},t)}function $e(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Ke(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}var Ze=n(9),Ye=n.n(Ze),Je="rectangular",Xe=[{isDefault:!0,name:Je},{name:"circle"},{name:"square"},{name:"columns"}];function Qe(e,t){var n=(t-e.reduce((function(e,t){return e+t}),0))/e.length;return e.map((function(e){return e+n}))}function et(e,t){!function(e,t,n){var r=Ye()(t,2),a=r[0],o=r[1],c=1/a*(n-4*(e.childElementCount-1)-o);!function(e,t){var n=t.rawHeight,r=t.rowWidth,a=nt(e),o=a.map((function(e){return(n-4*(e.childElementCount-1))*at(e)[0]})),c=Qe(o,r);a.forEach((function(e,t){var r=o[t],a=c[t];!function(e,t){var n=t.colHeight,r=t.width,a=t.rawWidth,o=Qe(rt(e).map((function(e){return a/ot(e)})),n);Array.from(e.children).forEach((function(e,t){var n=o[t];e.setAttribute("style","height:".concat(n,"px;width:").concat(r,"px;"))}))}(e,{colHeight:n-4*(e.childElementCount-1),width:a,rawWidth:r})}))}(e,{rawHeight:c,rowWidth:n-4*(e.childElementCount-1)})}(e,function(e){return nt(e).map(at).reduce((function(e,t){var n=Ye()(e,2),r=n[0],a=n[1],o=Ye()(t,2);return[r+o[0],a+o[1]]}),[0,0])}(e),t)}function tt(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function nt(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function rt(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function at(e){var t=rt(e),n=t.length,r=1/t.map(ot).reduce((function(e,t){return e+1/t}),0);return[r,r*n||1]}function ot(e){var t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}function ct(e){var t=e.height,n=e.width;return t&&n?n/t:1}var it=xt([2,1,2],5),lt=St([Nt,Nt,At,Nt,Nt]),st=St([Nt,Nt,Nt,At,Nt,Nt,Nt]),ut=xt([3,1,3],5),pt=St([At,Nt,Nt,At]),dt=xt([1,2,1],5),mt=St([At,Nt,Nt,Nt]),bt=xt([1,3],3),ht=St([Nt,Nt,Nt,At]),ft=xt([3,1],3),gt=St([Pt(1.6),Object(b.overEvery)(Tt(.9),Pt(2)),Object(b.overEvery)(Tt(.9),Pt(2))]),jt=xt([1,2],3),vt=xt([1,1,1,1,1],1),Ot=xt([1,1,1,1],1),kt=xt([1,1,1],3),_t=St([Object(b.overEvery)(Tt(.9),Pt(2)),Object(b.overEvery)(Tt(.9),Pt(2)),Pt(1.6)]),yt=xt([2,1],3),Et=St([function(e){return e>=2}]);function wt(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&kt(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function Ct(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return Ot(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function xt(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function St(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function Nt(e){return e>=1&&e<2}function At(e){return e<1}function Tt(e){return function(t){return t>=e}}function Pt(e){return function(t){return t<e}}var It=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),u()(y()(e),"ro",null),u()(y()(e),"handleGalleryResize",(function(t){e.pendingRaf&&(cancelAnimationFrame(e.pendingRaf),e.pendingRaf=null),e.pendingRaf=requestAnimationFrame((function(){var e,n=$()(t);try{var r=function(){var t=e.value,n=t.contentRect,r=t.target,a=n.width;tt(r).forEach((function(e){return et(e,a)}))};for(n.s();!(e=n.n()).done;)r()}catch(a){n.e(a)}finally{n.f()}}))})),e}return k()(n,[{key:"componentDidMount",value:function(){this.observeResize()}},{key:"componentWillUnmount",value:function(){this.unobserveResize()}},{key:"componentDidUpdate",value:function(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}},{key:"triggerResize",value:function(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}},{key:"observeResize",value:function(){this.triggerResize(),this.ro=new K.a(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}},{key:"unobserveResize",value:function(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=function(e){return Object(b.map)(e,ct)}(r),i="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(c,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&<(r)&&it(n)?[2,1,2]:r.length>15&&st(r)&&ut(n)?[3,1,3]:5!==r.length&&pt(r)&&dt(n)?[1,2,1]:mt(r)&&bt(n)?[1,3]:ht(r)&&ft(n)?[3,1]:gt(r)&&jt(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&vt(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:Ct(n,r)?[1,1,1,1]:wt(n,r,t)?[1,1,1]:_t(r)&&yt(n)?[2,1]:Et(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(c,{isWide:["full","wide"].includes(t)}),l=0;return Object(p.createElement)($e,{galleryRef:this.gallery},i.map((function(e,t){return Object(p.createElement)(Ke,{key:t},e.map((function(e,t){var n=o.slice(l,l+e);return l+=e,Object(p.createElement)(We,{key:t},n)})))})))}}]),n}(p.Component);function Mt(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)($e,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Ke,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(We,{key:t},e)})))})))}var Rt=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"photonize",value:function(e){var t=e.height,n=e.width,r=e.url;if(r){if(Object(B.isBlobURL)(r)||/^https?:\/\/localhost/.test(r))return r;var a=r.split("?",1)[0],o=function(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}(r)?Lt:Ge.a;if(Bt(this.props.layoutStyle)&&n&&t){var c=Math.min(2e3,n,t);return o(a,{resize:"".concat(c,",").concat(c)})}return o(a)}}},{key:"renderImage",value:function(e,t){var n=this.props,r=n.images,a=n.linkTo,o=n.selectedImage,c=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,r.length);return Object(p.createElement)(qe,{alt:e.alt,"aria-label":c,height:e.height,id:e.id,origUrl:e.url,isSelected:o===t,key:t,link:e.link,linkTo:a,url:this.photonize(e),width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=Bt(c)?Mt:It,l=this.props.images.map(this.renderImage,this);return Object(p.createElement)("div",{className:r},Object(p.createElement)(i,{align:t,columns:a,images:o,layoutStyle:c,renderedImages:l}),n)}}]),n}(p.Component);function Bt(e){return["circle","square"].includes(e)}function Lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}function Dt(e){var t=e.attributes,n=t.images;if(!n.length)return null;var r=t.align,a=t.className,o=t.columns,c=void 0===o?function(e){return Math.min(3,e.images.length)}(t):o,i=t.linkTo;return Object(p.createElement)(Rt,{align:r,className:a,columns:c,images:n,layoutStyle:Object(Te.a)(Xe,a),linkTo:i})}var Ft={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Je),type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},caption:{selector:"figcaption",source:"html",type:"string"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"}},zt={align:["center","wide","full"],customClassName:!1,html:!1},Ut=2e3,Vt="circle",Gt="rectangular",Ht=[{isDefault:!0,name:Gt},{name:Vt},{name:"square"},{name:"columns"}];function qt(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}function Wt(e){var t=e.children;return Object(p.createElement)("div",{className:"tiled-gallery__col"},t)}function $t(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Kt(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}function Zt(e){var t=e.height,n=e.width;return t&&n?n/t:1}var Yt=gn([2,1,2],5),Jt=jn([vn,vn,On,vn,vn]),Xt=jn([vn,vn,vn,On,vn,vn,vn]),Qt=gn([3,1,3],5),en=jn([On,vn,vn,On]),tn=gn([1,2,1],5),nn=jn([On,vn,vn,vn]),rn=gn([1,3],3),an=jn([vn,vn,vn,On]),on=gn([3,1],3),cn=jn([yn(1.6),Object(b.overEvery)(kn(.9),yn(2)),Object(b.overEvery)(kn(.9),yn(2))]),ln=gn([1,2],3),sn=gn([1,1,1,1,1],1),un=gn([1,1,1,1],1),pn=gn([1,1,1],3),dn=jn([Object(b.overEvery)(kn(.9),yn(2)),Object(b.overEvery)(kn(.9),yn(2)),yn(1.6)]),mn=gn([2,1],3),bn=jn([function(e){return e>=2}]);function hn(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&pn(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function fn(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return un(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function gn(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function jn(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function vn(e){return e>=1&&e<2}function On(e){return e<1}function kn(e){return function(t){return t>=e}}function yn(e){return function(t){return t<e}}var En=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),e}return k()(n,[{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=function(e){return Object(b.map)(e,Zt)}(r),i="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(c,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&Jt(r)&&Yt(n)?[2,1,2]:r.length>15&&Xt(r)&&Qt(n)?[3,1,3]:5!==r.length&&en(r)&&tn(n)?[1,2,1]:nn(r)&&rn(n)?[1,3]:an(r)&&on(n)?[3,1]:cn(r)&&ln(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&sn(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:fn(n,r)?[1,1,1,1]:hn(n,r,t)?[1,1,1]:dn(r)&&mn(n)?[2,1]:bn(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(c,{isWide:["full","wide"].includes(t)}),l=0;return Object(p.createElement)($t,{galleryRef:this.gallery},i.map((function(e,t){return Object(p.createElement)(Kt,{key:t},e.map((function(e,t){var n=o.slice(l,l+e);return l+=e,Object(p.createElement)(Wt,{key:t},n)})))})))}}]),n}(p.Component);function wn(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)($t,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Kt,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Wt,{key:t},e)})))})))}function Cn(e){return["circle","square"].includes(e)}function xn(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}function Sn(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}function Nn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}var An=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.linkTo,i=n.layoutStyle,l=n.selectedImage,s=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.height||!e.url||!e.width)return{};if(Object(B.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};var n,r=e.url.split("?",1)[0],a=e.height,o=e.width,c=t.layoutStyle,i=Sn(r)||!0===xn()?Nn:Ge.a;if(Cn(c)&&o&&a){var l=Math.min(Ut,o,a);n=i(r,{resize:"".concat(l,",").concat(l)})}else n=i(r);var s,u=300,p=600;if(Cn(c)){var d=Math.min(p,o,a),m=Math.min(Ut,o,a);s=Object(b.range)(d,m,u).map((function(e){var t=i(r,{resize:"".concat(e,",").concat(e),strip:"info"});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}else{var h=Math.min(p,o),f=Math.min(Ut,o);s=Object(b.range)(h,f,u).map((function(e){var t=i(r,{strip:"info",width:e});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}return Object.assign({src:n},s&&{srcSet:s})}(e,{layoutStyle:i}),m=u.src,h=u.srcSet;return Object(p.createElement)(qt,{alt:e.alt,"aria-label":s,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:l===t,key:t,link:e.link,linkTo:c,origUrl:e.url,showMovers:o.length>1,srcSet:h,url:m,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=Cn(c)?wn:En,s=this.props.images.map(this.renderImage,this),d=c!==Vt?Math.min(i,20):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(d),d>0))},Object(p.createElement)(l,{align:t,columns:a,images:o,layoutStyle:c,renderedImages:s}),n)}}]),n}(p.Component);function Tn(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?function(e){return Math.min(3,e.images.length)}(t):c,l=t.linkTo,s=t.roundedCorners;return Object(p.createElement)(An,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(Ht,o),linkTo:l,roundedCorners:s})}var Pn={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Gt),type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},In={align:["center","wide","full"],customClassName:!1,html:!1},Mn=2e3,Rn="circle",Bn="rectangular",Ln=[{isDefault:!0,name:Bn},{name:Rn},{name:"square"},{name:"columns"}];function Dn(e){var t,n=e.alt,r=e.imageFilter,a=e.height,o=e.id,c=e.link,i=e.linkTo,l=e.origUrl,s=e.url,d=e.width;if(Object(B.isBlobURL)(l))return null;switch(i){case"media":t=s;break;case"attachment":t=c}var m=Object(p.createElement)("img",{alt:n,"data-height":a,"data-id":o,"data-link":c,"data-url":l,"data-width":d,src:s});return Object(p.createElement)("figure",{className:M()("tiled-gallery__item",u()({},"filter__".concat(r),!!r))},t?Object(p.createElement)("a",{href:t},m):m)}function Fn(e){var t=e.children,n=e.width,r=Math.pow(10,12),a=Math.round(n*r)/r,o=n?{flexBasis:"".concat(a,"%")}:void 0;return Object(p.createElement)("div",{className:"tiled-gallery__col",style:o},t)}function zn(e){var t=e.children,n=e.galleryRef;return Object(p.createElement)("div",{className:"tiled-gallery__gallery",ref:n},t)}function Un(e){var t=e.children,n=e.className;return Object(p.createElement)("div",{className:M()("tiled-gallery__row",n)},t)}function Vn(e){var t=e.height,n=e.width;return t&&n?n/t:1}var Gn=sr([2,1,2],5),Hn=ur([pr,pr,dr,pr,pr]),qn=ur([pr,pr,pr,dr,pr,pr,pr]),Wn=sr([3,1,3],5),$n=ur([dr,pr,pr,dr]),Kn=sr([1,2,1],5),Zn=ur([dr,pr,pr,pr]),Yn=sr([1,3],3),Jn=ur([pr,pr,pr,dr]),Xn=sr([3,1],3),Qn=ur([br(1.6),Object(b.overEvery)(mr(.9),br(2)),Object(b.overEvery)(mr(.9),br(2))]),er=sr([1,2],3),tr=sr([1,1,1,1,1],1),nr=sr([1,1,1,1],1),rr=sr([1,1,1],3),ar=ur([Object(b.overEvery)(mr(.9),br(2)),Object(b.overEvery)(mr(.9),br(2)),br(1.6)]),or=sr([2,1],3),cr=ur([function(e){return e>=2}]);function ir(e,t,n){var r=Object(b.sum)(Object(b.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&rr(e)&&(r<2.5||r<5&&t.length>=3&&t[0]===t[2]||n)}function lr(e,t){var n=Object(b.sum)(Object(b.take)(t,4));return nr(e)&&n<3.5&&t.length>5||n<7&&4===t.length}function sr(e,t){return function(n){return!Object(b.some)(Object(b.takeRight)(n,t),(function(t){return Object(b.isEqual)(t,e)}))}}function ur(e){return function(t){return t.length>=e.length&&Object(b.every)(Object(b.zipWith)(e,t.slice(0,e.length),(function(e,t){return e(t)})))}}function pr(e){return e>=1&&e<2}function dr(e){return e<1}function mr(e){return function(t){return t>=e}}function br(e){return function(t){return t<e}}var hr=function(e){w()(n,e);var t=x()(n);function n(){var e;v()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return e=t.call.apply(t,[this].concat(a)),u()(y()(e),"gallery",Object(p.createRef)()),u()(y()(e),"pendingRaf",null),e}return k()(n,[{key:"render",value:function(){var e=this.props,t=e.align,n=e.columns,r=e.images,a=e.layoutStyle,o=e.renderedImages,c=e.columnWidths,i=function(e){return Object(b.map)(e,Vn)}(r),l="columns"===a?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];for(var n=Object(b.sum)(e)/t,r=[],a=e,o=0,c=function(e){var t=Object(b.takeWhile)(a,(function(t){var r=o<=(e+1)*n;return r&&(o+=t),r})).length;r.push(t),a=Object(b.drop)(a,t)},i=0;i<t-1;i++)c(i);return r.push(a.length),[r]}(i,n):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isWide;return function e(n,r){if(!r.length)return n;var a;a=r.length>15&&Hn(r)&&Gn(n)?[2,1,2]:r.length>15&&qn(r)&&Wn(n)?[3,1,3]:5!==r.length&&$n(r)&&Kn(n)?[1,2,1]:Zn(r)&&Yn(n)?[1,3]:Jn(r)&&Xn(n)?[3,1]:Qn(r)&&er(n)?[1,2]:t&&(5===r.length||10!==r.length&&r.length>6)&&tr(n)&&Object(b.sum)(Object(b.take)(r,5))<5?[1,1,1,1,1]:lr(n,r)?[1,1,1,1]:ir(n,r,t)?[1,1,1]:ar(r)&&or(n)?[2,1]:cr(r)?[1]:r.length>3?[1,1]:Array(r.length).fill(1);var o=n.concat([a]),c=Object(b.sum)(a);return e(o,r.slice(c))}([],e)}(i,{isWide:["full","wide"].includes(t)}),s=0;return Object(p.createElement)(zn,{galleryRef:this.gallery},l.map((function(e,t){return Object(p.createElement)(Un,{key:t},e.map((function(e,n){var r=o.slice(s,s+e);return s+=e,Object(p.createElement)(Fn,{key:n,width:c?c[t][n]:void 0},r)})))})))}}]),n}(p.Component);function fr(e){var t=e.columns,n=e.renderedImages,r=Math.min(20,t),a=n.length%r;return Object(p.createElement)(zn,null,[].concat(g()(a?[Object(b.take)(n,a)]:[]),g()(Object(b.chunk)(Object(b.drop)(n,a),r))).map((function(e,t){return Object(p.createElement)(Un,{key:t,className:"columns-".concat(e.length)},e.map((function(e,t){return Object(p.createElement)(Fn,{key:t},e)})))})))}function gr(e){return["circle","square"].includes(e)}function jr(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}function vr(e){var t=Object(He.parse)(e).host;return/\.files\.wordpress\.com$/.test(t)}function Or(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object(He.parse)(e),a=(r.auth,r.hash,r.port,r.query,r.search,Ve()(r,["auth","hash","port","query","search"]));return a.query=Object.keys(t).reduce((function(e,r){return Object.assign(e,u()({},n.hasOwnProperty(r)?n[r]:r,t[r]))}),{}),Object(He.format)(a)}var kr=function(e){w()(n,e);var t=x()(n);function n(){return v()(this,n),t.apply(this,arguments)}return k()(n,[{key:"renderImage",value:function(e,t){var n=this.props,r=n.columns,a=n.imageFilter,o=n.images,c=n.isSave,i=n.linkTo,l=n.layoutStyle,s=n.onMoveBackward,u=n.onMoveForward,m=n.onRemoveImage,h=n.onSelectImage,f=n.selectedImage,g=n.setImageAttributes,j=Object(d.sprintf)(Object(d.__)("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.height||!e.url||!e.width)return{};if(Object(B.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};var n,r=e.url.split("?",1)[0],a=e.height,o=e.width,c=t.layoutStyle,i=vr(r)||!0===jr()?Or:Ge.a;if(gr(c)&&o&&a){var l=Math.min(Mn,o,a);n=i(r,{resize:"".concat(l,",").concat(l)})}else n=i(r);var s,u=300,p=600;if(gr(c)){var d=Math.min(p,o,a),m=Math.min(Mn,o,a);s=Object(b.range)(d,m,u).map((function(e){var t=i(r,{resize:"".concat(e,",").concat(e),strip:"info"});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}else{var h=Math.min(p,o),f=Math.min(Mn,o);s=Object(b.range)(h,f,u).map((function(e){var t=i(r,{strip:"info",width:e});return t?"".concat(t," ").concat(e,"w"):null})).filter(Boolean).join(",")}return Object.assign({src:n},s&&{srcSet:s})}(e,{layoutStyle:l}),O=v.src,k=v.srcSet;return Object(p.createElement)(Dn,{alt:e.alt,"aria-label":j,columns:r,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:i,onMoveBackward:c?void 0:s(t),onMoveForward:c?void 0:u(t),onRemove:c?void 0:m(t),onSelect:c?void 0:h(t),origUrl:e.url,setAttributes:c?void 0:g(t),showMovers:o.length>1,srcSet:k,url:O,width:e.width})}},{key:"render",value:function(){var e=this.props,t=e.align,n=e.children,r=e.className,a=e.columns,o=e.images,c=e.layoutStyle,i=e.roundedCorners,l=e.onResize,s=e.isSave,d=e.columnWidths,m=gr(c)?fr:hr,b=this.props.images.map(this.renderImage,this),h=c!==Rn?Math.min(i,20):0;return Object(p.createElement)("div",{className:M()(r,u()({},"has-rounded-corners-".concat(h),h>0))},Object(p.createElement)(m,{align:t,columns:a,columnWidths:s?d:void 0,images:o,layoutStyle:c,renderedImages:b,onResize:s?void 0:l}),n)}}]),n}(p.Component);function _r(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?function(e){return Math.min(3,e.images.length)}(t):c,l=t.linkTo,s=t.roundedCorners,u=t.columnWidths;return Object(p.createElement)(kr,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(Ln,o),linkTo:l,roundedCorners:s,columnWidths:u})}var yr,Er={align:{default:"center",type:"string"},className:{default:"is-style-".concat(Bn),type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},wr={align:["center","wide","full"],customClassName:!1,html:!1},Cr=function(e){var t=Math.pow(10,5);return l()(l()({},e),{},{columnWidths:e.columnWidths.map((function(e){return e.map((function(e){return Math.round(e*t)/t}))}))})},xr=[o,a,r],Sr=n(200),Nr=n.n(Sr),Ar=n(201),Tr=n.n(Ar),Pr=n(202),Ir=n.n(Pr),Mr=n(203),Rr=n.n(Mr),Br=n(204),Lr=n.n(Br),Dr=n(205),Fr=n.n(Dr),zr=(yr={},u()(yr,xe.e,Object(d._x)("Tiled mosaic","Tiled gallery layout","jetpack")),u()(yr,xe.c,Object(d._x)("Circles","Tiled gallery layout","jetpack")),u()(yr,xe.d,Object(d._x)("Tiled columns","Tiled gallery layout","jetpack")),u()(yr,xe.f,Object(d._x)("Square tiles","Tiled gallery layout","jetpack")),yr),Ur=xe.g.map((function(e){return l()(l()({},e),{},{label:zr[e.name]})}));function Vr(e){return Object(b.filter)(e,(function(e){var t=e.id,n=e.url;return t&&n}))}var Gr={align:{default:"center",type:"string"},className:{default:"is-style-".concat(xe.e),type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},Hr={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:Nr.a,width:160,height:95},{alt:"",link:"",url:Tr.a,width:160,height:107},{alt:"",link:"",url:Ir.a,width:304,height:203},{alt:"",link:"",url:Rr.a,width:312,height:207},{alt:"",link:"",url:Lr.a,width:152,height:101},{alt:"",link:"",url:Fr.a,width:152,height:105}],linkTo:"none"},qr="tiled-gallery",Wr=Object(p.createElement)(h.SVG,{viewBox:"0 0 24 24",width:24,height:24},Object(p.createElement)(h.Path,{fill:"currentColor",d:"M19 5v2h-4V5h4M9 5v6H5V5h4m10 8v6h-4v-6h4M9 17v2H5v-2h4M21 3h-8v6h8V3zM11 3H3v10h8V3zm10 8h-8v10h8V11zm-10 4H3v6h8v-6z"})),$r={attributes:Gr,category:Object(ze.a)("media","layout"),description:Object(d.__)("Display multiple images in an elegantly organized tiled layout.","jetpack")+(Object(De.c)()?"":" "+Object(d.__)("Serves images using Jetpack's fast global network of servers.","jetpack")),icon:{src:Wr,foreground:Object(Fe.a)()},keywords:[Object(d._x)("columns","block search term","jetpack"),Object(d._x)("images","block search term","jetpack"),Object(d._x)("photos","block search term","jetpack"),Object(d._x)("pictures","block search term","jetpack"),Object(d._x)("square","block search term","jetpack"),Object(d._x)("circle","block search term","jetpack"),Object(d._x)("mosaic","block search term","jetpack")],styles:Ur,supports:{align:["center","wide","full"],customClassName:!1,html:!1},title:Object(d.__)("Tiled Gallery","jetpack"),transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:function(e){return Vr(e).length>0},transform:function(e){var t=Vr(e);return Object(m.createBlock)("jetpack/".concat(qr),{images:t.map((function(e){return{id:e.id,url:e.url,alt:e.alt}})),ids:t.map((function(e){return e.id}))})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:function(e){var t=Vr(e.images);return t.length>0?Object(m.createBlock)("jetpack/".concat(qr),{images:t.map((function(e){return{id:e.id,url:e.url,alt:e.alt}})),ids:t.map((function(e){return e.id}))}):Object(m.createBlock)("jetpack/".concat(qr))}}],to:[{type:"block",blocks:["core/gallery"],transform:function(e){var t=e.images,n=e.ids,r=e.columns,a=e.linkTo;return Object(m.createBlock)("core/gallery",{images:t,ids:n,columns:r,imageCrop:!0,linkTo:a})}},{type:"block",blocks:["core/image"],transform:function(e){var t=e.align,n=e.images;return n.length>0?n.map((function(e){var n=e.id,r=e.url,a=e.alt;return Object(m.createBlock)("core/image",{align:t,id:n,url:r,alt:a})})):Object(m.createBlock)("core/image")}}]},edit:Le,save:function(e){var t=e.attributes,n=t.imageFilter,r=t.images;if(!r.length)return null;var a=t.align,o=t.className,c=t.columns,i=void 0===c?Me(t):c,l=t.linkTo,s=t.roundedCorners,u=t.columnWidths;return Object(p.createElement)(Ae,{align:a,className:o,columns:i,imageFilter:n,images:r,isSave:!0,layoutStyle:Object(Te.a)(xe.g,o),linkTo:l,roundedCorners:s,columnWidths:u})},deprecated:xr,example:{attributes:Hr}};Object(c.a)(qr,$r)},function(e,t,n){"use strict";n.r(t);n(48),n(165);var r=n(4),a=n.n(r),o=n(26),c=n.n(o),i=n(22),l=n.n(i),s=n(10),u=n(1),p=(n(158),n(39)),d=n(45),m=n(23);function b(){var e=Object(d.a)();return void 0!==typeof window&&window.location&&e?Object(m.c)()||Object(m.a)()?"https://wordpress.com/plans/my-plan/".concat(e):"".concat(window.location.protocol,"//").concat(e.replace("::","/"),"/wp-admin/admin.php?page=jetpack#/my-plan"):null}if(c()(regeneratorRuntime.mark((function e(){var t,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===typeof window||!window.location){e.next=16;break}if(!new URLSearchParams(window.location.search).get("plan_upgraded")){e.next=16;break}if(t=null,e.prev=4,!Object(m.c)()){e.next=7;break}return e.abrupt("break",16);case 7:return e.next=9,l()({path:"/jetpack/v4/site"});case 9:n=e.sent,r=JSON.parse(n.data),t=r.plan.product_name;case 12:return e.prev=12,o=b(),Object(s.dispatch)("core/notices").createNotice("success",t?Object(u.sprintf)(Object(u.__)("Congratulations! Your site is now on the %s plan.","jetpack"),t):Object(u.__)("Congratulations! Your site is now on a paid plan.","jetpack"),a()({isDismissible:!0},o&&{actions:[{url:b(),label:Object(u.__)("View my plan","jetpack")}]})),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[4,,12,16]])})))(),void 0!==typeof window&&window.location){var h=Object(p.parse)(window.location.href,!0).query;h.stripe_connect_success?Object(s.dispatch)("core/notices").createNotice("success",Object(u.__)("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):h.stripe_connect_cancelled&&Object(s.dispatch)("core/notices").createNotice("error",Object(u.__)("You cancelled connecting your site to Stripe.","jetpack"))}var f=n(21),g=n.n(f),j=n(19),v=n.n(j),O=n(0),k=n(31),_=n(6),y=n(61),E=n(9),w=n.n(E),C=n(33),x=n(12),S=n.n(x),N=n(15),A=n.n(N),T=n(7),P=n.n(T),I=n(13),M=n.n(I),R=n(14),B=n.n(R),L=n(5),D=n.n(L),F=n(3),z=n(8),U=n.n(z),V=n(17),G=n(2),H=n(24),q=n(88),W="google_photos",$="pexels",K="recent",Z="/",Y=[{value:K,label:Object(u.__)("Photos","jetpack")},{value:Z,label:Object(u.__)("Albums","jetpack")}],J=[{value:"",label:Object(u.__)("All categories","jetpack")},{value:"animals",label:Object(u.__)("Animals","jetpack")},{value:"arts",label:Object(u.__)("Arts","jetpack")},{value:"birthdays",label:Object(u.__)("Birthdays","jetpack")},{value:"cityscapes",label:Object(u.__)("Cityscapes","jetpack")},{value:"crafts",label:Object(u.__)("Crafts","jetpack")},{value:"fashion",label:Object(u.__)("Fashion","jetpack")},{value:"food",label:Object(u.__)("Food","jetpack")},{value:"flowers",label:Object(u.__)("Flowers","jetpack")},{value:"gardens",label:Object(u.__)("Gardens","jetpack")},{value:"holidays",label:Object(u.__)("Holidays","jetpack")},{value:"houses",label:Object(u.__)("Houses","jetpack")},{value:"landmarks",label:Object(u.__)("Landmarks","jetpack")},{value:"landscapes",label:Object(u.__)("Landscapes","jetpack")},{value:"night",label:Object(u.__)("Night","jetpack")},{value:"people",label:Object(u.__)("People","jetpack")},{value:"pets",label:Object(u.__)("Pets","jetpack")},{value:"selfies",label:Object(u.__)("Selfies","jetpack")},{value:"sport",label:Object(u.__)("Sport","jetpack")},{value:"travel",label:Object(u.__)("Travel","jetpack")},{value:"weddings",label:Object(u.__)("Weddings","jetpack")}],X=["mountain","ocean","river","clouds","pattern","abstract","sky"],Q="ANY",ee="LAST_7_DAYS",te="LAST_30_DAYS",ne="LAST_6_MONTHS",re="LAST_12_MONTHS",ae="CUSTOM",oe=[{value:Q,label:Object(u.__)("Any time","jetpack")},{value:ee,label:Object(u.__)("Last 7 days","jetpack")},{value:te,label:Object(u.__)("Last 30 days","jetpack")},{value:ne,label:Object(u.__)("Last 6 months","jetpack")},{value:re,label:Object(u.__)("Last 12 months","jetpack")},{value:ae,label:Object(u.__)("Specific Month/Year","jetpack")}],ce=(new Date).getFullYear(),ie=[{label:Object(u.__)("Any Month","jetpack"),value:-1}].concat(v()(Object(F.map)(Object(F.range)(0,12),(function(e){return{label:Object(q.dateI18n)("F",new Date(0,e)),value:e}}))));function le(){return Object(V.createHigherOrderComponent)((function(e){var t=function(t){M()(r,t);var n=B()(r);function r(e){var t;return S()(this,r),t=n.call(this,e),D()(P()(t),"contentRef",(function(e){e?(t.contentElement=e,t.modalElement=e.closest(".jetpack-external-media-browser"),t.modalElement&&t.modalElement.addEventListener("keydown",t.stopArrowKeysPropagation)):t.modalElement&&(t.modalElement.removeEventListener("keydown",t.stopArrowKeysPropagation),t.modalElement=null,t.contentElement=null)})),D()(P()(t),"stopArrowKeysPropagation",(function(e){[H.UP,H.DOWN,H.LEFT,H.RIGHT].includes(e.keyCode)&&!e.target.classList.contains("jetpack-external-media-browser__media__item")&&e.stopPropagation()})),D()(P()(t),"setAuthenticated",(function(e){return t.setState({isAuthenticated:e})})),D()(P()(t),"getMedia",(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.state.isLoading||(n&&t.props.noticeOperations.removeAllNotices(),t.setState({account:n?t.defaultAccount:t.state.account,isLoading:!0,media:n?[]:t.state.media,nextHandle:!n&&t.state.nextHandle},(function(){return t.getMediaRequest(e)})))})),D()(P()(t),"handleApiError",(function(e){var n;"authorization_required"!==e.code?(null!==(n=e.errors)&&void 0!==n&&n.length&&(e={code:e.errors[0].error,message:e.errors[0].message}),t.props.noticeOperations.createErrorNotice("internal_server_error"===e.code?"Internal server error":e.message),t.setState({isLoading:!1,isCopying:!1})):t.setState({isAuthenticated:!1,isLoading:!1,isCopying:!1})})),D()(P()(t),"getMediaRequest",(function(e){var n=t.state,r=n.nextHandle,a=n.media;if(!1===r&&a.length>0)t.setState({isLoading:!1});else{var o=t.getRequestUrl(e);t.setAuthenticated(!0),l()({path:o,method:"GET",parse:void 0===window.wpcomFetch}).then((function(e){t.setState({account:e.meta.account,media:t.mergeMedia(a,e.media),nextHandle:e.meta.next_page,isLoading:!1})})).catch(t.handleApiError)}})),D()(P()(t),"copyMedia",(function(e,n,r){var a;t.setState({isCopying:e}),t.props.noticeOperations.removeAllNotices(),t.modalElement&&t.modalElement.focus(),l()({path:n,method:"POST",data:{external_ids:e.map((function(e){return e.guid})),media:e.map((function(e){return{guid:e.guid,caption:e.caption,title:e.title}})),service:r,post_id:null!==(a=t.props.postId)&&void 0!==a?a:0}}).then((function(e){e.media&&(e=e.media.map((function(e){return{alt:e.alt,caption:e.caption,id:e.ID,type:"image",url:e.URL}})));var n=t.props,r=n.value,a=n.addToGallery,o=n.multiple?e:e[0],c=e.find((function(e){return e.errors}));if(c){var i=c.errors,l=Object.keys(i)[0];t.handleApiError({code:l,message:i[l]})}else t.props.onClose(),t.props.onSelect(a?r.concat(e):o)})).catch(t.handleApiError)})),D()(P()(t),"onChangePath",(function(e,n){t.setState({path:e},n)})),t.defaultAccount={image:"",name:""},t.state={account:t.defaultAccount,media:[],nextHandle:!1,isLoading:!1,isCopying:null,isAuthenticated:!0,path:{ID:K}},t}return A()(r,[{key:"mergeMedia",value:function(e,t){return Object(F.uniqBy)(e.concat(t),"ID")}},{key:"getRequestUrl",value:function(e){var t=this.state.nextHandle;return t?e+"&page_handle="+encodeURIComponent(t):e}},{key:"render",value:function(){var t=this.state,n=t.account,r=t.isAuthenticated,a=t.isCopying,o=t.isLoading,c=t.media,i=t.nextHandle,l=t.path,s=this.props,p=s.allowedTypes,d=s.multiple,m=void 0!==d&&d,b=s.noticeUI,h=s.onClose,f=a?Object(u.__)("Inserting media","jetpack"):Object(u.__)("Select media","jetpack"),g=a?Object(u.__)("When the media is finished copying and inserting, you will be returned to the editor.","jetpack"):Object(u.__)("Select the media you would like to insert into the editor.","jetpack"),j="jetpack-external-media-browser__description",v=U()({"jetpack-external-media-browser":!0,"jetpack-external-media-browser--is-copying":a});return Object(O.createElement)(G.Modal,{onRequestClose:h,title:f,aria:{describedby:j},className:v},Object(O.createElement)("div",{ref:this.contentRef},b,Object(O.createElement)("p",{id:j,className:"jetpack-external-media-browser--visually-hidden"},g),Object(O.createElement)(e,{account:n,getMedia:this.getMedia,copyMedia:this.copyMedia,isCopying:a,isLoading:o,media:c,pageHandle:i,allowedTypes:p,isAuthenticated:r,setAuthenticated:this.setAuthenticated,multiple:m,path:l,onChangePath:this.onChangePath})))}}]),r}(O.Component);return Object(s.withSelect)((function(e){return{postId:e("core/editor").getCurrentPostId()}}))(Object(G.withNotices)(t))}))}var se=n(110),ue=function(e,t){var n,r=new se.a;r.open(e,null,"toolbar=0,location=0,status=0,menubar=0,"+r.getScreenCenterSpecs(780,700)),r.once("close",(function(){var e={};n&&n.keyring_id&&(e.keyring_id=Number(n.keyring_id),e.id_token=n.id_token,e.user=n.user),t(e)})),r.on("message",(function(e){return n=e}))},pe=n(27),de={list:"/wpcom/v2/external-media/list/",copy:Object(m.c)()?"/rest/v1.1/external-media-upload?service=":"/wpcom/v2/external-media/copy/",connection:"/wpcom/v2/external-media/connection/"};function me(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de[e]?Object(pe.addQueryArgs)(de[e]+t,n):null}var be=Object(O.memo)((function(){return Object(O.createElement)(O.Fragment,null,Object(O.createElement)(C.e,null),Object(O.createElement)("p",null,Object(u.__)("To show your Google Photos library you need to connect your Google account.","jetpack")),Object(O.createElement)("p",null,Object(u.__)("You can remove the connection in either of these places:","jetpack")),Object(O.createElement)("ul",null,Object(O.createElement)("li",null,Object(O.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://myaccount.google.com/security"},Object(u.__)("Google Security page","jetpack"))),Object(O.createElement)("li",null,Object(O.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://wordpress.com/marketing/connections/"},Object(u.__)("WordPress.com Connections","jetpack")))))}));var he=Object(O.memo)((function(){return Object(O.createElement)("p",null,Object(u.__)("Awaiting authorization","jetpack"))}));var fe=function(e){var t=e.setAuthenticated,n=Object(O.useState)(!1),r=w()(n,2),a=r[0],o=r[1],c=Object(O.useCallback)((function(){o(!0),l()({path:me("connection",W)}).then((function(e){if(e.error)throw e.message;ue(e.connect_URL,(function(){o(!1),t(!0)}))})).catch((function(){o(!1)}))}),[t]);return Object(O.createElement)("div",{className:"jetpack-external-media-auth"},a?Object(O.createElement)(he,null):Object(O.createElement)(be,null),Object(O.createElement)(G.Button,{isPrimary:!0,disabled:a,onClick:c},Object(u.__)("Authorize","jetpack")))};var ge=Object(O.memo)((function(){var e="jetpack-external-media-browser__media__item jetpack-external-media-browser__media__placeholder";return Object(O.createElement)(O.Fragment,null,Object(O.createElement)("div",{className:e}),Object(O.createElement)("div",{className:e}),Object(O.createElement)("div",{className:e}))}));var je=function(e){var t=e.item,n=e.focus,r=e.isSelected,a=e.isCopying,o=void 0!==a&&a,c=t.thumbnails,i=t.caption,l=t.name,s=t.title,p=t.type,d=t.children,m=void 0===d?0:d,b=c.medium,h=void 0===b?null:b,f=c.fmt_hd,g=void 0===f?null:f,j=s||i||l,v=U()({"jetpack-external-media-browser__media__item":!0,"jetpack-external-media-browser__media__item__selected":r,"jetpack-external-media-browser__media__folder":"folder"===p,"is-transient":o}),k=Object(O.useRef)(null);return Object(O.useEffect)((function(){n&&k.current.focus()}),[n]),Object(O.createElement)("li",{ref:k,className:v,onClick:o?void 0:function(t){var n=e.item,r=e.index;e.onClick&&e.onClick(t,{item:n,index:r})},onKeyDown:o?void 0:function(t){var n=e.item,r=e.index;e.onKeyDown&&e.onKeyDown(t,{item:n,index:r})},role:"checkbox",tabIndex:"0","aria-checked":!!r,"aria-disabled":!!o},r&&o&&Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator"},Object(O.createElement)(G.Spinner,null),Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator__label"},Object(u.__)("Inserting Image…","jetpack"))),Object(O.createElement)("img",{src:h||g,alt:j}),"folder"===p&&Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__info"},Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__name"},l),Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__count"},m)))},ve=Object(O.memo)((function(){return Object(O.createElement)("div",{className:"jetpack-external-media-browser__empty"},Object(O.createElement)("p",null,Object(u.__)("Sorry, but nothing matched your search criteria.","jetpack")))}));var Oe=function(e){var t=e.media,n=e.isCopying,r=e.isLoading,a=e.pageHandle,o=e.className,c=e.multiple,i=e.setPath,l=e.nextPage,s=e.onCopy,p=Object(O.useState)([]),d=w()(p,2),m=d[0],b=d[1],h=Object(O.useState)(-1),f=w()(h,2),g=f[0],j=f[1],v=Object(O.useRef)(-1),k=Object(O.useRef)(null),_=Object(O.useCallback)((function(e){var t=[e];"folder"===e.type?i(e.ID):c?(t=m.slice(0,9).concat(e),m.find((function(t){return e.ID===t.ID}))&&(t=m.filter((function(t){return t.ID!==e.ID})))):1===m.length&&e.ID===m[0].ID&&(t=[]),b(t)}),[m,c,i]),y=Object(O.useCallback)((function(){s(m)}),[m,s]),E=t.filter((function(e){return"folder"!==e.type})).length>0,C=U()({"jetpack-external-media-browser__media":!0,"jetpack-external-media-browser__media__loading":r}),x=U()(D()({"jetpack-external-media-browser":!0},o,!0)),S=function(){var e=1,t=k.current.children;if(t.length>0)for(var n=t[0].offsetTop;e<t.length&&t[e].offsetTop===n;)++e;v.current=e},N=Object(F.debounce)(S,400);Object(O.useEffect)((function(){return window.addEventListener("resize",N),function(){window.removeEventListener("resize",N)}}),[]),Object(O.useEffect)((function(){t.length&&-1===v.current&&S()}),[t]);var A=function(e,t){var n=t.item;_(n)},T=function(e,n){var r=n.item,a=n.index;[H.LEFT,H.RIGHT,H.UP,H.DOWN].includes(e.keyCode)?function(e,n){switch(e){case H.LEFT:n>=1&&j(n-1);break;case H.RIGHT:n<t.length&&j(n+1);break;case H.UP:n>=v.current&&j(n-v.current);break;case H.DOWN:n<t.length-v.current&&j(n+v.current)}}(e.keyCode,a):H.SPACE===e.keyCode?(_(r),e.preventDefault()):H.ENTER===e.keyCode&&_(r),[H.LEFT,H.RIGHT,H.UP,H.DOWN,H.SPACE,H.ENTER].includes(e.keyCode)&&e.stopPropagation()};return Object(O.createElement)("div",{className:x},Object(O.createElement)("ul",{ref:k,className:C},t.map((function(e,t){return Object(O.createElement)(je,{item:e,index:t,key:e.ID,onClick:A,onKeyDown:T,focus:t===g,isSelected:m.find((function(t){return t.ID===e.ID})),isCopying:n})})),0===t.length&&!r&&Object(O.createElement)(ve,null),r&&Object(O.createElement)(ge,null),a&&!r&&Object(O.createElement)(G.Button,{isSecondary:!0,className:"jetpack-external-media-browser__loadmore",disabled:r||n,onClick:function(){t.length&&j(t.length),l()}},Object(u.__)("Load More","jetpack"))),E&&Object(O.createElement)((function(){var e=0===m.length||n,t=n?Object(u.__)("Inserting…","jetpack"):Object(u.__)("Select","jetpack");return Object(O.createElement)("div",{className:"jetpack-external-media-browser__media__toolbar"},Object(O.createElement)(G.Button,{isPrimary:!0,isBusy:n,disabled:e,onClick:y},t))}),null))},ke=n(111);function _e(e){var t=e.value,n=e.updateFilter;return Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Category","jetpack"),value:t,options:J,onChange:n})}function ye(e){var t=e.value,n=e.updateFilter,r=(null==t?void 0:t.range)||Q,a=Object(O.useState)(-1),o=w()(a,2),c=o[0],i=o[1],l=Object(O.useState)(ce),s=w()(l,2),p=s[0],d=s[1];return Object(O.createElement)("div",{className:"jetpack-external-media-date-filter"},Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Filter by time period","jetpack"),value:r,options:oe,onChange:function(e){return n({range:e})}}),r===ae&&Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Month","jetpack"),value:c,options:ie,onChange:i}),Object(O.createElement)(ke.a,{className:"components-base-control",label:Object(u.__)("Year","jetpack"),value:p,min:1970,onChange:d}),Object(O.createElement)(G.Button,{isSecondary:!0,disabled:(null==t?void 0:t.month)===c&&(null==t?void 0:t.year)===p,onClick:function(){n({range:r,month:c,year:p})}},Object(u.__)("Apply","jetpack"))))}function Ee(){return Object(O.createElement)("span",null,Object(u.__)("Favorites","jetpack"))}function we(e){var t=e.value,n=e.updateFilter,r=[{label:Object(u.__)("All","jetpack"),value:""},{label:Object(u.__)("Images","jetpack"),value:"photo"},{label:Object(u.__)("Videos","jetpack"),value:"video"}];return Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Type","jetpack"),value:t,options:r,onChange:n})}function Ce(e){var t=e.children,n=e.removeFilter,r=e.isRemovable,a=void 0!==r&&r;return Object(O.createElement)("div",{className:"jetpack-external-media-googlephotos-filter"},t,!!a&&Object(O.createElement)(G.Button,{onClick:n,isSmall:!0},Object(u.__)("Remove Filter","jetpack")))}var xe=function(e){var t=e.filters,n=e.setFilters,r=e.canChangeMedia,o=Object.keys(t).filter((function(e){return r||"mediaType"!==e})).map((function(e){return Object(O.createElement)(Ce,{key:e,removeFilter:function(){return n(Object(F.omit)(t,e))}},(r=e,o=t[e],c=function(r){return n(function(e,t,n){var r=a()(a()({},e),{},D()({},t,n));return"mediaType"===t&&"video"===n?delete r.category:"category"===t&&"video"===r.mediaType&&delete r.mediaType,r}(t,e,r))},"category"===r?Object(O.createElement)(_e,{value:o,updateFilter:c}):"date"===r?Object(O.createElement)(ye,{value:o,updateFilter:c}):"favorite"===r?Object(O.createElement)(Ee,{value:o}):"mediaType"===r?Object(O.createElement)(we,{value:o,updateFilter:c}):null));var r,o,c}));return 0===o.length?null:o},Se=[{label:Object(u.__)("Category","jetpack"),value:"category"},{label:Object(u.__)("Date","jetpack"),value:"date"},{label:Object(u.__)("Favorites","jetpack"),value:"favorite"},{label:Object(u.__)("Media Type","jetpack"),value:"mediaType"}];function Ne(e){return Se.filter((function(t){return void 0===e[t.value]}))}function Ae(e){var t=Ne(e);return t.length>0?t[0].value:""}var Te=function(e){var t=Object(O.useState)(Ae([])),n=w()(t,2),r=n[0],o=n[1],c=e.isLoading,i=e.isCopying,l=e.filters,s=e.canChangeMedia,p=function(e,t){return t?e:e.filter((function(e){return"mediaType"!==e.value}))}(Ne(l),s);return 0===p.length?null:Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.SelectControl,{label:Object(u.__)("Filters","jetpack"),value:r,disabled:c||i,options:p,onChange:o}),Object(O.createElement)(G.Button,{disabled:c||i,isSecondary:!0,isSmall:!0,onClick:function(){var t,n,c=(t=l,n=r,a()(a()({},t),{},D()({},n,"favorite"===n||"")));e.setFilters(c),o(Ae(c))}},Object(u.__)("Add Filter","jetpack")))},Pe=function(e){var t=e.setAuthenticated,n=Object(O.useState)(!1),r=w()(n,2),a=r[0],o=r[1],c=Object(O.useCallback)((function(){o(!0),l()({method:"DELETE",path:me("connection",W)}).then((function(){return t(!1)})).catch((function(){return o(!1)}))}),[t]);return Object(O.createElement)(G.Button,{isSecondary:!0,className:"jetpack-external-media-browser__disconnect",onClick:c,disabled:a,isBusy:a},Object(u.__)("Disconnect from Google Photos","jetpack"))},Ie=function(e){var t=e.account,n=e.setAuthenticated,r=t||{},a=r.image,o=r.name;return Object(O.createElement)("div",{className:"jetpack-external-media-header__account"},Object(O.createElement)("div",{className:"jetpack-external-media-header__account-info"},a&&Object(O.createElement)("img",{className:"jetpack-external-media-header__account-image",src:a,alt:"",height:"18",width:"18"}),o&&Object(O.createElement)("div",{className:"jetpack-external-media-header__account-name"},o)),Object(O.createElement)(Pe,{setAuthenticated:n}))};var Me=Object(O.memo)((function(e){var t=e.path,n=e.setPath;return Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.Button,{isTertiary:!0,onClick:function(){return n(Z)}},Object(u.__)("Albums","jetpack")),"→ ",t.name)})),Re=n(54),Be=n.n(Re),Le=Be()();var De=function(e){var t,n=e.account,r=e.allowedTypes,a=e.copyMedia,o=e.getMedia,c=e.isCopying,i=e.isLoading,l=e.media,s=e.multiple,p=e.onChangePath,d=e.pageHandle,m=e.path,b=e.setAuthenticated,h=e.showAdditionalFilters,f=void 0!==h&&h,g=(t=r)&&1===t.length&&"image"===t[0],j=Object(O.useState)(g?{mediaType:"photo",date:{range:Q}}:{date:{range:Q}}),v=w()(j,2),k=v[0],_=v[1],y=Object(O.useRef)(""),E=Object(O.useRef)(""),C=m.ID===K?function(e){var t=e.mediaType,n=e.category,r=e.favorite,a=e.date,o=[];if(t&&o.push("mediaType="+t),n&&"video"!==t&&o.push("categoryInclude="+n),void 0!==r&&o.push("feature=favorite"),a){var c=null,i=null;switch(a.range){case ee:c=Be()(Le).subtract(7,"days"),i=Le;break;case te:c=Be()(Le).subtract(30,"days"),i=Le;break;case ne:c=Be()(Le).subtract(6,"months"),i=Le;break;case re:c=Be()(Le).subtract(1,"year"),i=Le;break;case ae:var l=parseInt(a.month),s=parseInt(a.year);isNaN(l)||isNaN(s)||(-1===l?(c=Be()([s,0]),i=Be()(c).endOf("year")):(c=Be()([s,l]),i=Be()(c).endOf("month")))}var u=c?c.format("YYYY-MM-DD"):"0000-00-00",p=i?i.format("YYYY-MM-DD"):"0000-00-00";o.push("dateRange=".concat(u,":").concat(p))}return o.length>0?o:null}(k):null,x={number:20,path:m.ID};C&&(x.filter=C);var S=me("list",W,x),N=Object(O.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o(S,t)}),[o,S]),A=Object(O.useCallback)((function(e){var t=l.find((function(t){return t.ID===e}));E.current=m,p(t||{ID:e})}),[l,p,E,m]),T=Object(O.useCallback)((function(e){a(e,me("copy",W),W)}),[a]);return Object(O.useEffect)((function(){y!==S&&(y.current=S,N({},m!==E.current))}),[y,S,N,m]),Object(O.createElement)("div",{className:"jetpack-external-media-wrapper__google"},Object(O.createElement)("div",{className:"jetpack-external-media-header__view"},Object(O.createElement)(G.SelectControl,{className:"jetpack-external-media-header__select",label:Object(u.__)("View","jetpack"),value:m.ID!==K?Z:K,disabled:i||c,options:Y,onChange:A}),f&&m.ID===K&&Object(O.createElement)(Te,{filters:k,isLoading:i,setFilters:_,canChangeMedia:!g}),Object(O.createElement)("div",{className:"jetpack-external-media-header__filter"},m.ID===K&&Object(O.createElement)(xe,{filters:k,isLoading:i,setFilters:_,canChangeMedia:!g}),m.ID!==K&&m.ID!==Z&&Object(O.createElement)(Me,{path:m,setPath:A})),(!i||l.length>0)&&Object(O.createElement)(Ie,{account:n,setAuthenticated:b})),Object(O.createElement)(Oe,{className:"jetpack-external-media-browser__google",key:S,media:l,isCopying:c,isLoading:i,nextPage:N,onCopy:T,pageHandle:d,multiple:s,setPath:A}))};var Fe=le()((function(e){return e.isAuthenticated?Object(O.createElement)(De,e):Object(O.createElement)(fe,e)}));var ze=le()((function(e){var t=e.media,n=e.isCopying,r=e.isLoading,a=e.pageHandle,o=e.multiple,c=e.copyMedia,i=e.getMedia,l=Object(O.useState)(Object(F.sample)(X)),s=w()(l,2),p=s[0],d=s[1],m=Object(O.useState)(""),b=w()(m,2),h=b[0],f=b[1],g=Object(O.useCallback)((function(e){c(e,me("copy",$),$)}),[c]),j=Object(O.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p&&i(me("list",$,{number:20,path:"recent",search:p}),t)}),[i,p]),v=Object(O.useRef)(),k=Object(O.useCallback)((function(e){e.preventDefault(),f(p),j(e,!0),v.current=p}),[j,p]);Object(O.useEffect)(j,[j]);var _=Object(O.useRef)(null);return Object(O.useEffect)((function(){if(_.current){var e=Array.from(_.current.elements).find((function(e){return"search"===e.type}));e&&(e.focus(),e.select())}}),[]),Object(O.createElement)("div",{className:"jetpack-external-media-wrapper__pexels"},Object(O.createElement)("form",{ref:_,className:"jetpack-external-media-header__pexels",onSubmit:k},Object(O.createElement)(G.TextControl,{"aria-label":Object(u.__)("Search","jetpack"),type:"search",value:p,onChange:d,disabled:!!n}),Object(O.createElement)(G.Button,{isPrimary:!0,onClick:k,type:"submit",disabled:!p.length||p===v.current||n},Object(u.__)("Search","jetpack"))),Object(O.createElement)(Oe,{key:h,className:"jetpack-external-media-browser__pexels",media:t,isCopying:n,isLoading:r,nextPage:j,onCopy:g,pageHandle:a,multiple:o}))})),Ue=[{id:W,label:Object(u.__)("Google Photos","jetpack"),icon:Object(O.createElement)(C.d,{className:"components-menu-items__item-icon"}),keyword:"google photos"},{id:$,label:Object(u.__)("Pexels Free Photos","jetpack"),icon:Object(O.createElement)(C.h,{className:"components-menu-items__item-icon"}),keyword:"pexels"}];var Ve=n(59),Ge=Object(O.createElement)(Ve.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(O.createElement)(Ve.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var He=function(e){var t=e.originalButton,n=void 0===t?null:t,r=e.onClick,a=void 0===r?function(){}:r,o=e.open,c=e.setSource;return Object(O.createElement)(O.Fragment,null,n&&n({open:o}),Ue.map((function(e){var t=e.icon,n=e.id,r=e.label;return Object(O.createElement)(G.MenuItem,{icon:t,key:n,onClick:function(){a(),c(n)}},r)})))};var qe=function(e){var t=e.mediaProps,n=e.open,r=e.setSelectedSource,a=e.isFeatured,o=e.isReplace,c=e.hasImage,i=t.render,l=a,s=!1,p=!a;if(o)return Object(O.createElement)(He,{originalButton:i,open:n,setSource:r});var d=Object(u.__)("Select Image","jetpack");return t.multiple&&(d=Object(u.__)("Select Images","jetpack")),t.allowedTypes.length>1&&(d=Object(u.__)("Select Media","jetpack")),a&&(d=Object(u.__)("Replace Image","jetpack"),l=!1,p=!1,s=!0),Object(O.createElement)(O.Fragment,null,Object(O.createElement)(G.Dropdown,{position:"bottom right",contentClassName:"jetpack-external-media-button-menu__options",renderToggle:function(e){var t=e.isOpen,n=e.onToggle,r=i&&i({open:n});return a&&c||r&&"string"!=typeof r.props.children?r:Object(O.createElement)(G.Button,{isPrimary:l,isSecondary:s,isTertiary:p,className:"jetpack-external-media-button-menu","aria-haspopup":"true","aria-expanded":t,onClick:n},d)},renderContent:function(e){var t=e.onClose;return Object(O.createElement)(G.NavigableMenu,{"aria-label":d},Object(O.createElement)(G.MenuGroup,null,Object(O.createElement)(G.MenuItem,{icon:Ge,onClick:function(){t(),n()}},Object(u.__)("Media Library","jetpack")),Object(O.createElement)(He,{open:n,setSource:r,onClick:t})))}}))},We=function(e){return e.unstableFeaturedImageFlow||e.modalClass&&-1!==e.modalClass.indexOf("featured-image")},$e=function(e){return void 0===e.multiple&&!We(e)};var Ke=function(e){var t,n=e.mediaProps,r=Object(O.useState)(null),a=w()(r,2),o=a[0],c=a[1],i=(t=o)===$?ze:t===W?Fe:null;return Object(O.createElement)("div",{onClick:function(e){return e.stopPropagation()}},Object(O.createElement)(qe,g()({},e,{setSelectedSource:c,isReplace:$e(n),isFeatured:We(n),hasImage:n.value>0})),i&&Object(O.createElement)(i,g()({onClose:function(e){e&&(e.stopPropagation(),e.target.closest(".jetpack-external-media-header__dropdown"))||c(null)}},n)))};n(256);if(Object(y.a)()&&"function"==typeof _.useBlockEditContext){Object(k.addFilter)("editor.MediaUpload","external-media/replace-media-upload",(function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=t.render;if(function(e,t){return["core/cover","core/image","core/gallery","core/media-text","jetpack/image-compare","jetpack/slideshow","jetpack/story","jetpack/tiled-gallery"].indexOf(e)>-1&&-1===t.toString().indexOf("coblocks")}(n,r)||function(e){return e.unstableFeaturedImageFlow||e.modalClass&&e.modalClass.indexOf("featured-image")>-1}(t)){var a=t.allowedTypes,o=t.gallery,c=void 0!==o&&o,i=t.value,l=void 0===i?[]:i;a.indexOf("image")>-1&&!(c&&l.length>0)&&(r=function(e){return Object(O.createElement)(Ke,g()({},e,{mediaProps:t}))})}return Object(O.createElement)(e,g()({},t,{render:r}))}}),100),Object(k.addFilter)("blocks.registerBlockType","external-media/individual-blocks",(function(e,t){return"core/image"!==t?e:a()(a()({},e),{},{keywords:[].concat(v()(e.keywords),v()(Ue.map((function(e){return e.keyword}))))})}))}var Ze=n(16),Ye={name:"facebook",title:"Facebook",icon:{src:"facebook",foreground:Object(Ze.a)()},keywords:[Object(u._x)("social","block search term","jetpack")],description:Object(u.__)("Embed a Facebook post.","jetpack"),patterns:[/^https?:\/\/www\.facebook.com\/.+/i],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}};Object(k.addFilter)("blocks.registerBlockType","reactivateFacebookEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations)return e;var n=e.variations.filter((function(e){return e.name!==Ye.name}));return e.variations=[].concat(v()(n),[Ye]),e}));var Je=n(46);var Xe={name:"instagram",title:"Instagram",icon:{src:"instagram",foreground:Object(Ze.a)()},keywords:[Object(u._x)("image","block search term","jetpack"),Object(u._x)("social","block search term","jetpack")],description:Object(u.__)("Embed an Instagram post.","jetpack"),patterns:[/^https?:\/\/(www\.)?instagr(\.am|am\.com)\/.+/i],attributes:{providerNameSlug:"instagram",responsive:!0}};Object(k.addFilter)("blocks.registerBlockType","reactivateInstagramEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations||!Object(F.get)(Object(Je.a)(),["jetpack","is_active"],!1))return e;var n=e.variations.filter((function(e){return e.name!==Xe.name}));return e.variations=[].concat(v()(n),[Xe]),e}));var Qe=n(11),et={name:"loom",title:"Loom",icon:C.g,keywords:[Object(u.__)("video","jetpack")],description:Object(u.__)("Embed a Loom video.","jetpack"),patterns:[/^https?:\/\/(www\.)?loom\.com\/share\/.+/i],attributes:{providerNameSlug:"loom",responsive:!0}};Object(Qe.registerBlockVariation)("core/embed",et);var tt=n(57),nt=n.n(tt),rt=n(41),at=n(122),ot=(n(258),function(e){var t=e.align,n=e.className,r=e.title,a=e.description,o=e.buttonText,c=e.visible,i=void 0===c||c,l=e.context,s=e.checkoutUrl,p=e.goToCheckoutPage,d=e.isRedirecting,m=void 0!==d&&d,b=U()(n,"jetpack-upgrade-plan-banner",{"wp-block":"editor-canvas"===l,"block-editor-block-list__block":"editor-canvas"===l,"jetpack-upgrade-plan__hidden":!i}),h=Object(u.__)("Redirecting…","jetpack");return Object(O.createElement)("div",{className:b,"data-align":t},Object(O.createElement)("div",{className:"jetpack-upgrade-plan-banner__wrapper"},r&&Object(O.createElement)("strong",{className:U()("banner-title",D()({},"".concat(n,"__title"),n))},r),a&&Object(O.createElement)("span",{className:"".concat(n,"__description banner-description")},a),Object(O.createElement)(G.Button,{href:m?null:s,onClick:p,target:"_top",className:U()("is-primary",{"jetpack-upgrade-plan__hidden":!s}),isBusy:m},m?h:o)))}),ct=Object(u.__)("Premium Block","jetpack"),it=Object(u.__)("Upgrade your plan to use this premium block","jetpack"),lt=Object(u.__)("Upgrade","jetpack"),st=function(e){var t=e.onRedirect,n=e.align,r=e.className,a=e.title,o=void 0===a?ct:a,c=e.description,i=void 0===c?it:c,l=e.buttonText,s=void 0===l?lt:l,u=e.visible,p=void 0===u||u,d=e.requiredPlan,m=e.context,b=Object(at.a)(d,t),h=w()(b,3),f=h[0],g=h[1],j=h[2];return Object(O.createElement)(ot,{align:n,buttonText:s,checkoutUrl:f,className:r,context:m,description:i,goToCheckoutPage:g,isRedirecting:j,title:o,visible:p})},ut=Object(O.createContext)(),pt=function(e){var t=e.onBannerVisibilityChange,n=e.onChildBannerVisibilityChange,r=e.hasParentBanner,a=e.children;return Object(O.createElement)(ut.Provider,{value:{onBannerVisibilityChange:t,onChildBannerVisibilityChange:n,hasParentBanner:r},children:a})},dt=n(62),mt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n,r=t||{},a=r.name,o=r.className,c=r.clientId,i=r.isSelected,l=r.attributes,u=r.setAttributes,p=Object(O.useContext)(ut)||{},d=p.onChildBannerVisibilityChange,m=p.hasParentBanner,b=Object(rt.a)(a);if(!b)return Object(O.createElement)(e,t);var h=Object(rt.d)(a),f=Object(rt.c)(a),j=Object(O.useState)(!h),v=w()(j,2),k=v[0],_=v[1],y=Object(O.useState)(!1),E=w()(y,2),C=E[0],x=E[1],S=Object(O.useState)(!1),N=w()(S,2),A=N[0],T=N[1],P="editor-canvas",I=Object(s.useSelect)((function(e){return e("core/block-editor").hasSelectedInnerBlock(c,!0)}),[]),M=(i||I)&&k&&!A,R=Object(O.useMemo)((function(){return{plan:b,blockName:a,context:P}}),[b,a,P]);Object(O.useEffect)((function(){M&&x(!0)}),[M,x]),Object(O.useEffect)((function(){!C&&M&&function(e){var t=e.plan,n=e.blockName,r=e.context;dt.a.tracks.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:t,block:n,context:r})}(R)}),[C,R,M]),Object(O.useEffect)((function(){return _(!h)}),[l,_,h]),Object(O.useEffect)((function(){u({shouldDisplayFrontendBanner:!m})}),[u,m]),Object(O.useEffect)((function(){d&&d(M||A)}),[M,A,d]);var B=U()(o,{"is-upgradable":M});return Object(O.createElement)(pt,{onBannerVisibilityChange:_,onChildBannerVisibilityChange:T,hasParentBanner:!0},Object(O.createElement)(st,{className:"is-".concat(t.name.replace(/\//,"-"),"-paid-block"),title:null,align:null==t||null===(n=t.attributes)||void 0===n?void 0:n.align,visible:M,description:null==f?void 0:f.description,requiredPlan:b,context:P,onRedirect:function(){return function(e){var t=e.plan,n=e.blockName,r=e.context;dt.a.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:t,block:n,context:r})}(R)}}),Object(O.createElement)(e,g()({},t,{className:B})))}}),"withUpgradeBanner"),bt=n(121);n(259);function ht(){return Object(F.get)(Object(Je.a)(),["allowedMimeTypes"],[])}function ft(e,t){if(!e||!t)return!1;if(!ht())return!1;var n,r,a=(n=t)?Object(F.pickBy)(ht(),(function(e){return Object(F.startsWith)(e,"".concat(n,"/"))})):{},o=(r=a)?Object(F.flatten)(Object(F.map)(Object(F.keys)(r),(function(e){return e.split("|")}))):[];if("string"==typeof e){var c=e.split(".").pop();return c&&o.includes(c)}return"object"==typeof e&&(e.type&&Object(F.values)(a).includes(e.type))}var gt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=Object(rt.c)(n);if(null==r||!r.mediaPlaceholder||!Object(rt.e)(n))return Object(O.createElement)(e,t);var a=r.fileType,o=t.onError,c=Object(O.useContext)(ut).onBannerVisibilityChange,i=Object(O.useCallback)((function(e){return c((null==e?void 0:e.length)&&ft(e[0],a))}),[a,c]),l=Object(O.useCallback)((function(e){var t,n,r=null==e||null===(t=e[0])||void 0===t||null===(n=t.props)||void 0===n?void 0:n.children;return ft(r,a)?i([r]):o(e)}),[i,a,o]);return Object(O.createElement)("div",{className:"paid-block-media-placeholder"},Object(O.createElement)(e,g()({},t,{onFilesPreUpload:i,onError:l})))}}),"withMediaPlaceholderUpgradable"),jt=Object(V.createHigherOrderComponent)((function(e){return function(t){var n=Object(_.useBlockEditContext)().name,r=Object(rt.c)(n),a=Object(O.useRef)();if(null==r||!r.mediaReplaceFlow||!Object(rt.e)(n))return Object(O.createElement)(e,t);var o=r.fileType,c=Object(O.useContext)(ut).onBannerVisibilityChange;return Object(O.createElement)(e,g()({},t,{onFilesUpload:function(e){a.current=null!=e&&e.length?e[0]:null,c((null==e?void 0:e.length)&&ft(e[0],o))},createNotice:function(e,n,r){if(ft(a.current,o))return a.current=null,null;t.createNotice(e,n,r)}}))}}),"withMediaReplaceFlowUpgradable"),vt=[];Object(k.addFilter)("blocks.registerBlockType","jetpack/paid-block",(function(e,t){return Object(rt.e)(t)&&(vt.includes(t)||vt.push(t),e.keywords=Object(F.uniq)([].concat(v()(e.keywords),["premium",Object(u.__)("premium","jetpack")])),Object(rt.d)(t)||(e.icon=Object(bt.a)(e.icon)),e.attributes.shouldDisplayFrontendBanner||(e.attributes.shouldDisplayFrontendBanner={type:"boolean",default:!0})),e})),Object(k.addFilter)("editor.BlockListBlock","jetpack/paid-block-with-warning",mt),Object(k.addFilter)("editor.MediaPlaceholder","jetpack/paid-block-media-placeholder",gt),Object(k.addFilter)("editor.MediaReplaceFlow","jetpack/paid-block-media-placeholder",jt),nt()((function(){Object(rt.f)()&&document.body.classList.add("jetpack-enable-upgrade-nudge")}));n(260),n(261),n(241);if("object"==typeof window&&"object"==typeof window.Jetpack_Editor_Initial_State&&"object"==typeof window.Jetpack_Editor_Initial_State.tracksUserData&&void 0!==window.Jetpack_Editor_Initial_State.wpcomBlogId){var Ot=window.Jetpack_Editor_Initial_State.tracksUserData,kt=Ot.userid,_t=Ot.username;dt.a.initialize(kt,_t,{blog_id:window.Jetpack_Editor_Initial_State.wpcomBlogId})}},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(4),o=n.n(a),c=n(0),i=n(1),l=n(11),s=n(2),u=n(6),p=(n(269),n(9)),d=n.n(p),m=n(3),b=n(8),h=n.n(b),f=n(68),g=n.n(f),j=n(17),v=n(10),O=n(24),k=n(50),_=n(23),y=n(25),E=n(16),w=Object(m.compact)([{name:"contact-form",title:Object(i.__)("Contact Form","jetpack"),description:Object(i.__)("Add a contact form to your page.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M21.99 8c0-.72-.37-1.35-.94-1.7l-8.04-4.71c-.62-.37-1.4-.37-2.02 0L2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zm-11.05 4.34l-7.2-4.5 7.25-4.25c.62-.37 1.4-.37 2.02 0l7.25 4.25-7.2 4.5c-.65.4-1.47.4-2.12 0z"}),48,48,"-4 -4 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-textarea",{}],["jetpack/button",{text:Object(i.__)("Contact Us","jetpack"),element:"button"}]]},!Object(_.c)()&&{name:"newsletter-form",title:Object(i.__)("Newsletter Sign-up","jetpack"),description:Object(i.__)("A simple way to collect information from folks visiting your site.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M37.9999 7.59998C49.3999 7.59998 68.3999 26.6 68.3999 26.6V68.4H7.59985V26.6C7.59985 26.6 26.5999 7.59998 37.9999 7.59998ZM64.5999 63.536L50.4259 52.44L64.5999 41.8L62.9659 40.394L54.3779 45.334L55.2899 28.956L21.9639 26.98L20.2159 44.232L12.6539 40.622L11.3999 41.8L25.5739 52.44L12.5019 63.27L14.0219 64.904L37.9999 49.4L62.8139 65.17L64.5999 63.536Z"}),48,48,"-6 -6 92 92"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-consent",{}],["jetpack/button",{text:Object(i.__)("Subscribe","jetpack"),element:"button"}]]},{name:"rsvp-form",title:Object(i.__)("RSVP Form","jetpack"),description:Object(i.__)("Add an RSVP form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M10 9V7.41c0-.89-1.08-1.34-1.71-.71L3.7 11.29c-.39.39-.39 1.02 0 1.41l4.59 4.59c.63.63 1.71.19 1.71-.7V14.9c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:Object(i.__)("Attending?","jetpack"),required:!0,options:[Object(i.__)("Yes","jetpack"),Object(i.__)("No","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Other Details","jetpack")}],["jetpack/button",{text:Object(i.__)("Send RSVP","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new RSVP from your website","jetpack")}},{name:"registration-form",title:Object(i.__)("Registration Form","jetpack"),description:Object(i.__)("Add a Registration form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M11.34 15.02c.39.39 1.02.39 1.41 0l6.36-6.36c.39-.39.39-1.02 0-1.41L14.16 2.3c-.38-.4-1.01-.4-1.4-.01L6.39 8.66c-.39.39-.39 1.02 0 1.41l4.95 4.95zm2.12-10.61L17 7.95l-4.95 4.95-3.54-3.54 4.95-4.95zm6.95 11l-2.12-2.12c-.18-.18-.44-.29-.7-.29h-.27l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2h-.42c-.27 0-.52.11-.71.29l-2.12 2.12c-.37.38-.58.89-.58 1.42V20c0 1.1.9 2 2 2h14c1.1 0 2-.89 2-2v-3.17c0-.53-.21-1.04-.59-1.42z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{label:Object(i.__)("Phone Number","jetpack")}],["jetpack/field-select",{label:Object(i.__)("How did you hear about us?","jetpack"),options:[Object(i.__)("Search Engine","jetpack"),Object(i.__)("Social Media","jetpack"),Object(i.__)("TV","jetpack"),Object(i.__)("Radio","jetpack"),Object(i.__)("Friend or Family","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Other Details","jetpack")}],["jetpack/button",{text:Object(i.__)("Send","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new registration from your website","jetpack")}},{name:"appointment-form",title:Object(i.__)("Appointment Form","jetpack"),description:Object(i.__)("Add an Appointment booking form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V8c0-.55-.45-1-1-1s-1 .45-1 1v2H2c-.55 0-1 .45-1 1s.45 1 1 1h2v2c0 .55.45 1 1 1s1-.45 1-1v-2h2c.55 0 1-.45 1-1s-.45-1-1-1H6zm9 4c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{required:!0}],["jetpack/field-date",{label:Object(i.__)("Date","jetpack"),required:!0}],["jetpack/field-radio",{label:Object(i.__)("Time","jetpack"),required:!0,options:[Object(i.__)("Morning","jetpack"),Object(i.__)("Afternoon","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("Notes","jetpack")}],["jetpack/button",{text:Object(i.__)("Book Appointment","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("A new appointment booked from your website","jetpack")}},{name:"feedback-form",title:Object(i.__)("Feedback Form","jetpack"),description:Object(i.__)("Add a Feedback form to your page","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.03 0 3.8-1.11 4.75-2.75.19-.33-.05-.75-.44-.75H7.69c-.38 0-.63.42-.44.75.95 1.64 2.72 2.75 4.75 2.75z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:Object(i.__)("Please rate our website","jetpack"),required:!0,options:[Object(i.__)("1 - Very Bad","jetpack"),Object(i.__)("2 - Poor","jetpack"),Object(i.__)("3 - Average","jetpack"),Object(i.__)("4 - Good","jetpack"),Object(i.__)("5 - Excellent","jetpack")]}],["jetpack/field-textarea",{label:Object(i.__)("How could we improve?","jetpack")}],["jetpack/button",{text:Object(i.__)("Send Feedback","jetpack"),element:"button"}]],attributes:{subject:Object(i.__)("New feedback received from your website","jetpack")}}]),C=n(22),x=n.n(C),S=n(94),N=n.n(S),A=function(e){var t=e.error;return Object(c.createElement)(s.Notice,{isDismissible:!1,status:"error"},Object(c.createInterpolateElement)(Object(i.__)('The CRM Jetpack Form extension failed to activate. The error message was "<error />".',"jetpack"),{error:Object(c.createElement)("span",null,t)}))},T=function(e){var t=e.isActivatingExt,n=e.setIsActivatingExt,r=e.extActivationError,a=function(e,t,n,r){return function(){t(void 0),e(!0),x()({path:"/jetpack/v4/jetpack_crm",method:"POST",data:{extension:"jetpackforms"}}).then((function(e){if("success"!==e.code)throw new Error(e.code);var t=Object.assign({},n);t.jp_form_ext_enabled=!0,r(t)})).catch((function(e){t(e.message)})).finally((function(){e(!1)}))}}(n,e.setExtActivationError,e.crmData,e.setCRMData);return t?Object(c.createElement)(s.Spinner,null):r?Object(c.createElement)(A,{error:r}):Object(c.createElement)(s.Button,{isSecondary:!0,onClick:a},Object(i.__)("Enable Jetpack Forms Extension","jetpack"))},P=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("A site administrator must enable the CRM Jetpack Forms extension.","jetpack"))},I=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("You can integrate this contact form with Jetpack CRM by enabling Jetpack CRM's Jetpack Forms extension.","jetpack"))},M=function(e){var t=e.isActivatingExt,n=e.setIsActivatingExt,r=e.extActivationError,a=e.setExtActivationError,o=e.crmData,i=e.setCRMData;return o.can_activate_extension?Object(c.createElement)("div",null,Object(c.createElement)(I,null),Object(c.createElement)("br",null),Object(c.createElement)(T,{isActivatingExt:t,setIsActivatingExt:n,extActivationError:r,setExtActivationError:a,crmData:o,setCRMData:i})):Object(c.createElement)(P,null)},R=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),B=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("The Jetpack CRM is installed but has an invalid version.","jetpack"))},L=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("The Zero BS CRM plugin is now Jetpack CRM. Update to the latest version to integrate your contact form with your CRM.","jetpack"))},D=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(c.createInterpolateElement)(Object(i.__)("You can save contacts from Jetpack contact forms in Jetpack CRM. Learn more at <a>jetpackcrm.com</a>","jetpack"),{a:Object(c.createElement)(s.ExternalLink,{href:"https://jetpackcrm.com"})}))},F=function(){return Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("You already have the Jetpack CRM plugin installed, but it's not activated. Activate the Jetpack CRM plugin to save contacts from this contact form in your Jetpack CRM.","jetpack"))},z=function(e){var t=e.crmData,n=e.setCRMData,r=e.jetpackCRM,a=e.setAttributes,o=Object(c.useState)(!1),l=d()(o,2),u=l[0],p=l[1],m=Object(c.useState)(!1),b=d()(m,2),h=b[0],f=b[1];return t.jp_form_ext_enabled?N.a.satisfies(N.a.coerce(t.crm_version),"3.0.19 - 4.0.0")?Object(c.createElement)("p",{className:"jetpack-contact-form__crm_text"},Object(i.__)("Contacts from this form will be stored in Jetpack CRM.","jetpack")):Object(c.createElement)(s.ToggleControl,{className:"jetpack-contact-form__crm_toggle",label:Object(i.__)("Jetpack CRM","jetpack"),checked:r,onChange:function(e){return a({jetpackCRM:e})},help:Object(i.__)("Store contact form submissions in your CRM.","jetpack")}):Object(c.createElement)(M,{isActivatingExt:u,setIsActivatingExt:p,extActivationError:h,setExtActivationError:f,crmData:t,setCRMData:n})},U=function(e){var t=e.crmData,n=e.setCRMData,r=e.jetpackCRM,a=e.setAttributes,o=N.a.coerce(t.crm_version);if(t.crm_installed&&!o)return Object(c.createElement)(B,null);if(t.crm_installed&&N.a.lt(o,"3.0.19"))return Object(c.createElement)(L,null);var i=R.NOT_INSTALLED;return t.crm_active?i=R.ACTIVE:t.crm_installed&&(i=R.INSTALLED),Object(c.createElement)("div",{"aria-live":"polite"},R.ACTIVE===i&&Object(c.createElement)(z,{crmData:t,setCRMData:n,jetpackCRM:r,setAttributes:a}),R.INSTALLED===i&&Object(c.createElement)(F,null),R.NOT_INSTALLED===i&&Object(c.createElement)(D,null))},V=function(e){var t=e.isFetchingCRMData,n=e.hasCRMDataError,r=e.crmData,a=e.setCRMData,o=e.jetpackCRM,i=e.setAttributes;return t?Object(c.createElement)(s.Spinner,null):n?null:Object(c.createElement)(U,{crmData:r,setCRMData:a,jetpackCRM:o,setAttributes:i})},G=function(e){var t=e.jetpackCRM,n=e.setAttributes,r=Object(c.useState)(!0),a=d()(r,2),o=a[0],l=a[1],u=Object(c.useState)(!1),p=d()(u,2),m=p[0],b=p[1],h=Object(c.useState)(),f=d()(h,2),g=f[0],j=f[1];return Object(c.useEffect)((function(){x()({path:"/jetpack/v4/jetpack_crm"}).then((function(e){if(e.error)throw e.message;b(!1),j(e)})).catch((function(){return b(!0)})).finally((function(){return l(!1)}))}),[]),Object(c.createElement)(s.PanelBody,{title:Object(i.__)("CRM Integration","jetpack"),initialOpen:!1},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)(V,{isFetchingCRMData:o,hasCRMDataError:m,crmData:g,setCRMData:j,jetpackCRM:t,setAttributes:n})))},H=n(26),q=n.n(H),W=function(){var e,t,n=(e=Object(v.useSelect)((function(e){return e("core/block-editor").getSelectedBlock()}),[]),t=Object(v.useDispatch)("core/block-editor").insertBlock,{insertConsentBlock:Object(c.useCallback)(q()(regeneratorRuntime.mark((function n(){var r,a,o,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return-1===(a=(null!==(r=e.innerBlocks)&&void 0!==r?r:[]).findIndex((function(e){return"jetpack/button"===e.name})))&&(a=(null!==(o=e.innerBlocks)&&void 0!==o?o:[]).length),n.next=4,Object(l.createBlock)("jetpack/field-consent");case 4:return c=n.sent,n.next=7,t(c,a,e.clientId,!1);case 7:case"end":return n.stop()}}),n)}))),[t,e.clientId,e.innerBlocks])}).insertConsentBlock;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("p",null,Object(i.__)("You’re already collecting email contacts. Why not make sure you have permission to email them too?","jetpack")),Object(c.createElement)(s.Button,{isSecondary:!0,onClick:n,style:{marginBottom:"1em"}},Object(i.__)("Add email permission request","jetpack")),Object(c.createElement)("br",null))},$=function(){var e=Object(v.useSelect)((function(e){return e("core/block-editor").getSelectedBlock()}),[]);return Object(c.useMemo)((function(){return t=e.innerBlocks,n=t.some((function(e){return"jetpack/field-email"===e.name})),r=t.some((function(e){return"jetpack/field-consent"===e.name})),!!n&&!r;var t,n,r}),[e.innerBlocks])?Object(c.createElement)(W,null):null};function K(){return(K=q()(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins"});case 5:return t=e.sent,e.abrupt("return",t);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function Z(_x){return Y.apply(this,arguments)}function Y(){return(Y=q()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins",method:"POST",data:{slug:t,status:"active",source:"block-editor"}});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function J(e){return X.apply(this,arguments)}function X(){return(X=q()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Object(_.c)()){e.next=2;break}return e.abrupt("return",Promise.reject());case 2:return e.prev=2,e.next=5,x()({path:"/jetpack/v4/plugins/".concat(t),method:"POST",data:{status:"active",source:"block-editor"}});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}var Q=function(e){var t=e.error;return Object(c.createElement)(s.Notice,{isDismissible:!1,status:"error"},Object(c.createInterpolateElement)(Object(i.__)("The plugin failed to install. <b /> Please check the <a>plugin information</a> for detailed requirements.","jetpack"),{a:Object(c.createElement)(s.ExternalLink,{href:"https://wordpress.org/plugins/creative-mail-by-constant-contact"}),b:Object(c.createElement)("span",null,t)}))},ee=n(46),te=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),ne=function(e){var t=e.isActivating?Object(i.__)("Activating…","jetpack"):Object(i.__)("Installing…","jetpack");return Object(c.createElement)(s.Button,{isSecondary:!0,icon:Object(c.createElement)(s.Icon,{style:{animation:"rotation 2s infinite linear"},icon:"update"}),disabled:!0,"aria-label":t},t)},re=function(e){var t=e.installAndActivateCreativeMailPlugin,n=e.isInstalling;return Object(c.createElement)("p",null,Object(c.createElement)("em",{style:{color:"rgba(38, 46, 57, 0.7)"}},Object(i.__)("To start sending email campaigns, install the Creative Mail plugin for WordPress.","jetpack"),Object(c.createElement)("br",null),n&&Object(c.createElement)(ne,null),!n&&Object(c.createElement)(s.Button,{isSecondary:!0,onClick:t},Object(i.__)("Install Creative Mail plugin","jetpack"))))},ae=function(e){var t=e.activateCreativeMailPlugin,n=e.isInstalling;return Object(c.createElement)("p",null,Object(c.createElement)("em",null,Object(i.__)("To start sending email campaigns, activate the Creative Mail plugin for WordPress.","jetpack")),Object(c.createElement)("br",null),n&&Object(c.createElement)(ne,{isActivating:!0}),!n&&Object(c.createElement)(s.Button,{isSecondary:!0,onClick:t},Object(i.__)("Activate Creative Mail Plugin","jetpack")))},oe=function(){return Object(c.createElement)("p",null,Object(c.createElement)("em",null,Object(i.__)("You’re all setup for email marketing with Creative Mail.","jetpack"),Object(c.createElement)("br",null),Object(c.createElement)(s.ExternalLink,{href:(e=Object(m.get)(Object(ee.a)(),"adminUrl",!1),"".concat(e,"admin.php?page=creativemail"))},Object(i.__)("Open Creative Mail settings","jetpack"))));var e},ce=function(e){var t=e.pluginState,n=e.onCreativeMailPluginClick,r=e.isInstalling;return Object(c.createElement)("div",{"aria-live":"polite"},te.ACTIVE===t&&Object(c.createElement)(oe,null),te.INSTALLED===t&&Object(c.createElement)(ae,{activateCreativeMailPlugin:function(){return n(J,"creative-mail-by-constant-contact/creative-mail-plugin")},isInstalling:r}),te.NOT_INSTALLED===t&&Object(c.createElement)(re,{installAndActivateCreativeMailPlugin:function(){return n(Z,"creative-mail-by-constant-contact")},isInstalling:r}))},ie="".concat("creative-mail-by-constant-contact/creative-mail-plugin",".php"),le=function(e){var t=e.pluginState,n=e.setPluginState,r=Object(c.useState)(),a=d()(r,2),o=a[0],i=a[1],l=Object(c.useState)(!1),s=d()(l,2),u=s[0],p=function(e,t,n){return Object(c.useCallback)((function(r,a){e(void 0),t(!0),r(a).then((function(){n(te.ACTIVE)})).catch((function(t){e(t)})).finally((function(){return t(!1)}))}),[t,e,n])}(i,s[1],n);return o?Object(c.createElement)(Q,{error:o}):Object(c.createElement)(ce,{pluginState:t,onCreativeMailPluginClick:p,isInstalling:u})},se=function(e){var t=e.isFetchingPlugins,n=e.hasError,r=e.pluginState,a=e.setPluginState;return t?Object(c.createElement)(s.Spinner,null):n?null:Object(c.createElement)(le,{pluginState:r,setPluginState:a})},ue=function(){var e=Object(c.useState)(!0),t=d()(e,2),n=t[0],r=t[1],a=Object(c.useState)(!1),o=d()(a,2),i=o[0],l=o[1],s=Object(c.useState)(te.NOT_INSTALLED),u=d()(s,2),p=u[0],b=u[1];return Object(c.useEffect)((function(){(function(){return K.apply(this,arguments)})().then((function(e){l(!1),Object(m.get)(e,ie)&&(Object(m.get)(e,[ie,"active"])?b(te.ACTIVE):b(te.INSTALLED))})).catch((function(){return l(!0)})).finally((function(){return r(!1)}))}),[b,r,l]),Object(c.createElement)(se,{isFetchingPlugins:n,hasError:i,pluginState:p,setPluginState:b})},pe=function(){return Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Newsletter Integration","jetpack"),initialOpen:!1},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)($,null),Object(c.createElement)(ue,null)))},de=["jetpack/markdown","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/file","core/html","core/separator","core/spacer","core/subhead","core/table","core/verse","core/video"];var me=Object(j.compose)([Object(v.withSelect)((function(e,t){var n=e("core/blocks"),r=n.getBlockType,a=n.getBlockVariations,o=n.getDefaultBlockVariation,c=e("core/block-editor").getBlocks,i=e("core/editor").getEditedPostAttribute,l=e("core"),s=l.getSite,u=l.getUser,p=c(t.clientId),d=i("author"),b=d&&u(d)&&u(d).email,h=i("title");return{blockType:r&&r(t.name),defaultVariation:o&&o(t.name,"block"),variations:a&&a(t.name,"block"),innerBlocks:p,hasInnerBlocks:p.length>0,siteTitle:Object(m.get)(s&&s(),["title"]),postTitle:h,postAuthorEmail:b}})),Object(v.withDispatch)((function(e){var t=e("core/block-editor");return{replaceInnerBlocks:t.replaceInnerBlocks,selectBlock:t.selectBlock}})),j.withInstanceId])((function(e){var t=e.attributes,n=e.setAttributes,r=e.siteTitle,a=e.postTitle,o=e.postAuthorEmail,p=e.hasInnerBlocks,b=e.replaceInnerBlocks,f=e.selectBlock,j=e.clientId,v=e.instanceId,y=e.className,E=e.blockType,C=e.variations,x=e.defaultVariation,S=t.to,N=t.subject,A=t.customThankyou,T=t.customThankyouHeading,P=t.customThankyouMessage,I=t.customThankyouRedirect,M=t.jetpackCRM,R=Object(c.useState)(!1),B=d()(R,2),L=B[0],D=B[1],F=h()(y,"jetpack-contact-form"),z=function e(t){return Object(m.map)(t,(function(t){var n=d()(t,3),r=n[0],a=n[1],o=n[2],c=void 0===o?[]:o;return Object(l.createBlock)(r,a,e(c))}))},U=function(e){e.attributes&&n(e.attributes),e.innerBlocks&&b(j,z(e.innerBlocks)),f(j)};Object(c.useEffect)((function(){p||l.registerBlockVariation||U(w[0])})),Object(c.useEffect)((function(){(void 0===S&&o&&n({to:o}),void 0===N&&void 0!==r&&void 0!==a)&&n({subject:"["+r+"] "+a})}),[S,o,N,r,a,n]);var V=function(e){return 0!==(e=e.trim()).length&&(!g.a.validate(e)&&{email:e})},H=function(e){if(0===e.target.value.length)return D(!1),void n({to:o});var t=e.target.value.split(",").map(V).filter(Boolean);t&&t.length&&D(t)},q=function(e){D(!1),n({to:e.trim()})},W=function(){var e=void 0!==S?S:"",t=void 0!==N?N:"";return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.TextControl,{"aria-describedby":"contact-form-".concat(v,"-email-").concat(L&&L.length>0?"error":"help"),label:Object(i.__)("Email address to send to","jetpack"),placeholder:Object(i.__)("name@example.com","jetpack"),onKeyDown:function(e){"Enter"===event.key&&(e.preventDefault(),e.stopPropagation())},value:e,onBlur:H,onChange:q,help:Object(i.__)("You can enter multiple email addresses separated by commas.","jetpack")}),Object(c.createElement)(k.a,{isError:!0,id:"contact-form-".concat(v,"-email-error")},function(){if(L){if(1===L.length)return L[0]&&L[0].email?Object(i.sprintf)(Object(i.__)("%s is not a valid email address.","jetpack"),L[0].email):L[0];if(2===L.length)return Object(i.sprintf)(Object(i.__)("%1$s and %2$s are not a valid email address.","jetpack"),L[0].email,L[1].email);var e=L.map((function(e){return e.email}));return Object(i.sprintf)(Object(i.__)("%s are not a valid email address.","jetpack"),e.join(", "))}return null}()),Object(c.createElement)(s.TextControl,{label:Object(i.__)("Email subject line","jetpack"),value:t,placeholder:Object(i.__)("Enter a subject","jetpack"),onChange:function(e){return n({subject:e})},help:Object(i.__)("Choose a subject line that you recognize as an email from your website.","jetpack")}),Object(c.createElement)(s.SelectControl,{label:Object(i.__)("On Submission","jetpack"),value:A,options:[{label:Object(i.__)("Show a summary of submitted fields","jetpack"),value:""},{label:Object(i.__)("Show a custom text message","jetpack"),value:"message"},{label:Object(i.__)("Redirect to another webpage","jetpack"),value:"redirect"}],onChange:function(e){return n({customThankyou:e})}}),"redirect"!==A&&Object(c.createElement)(s.TextControl,{label:Object(i.__)("Message Heading","jetpack"),value:T,placeholder:Object(i.__)("Message Sent","jetpack"),onChange:function(e){return n({customThankyouHeading:e})}}),"message"===A&&Object(c.createElement)(s.TextareaControl,{label:Object(i.__)("Message Text","jetpack"),value:P,placeholder:Object(i.__)("Thank you for your submission!","jetpack"),onChange:function(e){return n({customThankyouMessage:e})}}),"redirect"===A&&Object(c.createElement)(s.BaseControl,{label:Object(i.__)("Redirect Address","jetpack"),id:"contact-form-".concat(v,"-thankyou-url")},Object(c.createElement)(u.URLInput,{id:"contact-form-".concat(v,"-thankyou-url"),value:I,className:"jetpack-contact-form__thankyou-redirect-url",onChange:function(e){return n({customThankyouRedirect:e})}})))};return!p&&l.registerBlockVariation?Object(c.createElement)("div",{className:F},Object(c.createElement)(u.__experimentalBlockVariationPicker,{icon:Object(m.get)(E,["icon","src"]),label:Object(m.get)(E,["title"]),instructions:Object(i.__)("Please select which type of form you'd like to add, or create your own using the skip option.","jetpack"),variations:C,allowSkip:!0,onSelect:function(){U(arguments.length>0&&void 0!==arguments[0]?arguments[0]:x)}})):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(u.BlockControls,null,Object(c.createElement)(s.ToolbarGroup,null,Object(c.createElement)(s.ToolbarItem,null,(function(){return Object(c.createElement)(s.Dropdown,{position:"bottom right",className:"jetpack-contact-form-settings-selector",contentClassName:"jetpack-contact-form__popover",renderToggle:function(e){return function(e,t){return Object(c.createElement)(s.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:Object(i.__)("Edit Form Settings","jetpack"),onClick:t,onKeyDown:function(n){e||n.keyCode!==O.DOWN||(n.preventDefault(),n.stopPropagation(),t())},icon:Object(c.createElement)(s.Icon,{icon:"edit"})})}(e.isOpen,e.onToggle)},renderContent:function(){return W()}})})))),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Form Settings","jetpack")},W()),!Object(_.c)()&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(G,{jetpackCRM:M,setAttributes:n}),Object(c.createElement)(pe,null))),Object(c.createElement)("div",{className:F},Object(c.createElement)(u.InnerBlocks,{allowedBlocks:de,templateInsertUpdatesSelection:!1})))})),be={subject:{type:"string"},to:{type:"string"},customThankyou:{type:"string",default:""},customThankyouHeading:{type:"string",default:Object(i.__)("Message Sent","jetpack")},customThankyouMessage:{type:"string",default:""},customThankyouRedirect:{type:"string",default:""},jetpackCRM:{type:"boolean",default:!0}},he=["submit_button_text","has_form_settings_set","submitButtonText","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor","submitButtonClasses","hasFormSettingsSet"],fe=[{attributes:o()({submit_button_text:{type:"string",default:Object(i.__)("Submit","jetpack")},has_form_settings_set:{type:"string",default:null},submitButtonText:{type:"string",default:Object(i.__)("Submit","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"}},be),migrate:function(e,t){var n=Object(m.omit)(e,he),r={text:e.submitButtonText||e.submit_button_text||Object(i.__)("Submit","jetpack"),backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,customBackgroundColor:e.customBackgroundButtonColor,customTextColor:e.customTextButtonColor};return[n,t.concat(Object(l.createBlock)("jetpack/button",o()({element:"button"},r)))]},isEligible:function(e){return!(!e.has_form_settings_set&&!e.hasFormSettingsSet)},save:u.InnerBlocks.Content}],ge=function(e,t,n){var r=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,'="([^"]*)"'),"im"));if(r&&r.length)return r[1];var a=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,"='([^']*)'"),"im"));if(a&&a.length)return a[1];var o=n.match(new RegExp("\\[".concat(e,"[^\\]]* ").concat(t,"=([^\\s]*)\\s"),"im"));return!(!o||!o.length)&&o[1]},je={root:{},innerBlocks:[]},ve={from:[{type:"raw",priority:1,isMatch:function(e){return!("P"!==e.nodeName||!(/\[contact-form(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[contact-field(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[\/contact-form]/g.test(e.textContent)))},transform:function(e){var t,n,r=e.textContent.replace("<br>","");if(r.includes("[contact-form")&&(je.root={},je.innerBlocks=[],je.root=(n={to:ge("contact-form","to",t=r),subject:ge("contact-form","subject",t),submitButtonText:ge("contact-form","submit_button_text",t)},{blockName:"jetpack/contact-form",attrs:Object(m.pickBy)(n,m.identity)})),r.includes("[contact-field")){var a=r.match(/(\[contact-field[\s\S]*?\/?])/g);a&&a.length>0&&a.forEach((function(e){je.innerBlocks.push(function(e){var t,n,r,a={label:ge("contact-field","label",e),placeholder:ge("contact-field","placeholder",e),required:ge("contact-field","required",e),options:ge("contact-field","options",e)},o=(t=ge("contact-field","type",e),(r={text:"".concat(n="jetpack","/field-text"),url:"".concat(n,"/field-text"),textarea:"".concat(n,"/field-textarea"),radio:"".concat(n,"/field-radio"),checkbox:"".concat(n,"/field-checkbox"),"checkbox-multiple":"".concat(n,"/field-checkbox-multiple"),select:"".concat(n,"/field-select"),email:"".concat(n,"/field-email"),name:"".concat(n,"/field-name"),default:"".concat(n,"/field-text")})[t]?r[t]:r.default);return a.options&&(a.options=a.options.split(",")),Object(l.createBlock)(o,Object(m.pickBy)(a,m.identity))}(e))}))}return!!r.includes("[/contact-form]")&&(je.innerBlocks.push(Object(l.createBlock)("jetpack/button",{element:"button",text:je.root.attrs.submitButtonText||Object(i.__)("Contact Us","jetpack")})),Object(l.createBlock)(je.root.blockName,je.root.attrs,je.innerBlocks))}}]},Oe=n(21),ke=n.n(Oe),_e=n(31),ye=n(47);function Ee(e){var t=e.setAttributes,n=e.width;return Object(c.createElement)(s.BaseControl,{label:Object(i.__)("Field Width","jetpack"),help:Object(i.__)("Adjust the width of the field to include multiple fields on a single line.","jetpack"),className:"jetpack-field-label__width"},Object(c.createElement)(s.ButtonGroup,{"aria-label":Object(i.__)("Field Width","jetpack")},[25,50,75,100].map((function(e){return Object(c.createElement)(s.Button,{key:e,isSmall:!0,isPrimary:e===n,onClick:function(){return t({width:e})}},e,"%")}))))}function we(e){var t=e.setAttributes,n=e.id;return Object(c.createElement)(s.TextControl,{label:Object(i.__)("Unique CSS ID","jetpack"),value:n,onChange:function(e){return t({id:e})},help:Object(i.__)("A unique ID that can be used in CSS or as an anchor.","jetpack")})}var Ce=function(e){var t=e.setAttributes,n=e.width,r=e.id,a=e.required;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(u.BlockControls,null,Object(c.createElement)(s.ToolbarGroup,null,Object(c.createElement)(s.ToolbarButton,{title:Object(i.__)("Required","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{d:"M8.23118 8L16 16M8 16L15.7688 8 M6.5054 11.893L17.6567 11.9415M12.0585 17.6563L12 6.5",stroke:"currentColor"})),onClick:function(){t({required:!a})},className:a?"is-pressed":void 0}))),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Field Settings","jetpack")},Object(c.createElement)(s.ToggleControl,{label:Object(i.__)("Field is required","jetpack"),className:"jetpack-field-label__required",checked:a,onChange:function(e){return t({required:e})},help:Object(i.__)("Does this field have to be completed for the form to be submitted?","jetpack")}),Object(c.createElement)(Ee,{setAttributes:t,width:n}))),Object(c.createElement)(u.InspectorAdvancedControls,null,Object(c.createElement)(we,{setAttributes:t,id:r})))};function xe(e){var t=e.id,n=e.type,r=e.required,a=e.label,o=e.setAttributes,l=e.placeholder,u=e.width;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"jetpack-field"},Object(c.createElement)(ye.a,{required:r,label:a,setAttributes:o}),Object(c.createElement)(s.Disabled,null,Object(c.createElement)(s.TextControl,{type:n,placeholder:l,value:l,onChange:function(e){return o({placeholder:e})},title:Object(i.__)("Set the placeholder text","jetpack")}))),Object(c.createElement)(Ce,{id:t,required:r,width:u,setAttributes:o}))}var Se=Object(j.createHigherOrderComponent)((function(e){return function(t){if(t.name.indexOf("jetpack/field")>-1){var n=t.attributes.width?"jetpack-field__width-"+t.attributes.width:"";return Object(c.createElement)(e,ke()({},t,{className:n}))}return Object(c.createElement)(e,t)}}),"withCustomClassName");function Ne(e){var t=e.id,n=e.required,r=e.label,a=e.setAttributes,o=e.placeholder,l=e.width;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"jetpack-field"},Object(c.createElement)(ye.a,{required:n,label:r,setAttributes:a}),Object(c.createElement)(s.Disabled,null,Object(c.createElement)(s.TextareaControl,{placeholder:o,value:o,onChange:function(e){return a({placeholder:e})},title:Object(i.__)("Set the placeholder text","jetpack")}))),Object(c.createElement)(Ce,{id:t,required:n,setAttributes:a,width:l}))}Object(_e.addFilter)("editor.BlockListBlock","jetpack/contact-form",Se);var Ae=Object(j.withInstanceId)((function(e){var t=e.id,n=e.instanceId,r=e.required,a=e.label,o=e.setAttributes,l=e.width,p=e.defaultValue;return Object(c.createElement)(s.BaseControl,{id:"jetpack-field-checkbox-".concat(n),className:"jetpack-field jetpack-field-checkbox",label:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("input",{className:"jetpack-field-checkbox__checkbox",type:"checkbox",disabled:!0,checked:p}),Object(c.createElement)(ye.a,{required:r,label:a,setAttributes:o}),Object(c.createElement)(Ce,{id:t,required:r,width:l,setAttributes:o}),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Checkbox Settings","jetpack")},Object(c.createElement)(s.ToggleControl,{label:Object(i.__)("Checked by default","jetpack"),checked:p,onChange:function(e){return o({defaultValue:e?"true":""})}}))))})})),Te=n(12),Pe=n.n(Te),Ie=n(15),Me=n.n(Ie),Re=n(7),Be=n.n(Re),Le=n(13),De=n.n(Le),Fe=n(14),ze=n.n(Fe),Ue=function(e){De()(n,e);var t=ze()(n);function n(){var e;Pe()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).onChangeOption=e.onChangeOption.bind(Be()(e)),e.onKeyPress=e.onKeyPress.bind(Be()(e)),e.onDeleteOption=e.onDeleteOption.bind(Be()(e)),e.textInput=Object(c.createRef)(),e}return Me()(n,[{key:"componentDidMount",value:function(){this.props.isInFocus&&this.textInput.current.focus()}},{key:"componentDidUpdate",value:function(){this.props.isInFocus&&this.textInput.current.focus()}},{key:"onChangeOption",value:function(e){this.props.onChangeOption(this.props.index,e.target.value)}},{key:"onKeyPress",value:function(e){return"Enter"===e.key?(this.props.onAddOption(this.props.index),void e.preventDefault()):"Backspace"===e.key&&""===e.target.value?(this.props.onChangeOption(this.props.index),void e.preventDefault()):void 0}},{key:"onDeleteOption",value:function(){this.props.onChangeOption(this.props.index)}},{key:"render",value:function(){var e=this.props,t=e.isSelected,n=e.option,r=e.type;return Object(c.createElement)("li",{className:"jetpack-option"},r&&"select"!==r&&Object(c.createElement)("input",{className:"jetpack-option__type",type:r,disabled:!0}),Object(c.createElement)("input",{type:"text",className:"jetpack-option__input",value:n,placeholder:Object(i.__)("Write option…","jetpack"),onChange:this.onChangeOption,onKeyDown:this.onKeyPress,ref:this.textInput}),t&&Object(c.createElement)(s.Button,{className:"jetpack-option__remove",icon:"trash",label:Object(i.__)("Remove option","jetpack"),onClick:this.onDeleteOption}))}}]),n}(c.Component);var Ve=Object(j.withInstanceId)((function(e){var t=e.id,n=e.type,r=e.instanceId,a=e.required,o=e.label,l=e.setAttributes,u=e.isSelected,p=e.width,m=e.options,b=Object(c.useState)(null),h=d()(b,2),f=h[0],g=h[1],j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=m.slice(0);null===t?(n.splice(e,1),e>0&&g(e-1)):(n.splice(e,1,t),g(e)),l({options:n})},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=m.slice(0),n=0;"object"==typeof e?(t.push(""),n=t.length-1):(t.splice(e+1,0,""),n=e+1),g(n),l({options:t})};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.BaseControl,{id:"jetpack-field-multiple-".concat(r),className:"jetpack-field jetpack-field-multiple",label:Object(c.createElement)(ye.a,{required:a,label:o,setAttributes:l,isSelected:u,resetFocus:function(){return g(null)}})},Object(c.createElement)("ol",{className:"jetpack-field-multiple__list",id:"jetpack-field-multiple-".concat(r)},m.map((function(e,t){return Object(c.createElement)(Ue,{type:n,key:t,option:e,index:t,onChangeOption:j,onAddOption:v,isInFocus:t===f&&u,isSelected:u})}))),u&&Object(c.createElement)(s.Button,{className:"jetpack-field-multiple__add-option",icon:"insert",label:Object(i.__)("Insert option","jetpack"),onClick:v},Object(i.__)("Add option","jetpack"))),Object(c.createElement)(Ce,{id:t,required:a,setAttributes:l,width:p}))})),Ge=Object(j.withInstanceId)((function(e){var t,n=e.id,r=e.instanceId,a=e.width,o=e.consentType,l=e.implicitConsentMessage,p=e.explicitConsentMessage,d=e.setAttributes;return Object(c.createElement)(s.BaseControl,{id:"jetpack-field-consent-".concat(r),className:"jetpack-field jetpack-field-consent",label:Object(c.createElement)(c.Fragment,null,"explicit"===o&&Object(c.createElement)("input",{className:"jetpack-field-consent__checkbox",type:"checkbox",disabled:!0}),Object(c.createElement)(ye.a,{required:!1,label:null!==(t={implicit:l,explicit:p}[o])&&void 0!==t?t:"",setAttributes:d,labelFieldName:"".concat(o,"ConsentMessage"),placeholder:Object(i.sprintf)(Object(i.__)("Add %s consent message…","jetpack"),o)}),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Field Settings","jetpack")},Object(c.createElement)(Ee,{setAttributes:d,width:a}))),Object(c.createElement)(u.InspectorAdvancedControls,null,Object(c.createElement)(we,{setAttributes:d,id:n})),Object(c.createElement)(u.InspectorControls,null,Object(c.createElement)(s.PanelBody,{title:Object(i.__)("Consent Settings","jetpack")},Object(c.createElement)(s.BaseControl,null,Object(c.createElement)(s.SelectControl,{label:Object(i.__)("Permission to email","jetpack"),value:o,options:[{label:Object(i.__)("Mention that you can email","jetpack"),value:"implicit"},{label:Object(i.__)("Add a privacy checkbox","jetpack"),value:"explicit"}],onChange:function(e){return d({consentType:e})}})))))})})),He=Object(y.a)(Object(c.createElement)(s.Path,{d:"M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"})),qe={title:Object(i.__)("Form","jetpack"),description:Object(i.__)("A simple way to get feedback from folks visiting your site.","jetpack"),icon:{src:He,foreground:Object(E.a)()},keywords:[Object(i._x)("email","block search term","jetpack"),Object(i._x)("feedback","block search term","jetpack"),Object(i._x)("contact form","block search term","jetpack")],supports:{html:!1},attributes:be,edit:me,save:u.InnerBlocks.Content,variations:w,category:"grow",transforms:ve,deprecated:fe},We={category:"grow",parent:["jetpack/contact-form"],supports:{reusable:!1,html:!1},attributes:{label:{type:"string",default:null},required:{type:"boolean",default:!1},options:{type:"array",default:[]},defaultValue:{type:"string",default:""},placeholder:{type:"string",default:""},id:{type:"string",default:""},width:{type:"number",default:100}},transforms:{to:[{type:"block",blocks:["jetpack/field-text"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-text",e)}},{type:"block",blocks:["jetpack/field-name"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-name",e)}},{type:"block",blocks:["jetpack/field-email"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-email",e)}},{type:"block",blocks:["jetpack/field-url"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-url",e)}},{type:"block",blocks:["jetpack/field-date"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-date",e)}},{type:"block",blocks:["jetpack/field-telephone"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-telephone",e)}},{type:"block",blocks:["jetpack/field-textarea"],isMatch:function(e){return!e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-textarea",e)}},{type:"block",blocks:["jetpack/field-checkbox-multiple"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-checkbox-multiple",e)}},{type:"block",blocks:["jetpack/field-radio"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-radio",e)}},{type:"block",blocks:["jetpack/field-select"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-select",e)}},{type:"block",blocks:["jetpack/field-consent"],isMatch:function(e){return 1<=e.options.length},transform:function(e){return Object(l.createBlock)("jetpack/field-consent",e)}}]},save:function(){return null},example:{}},$e=function(e){var t=e.attributes,n=e.name;return null===t.label?Object(l.getBlockType)(n).title:t.label},Ke=function(e){return function(t){return Object(c.createElement)(xe,{type:e,label:$e(t),required:t.attributes.required,setAttributes:t.setAttributes,isSelected:t.isSelected,defaultValue:t.attributes.defaultValue,placeholder:t.attributes.placeholder,id:t.attributes.id,width:t.attributes.width})}},Ze=function(e){return function(t){return Object(c.createElement)(Ve,{label:$e(t),required:t.attributes.required,options:t.attributes.options,setAttributes:t.setAttributes,type:e,isSelected:t.isSelected,id:t.attributes.id,width:t.attributes.width})}},Ye=[{name:"field-text",settings:o()(o()({},We),{},{title:Object(i.__)("Text","jetpack"),description:Object(i.__)("When you need just a small amount of text, add a text input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),edit:Ke("text")})},{name:"field-name",settings:o()(o()({},We),{},{title:Object(i.__)("Name","jetpack"),description:Object(i.__)("Introductions are important. Add an input for folks to add their name.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})),edit:Ke("text")})},{name:"field-email",settings:o()(o()({},We),{},{title:Object(i.__)("Email","jetpack"),keywords:[Object(i.__)("e-mail","jetpack"),Object(i.__)("mail","jetpack"),"email"],description:Object(i.__)("Want to reply to folks? Add an email address input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),edit:Ke("email")})},{name:"field-url",settings:o()(o()({},We),{},{title:Object(i.__)("Website","jetpack"),keywords:["url",Object(i.__)("internet page","jetpack"),"link"],description:Object(i.__)("Add an address input for a website.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6z"})),edit:Ke("url")})},{name:"field-date",settings:o()(o()({},We),{},{title:Object(i.__)("Date Picker","jetpack"),keywords:[Object(i.__)("Calendar","jetpack"),Object(i._x)("day month year","block search term","jetpack")],description:Object(i.__)("The best way to set a date. Add a date picker.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V9h14v10zm0-12H5V5h14v2zM7 11h5v5H7z"})),edit:Ke("text")})},{name:"field-telephone",settings:o()(o()({},We),{},{title:Object(i.__)("Phone Number","jetpack"),keywords:[Object(i.__)("Phone","jetpack"),Object(i.__)("Cellular phone","jetpack"),Object(i.__)("Mobile","jetpack")],description:Object(i.__)("Add a phone number input.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),edit:Ke("tel")})},{name:"field-textarea",settings:o()(o()({},We),{},{title:Object(i.__)("Message","jetpack"),keywords:[Object(i.__)("Textarea","jetpack"),"textarea",Object(i.__)("Multiline text","jetpack")],description:Object(i.__)("Let folks speak their mind. This text box is great for longer responses.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),edit:function(e){return Object(c.createElement)(Ne,{label:$e(e),required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,placeholder:e.attributes.placeholder,id:e.attributes.id,width:e.attributes.width})}})},{name:"field-checkbox",settings:o()(o()({},We),{},{title:Object(i.__)("Checkbox","jetpack"),keywords:[Object(i.__)("Confirm","jetpack"),Object(i.__)("Accept","jetpack")],description:Object(i.__)("Add a single checkbox.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})),edit:function(e){return Object(c.createElement)(Ae,{label:e.attributes.label,required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,id:e.attributes.id,width:e.attributes.width})},attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:""}})})},{name:"field-consent",settings:o()(o()({},We),{},{title:Object(i.__)("Consent","jetpack"),keywords:[Object(i.__)("Consent","jetpack")],description:Object(i.__)("Ask for consent","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"m81 370h142v40h-142zm0-39h142v-40h-142zm0-79h245v-40h-245zm378 260h-40c0-40.253906-32.746094-73-73-73s-73 32.746094-73 73h-40c0-42.085938 23.128906-78.867188 57.34375-98.3125-11.40625-13.023438-18.34375-30.054688-18.34375-48.6875 0-40.804688 33.195312-74 74-74s74 33.195312 74 74c0 18.632812-6.9375 35.664062-18.34375 48.6875 34.214844 19.445312 57.34375 56.226562 57.34375 98.3125zm-113-113c18.746094 0 34-15.253906 34-34s-15.253906-34-34-34-34 15.253906-34 34 15.253906 34 34 34zm-286 73h138.316406c-3.460937 12.757812-5.316406 26.164062-5.316406 40h-133c-33.085938 0-60-26.914062-60-60v-392c0-33.085938 26.914062-60 60-60h203.757812l142.132813 142.855469v125.210937c-12.042969-7.476562-25.453125-12.765625-39.890625-15.324218v-81.632813h-71.109375c-33.085937 0-60-26.914063-60-60v-71.109375h-174.890625c-11.027344 0-20 8.972656-20 20v392c0 11.027344 8.972656 20 20 20zm234.890625-340.890625h42.972656l-62.972656-63.234375v43.234375c0 11.03125 8.96875 20 20 20zm0 0"}),24,25,"-26 0 512 512"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:Object(i.__)("Consent","jetpack")},consentType:{type:"string",default:"implicit"},implicitConsentMessage:{type:"string",default:Object(i.__)("By submitting your information, you're giving us permission to email you. You may unsubscribe at any time.","jetpack")},explicitConsentMessage:{type:"string",default:Object(i.__)("Can we send you an email from time to time?","jetpack")}}),edit:function(e){var t=e.attributes,n=e.isSelected,r=e.setAttributes,a=t.id,o=t.width,i=t.consentType,l=t.implicitConsentMessage,s=t.explicitConsentMessage;return Object(c.createElement)(Ge,{id:a,isSelected:n,width:o,consentType:i,implicitConsentMessage:l,explicitConsentMessage:s,setAttributes:r})}})},{name:"field-checkbox-multiple",settings:o()(o()({},We),{},{title:Object(i.__)("Checkbox Group","jetpack"),keywords:[Object(i.__)("Choose Multiple","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("People love options. Add several checkbox items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})),edit:Ze("checkbox"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Choose several"}})})},{name:"field-radio",settings:o()(o()({},We),{},{title:Object(i.__)("Radio","jetpack"),keywords:[Object(i.__)("Choose","jetpack"),Object(i.__)("Select","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("Inspired by radios, only one radio item can be selected at a time. Add several radio button items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Object(c.createElement)(s.Circle,{cx:"12",cy:"12",r:"5"}))),edit:Ze("radio"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Choose one"}})})},{name:"field-select",settings:o()(o()({},We),{},{title:Object(i.__)("Select","jetpack"),keywords:[Object(i.__)("Choose","jetpack"),Object(i.__)("Dropdown","jetpack"),Object(i.__)("Option","jetpack")],description:Object(i.__)("Compact, but powerful. Add a select box with several items.","jetpack"),icon:Object(y.a)(Object(c.createElement)(s.Path,{fill:Object(E.a)(),d:"M3 17h18v2H3zm16-5v1H5v-1h14m2-2H3v5h18v-5zM3 6h18v2H3z"})),edit:Ze("select"),attributes:o()(o()({},We.attributes),{},{label:{type:"string",default:"Select one"}})})}];Object(r.a)("contact-form",qe,Ye)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i={subscribePlaceholder:{type:"string",default:Object(o.__)("Email Address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},buttonWidth:{type:"string"},submitButtonText:{type:"string",default:Object(o.__)("Subscribe","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"string"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},l=n(3),s={attributes:{subscribeButton:{type:"string",default:Object(o.__)("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1}},migrate:function(e){return{submitButtonText:e.subscribeButton,showSubscribersTotal:e.showSubscribersTotal}},isEligible:function(e){return!(!e.hasOwnProperty("subscribeButton")||!Object(l.isEmpty)(e.subscribeButton))},save:function(e){var t=e.attributes;return Object(a.createElement)(a.RawHTML,null,'[jetpack_subscription_form show_subscribers_total="'.concat(t.showSubscribersTotal,'" show_only_email_and_button="true"]'))}};var u={attributes:{subscribePlaceholder:{type:"string",default:Object(o.__)("Email Address","jetpack")},subscribeButton:{type:"string",default:Object(o.__)("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},submitButtonText:{type:"string",default:Object(o.__)("Subscribe","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"}},migrate:function(e){return{subscribePlaceholder:e.subscribePlaceholder,showSubscribersTotal:e.showSubscribersTotal,buttonOnNewLine:!0,submitButtonText:e.submitButtonText,buttonBackgroundColor:e.backgroundButtonColor?e.backgroundButtonColor:"primary",customButtonBackgroundColor:e.customBackgroundButtonColor,textColor:e.textButtonColor?e.textButtonColor:"background",customTextColor:e.customTextButtonColor}},save:function(e){var t=e.attributes,n=t.showSubscribersTotal,r=t.submitButtonClasses,o=t.customBackgroundButtonColor,c=t.customTextButtonColor,i=t.submitButtonText;return Object(a.createElement)(a.RawHTML,null,'[jetpack_subscription_form show_only_email_and_button="true" custom_background_button_color="'.concat(o,'" custom_text_button_color="').concat(c,'" submit_button_text="').concat(i,'" submit_button_classes="').concat(r,'" show_subscribers_total="').concat(n,'" ]'))}},p=n(4),d=n.n(p),m={subscribePlaceholder:{type:"string",default:Object(o.__)("Enter your email address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},submitButtonText:{type:"string",default:Object(o.__)("Sign Up","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"number"},customFontSize:{type:"number"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},b=n(6),h=n(8),f=n.n(h);function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.subscribePlaceholder,o=t.showSubscribersTotal,c=t.buttonOnNewLine,i=t.submitButtonText,l=t.emailFieldBackgroundColor,s=t.customEmailFieldBackgroundColor,u=t.emailFieldGradient,p=t.customEmailFieldGradient,d=t.buttonBackgroundColor,h=t.customButtonBackgroundColor,g=t.buttonGradient,j=t.customButtonGradient,v=t.textColor,O=t.customTextColor,k=t.fontSize,_=t.customFontSize,y=t.borderRadius,E=t.borderWeight,w=t.borderColor,C=t.customBorderColor,x=t.padding,S=t.spacing,N=!!b.__experimentalGetGradientClass,A=Object(b.getColorClassName)("color",v),T=Object(b.getFontSizeClass)(k),P=Object(b.getColorClassName)("border-color",w),I=Object(b.getColorClassName)("background-color",d),M=N?Object(b.__experimentalGetGradientClass)(g):void 0,R=Object(b.getColorClassName)("background-color",l),B=N?Object(b.__experimentalGetGradientClass)(u):void 0,L=f()(0===y?"no-border-radius":void 0,T,P),D=f()(L,v?"has-text-color":void 0,A,d||g?"has-background":void 0,I,M),F=f()(L,R,B),z=!R&&p?p:s,U=!I&&j?j:h,V=function(){return f()(e,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},G=r,H=i;return"check-text-defaults"===n&&(G=r===m.subscribePlaceholder.default?"Enter your email address":r,H=i===m.submitButtonText.default?"Sign Up":i),Object(a.createElement)("div",{className:V()},Object(a.createElement)(a.RawHTML,null,'\n\t\t\t[jetpack_subscription_form\n\t\t\t\tsubscribe_placeholder="'.concat(G,'"\n\t\t\t\tshow_subscribers_total="').concat(o,'"\n\t\t\t\tbutton_on_newline="').concat(c,'"\n\t\t\t\tsubmit_button_text="').concat(H,'"\n\t\t\t\tcustom_background_emailfield_color="').concat(z,'"\n\t\t\t\tcustom_background_button_color="').concat(U,'"\n\t\t\t\tcustom_text_button_color="').concat(O,'"\n\t\t\t\tcustom_font_size="').concat(_||16,'"\n\t\t\t\tcustom_border_radius="').concat(y||0,'"\n\t\t\t\tcustom_border_weight="').concat(E||1,'"\n\t\t\t\tcustom_border_color="').concat(C,'"\n\t\t\t\tcustom_padding="').concat(x||15,'"\n\t\t\t\tcustom_spacing="').concat(S||10,'"\n\t\t\t\tsubmit_button_classes="').concat(D,'"\n\t\t\t\temail_field_classes="').concat(F,'"\n\t\t\t\tshow_only_email_and_button="true"\n\t\t\t]')))}var j=[{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){var t=e.className,n=e.attributes,r=n.subscribePlaceholder,o=n.showSubscribersTotal,c=n.buttonOnNewLine,i=n.submitButtonText,s=n.emailFieldBackgroundColor,u=n.customEmailFieldBackgroundColor,p=n.emailFieldGradient,d=n.customEmailFieldGradient,h=n.buttonBackgroundColor,g=n.customButtonBackgroundColor,j=n.buttonGradient,v=n.customButtonGradient,O=n.textColor,k=n.customTextColor,_=n.fontSize,y=n.customFontSize,E=n.borderRadius,w=n.borderWeight,C=n.borderColor,x=n.customBorderColor,S=n.padding,N=n.spacing,A=!!b.__experimentalGetGradientClass,T=Object(b.getColorClassName)("color",O),P=Object(b.getFontSizeClass)(_),I=Object(b.getColorClassName)("border-color",C),M=Object(b.getColorClassName)("background-color",h),R=A?Object(b.__experimentalGetGradientClass)(j):void 0,B=Object(b.getColorClassName)("background-color",s),L=A?Object(b.__experimentalGetGradientClass)(p):void 0,D=f()(0===E?"no-border-radius":void 0,P,I),F=f()(D,O?"has-text-color":void 0,T,h||j?"has-background":void 0,M,R),z=f()(D,B,L),U=!B&&d?d:u,V=!M&&v?v:g,G={subscribe_placeholder:r!==m.subscribePlaceholder.default?r:void 0,show_subscribers_total:o,button_on_newline:c,submit_button_text:i!==m.submitButtonText.default?i:void 0,custom_background_emailfield_color:U,custom_background_button_color:V,custom_text_button_color:k,custom_font_size:y||16,custom_border_radius:E||0,custom_border_weight:w||1,custom_border_color:x,custom_padding:S||15,custom_spacing:N||10,submit_button_classes:F,email_field_classes:z,show_only_email_and_button:!0},H=Object(l.reduce)(G,(function(e,t,n){return void 0===t?e:e+" ".concat(n,'="').concat(t,'"')}),"");return Object(a.createElement)("div",{className:f()(t,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)(a.RawHTML,null,"[jetpack_subscription_form".concat(H,"]")))}},{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){return g(e.className,e.attributes,"check-text-defaults")}},{attributes:m,migrate:function(e){var t=e.fontSize,n=e.customFontSize;return d()(d()({},e),{},{fontSize:t?"".concat(t,"px"):void 0,customFontSize:n?"".concat(n,"px"):void 0})},save:function(e){return g(e.className,e.attributes)}},u,s],v=n(5),O=n.n(v),k=n(9),_=n.n(k),y=n(22),E=n.n(y),w=n(17),C=(n(240),n(43)),x="16px",S=n(108);function N(e){var t=e.buttonBackgroundColor,n=e.borderColor,r=e.buttonGradient,i=e.borderRadius,l=e.borderWeight,s=e.buttonOnNewLine,u=e.emailFieldBackgroundColor,p=e.fallbackButtonBackgroundColor,d=e.fallbackTextColor,m=e.fontSize,h=e.isGradientAvailable,f=e.padding,g=e.setAttributes,j=e.setButtonBackgroundColor,v=e.setTextColor,O=e.showSubscribersTotal,k=e.spacing,_=e.subscriberCount,y=e.textColor,E=e.buttonWidth;return Object(a.createElement)(a.Fragment,null,h&&Object(a.createElement)(b.__experimentalPanelColorGradientSettings,{title:Object(o.__)("Color Settings","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:t.color,onColorChange:j,gradientValue:r.gradientValue,onGradientChange:r.setGradient,label:Object(o.__)("Button Background Color","jetpack")},{colorValue:y.color,onColorChange:v,label:Object(o.__)("Button Text Color","jetpack")},{colorValue:n.color,onColorChange:function(e){g({borderColor:e,customBorderColor:e})},label:Object(o.__)("Border Color","jetpack")}],initialOpen:!0},Object(a.createElement)(b.ContrastChecker,{fontSize:m.size,textColor:y.color,backgroundColor:u.color,fallbackButtonBackgroundColor:p,fallbackTextColor:d})),!h&&Object(a.createElement)(b.PanelColorSettings,{title:Object(o.__)("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:t.color,onChange:j,label:Object(o.__)("Button Background Color","jetpack")},{value:y.color,onChange:v,label:Object(o.__)("Button Text Color","jetpack")},{value:n.color,onColorChange:function(e){g({borderColor:e,customBorderColor:e})},label:Object(o.__)("Border Color","jetpack")}],initialOpen:!1},Object(a.createElement)(b.ContrastChecker,{fontSize:m.size,textColor:y.color,backgroundColor:u.color,fallbackButtonBackgroundColor:p,fallbackTextColor:d})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Text Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},Object(a.createElement)(b.FontSizePicker,{withSlider:!0,value:m.size,onChange:function(e){var t=e||x;g({fontSize:t,customFontSize:t})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Border Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},Object(a.createElement)(c.RangeControl,{value:i,label:Object(o.__)("Border Radius","jetpack"),min:0,max:50,initialPosition:0,allowReset:!0,onChange:function(e){return g({borderRadius:e})}}),Object(a.createElement)(c.RangeControl,{value:l,label:Object(o.__)("Border Weight","jetpack"),min:0,max:15,initialPosition:1,allowReset:!0,onChange:function(e){return g({borderWeight:e})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Spacing Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},Object(a.createElement)(c.RangeControl,{value:f,label:Object(o.__)("Space Inside","jetpack"),min:5,max:50,initialPosition:15,allowReset:!0,onChange:function(e){return g({padding:e})}}),Object(a.createElement)(c.RangeControl,{value:k,label:Object(o.__)("Space Between","jetpack"),min:0,max:50,initialPosition:10,allowReset:!0,onChange:function(e){return g({spacing:e})}}),Object(a.createElement)(S.a,{width:E,onChange:function(e){return g({buttonWidth:e})}})),Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Display Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Show subscriber count","jetpack"),checked:O,onChange:function(){g({showSubscribersTotal:!O})},help:function(){if(!_||_<1)return Object(o.__)("This will remain hidden on your website until you have at least one subscriber.","jetpack")}}),Object(a.createElement)(c.ToggleControl,{label:Object(o.__)("Place button on new line","jetpack"),checked:s,onChange:function(){g({buttonOnNewLine:!s})}})))}var A=window.getComputedStyle,T=!!b.__experimentalUseGradient,P=Object(c.withFallbackStyles)((function(e,t){var n=t.buttonBackgroundColor,r=t.textColor,a=n&&n.color,o=r&&r.color,c=e.querySelector(".wp-block-jetpack-subscriptions__button");return{fallbackButtonBackgroundColor:a||!e?void 0:c&&A(c).backgroundColor,fallbackTextColor:o||!e?void 0:c&&A(c).color}}));var I=Object(w.compose)([Object(b.withColors)({emailFieldBackgroundColor:"backgroundColor"},{buttonBackgroundColor:"backgroundColor"},{textColor:"color"},"borderColor"),Object(b.withFontSizes)("fontSize"),P])((function(e){var t,n,r,s=e.className,u=e.attributes,p=e.setAttributes,m=e.emailFieldBackgroundColor,h=e.buttonBackgroundColor,g=e.setButtonBackgroundColor,j=e.fallbackButtonBackgroundColor,v=e.textColor,k=e.fallbackTextColor,y=e.setTextColor,w=e.borderColor,S=e.fontSize,A=Object(C.a)(i,u);Object(l.isEqual)(A,u)||p(A);var P,I,M=A.borderRadius,R=A.borderWeight,B=A.buttonWidth,L=A.padding,D=A.spacing,F=A.submitButtonText,z=A.subscribePlaceholder,U=A.showSubscribersTotal,V=A.buttonOnNewLine,G=Object(a.useState)(""),H=_()(G,2),q=H[0],W=H[1],$=Object(a.useState)(""),K=_()($,2),Z=K[0],Y=K[1],J=T?Object(b.__experimentalUseGradient)({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}):{},X=T?Object(b.__experimentalUseGradient)({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}):{},Q=(t={"no-border-radius":0===M},O()(t,S.class,S.class),O()(t,"has-text-color",v.color),O()(t,v.class,v.class),t),ee=d()(d()({},Q),{},(n={"has-background":m.color||J.gradientValue},O()(n,m.class,!J.gradientValue&&m.class),O()(n,J.gradientClass,J.gradientClass),n)),te=d()(d()({},Q),{},(r={"has-background":h.color||X.gradientValue},O()(r,h.class,!X.gradientValue&&h.class),O()(r,X.gradientClass,X.gradientClass),r)),ne=function(e){return e||10},re={color:v.color,borderColor:w.color,borderRadius:M?M+"px":"0px",borderWidth:R?R+"px":"1px",fontSize:S.size?S.size:x,padding:(P=L,I=P||15,I+"px "+Math.round(1.5*I)+"px "+I+"px "+Math.round(1.5*I)+"px")},ae=d()(d()({},re),!m.color&&J.gradientValue?{background:J.gradientValue}:{backgroundColor:m.color}),oe=d()(d()(d()(d()({},re),!h.color&&X.gradientValue?{background:X.gradientValue}:{backgroundColor:h.color}),V?{marginTop:ne(D)+"px"}:{marginLeft:ne(D)+"px"}),{},{width:B});return Object(a.useEffect)((function(){E()({path:"/wpcom/v2/subscribers/count"}).then((function(e){e.hasOwnProperty("count")?(W(Object(o.sprintf)(Object(o._n)("Join %s other subscriber","Join %s other subscribers",e.count,"jetpack"),e.count)),Y(e.count)):(W(Object(o.__)("Subscriber count unavailable","jetpack")),Y(0))}))}),[]),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(b.InspectorControls,null,Object(a.createElement)(N,{buttonBackgroundColor:h,borderColor:w,buttonGradient:X,borderRadius:M,borderWeight:R,buttonOnNewLine:V,emailFieldBackgroundColor:m,fallbackButtonBackgroundColor:j,fallbackTextColor:k,fontSize:S,isGradientAvailable:T,padding:L,setAttributes:p,setButtonBackgroundColor:g,setTextColor:y,showSubscribersTotal:U,spacing:D,subscriberCount:Z,textColor:v,buttonWidth:B})),Object(a.createElement)("div",{className:f()(s,"wp-block-jetpack-subscriptions__supports-newline",V?"wp-block-jetpack-subscriptions__use-newline":void 0,U?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form"},Object(a.createElement)(c.TextControl,{placeholder:z,disabled:!0,className:f()(ee,"wp-block-jetpack-subscriptions__textfield"),style:ae}),Object(a.createElement)(b.RichText,{className:f()(te,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:function(e){return p({submitButtonText:e})},style:oe,value:F,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),U&&Object(a.createElement)("p",{className:"wp-block-jetpack-subscriptions__subscount"},q)))}));var M=n(16),R=Object(a.createElement)(c.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(c.Rect,{x:"4.75",y:"6.75",width:"14.5",height:"10.5",rx:"1.25",stroke:Object(M.a)(),strokeWidth:"1.5",fill:"none"}),Object(a.createElement)(c.Path,{d:"M19 7L13.3609 12.2363C12.5935 12.9489 11.4065 12.9489 10.6391 12.2363L5 7",stroke:Object(M.a)(),strokeWidth:"1.5",strokeLinejoin:"bevel",fill:"none"})),B={title:Object(o.__)("Subscription Form","jetpack"),description:Object(a.createElement)("p",null,Object(o.__)("A form enabling readers to get notifications when new posts are published from this site.","jetpack")),icon:{src:R,foreground:Object(M.a)()},category:"grow",keywords:[Object(o._x)("subscribe","block search term","jetpack"),Object(o._x)("join","block search term","jetpack"),Object(o._x)("follow","block search term","jetpack")],attributes:i,edit:I,save:function(e){var t=e.className,n=e.attributes,r=n.subscribePlaceholder,o=n.showSubscribersTotal,c=n.buttonOnNewLine,s=n.submitButtonText,u=n.emailFieldBackgroundColor,p=n.customEmailFieldBackgroundColor,d=n.emailFieldGradient,m=n.customEmailFieldGradient,h=n.buttonBackgroundColor,g=n.customButtonBackgroundColor,j=n.buttonGradient,v=n.customButtonGradient,O=n.textColor,k=n.customTextColor,_=n.fontSize,y=n.customFontSize,E=n.borderRadius,w=n.borderWeight,C=n.borderColor,S=n.customBorderColor,N=n.padding,A=n.spacing,T=n.buttonWidth,P=!!b.__experimentalGetGradientClass,I=Object(b.getColorClassName)("color",O),M=Object(b.getFontSizeClass)(_),R=Object(b.getColorClassName)("border-color",C),B=Object(b.getColorClassName)("background-color",h),L=P?Object(b.__experimentalGetGradientClass)(j):void 0,D=Object(b.getColorClassName)("background-color",u),F=P?Object(b.__experimentalGetGradientClass)(d):void 0,z=f()(0===E?"no-border-radius":void 0,M,R),U=f()(z,O?"has-text-color":void 0,I,h||j?"has-background":void 0,B,L),V=f()(z,D,F),G=!D&&m?m:p,H=!B&&v?v:g,q=T||void 0,W={subscribe_placeholder:r!==i.subscribePlaceholder.default?r:void 0,show_subscribers_total:o,button_on_newline:c,submit_button_text:s!==i.submitButtonText.default?s:void 0,custom_background_emailfield_color:G,custom_background_button_color:H,custom_text_button_color:k,custom_font_size:y||x,custom_border_radius:E||0,custom_border_weight:w||1,custom_border_color:S,custom_button_width:q,custom_padding:N||15,custom_spacing:A||10,submit_button_classes:U,email_field_classes:V,show_only_email_and_button:!0},$=Object(l.reduce)(W,(function(e,t,n){return void 0===t?e:e+" ".concat(n,'="').concat(t,'"')}),"");return Object(a.createElement)("div",{className:f()(t,"wp-block-jetpack-subscriptions__supports-newline",c?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},Object(a.createElement)(a.RawHTML,null,"[jetpack_subscription_form".concat($,"]")))},example:{attributes:{}},deprecated:j};Object(r.a)("subscriptions",B)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(21),c=n.n(o),i=n(9),l=n.n(i),s=n(0),u=n(10),p=n(4),d=n.n(p),m=n(8),b=n.n(m),h=n(5),f=n.n(h),g=n(53),j=n(6),v=n(2),O=n(24),k=n(37),_=n(45),y=function(e){var t=e.attributes,n=e.setAttributes,r=t.currency,o=t.monthlyDonation,c=t.annualDonation,i=t.showCustomAmount,l=function(e,r){var a={"1 month":"monthlyDonation","1 year":"annualDonation"}[e],o=t[a];n(f()({},a,d()(d()({},o),{},{show:r})))};return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.BlockControls,null,Object(s.createElement)(v.ToolbarGroup,null,Object(s.createElement)(v.ToolbarItem,null,(function(){return Object(s.createElement)(v.Dropdown,{contentClassName:"jetpack-donations__currency-popover",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(s.createElement)(v.Button,{className:"jetpack-donations__currency-toggle",icon:Object(s.createElement)(s.Fragment,null,g.a[r].symbol+" - "+r,Object(s.createElement)(v.Dashicon,{icon:"arrow-down"})),label:Object(a.__)("Change currency","jetpack"),onClick:t,onKeyDown:function(e){n||e.keyCode!==O.DOWN||(e.preventDefault(),e.stopPropagation(),t())}})},renderContent:function(e){var t=e.onClose;return Object(s.createElement)(v.MenuGroup,null,Object.keys(k.b).map((function(e){return Object(s.createElement)(v.MenuItem,{isSelected:e===r,onClick:function(){n({currency:e}),t()},key:"jetpack-donations-currency-".concat(e)},g.a[e].symbol+" - "+e)})))}})})))),Object(s.createElement)(j.InspectorControls,null,Object(s.createElement)(v.PanelBody,{title:Object(a.__)("Settings","jetpack")},Object(s.createElement)(v.ToggleControl,{checked:o.show,onChange:function(e){return l("1 month",e)},label:Object(a.__)("Show monthly donations","jetpack")}),Object(s.createElement)(v.ToggleControl,{checked:c.show,onChange:function(e){return l("1 year",e)},label:Object(a.__)("Show annual donations","jetpack")}),Object(s.createElement)(v.ToggleControl,{checked:i,onChange:function(e){return n({showCustomAmount:e})},label:Object(a.__)("Show custom amount option","jetpack")}),Object(s.createElement)(v.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(Object(_.a)())},Object(a.__)("View donation earnings","jetpack")))))},E=n(19),w=n.n(E),C=n(35),x=function(e){var t=e.className,n=void 0===t?null:t,r=e.currency,a=void 0===r?null:r,o=e.defaultValue,c=void 0===o?null:o,i=e.disabled,u=void 0!==i&&i,p=e.label,d=void 0===p?"":p,m=e.onChange,h=void 0===m?null:m,f=e.value,v=void 0===f?"":f,O=Object(s.useState)(Object(C.a)(v,a,{symbol:""})),_=l()(O,2),y=_[0],E=_[1],w=Object(s.useState)(!1),x=l()(w,2),S=x[0],N=x[1],A=Object(s.useState)(!1),T=l()(A,2),P=T[0],I=T[1],M=Object(s.useRef)(null),R=Object(s.useCallback)((function(e){if(E(e),h){var t=Object(k.e)(e,a);t&&t>=Object(k.d)(a)?(h(t),I(!1)):e&&I(!0)}}),[a,h]),B=function(){M.current&&(M.current.focus(),N(!0))};return Object(s.useEffect)((function(){M.current&&M.current.addEventListener("blur",(function(){return N(!1)}))}),[M]),Object(s.useEffect)((function(){S||y||R(Object(C.a)(c,a,{symbol:""}))}),[a,c,y,S,R]),Object(s.useEffect)((function(){S||P||E(Object(C.a)(v,a,{symbol:""}))}),[a,S,P,R,v]),Object(s.createElement)("div",{className:b()("donations__amount",n,{"has-focus":S,"has-error":P}),role:"button",tabIndex:0,onClick:B,onKeyDown:B},g.a[a].symbol,u?Object(s.createElement)("div",{className:"donations__amount-value"},Object(C.a)(v||c,a,{symbol:""})):Object(s.createElement)(j.RichText,{allowedFormats:[],"aria-label":d,keepPlaceholderOnFocus:!0,multiline:!1,onChange:function(e){return R(e)},placeholder:Object(C.a)(c,a,{symbol:""}),ref:M,value:y,withoutInteractiveFormatting:!0}))},S=function(e){var t=e.activeTab,n=e.attributes,r=e.setAttributes,o=n.currency,c=n.oneTimeDonation,i=n.monthlyDonation,p=n.annualDonation,m=n.showCustomAmount,b=n.chooseAmountText,h=n.customAmountText,g={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"},v=function(e){return n[g[t]][e]},O=function(e,a){var o=g[t],c=n[o];r(f()({},o,d()(d()({},c),{},f()({},e,a))))},_=Object(s.useState)(o),y=l()(_,2),E=y[0],C=y[1],S=Object(k.d)(o),N=Object(s.useMemo)((function(){return[10*S,30*S,200*S]}),[S]);Object(s.useEffect)((function(){E!==o&&(C(o),r({oneTimeDonation:d()(d()({},c),{},{amounts:N}),monthlyDonation:d()(d()({},i),{},{amounts:N}),annualDonation:d()(d()({},p),{},{amounts:N})}))}),[o,E,N,c,i,p,r]);var A=v("amounts"),T=Object(u.useSelect)((function(e){return e("core/rich-text").getFormatTypes()}),[]).map((function(e){return e.name})).filter((function(e){return"core/link"!==e}));return Object(s.createElement)("div",{className:"donations__tab"},Object(s.createElement)(j.RichText,{tagName:"h4",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("heading"),onChange:function(e){return O("heading",e)}}),Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:b,onChange:function(e){return r({chooseAmountText:e})}}),Object(s.createElement)("div",{className:"donations__amounts"},A.map((function(e,t){return Object(s.createElement)(x,{currency:o,defaultValue:N[t],label:Object(a.sprintf)(Object(a.__)("Tier %d","jetpack"),t+1),key:"jetpack-donations-amount-".concat(t),onChange:function(e){return function(e,t){var n=w()(A);n[t]=e,O("amounts",n)}(e,t)},value:e})}))),m&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:h,onChange:function(e){return r({customAmountText:e})}}),Object(s.createElement)(x,{currency:o,label:Object(a.__)("Custom amount","jetpack"),defaultValue:100*Object(k.d)(o),className:"donations__custom-amount",disabled:!0})),Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText,{tagName:"p",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("extraText"),onChange:function(e){return O("extraText",e)}}),Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper"},Object(s.createElement)(j.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:Object(a.__)("Write a message…","jetpack"),value:v("buttonText"),onChange:function(e){return t=e,void r({oneTimeDonation:d()(d()({},c),{},{buttonText:t}),monthlyDonation:d()(d()({},i),{},{buttonText:t}),annualDonation:d()(d()({},p),{},{buttonText:t})});var t},allowedFormats:T})))},N=n(186),A=n.n(N),T=n(62),P=(n(298),n(80));function I(e){var t=e.blockName,n=e.buttonLabel,r=e.href,a=e.icon,o=e.onClick,c=e.subtitle,i=e.title,l=e.className,u=Object(P.a)(r).autosaveAndRedirect;return Object(s.createElement)(j.Warning,{actions:r&&[Object(s.createElement)(v.Button,{href:r,onClick:function(e){e.preventDefault(),o(t),u(e)},target:"_top",isSecondary:!0,isLarge:!0},n)],className:b()(l,"jetpack-block-nudge wp-block")},Object(s.createElement)("span",{className:"jetpack-block-nudge__info"},a,Object(s.createElement)("span",{className:"jetpack-block-nudge__text-container"},Object(s.createElement)("span",{className:"jetpack-block-nudge__title"},i),c&&Object(s.createElement)("span",{className:"jetpack-block-nudge__message"},c))))}var M=n(91),R=(n(299),function(e){var t=e.blockName,n=e.url;return Object(s.createElement)(I,{className:"jetpack-stripe-nudge__banner",buttonLabel:Object(a.__)("Connect","jetpack"),icon:Object(s.createElement)(A.a,{className:"jetpack-stripe-nudge__icon",size:18,"aria-hidden":"true",role:"img",focusable:"false"}),href:n,onClick:function(){T.a.tracks.recordEvent("jetpack_editor_block_stripe_connect_click",{block:t})},title:Object(a.__)("Connect to Stripe to use this block on your site","jetpack"),subtitle:Object(a.__)("This block will be hidden from your visitors until you connect to Stripe.","jetpack")})}),B=function(e){var t=e.blockName,n=e.postId,r=e.stripeConnectUrl,a=Object(M.a)(n,r);return a?Object(s.createElement)(R,{blockName:t,url:a}):null},L=function(e){var t=e.attributes,n=e.className,r=e.products,o=e.setAttributes,c=e.shouldUpgrade,i=e.stripeConnectUrl,p=t.oneTimeDonation,m=t.monthlyDonation,h=t.annualDonation,f=Object(s.useState)("one-time"),g=l()(f,2),j=g[0],v=g[1],O=Object(u.useSelect)((function(e){return e("core/editor").getCurrentPostId()}),[]),k=Object(s.useCallback)((function(e){return j===e}),[j]),_=d()(d()({"one-time":{title:Object(a.__)("One-Time","jetpack")}},m.show&&{"1 month":{title:Object(a.__)("Monthly","jetpack")}}),h.show&&{"1 year":{title:Object(a.__)("Yearly","jetpack")}});return Object(s.useEffect)((function(){p.planId===r["one-time"]&&m.planId===r["1 month"]&&h.planId===r["1 year"]||o({oneTimeDonation:d()(d()({},p),{},{planId:r["one-time"]}),monthlyDonation:d()(d()({},m),{},{planId:r["1 month"]}),annualDonation:d()(d()({},h),{},{planId:r["1 year"]})})}),[p,m,h,o,r]),Object(s.useEffect)((function(){!m.show&&k("1 month")&&v("one-time"),!h.show&&k("1 year")&&v("one-time")}),[m,h,v,k]),Object(s.createElement)("div",{className:n},!c&&i&&Object(s.createElement)(B,{blockName:"donations",postId:O,stripeConnectUrl:i}),Object(s.createElement)("div",{className:"donations__container"},Object.keys(_).length>1&&Object(s.createElement)("div",{className:"donations__nav"},Object.entries(_).map((function(e){var t=l()(e,2),n=t[0],r=t[1].title;return Object(s.createElement)("div",{role:"button",tabIndex:0,className:b()("donations__nav-item",{"is-active":k(n)}),onClick:function(){return v(n)},onKeyDown:function(){return v(n)},key:"jetpack-donations-nav-item-".concat(n," ")},r)}))),Object(s.createElement)("div",{className:"donations__content"},Object(s.createElement)(S,{activeTab:j,attributes:t,setAttributes:o}))),Object(s.createElement)(y,e))},D=function(e){var t=e.className,n=e.error;return Object(s.createElement)(v.Placeholder,{icon:"lock",label:Object(a.__)("Donations","jetpack"),instructions:n,className:t})},F=n(26),z=n.n(F),U=n(22),V=n.n(U),G=function(){var e=z()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,V()({path:"/wpcom/v2/memberships/products",method:"POST",data:{type:"donation",currency:t}});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0.message));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(_x){return e.apply(this,arguments)}}(),H=n(39),q=n(27),W=function(){var e=z()(regeneratorRuntime.mark((function e(){var t,n,r,a,o,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:null,n=Object(H.parse)(window.location.href,!0),r=n.query,a=Object(q.addQueryArgs)("/wpcom/v2/memberships/status",d()({source:"https://wordpress.com"===r.origin?"gutenberg-wpcom":"gutenberg"},t&&{type:t})),e.prev=3,e.next=6,V()({path:a,method:"GET"});case 6:return o=e.sent,e.abrupt("return",o);case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject(e.t0.message));case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}(),$=function(e){var t=e.attributes,n=e.className,r=e.setAttributes,o=t.currency,i=Object(s.useState)(""),p=l()(i,2),d=p[0],m=p[1],b=Object(s.useState)(!1),h=l()(b,2),f=h[0],g=h[1],j=Object(s.useState)(!1),v=l()(j,2),O=v[0],k=v[1],_=Object(s.useState)([]),y=l()(_,2),E=y[0],w=y[1],C=Object(u.useSelect)((function(e){return e("core/editor").getCurrentPost()}),[]);Object(s.useEffect)((function(){r({fallbackLinkUrl:C.link})}),[C.link,r]);var x=function(e){m(e)},S=function(e){return e.reduce((function(e,t){var n=t.id,r=t.currency,a=t.type,c=t.interval;return r===o&&"donation"===a&&(e[c]=n),e}),{})},N=function(e){if(!e&&"object"!=typeof e||e.errors)m(Object(a.__)("Could not load data from WordPress.com.","jetpack"));else{g(e.should_upgrade_to_access_memberships),k(e.connect_url);var t,n,r=S(e.products);if(t=r,(n=Object.keys(t)).includes("one-time")&&n.includes("1 month")&&n.includes("1 year"))w(r);else e.should_upgrade_to_access_memberships||e.connect_url?w({"one-time":-1,"1 month":-1,"1 year":-1}):G(o).then((function(e){return w(S(e))}),x)}};return Object(s.useEffect)((function(){W("donation").then(N,x)}),[o]),d?Object(s.createElement)(D,{className:n,error:d}):Object(s.createElement)(L,c()({},e,{products:E,shouldUpgrade:f,stripeConnectUrl:O}))},K=function(e){var t=e.attributes,n=t.fallbackLinkUrl,r=t.oneTimeDonation,a=t.monthlyDonation,o=t.annualDonation;return r&&r.show&&r.planId&&-1!==r.planId?Object(s.createElement)("div",null,Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:r.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:r.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:r.buttonText}),a.show&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:a.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:a.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:a.buttonText})),o.show&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)("hr",{className:"donations__separator"}),Object(s.createElement)(j.RichText.Content,{tagName:"h4",value:o.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:o.extraText}),Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:o.buttonText}))):null},Z={attributes:{currency:{type:"string",default:"USD"},oneTimeDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a one-time donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate","jetpack")}},monthlyDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a monthly donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate monthly","jetpack")}},annualDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:Object(a.__)("Make a yearly donation","jetpack"),extraText:Object(a.__)("Your contribution is appreciated.","jetpack"),buttonText:Object(a.__)("Donate yearly","jetpack")}},showCustomAmount:{type:"boolean",default:!0},chooseAmountText:{type:"string",default:Object(a.__)("Choose an amount","jetpack")},customAmountText:{type:"string",default:Object(a.__)("Or enter a custom amount","jetpack")}},supports:{html:!1},save:function(e){var t=e.attributes,n=t.currency,r=t.oneTimeDonation,o=t.monthlyDonation,c=t.annualDonation,i=t.showCustomAmount,u=t.chooseAmountText,p=t.customAmountText;if(!r||!r.show||-1===r.planId)return null;var m=d()(d()({"one-time":{title:Object(a.__)("One-Time","jetpack")}},o.show&&{"1 month":{title:Object(a.__)("Monthly","jetpack")}}),c.show&&{"1 year":{title:Object(a.__)("Yearly","jetpack")}});return Object(s.createElement)("div",null,Object(s.createElement)("div",{className:"donations__container"},Object.keys(m).length>1&&Object(s.createElement)("div",{className:"donations__nav"},Object.entries(m).map((function(e){var t=l()(e,2),n=t[0],r=t[1].title;return Object(s.createElement)("div",{role:"button",tabIndex:0,className:"donations__nav-item",key:"jetpack-donations-nav-item-".concat(n," "),"data-interval":n},r)}))),Object(s.createElement)("div",{className:"donations__content"},Object(s.createElement)("div",{className:"donations__tab"},Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__one-time-item",value:r.heading}),o.show&&Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__monthly-item",value:o.heading}),c.show&&Object(s.createElement)(j.RichText.Content,{tagName:"h4",className:"donations__annual-item",value:c.heading}),Object(s.createElement)(j.RichText.Content,{tagName:"p",value:u}),Object(s.createElement)("div",{className:"donations__amounts donations__one-time-item"},r.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),o.show&&Object(s.createElement)("div",{className:"donations__amounts donations__monthly-item"},o.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),c.show&&Object(s.createElement)("div",{className:"donations__amounts donations__annual-item"},c.amounts.map((function(e){return Object(s.createElement)("div",{className:"donations__amount","data-amount":e},Object(C.a)(e,n))}))),i&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(j.RichText.Content,{tagName:"p",value:p}),Object(s.createElement)("div",{className:"donations__amount donations__custom-amount"},g.a[n].symbol,Object(s.createElement)("div",{className:"donations__amount-value","data-currency":n,"data-empty-text":Object(C.a)(100*Object(k.d)(n),n,{symbol:""})}))),Object(s.createElement)("div",{className:"donations__separator"},"——"),Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__one-time-item",value:r.extraText}),o.show&&Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__monthly-item",value:o.extraText}),c.show&&Object(s.createElement)(j.RichText.Content,{tagName:"p",className:"donations__annual-item",value:c.extraText}),Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__one-time-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__one-time-item",value:r.buttonText})),o.show&&Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__monthly-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__monthly-item",value:o.buttonText})),c.show&&Object(s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__annual-item"},Object(s.createElement)(j.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__annual-item",value:c.buttonText}))))))}},Y=n(33),J=(n(300),{title:Object(a.__)("Donations","jetpack"),description:Object(a.__)("Collect one-time, monthly, or annually recurring donations.","jetpack"),icon:Y.c,category:"earn",keywords:[Object(a.__)("Donations","jetpack")],supports:{html:!1},edit:$,save:K,example:{},deprecated:[Z]});Object(r.a)("donations",J)},function(e,t,n){"use strict";n.r(t);var r=n(19),a=n.n(r),o=n(9),c=n.n(o),i=n(4),l=n.n(i),s=n(21),u=n.n(s),p=n(0),d=n(2),m=n(29),b=n(11),h=n(51),f=n(6),g=n(31),j=n(17),v=n(1),O=n(3),k=n(26),_=n.n(k),y=n(12),E=n.n(y),w=n(15),C=n.n(w),x=n(7),S=n.n(x),N=n(13),A=n.n(N),T=n(14),P=n.n(T),I=n(5),M=n.n(I),R=n(22),B=n.n(R),L=n(10),D=n(8),F=n.n(D),z=function(e){var t=e.text;return Object(p.createElement)("div",{className:"wp-block-embed is-loading"},Object(p.createElement)(d.Spinner,null),Object(p.createElement)("p",null,t))},U=n(27),V=function(e,t){var n=t.autoplay,r=t.controls,a=t.loop,o=t.muted,c=t.playsinline,i=t.poster,s=t.preload,u=t.seekbarColor,p=t.seekbarPlayedColor,d=t.seekbarLoadingColor;if(!e)return null;var m=l()(l()(l()(l()(l()(l()(l()(l()(l()(l()({},n&&{autoPlay:!0}),!r&&{controls:!1}),a&&{loop:!0}),o&&{muted:!0,persistVolume:!1}),c&&{playsinline:!0}),i&&{posterUrl:i}),"none"!==s&&{preloadContent:s}),""!==u&&{sbc:u}),""!==p&&{sbpc:p}),""!==d&&{sblc:d});return Object(U.addQueryArgs)("https://videopress.com/v/".concat(e),m)},G=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],H=function(e){var t=G.reduce((function(e,t){return e[t.className]=!1,e}),{"wp-has-aspect-ratio":!1});return F()(e,t)};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return H(t);var r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;var a=r.body.querySelector("iframe");if(a&&a.height&&a.width)for(var o=(a.width/a.height).toFixed(2),c=0;c<G.length;c++){var i=G[c];if(o>=i.ratio)return F()(H(t),i.className,"wp-has-aspect-ratio")}return t}n(18);var W=function(e){A()(n,e);var t=P()(n);function n(){var e;E()(this,n),e=t.apply(this,arguments),M()(S()(e),"handleChangeSeekbarColor",(function(t){e.setState({seekbarColor:t})})),M()(S()(e),"handleChangeSeekbarLoadingColor",(function(t){e.setState({seekbarLoadingColor:t})})),M()(S()(e),"handleChangeSeekbarPlayedColor",(function(t){e.setState({seekbarPlayedColor:t})})),M()(S()(e),"saveColors",(function(){var t=e.state,n=t.seekbarColor,r=t.seekbarLoadingColor,a=t.seekbarPlayedColor;(0,e.props.setAttributes)({seekbarColor:n,seekbarLoadingColor:r,seekbarPlayedColor:a})}));var r=e.props.attributes,a=r.seekbarColor,o=r.seekbarPlayedColor,c=r.seekbarLoadingColor;return e.state={seekbarColor:a,seekbarPlayedColor:o,seekbarLoadingColor:c},e}return C()(n,[{key:"render",value:function(){var e=this.state,t=e.seekbarColor,n=e.seekbarPlayedColor,r=e.seekbarLoadingColor;return Object(p.createElement)(f.PanelColorSettings,{title:Object(v.__)("Progress Colors","jetpack"),initialOpen:!1,colorSettings:[{value:t,onChange:this.handleChangeSeekbarColor,label:Object(v.__)("Main","jetpack")},{value:r,onChange:this.handleChangeSeekbarLoadingColor,label:Object(v.__)("Loaded","jetpack")},{value:n,onChange:this.handleChangeSeekbarPlayedColor,label:Object(v.__)("Progress","jetpack")}]},Object(p.createElement)(d.Button,{isDefault:!0,onClick:this.saveColors},Object(v.__)("Save colors","jetpack")))}}]),n}(p.Component),$=["image"],K=function(e){var t=e.html,n=e.scripts,r=e.interactive,a=e.caption,o=e.isSelected,c=e.hideOverlay,i=e.attributes,l=e.setAttributes,s=i.align,u=i.className,m=i.videoPressClassNames,b=Object(f.useBlockProps)({className:F()("wp-block-video",u,m,M()({},"align".concat(s),s))});return Object(p.createElement)("figure",b,Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},Object(p.createElement)(d.SandBox,{html:t,scripts:n,type:m})),!r&&Object(p.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:c}),(!f.RichText.isEmpty(a)||o)&&Object(p.createElement)(f.RichText,{tagName:"figcaption",placeholder:Object(v.__)("Write caption…","jetpack"),value:a,onChange:function(e){return l({caption:e})},inlineToolbar:!0}))},Z=Object(j.createHigherOrderComponent)(Object(j.compose)([Object(L.withSelect)((function(e,t){var n=t.attributes,r=n.autoplay,a=n.controls,o=n.guid,c=n.loop,i=n.muted,l=n.playsinline,s=n.poster,u=n.preload,p=n.seekbarColor,d=n.seekbarLoadingColor,b=n.seekbarPlayedColor,h=n.src,f=e("core"),g=f.getEmbedPreview,j=f.isRequestingEmbedPreview,v=V(o,{autoplay:r,controls:a,loop:c,muted:i,playsinline:l,poster:s,preload:u,seekbarColor:p,seekbarLoadingColor:d,seekbarPlayedColor:b}),O=!!v&&g(v);return{isFetchingPreview:!!v&&j(v),isUploading:Object(m.isBlobURL)(h),preview:O,url:v}})),Object(L.withDispatch)((function(e){return{invalidateCachedEmbedPreview:function(t){e("core/data").invalidateResolution("core","getEmbedPreview",[t])}}})),j.withInstanceId,function(e){return function(t){A()(o,t);var n,r,a=P()(o);function o(){var e;return E()(this,o),e=a.apply(this,arguments),M()(S()(e),"hideOverlay",(function(){e.setState({interactive:!0})})),M()(S()(e),"setRating",_()(regeneratorRuntime.mark((function t(){var n,r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(O.get)(e.props,"attributes.id"),t.next=3,e.requestMedia(n);case 3:r=t.sent,(a=Object(O.get)(r,"jetpack_videopress.rating"))&&e.setState({rating:a});case 6:case"end":return t.stop()}}),t)})))),M()(S()(e),"fallbackToCore",(function(){e.props.setAttributes({guid:void 0}),e.setState({fallback:!0})})),M()(S()(e),"setGuid",_()(regeneratorRuntime.mark((function t(){var n,r,a,o,c,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.props,r=n.attributes,a=n.setAttributes,o=r.id){t.next=5;break}return a({guid:void 0}),t.abrupt("return");case 5:return t.prev=5,t.next=8,e.requestMedia(o);case 8:if(null!==(c=t.sent)){t.next=11;break}return t.abrupt("return");case 11:(i=Object(O.get)(c,"jetpack_videopress.guid"))?a({guid:i}):e.fallbackToCore(),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(5),e.setState({isFetchingMedia:!1}),e.fallbackToCore();case 19:case"end":return t.stop()}}),t,null,[[5,15]])})))),M()(S()(e),"requestMedia",function(){var t=_()(regeneratorRuntime.mark((function t(n){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return",null);case 2:if(null===e.state.media||e.state.lastRequestedMediaId!==n){t.next=4;break}return t.abrupt("return",e.state.media);case 4:return e.setState({isFetchingMedia:!0}),t.next=7,B()({path:"/wp/v2/media/".concat(n)}).catch((function(){return e.setState({fallback:!0}),null})).finally((function(){e.setState({isFetchingMedia:!1})}));case 7:if(r=t.sent,a=e.props.attributes.id,n===a){t.next=11;break}return t.abrupt("return",null);case 11:return e.setState({media:r,lastRequestedMediaId:n}),t.abrupt("return",r);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),M()(S()(e),"switchToEditing",(function(){e.props.setAttributes({id:void 0,guid:void 0,src:void 0})})),M()(S()(e),"onSelectPoster",(function(t){(0,e.props.setAttributes)({poster:t.url})})),M()(S()(e),"onRemovePoster",(function(){(0,e.props.setAttributes)({poster:""}),e.posterImageButton.current.focus()})),M()(S()(e),"toggleAttribute",(function(t){return function(n){e.props.setAttributes(M()({},t,n))}})),M()(S()(e),"getAutoplayHelp",(function(e){return e?Object(v.__)("Note: Autoplaying videos may cause usability issues for some visitors.","jetpack"):null})),M()(S()(e),"onChangeRating",(function(t){var n=e.props.attributes.id,r=e.state.rating;if(n&&-1!==Object(O.indexOf)(["G","PG-13","R-17","X-18"],t)){e.setState({isUpdatingRating:!0,rating:t});var a=function(){return e.setState({rating:r})};B()({path:"/wpcom/v2/videopress/meta",method:"POST",data:{id:n,rating:t}}).then((function(e){status in e&&200!==e.status&&a()})).catch((function(){return a()})).finally((function(){return e.setState({isUpdatingRating:!1})}))}})),e.state={media:null,isFetchingMedia:!1,fallback:!1,interactive:!1,rating:null,lastRequestedMediaId:null,isUpdatingRating:!1},e.posterImageButton=Object(p.createRef)(),e}return C()(o,[{key:"componentDidMount",value:(r=_()(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.attributes.guid){e.next=4;break}return e.next=4,this.setGuid();case 4:this.setRating();case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=_()(regeneratorRuntime.mark((function e(t){var n,r,a,o,c,i,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props,r=n.attributes,a=n.invalidateCachedEmbedPreview,o=n.preview,c=n.setAttributes,i=n.url,r.id===t.attributes.id){e.next=5;break}return e.next=4,this.setGuid();case 4:this.setRating();case 5:i&&i!==t.url&&a(i),o&&(l=q(o.html,F()("wp-block-embed","is-type-video","is-provider-videopress"),!0),c({videoPressClassNames:l}));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"render",value:function(){var t=this,n=this.props,r=n.attributes,a=n.instanceId,o=n.isFetchingPreview,c=n.isUploading,i=n.preview,l=n.setAttributes,s=this.state,m=s.fallback,b=s.isFetchingMedia,h=s.isUpdatingRating,g=s.interactive,j=s.rating,O=r.autoplay,k=r.caption,_=r.controls,y=r.loop,E=r.muted,w=r.playsinline,C=r.poster,x=r.preload,S="video-block__poster-image-description-".concat(a),N=Object(p.createElement)(p.Fragment,null,Object(p.createElement)(f.BlockControls,null,Object(p.createElement)(d.ToolbarGroup,null,Object(p.createElement)(d.ToolbarButton,{className:"components-icon-button components-toolbar__control",label:Object(v.__)("Edit video","jetpack"),onClick:this.switchToEditing,icon:"edit"}))),Object(p.createElement)(f.InspectorControls,null,Object(p.createElement)(d.PanelBody,{title:Object(v.__)("Video Settings","jetpack")},Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Autoplay","jetpack"),onChange:this.toggleAttribute("autoplay"),checked:O,help:this.getAutoplayHelp}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Loop","jetpack"),onChange:this.toggleAttribute("loop"),checked:y}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:E}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Playback Controls","jetpack"),onChange:this.toggleAttribute("controls"),checked:_}),Object(p.createElement)(d.ToggleControl,{label:Object(v.__)("Play Inline","jetpack"),onChange:this.toggleAttribute("playsinline"),checked:w}),Object(p.createElement)(d.SelectControl,{label:Object(v.__)("Preload","jetpack"),value:x,onChange:function(e){return l({preload:e})},options:[{value:"auto",label:Object(v._x)("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:Object(v._x)("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:Object(v._x)("None","VideoPress preload setting","jetpack")}]}),Object(p.createElement)(f.MediaUploadCheck,null,Object(p.createElement)(d.BaseControl,{className:"editor-video-poster-control",label:Object(v.__)("Poster Image","jetpack")},Object(p.createElement)(f.MediaUpload,{title:Object(v.__)("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:$,render:function(e){var n=e.open;return Object(p.createElement)(d.Button,{isDefault:!0,onClick:n,ref:t.posterImageButton,"aria-describedby":S},C?Object(v.__)("Replace image","jetpack"):Object(v.__)("Select Poster Image","jetpack"))}}),Object(p.createElement)("p",{id:S,hidden:!0},C?Object(v.sprintf)(Object(v.__)("The current poster image url is %s","jetpack"),C):Object(v.__)("There is no poster image currently selected","jetpack")),!!C&&Object(p.createElement)(d.Button,{onClick:this.onRemovePoster,isLink:!0,isDestructive:!0},Object(v.__)("Remove Poster Image","jetpack"))))),Object(p.createElement)(W,{attributes:r,setAttributes:l}),Object(p.createElement)(d.PanelBody,{title:Object(v.__)("Video File Settings","jetpack")},Object(p.createElement)(d.SelectControl,{label:Object(v._x)("Rating","The age rating for this video.","jetpack"),value:j,disabled:b||h,options:[{label:Object(v._x)("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:Object(v._x)("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:Object(v._x)("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"},{label:Object(v._x)("X",'Video rating for "Explicit" content.',"jetpack"),value:"X-18"}],onChange:this.onChangeRating}))));if(c)return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(z,{text:Object(v.__)("Uploading…","jetpack")}));if(b||o)return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(z,{text:Object(v.__)("Generating preview…","jetpack")}));if(m||!i)return Object(p.createElement)(e,this.props);var A=i.html,T=i.scripts;return Object(p.createElement)(p.Fragment,null,N,Object(p.createElement)(K,u()({},this.props,{hideOverlay:this.hideOverlay,html:A,scripts:T,interactive:g,caption:k})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),o}(p.Component)}]),"withVideoPressEdit"),Y=Object(j.createHigherOrderComponent)((function(e){return function(t){var n=t.attributes,r=(n=void 0===n?{}:n).autoplay,a=n.caption,o=n.controls,c=n.guid,i=n.loop,l=n.muted,s=n.playsinline,u=n.poster,d=n.preload,m=n.videoPressClassNames,b=n.className,h=n.align,g=n.seekbarColor,j=n.seekbarPlayedColor,v=n.seekbarLoadingColor,O=f.useBlockProps.save({className:F()("wp-block-video",b,m,M()({},"align".concat(h),h))});if(!c)return e(t);var k=V(c,{autoplay:r,controls:o,loop:i,muted:l,playsinline:s,poster:u,preload:d,seekbarColor:g,seekbarPlayedColor:j,seekbarLoadingColor:v});return Object(p.createElement)("figure",O,Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(k,"\n")),!f.RichText.isEmpty(a)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:a}))}}),"withVideoPressSave"),J=n(49);var X={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"}},support:{reusable:!1},save:function(e){var t=e.attributes,n=t.caption,r=t.guid;if(!r)return null;var a="https://videopress.com/v/".concat(r);return Object(p.createElement)("figure",{className:"wp-block-embed is-type-video is-provider-videopress"},Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(a,"\n")),!f.RichText.isEmpty(n)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:n}))},isDeprecation:!0};var Q=n(136),ee=n.n(Q),te=n(95),ne=n.n(te),re=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],ae={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsInline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"},videoPressClassNames:{type:"string"},align:{type:"wide"}},support:{reusable:!1},isEligible:function(e){var t=e.videoPressClassNames;return e.guid&&void 0===t},migrate:function(e){var t=e.className,n=e.videoPressClassNames;return l()(l()({},e),function(e,t){var n=re.reduce((function(e,t){return e[t.className]=!1,e}),{"wp-has-aspect-ratio":!1}),r=ee()(e,l()(l()({},n),{},{"wp-block-embed":!1,"is-type-video":!1,"is-provider-videopress":!1})),a=new ne.a(r),o=ee()(e,t);return a.forEach((function(e){o=o.replace(e,"")})),{className:r,videoPressClassNames:o.trim()}}(t,n))},save:function(e){var t=e.attributes,n=(t=void 0===t?{}:t).autoplay,r=t.caption,a=t.controls,o=t.guid,c=t.loop,i=t.muted,s=t.poster,u=t.preload,d=t.videoPressClassNames;if(!o)return null;var m=function(e,t){var n=t.autoplay,r=t.controls,a=t.loop,o=t.muted,c=t.poster,i=t.preload;if(!e)return null;var s=l()(l()(l()(l()(l()(l()({},n&&{autoPlay:!0}),!r&&{controls:!1}),a&&{loop:!0}),o&&{muted:!0,persistVolume:!1}),c&&{posterUrl:c}),"none"!==i&&{preloadContent:i});return Object(U.addQueryArgs)("https://videopress.com/v/".concat(e),s)}(o,{autoplay:n,controls:a,loop:c,muted:i,poster:s,preload:u});return Object(p.createElement)("figure",{className:d},Object(p.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(m,"\n")),!f.RichText.isEmpty(r)&&Object(p.createElement)(f.RichText.Content,{tagName:"figcaption",value:r}))},isDeprecation:!0},oe=n(23),ce=n(107),ie=(n(379),Object(j.createHigherOrderComponent)((function(e){return function(t){return"core/video"!==Object(f.useBlockEditContext)().name?Object(p.createElement)(e,t):Object(p.createElement)(e,u()({},t,{disableDropZone:!0,className:"no-videopress-media-placeholder"}),Object(p.createElement)(d.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Object(v.__)("Media Library","jetpack")),Object(p.createElement)(d.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Object(v.__)("Upload","jetpack")))}}),"videoPressNoPlanMediaPlaceholder")),le=function(e,t,n){var r;return"core/video"!==t.name||!n.guid||(null===(r=n.className)||void 0===r?void 0:r.indexOf("wp-block-video"))>=0||n.videoPressClassNames||(e.className=e.className.replace("wp-block-video","").trim()),e};Object(g.addFilter)("blocks.registerBlockType","jetpack/videopress",(function(e,t){if("core/video"!==t||e.isDeprecation)return e;var n=e.attributes,r=e.deprecated,o=e.edit,i=e.save,s=e.supports,u=e.transforms,p=Object(J.a)("videopress"),d=p.available,f=p.unavailableReason;return(Object(oe.c)()||Object(oe.a)())&&["missing_plan","unknown"].includes(f)&&(Object(g.addFilter)("editor.MediaPlaceholder","jetpack/videopress",ie),Object(g.addFilter)("editor.BlockListBlock","jetpack/videopress-with-has-warning-is-interactive-class-names",Object(ce.a)("core/video"))),Object(g.addFilter)("blocks.getSaveContent.extraProps","jetpack/videopress",le,20),d||["missing_plan","missing_module","unknown"].includes(f)?l()(l()({},e),{},{attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsinline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},seekbarPlayedColor:{type:"string",default:""},seekbarLoadingColor:{type:"string",default:""},seekbarColor:{type:"string",default:""},src:{type:"string"},videoPressClassNames:{type:"string"}},transforms:l()(l()({},u),{},{from:[{type:"files",isMatch:function(e){return Object(O.every)(e,(function(e){return 0===e.type.indexOf("video/")}))},priority:9,transform:function(e,t){var n=[];return e.forEach((function(e){var r=Object(b.createBlock)("core/video",{src:Object(m.createBlobURL)(e)});Object(h.mediaUpload)({filesList:[e],onFileChange:function(e){var n=c()(e,1)[0],a=n.id,o=n.url;t(r.clientId,{id:a,src:o})},allowedTypes:["video"]}),n.push(r)})),n}}]}),supports:l()(l()({},s),{},{reusable:!1}),edit:Z(o),save:Y(i),deprecated:[].concat(a()(r||[]),[{attributes:n,isEligible:function(e){return!e.guid},save:i,supports:s,isDeprecation:!0},ae,X])}):e}),5)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(6),i=n(2),l=n(8),s=n.n(l),u=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],p=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]],d=function(e){var t=e.isSelected;return Object(a.createElement)("div",{className:s()({"jetpack-contact-info-block":!0,"is-selected":t})},Object(a.createElement)(c.InnerBlocks,{allowedBlocks:u,templateLock:!1,template:p}))},m=n(25),b=(n(297),n(216),n(12)),h=n.n(b),f=n(15),g=n.n(f),j=n(7),v=n.n(j),O=n(13),k=n.n(O),_=n(14),y=n.n(_),E=function(e){var t=e.attributes,n=t.address,r=t.addressLine2,o=t.addressLine3,c=t.city,i=t.region,l=t.postal,s=t.country;return Object(a.createElement)(a.Fragment,null,n&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address1"},n),r&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address2"},r),o&&Object(a.createElement)("div",{className:"jetpack-address__address jetpack-address__address3"},o),c&&!(i||l)&&Object(a.createElement)("div",{className:"jetpack-address__city"},c),c&&(i||l)&&Object(a.createElement)("div",null,[Object(a.createElement)("span",{className:"jetpack-address__city"},c),", ",Object(a.createElement)("span",{className:"jetpack-address__region"},i)," ",Object(a.createElement)("span",{className:"jetpack-address__postal"},l)]),!c&&(i||l)&&Object(a.createElement)("div",null,[Object(a.createElement)("span",{className:"jetpack-address__region"},i)," ",Object(a.createElement)("span",{className:"jetpack-address__postal"},l)]),s&&Object(a.createElement)("div",{className:"jetpack-address__country"},s))},w=function(e){var t=e.attributes,n=t.address,r=t.addressLine2,a=t.addressLine3,o=t.city,c=t.region,i=t.postal,l=t.country,s=n?"".concat(n,","):"",u=r?"".concat(r,","):"",p=a?"".concat(a,","):"",d=o?"+".concat(o,","):"",m=c?"+".concat(c,","):"";m=i?"".concat(m,"+").concat(i):m;var b=l?"+".concat(l):"";return"https://www.google.com/maps/search/".concat(s).concat(u).concat(p).concat(d).concat(m).concat(b).replace(" ","+")},C=function(e){return[(t=e.attributes).address,t.addressLine2,t.addressLine3,t.city,t.region,t.postal,t.country].some((function(e){return""!==e}))&&Object(a.createElement)("div",{className:e.className},e.attributes.linkToGoogleMaps&&Object(a.createElement)("a",{href:w(e),target:"_blank",rel:"noopener noreferrer",title:Object(o.__)("Open address in Google Maps","jetpack")},Object(a.createElement)(E,e)),!e.attributes.linkToGoogleMaps&&Object(a.createElement)(E,e));var t},x=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).preventEnterKey=e.preventEnterKey.bind(v()(e)),e}return g()(n,[{key:"preventEnterKey",value:function(e){"Enter"!==e.key||e.preventDefault()}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.address,r=t.addressLine2,l=t.addressLine3,u=t.city,p=t.region,d=t.postal,m=t.country,b=t.linkToGoogleMaps,h=e.isSelected,f=e.setAttributes,g=[n,r,l,u,p,d,m].some((function(e){return""!==e})),j=s()({"jetpack-address-block":!0,"is-selected":h}),v=Object(a.createElement)(i.ToggleControl,{label:Object(o.__)("Link address to Google Maps","jetpack"),checked:b,onChange:function(e){return f({linkToGoogleMaps:e})}});return Object(a.createElement)("div",{className:j},!h&&g&&C(this.props),(h||!g)&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(c.PlainText,{value:n,placeholder:Object(o.__)("Street Address","jetpack"),"aria-label":Object(o.__)("Street Address","jetpack"),onChange:function(e){return f({address:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:r,placeholder:Object(o.__)("Address Line 2","jetpack"),"aria-label":Object(o.__)("Address Line 2","jetpack"),onChange:function(e){return f({addressLine2:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:l,placeholder:Object(o.__)("Address Line 3","jetpack"),"aria-label":Object(o.__)("Address Line 3","jetpack"),onChange:function(e){return f({addressLine3:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:u,placeholder:Object(o.__)("City","jetpack"),"aria-label":Object(o.__)("City","jetpack"),onChange:function(e){return f({city:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:p,placeholder:Object(o.__)("State/Province/Region","jetpack"),"aria-label":Object(o.__)("State/Province/Region","jetpack"),onChange:function(e){return f({region:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:d,placeholder:Object(o.__)("Postal/Zip Code","jetpack"),"aria-label":Object(o.__)("Postal/Zip Code","jetpack"),onChange:function(e){return f({postal:e})},onKeyDown:this.preventEnterKey}),Object(a.createElement)(c.PlainText,{value:m,placeholder:Object(o.__)("Country","jetpack"),"aria-label":Object(o.__)("Country","jetpack"),onChange:function(e){return f({country:e})},onKeyDown:this.preventEnterKey}),v))}}]),n}(a.Component),S={title:Object(o.__)("Address","jetpack"),description:Object(o.__)("Lets you add a physical address with Schema markup.","jetpack"),keywords:[Object(o._x)("location","block search term","jetpack"),Object(o._x)("direction","block search term","jetpack"),Object(o._x)("place","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),Object(a.createElement)(i.Circle,{cx:"12",cy:"9",r:"2.5"}))),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:x,save:C},N=n(68),A=n.n(N),T=function(e){var t=e.attributes.email,n=e.className;return t&&Object(a.createElement)("div",{className:n},t.split(/(\s+)/).map((function(e,t){var n=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&A.a.validate(n)?e===n?Object(a.createElement)("a",{href:"mailto:".concat(e),key:t},e):Object(a.createElement)(a.Fragment,{key:t},Object(a.createElement)("a",{href:"mailto:".concat(e),key:t},n),Object(a.createElement)(a.Fragment,null,e.slice(-(e.length-n.length)))):Object(a.createElement)(a.Fragment,{key:t},e)})))},P=function(e,t,n,r,o){var i=t.isSelected,l=t.attributes[e];return Object(a.createElement)("div",{className:"jetpack-".concat(e,i?"-block is-selected":"-block")},!i&&""!==l&&r(t),(i||""===l)&&Object(a.createElement)(c.PlainText,{value:l,placeholder:n,"aria-label":n,onChange:o}))},I=function(e){var t=e.setAttributes;return P("email",e,Object(o.__)("Email","jetpack"),T,(function(e){return t({email:e})}))},M={title:Object(o.__)("Email Address","jetpack"),description:Object(o.__)("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",Object(o._x)("message","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(i.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),category:"grow",attributes:{email:{type:"string",default:""}},edit:I,save:T,parent:["jetpack/contact-info"]};var R=function(e){var t=e.attributes.phone,n=e.className;return t&&Object(a.createElement)("div",{className:n},function(e){var t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;var n=e.indexOf(t[0]),r=n?e.substring(n-1):e,o=n?e.substring(0,n):"",c=r.replace(/\D/g,"");return/[0-9/+/(]/.test(r[0])?(o=o.slice(0,-1),"+"===r[0]&&(c="+"+c)):r=r.substring(1),[o.trim()?Object(a.createElement)("span",{key:"phonePrefix",className:"phone-prefix"},o):null,Object(a.createElement)("a",{key:"phoneNumber",href:"tel:".concat(c)},r)]}(t))},B=function(e){var t=e.setAttributes;return P("phone",e,Object(o.__)("Phone number","jetpack"),R,(function(e){return t({phone:e})}))},L={title:Object(o.__)("Phone Number","jetpack"),description:Object(o.__)("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[Object(o._x)("mobile","block search term","jetpack"),Object(o._x)("telephone","block search term","jetpack"),Object(o._x)("cell","block search term","jetpack")],icon:Object(m.a)(Object(a.createElement)(i.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:B,save:R},D=n(16),F=Object(m.a)(Object(a.createElement)(i.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 9c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm6 10H6v-1.53c0-2.5 3.97-3.58 6-3.58s6 1.08 6 3.58V18zm-9.69-2h7.38c-.69-.56-2.38-1.12-3.69-1.12s-3.01.56-3.69 1.12z"})),z={title:Object(o.__)("Contact Info","jetpack"),description:Object(o.__)("Lets you add an email address, phone number, and physical address with improved markup for better SEO results.","jetpack"),keywords:[Object(o._x)("email","block search term","jetpack"),Object(o._x)("phone","block search term","jetpack"),Object(o._x)("address","block search term","jetpack")],icon:{src:F,foreground:Object(D.a)()},category:"grow",supports:{align:["wide","full"],html:!1},attributes:{},edit:d,save:function(e){var t=e.className;return Object(a.createElement)("div",{className:t},Object(a.createElement)(c.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"jetpack/email",attributes:{email:"hello@yourjetpack.blog"}},{name:"jetpack/phone",attributes:{phone:"123-456-7890"}},{name:"jetpack/address",attributes:{address:"987 Photon Drive",city:"Speedyville",region:"CA",postal:"12345",country:"USA"}}]}},U=[{name:"address",settings:S},{name:"email",settings:M},{name:"phone",settings:L}];Object(r.a)("contact-info",z,U)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(38),o=n(12),c=n.n(o),i=n(15),l=n.n(i),s=n(7),u=n.n(s),p=n(13),d=n.n(p),m=n(14),b=n.n(m),h=n(5),f=n.n(h),g=n(0),j=n(22),v=n.n(j),O=n(1),k=n(2),_=n(6),y=(n(308),n(19)),E=n.n(y),w=n(8),C=n.n(w),x=n(3),S=n(24),N=n(17);function A(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=[],r=0;r<e.length;r++){var a=e[r],o=a.keywords,c=void 0===o?[]:o;if("string"==typeof a.label&&(c=[].concat(E()(c),[a.label])),n.push(a),n.length===t)break}return n}var T=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"select",(function(t){(e.props.completer.getOptionCompletion||{})(t),e.reset()})),f()(u()(e),"reset",(function(){e.setState(e.constructor.getInitialState())})),f()(u()(e),"onChange",(function(t){var n=e.props.completer,r=e.state.options;if(t){n&&(n.isDebounced?e.debouncedLoadOptions(n,t):e.loadOptions(n,t));var a=n?A(r):[];n&&e.setState({selectedIndex:0,filteredOptions:a,query:t})}else e.reset()})),f()(u()(e),"onKeyDown",(function(t){var n=e.state,r=n.isOpen,a=n.selectedIndex,o=n.filteredOptions;if(r){var c;switch(t.keyCode){case S.UP:c=(0===a?o.length:a)-1,e.setState({selectedIndex:c});break;case S.DOWN:c=(a+1)%o.length,e.setState({selectedIndex:c});break;case S.ENTER:e.select(o[a]);break;case S.LEFT:case S.RIGHT:case S.ESCAPE:return void e.reset();default:return}t.preventDefault(),t.stopPropagation()}})),e.debouncedLoadOptions=Object(x.debounce)(e.loadOptions,250),e.state=e.constructor.getInitialState(),e}return l()(n,[{key:"componentWillUnmount",value:function(){this.debouncedLoadOptions.cancel()}},{key:"handleFocusOutside",value:function(){this.reset()}},{key:"loadOptions",value:function(e,t){var n=this,r=e.options,a=this.activePromise=Promise.resolve("function"==typeof r?r(t):r).then((function(t){var r;if(a===n.activePromise){var o=t.map((function(t,n){return{key:"".concat(n),value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[]}})),c=A(o),i=c.length===n.state.filteredOptions.length?n.state.selectedIndex:0;n.setState((r={},f()(r,"options",o),f()(r,"filteredOptions",c),f()(r,"selectedIndex",i),f()(r,"isOpen",c.length>0),r)),n.announce(c)}}))}},{key:"announce",value:function(e){var t=this.props.debouncedSpeak;t&&(e.length?t(Object(O.sprintf)(Object(O._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,"jetpack","jetpack"),e.length),"assertive"):t(Object(O.__)("No results.","jetpack"),"assertive"))}},{key:"render",value:function(){var e=this,t=this.onChange,n=this.onKeyDown,r=this.props,a=r.children,o=r.instanceId,c=r.completer,i=this.state,l=i.selectedIndex,s=i.filteredOptions,u=(s[l]||{}).key,p=void 0===u?"":u,d=c.className,m=s.length>0,b=m?"components-autocomplete-listbox-".concat(o):null,h=m?"components-autocomplete-item-".concat(o,"-").concat(p):null;return Object(g.createElement)("div",{className:"components-autocomplete"},a({isExpanded:m,listBoxId:b,activeId:h,onChange:t,onKeyDown:n}),m&&Object(g.createElement)(k.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0},Object(g.createElement)("div",{id:b,role:"listbox",className:"components-autocomplete__results"},Object(x.map)(s,(function(t,n){return Object(g.createElement)(k.Button,{key:t.key,id:"components-autocomplete-item-".concat(o,"-").concat(t.key),role:"option","aria-selected":n===l,disabled:t.isDisabled,className:C()("components-autocomplete__result",d,{"is-selected":n===l}),onClick:function(){return e.select(t)}},t.label)})))))}}],[{key:"getInitialState",value:function(){return{selectedIndex:0,query:void 0,filteredOptions:[],isOpen:!1}}}]),n}(g.Component),P=Object(N.compose)([k.withSpokenMessages,N.withInstanceId,k.withFocusOutside])(T),I=Object(O.__)("Add a marker…","jetpack"),M=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"getOptionCompletion",(function(t){var n=t.value,r={placeTitle:n.text,title:n.text,caption:n.place_name,id:n.id,coordinates:{longitude:n.geometry.coordinates[0],latitude:n.geometry.coordinates[1]}};return e.props.onAddPoint(r),n.text})),f()(u()(e),"search",(function(t){var n=e.props,r=n.apiKey,a=n.onError,o="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURI(t)+".json?access_token="+r;return new Promise((function(e,t){var n=new XMLHttpRequest;n.open("GET",o),n.onload=function(){if(200===n.status){var r=JSON.parse(n.responseText);e(r.features)}else{var o=JSON.parse(n.responseText);a(o.statusText,o.responseJSON.message),t(new Error("Mapbox Places Error"))}},n.send()}))})),f()(u()(e),"onReset",(function(){e.textRef.current.value=null})),e.textRef=Object(g.createRef)(),e.containerRef=Object(g.createRef)(),e.state={isEmpty:!0},e.autocompleter={name:"placeSearch",options:e.search,isDebounced:!0,getOptionLabel:function(e){return Object(g.createElement)("span",null,e.place_name)},getOptionKeywords:function(e){return[e.place_name]},getOptionCompletion:e.getOptionCompletion},e}return l()(n,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.containerRef.current.querySelector("input").focus()}),50)}},{key:"render",value:function(){var e=this,t=this.props.label;return Object(g.createElement)("div",{ref:this.containerRef},Object(g.createElement)(k.BaseControl,{label:t,className:"components-location-search"},Object(g.createElement)(P,{completer:this.autocompleter,onReset:this.onReset},(function(t){var n=t.isExpanded,r=t.listBoxId,a=t.activeId,o=t.onChange,c=t.onKeyDown;return Object(g.createElement)(k.TextControl,{placeholder:I,ref:e.textRef,onChange:o,"aria-expanded":n,"aria-owns":r,"aria-activedescendant":a,onKeyDown:c})}))))}}]),n}(g.Component);M.defaultProps={onError:function(){}};var R=M,B=function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.onAddPoint,r=e.onError,a=e.apiKey;return Object(g.createElement)(k.Button,{className:"component__add-point"},Object(O.__)("Add marker","jetpack"),Object(g.createElement)(k.Popover,{className:"component__add-point__popover",position:"bottom center"},Object(g.createElement)(k.Button,{className:"component__add-point__close",onClick:t},Object(g.createElement)(k.Dashicon,{icon:"no"})),Object(g.createElement)(R,{onAddPoint:n,label:Object(O.__)("Add a location","jetpack"),apiKey:a,onError:r})))}}]),n}(g.Component);B.defaultProps={onAddPoint:function(){},onClose:function(){},onError:function(){}};var L=B,D=n(155),F=(n(309),function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"onDeletePoint",(function(t){var n=parseInt(t.target.getAttribute("data-id")),r=e.props,a=r.points,o=r.onChange,c=a.slice(0);c.splice(n,1),o(c)})),e.state={selectedCell:null},e}return l()(n,[{key:"setMarkerField",value:function(e,t,n){var r=this.props,a=r.points,o=r.onChange,c=a.slice(0);c[n][e]=t,o(c)}},{key:"render",value:function(){var e=this,t=this.props.points.map((function(t,n){return Object(g.createElement)(k.PanelBody,{title:t.placeTitle,key:t.id,initialOpen:!1},Object(g.createElement)(k.TextControl,{label:"Marker Title",value:t.title,onChange:function(t){return e.setMarkerField("title",t,n)}}),Object(g.createElement)(k.TextareaControl,{label:"Marker Caption",value:t.caption,rows:"3",onChange:function(t){return e.setMarkerField("caption",t,n)}}),Object(g.createElement)(k.Button,{"data-id":n,onClick:e.onDeletePoint,className:"component__locations__delete-btn"},Object(g.createElement)(k.Dashicon,{icon:"trash",size:"15"})," Delete Marker"))}));return Object(g.createElement)("div",{className:"component__locations"},Object(g.createElement)(k.Panel,{className:"component__locations__panel"},t))}}]),n}(g.Component));F.defaultProps={points:Object.freeze([]),onChange:function(){}};var z=F,U=function(e){var t=e.attributes,n=e.setAttributes,r=e.state,o=e.setState,c=e.context,i=e.mapRef,l=e.instanceId,s=e.minHeight,u=e.removeAPIKey,p=e.updateAPIKey,d=e.setPointVisibility;return"toolbar"===c?Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.BlockAlignmentToolbar,{value:t.align,onChange:function(e){n({align:e}),setTimeout(i.current.sizeMap,0)},controls:["center","wide","full"]}),Object(g.createElement)(k.ToolbarGroup,null,Object(g.createElement)(k.ToolbarButton,{icon:a.a.markerIcon,label:Object(O.__)("Add a marker","jetpack"),onClick:d}))):Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.PanelColorSettings,{title:Object(O.__)("Colors","jetpack"),initialOpen:!0,colorSettings:[{value:t.markerColor,onChange:function(e){return n({markerColor:e})},label:Object(O.__)("Marker Color","jetpack")}]}),Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Map Settings","jetpack")},Object(g.createElement)(k.BaseControl,{label:Object(O.__)("Height in pixels","jetpack"),id:"block-jetpack-map-height-input-".concat(l)},Object(g.createElement)("input",{type:"number",id:"block-jetpack-map-height-input-".concat(l),className:"wp-block-jetpack-map__height_input",onChange:function(e){n({mapHeight:e.target.value}),e.target!==document.activeElement&&setTimeout(i.current.sizeMap,0)},onBlur:function(e){var r=t.mapHeight,a=parseInt(e.target.value,10);isNaN(a)?a=null:null==r?a=i.current.mapRef.current.offsetHeight:a<s&&(a=s),n({mapHeight:a}),setTimeout(i.current.sizeMap,0)},value:t.mapHeight||"",min:s,step:"10"})),Object(g.createElement)(k.RangeControl,{label:Object(O.__)("Zoom level","jetpack"),help:t.points.length>1&&Object(O.__)("The default zoom level cannot be changed when there are two or more markers on the map.","jetpack"),disabled:t.points.length>1,value:t.zoom,onChange:function(e){n({zoom:e}),setTimeout(i.current.updateZoom,0)},min:0,max:22}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Show street names","jetpack"),checked:t.mapDetails,onChange:function(e){return n({mapDetails:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Scroll to zoom","jetpack"),help:Object(O.__)("Allow the map to capture scrolling, and zoom in or out.","jetpack"),checked:t.scrollToZoom,onChange:function(e){return n({scrollToZoom:e})}}),Object(g.createElement)(k.ToggleControl,{label:Object(O.__)("Show Fullscreen Button","jetpack"),help:Object(O.__)("Allow your visitors to display the map in fullscreen.","jetpack"),checked:t.showFullscreenButton,onChange:function(e){return n({showFullscreenButton:e})}})),t.points.length?Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Markers","jetpack"),initialOpen:!1},Object(g.createElement)(z,{points:t.points,onChange:function(e){n({points:e})}})):null,Object(g.createElement)(k.PanelBody,{title:Object(O.__)("Mapbox Access Token","jetpack"),initialOpen:!1},Object(g.createElement)(k.TextControl,{help:"wpcom"===r.apiKeySource&&Object(g.createElement)(g.Fragment,null,Object(O.__)("You can optionally enter your own access token.","jetpack")," ",Object(g.createElement)(k.ExternalLink,{href:"https://account.mapbox.com/access-tokens/"},Object(O.__)("Find it on Mapbox","jetpack"))),label:Object(O.__)("Mapbox Access Token","jetpack"),value:r.apiKeyControl,onChange:function(e){return o({apiKeyControl:e})}}),Object(g.createElement)(k.ButtonGroup,null,Object(g.createElement)(k.Button,{type:"button",onClick:p,disabled:!r.apiKeyControl||r.apiKeyControl===r.apiKey},Object(O.__)("Update Token","jetpack")),Object(g.createElement)(k.Button,{type:"button",onClick:u,disabled:"wpcom"===r.apiKeySource,isSecondary:!0},Object(O.__)("Remove Token","jetpack")))))},V=n(191),G=n.n(V),H=n(10),q=n(42),W={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},$=function(e){d()(n,e);var t=b()(n);function n(){var e;return c()(this,n),e=t.apply(this,arguments),f()(u()(e),"addPoint",(function(t){var n=e.props,r=n.attributes,a=n.setAttributes,o=r.points,c=o.slice(0),i=!1;o.map((function(e){e.id===t.id&&(i=!0)})),i||(c.push(t),a({points:c}),e.setState({addPointVisibility:!1}))})),f()(u()(e),"setPointVisibility",(function(){e.setState({addPointVisibility:!0})})),f()(u()(e),"updateAPIKeyControl",(function(t){e.setState({apiKeyControl:t.target.value})})),f()(u()(e),"updateAPIKey",(function(){var t=e.props.noticeOperations,n=e.state.apiKeyControl;t.removeAllNotices(),n&&e.apiCall(n,"POST")})),f()(u()(e),"removeAPIKey",(function(){e.apiCall(null,"DELETE")})),f()(u()(e),"onError",(function(t,n){var r=e.props.noticeOperations;r.removeAllNotices(),r.createErrorNotice(n)})),f()(u()(e),"onMapResize",(function(t,n,r,a){var o=e.props,c=o.onResizeStop,i=o.setAttributes;c(),i({mapHeight:parseInt(e.mapRef.current.mapRef.current.offsetHeight+a.height,10)}),setTimeout(e.mapRef.current.sizeMap,0)})),e.state={addPointVisibility:!1,apiState:0},e.mapRef=Object(g.createRef)(),e}return l()(n,[{key:"apiCall",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=this.props.noticeOperations,a="/wpcom/v2/service-api-keys/mapbox",o=t?{path:a,method:n,data:{service_api_key:t}}:{path:a,method:n};this.setState({apiRequestOutstanding:!0},(function(){v()(o).then((function(t){var n=t.service_api_key,a=t.service_api_key_source;r.removeAllNotices();var o=n?2:1,c="wpcom"===a?"":n;e.setState({apiState:o,apiKey:n,apiKeyControl:c,apiKeySource:a,apiRequestOutstanding:!1})}),(function(t){var n=t.message;e.onError(null,n),e.setState({apiState:1,apiRequestOutstanding:!1})}))}))}},{key:"componentDidMount",value:function(){this.apiCall()}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.setAttributes,o=t.attributes,c=t.noticeUI,i=t.notices,l=t.isSelected,s=t.instanceId,u=t.onResizeStart,p=o.mapDetails,d=o.points,m=o.zoom,b=o.mapCenter,h=o.markerColor,f=o.preview,j=o.mapHeight,v=o.showFullscreenButton,y=this.state,E=y.addPointVisibility,w=y.apiKey,C=y.apiKeyControl,x=y.apiState,S=y.apiRequestOutstanding,N=Object(g.createElement)(g.Fragment,null,Object(g.createElement)(_.BlockControls,null,Object(g.createElement)(U,{attributes:o,setAttributes:r,state:this.state,setPointVisibility:this.setPointVisibility,context:"toolbar",mapRef:this.mapRef})),Object(g.createElement)(_.InspectorControls,null,Object(g.createElement)(U,{attributes:o,setAttributes:r,state:this.state,setState:this.setState,mapRef:this.mapRef,instanceId:s,minHeight:400,removeAPIKey:this.removeAPIKey,updateAPIKey:this.updateAPIKey}))),A=Object(g.createElement)(k.Placeholder,{icon:a.a.icon},Object(g.createElement)(k.Spinner,null)),T=Object(g.createElement)(g.Fragment,null,Object(O.__)("To use the map block, you need an Access Token.","jetpack"),Object(g.createElement)("br",null),Object(g.createElement)(k.ExternalLink,{href:"https://www.mapbox.com"},Object(O.__)("Create an account or log in to Mapbox.","jetpack")),Object(g.createElement)("br",null),Object(O.__)("Locate and copy the default access token. Then, paste it into the field below.","jetpack")),P=Object(g.createElement)(k.Placeholder,{icon:a.a.icon,label:Object(O.__)("Map","jetpack"),notices:i,instructions:T},Object(g.createElement)(g.Fragment,null,Object(g.createElement)("form",null,Object(g.createElement)("input",{type:"text",className:"components-placeholder__input",disabled:S,placeholder:Object(O.__)("Paste Token Here","jetpack"),value:C,onChange:this.updateAPIKeyControl}),Object(g.createElement)(k.Button,{isSecondary:!0,disabled:S||!C||C.length<1,onClick:this.updateAPIKey},Object(O.__)("Set Token","jetpack"))))),I=l&&d.length<=1,M=Object(q.a)(a.a.styles,o.className),R=Object(g.createElement)(g.Fragment,null,N,Object(g.createElement)("div",{className:n},Object(g.createElement)(k.ResizableBox,{size:{height:j||"auto",width:"100%"},grid:[10,10],showHandle:l,minHeight:400,enable:W,onResizeStart:u,onResizeStop:this.onMapResize},Object(g.createElement)("div",{className:"wp-block-jetpack-map__map_wrapper"},Object(g.createElement)(D.a,{ref:this.mapRef,scrollToZoom:I,showFullscreenButton:v,mapStyle:M||"default",mapDetails:p,mapHeight:j,points:d,zoom:m,mapCenter:b,markerColor:h,onSetZoom:function(e){r({zoom:e})},admin:!0,apiKey:w,onSetPoints:function(e){return r({points:e})},onSetMapCenter:function(e){return r({mapCenter:e})},onMapLoaded:function(){return e.setState({addPointVisibility:!d.length})},onMarkerClick:function(){return e.setState({addPointVisibility:!1})},onError:this.onError},l&&E&&Object(g.createElement)(L,{onAddPoint:this.addPoint,onClose:function(){return e.setState({addPointVisibility:!1})},apiKey:w,onError:this.onError,tagName:"AddPoint"})))))),B=a.a.styles.find((function(e){return e.name===M})),F=Object(g.createElement)("div",null,Object(g.createElement)("img",{alt:Object(O.__)("Map Preview","jetpack"),src:B?B.preview:G.a}));return Object(g.createElement)(g.Fragment,null,c,f&&F,!f&&0===x&&A,!f&&1===x&&P,!f&&2===x&&R)}}]),n}(g.Component),K=Object(N.compose)([k.withNotices,Object(H.withDispatch)((function(e){var t=e("core/block-editor").toggleSelection;return{onResizeStart:function(){return t(!1)},onResizeStop:function(){return t(!0)}}}))])($),Z=function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.className,r=e.mapDetails,o=e.points,c=e.zoom,i=e.mapCenter,l=e.markerColor,s=e.scrollToZoom,u=e.mapHeight,p=e.showFullscreenButton,d=Object(q.a)(a.a.styles,n),m=o.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),b=t?"align".concat(t):null;return Object(g.createElement)("div",{className:b,"data-map-style":d,"data-map-details":r,"data-points":JSON.stringify(o),"data-zoom":c,"data-map-center":JSON.stringify(i),"data-marker-color":l,"data-scroll-to-zoom":s||null,"data-map-height":u||null,"data-show-fullscreen-button":p||null},o.length>0&&Object(g.createElement)("ul",null,m))}}]),n}(g.Component),Y=n(4),J=n.n(Y),X=n(34),Q=n.n(X),ee={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"}},migrate:function(e){var t=((e.className||"").replace(/is-style-[^ ]+/,"")+" is-style-".concat(e.mapStyle)).replace(/\s+/g," ").trim(),n=(e.mapStyle,Q()(e,["mapStyle"]));return J()(J()({},n),{},{showFullscreenButton:!0,className:t})},save:function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.mapStyle,r=e.mapDetails,a=e.points,o=e.zoom,c=e.mapCenter,i=e.markerColor,l=e.scrollToZoom,s=e.mapHeight,u=a.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),p=t?"align".concat(t):null;return Object(g.createElement)("div",{className:p,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(a),"data-zoom":o,"data-map-center":JSON.stringify(c),"data-marker-color":i,"data-scroll-to-zoom":l||null,"data-map-height":s||null},a.length>0&&Object(g.createElement)("ul",null,u))}}]),n}(g.Component)},te={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"},showFullscreenButton:{type:"boolean",default:!0}},migrate:function(e){var t=((e.className||"").replace(/is-style-[^ ]+/,"")+" is-style-".concat(e.mapStyle)).replace(/\s+/g," ").trim(),n=(e.mapStyle,Q()(e,["mapStyle"]));return J()(J()({},n),{},{className:t})},save:function(e){d()(n,e);var t=b()(n);function n(){return c()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props.attributes,t=e.align,n=e.mapStyle,r=e.mapDetails,a=e.points,o=e.zoom,c=e.mapCenter,i=e.markerColor,l=e.scrollToZoom,s=e.mapHeight,u=e.showFullscreenButton,p=a.map((function(e,t){var n=e.coordinates,r=n.longitude,a="https://www.google.com/maps/search/?api=1&query="+n.latitude+","+r;return Object(g.createElement)("li",{key:t},Object(g.createElement)("a",{href:a},e.title))})),d=t?"align".concat(t):null;return Object(g.createElement)("div",{className:d,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(a),"data-zoom":o,"data-map-center":JSON.stringify(c),"data-marker-color":i,"data-scroll-to-zoom":l||null,"data-map-height":s||null,"data-show-fullscreen-button":u||null},a.length>0&&Object(g.createElement)("ul",null,p))}}]),n}(g.Component)},ne=(n(235),n(310),n(16)),re=a.a.name,ae={title:a.a.title,icon:{src:a.a.icon,foreground:Object(ne.a)()},category:a.a.category,keywords:a.a.keywords,description:a.a.description,attributes:a.a.attributes,supports:a.a.supports,styles:a.a.styles,getEditWrapperProps:function(e){var t=e.align;if(-1!==a.a.validAlignments.indexOf(t))return{"data-align":t}},edit:K,save:Z,example:a.a.example,deprecated:[te,ee]};Object(r.a)(re,ae)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(2),i="jp_pay_product",l="USD",s=[l,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"],u=n(23),p=n(16),d=n(4),m=n.n(d),b=n(12),h=n.n(b),f=n(15),g=n.n(f),j=n(7),v=n.n(j),O=n(13),k=n.n(O),_=n(14),y=n.n(_),E=n(5),w=n.n(E),C=n(8),x=n.n(C),S=n(68),N=n.n(S),A=n(3),T=n(53),P=n(17),I=n(10),M=n(6),R=n(50),B=(n(373),n(193)),L=n.n(B),D=n(194),F=n.n(D),z=function(e){var t=e.title,n=void 0===t?"":t,r=e.content,c=void 0===r?"":r,i=e.formattedPrice,l=void 0===i?"":i,s=e.multiple,u=void 0!==s&&s,p=e.featuredMediaUrl,d=void 0===p?null:p,m=e.featuredMediaTitle,b=void 0===m?null:m;return Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper"},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},d&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("figure",{className:"jetpack-simple-payments-image"},Object(a.createElement)("img",{src:d,alt:b}))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},n&&Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,n)),c&&Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,c)),l&&Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,l)),Object(a.createElement)("div",{className:"jetpack-simple-payments-purchase-box"},u&&Object(a.createElement)("div",{className:"jetpack-simple-payments-items"},Object(a.createElement)("input",{className:"jetpack-simple-payments-items-number",readOnly:!0,type:"number",value:"1"})),Object(a.createElement)("div",{className:"jetpack-simple-payments-button"},Object(a.createElement)("img",{alt:Object(o.__)("Pay with PayPal","jetpack"),src:L.a,srcSet:"".concat(F.a," 2x")}))))))},U=n(73),V=function(e){return function(t){return e({featuredMediaId:Object(A.get)(t,"id",0),featuredMediaUrl:Object(A.get)(t,"url",null),featuredMediaTitle:Object(A.get)(t,"title",null)})}},G=function(e){var t=e.featuredMediaId,n=e.featuredMediaUrl,r=e.featuredMediaTitle,i=e.setAttributes;return t?Object(a.createElement)("div",null,Object(a.createElement)(a.Fragment,null,Object(a.createElement)(M.BlockControls,null,Object(a.createElement)(c.ToolbarGroup,null,Object(a.createElement)(c.ToolbarItem,null,(function(){return Object(a.createElement)(M.MediaUpload,{onSelect:V(i),allowedTypes:["image"],value:t,render:function(e){var t=e.open;return Object(a.createElement)(U.a,{label:Object(o.__)("Edit Image","jetpack"),onClick:t})}})})),Object(a.createElement)(c.ToolbarButton,{icon:"trash",title:Object(o.__)("Remove Image","jetpack"),onClick:function(){return i({featuredMediaId:null,featuredMediaUrl:null,featuredMediaTitle:null})}}))),Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:n,alt:r})))):Object(a.createElement)(M.MediaPlaceholder,{icon:Object(a.createElement)(M.BlockIcon,{icon:"format-image"}),labels:{title:Object(o.__)("Product Image","jetpack")},accept:"image/*",allowedTypes:["image"],onSelect:V(i)})},H=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},q=function(){var e,t,n,r,a,o,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",i=null===(e=window)||void 0===e||null===(t=e.window)||void 0===t?void 0:t.navigator;return null!=i&&null!==(n=i.languages)&&void 0!==n&&n.length?i.languages[0]:null!==(r=null!==(a=null!==(o=null==i?void 0:i.userLanguage)&&void 0!==o?o:null==i?void 0:i.language)&&void 0!==a?a:null==i?void 0:i.browserLanguage)&&void 0!==r?r:c},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Object(T.b)(t),a=r.precision,o=r.symbol,c=e.toFixed(a);return n?"".concat(c," ").concat(Object(A.trimEnd)(o,".")):c},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!window.Intl||"function"!=typeof Intl.NumberFormat)return W(e,t,n);var r,a=Object(I.select)("core/block-editor").getSettings(),o=a.siteLocale,c=[o,q(),"en-US"],i={};n&&(i={style:"currency",currency:t});for(var l=0,s=c;l<s.length;l++){r=s[l];try{return Intl.NumberFormat(r,i).format(e)}catch(u){continue}}return W(e,t,n)};function K(e){var t=e.setAttributes,n=e.postLinkText;return Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Settings","jetpack"),initialOpen:!1},Object(a.createElement)(c.BaseControl,{label:Object(o.__)("Purchase link text","jetpack"),help:Object(o.__)("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},Object(a.createElement)(c.TextControl,{placeholder:Object(o.__)("Click here to purchase","jetpack"),onChange:function(e){return t({postLinkText:e})},value:n})))}var Z=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),w()(v()(e),"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),w()(v()(e),"shouldInjectPaymentAttributes",!!e.props.attributes.productId),w()(v()(e),"validateAttributes",(function(){var t=e.validatePrice(),n=e.validateTitle(),r=e.validateEmail(),a=e.validateCurrency();return t&&n&&r&&a})),w()(v()(e),"validateCurrency",(function(){var t=e.props.attributes.currency;return s.includes(t)})),w()(v()(e),"validatePrice",(function(){var t=e.props.attributes,n=t.currency,r=t.price,a=Object(T.b)(n).precision;return r&&0!==parseFloat(r)?Number.isNaN(parseFloat(r))?(e.setState({fieldPriceError:Object(o.__)("Invalid price","jetpack")}),!1):parseFloat(r)<0?(e.setState({fieldPriceError:Object(o.__)("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):H(r)>a?0===a?(e.setState({fieldPriceError:Object(o.__)("We know every penny counts, but prices in this currency can’t contain decimal values.","jetpack")}),!1):(e.setState({fieldPriceError:Object(o.sprintf)(Object(o._n)("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",a,"jetpack"),a)}),!1):(e.state.fieldPriceError&&e.setState({fieldPriceError:null}),!0):(e.setState({fieldPriceError:Object(o.__)("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),w()(v()(e),"validateEmail",(function(){var t=e.props.attributes.email;return t?N.a.validate(t)?(e.state.fieldEmailError&&e.setState({fieldEmailError:null}),!0):(e.setState({fieldEmailError:Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),t)}),!1):(e.setState({fieldEmailError:Object(o.__)("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),w()(v()(e),"validateTitle",(function(){return e.props.attributes.title?(e.state.fieldTitleError&&e.setState({fieldTitleError:null}),!0):(e.setState({fieldTitleError:Object(o.__)("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),w()(v()(e),"handleEmailChange",(function(t){e.props.setAttributes({email:t}),e.setState({fieldEmailError:null})})),w()(v()(e),"handleContentChange",(function(t){e.props.setAttributes({content:t})})),w()(v()(e),"handlePriceChange",(function(t){t=parseFloat(t),isNaN(t)?e.props.setAttributes({price:void 0}):e.props.setAttributes({price:t}),e.setState({fieldPriceError:null})})),w()(v()(e),"handleCurrencyChange",(function(t){e.props.setAttributes({currency:t})})),w()(v()(e),"handleMultipleChange",(function(t){e.props.setAttributes({multiple:!!t})})),w()(v()(e),"handleTitleChange",(function(t){e.props.setAttributes({title:t}),e.setState({fieldTitleError:null})})),w()(v()(e),"getCurrencyList",s.map((function(e){var t=Object(T.b)(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(A.trimEnd)(t,"."))}}))),w()(v()(e),"renderSettings",(function(){return Object(a.createElement)(M.InspectorControls,null,Object(a.createElement)(K,{postLinkText:e.props.attributes.postLinkText,setAttributes:e.props.setAttributes}))})),e}return g()(n,[{key:"componentDidMount",value:function(){this.injectPaymentAttributes();var e=this.props,t=e.attributes,n=e.hasPublishAction,r=e.postLinkUrl,a=e.setAttributes,c=e.isPostEditor;(!t.productId&&n||!c)&&this.saveProduct();var i=r&&r!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&a(m()(m()({},i&&{postLinkUrl:r}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.hasPublishAction,r=t.isSelected,a=t.postLinkUrl,c=t.setAttributes;Object(A.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&n&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();var i=a&&a!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&c(m()(m()({},i&&{postLinkUrl:a}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"injectPaymentAttributes",value:function(){var e=this.props,t=e.simplePayment,n=e.featuredMedia;if(this.shouldInjectPaymentAttributes&&!Object(A.isEmpty)(t)){var r=this.props,a=r.attributes,o=r.setAttributes,c=a.content,i=a.currency,l=a.email,s=a.featuredMediaId,u=a.featuredMediaUrl,p=a.featuredMediaTitle,d=a.multiple,m=a.price,b=a.title;o({content:Object(A.get)(t,["content","raw"],c),currency:Object(A.get)(t,["meta","spay_currency"],i),email:Object(A.get)(t,["meta","spay_email"],l),featuredMediaId:Object(A.get)(t,["featured_media"],s),featuredMediaUrl:Object(A.get)(n,"url",u),featuredMediaTitle:Object(A.get)(n,"title",p),multiple:Boolean(Object(A.get)(t,["meta","spay_multiple"],Boolean(d))),price:Object(A.get)(t,["meta","spay_price"],m||void 0),title:Object(A.get)(t,["title","raw"],b)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}}},{key:"toApi",value:function(){var e=this.props.attributes,t=e.content,n=e.currency,r=e.email,a=e.featuredMediaId,o=e.multiple,c=e.price,i=e.productId;return{id:i,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:c},status:i?"publish":"draft",title:e.title}}},{key:"saveProduct",value:function(){var e=this;if(!this.state.isSavingProduct){var t=this.props,n=t.attributes,r=t.setAttributes,a=n.email,c=Object(I.dispatch)("core").saveEntityRecord;this.setState({isSavingProduct:!0},(function(){c("postType",i,e.toApi()).then((function(e){return e&&r({productId:e.id}),e})).catch((function(t){if(t&&t.data){var n=t.data.key;e.setState({fieldEmailError:"spay_email"===n?Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),a):null,fieldPriceError:"spay_price"===n?Object(o.__)("Invalid price.","jetpack"):null})}})).finally((function(){e.setState({isSavingProduct:!1})}))}))}}},{key:"render",value:function(){var e=this.state,t=e.fieldEmailError,n=e.fieldPriceError,r=e.fieldTitleError,i=this.props,l=i.attributes,s=i.instanceId,u=i.isSelected,p=i.setAttributes,d=i.simplePayment,m=l.content,b=l.currency,h=l.email,f=l.featuredMediaId,g=l.featuredMediaUrl,j=l.featuredMediaTitle,v=l.multiple,O=l.price,k=l.productId,_=l.title,y=k&&Object(A.isEmpty)(d);if(!u&&y)return Object(a.createElement)("div",{className:"simple-payments__loading"},Object(a.createElement)(z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!u&&h&&O&&_&&!t&&!n&&!r)return Object(a.createElement)(z,{"aria-busy":"false",content:m,featuredMediaUrl:g,featuredMediaTitle:j,formattedPrice:$(O,b),multiple:v,title:_});var E=y?c.Disabled:"div";return Object(a.createElement)(E,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),Object(a.createElement)(G,{featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:j,setAttributes:p}),Object(a.createElement)("div",null,Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-title-error"),className:x()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:Object(o.__)("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:Object(o.__)("Item name","jetpack"),required:!0,type:"text",value:_}),Object(a.createElement)(R.a,{id:"".concat(s,"-title-error"),isError:!0},r),Object(a.createElement)(c.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:Object(o.__)("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:Object(o.__)("Describe your item in a few words","jetpack"),"aria-label":Object(o.__)("Describe your item in a few words","jetpack"),value:m}),Object(a.createElement)("div",{className:"simple-payments__price-container"},Object(a.createElement)(c.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:Object(o.__)("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:b}),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-price-error"),className:x()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":n}),label:Object(o.__)("Price","jetpack"),onChange:this.handlePriceChange,placeholder:$(0,b,!1),required:!0,step:"1",type:"number",value:O||""}),Object(a.createElement)(R.a,{id:"".concat(s,"-price-error"),isError:!0},n)),Object(a.createElement)("div",{className:"simple-payments__field-multiple"},Object(a.createElement)(c.ToggleControl,{checked:Boolean(v),label:Object(o.__)("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-email-").concat(t?"error":"help"),className:x()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":t}),label:Object(o.__)("Email","jetpack"),onChange:this.handleEmailChange,placeholder:Object(o.__)("Email","jetpack"),required:!0,type:"text",value:h}),Object(a.createElement)(R.a,{id:"".concat(s,"-email-error"),isError:!0},t),Object(a.createElement)(R.a,{id:"".concat(s,"-email-help")},Object(o.__)("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",Object(a.createElement)(c.ExternalLink,{href:"https://www.paypal.com/"},Object(o.__)("Create one on PayPal","jetpack")))))}}]),n}(a.Component),Y=Object(I.withSelect)((function(e,t){var n=e("core"),r=n.getEntityRecord,a=n.getMedia,o=e("core/editor"),c=o.isSavingPost,l=o.getCurrentPost,s=t.attributes,u=s.productId,p=s.featuredMediaId,d=u?Object(A.pick)(r("postType",i,u),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,m=l();return{hasPublishAction:!!Object(A.get)(m,["_links","wp:action-publish"]),isSaving:!!c(),simplePayment:d,featuredMedia:p?a(p):null,postLinkUrl:null==m?void 0:m.link,isPostEditor:Object.keys(l()).length>0}})),J=Object(P.compose)(Y,P.withInstanceId)(Z);var X={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:function(e){var t=e.attributes.productId;return t?Object(a.createElement)(a.RawHTML,null,'[simple-payment id="'.concat(t,'"]')):null}},Q=function(e){k()(n,e);var t=y()(n);function n(){var e;h()(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),w()(v()(e),"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),w()(v()(e),"shouldInjectPaymentAttributes",!!e.props.attributes.productId),w()(v()(e),"validateAttributes",(function(){var t=e.validatePrice(),n=e.validateTitle(),r=e.validateEmail(),a=e.validateCurrency();return t&&n&&r&&a})),w()(v()(e),"validateCurrency",(function(){var t=e.props.attributes.currency;return s.includes(t)})),w()(v()(e),"validatePrice",(function(){var t=e.props.attributes,n=t.currency,r=t.price,a=Object(T.b)(n).precision;return r&&0!==parseFloat(r)?Number.isNaN(parseFloat(r))?(e.setState({fieldPriceError:Object(o.__)("Invalid price","jetpack")}),!1):parseFloat(r)<0?(e.setState({fieldPriceError:Object(o.__)("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):H(r)>a?0===a?(e.setState({fieldPriceError:Object(o.__)("We know every penny counts, but prices in this currency can’t contain decimal values.","jetpack")}),!1):(e.setState({fieldPriceError:Object(o.sprintf)(Object(o._n)("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",a,"jetpack"),a)}),!1):(e.state.fieldPriceError&&e.setState({fieldPriceError:null}),!0):(e.setState({fieldPriceError:Object(o.__)("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),w()(v()(e),"validateEmail",(function(){var t=e.props.attributes.email;return t?N.a.validate(t)?(e.state.fieldEmailError&&e.setState({fieldEmailError:null}),!0):(e.setState({fieldEmailError:Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),t)}),!1):(e.setState({fieldEmailError:Object(o.__)("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),w()(v()(e),"validateTitle",(function(){return e.props.attributes.title?(e.state.fieldTitleError&&e.setState({fieldTitleError:null}),!0):(e.setState({fieldTitleError:Object(o.__)("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),w()(v()(e),"handleEmailChange",(function(t){e.props.setAttributes({email:t}),e.setState({fieldEmailError:null})})),w()(v()(e),"handleContentChange",(function(t){e.props.setAttributes({content:t})})),w()(v()(e),"handlePriceChange",(function(t){t=parseFloat(t),isNaN(t)?e.props.setAttributes({price:void 0}):e.props.setAttributes({price:t}),e.setState({fieldPriceError:null})})),w()(v()(e),"handleCurrencyChange",(function(t){e.props.setAttributes({currency:t})})),w()(v()(e),"handleMultipleChange",(function(t){e.props.setAttributes({multiple:!!t})})),w()(v()(e),"handleTitleChange",(function(t){e.props.setAttributes({title:t}),e.setState({fieldTitleError:null})})),w()(v()(e),"getCurrencyList",s.map((function(e){var t=Object(T.b)(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(A.trimEnd)(t,"."))}}))),w()(v()(e),"renderSettings",(function(){return Object(a.createElement)(M.InspectorControls,null,Object(a.createElement)(c.PanelBody,{title:Object(o.__)("Settings","jetpack"),initialOpen:!1},Object(a.createElement)(c.BaseControl,{label:Object(o.__)("Purchase link text","jetpack"),help:Object(o.__)("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},Object(a.createElement)(c.TextControl,{placeholder:Object(o.__)("Click here to purchase","jetpack"),onChange:function(t){return e.props.setAttributes({postLinkText:t})},value:e.props.attributes.postLinkText}))))})),e}return g()(n,[{key:"componentDidMount",value:function(){this.injectPaymentAttributes();var e=this.props,t=e.attributes,n=e.hasPublishAction,r=e.postLinkUrl,a=e.setAttributes;!t.productId&&n&&this.saveProduct();var c=r&&r!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(c||i)&&a(m()(m()({},c&&{postLinkUrl:r}),i&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.hasPublishAction,r=t.isSelected,a=t.postLinkUrl,c=t.setAttributes;Object(A.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&n&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();var i=a&&a!==this.props.attributes.postLinkUrl,l=!this.props.attributes.postLinkText;(i||l)&&c(m()(m()({},i&&{postLinkUrl:a}),l&&{postLinkText:Object(o.__)("Click here to purchase.","jetpack")}))}},{key:"injectPaymentAttributes",value:function(){var e=this.props,t=e.simplePayment,n=e.featuredMedia;if(this.shouldInjectPaymentAttributes&&!Object(A.isEmpty)(t)){var r=this.props,a=r.attributes,o=r.setAttributes,c=a.content,i=a.currency,l=a.email,s=a.featuredMediaId,u=a.featuredMediaUrl,p=a.featuredMediaTitle,d=a.multiple,m=a.price,b=a.title;o({content:Object(A.get)(t,["content","raw"],c),currency:Object(A.get)(t,["meta","spay_currency"],i),email:Object(A.get)(t,["meta","spay_email"],l),featuredMediaId:Object(A.get)(t,["featured_media"],s),featuredMediaUrl:Object(A.get)(n,"url",u),featuredMediaTitle:Object(A.get)(n,"title",p),multiple:Boolean(Object(A.get)(t,["meta","spay_multiple"],Boolean(d))),price:Object(A.get)(t,["meta","spay_price"],m||void 0),title:Object(A.get)(t,["title","raw"],b)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}}},{key:"toApi",value:function(){var e=this.props.attributes,t=e.content,n=e.currency,r=e.email,a=e.featuredMediaId,o=e.multiple,c=e.price,i=e.productId;return{id:i,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:c},status:i?"publish":"draft",title:e.title}}},{key:"saveProduct",value:function(){var e=this;if(!this.state.isSavingProduct){var t=this.props,n=t.attributes,r=t.setAttributes,a=n.email,c=Object(I.dispatch)("core").saveEntityRecord;this.setState({isSavingProduct:!0},(function(){c("postType",i,e.toApi()).then((function(e){return e&&r({productId:e.id}),e})).catch((function(t){if(t&&t.data){var n=t.data.key;e.setState({fieldEmailError:"spay_email"===n?Object(o.sprintf)(Object(o.__)("%s is not a valid email address.","jetpack"),a):null,fieldPriceError:"spay_price"===n?Object(o.__)("Invalid price.","jetpack"):null})}})).finally((function(){e.setState({isSavingProduct:!1})}))}))}}},{key:"render",value:function(){var e=this.state,t=e.fieldEmailError,n=e.fieldPriceError,r=e.fieldTitleError,i=this.props,l=i.attributes,s=i.instanceId,u=i.isSelected,p=i.setAttributes,d=i.simplePayment,m=l.content,b=l.currency,h=l.email,f=l.featuredMediaId,g=l.featuredMediaUrl,j=l.featuredMediaTitle,v=l.multiple,O=l.price,k=l.productId,_=l.title,y=k&&Object(A.isEmpty)(d);if(!u&&y)return Object(a.createElement)("div",{className:"simple-payments__loading"},Object(a.createElement)(z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!u&&h&&O&&_&&!t&&!n&&!r)return Object(a.createElement)(z,{"aria-busy":"false",content:m,featuredMediaUrl:g,featuredMediaTitle:j,formattedPrice:W(O,b),multiple:v,title:_});var E=y?c.Disabled:"div";return Object(a.createElement)(E,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),Object(a.createElement)(G,{featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:j,setAttributes:p}),Object(a.createElement)("div",null,Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-title-error"),className:x()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:Object(o.__)("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:Object(o.__)("Item name","jetpack"),required:!0,type:"text",value:_}),Object(a.createElement)(R.a,{id:"".concat(s,"-title-error"),isError:!0},r),Object(a.createElement)(c.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:Object(o.__)("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:Object(o.__)("Describe your item in a few words","jetpack"),value:m}),Object(a.createElement)("div",{className:"simple-payments__price-container"},Object(a.createElement)(c.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:Object(o.__)("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:b}),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-price-error"),className:x()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":n}),label:Object(o.__)("Price","jetpack"),onChange:this.handlePriceChange,placeholder:W(0,b,!1),required:!0,step:"1",type:"number",value:O||""}),Object(a.createElement)(R.a,{id:"".concat(s,"-price-error"),isError:!0},n)),Object(a.createElement)("div",{className:"simple-payments__field-multiple"},Object(a.createElement)(c.ToggleControl,{checked:Boolean(v),label:Object(o.__)("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),Object(a.createElement)(c.TextControl,{"aria-describedby":"".concat(s,"-email-").concat(t?"error":"help"),className:x()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":t}),label:Object(o.__)("Email","jetpack"),onChange:this.handleEmailChange,placeholder:Object(o.__)("Email","jetpack"),required:!0,type:"text",value:h}),Object(a.createElement)(R.a,{id:"".concat(s,"-email-error"),isError:!0},t),Object(a.createElement)(R.a,{id:"".concat(s,"-email-help")},Object(o.__)("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",Object(a.createElement)(c.ExternalLink,{href:"https://www.paypal.com/"},Object(o.__)("Create one on PayPal","jetpack")))))}}]),n}(a.Component),ee=Object(I.withSelect)((function(e,t){var n=e("core"),r=n.getEntityRecord,a=n.getMedia,o=e("core/editor"),c=o.isSavingPost,l=o.getCurrentPost,s=t.attributes,u=s.productId,p=s.featuredMediaId,d=u?Object(A.pick)(r("postType",i,u),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,m=l();return{hasPublishAction:!!Object(A.get)(m,["_links","wp:action-publish"]),isSaving:!!c(),simplePayment:d,featuredMedia:p?a(p):null,postLinkUrl:m.link}})),te=Object(P.compose)(ee,P.withInstanceId)(Q);var ne=Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"})),re=Object(u.c)()||Object(u.a)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/",ae={title:Object(o.__)("Pay with PayPal","jetpack"),description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),Object(a.createElement)("p",null,Object(o.__)("Good for collecting donations or payments for products and services.","jetpack")),Object(a.createElement)(c.ExternalLink,{href:re},Object(o.__)("Support reference","jetpack"))),icon:{src:ne,foreground:Object(p.a)()},category:"earn",keywords:[Object(o._x)("buy","block search term","jetpack"),Object(o._x)("commerce","block search term","jetpack"),Object(o._x)("products","block search term","jetpack"),Object(o._x)("purchase","block search term","jetpack"),Object(o._x)("sell","block search term","jetpack"),Object(o._x)("shop","block search term","jetpack"),Object(o._x)("simple","block search term","jetpack"),Object(o._x)("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:Object(o.__)("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:function(e){var t=e.named.id;if(t){var n=parseInt(t,10);return n||void 0}}}}}]},edit:te,save:function(e){var t=e.attributes,n=t.content,r=t.currency,o=t.featuredMediaUrl,c=t.featuredMediaTitle,i=t.postLinkUrl,l=t.postLinkText,s=t.price,u=t.productId,p=t.title;return u?Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper jetpack-simple-payments-".concat(u)},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},o&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("div",{className:"jetpack-simple-payments-image"},Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:o,alt:c})))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,p)),Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,n)),Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,W(s,r))),Object(a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},l)))):null},supports:{className:!1,customClassName:!1,html:!1,reusable:!1}},oe=n(195),ce=n.n(oe),ie=(n(374),Object(a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(c.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(a.createElement)(c.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}))),le=Object(u.c)()||Object(u.a)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/",se={title:Object(o.__)("Pay with PayPal","jetpack"),description:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(o.__)("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),Object(a.createElement)("p",null,Object(o.__)("Good for collecting donations or payments for products and services.","jetpack")),Object(a.createElement)(c.ExternalLink,{href:le},Object(o.__)("Support reference","jetpack"))),icon:{src:ie,foreground:Object(p.a)()},category:"earn",keywords:[Object(o._x)("buy","block search term","jetpack"),Object(o._x)("commerce","block search term","jetpack"),Object(o._x)("products","block search term","jetpack"),Object(o._x)("purchase","block search term","jetpack"),Object(o._x)("sell","block search term","jetpack"),Object(o._x)("shop","block search term","jetpack"),Object(o._x)("simple","block search term","jetpack"),Object(o._x)("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:Object(o.__)("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:function(e){var t=e.named.id;if(t){var n=parseInt(t,10);return n||void 0}}}}}]},edit:J,save:function(e){var t=e.attributes,n=t.content,r=t.currency,o=t.featuredMediaUrl,c=t.featuredMediaTitle,i=t.postLinkUrl,l=t.postLinkText,s=t.price,u=t.productId,p=t.title;return u?Object(a.createElement)("div",{className:"jetpack-simple-payments-wrapper jetpack-simple-payments-".concat(u)},Object(a.createElement)("div",{className:"jetpack-simple-payments-product"},o&&Object(a.createElement)("div",{className:"jetpack-simple-payments-product-image"},Object(a.createElement)("div",{className:"jetpack-simple-payments-image"},Object(a.createElement)("figure",null,Object(a.createElement)("img",{src:o,alt:c})))),Object(a.createElement)("div",{className:"jetpack-simple-payments-details"},Object(a.createElement)("div",{className:"jetpack-simple-payments-title"},Object(a.createElement)("p",null,p)),Object(a.createElement)("div",{className:"jetpack-simple-payments-description"},Object(a.createElement)("p",null,n)),Object(a.createElement)("div",{className:"jetpack-simple-payments-price"},Object(a.createElement)("p",null,$(s,r))),Object(a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},l)))):null},example:{attributes:{price:25,title:Object(o.__)("Jetpack t-shirt","jetpack"),content:Object(o.__)("Take flight in ultimate comfort with this stylish t-shirt featuring the Jetpack logo.","jetpack"),email:"jetpack@jetpack.com",featuredMediaUrl:ce.a}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},deprecated:[X,ae]};Object(r.a)("simple-payments",se)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(1),o=n(36),c={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string"},placeholder:{type:"string"},url:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string",validator:o.a},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:o.a},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"}},i=n(4),l=n.n(i),s=n(5),u=n.n(s),p=n(0),d=n(8),m=n.n(d),b=n(6),h=n(17),f=n(3),g=n(2),j=Object(g.withFallbackStyles)((function(e,t){var n=t.backgroundColor,r=t.textColor,a=Object(f.get)(n,"color"),o=!Object(f.get)(r,"color")&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:a||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:r||!o?void 0:getComputedStyle(o).color}})),v=!!b.__experimentalUseGradient;function O(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(p.useCallback)((function(e){return r({borderRadius:e})}),[r]);return Object(p.createElement)(g.PanelBody,{title:Object(a.__)("Border Settings","jetpack")},Object(p.createElement)(g.RangeControl,{allowReset:!0,initialPosition:5,label:Object(a.__)("Border radius","jetpack"),max:50,min:0,onChange:o,value:n}))}function k(e){var t=e.isGradientAvailable,n=e.backgroundColor,r=e.fallbackBackgroundColor,o=e.fallbackTextColor,c=e.gradientValue,i=e.setBackgroundColor,l=e.setGradient,s=e.setTextColor,u=e.textColor,d=Object(p.createElement)(b.ContrastChecker,{backgroundColor:n.color,fallbackBackgroundColor:r,fallbackTextColor:o,isLargeText:!1,textColor:u.color});return t?Object(p.createElement)(b.__experimentalPanelColorGradientSettings,{settings:[{colorValue:u.color,label:Object(a.__)("Text Color","jetpack"),onColorChange:s},{colorValue:n.color,gradientValue:c,label:Object(a.__)("Background","jetpack"),onColorChange:i,onGradientChange:l}],title:Object(a.__)("Background & Text Color","jetpack")},d):Object(p.createElement)(b.PanelColorSettings,{colorSettings:[{value:u.color,onChange:s,label:Object(a.__)("Text Color","jetpack")},{value:n.color,onChange:i,label:Object(a.__)("Background","jetpack")}],title:Object(a.__)("Background & Text Color","jetpack")},d)}var _=n(108);function y(e){var t=e.attributes,n=e.backgroundColor,r=e.fallbackBackgroundColor,a=e.fallbackTextColor,o=e.setAttributes,c=e.setBackgroundColor,i=e.setTextColor,l=e.textColor,s=e.gradientValue,u=e.setGradient,d=e.isGradientAvailable,m=t.align,b=t.borderRadius,h=t.width;return Object(p.createElement)(p.Fragment,null,Object(p.createElement)(k,{backgroundColor:n,fallbackBackgroundColor:r,fallbackTextColor:a,gradientValue:s,setBackgroundColor:c,setGradient:u,setTextColor:i,textColor:l,isGradientAvailable:d}),Object(p.createElement)(O,{borderRadius:b,setAttributes:o}),Object(p.createElement)(_.b,{align:m,width:h,onChange:function(e){return o({width:e})}}))}var E=n(10);n(263);var w=Object(h.compose)(Object(b.withColors)({backgroundColor:"background-color"},{textColor:"color"}),j)((function(e){var t,n,r,o=e.attributes,c=e.backgroundColor,i=e.className,s=e.clientId,d=e.setAttributes,h=e.textColor,g=o.align,j=o.borderRadius,O=o.element,k=o.placeholder,_=o.text,w=o.width,C=(n=g,r=Object(p.useRef)(),Object(p.useEffect)((function(){r.current=n}),[n]),r.current);!function(e){var t=e.attributes,n=e.clientId,r=e.setAttributes,a=t.passthroughAttributes,o=Object(E.useSelect)((function(e){var r=e("core/block-editor"),o=(0,r.getBlockAttributes)((0,r.getBlockRootClientId)(n))||{},c=Object(f.mapValues)(a,(function(e){return o[e]}));return{attributesToSync:Object(f.pickBy)(c,(function(e,n){return e!==t[n]}))}})).attributesToSync;Object(p.useEffect)((function(){Object(f.isEmpty)(o)||r(o)}),[o,r])}({attributes:o,clientId:s,setAttributes:d}),Object(p.useEffect)((function(){C!==g&&("left"===g||"right"===g)&&null!=w&&w.includes("%")&&d({width:void 0})}),[g,C,d,w]);var x=v?Object(b.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},S=x.gradientClass,N=x.gradientValue,A=x.setGradient,T=m()("wp-block-button",i),P=m()("wp-block-button__link",(t={"has-background":c.color||N},u()(t,c.class,!N&&c.class),u()(t,"has-text-color",h.color),u()(t,h.class,h.class),u()(t,S,S),u()(t,"no-border-radius",0===j),u()(t,"has-custom-width",!!w),t)),I=l()(l()({},!c.color&&N?{background:N}:{backgroundColor:c.color}),{},{color:h.color,borderRadius:j?j+"px":void 0,width:w});return Object(p.createElement)("div",{className:T},Object(p.createElement)(b.RichText,{allowedFormats:"input"===O?[]:void 0,className:P,disableLineBreaks:"input"===O,onChange:function(e){var t="input"===O?e.replace(/<br>/gim," "):e;d({text:t})},placeholder:k||Object(a.__)("Add text…","jetpack"),style:I,value:_,withoutInteractiveFormatting:!0}),Object(p.createElement)(b.InspectorControls,null,Object(p.createElement)(y,l()({gradientValue:N,setGradient:A,isGradientAvailable:v},e))))})),C=Object(p.createElement)(g.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(g.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"}));var x=n(58),S={title:Object(a.__)("Button","jetpack"),icon:C,category:Object(x.a)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"]},styles:[{name:"fill",label:Object(a.__)("Fill","jetpack"),isDefault:!0},{name:"outline",label:Object(a.__)("Outline","jetpack")}],attributes:c,edit:w,save:function(e){var t,n=e.attributes,r=e.blockName,a=e.uniqueId,o=n.backgroundColor,c=n.borderRadius,i=n.className,l=n.customBackgroundColor,s=n.customGradient,d=n.customTextColor,h=n.gradient,f=n.saveInPostContent,g=n.text,j=n.textColor,O=n.url,k=n.width;if(!f)return null;var _=Object(b.getColorClassName)("background-color",o),y=v?Object(b.__experimentalGetGradientClass)(h):void 0,E=Object(b.getColorClassName)("color",j),w=m()("wp-block-button","jetpack-submit-button",i,u()({},"wp-block-jetpack-".concat(r),r)),C=m()("wp-block-button__link",(t={"has-text-color":j||d},u()(t,E,E),u()(t,"has-background",o||h||l||s),u()(t,_,_),u()(t,y,y),u()(t,"no-border-radius",0===c),u()(t,"has-custom-width",!!k),t)),x={background:s||void 0,backgroundColor:_||s||h?void 0:l,color:E?void 0:d,borderRadius:c?c+"px":void 0,width:k};return Object(p.createElement)("div",{className:w},Object(p.createElement)(b.RichText.Content,{className:C,"data-id-attr":a||"placeholder",href:O,id:a,rel:"noopener noreferrer",role:"button",style:x,tagName:"a",target:"_blank",value:g}))}};Object(r.a)("button",S)},function(e,t,n){"use strict";n.r(t);var r=n(20),a=n(0),o=n(1),c=n(11),i=n(10),l=n(3),s=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],u=s.map((function(e){return e.value})),p={name:"button",label:Object(o.__)("Button (210 x 113 pixels)","jetpack")},d=function(e){return Object(l.compact)([{name:"standard",label:Object(o.__)("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:Object(o.__)("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:Object(o.__)("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&p])},m=function(e){return d(e).map((function(e){return e.name}))},b=Object(i.select)("core/block-editor").getSettings().siteLocale,h=!Object(l.isEmpty)(b)&&u.includes(b)?b:"en-US",f={rid:{default:[],type:"array"},style:{default:"standard",type:"string",validValues:m()},iframe:{default:!0,type:"boolean"},domain:{default:"com",type:"string"},lang:{default:h,type:"string",validValues:u},newtab:{default:!1,type:"boolean"},negativeMargin:{default:!1,type:"boolean"}},g={attributes:f,supports:{align:!0,html:!1},save:function(e){var t=e.attributes.rid;return Object(a.createElement)(a.Fragment,null,t.map((function(e){return Object(a.createElement)("a",{href:"https://www.opentable.com/restref/client/?rid=".concat(e)},"https://www.opentable.com/restref/client/?rid=".concat(e))})))}},j=n(4),v=n.n(j),O={attributes:f,migrate:function(e){var t=e.style,n=e.className,r="standard"===t?"":"is-style-".concat(t);return v()(v()({},e),{},{className:n?"".concat(n," ").concat(r):r})},isEligible:function(e){var t=e.style,n=e.className;return!(!t||"standard"===t)&&(!n||-1===n.indexOf("is-style-"))},save:function(e){var t=e.attributes.rid;return Object(a.createElement)("div",null,t.map((function(e){return Object(a.createElement)("a",{href:"https://www.opentable.com/restref/client/?rid=".concat(e)},"https://www.opentable.com/restref/client/?rid=".concat(e))})))}},k=n(5),_=n.n(k),y=n(9),E=n.n(y),w=(n(169),n(8)),C=n.n(w),x=n(6),S=n(2),N=(n(181),Object(a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 16",fill:"none",height:"16",width:"22"},Object(a.createElement)(S.Path,{d:"m1.997 5.982c-.39457-.00039-.7804.11622-1.108699.33511-.328295.21888-.584312.5302-.735674.89459-.15136174.36439-.1912714.76548-.1146819 1.15254.0765899.38707.2662379.74274.5449639 1.02202.278726.27929.634011.46965 1.020921.54702.38692.07732.78809.03826 1.15278-.11238.36469-.15063.67652-.40602.89606-.73387.21954-.32786.33693-.71345.33733-1.10803v-.002c.001-1.1-.89-1.994-1.992-1.995zm12.006 3.988c-.3946.0004-.7805-.11625-1.1088-.33517-.3283-.21893-.5843-.53031-.7357-.89476-.1513-.36444-.1912-.76558-.1145-1.15268s.2664-.74276.5453-1.022c.2788-.27925.6342-.46953 1.0211-.54679.387-.07725.7882-.038 1.1529.11278.3647.15079.6764.40634.8959.73432.2194.32799.3366.71369.3368 1.1083v.003c.0003.52814-.2092 1.03477-.5824 1.4085s-.8795.58397-1.4076.5845zm0-9.96999843c-1.5777-.0009886-3.1203.46588743-4.43262 1.34158843-1.31236.8757-2.33558 2.1209-2.94025 3.57813-.60467 1.45722-.76365 3.06103-.45683 4.60861.30683 1.54757 1.06567 2.96947 2.18058 4.08577 1.1149 1.1163 2.53582 1.8769 4.08302 2.1856 1.5472.3088 3.1512.1518 4.6091-.451 1.458-.6028 2.7045-1.6245 3.5819-2.9358.8773-1.3112 1.3461-2.8532 1.3471-4.4309v-.005c.0008-2.11466-.8384-4.14304-2.3331-5.63899-1.4946-1.495952-3.5222-2.3369478-5.6369-2.33800843z"}))),A=n(23),T=n(21),P=n.n(T),I=/^\s*(http[s]?:\/\/|\<script)/;function M(e){var t=Object(a.useState)(""),n=E()(t,2),r=n[0],c=n[1],i=function(e,t){var n=Object(a.useState)([]),r=E()(n,2),o=r[0],c=r[1],i=Object(a.useCallback)(Object(l.throttle)((function(){fetch("https://www.opentable.com/widget/reservation/restaurant-search?pageSize="+t+"&query="+encodeURIComponent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).then((function(e){return e.json()})).then((function(e){return c(Object(l.unionBy)(o,e.items,"rid"))}))}),500),[o]);return Object(a.useEffect)((function(){Object(l.isEmpty)(e)||I.test(e)||i(e)}),[e]),o}(r,20),s=Object(a.useState)(e.rids||[]),u=E()(s,2),p=u[0],d=u[1],m=/^(\d+)$|\(\#(\d+)\)$/,b=i.filter((function(e){return p.indexOf(e.rid.toString())<0})).map((function(e){return e.name+" (#".concat(e.rid,")")})),h=Object(a.createElement)(S.FormTokenField,P()
|