Plugin Directory

Changeset 2671597


Ignore:
Timestamp:
02/02/2022 07:35:28 PM (4 years ago)
Author:
shutterstockplugins
Message:

Release version v1.3.10

Location:
shutterstock
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shutterstock/tags/1.3.10/README.txt

    r2670796 r2671597  
    44Requires at least: 5.5
    55Tested up to: 5.9
    6 Stable tag: 1.3.9
     6Stable tag: 1.3.10
    77Requires PHP: 7.1
    88License: MIT
     
    112112
    113113== Changelog ==
     114= 1.3.10 =
     115* Update package dependencies
     116
    114117= 1.3.9 =
    115118* Update to support Wordpress 5.9
  • shutterstock/tags/1.3.10/admin/shutterstock-media-page/index.asset.php

    r2543701 r2671597  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'a6bf67079b9aa9bd04b1e92f732bc4c3');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => '15b193786b33fea16b8eeda44cdfb0e4');
  • shutterstock/tags/1.3.10/admin/shutterstock-media-page/index.css

    r2519174 r2671597  
    1 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    2 
    3 .components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
    4 
     1.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-bottom-left-radius:8px;border-top-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{height:auto;width:auto}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{position:relative;top:90px}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:auto}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{padding-bottom:5px;padding-top:1px;top:0}.components-shutterstock-ui__widget-container-overlay{background-color:rgba(0,0,0,.55);background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:60px 60px;height:100%;left:0;opacity:1;overflow:hidden;position:fixed;top:2px;top:60px;transition:opacity .1s;width:100%;z-index:111}.components-shutterstock-ui__widget-container-overlay .text{bottom:0;color:#fff!important;cursor:default;font-size:18px;height:100px;left:0;margin:auto;max-width:300px;position:absolute;right:0;text-align:center;top:0;transform:translateY(100%)}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{font-weight:700;margin-left:180px;position:absolute;top:19px;z-index:111111111}.components-shutterstock-ui__navigation a{color:#444;cursor:pointer;margin:0 10px}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media(min-width:600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden}.components-shutterstock-ui__navigation.media-page{margin-top:5px;top:0}}
     2.components-shutterstock-snackbar__container{bottom:0;display:flex;justify-content:center;left:0;margin:auto auto 20px;position:absolute;position:fixed;right:0;width:100%;z-index:11111}
    53.components-shutterstock-logo{height:24px;width:162px}.components-shutterstock-logo__stck{fill:#25282a}.components-shutterstock-logo__o,.components-shutterstock-logo__shutter{fill:#ee3625}
    6 
    7 #shutterstock-widget{position:relative}.components-shutterstock-media-page__logo{margin:20px 0 15px 0}.components-shutterstock-media-page__license-history-container{overflow:hidden scroll}.components-shutterstock-snackbar__container .components-snackbar__content{font-family:Roboto, sans-serif;font-size:13px;background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,0.3);color:#fff;padding:16px 24px;width:100%;max-width:400px;box-sizing:border-box;cursor:pointer}
    8 
     4#shutterstock-widget{position:relative}.components-shutterstock-media-page__logo{margin:20px 0 15px}.components-shutterstock-media-page__license-history-container{overflow:hidden scroll}.components-shutterstock-snackbar__container .components-snackbar__content{background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);box-sizing:border-box;color:#fff;cursor:pointer;font-family:Roboto,sans-serif;font-size:13px;max-width:400px;padding:16px 24px;width:100%}
  • shutterstock/tags/1.3.10/admin/shutterstock-media-page/index.js

    r2543701 r2671597  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function a(e){r(c,o,i,a,s,"next",e)}function s(e){r(c,o,i,a,s,"throw",e)}a(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(17),o=r(18),i=r(11),c=r(19);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t,r){var n=r(14),o=r(15),i=r(11),c=r(16);e.exports=function(e){return n(e)||o(e)||i(e)||c()}},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t,r){var n=r(10);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,r){var n=r(10);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(12),i=r.n(o),c=r(8),a=r.n(c),s=r(3),u=r.n(s),l=r(5),p=r.n(l),g=r(4),d=r.n(g),b=r(7),m=r.n(b),f=r(1),y=r(6),I=r.n(y),w=r(2),v=r(9);r(20);var h="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=function(){var e=p()(u.a.mark((function e(t){var r,n,o,i,c,a,s,l,p,g=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=g.length>1&&void 0!==g[1]?g[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,I()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,I()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,s=a.assets,a.id,a.is_editorial,l=Object.entries(s).filter((function(e){var t=m()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=m()(t,2),n=r[0],o=r[1];return j(j({},e),{},d()({},n,o))}),{}),p=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return j(j({},e),{},{details_for_image:j({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=m()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return j(j({},e),{},{formats:n})})),e.abrupt("return",p);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),L=function(){var e=p()(u.a.mark((function e(){var t,r,n,o=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,I()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=C;function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=m()(i,2),a=c[0],s=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){s(D(D({},a),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[a.show]),{snackbar:a,setSnackbar:s}},_=r(13),k=(r(21),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(_.Snackbar,null,"Shutterstock: ",t))});function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A=function(e){var t=e.item,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:r?[]:[S(S({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],item:t}}};function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(){var e=p()(u.a.mark((function e(t,r){var n,o,i,c,a,s,l,p,g,d,b,m,f,y,v,h,O,j,C,L;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,s=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(w.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,I()({path:"shutterstock/contributor/".concat(d)});case 8:y=e.sent,b=(null==y||null===(m=y.data)||void 0===m||null===(f=m[0])||void 0===f?void 0:f.display_name)||d;case 10:return e.next=12,I()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return v=e.sent,h=v.assets,e.next=16,I()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:Z({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==h?void 0:h["".concat(i,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(j=O.data,C=j.url,L=j.id,l?l&&p(Object(w.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:Z(Z({},t),{},{licensedImageUrl:C,contributorName:b,uploadedImageId:L})}),a()),n(!1)):s(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),s(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=(e.routesConfig,e.setAttributes),c=e.showSnackbar,a=e.toggleOverlay,s=e.widgetRef;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){t.history;s.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:(t=p()(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(w.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:h,onClick:function(e,t,s){e.preventDefault(),N(t,B(B({},s),{},{toggleOverlay:a,handleError:n,isMediaPage:o,setAttributes:i,showSnackbar:c,closeModal:r}))}}]}}};function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.item,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,s=e.showSnackbar,l=e.subscriptions,g=e.toggleOverlay;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[H(H({},o),{},{onClick:(t=p()(u.a.mark((function e(t,r,o){var l,p,d,b,m,f,y,v,h,O,j,C,L,M;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.subscription,e.prev=1,g(!0,Object(w.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,y=(f="editorial"===m)?null==r?void 0:r.byline:"",!b||f){e.next=12;break}return e.next=10,I()({path:"shutterstock/contributor/".concat(b)});case 10:O=e.sent,y=(null==O||null===(v=O.data)||void 0===v||null===(h=v[0])||void 0===h?void 0:h.display_name)||b;case 12:return e.next=14,I()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:H(H(H({subscription_id:null==l?void 0:l.id,size:null==l?void 0:l.size,id:r.id,description:r.description},(null==l?void 0:l.metadata)?{metadata:l.metadata}:{}),{},{contributorName:y},null==l?void 0:l.details_for_image),{},{mediaType:m,license:null==l?void 0:l.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(j=e.sent)?void 0:j.success)?(C=j.data,L=C.url,M=C.id,c?c&&s(Object(w.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:H(H({},r),{},{licensedImageUrl:L,contributorName:y,uploadedImageId:M})}),n()),g(!1)):i(j),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],item:r,subscriptions:l}}};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=/<\/?[a-z][^>]*?>/gi,Q=/\r?\n|\r/gi,V=function(e){var t=e.isMediaPage,r=e.overlayActions,n=e.shutterstock,o=e.searchBarDropdownFilters,i=e.userIsAbleToSearchEditorial,c=e.widgetRef;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:F({mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t){e.preventDefault(),c.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:r,editorialCountry:null==n?void 0:n.country,searchFilters:F({showFilterDrawer:!0,images:{orientationFilter:!0}},i?{searchBarDropdownFilters:o}:{})},t?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(v.__unstableStripHTML)("".concat(e," ").concat(t)).replace(J,"").replace(Q,"").trim()}},title:Object(w.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")})}};function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var X=function(e){var t,r,o,c,s,l=e.setAttributes,g=e.closeModal,d=e.canLicense,b=void 0!==d&&d,y=e.item,I=void 0===y?{}:y,v=e.licenseImage,O=void 0!==v&&v,j=e.subscriptions,C=void 0===j?[]:j,P=e.isMediaPage,D=void 0!==P&&P,_=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),E=Object(f.useRef)(),S=Object(f.useState)({show:!1,text:""}),T=m()(S,2),Z=T[0],N=T[1],G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return N(K(K({},Z),{},{show:e,text:t}))},B=x({timeout:5e3}),z=B.snackbar,H=B.setSnackbar,U=function(e){return H(K(K({},z),{},{show:!0,text:e}))},F=function(e){var t,r,n,o=Object(w.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);U(o),G(!1)},J={label:Object(w.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),l({img:t}),g()}},Q=D?[]:[K(K({},J),{},{icon:h})],Y=[A({item:I,commonInsertPreviewProps:J,isMediaPage:D})],X=A({item:I,commonInsertPreviewProps:J,isMediaPage:D});if(b){var $={label:Object(w.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(s=p()(u.a.mark((function e(t,r,n){var o,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,G(!0,Object(w.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,M(r.id,o);case 6:i=e.sent,E.current.navigateTo("imageLicensingPage",{item:r,subscriptions:i,searchId:r.searchId}),G(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),G(!1),F(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,11]])}))),function(e,t,r){return s.apply(this,arguments)})};Q.push(K({},$)),X.props.buttons.push(K({},$)),o=R({item:I,closeModal:g,commonLicensingProps:$,handleError:F,isMediaPage:D,licenseImage:O,setAttributes:l,showSnackbar:U,subscriptions:C,toggleOverlay:G}),c=W({closeModal:g,handleError:F,isMediaPage:D,routesConfig:Y,setAttributes:l,showSnackbar:U,toggleOverlay:G,widgetRef:E})}Object(f.useEffect)((function(){var e,t,r,n=[{label:Object(w.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(w.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],s=V({isMediaPage:D,overlayActions:Q,shutterstock:shutterstock,searchBarDropdownFilters:n,userIsAbleToSearchEditorial:_,widgetRef:E}),u=[].concat(a()(O&&o?[o]:[]),[s,X],a()(!O&&o?[o]:[]),a()(c?[c]:[])),l={container:E.current,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},pages:u};if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var p=new window.ShutterstockWidget(l);p.render({}),E.current=p}}),[]);var q=D?"media-page":"";return Object(n.createElement)(n.Fragment,null,b&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(Z.show?"disabled":""," ").concat(q)},Object(n.createElement)("a",{onClick:function(e,t){E.current.navigateTo("searchPage")}},Object(w.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=p()(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,G(!0,Object(w.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,L("images");case 4:r=e.sent,E.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:r}),G(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),G(!1),F(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()},Object(w.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:E,className:"components-shutterstock-ui__widget-container ".concat(q)}),Z.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(q)},Z.text&&Object(n.createElement)("div",{className:"text"},Z.text)),z.show&&Object(n.createElement)(k,{text:z.text}))},$=(r(22),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))});r(23);window.onload=function(){var e=shutterstock.permissions,t=void 0===e?{}:e,r=t.includes("can_user_license_all_shutterstock_images"),o=t.includes("can_user_license_shutterstock_editorial_image"),i=t.includes("can_user_license_shutterstock_photos"),c=!1;(r||o||i)&&(c=!0),Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)($,null)),Object(n.createElement)(X,{isMediaPage:!0,canLicense:c})),document.getElementById("shutterstock-widget"))}}]);
     1!function(){"use strict";var e={n:function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,{a:s}),s},d:function(t,s){for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.element,s=window.React,a=window.wp.apiFetch,i=e.n(a),o=window.wp.i18n,r=window.wp.dom,n="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";const c=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"images",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{return await i()({path:`shutterstock/images/licenses?mediaType=${e}&page=${t}`})}catch(e){throw e}};var l=window.wp.components,g=e=>{let{text:s}=e;return s&&(0,t.createElement)("div",{className:"components-shutterstock-snackbar__container"},(0,t.createElement)(l.Snackbar,null,"Shutterstock: ",s))},I=e=>{let{item:t,isMediaPage:s,commonInsertPreviewProps:a}=e;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:s?[]:[{...a,icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="}],item:t}}},m=e=>{let{closeModal:t,handleError:s,isMediaPage:a,routesConfig:r,setAttributes:l,showSnackbar:g,toggleOverlay:I,widgetRef:m}=e;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:(e,t)=>{let{history:s}=t;m.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:async e=>await c("images",e+1),licenseHistory:[],overlayActions:[{label:(0,o.__)(a?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:n,onClick:(e,r,n)=>{e.preventDefault(),(async(e,t)=>{const{toggleOverlay:s,licenseId:a,size:r,setAttributes:n,closeModal:c,handleError:l,isMediaPage:g,showSnackbar:I}=t;try{s(!0,(0,o.__)("wordpress:downloading_image","shutterstock"));const t=e?.contributor?.id;let m="";t&&(m=(await i()({path:`shutterstock/contributor/${t}`}))?.data?.[0]?.display_name||t);const{assets:d}=await i()({path:`shutterstock/images/${e.id}?mediaType=images`}),u=await i()({path:`shutterstock/images/licenses/${a}/downloads`,method:"POST",contentType:"application/json",data:{mediaType:"images",size:r,contributorName:m,imageId:e.id,description:e.description,...d?.[`${r}_jpg`]}});if(u?.success){const{url:t,id:a}=u.data;g?g&&I((0,o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(n({img:{...e,licensedImageUrl:t,contributorName:m,uploadedImageId:a}}),c()),s(!1)}else l(u)}catch(e){s(!1),l(e)}})(r,{...n,toggleOverlay:I,handleError:s,isMediaPage:a,setAttributes:l,showSnackbar:g,closeModal:t})}}]}}};const d=/<\/?[a-z][^>]*?>/gi,u=/\r?\n|\r/gi;var w=e=>{let{setAttributes:a,closeModal:l,canLicense:w=!1,item:C={},licenseImage:p=!1,subscriptions:L=[],isMediaPage:h=!1}=e;const y=shutterstock?.permissions?.includes("can_user_search_editorial_images"),M=(0,s.useRef)(),[_,b]=(0,s.useState)({show:!1,text:""}),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return b({..._,show:e,text:t})},{snackbar:k,setSnackbar:E}=(e=>{let{timeout:s=5e3,onRemoveSnackbar:a}=e;const[i,o]=(0,t.useState)({show:!1,text:""});return(0,t.useEffect)((()=>{const e=setTimeout((()=>{o({...i,show:!1,text:""}),a&&a()}),s);return()=>clearTimeout(e)}),[i.show]),{snackbar:i,setSnackbar:o}})({timeout:5e3}),A=e=>E({...k,show:!0,text:e}),S=e=>{let t=(0,o.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e?.data?.message),A(t),D(!1)},x={label:(0,o.__)("wordpress:text_insert_preview","shutterstock"),onClick:(e,t)=>{e.preventDefault(),a({img:t}),l()}},v=h?[]:[{...x,icon:n}],P=[I({item:C,commonInsertPreviewProps:x,isMediaPage:h})],T=I({item:C,commonInsertPreviewProps:x,isMediaPage:h});let Z,N;if(w){const e={label:(0,o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:async(e,t,s)=>{e.preventDefault();try{const e=t.media_type;D(!0,(0,o.__)("wordpress:text_loading_please_wait","shutterstock"));const s=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image";try{const s="editorial"===t&&shutterstock?.country?`&country=${shutterstock?.country}`:"",a=await i()({path:`shutterstock/user/subscriptions?mediaType=${t}`}),{assets:o,id:r,is_editorial:n}=await i()({path:`shutterstock/images/${e}?mediaType=${t}${s}`}),c=Object.entries(o).filter((e=>{let[t,s]=e;return s.is_licensable})).reduce(((e,t)=>{let[s,a]=t;return{...e,[s]:a}}),{});return a.map((e=>{let s=e?.formats?.filter((e=>{let{size:t,format:s}=e;return!t.match(/supersize/i)&&"tiff"!==s&&"eps"!==s&&void 0!==s})).sort(((e,t)=>e.min_resolution-t.min_resolution)).map((e=>({...e,details_for_image:{...c[`${e.size}_${e.format}`]}})));if("editorial"===t){const e=e=>({small_jpg:"small",medium_jpg:"medium",original:"original"}[e]);s=Object.entries(c||{}).map((t=>{let[s,a]=t;return{details_for_image:a,size:e(s)}}))}return{...e,formats:s}}))}catch(e){throw e}}(t.id,e);M.current.navigateTo("imageLicensingPage",{item:t,subscriptions:s,searchId:t.searchId}),D(!1)}catch(e){D(!1),S(e)}}};v.push({...e}),T.props.buttons.push({...e}),Z=(e=>{let{item:t,closeModal:s,commonLicensingProps:a,handleError:r,isMediaPage:n,setAttributes:c,showSnackbar:l,subscriptions:g,toggleOverlay:I}=e;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[{...a,onClick:async(e,t,a)=>{const{subscription:g}=a;try{I(!0,(0,o.__)("wordpress:text_licensing_image_please_wait","shutterstock"));const e=t?.contributor?.id,a=t?.media_type,m="editorial"===a;let d=m?t?.byline:"";e&&!m&&(d=(await i()({path:`shutterstock/contributor/${e}`}))?.data?.[0]?.display_name||e);const u=await i()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:{subscription_id:g?.id,size:g?.size,id:t.id,description:t.description,...g?.metadata?{metadata:g.metadata}:{},contributorName:d,...g?.details_for_image,mediaType:a,license:g?.license,country:shutterstock?.country,search_id:t.searchId}});if(u?.success){const{url:e,id:a}=u.data;n?n&&l((0,o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:{...t,licensedImageUrl:e,contributorName:d,uploadedImageId:a}}),s()),I(!1)}else r(u)}catch(e){I(!1),r(e)}}}],item:t,subscriptions:g}}})({item:C,closeModal:l,commonLicensingProps:e,handleError:S,isMediaPage:h,licenseImage:p,setAttributes:a,showSnackbar:A,subscriptions:L,toggleOverlay:D}),N=m({closeModal:l,handleError:S,isMediaPage:h,routesConfig:P,setAttributes:a,showSnackbar:A,toggleOverlay:D,widgetRef:M})}(0,s.useEffect)((()=>{const e=[{label:(0,o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:(0,o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],t=(e=>{let{isMediaPage:t,overlayActions:s,shutterstock:a,searchBarDropdownFilters:i,userIsAbleToSearchEditorial:n,widgetRef:c}=e;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:{mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:(e,t)=>{e.preventDefault(),c.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:s,editorialCountry:a?.country,searchFilters:{showFilterDrawer:!0,images:{orientationFilter:!0},...n?{searchBarDropdownFilters:i}:{}},...t?{}:{searchSuggestions:{enable:!0,textProvider:()=>{const e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return(0,r.__unstableStripHTML)(`${e} ${t}`).replace(d,"").replace(u,"").trim()}},title:(0,o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")}}}})({isMediaPage:h,overlayActions:v,shutterstock:shutterstock,searchBarDropdownFilters:e,userIsAbleToSearchEditorial:y,widgetRef:M}),s=[...p&&Z?[Z]:[],t,T,...!p&&Z?[Z]:[],...N?[N]:[]],a={container:M.current,key:shutterstock?.api_key,languageCode:shutterstock?.language,customHeaders:{"x-shutterstock-application":`Wordpress/${shutterstock?.version}`},pages:s};if("object"==typeof window&&window.ShutterstockWidget){const e=new window.ShutterstockWidget(a);e.render({}),M.current=e}}),[]);const j=h?"media-page":"";return(0,t.createElement)(t.Fragment,null,w&&(0,t.createElement)("div",{className:`components-shutterstock-ui__navigation ${_.show?"disabled":""} ${j}`},(0,t.createElement)("a",{onClick:(e,t)=>{M.current.navigateTo("searchPage")}},(0,o.__)("wordpress:text_home","shutterstock")),(0,t.createElement)("a",{className:"components-shutterstock-ui__download",onClick:async e=>{try{D(!0,(0,o.__)("wordpress:text_loading_please_wait","shutterstock"));const e=await c("images");M.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:e}),D(!1)}catch(e){D(!1),S(e)}}},(0,o.__)("wordpress:text_downloads","shutterstock"))),(0,t.createElement)("div",{ref:M,className:`components-shutterstock-ui__widget-container ${j}`}),_.show&&(0,t.createElement)("div",{className:`components-shutterstock-ui__widget-container-overlay ${j}`},_.text&&(0,t.createElement)("div",{className:"text"},_.text)),k.show&&(0,t.createElement)(g,{text:k.text}))},C=()=>(0,t.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},(0,t.createElement)("g",{className:"components-shutterstock-logo__stck"},(0,t.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),(0,t.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),(0,t.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),(0,t.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),(0,t.createElement)("g",{className:"components-shutterstock-logo__o"},(0,t.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),(0,t.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),(0,t.createElement)("g",{className:"components-shutterstock-logo__shutter"},(0,t.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),(0,t.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),(0,t.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),(0,t.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),(0,t.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),(0,t.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))));window.onload=()=>{const{permissions:e={}}=shutterstock,s=e.includes("can_user_license_all_shutterstock_images"),a=e.includes("can_user_license_shutterstock_editorial_image"),i=e.includes("can_user_license_shutterstock_photos");let o=!1;(s||a||i)&&(o=!0),(0,t.render)((0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"components-shutterstock-media-page__logo"},(0,t.createElement)(C,null)),(0,t.createElement)(w,{isMediaPage:!0,canLicense:o})),document.getElementById("shutterstock-widget"))}}();
  • shutterstock/tags/1.3.10/includes/class-shutterstock.php

    r2670796 r2671597  
    7171            $this->version = SHUTTERSTOCK_VERSION;
    7272        } else {
    73             $this->version = '1.3.9';
     73            $this->version = '1.3.10';
    7474        }
    7575        $this->shutterstock = 'shutterstock';
  • shutterstock/tags/1.3.10/public/shutterstock-block/build/index.asset.php

    r2543701 r2671597  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'e806a75149c5c4819c99a6f2953375d6');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => '5c6096b7ec5a22aed8b0b9d17c0499c5');
  • shutterstock/tags/1.3.10/public/shutterstock-block/build/index.css

    r2519174 r2671597  
    1 .wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);margin-right:2px}
    2 
    3 .components-shutterstock-icon{width:30px;height:30px}.components-shutterstock-icon__rectangle{fill:#ffffff}
    4 
    5 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    6 
    7 .components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
    8 
     1.wp-block-shutterstock-shutterstock-block{background:#fff;border:1px solid;clear:both;padding:1em}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-family:Roboto,sans-serif;font-size:18pt;font-weight:400;margin-left:18px;vertical-align:middle}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{display:inline-block;height:30px;margin-left:-5px;vertical-align:middle;width:30px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{background:#f54336;border-radius:20px;bottom:0;color:#fff;font-family:Roboto;font-size:13px;font-weight:700;height:40px;margin-bottom:60px;margin-right:15px;position:absolute;right:0}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,.8);color:hsla(0,0%,100%,.5);opacity:.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:15px 15px;height:20px;margin-right:2px;opacity:1;overflow:hidden;width:25px}
     2.components-shutterstock-icon{height:30px;width:30px}.components-shutterstock-icon__rectangle{fill:#fff}
     3.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-bottom-left-radius:8px;border-top-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{height:auto;width:auto}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{position:relative;top:90px}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:auto}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{padding-bottom:5px;padding-top:1px;top:0}.components-shutterstock-ui__widget-container-overlay{background-color:rgba(0,0,0,.55);background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:60px 60px;height:100%;left:0;opacity:1;overflow:hidden;position:fixed;top:2px;top:60px;transition:opacity .1s;width:100%;z-index:111}.components-shutterstock-ui__widget-container-overlay .text{bottom:0;color:#fff!important;cursor:default;font-size:18px;height:100px;left:0;margin:auto;max-width:300px;position:absolute;right:0;text-align:center;top:0;transform:translateY(100%)}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{font-weight:700;margin-left:180px;position:absolute;top:19px;z-index:111111111}.components-shutterstock-ui__navigation a{color:#444;cursor:pointer;margin:0 10px}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media(min-width:600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden}.components-shutterstock-ui__navigation.media-page{margin-top:5px;top:0}}
     4.components-shutterstock-snackbar__container{bottom:0;display:flex;justify-content:center;left:0;margin:auto auto 20px;position:absolute;position:fixed;right:0;width:100%;z-index:11111}
    95.components-shutterstock-logo{height:24px;width:162px}.components-shutterstock-logo__stck{fill:#25282a}.components-shutterstock-logo__o,.components-shutterstock-logo__shutter{fill:#ee3625}
    10 
    11 .components-shutterstock-modal__open-modal-button{font-size:13px;white-space:nowrap;background:#007cba;background:var(--wp-admin-theme-color);color:#fff;text-decoration:none;text-shadow:none;margin-top:10px}.components-shutterstock-modal__open-modal-button:hover{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__open-modal-button:focus{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__content{width:100%;height:calc(100vh)}.components-shutterstock-modal__content .components-modal__header{position:fixed;width:100%}.components-shutterstock-modal__content::-webkit-scrollbar{display:none}.components-shutterstock-modal__shutterstock-logo{padding-bottom:24px}.components-shutterstock-ui__widget-container input[type="radio"]:checked:before{width:8px;height:8px;margin:.1875rem;background-color:#1e8cbe}@media (min-width: 600px){.components-shutterstock-modal__content{width:80%}}
    12 
     6.components-shutterstock-modal__open-modal-button{background:#007cba;background:var(--wp-admin-theme-color);color:#fff;font-size:13px;margin-top:10px;text-decoration:none;text-shadow:none;white-space:nowrap}.components-shutterstock-modal__open-modal-button:focus,.components-shutterstock-modal__open-modal-button:hover{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__content{height:100vh;width:100%}.components-shutterstock-modal__content .components-modal__header{position:fixed;width:100%}.components-shutterstock-modal__content::-webkit-scrollbar{display:none}.components-shutterstock-modal__shutterstock-logo{padding-bottom:24px}.components-shutterstock-ui__widget-container input[type=radio]:checked:before{background-color:#1e8cbe;height:8px;margin:.1875rem;width:8px}@media(min-width:600px){.components-shutterstock-modal__content{width:80%}}
  • shutterstock/tags/1.3.10/public/shutterstock-block/build/index.js

    r2543701 r2671597  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,c,i){try{var s=e[c](i),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var i=e.apply(t,n);function s(e){r(i,o,c,s,a,"next",e)}function a(e){r(i,o,c,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(16),o=r(17),c=r(12),i=r(18);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,r){var n=r(21),o=r(22),c=r(12),i=r(23);e.exports=function(e){return n(e)||o(e)||c(e)||i()}},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t,r){var n=r(13);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw c}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){var n=r(13);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),c=r(2),i=r.n(c),s=r(5),a=r.n(s),u=r(4),l=r.n(u),p=r(6),d=r.n(p),b=r(0),g=r(8),m=r(14),f=(r(19),r(3)),v=(r(20),function(){return Object(b.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(b.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(b.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(b.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),y=r(15),I=r.n(y),w=r(10),h=r.n(w),O=r(7),j=r.n(O),C=r(11);r(24);var _="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M=function(){var e=a()(i.a.mark((function e(t){var r,n,o,c,s,a,u,p,b,g=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=g.length>1&&void 0!==g[1]?g[1]:"image",e.prev=1,c="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,j()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,j()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(c)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,p=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return k(k({},e),{},l()({},n,o))}),{}),b=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return k(k({},e),{},{details_for_image:k({},p["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(p||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return k(k({},e),{},{formats:n})})),e.abrupt("return",b);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),x=function(){var e=a()(i.a.mark((function e(){var t,r,n,o=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,j()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),P=M;function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(b.useState)({show:!1,text:""}),c=d()(o,2),i=c[0],s=c[1];return Object(b.useEffect)((function(){var e=setTimeout((function(){s(D(D({},i),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[i.show]),{snackbar:i,setSnackbar:s}},A=(r(25),function(e){var t=e.text;return t&&Object(b.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(b.createElement)(g.Snackbar,null,"Shutterstock: ",t))});function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Z=function(e){var t=e.item,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:r?[]:[T(T({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],item:t}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W=function(){var e=a()(i.a.mark((function e(t,r){var n,c,s,a,u,l,p,d,b,g,m,f,v,y,I,w,h,O,C,_;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,c=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,p=r.isMediaPage,d=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),g=null==t||null===(b=t.contributor)||void 0===b?void 0:b.id,m="",!g){e.next=10;break}return e.next=8,j()({path:"shutterstock/contributor/".concat(g)});case 8:y=e.sent,m=(null==y||null===(f=y.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||g;case 10:return e.next=12,j()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return I=e.sent,w=I.assets,e.next=16,j()({path:"shutterstock/images/licenses/".concat(c,"/downloads"),method:"POST",contentType:"application/json",data:G({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==w?void 0:w["".concat(s,"_jpg")])});case 16:(null==(h=e.sent)?void 0:h.success)?(O=h.data,C=O.url,_=O.id,p?p&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:G(G({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:_})}),u()),n(!1)):l(h),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.closeModal,n=e.handleError,c=e.isMediaPage,s=(e.routesConfig,e.setAttributes),u=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){t.history;p.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:(t=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(c?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:_,onClick:function(e,t,o){e.preventDefault(),W(t,H(H({},o),{},{toggleOverlay:l,handleError:n,isMediaPage:c,setAttributes:s,showSnackbar:u,closeModal:r}))}}]}}};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=function(e){var t,r=e.item,n=e.closeModal,c=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,p=e.showSnackbar,d=e.subscriptions,b=e.toggleOverlay;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[F(F({},c),{},{onClick:(t=a()(i.a.mark((function e(t,r,c){var a,d,g,m,f,v,y,I,w,h,O,C,_,L;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=c.subscription,e.prev=1,b(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(d=r.contributor)||void 0===d?void 0:d.id,f=null==r?void 0:r.media_type,y=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,j()({path:"shutterstock/contributor/".concat(m)});case 10:h=e.sent,y=(null==h||null===(I=h.data)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.display_name)||m;case 12:return e.next=14,j()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:F(F(F({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:y},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(g=shutterstock)||void 0===g?void 0:g.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,_=C.url,L=C.id,u?u&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:F(F({},r),{},{licensedImageUrl:_,contributorName:y,uploadedImageId:L})}),n()),b(!1)):s(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),b(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],item:r,subscriptions:d}}};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Y=/<\/?[a-z][^>]*?>/gi,K=/\r?\n|\r/gi,X=function(e){var t=e.isMediaPage,r=e.overlayActions,n=e.shutterstock,c=e.searchBarDropdownFilters,i=e.userIsAbleToSearchEditorial,s=e.widgetRef;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:Q({mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t){e.preventDefault(),s.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:r,editorialCountry:null==n?void 0:n.country,searchFilters:Q({showFilterDrawer:!0,images:{orientationFilter:!0}},i?{searchBarDropdownFilters:c}:{})},t?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(C.__unstableStripHTML)("".concat(e," ").concat(t)).replace(Y,"").replace(K,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")})}};function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=function(e){var t,r,n,c,s,u=e.setAttributes,l=e.closeModal,p=e.canLicense,g=void 0!==p&&p,m=e.item,v=void 0===m?{}:m,y=e.licenseImage,w=void 0!==y&&y,O=e.subscriptions,j=void 0===O?[]:O,C=e.isMediaPage,L=void 0!==C&&C,k=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),M=Object(f.useRef)(),E=Object(f.useState)({show:!1,text:""}),D=d()(E,2),N=D[0],T=D[1],B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return T($($({},N),{},{show:e,text:t}))},G=S({timeout:5e3}),W=G.snackbar,z=G.setSnackbar,H=function(e){return z($($({},W),{},{show:!0,text:e}))},U=function(e){var t,r,n,c=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(c=null==e||null===(n=e.data)||void 0===n?void 0:n.message);H(c),B(!1)},F={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),u({img:t}),l()}},J=L?[]:[$($({},F),{},{icon:_})],Q=[Z({item:v,commonInsertPreviewProps:F,isMediaPage:L})],Y=Z({item:v,commonInsertPreviewProps:F,isMediaPage:L});if(g){var K={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(s=a()(i.a.mark((function e(t,r,n){var c,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,c=r.media_type,B(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,P(r.id,c);case 6:s=e.sent,M.current.navigateTo("imageLicensingPage",{item:r,subscriptions:s,searchId:r.searchId}),B(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),B(!1),U(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,11]])}))),function(e,t,r){return s.apply(this,arguments)})};J.push($({},K)),Y.props.buttons.push($({},K)),n=V({item:v,closeModal:l,commonLicensingProps:K,handleError:U,isMediaPage:L,licenseImage:w,setAttributes:u,showSnackbar:H,subscriptions:j,toggleOverlay:B}),c=R({closeModal:l,handleError:U,isMediaPage:L,routesConfig:Q,setAttributes:u,showSnackbar:H,toggleOverlay:B,widgetRef:M})}Object(f.useEffect)((function(){var e,t,r,i=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],s=X({isMediaPage:L,overlayActions:J,shutterstock:shutterstock,searchBarDropdownFilters:i,userIsAbleToSearchEditorial:k,widgetRef:M}),a=[].concat(h()(w&&n?[n]:[]),[s,Y],h()(!w&&n?[n]:[]),h()(c?[c]:[])),u={container:M.current,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},pages:a};if("object"===("undefined"==typeof window?"undefined":I()(window))&&window.ShutterstockWidget){var l=new window.ShutterstockWidget(u);l.render({}),M.current=l}}),[]);var q=L?"media-page":"";return Object(b.createElement)(b.Fragment,null,g&&Object(b.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(N.show?"disabled":""," ").concat(q)},Object(b.createElement)("a",{onClick:function(e,t){M.current.navigateTo("searchPage")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(b.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,B(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,x("images");case 4:r=e.sent,M.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:r}),B(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),B(!1),U(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(b.createElement)("div",{ref:M,className:"components-shutterstock-ui__widget-container ".concat(q)}),N.show&&Object(b.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(q)},N.text&&Object(b.createElement)("div",{className:"text"},N.text)),W.show&&Object(b.createElement)(A,{text:W.text}))},te=(r(26),function(){return Object(b.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(b.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(b.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(b.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(b.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(b.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(b.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(b.createElement)("g",{className:"components-shutterstock-logo__o"},Object(b.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(b.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(b.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(b.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(b.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(b.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(b.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(b.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(b.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))}),re=(r(27),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.item,c=e.licenseImage,i=e.subscriptions;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(g.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(b.createElement)(te,null),onRequestClose:r},Object(b.createElement)("div",{style:{width:"100%"}},Object(b.createElement)(ee,{setAttributes:t,closeModal:r,canLicense:n,item:o,licenseImage:c,subscriptions:i}))))});function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,c,s,u,l,p,m,f,y,I,w,h=Object(b.useState)(!1),O=d()(h,2),j=O[0],C=O[1],_=Object(b.useState)(!1),L=d()(_,2),k=L[0],M=L[1],x=Object(b.useState)(!1),E=d()(x,2),D=E[0],N=E[1],T=Object(b.useState)(!1),Z=d()(T,2),B=Z[0],G=Z[1],W=Object(b.useState)([]),z=d()(W,2),H=z[0],R=z[1],U=function(){return C(!0)},F=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",V="editorial"===F,J=shutterstock.permissions,Q=void 0===J?{}:J,Y=Q.includes("can_user_license_all_shutterstock_images"),K=Q.includes("can_user_license_shutterstock_editorial_image"),X=Q.includes("can_user_license_shutterstock_photos"),q=!1;(Y||V&&K||!V&&X)&&(q=!0);var $=function(e){M(e),G(e)},ee=S({onRemoveSnackbar:function(){return $(!1)}}),te=ee.snackbar,ne=ee.setSnackbar;return Object(b.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,c=o.licensedImageUrl,i=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:c,id:s,caption:"Image: ".concat(i,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(c=e.attributes)||void 0===c||null===(s=c.img)||void 0===s?void 0:s.licensedImageUrl]),Object(b.createElement)("div",{className:e.className},Object(b.createElement)("div",null,Object(b.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(b.createElement)(v,null)),Object(b.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(b.createElement)("div",{className:"components-edit__image-container"},Object(b.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(p=e.attributes)||void 0===p||null===(m=p.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return N(!0)}}),q&&D&&!(null===(y=e.attributes)||void 0===y||null===(I=y.img)||void 0===I?void 0:I.licensedImageUrl)&&Object(b.createElement)(g.Button,{disabled:B,onClick:a()(i.a.mark((function t(){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,$(!0),t.next=4,P(null===(r=e.attributes)||void 0===r?void 0:r.img.id,F);case 4:n=t.sent,R(n),U(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),c=t.t0,i=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==c||null===(i=c.data)||void 0===i?void 0:i.statusCode)&&(null==c||null===(s=c.data)||void 0===s?void 0:s.message)&&(a=c.data.message),ne(oe(oe({},te),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var c,i,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(b.createElement)("span",{className:"loading-spinner"}),Object(b.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(b.createElement)("span",null),Object(b.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(b.createElement)(g.Button,{disabled:B,onClick:function(){U(),M(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),j&&Object(b.createElement)(re,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:q,item:null==e||null===(w=e.attributes)||void 0===w?void 0:w.img,licenseImage:k,subscriptions:H}),te.show&&!j&&Object(b.createElement)(A,{text:te.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ce,save:function(e){var t,r,n,c,i;return Object(b.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(c=n.img)||void 0===c||null===(i=c.preview_1500)||void 0===i?void 0:i.url)})},attributes:{img:{type:"object"}}})}]);
     1!function(){"use strict";var e={n:function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,{a:s}),s},d:function(t,s){for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.blocks,s=window.wp.i18n,a=window.wp.element,i=window.wp.components,o=window.wp.data,r=window.React,n=()=>(0,a.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},(0,a.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),(0,a.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),(0,a.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"})),c=window.wp.apiFetch,l=e.n(c),g=window.wp.dom,m="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";const u=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"images",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{return await l()({path:`shutterstock/images/licenses?mediaType=${e}&page=${t}`})}catch(e){throw e}};var d=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image";try{const s="editorial"===t&&shutterstock?.country?`&country=${shutterstock?.country}`:"",a=await l()({path:`shutterstock/user/subscriptions?mediaType=${t}`}),{assets:i,id:o,is_editorial:r}=await l()({path:`shutterstock/images/${e}?mediaType=${t}${s}`}),n=Object.entries(i).filter((e=>{let[t,s]=e;return s.is_licensable})).reduce(((e,t)=>{let[s,a]=t;return{...e,[s]:a}}),{});return a.map((e=>{let s=e?.formats?.filter((e=>{let{size:t,format:s}=e;return!t.match(/supersize/i)&&"tiff"!==s&&"eps"!==s&&void 0!==s})).sort(((e,t)=>e.min_resolution-t.min_resolution)).map((e=>({...e,details_for_image:{...n[`${e.size}_${e.format}`]}})));if("editorial"===t){const e=e=>({small_jpg:"small",medium_jpg:"medium",original:"original"}[e]);s=Object.entries(n||{}).map((t=>{let[s,a]=t;return{details_for_image:a,size:e(s)}}))}return{...e,formats:s}}))}catch(e){throw e}},I=e=>{let{timeout:t=5e3,onRemoveSnackbar:s}=e;const[i,o]=(0,a.useState)({show:!1,text:""});return(0,a.useEffect)((()=>{const e=setTimeout((()=>{o({...i,show:!1,text:""}),s&&s()}),t);return()=>clearTimeout(e)}),[i.show]),{snackbar:i,setSnackbar:o}},p=e=>{let{text:t}=e;return t&&(0,a.createElement)("div",{className:"components-shutterstock-snackbar__container"},(0,a.createElement)(i.Snackbar,null,"Shutterstock: ",t))},w=e=>{let{item:t,isMediaPage:s,commonInsertPreviewProps:a}=e;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:s?[]:[{...a,icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="}],item:t}}},h=e=>{let{closeModal:t,handleError:a,isMediaPage:i,routesConfig:o,setAttributes:r,showSnackbar:n,toggleOverlay:c,widgetRef:g}=e;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:(e,t)=>{let{history:s}=t;g.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:async e=>await u("images",e+1),licenseHistory:[],overlayActions:[{label:(0,s.__)(i?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:m,onClick:(e,o,g)=>{e.preventDefault(),(async(e,t)=>{const{toggleOverlay:a,licenseId:i,size:o,setAttributes:r,closeModal:n,handleError:c,isMediaPage:g,showSnackbar:m}=t;try{a(!0,(0,s.__)("wordpress:downloading_image","shutterstock"));const t=e?.contributor?.id;let u="";t&&(u=(await l()({path:`shutterstock/contributor/${t}`}))?.data?.[0]?.display_name||t);const{assets:d}=await l()({path:`shutterstock/images/${e.id}?mediaType=images`}),I=await l()({path:`shutterstock/images/licenses/${i}/downloads`,method:"POST",contentType:"application/json",data:{mediaType:"images",size:o,contributorName:u,imageId:e.id,description:e.description,...d?.[`${o}_jpg`]}});if(I?.success){const{url:t,id:i}=I.data;g?g&&m((0,s.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(r({img:{...e,licensedImageUrl:t,contributorName:u,uploadedImageId:i}}),n()),a(!1)}else c(I)}catch(e){a(!1),c(e)}})(o,{...g,toggleOverlay:c,handleError:a,isMediaPage:i,setAttributes:r,showSnackbar:n,closeModal:t})}}]}}};const C=/<\/?[a-z][^>]*?>/gi,_=/\r?\n|\r/gi;var L=e=>{let{setAttributes:t,closeModal:i,canLicense:o=!1,item:n={},licenseImage:c=!1,subscriptions:L=[],isMediaPage:y=!1}=e;const M=shutterstock?.permissions?.includes("can_user_search_editorial_images"),b=(0,r.useRef)(),[k,E]=(0,r.useState)({show:!1,text:""}),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return E({...k,show:e,text:t})},{snackbar:A,setSnackbar:S}=I({timeout:5e3}),x=e=>S({...A,show:!0,text:e}),v=e=>{let t=(0,s.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e?.data?.message),x(t),D(!1)},N={label:(0,s.__)("wordpress:text_insert_preview","shutterstock"),onClick:(e,s)=>{e.preventDefault(),t({img:s}),i()}},P=y?[]:[{...N,icon:m}],T=[w({item:n,commonInsertPreviewProps:N,isMediaPage:y})],Z=w({item:n,commonInsertPreviewProps:N,isMediaPage:y});let B,j;if(o){const e={label:(0,s.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:async(e,t,a)=>{e.preventDefault();try{const e=t.media_type;D(!0,(0,s.__)("wordpress:text_loading_please_wait","shutterstock"));const a=await d(t.id,e);b.current.navigateTo("imageLicensingPage",{item:t,subscriptions:a,searchId:t.searchId}),D(!1)}catch(e){D(!1),v(e)}}};P.push({...e}),Z.props.buttons.push({...e}),B=(e=>{let{item:t,closeModal:a,commonLicensingProps:i,handleError:o,isMediaPage:r,setAttributes:n,showSnackbar:c,subscriptions:g,toggleOverlay:m}=e;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[{...i,onClick:async(e,t,i)=>{const{subscription:g}=i;try{m(!0,(0,s.__)("wordpress:text_licensing_image_please_wait","shutterstock"));const e=t?.contributor?.id,i=t?.media_type,u="editorial"===i;let d=u?t?.byline:"";e&&!u&&(d=(await l()({path:`shutterstock/contributor/${e}`}))?.data?.[0]?.display_name||e);const I=await l()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:{subscription_id:g?.id,size:g?.size,id:t.id,description:t.description,...g?.metadata?{metadata:g.metadata}:{},contributorName:d,...g?.details_for_image,mediaType:i,license:g?.license,country:shutterstock?.country,search_id:t.searchId}});if(I?.success){const{url:e,id:i}=I.data;r?r&&c((0,s.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(n({img:{...t,licensedImageUrl:e,contributorName:d,uploadedImageId:i}}),a()),m(!1)}else o(I)}catch(e){m(!1),o(e)}}}],item:t,subscriptions:g}}})({item:n,closeModal:i,commonLicensingProps:e,handleError:v,isMediaPage:y,licenseImage:c,setAttributes:t,showSnackbar:x,subscriptions:L,toggleOverlay:D}),j=h({closeModal:i,handleError:v,isMediaPage:y,routesConfig:T,setAttributes:t,showSnackbar:x,toggleOverlay:D,widgetRef:b})}(0,r.useEffect)((()=>{const e=[{label:(0,s.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:(0,s.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],t=(e=>{let{isMediaPage:t,overlayActions:a,shutterstock:i,searchBarDropdownFilters:o,userIsAbleToSearchEditorial:r,widgetRef:n}=e;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:{mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:(e,t)=>{e.preventDefault(),n.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:a,editorialCountry:i?.country,searchFilters:{showFilterDrawer:!0,images:{orientationFilter:!0},...r?{searchBarDropdownFilters:o}:{}},...t?{}:{searchSuggestions:{enable:!0,textProvider:()=>{const e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return(0,g.__unstableStripHTML)(`${e} ${t}`).replace(C,"").replace(_,"").trim()}},title:(0,s.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")}}}})({isMediaPage:y,overlayActions:P,shutterstock:shutterstock,searchBarDropdownFilters:e,userIsAbleToSearchEditorial:M,widgetRef:b}),a=[...c&&B?[B]:[],t,Z,...!c&&B?[B]:[],...j?[j]:[]],i={container:b.current,key:shutterstock?.api_key,languageCode:shutterstock?.language,customHeaders:{"x-shutterstock-application":`Wordpress/${shutterstock?.version}`},pages:a};if("object"==typeof window&&window.ShutterstockWidget){const e=new window.ShutterstockWidget(i);e.render({}),b.current=e}}),[]);const G=y?"media-page":"";return(0,a.createElement)(a.Fragment,null,o&&(0,a.createElement)("div",{className:`components-shutterstock-ui__navigation ${k.show?"disabled":""} ${G}`},(0,a.createElement)("a",{onClick:(e,t)=>{b.current.navigateTo("searchPage")}},(0,s.__)("wordpress:text_home","shutterstock")),(0,a.createElement)("a",{className:"components-shutterstock-ui__download",onClick:async e=>{try{D(!0,(0,s.__)("wordpress:text_loading_please_wait","shutterstock"));const e=await u("images");b.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:e}),D(!1)}catch(e){D(!1),v(e)}}},(0,s.__)("wordpress:text_downloads","shutterstock"))),(0,a.createElement)("div",{ref:b,className:`components-shutterstock-ui__widget-container ${G}`}),k.show&&(0,a.createElement)("div",{className:`components-shutterstock-ui__widget-container-overlay ${G}`},k.text&&(0,a.createElement)("div",{className:"text"},k.text)),A.show&&(0,a.createElement)(p,{text:A.text}))},y=()=>(0,a.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},(0,a.createElement)("g",{className:"components-shutterstock-logo__stck"},(0,a.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),(0,a.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),(0,a.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),(0,a.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),(0,a.createElement)("g",{className:"components-shutterstock-logo__o"},(0,a.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),(0,a.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),(0,a.createElement)("g",{className:"components-shutterstock-logo__shutter"},(0,a.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),(0,a.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),(0,a.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),(0,a.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),(0,a.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),(0,a.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"})))),M=e=>{let{setAttributes:t,closeModal:s,canLicense:o,item:r,licenseImage:n,subscriptions:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:(0,a.createElement)(y,null),onRequestClose:s},(0,a.createElement)("div",{style:{width:"100%"}},(0,a.createElement)(L,{setAttributes:t,closeModal:s,canLicense:o,item:r,licenseImage:n,subscriptions:c}))))},b=(0,o.withDispatch)((e=>({replaceBlock:e("core/block-editor").replaceBlock})))((e=>{const[o,r]=(0,a.useState)(!1),[c,l]=(0,a.useState)(!1),[g,m]=(0,a.useState)(!1),[u,w]=(0,a.useState)(!1),[h,C]=(0,a.useState)([]),_=()=>r(!0),L=e.attributes?.img?.media_type||"image",y="editorial"===L,{permissions:b={}}=shutterstock,k=b.includes("can_user_license_all_shutterstock_images"),E=b.includes("can_user_license_shutterstock_editorial_image"),D=b.includes("can_user_license_shutterstock_photos");let A=!1;(k||y&&E||!y&&D)&&(A=!0);const S=e=>{l(e),w(e)},{snackbar:x,setSnackbar:v}=I({onRemoveSnackbar:()=>S(!1)});return(0,a.useEffect)((()=>{if(e.attributes?.img?.licensedImageUrl){const{attributes:{img:{licensedImageUrl:s,contributorName:a,uploadedImageId:i,description:o}}}=e,r=(0,t.createBlock)("core/image",{url:s,id:i,caption:`Image: ${a}, Shutterstock`,alt:o,align:"center"});e.replaceBlock(e.clientId,r)}}),[e.attributes?.img?.licensedImageUrl]),(0,a.createElement)("div",{className:e.className},(0,a.createElement)("div",null,(0,a.createElement)("span",{className:"components-edit__shutterstock-icon"},(0,a.createElement)(n,null)),(0,a.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?(0,a.createElement)("div",{className:"components-edit__image-container"},(0,a.createElement)("img",{src:e.attributes?.img?.licensedImageUrl||e.attributes?.img?.preview_1500?.url,onLoad:()=>m(!0)}),A&&g&&!e.attributes?.img?.licensedImageUrl&&(0,a.createElement)(i.Button,{disabled:u,onClick:async()=>{try{S(!0);const t=await d(e.attributes?.img.id,L);C(t),_(),w(!1)}catch(e){(e=>{let t=(0,s.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e.data.message),v({...x,show:!0,text:t})})(e)}},className:"components-edit__license-image-button"},u&&(0,a.createElement)("span",{className:"loading-spinner"}),(0,a.createElement)("span",null,(0,s.__)("wordpress:text_license_this_image","shutterstock")))):(0,a.createElement)("span",null),(0,a.createElement)("div",{className:"components-edit__paragraph"},(0,s.__)("wordpress:text_block_paragraph","shutterstock")),(0,a.createElement)(i.Button,{disabled:u,onClick:()=>{_(),l(!1)},className:"components-shutterstock-modal__open-modal-button "},(0,s.__)("wordpress:text_browse","shutterstock")),o&&(0,a.createElement)(M,{setAttributes:e.setAttributes,closeModal:()=>r(!1),canLicense:A,item:e?.attributes?.img,licenseImage:c,subscriptions:h}),x.show&&!o&&(0,a.createElement)(p,{text:x.text}))}));(0,t.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:(0,s.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:n,supports:{html:!1},edit:b,save:function(e){return(0,a.createElement)("img",{alt:(0,s.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:e.attributes?.img?.licensedImageUrl||e.attributes?.img?.preview_1500?.url})},attributes:{img:{type:"object"}}})}();
  • shutterstock/tags/1.3.10/shutterstock.php

    r2670796 r2671597  
    1616 * Plugin Name:       Shutterstock
    1717 * Description:       Access exceptional, royalty-free content straight from WordPress.
    18  * Version:           1.3.9
     18 * Version:           1.3.10
    1919 * Author:            Shutterstock
    2020 * License:           MIT
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'SHUTTERSTOCK_VERSION', '1.3.9' );
     36define( 'SHUTTERSTOCK_VERSION', '1.3.10' );
    3737
    3838/**
  • shutterstock/trunk/README.txt

    r2670796 r2671597  
    44Requires at least: 5.5
    55Tested up to: 5.9
    6 Stable tag: 1.3.9
     6Stable tag: 1.3.10
    77Requires PHP: 7.1
    88License: MIT
     
    112112
    113113== Changelog ==
     114= 1.3.10 =
     115* Update package dependencies
     116
    114117= 1.3.9 =
    115118* Update to support Wordpress 5.9
  • shutterstock/trunk/admin/shutterstock-media-page/index.asset.php

    r2543701 r2671597  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'a6bf67079b9aa9bd04b1e92f732bc4c3');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => '15b193786b33fea16b8eeda44cdfb0e4');
  • shutterstock/trunk/admin/shutterstock-media-page/index.css

    r2519174 r2671597  
    1 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    2 
    3 .components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
    4 
     1.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-bottom-left-radius:8px;border-top-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{height:auto;width:auto}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{position:relative;top:90px}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:auto}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{padding-bottom:5px;padding-top:1px;top:0}.components-shutterstock-ui__widget-container-overlay{background-color:rgba(0,0,0,.55);background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:60px 60px;height:100%;left:0;opacity:1;overflow:hidden;position:fixed;top:2px;top:60px;transition:opacity .1s;width:100%;z-index:111}.components-shutterstock-ui__widget-container-overlay .text{bottom:0;color:#fff!important;cursor:default;font-size:18px;height:100px;left:0;margin:auto;max-width:300px;position:absolute;right:0;text-align:center;top:0;transform:translateY(100%)}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{font-weight:700;margin-left:180px;position:absolute;top:19px;z-index:111111111}.components-shutterstock-ui__navigation a{color:#444;cursor:pointer;margin:0 10px}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media(min-width:600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden}.components-shutterstock-ui__navigation.media-page{margin-top:5px;top:0}}
     2.components-shutterstock-snackbar__container{bottom:0;display:flex;justify-content:center;left:0;margin:auto auto 20px;position:absolute;position:fixed;right:0;width:100%;z-index:11111}
    53.components-shutterstock-logo{height:24px;width:162px}.components-shutterstock-logo__stck{fill:#25282a}.components-shutterstock-logo__o,.components-shutterstock-logo__shutter{fill:#ee3625}
    6 
    7 #shutterstock-widget{position:relative}.components-shutterstock-media-page__logo{margin:20px 0 15px 0}.components-shutterstock-media-page__license-history-container{overflow:hidden scroll}.components-shutterstock-snackbar__container .components-snackbar__content{font-family:Roboto, sans-serif;font-size:13px;background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,0.3);color:#fff;padding:16px 24px;width:100%;max-width:400px;box-sizing:border-box;cursor:pointer}
    8 
     4#shutterstock-widget{position:relative}.components-shutterstock-media-page__logo{margin:20px 0 15px}.components-shutterstock-media-page__license-history-container{overflow:hidden scroll}.components-shutterstock-snackbar__container .components-snackbar__content{background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);box-sizing:border-box;color:#fff;cursor:pointer;font-family:Roboto,sans-serif;font-size:13px;max-width:400px;padding:16px 24px;width:100%}
  • shutterstock/trunk/admin/shutterstock-media-page/index.js

    r2543701 r2671597  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function a(e){r(c,o,i,a,s,"next",e)}function s(e){r(c,o,i,a,s,"throw",e)}a(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(17),o=r(18),i=r(11),c=r(19);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t,r){var n=r(14),o=r(15),i=r(11),c=r(16);e.exports=function(e){return n(e)||o(e)||i(e)||c()}},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t,r){var n=r(10);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,r){var n=r(10);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(12),i=r.n(o),c=r(8),a=r.n(c),s=r(3),u=r.n(s),l=r(5),p=r.n(l),g=r(4),d=r.n(g),b=r(7),m=r.n(b),f=r(1),y=r(6),I=r.n(y),w=r(2),v=r(9);r(20);var h="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=function(){var e=p()(u.a.mark((function e(t){var r,n,o,i,c,a,s,l,p,g=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=g.length>1&&void 0!==g[1]?g[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,I()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,I()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,s=a.assets,a.id,a.is_editorial,l=Object.entries(s).filter((function(e){var t=m()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=m()(t,2),n=r[0],o=r[1];return j(j({},e),{},d()({},n,o))}),{}),p=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return j(j({},e),{},{details_for_image:j({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=m()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return j(j({},e),{},{formats:n})})),e.abrupt("return",p);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),L=function(){var e=p()(u.a.mark((function e(){var t,r,n,o=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,I()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=C;function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=m()(i,2),a=c[0],s=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){s(D(D({},a),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[a.show]),{snackbar:a,setSnackbar:s}},_=r(13),k=(r(21),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(_.Snackbar,null,"Shutterstock: ",t))});function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A=function(e){var t=e.item,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:r?[]:[S(S({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],item:t}}};function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(){var e=p()(u.a.mark((function e(t,r){var n,o,i,c,a,s,l,p,g,d,b,m,f,y,v,h,O,j,C,L;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,s=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(w.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,I()({path:"shutterstock/contributor/".concat(d)});case 8:y=e.sent,b=(null==y||null===(m=y.data)||void 0===m||null===(f=m[0])||void 0===f?void 0:f.display_name)||d;case 10:return e.next=12,I()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return v=e.sent,h=v.assets,e.next=16,I()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:Z({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==h?void 0:h["".concat(i,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(j=O.data,C=j.url,L=j.id,l?l&&p(Object(w.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:Z(Z({},t),{},{licensedImageUrl:C,contributorName:b,uploadedImageId:L})}),a()),n(!1)):s(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),s(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=(e.routesConfig,e.setAttributes),c=e.showSnackbar,a=e.toggleOverlay,s=e.widgetRef;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){t.history;s.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:(t=p()(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(w.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:h,onClick:function(e,t,s){e.preventDefault(),N(t,B(B({},s),{},{toggleOverlay:a,handleError:n,isMediaPage:o,setAttributes:i,showSnackbar:c,closeModal:r}))}}]}}};function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.item,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,s=e.showSnackbar,l=e.subscriptions,g=e.toggleOverlay;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[H(H({},o),{},{onClick:(t=p()(u.a.mark((function e(t,r,o){var l,p,d,b,m,f,y,v,h,O,j,C,L,M;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.subscription,e.prev=1,g(!0,Object(w.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,y=(f="editorial"===m)?null==r?void 0:r.byline:"",!b||f){e.next=12;break}return e.next=10,I()({path:"shutterstock/contributor/".concat(b)});case 10:O=e.sent,y=(null==O||null===(v=O.data)||void 0===v||null===(h=v[0])||void 0===h?void 0:h.display_name)||b;case 12:return e.next=14,I()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:H(H(H({subscription_id:null==l?void 0:l.id,size:null==l?void 0:l.size,id:r.id,description:r.description},(null==l?void 0:l.metadata)?{metadata:l.metadata}:{}),{},{contributorName:y},null==l?void 0:l.details_for_image),{},{mediaType:m,license:null==l?void 0:l.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(j=e.sent)?void 0:j.success)?(C=j.data,L=C.url,M=C.id,c?c&&s(Object(w.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:H(H({},r),{},{licensedImageUrl:L,contributorName:y,uploadedImageId:M})}),n()),g(!1)):i(j),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],item:r,subscriptions:l}}};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=/<\/?[a-z][^>]*?>/gi,Q=/\r?\n|\r/gi,V=function(e){var t=e.isMediaPage,r=e.overlayActions,n=e.shutterstock,o=e.searchBarDropdownFilters,i=e.userIsAbleToSearchEditorial,c=e.widgetRef;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:F({mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t){e.preventDefault(),c.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:r,editorialCountry:null==n?void 0:n.country,searchFilters:F({showFilterDrawer:!0,images:{orientationFilter:!0}},i?{searchBarDropdownFilters:o}:{})},t?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(v.__unstableStripHTML)("".concat(e," ").concat(t)).replace(J,"").replace(Q,"").trim()}},title:Object(w.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")})}};function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var X=function(e){var t,r,o,c,s,l=e.setAttributes,g=e.closeModal,d=e.canLicense,b=void 0!==d&&d,y=e.item,I=void 0===y?{}:y,v=e.licenseImage,O=void 0!==v&&v,j=e.subscriptions,C=void 0===j?[]:j,P=e.isMediaPage,D=void 0!==P&&P,_=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),E=Object(f.useRef)(),S=Object(f.useState)({show:!1,text:""}),T=m()(S,2),Z=T[0],N=T[1],G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return N(K(K({},Z),{},{show:e,text:t}))},B=x({timeout:5e3}),z=B.snackbar,H=B.setSnackbar,U=function(e){return H(K(K({},z),{},{show:!0,text:e}))},F=function(e){var t,r,n,o=Object(w.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);U(o),G(!1)},J={label:Object(w.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),l({img:t}),g()}},Q=D?[]:[K(K({},J),{},{icon:h})],Y=[A({item:I,commonInsertPreviewProps:J,isMediaPage:D})],X=A({item:I,commonInsertPreviewProps:J,isMediaPage:D});if(b){var $={label:Object(w.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(s=p()(u.a.mark((function e(t,r,n){var o,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,G(!0,Object(w.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,M(r.id,o);case 6:i=e.sent,E.current.navigateTo("imageLicensingPage",{item:r,subscriptions:i,searchId:r.searchId}),G(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),G(!1),F(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,11]])}))),function(e,t,r){return s.apply(this,arguments)})};Q.push(K({},$)),X.props.buttons.push(K({},$)),o=R({item:I,closeModal:g,commonLicensingProps:$,handleError:F,isMediaPage:D,licenseImage:O,setAttributes:l,showSnackbar:U,subscriptions:C,toggleOverlay:G}),c=W({closeModal:g,handleError:F,isMediaPage:D,routesConfig:Y,setAttributes:l,showSnackbar:U,toggleOverlay:G,widgetRef:E})}Object(f.useEffect)((function(){var e,t,r,n=[{label:Object(w.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(w.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],s=V({isMediaPage:D,overlayActions:Q,shutterstock:shutterstock,searchBarDropdownFilters:n,userIsAbleToSearchEditorial:_,widgetRef:E}),u=[].concat(a()(O&&o?[o]:[]),[s,X],a()(!O&&o?[o]:[]),a()(c?[c]:[])),l={container:E.current,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},pages:u};if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var p=new window.ShutterstockWidget(l);p.render({}),E.current=p}}),[]);var q=D?"media-page":"";return Object(n.createElement)(n.Fragment,null,b&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(Z.show?"disabled":""," ").concat(q)},Object(n.createElement)("a",{onClick:function(e,t){E.current.navigateTo("searchPage")}},Object(w.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=p()(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,G(!0,Object(w.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,L("images");case 4:r=e.sent,E.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:r}),G(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),G(!1),F(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()},Object(w.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:E,className:"components-shutterstock-ui__widget-container ".concat(q)}),Z.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(q)},Z.text&&Object(n.createElement)("div",{className:"text"},Z.text)),z.show&&Object(n.createElement)(k,{text:z.text}))},$=(r(22),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))});r(23);window.onload=function(){var e=shutterstock.permissions,t=void 0===e?{}:e,r=t.includes("can_user_license_all_shutterstock_images"),o=t.includes("can_user_license_shutterstock_editorial_image"),i=t.includes("can_user_license_shutterstock_photos"),c=!1;(r||o||i)&&(c=!0),Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)($,null)),Object(n.createElement)(X,{isMediaPage:!0,canLicense:c})),document.getElementById("shutterstock-widget"))}}]);
     1!function(){"use strict";var e={n:function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,{a:s}),s},d:function(t,s){for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.element,s=window.React,a=window.wp.apiFetch,i=e.n(a),o=window.wp.i18n,r=window.wp.dom,n="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";const c=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"images",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{return await i()({path:`shutterstock/images/licenses?mediaType=${e}&page=${t}`})}catch(e){throw e}};var l=window.wp.components,g=e=>{let{text:s}=e;return s&&(0,t.createElement)("div",{className:"components-shutterstock-snackbar__container"},(0,t.createElement)(l.Snackbar,null,"Shutterstock: ",s))},I=e=>{let{item:t,isMediaPage:s,commonInsertPreviewProps:a}=e;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:s?[]:[{...a,icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="}],item:t}}},m=e=>{let{closeModal:t,handleError:s,isMediaPage:a,routesConfig:r,setAttributes:l,showSnackbar:g,toggleOverlay:I,widgetRef:m}=e;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:(e,t)=>{let{history:s}=t;m.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:async e=>await c("images",e+1),licenseHistory:[],overlayActions:[{label:(0,o.__)(a?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:n,onClick:(e,r,n)=>{e.preventDefault(),(async(e,t)=>{const{toggleOverlay:s,licenseId:a,size:r,setAttributes:n,closeModal:c,handleError:l,isMediaPage:g,showSnackbar:I}=t;try{s(!0,(0,o.__)("wordpress:downloading_image","shutterstock"));const t=e?.contributor?.id;let m="";t&&(m=(await i()({path:`shutterstock/contributor/${t}`}))?.data?.[0]?.display_name||t);const{assets:d}=await i()({path:`shutterstock/images/${e.id}?mediaType=images`}),u=await i()({path:`shutterstock/images/licenses/${a}/downloads`,method:"POST",contentType:"application/json",data:{mediaType:"images",size:r,contributorName:m,imageId:e.id,description:e.description,...d?.[`${r}_jpg`]}});if(u?.success){const{url:t,id:a}=u.data;g?g&&I((0,o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(n({img:{...e,licensedImageUrl:t,contributorName:m,uploadedImageId:a}}),c()),s(!1)}else l(u)}catch(e){s(!1),l(e)}})(r,{...n,toggleOverlay:I,handleError:s,isMediaPage:a,setAttributes:l,showSnackbar:g,closeModal:t})}}]}}};const d=/<\/?[a-z][^>]*?>/gi,u=/\r?\n|\r/gi;var w=e=>{let{setAttributes:a,closeModal:l,canLicense:w=!1,item:C={},licenseImage:p=!1,subscriptions:L=[],isMediaPage:h=!1}=e;const y=shutterstock?.permissions?.includes("can_user_search_editorial_images"),M=(0,s.useRef)(),[_,b]=(0,s.useState)({show:!1,text:""}),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return b({..._,show:e,text:t})},{snackbar:k,setSnackbar:E}=(e=>{let{timeout:s=5e3,onRemoveSnackbar:a}=e;const[i,o]=(0,t.useState)({show:!1,text:""});return(0,t.useEffect)((()=>{const e=setTimeout((()=>{o({...i,show:!1,text:""}),a&&a()}),s);return()=>clearTimeout(e)}),[i.show]),{snackbar:i,setSnackbar:o}})({timeout:5e3}),A=e=>E({...k,show:!0,text:e}),S=e=>{let t=(0,o.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e?.data?.message),A(t),D(!1)},x={label:(0,o.__)("wordpress:text_insert_preview","shutterstock"),onClick:(e,t)=>{e.preventDefault(),a({img:t}),l()}},v=h?[]:[{...x,icon:n}],P=[I({item:C,commonInsertPreviewProps:x,isMediaPage:h})],T=I({item:C,commonInsertPreviewProps:x,isMediaPage:h});let Z,N;if(w){const e={label:(0,o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:async(e,t,s)=>{e.preventDefault();try{const e=t.media_type;D(!0,(0,o.__)("wordpress:text_loading_please_wait","shutterstock"));const s=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image";try{const s="editorial"===t&&shutterstock?.country?`&country=${shutterstock?.country}`:"",a=await i()({path:`shutterstock/user/subscriptions?mediaType=${t}`}),{assets:o,id:r,is_editorial:n}=await i()({path:`shutterstock/images/${e}?mediaType=${t}${s}`}),c=Object.entries(o).filter((e=>{let[t,s]=e;return s.is_licensable})).reduce(((e,t)=>{let[s,a]=t;return{...e,[s]:a}}),{});return a.map((e=>{let s=e?.formats?.filter((e=>{let{size:t,format:s}=e;return!t.match(/supersize/i)&&"tiff"!==s&&"eps"!==s&&void 0!==s})).sort(((e,t)=>e.min_resolution-t.min_resolution)).map((e=>({...e,details_for_image:{...c[`${e.size}_${e.format}`]}})));if("editorial"===t){const e=e=>({small_jpg:"small",medium_jpg:"medium",original:"original"}[e]);s=Object.entries(c||{}).map((t=>{let[s,a]=t;return{details_for_image:a,size:e(s)}}))}return{...e,formats:s}}))}catch(e){throw e}}(t.id,e);M.current.navigateTo("imageLicensingPage",{item:t,subscriptions:s,searchId:t.searchId}),D(!1)}catch(e){D(!1),S(e)}}};v.push({...e}),T.props.buttons.push({...e}),Z=(e=>{let{item:t,closeModal:s,commonLicensingProps:a,handleError:r,isMediaPage:n,setAttributes:c,showSnackbar:l,subscriptions:g,toggleOverlay:I}=e;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[{...a,onClick:async(e,t,a)=>{const{subscription:g}=a;try{I(!0,(0,o.__)("wordpress:text_licensing_image_please_wait","shutterstock"));const e=t?.contributor?.id,a=t?.media_type,m="editorial"===a;let d=m?t?.byline:"";e&&!m&&(d=(await i()({path:`shutterstock/contributor/${e}`}))?.data?.[0]?.display_name||e);const u=await i()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:{subscription_id:g?.id,size:g?.size,id:t.id,description:t.description,...g?.metadata?{metadata:g.metadata}:{},contributorName:d,...g?.details_for_image,mediaType:a,license:g?.license,country:shutterstock?.country,search_id:t.searchId}});if(u?.success){const{url:e,id:a}=u.data;n?n&&l((0,o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:{...t,licensedImageUrl:e,contributorName:d,uploadedImageId:a}}),s()),I(!1)}else r(u)}catch(e){I(!1),r(e)}}}],item:t,subscriptions:g}}})({item:C,closeModal:l,commonLicensingProps:e,handleError:S,isMediaPage:h,licenseImage:p,setAttributes:a,showSnackbar:A,subscriptions:L,toggleOverlay:D}),N=m({closeModal:l,handleError:S,isMediaPage:h,routesConfig:P,setAttributes:a,showSnackbar:A,toggleOverlay:D,widgetRef:M})}(0,s.useEffect)((()=>{const e=[{label:(0,o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:(0,o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],t=(e=>{let{isMediaPage:t,overlayActions:s,shutterstock:a,searchBarDropdownFilters:i,userIsAbleToSearchEditorial:n,widgetRef:c}=e;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:{mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:(e,t)=>{e.preventDefault(),c.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:s,editorialCountry:a?.country,searchFilters:{showFilterDrawer:!0,images:{orientationFilter:!0},...n?{searchBarDropdownFilters:i}:{}},...t?{}:{searchSuggestions:{enable:!0,textProvider:()=>{const e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return(0,r.__unstableStripHTML)(`${e} ${t}`).replace(d,"").replace(u,"").trim()}},title:(0,o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")}}}})({isMediaPage:h,overlayActions:v,shutterstock:shutterstock,searchBarDropdownFilters:e,userIsAbleToSearchEditorial:y,widgetRef:M}),s=[...p&&Z?[Z]:[],t,T,...!p&&Z?[Z]:[],...N?[N]:[]],a={container:M.current,key:shutterstock?.api_key,languageCode:shutterstock?.language,customHeaders:{"x-shutterstock-application":`Wordpress/${shutterstock?.version}`},pages:s};if("object"==typeof window&&window.ShutterstockWidget){const e=new window.ShutterstockWidget(a);e.render({}),M.current=e}}),[]);const j=h?"media-page":"";return(0,t.createElement)(t.Fragment,null,w&&(0,t.createElement)("div",{className:`components-shutterstock-ui__navigation ${_.show?"disabled":""} ${j}`},(0,t.createElement)("a",{onClick:(e,t)=>{M.current.navigateTo("searchPage")}},(0,o.__)("wordpress:text_home","shutterstock")),(0,t.createElement)("a",{className:"components-shutterstock-ui__download",onClick:async e=>{try{D(!0,(0,o.__)("wordpress:text_loading_please_wait","shutterstock"));const e=await c("images");M.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:e}),D(!1)}catch(e){D(!1),S(e)}}},(0,o.__)("wordpress:text_downloads","shutterstock"))),(0,t.createElement)("div",{ref:M,className:`components-shutterstock-ui__widget-container ${j}`}),_.show&&(0,t.createElement)("div",{className:`components-shutterstock-ui__widget-container-overlay ${j}`},_.text&&(0,t.createElement)("div",{className:"text"},_.text)),k.show&&(0,t.createElement)(g,{text:k.text}))},C=()=>(0,t.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},(0,t.createElement)("g",{className:"components-shutterstock-logo__stck"},(0,t.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),(0,t.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),(0,t.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),(0,t.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),(0,t.createElement)("g",{className:"components-shutterstock-logo__o"},(0,t.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),(0,t.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),(0,t.createElement)("g",{className:"components-shutterstock-logo__shutter"},(0,t.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),(0,t.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),(0,t.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),(0,t.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),(0,t.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),(0,t.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))));window.onload=()=>{const{permissions:e={}}=shutterstock,s=e.includes("can_user_license_all_shutterstock_images"),a=e.includes("can_user_license_shutterstock_editorial_image"),i=e.includes("can_user_license_shutterstock_photos");let o=!1;(s||a||i)&&(o=!0),(0,t.render)((0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"components-shutterstock-media-page__logo"},(0,t.createElement)(C,null)),(0,t.createElement)(w,{isMediaPage:!0,canLicense:o})),document.getElementById("shutterstock-widget"))}}();
  • shutterstock/trunk/includes/class-shutterstock.php

    r2670796 r2671597  
    7171            $this->version = SHUTTERSTOCK_VERSION;
    7272        } else {
    73             $this->version = '1.3.9';
     73            $this->version = '1.3.10';
    7474        }
    7575        $this->shutterstock = 'shutterstock';
  • shutterstock/trunk/public/shutterstock-block/build/index.asset.php

    r2543701 r2671597  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'e806a75149c5c4819c99a6f2953375d6');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n'), 'version' => '5c6096b7ec5a22aed8b0b9d17c0499c5');
  • shutterstock/trunk/public/shutterstock-block/build/index.css

    r2519174 r2671597  
    1 .wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);margin-right:2px}
    2 
    3 .components-shutterstock-icon{width:30px;height:30px}.components-shutterstock-icon__rectangle{fill:#ffffff}
    4 
    5 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    6 
    7 .components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
    8 
     1.wp-block-shutterstock-shutterstock-block{background:#fff;border:1px solid;clear:both;padding:1em}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-family:Roboto,sans-serif;font-size:18pt;font-weight:400;margin-left:18px;vertical-align:middle}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{display:inline-block;height:30px;margin-left:-5px;vertical-align:middle;width:30px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{background:#f54336;border-radius:20px;bottom:0;color:#fff;font-family:Roboto;font-size:13px;font-weight:700;height:40px;margin-bottom:60px;margin-right:15px;position:absolute;right:0}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,.8);color:hsla(0,0%,100%,.5);opacity:.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:15px 15px;height:20px;margin-right:2px;opacity:1;overflow:hidden;width:25px}
     2.components-shutterstock-icon{height:30px;width:30px}.components-shutterstock-icon__rectangle{fill:#fff}
     3.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-bottom-left-radius:8px;border-top-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{height:auto;width:auto}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{position:relative;top:90px}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:auto}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{padding-bottom:5px;padding-top:1px;top:0}.components-shutterstock-ui__widget-container-overlay{background-color:rgba(0,0,0,.55);background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:60px 60px;height:100%;left:0;opacity:1;overflow:hidden;position:fixed;top:2px;top:60px;transition:opacity .1s;width:100%;z-index:111}.components-shutterstock-ui__widget-container-overlay .text{bottom:0;color:#fff!important;cursor:default;font-size:18px;height:100px;left:0;margin:auto;max-width:300px;position:absolute;right:0;text-align:center;top:0;transform:translateY(100%)}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{font-weight:700;margin-left:180px;position:absolute;top:19px;z-index:111111111}.components-shutterstock-ui__navigation a{color:#444;cursor:pointer;margin:0 10px}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media(min-width:600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:auto;overflow:hidden}.components-shutterstock-ui__navigation.media-page{margin-top:5px;top:0}}
     4.components-shutterstock-snackbar__container{bottom:0;display:flex;justify-content:center;left:0;margin:auto auto 20px;position:absolute;position:fixed;right:0;width:100%;z-index:11111}
    95.components-shutterstock-logo{height:24px;width:162px}.components-shutterstock-logo__stck{fill:#25282a}.components-shutterstock-logo__o,.components-shutterstock-logo__shutter{fill:#ee3625}
    10 
    11 .components-shutterstock-modal__open-modal-button{font-size:13px;white-space:nowrap;background:#007cba;background:var(--wp-admin-theme-color);color:#fff;text-decoration:none;text-shadow:none;margin-top:10px}.components-shutterstock-modal__open-modal-button:hover{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__open-modal-button:focus{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__content{width:100%;height:calc(100vh)}.components-shutterstock-modal__content .components-modal__header{position:fixed;width:100%}.components-shutterstock-modal__content::-webkit-scrollbar{display:none}.components-shutterstock-modal__shutterstock-logo{padding-bottom:24px}.components-shutterstock-ui__widget-container input[type="radio"]:checked:before{width:8px;height:8px;margin:.1875rem;background-color:#1e8cbe}@media (min-width: 600px){.components-shutterstock-modal__content{width:80%}}
    12 
     6.components-shutterstock-modal__open-modal-button{background:#007cba;background:var(--wp-admin-theme-color);color:#fff;font-size:13px;margin-top:10px;text-decoration:none;text-shadow:none;white-space:nowrap}.components-shutterstock-modal__open-modal-button:focus,.components-shutterstock-modal__open-modal-button:hover{background:var(--wp-admin-theme-color);color:#fff}.components-shutterstock-modal__content{height:100vh;width:100%}.components-shutterstock-modal__content .components-modal__header{position:fixed;width:100%}.components-shutterstock-modal__content::-webkit-scrollbar{display:none}.components-shutterstock-modal__shutterstock-logo{padding-bottom:24px}.components-shutterstock-ui__widget-container input[type=radio]:checked:before{background-color:#1e8cbe;height:8px;margin:.1875rem;width:8px}@media(min-width:600px){.components-shutterstock-modal__content{width:80%}}
  • shutterstock/trunk/public/shutterstock-block/build/index.js

    r2543701 r2671597  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,c,i){try{var s=e[c](i),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var i=e.apply(t,n);function s(e){r(i,o,c,s,a,"next",e)}function a(e){r(i,o,c,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(16),o=r(17),c=r(12),i=r(18);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,r){var n=r(21),o=r(22),c=r(12),i=r(23);e.exports=function(e){return n(e)||o(e)||c(e)||i()}},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t,r){var n=r(13);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw c}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){var n=r(13);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),c=r(2),i=r.n(c),s=r(5),a=r.n(s),u=r(4),l=r.n(u),p=r(6),d=r.n(p),b=r(0),g=r(8),m=r(14),f=(r(19),r(3)),v=(r(20),function(){return Object(b.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(b.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(b.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(b.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),y=r(15),I=r.n(y),w=r(10),h=r.n(w),O=r(7),j=r.n(O),C=r(11);r(24);var _="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M=function(){var e=a()(i.a.mark((function e(t){var r,n,o,c,s,a,u,p,b,g=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=g.length>1&&void 0!==g[1]?g[1]:"image",e.prev=1,c="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,j()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,j()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(c)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,p=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return k(k({},e),{},l()({},n,o))}),{}),b=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return k(k({},e),{},{details_for_image:k({},p["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(p||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return k(k({},e),{},{formats:n})})),e.abrupt("return",b);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),x=function(){var e=a()(i.a.mark((function e(){var t,r,n,o=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,j()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),P=M;function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(b.useState)({show:!1,text:""}),c=d()(o,2),i=c[0],s=c[1];return Object(b.useEffect)((function(){var e=setTimeout((function(){s(D(D({},i),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[i.show]),{snackbar:i,setSnackbar:s}},A=(r(25),function(e){var t=e.text;return t&&Object(b.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(b.createElement)(g.Snackbar,null,"Shutterstock: ",t))});function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Z=function(e){var t=e.item,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:r?[]:[T(T({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],item:t}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W=function(){var e=a()(i.a.mark((function e(t,r){var n,c,s,a,u,l,p,d,b,g,m,f,v,y,I,w,h,O,C,_;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,c=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,p=r.isMediaPage,d=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),g=null==t||null===(b=t.contributor)||void 0===b?void 0:b.id,m="",!g){e.next=10;break}return e.next=8,j()({path:"shutterstock/contributor/".concat(g)});case 8:y=e.sent,m=(null==y||null===(f=y.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||g;case 10:return e.next=12,j()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return I=e.sent,w=I.assets,e.next=16,j()({path:"shutterstock/images/licenses/".concat(c,"/downloads"),method:"POST",contentType:"application/json",data:G({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==w?void 0:w["".concat(s,"_jpg")])});case 16:(null==(h=e.sent)?void 0:h.success)?(O=h.data,C=O.url,_=O.id,p?p&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:G(G({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:_})}),u()),n(!1)):l(h),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.closeModal,n=e.handleError,c=e.isMediaPage,s=(e.routesConfig,e.setAttributes),u=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){t.history;p.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:(t=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(c?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:_,onClick:function(e,t,o){e.preventDefault(),W(t,H(H({},o),{},{toggleOverlay:l,handleError:n,isMediaPage:c,setAttributes:s,showSnackbar:u,closeModal:r}))}}]}}};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=function(e){var t,r=e.item,n=e.closeModal,c=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,p=e.showSnackbar,d=e.subscriptions,b=e.toggleOverlay;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[F(F({},c),{},{onClick:(t=a()(i.a.mark((function e(t,r,c){var a,d,g,m,f,v,y,I,w,h,O,C,_,L;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=c.subscription,e.prev=1,b(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(d=r.contributor)||void 0===d?void 0:d.id,f=null==r?void 0:r.media_type,y=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,j()({path:"shutterstock/contributor/".concat(m)});case 10:h=e.sent,y=(null==h||null===(I=h.data)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.display_name)||m;case 12:return e.next=14,j()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:F(F(F({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:y},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(g=shutterstock)||void 0===g?void 0:g.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,_=C.url,L=C.id,u?u&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:F(F({},r),{},{licensedImageUrl:_,contributorName:y,uploadedImageId:L})}),n()),b(!1)):s(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),b(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],item:r,subscriptions:d}}};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Y=/<\/?[a-z][^>]*?>/gi,K=/\r?\n|\r/gi,X=function(e){var t=e.isMediaPage,r=e.overlayActions,n=e.shutterstock,c=e.searchBarDropdownFilters,i=e.userIsAbleToSearchEditorial,s=e.widgetRef;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:Q({mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t){e.preventDefault(),s.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:r,editorialCountry:null==n?void 0:n.country,searchFilters:Q({showFilterDrawer:!0,images:{orientationFilter:!0}},i?{searchBarDropdownFilters:c}:{})},t?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(C.__unstableStripHTML)("".concat(e," ").concat(t)).replace(Y,"").replace(K,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")})}};function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=function(e){var t,r,n,c,s,u=e.setAttributes,l=e.closeModal,p=e.canLicense,g=void 0!==p&&p,m=e.item,v=void 0===m?{}:m,y=e.licenseImage,w=void 0!==y&&y,O=e.subscriptions,j=void 0===O?[]:O,C=e.isMediaPage,L=void 0!==C&&C,k=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),M=Object(f.useRef)(),E=Object(f.useState)({show:!1,text:""}),D=d()(E,2),N=D[0],T=D[1],B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return T($($({},N),{},{show:e,text:t}))},G=S({timeout:5e3}),W=G.snackbar,z=G.setSnackbar,H=function(e){return z($($({},W),{},{show:!0,text:e}))},U=function(e){var t,r,n,c=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(c=null==e||null===(n=e.data)||void 0===n?void 0:n.message);H(c),B(!1)},F={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),u({img:t}),l()}},J=L?[]:[$($({},F),{},{icon:_})],Q=[Z({item:v,commonInsertPreviewProps:F,isMediaPage:L})],Y=Z({item:v,commonInsertPreviewProps:F,isMediaPage:L});if(g){var K={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(s=a()(i.a.mark((function e(t,r,n){var c,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,c=r.media_type,B(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,P(r.id,c);case 6:s=e.sent,M.current.navigateTo("imageLicensingPage",{item:r,subscriptions:s,searchId:r.searchId}),B(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),B(!1),U(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,11]])}))),function(e,t,r){return s.apply(this,arguments)})};J.push($({},K)),Y.props.buttons.push($({},K)),n=V({item:v,closeModal:l,commonLicensingProps:K,handleError:U,isMediaPage:L,licenseImage:w,setAttributes:u,showSnackbar:H,subscriptions:j,toggleOverlay:B}),c=R({closeModal:l,handleError:U,isMediaPage:L,routesConfig:Q,setAttributes:u,showSnackbar:H,toggleOverlay:B,widgetRef:M})}Object(f.useEffect)((function(){var e,t,r,i=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],s=X({isMediaPage:L,overlayActions:J,shutterstock:shutterstock,searchBarDropdownFilters:i,userIsAbleToSearchEditorial:k,widgetRef:M}),a=[].concat(h()(w&&n?[n]:[]),[s,Y],h()(!w&&n?[n]:[]),h()(c?[c]:[])),u={container:M.current,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},pages:a};if("object"===("undefined"==typeof window?"undefined":I()(window))&&window.ShutterstockWidget){var l=new window.ShutterstockWidget(u);l.render({}),M.current=l}}),[]);var q=L?"media-page":"";return Object(b.createElement)(b.Fragment,null,g&&Object(b.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(N.show?"disabled":""," ").concat(q)},Object(b.createElement)("a",{onClick:function(e,t){M.current.navigateTo("searchPage")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(b.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,B(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,x("images");case 4:r=e.sent,M.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:r}),B(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),B(!1),U(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(b.createElement)("div",{ref:M,className:"components-shutterstock-ui__widget-container ".concat(q)}),N.show&&Object(b.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(q)},N.text&&Object(b.createElement)("div",{className:"text"},N.text)),W.show&&Object(b.createElement)(A,{text:W.text}))},te=(r(26),function(){return Object(b.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(b.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(b.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(b.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(b.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(b.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(b.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(b.createElement)("g",{className:"components-shutterstock-logo__o"},Object(b.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(b.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(b.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(b.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(b.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(b.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(b.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(b.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(b.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))}),re=(r(27),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.item,c=e.licenseImage,i=e.subscriptions;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(g.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(b.createElement)(te,null),onRequestClose:r},Object(b.createElement)("div",{style:{width:"100%"}},Object(b.createElement)(ee,{setAttributes:t,closeModal:r,canLicense:n,item:o,licenseImage:c,subscriptions:i}))))});function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,c,s,u,l,p,m,f,y,I,w,h=Object(b.useState)(!1),O=d()(h,2),j=O[0],C=O[1],_=Object(b.useState)(!1),L=d()(_,2),k=L[0],M=L[1],x=Object(b.useState)(!1),E=d()(x,2),D=E[0],N=E[1],T=Object(b.useState)(!1),Z=d()(T,2),B=Z[0],G=Z[1],W=Object(b.useState)([]),z=d()(W,2),H=z[0],R=z[1],U=function(){return C(!0)},F=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",V="editorial"===F,J=shutterstock.permissions,Q=void 0===J?{}:J,Y=Q.includes("can_user_license_all_shutterstock_images"),K=Q.includes("can_user_license_shutterstock_editorial_image"),X=Q.includes("can_user_license_shutterstock_photos"),q=!1;(Y||V&&K||!V&&X)&&(q=!0);var $=function(e){M(e),G(e)},ee=S({onRemoveSnackbar:function(){return $(!1)}}),te=ee.snackbar,ne=ee.setSnackbar;return Object(b.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,c=o.licensedImageUrl,i=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:c,id:s,caption:"Image: ".concat(i,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(c=e.attributes)||void 0===c||null===(s=c.img)||void 0===s?void 0:s.licensedImageUrl]),Object(b.createElement)("div",{className:e.className},Object(b.createElement)("div",null,Object(b.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(b.createElement)(v,null)),Object(b.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(b.createElement)("div",{className:"components-edit__image-container"},Object(b.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(p=e.attributes)||void 0===p||null===(m=p.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return N(!0)}}),q&&D&&!(null===(y=e.attributes)||void 0===y||null===(I=y.img)||void 0===I?void 0:I.licensedImageUrl)&&Object(b.createElement)(g.Button,{disabled:B,onClick:a()(i.a.mark((function t(){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,$(!0),t.next=4,P(null===(r=e.attributes)||void 0===r?void 0:r.img.id,F);case 4:n=t.sent,R(n),U(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),c=t.t0,i=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==c||null===(i=c.data)||void 0===i?void 0:i.statusCode)&&(null==c||null===(s=c.data)||void 0===s?void 0:s.message)&&(a=c.data.message),ne(oe(oe({},te),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var c,i,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(b.createElement)("span",{className:"loading-spinner"}),Object(b.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(b.createElement)("span",null),Object(b.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(b.createElement)(g.Button,{disabled:B,onClick:function(){U(),M(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),j&&Object(b.createElement)(re,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:q,item:null==e||null===(w=e.attributes)||void 0===w?void 0:w.img,licenseImage:k,subscriptions:H}),te.show&&!j&&Object(b.createElement)(A,{text:te.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ce,save:function(e){var t,r,n,c,i;return Object(b.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(c=n.img)||void 0===c||null===(i=c.preview_1500)||void 0===i?void 0:i.url)})},attributes:{img:{type:"object"}}})}]);
     1!function(){"use strict";var e={n:function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,{a:s}),s},d:function(t,s){for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.blocks,s=window.wp.i18n,a=window.wp.element,i=window.wp.components,o=window.wp.data,r=window.React,n=()=>(0,a.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},(0,a.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),(0,a.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),(0,a.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"})),c=window.wp.apiFetch,l=e.n(c),g=window.wp.dom,m="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";const u=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"images",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{return await l()({path:`shutterstock/images/licenses?mediaType=${e}&page=${t}`})}catch(e){throw e}};var d=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image";try{const s="editorial"===t&&shutterstock?.country?`&country=${shutterstock?.country}`:"",a=await l()({path:`shutterstock/user/subscriptions?mediaType=${t}`}),{assets:i,id:o,is_editorial:r}=await l()({path:`shutterstock/images/${e}?mediaType=${t}${s}`}),n=Object.entries(i).filter((e=>{let[t,s]=e;return s.is_licensable})).reduce(((e,t)=>{let[s,a]=t;return{...e,[s]:a}}),{});return a.map((e=>{let s=e?.formats?.filter((e=>{let{size:t,format:s}=e;return!t.match(/supersize/i)&&"tiff"!==s&&"eps"!==s&&void 0!==s})).sort(((e,t)=>e.min_resolution-t.min_resolution)).map((e=>({...e,details_for_image:{...n[`${e.size}_${e.format}`]}})));if("editorial"===t){const e=e=>({small_jpg:"small",medium_jpg:"medium",original:"original"}[e]);s=Object.entries(n||{}).map((t=>{let[s,a]=t;return{details_for_image:a,size:e(s)}}))}return{...e,formats:s}}))}catch(e){throw e}},I=e=>{let{timeout:t=5e3,onRemoveSnackbar:s}=e;const[i,o]=(0,a.useState)({show:!1,text:""});return(0,a.useEffect)((()=>{const e=setTimeout((()=>{o({...i,show:!1,text:""}),s&&s()}),t);return()=>clearTimeout(e)}),[i.show]),{snackbar:i,setSnackbar:o}},p=e=>{let{text:t}=e;return t&&(0,a.createElement)("div",{className:"components-shutterstock-snackbar__container"},(0,a.createElement)(i.Snackbar,null,"Shutterstock: ",t))},w=e=>{let{item:t,isMediaPage:s,commonInsertPreviewProps:a}=e;return{name:"imageDetailsPage",component:ShutterstockWidget.components.ImageDetailsPage,props:{showSearchBar:!0,buttons:s?[]:[{...a,icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="}],item:t}}},h=e=>{let{closeModal:t,handleError:a,isMediaPage:i,routesConfig:o,setAttributes:r,showSnackbar:n,toggleOverlay:c,widgetRef:g}=e;return{name:"imageLicenseHistoryPage",component:ShutterstockWidget.components.ImageLicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:(e,t)=>{let{history:s}=t;g.current.navigateTo("imageDetailsPage",{item:e})},getMoreResults:async e=>await u("images",e+1),licenseHistory:[],overlayActions:[{label:(0,s.__)(i?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:m,onClick:(e,o,g)=>{e.preventDefault(),(async(e,t)=>{const{toggleOverlay:a,licenseId:i,size:o,setAttributes:r,closeModal:n,handleError:c,isMediaPage:g,showSnackbar:m}=t;try{a(!0,(0,s.__)("wordpress:downloading_image","shutterstock"));const t=e?.contributor?.id;let u="";t&&(u=(await l()({path:`shutterstock/contributor/${t}`}))?.data?.[0]?.display_name||t);const{assets:d}=await l()({path:`shutterstock/images/${e.id}?mediaType=images`}),I=await l()({path:`shutterstock/images/licenses/${i}/downloads`,method:"POST",contentType:"application/json",data:{mediaType:"images",size:o,contributorName:u,imageId:e.id,description:e.description,...d?.[`${o}_jpg`]}});if(I?.success){const{url:t,id:i}=I.data;g?g&&m((0,s.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(r({img:{...e,licensedImageUrl:t,contributorName:u,uploadedImageId:i}}),n()),a(!1)}else c(I)}catch(e){a(!1),c(e)}})(o,{...g,toggleOverlay:c,handleError:a,isMediaPage:i,setAttributes:r,showSnackbar:n,closeModal:t})}}]}}};const C=/<\/?[a-z][^>]*?>/gi,_=/\r?\n|\r/gi;var L=e=>{let{setAttributes:t,closeModal:i,canLicense:o=!1,item:n={},licenseImage:c=!1,subscriptions:L=[],isMediaPage:y=!1}=e;const M=shutterstock?.permissions?.includes("can_user_search_editorial_images"),b=(0,r.useRef)(),[k,E]=(0,r.useState)({show:!1,text:""}),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return E({...k,show:e,text:t})},{snackbar:A,setSnackbar:S}=I({timeout:5e3}),x=e=>S({...A,show:!0,text:e}),v=e=>{let t=(0,s.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e?.data?.message),x(t),D(!1)},N={label:(0,s.__)("wordpress:text_insert_preview","shutterstock"),onClick:(e,s)=>{e.preventDefault(),t({img:s}),i()}},P=y?[]:[{...N,icon:m}],T=[w({item:n,commonInsertPreviewProps:N,isMediaPage:y})],Z=w({item:n,commonInsertPreviewProps:N,isMediaPage:y});let B,j;if(o){const e={label:(0,s.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:async(e,t,a)=>{e.preventDefault();try{const e=t.media_type;D(!0,(0,s.__)("wordpress:text_loading_please_wait","shutterstock"));const a=await d(t.id,e);b.current.navigateTo("imageLicensingPage",{item:t,subscriptions:a,searchId:t.searchId}),D(!1)}catch(e){D(!1),v(e)}}};P.push({...e}),Z.props.buttons.push({...e}),B=(e=>{let{item:t,closeModal:a,commonLicensingProps:i,handleError:o,isMediaPage:r,setAttributes:n,showSnackbar:c,subscriptions:g,toggleOverlay:m}=e;return{name:"imageLicensingPage",component:ShutterstockWidget.components.ImageLicensingPage,props:{showSearchBar:!0,buttons:[{...i,onClick:async(e,t,i)=>{const{subscription:g}=i;try{m(!0,(0,s.__)("wordpress:text_licensing_image_please_wait","shutterstock"));const e=t?.contributor?.id,i=t?.media_type,u="editorial"===i;let d=u?t?.byline:"";e&&!u&&(d=(await l()({path:`shutterstock/contributor/${e}`}))?.data?.[0]?.display_name||e);const I=await l()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:{subscription_id:g?.id,size:g?.size,id:t.id,description:t.description,...g?.metadata?{metadata:g.metadata}:{},contributorName:d,...g?.details_for_image,mediaType:i,license:g?.license,country:shutterstock?.country,search_id:t.searchId}});if(I?.success){const{url:e,id:i}=I.data;r?r&&c((0,s.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(n({img:{...t,licensedImageUrl:e,contributorName:d,uploadedImageId:i}}),a()),m(!1)}else o(I)}catch(e){m(!1),o(e)}}}],item:t,subscriptions:g}}})({item:n,closeModal:i,commonLicensingProps:e,handleError:v,isMediaPage:y,licenseImage:c,setAttributes:t,showSnackbar:x,subscriptions:L,toggleOverlay:D}),j=h({closeModal:i,handleError:v,isMediaPage:y,routesConfig:T,setAttributes:t,showSnackbar:x,toggleOverlay:D,widgetRef:b})}(0,r.useEffect)((()=>{const e=[{label:(0,s.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:(0,s.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],t=(e=>{let{isMediaPage:t,overlayActions:a,shutterstock:i,searchBarDropdownFilters:o,userIsAbleToSearchEditorial:r,widgetRef:n}=e;return{name:"searchPage",component:ShutterstockWidget.components.SearchPage,props:{mediaType:"images",imageType:["photo"],subtitle:"",showMore:!0,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:(e,t)=>{e.preventDefault(),n.current.navigateTo("imageDetailsPage",{item:t})},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},overlayActions:a,editorialCountry:i?.country,searchFilters:{showFilterDrawer:!0,images:{orientationFilter:!0},...r?{searchBarDropdownFilters:o}:{}},...t?{}:{searchSuggestions:{enable:!0,textProvider:()=>{const e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return(0,g.__unstableStripHTML)(`${e} ${t}`).replace(C,"").replace(_,"").trim()}},title:(0,s.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")}}}})({isMediaPage:y,overlayActions:P,shutterstock:shutterstock,searchBarDropdownFilters:e,userIsAbleToSearchEditorial:M,widgetRef:b}),a=[...c&&B?[B]:[],t,Z,...!c&&B?[B]:[],...j?[j]:[]],i={container:b.current,key:shutterstock?.api_key,languageCode:shutterstock?.language,customHeaders:{"x-shutterstock-application":`Wordpress/${shutterstock?.version}`},pages:a};if("object"==typeof window&&window.ShutterstockWidget){const e=new window.ShutterstockWidget(i);e.render({}),b.current=e}}),[]);const G=y?"media-page":"";return(0,a.createElement)(a.Fragment,null,o&&(0,a.createElement)("div",{className:`components-shutterstock-ui__navigation ${k.show?"disabled":""} ${G}`},(0,a.createElement)("a",{onClick:(e,t)=>{b.current.navigateTo("searchPage")}},(0,s.__)("wordpress:text_home","shutterstock")),(0,a.createElement)("a",{className:"components-shutterstock-ui__download",onClick:async e=>{try{D(!0,(0,s.__)("wordpress:text_loading_please_wait","shutterstock"));const e=await u("images");b.current.navigateTo("imageLicenseHistoryPage",{licenseHistory:e}),D(!1)}catch(e){D(!1),v(e)}}},(0,s.__)("wordpress:text_downloads","shutterstock"))),(0,a.createElement)("div",{ref:b,className:`components-shutterstock-ui__widget-container ${G}`}),k.show&&(0,a.createElement)("div",{className:`components-shutterstock-ui__widget-container-overlay ${G}`},k.text&&(0,a.createElement)("div",{className:"text"},k.text)),A.show&&(0,a.createElement)(p,{text:A.text}))},y=()=>(0,a.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},(0,a.createElement)("g",{className:"components-shutterstock-logo__stck"},(0,a.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),(0,a.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),(0,a.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),(0,a.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),(0,a.createElement)("g",{className:"components-shutterstock-logo__o"},(0,a.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),(0,a.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),(0,a.createElement)("g",{className:"components-shutterstock-logo__shutter"},(0,a.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),(0,a.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),(0,a.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),(0,a.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),(0,a.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),(0,a.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"})))),M=e=>{let{setAttributes:t,closeModal:s,canLicense:o,item:r,licenseImage:n,subscriptions:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:(0,a.createElement)(y,null),onRequestClose:s},(0,a.createElement)("div",{style:{width:"100%"}},(0,a.createElement)(L,{setAttributes:t,closeModal:s,canLicense:o,item:r,licenseImage:n,subscriptions:c}))))},b=(0,o.withDispatch)((e=>({replaceBlock:e("core/block-editor").replaceBlock})))((e=>{const[o,r]=(0,a.useState)(!1),[c,l]=(0,a.useState)(!1),[g,m]=(0,a.useState)(!1),[u,w]=(0,a.useState)(!1),[h,C]=(0,a.useState)([]),_=()=>r(!0),L=e.attributes?.img?.media_type||"image",y="editorial"===L,{permissions:b={}}=shutterstock,k=b.includes("can_user_license_all_shutterstock_images"),E=b.includes("can_user_license_shutterstock_editorial_image"),D=b.includes("can_user_license_shutterstock_photos");let A=!1;(k||y&&E||!y&&D)&&(A=!0);const S=e=>{l(e),w(e)},{snackbar:x,setSnackbar:v}=I({onRemoveSnackbar:()=>S(!1)});return(0,a.useEffect)((()=>{if(e.attributes?.img?.licensedImageUrl){const{attributes:{img:{licensedImageUrl:s,contributorName:a,uploadedImageId:i,description:o}}}=e,r=(0,t.createBlock)("core/image",{url:s,id:i,caption:`Image: ${a}, Shutterstock`,alt:o,align:"center"});e.replaceBlock(e.clientId,r)}}),[e.attributes?.img?.licensedImageUrl]),(0,a.createElement)("div",{className:e.className},(0,a.createElement)("div",null,(0,a.createElement)("span",{className:"components-edit__shutterstock-icon"},(0,a.createElement)(n,null)),(0,a.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?(0,a.createElement)("div",{className:"components-edit__image-container"},(0,a.createElement)("img",{src:e.attributes?.img?.licensedImageUrl||e.attributes?.img?.preview_1500?.url,onLoad:()=>m(!0)}),A&&g&&!e.attributes?.img?.licensedImageUrl&&(0,a.createElement)(i.Button,{disabled:u,onClick:async()=>{try{S(!0);const t=await d(e.attributes?.img.id,L);C(t),_(),w(!1)}catch(e){(e=>{let t=(0,s.__)("wordpress:text_something_went_wrong","shutterstock");500!==e?.data?.statusCode&&e?.data?.message&&(t=e.data.message),v({...x,show:!0,text:t})})(e)}},className:"components-edit__license-image-button"},u&&(0,a.createElement)("span",{className:"loading-spinner"}),(0,a.createElement)("span",null,(0,s.__)("wordpress:text_license_this_image","shutterstock")))):(0,a.createElement)("span",null),(0,a.createElement)("div",{className:"components-edit__paragraph"},(0,s.__)("wordpress:text_block_paragraph","shutterstock")),(0,a.createElement)(i.Button,{disabled:u,onClick:()=>{_(),l(!1)},className:"components-shutterstock-modal__open-modal-button "},(0,s.__)("wordpress:text_browse","shutterstock")),o&&(0,a.createElement)(M,{setAttributes:e.setAttributes,closeModal:()=>r(!1),canLicense:A,item:e?.attributes?.img,licenseImage:c,subscriptions:h}),x.show&&!o&&(0,a.createElement)(p,{text:x.text}))}));(0,t.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:(0,s.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:n,supports:{html:!1},edit:b,save:function(e){return(0,a.createElement)("img",{alt:(0,s.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:e.attributes?.img?.licensedImageUrl||e.attributes?.img?.preview_1500?.url})},attributes:{img:{type:"object"}}})}();
  • shutterstock/trunk/shutterstock.php

    r2670796 r2671597  
    1616 * Plugin Name:       Shutterstock
    1717 * Description:       Access exceptional, royalty-free content straight from WordPress.
    18  * Version:           1.3.9
     18 * Version:           1.3.10
    1919 * Author:            Shutterstock
    2020 * License:           MIT
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'SHUTTERSTOCK_VERSION', '1.3.9' );
     36define( 'SHUTTERSTOCK_VERSION', '1.3.10' );
    3737
    3838/**
Note: See TracChangeset for help on using the changeset viewer.