File: /home/ykk9qst4f1zf/public_html/wp-content/plugins/safe-svg/dist/safe-svg-block.js
(()=>{var e={2694:(e,t,r)=>{"use strict";var n=r(6925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},5556:(e,t,r)=>{e.exports=r(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=a(e,o(r)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=a(t,r));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},8597:(e,t)=>{"use strict";var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function o(e){this.parameters=Object.create(null),this.type=e}t.q=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var a=t.indexOf(";"),s=-1!==a?t.slice(0,a).trim():t.trim();if(!i.test(s))throw new TypeError("invalid media type");var l=new o(s.toLowerCase());if(-1!==a){var c,u,p;for(r.lastIndex=a;u=r.exec(t);){if(u.index!==a)throw new TypeError("invalid parameter format");a+=u[0].length,c=u[1].toLowerCase(),34===(p=u[2]).charCodeAt(0)&&-1!==(p=p.slice(1,-1)).indexOf("\\")&&(p=p.replace(n,"$1")),l.parameters[c]=p}if(a!==t.length)throw new TypeError("invalid parameter format")}return l}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks;var n=r(5556),i=r.n(n);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(null,arguments)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function s(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var l=r(8597),c=new Map,u=function(e){return e.cloneNode(!0)},p=function(){return"file:"===window.location.protocol},d=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===n.readyState){var t=n.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var i=(0,l.q)(t).type;if("image/svg+xml"!==i&&"text/plain"!==i)throw new Error("Invalid content type: ".concat(i))}if(4===n.readyState){if(404===n.status||null===n.responseXML)throw new Error(p()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===n.status||p()&&0===n.status))throw new Error("There was a problem injecting the SVG: "+n.status+" "+n.statusText);r(null,n)}}catch(e){if(n.abort(),!(e instanceof Error))throw e;r(e,n)}},n.open("GET",e),n.withCredentials=t,n.overrideMimeType&&n.overrideMimeType("text/xml"),n.send()},f={},h=function(e,t){f[e]=f[e]||[],f[e].push(t)},g=function(e,t,r){if(c.has(e)){var n=c.get(e);if(void 0===n)return void h(e,r);if(n instanceof SVGSVGElement)return void r(null,u(n))}c.set(e,void 0),h(e,r),d(e,t,(function(t,r){var n;t?c.set(e,t):(null===(n=r.responseXML)||void 0===n?void 0:n.documentElement)instanceof SVGSVGElement&&c.set(e,r.responseXML.documentElement),function(e){for(var t=function(t,r){setTimeout((function(){if(Array.isArray(f[e])){var r=c.get(e),n=f[e][t];r instanceof SVGSVGElement&&n(null,u(r)),r instanceof Error&&n(r),t===f[e].length-1&&delete f[e]}}),0)},r=0,n=f[e].length;r<n;r++)t(r)}(e)}))},v=function(e,t,r){d(e,t,(function(e,t){var n;e?r(e):(null===(n=t.responseXML)||void 0===n?void 0:n.documentElement)instanceof SVGSVGElement&&r(null,t.responseXML.documentElement)}))},m=0,w=[],y={},b="http://www.w3.org/1999/xlink",S=function(e,t,r,n,i,o,a){var l=e.getAttribute("data-src")||e.getAttribute("src");if(l){if(-1!==w.indexOf(e))return w.splice(w.indexOf(e),1),void(e=null);w.push(e),e.setAttribute("src",""),(n?g:v)(l,i,(function(n,i){if(!i)return w.splice(w.indexOf(e),1),e=null,void a(n);var c=e.getAttribute("id");c&&i.setAttribute("id",c);var u=e.getAttribute("title");u&&i.setAttribute("title",u);var p=e.getAttribute("width");p&&i.setAttribute("width",p);var d=e.getAttribute("height");d&&i.setAttribute("height",d);var f=Array.from(new Set(s(s(s([],(i.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();i.setAttribute("class",f);var h=e.getAttribute("style");h&&i.setAttribute("style",h),i.setAttribute("data-src",l);var g=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(g,(function(e){e.name&&e.value&&i.setAttribute(e.name,e.value)})),r){var v,S,x,E,A,j={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(j).forEach((function(e){v=e,x=j[e];for(var t=function(e,t){var r;E=S[e].id,A=E+"-"+ ++m,Array.prototype.forEach.call(x,(function(e){for(var t=0,n=(r=i.querySelectorAll("["+e+'*="'+E+'"]')).length;t<n;t++){var o=r[t].getAttribute(e);o&&!o.match(new RegExp('url\\("?#'+E+'"?\\)'))||r[t].setAttribute(e,"url(#"+A+")")}}));for(var n=i.querySelectorAll("[*|href]"),o=[],a=0,s=n.length;a<s;a++){var l=n[a].getAttributeNS(b,"href");l&&l.toString()==="#"+S[e].id&&o.push(n[a])}for(var c=0,u=o.length;c<u;c++)o[c].setAttributeNS(b,"href","#"+A);S[e].id=A},r=0,n=(S=i.querySelectorAll(v+"[id]")).length;r<n;r++)t(r)}))}i.removeAttribute("xmlns:a");for(var _,R,I=i.querySelectorAll("script"),C=[],O=0,k=I.length;O<k;O++)(R=I[O].getAttribute("type"))&&"application/ecmascript"!==R&&"application/javascript"!==R&&"text/javascript"!==R||((_=I[O].innerText||I[O].textContent)&&C.push(_),i.removeChild(I[O]));if(C.length>0&&("always"===t||"once"===t&&!y[l])){for(var T=0,W=C.length;T<W;T++)new Function(C[T])(window);y[l]=!0}var q=i.querySelectorAll("style");if(Array.prototype.forEach.call(q,(function(e){e.textContent+=""})),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink",b),o(i),!e.parentNode)return w.splice(w.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(i,e),w.splice(w.indexOf(e),1),e=null,a(null,i)}))}else a(new Error("Invalid data-src or src attribute"))};const x=window.React;var E=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],A="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xlink",_=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,a(t,r);var i=n.prototype;return i.renderSVG=function(){var e,t=this;if(this.reactWrapper instanceof(e=this.reactWrapper,((null==e?void 0:e.ownerDocument)||document).defaultView||window).Node){var r,n,i=this.props,o=i.desc,a=i.evalScripts,s=i.httpRequestWithCredentials,l=i.renumerateIRIElements,c=i.src,u=i.title,p=i.useRequestCache,d=this.props.onError,f=this.props.beforeInjection,h=this.props.afterInjection,g=this.props.wrapper;"svg"===g?((r=document.createElementNS(A,g)).setAttribute("xmlns",A),r.setAttribute("xmlns:xlink",j),n=document.createElementNS(A,g)):(r=document.createElement(g),n=document.createElement(g)),r.appendChild(n),n.dataset.src=c,this.nonReactWrapper=this.reactWrapper.appendChild(r);var v=function(e){t.removeSVG(),t._isMounted?t.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){d(e)})):d(e)};!function(e,t){var r=void 0===t?{}:t,n=r.afterAll,i=void 0===n?function(){}:n,o=r.afterEach,a=void 0===o?function(){}:o,s=r.beforeEach,l=void 0===s?function(){}:s,c=r.cacheRequests,u=void 0===c||c,p=r.evalScripts,d=void 0===p?"never":p,f=r.httpRequestWithCredentials,h=void 0!==f&&f,g=r.renumerateIRIElements,v=void 0===g||g;if(e&&"length"in e)for(var m=0,w=0,y=e.length;w<y;w++)S(e[w],d,v,u,h,l,(function(t,r){a(t,r),e&&"length"in e&&e.length===++m&&i(m)}));else e?S(e,d,v,u,h,l,(function(t,r){a(t,r),i(1),e=null})):i(0)}(n,{afterEach:function(e,r){e?v(e):t._isMounted&&t.setState((function(){return{isLoading:!1}}),(function(){try{h(r)}catch(e){v(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var r=document.createElement("desc");r.innerHTML=o,e.prepend(r)}if(u){var n=e.querySelector(":scope > title");n&&e.removeChild(n);var i=document.createElement("title");i.innerHTML=u,e.prepend(i)}try{f(e)}catch(e){v(e)}},cacheRequests:p,evalScripts:a,httpRequestWithCredentials:s,renumerateIRIElements:l})}},i.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},i.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},i.componentDidUpdate=function(e){var t=this;(function(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1})(o({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},i.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},i.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var r=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var n=e.wrapper,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,E),a=n;return x.createElement(a,o({},i,{ref:this.refCallback},"svg"===n?{xmlns:A,xmlnsXlink:j}:{}),this.state.isLoading&&r&&x.createElement(r,null),this.state.hasError&&t&&x.createElement(t,null))},n}(x.Component);_.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},_.propTypes={afterInjection:n.func,beforeInjection:n.func,desc:n.string,evalScripts:n.oneOf(["always","once","never"]),fallback:n.oneOfType([n.func,n.object,n.string]),httpRequestWithCredentials:n.bool,loading:n.oneOfType([n.func,n.object,n.string]),onError:n.func,renumerateIRIElements:n.bool,src:n.string.isRequired,title:n.string,useRequestCache:n.bool,wrapper:n.oneOf(["div","span","svg"])};var R=r(6942),I=r.n(R);const C=window.wp.components,O=window.wp.blockEditor,k=window.ReactJSXRuntime,T=({attributes:t,setAttributes:r})=>{const{contentPostType:n,svgURL:i,type:o,imageID:a,imageSizes:s,alignment:l,imageWidth:c,imageHeight:u,dimensionWidth:p,dimensionHeight:d,textColor:f}=t,h=(0,O.useBlockProps)({className:"wp-block-safe-svg-svg-icon safe-svg-cover",style:{textAlign:l}}),{className:g,style:v,...m}=h;delete v.textAlign,m.style={textAlign:l};const w=g.replace(/has-[\w-]*-color|has-background/g,"").trim();m.className=w,v.width=`${p}px`,v.height=`${d}px`;const y=["image/svg+xml"],b=e=>{var t;if(!e.sizes&&!e.media_details?.sizes)return;e.media_details&&(e.sizes=e.media_details.sizes);const n=null!==(t=e.sizes.full.url)&&void 0!==t?t:e.sizes.full.source_url;r({imageSizes:{full:e.sizes.full,medium:e.sizes.medium,thumbnail:e.sizes.thumbnail},imageWidth:e.sizes.full.width,imageHeight:e.sizes.full.height,dimensionWidth:e.sizes.full.width,dimensionHeight:e.sizes.full.height,imageID:e.id,svgURL:n,type:"full"})},S=[{value:"full",label:(0,e.__)("Full Size","safe-svg")},{value:"medium",label:(0,e.__)("Medium","safe-svg")},{value:"thumbnail",label:(0,e.__)("Thumbnail","safe-svg")}];return(0,k.jsxs)(k.Fragment,{children:[i&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(O.InspectorControls,{children:(0,k.jsx)(C.PanelBody,{title:(0,e.__)("Image settings","safe-svg"),children:(0,k.jsx)(O.__experimentalImageSizeControl,{width:p,height:d,imageWidth:c,imageHeight:u,imageSizeOptions:S,slug:o,onChange:e=>{var t,n;e.width||e.height||(e.width=parseInt(s[o].width),e.height=parseInt(s[o].height)),r({dimensionWidth:null!==(t=e.width)&&void 0!==t?t:p,dimensionHeight:null!==(n=e.height)&&void 0!==n?n:d})},onChangeImage:e=>{var t;const n=null!==(t=s[e].url)&&void 0!==t?t:s[e].source_url;if(!n)return null;let i=parseInt(s[e].width),o=parseInt(s[e].height);"full"!==e&&(s[e].width>=s[e].height?o=s[e].height*s.full.height/s.full.width:i=s[e].width*s.full.width/s.full.height),r({svgURL:n,imageWidth:i,imageHeight:o,dimensionWidth:i,dimensionHeight:o,type:e})}})})}),(0,k.jsx)(O.BlockControls,{children:(0,k.jsx)(O.AlignmentToolbar,{value:l,onChange:e=>r({alignment:e})})}),(0,k.jsx)(O.BlockControls,{children:(0,k.jsx)(O.MediaReplaceFlow,{mediaId:a,mediaURL:i,allowedTypes:y,accept:y,onSelect:b,onError:t=>{console.log((0,e.__)(`Something went wrong, please try again. Message: ${t}`,"safe-svg"))}})})]}),!i&&(0,k.jsx)(O.MediaPlaceholder,{onSelect:b,allowedTypes:y,accept:y,value:a,labels:{title:(0,e.__)("Inline SVG","safe-svg"),instructions:(0,e.__)("Upload an SVG or pick one from your media library.","safe-svg")}}),i&&(0,k.jsx)("div",{...m,children:(0,k.jsx)("div",{style:v,className:I()("safe-svg-inside",(0,O.getColorClassName)("color",f)||""),children:(0,k.jsx)(_,{src:i,beforeInjection:e=>{e.setAttribute("style",`width: ${p}px; height: ${d}px;`)}})})}),n&&(0,k.jsx)(C.Placeholder,{label:(0,e.__)("SafeSvg","safe-svg"),children:(0,k.jsx)("p",{children:(0,e.__)("Please select the SVG icon.","safe-svg")})})]})};T.propTypes={attributes:i().shape({svgURL:i().string,alignment:i().string,imageID:i().number,imageWidth:i().number,imageHeight:i().number,dimensionWidth:i().number,dimensionHeight:i().number,imageSizes:i().object}).isRequired,className:i().string,clientId:i().string,setAttributes:i().func.isRequired};const W=T,q=JSON.parse('{"UU":"safe-svg/svg-icon"}');(0,t.registerBlockType)(q.UU,{title:(0,e.__)("Inline SVG","safe-svg"),description:(0,e.__)("Display an SVG icon","safe-svg"),edit:W,save:()=>null,icon:{src:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"800",height:"800",viewBox:"0 0 512 512",children:(0,k.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M321.838 42.667H87.171v234.666h42.667v-192h174.293l81.707 81.707v110.293h42.667v-128L321.838 42.667ZM85.333 441.734l4.17-24.65c14.68 6.163 27.126 9.244 37.337 9.244 6.645 0 11.54-1.631 14.68-4.894 2.72-2.84 4.079-6.313 4.079-10.422 0-3.685-1.33-6.555-3.988-8.61-2.658-2.053-9.213-5.225-19.665-9.515-7.734-3.202-13.186-5.588-16.358-7.16-3.172-1.57-6.087-3.352-8.745-5.346-7.552-5.619-11.328-13.715-11.328-24.287 0-9.123 2.477-17.129 7.43-24.016 7.613-10.694 20.12-16.04 37.52-16.04 12.566 0 26.22 2.325 40.962 6.977l-5.8 23.563c-8.7-3.202-15.24-5.317-19.62-6.344-4.38-1.027-8.957-1.54-13.73-1.54-5.437 0-9.576 1.208-12.416 3.625-2.96 2.597-4.44 5.89-4.44 9.878 0 3.443 1.253 6.147 3.76 8.11 2.508 1.964 8.535 4.91 18.08 8.837 9.486 3.927 15.77 6.66 18.85 8.201a55.772 55.772 0 0 1 8.7 5.392c7.432 5.68 11.147 14.35 11.147 26.01 0 13.775-4.682 24.197-14.047 31.265-7.975 5.982-19.152 8.972-33.53 8.972-14.984 0-29.333-2.417-43.048-7.25Zm146.722 4.985L183.39 318.303h30.087l21.388 57.637c5.437 14.682 9.515 26.765 12.234 36.25 4.169-13.291 8.126-24.982 11.872-35.071l22.022-58.816h28.637l-48.665 128.416h-28.91ZM429.8 374.853v65.522c-7.37 2.477-12.567 4.108-15.588 4.894-9.364 2.477-19.424 3.715-30.178 3.715-21.146 0-37.247-5.317-48.303-15.95-12.264-11.72-18.397-28.063-18.397-49.028 0-24.106 7.613-42.292 22.838-54.556 11.056-8.942 25.979-13.413 44.769-13.413 16.07 0 31.024 2.93 44.859 8.79l-9.878 22.567c-6.525-3.263-12.235-5.544-17.128-6.843-4.894-1.299-10.271-1.948-16.132-1.948-14.016 0-24.347 4.561-30.993 13.684-5.619 7.734-8.428 17.914-8.428 30.54 0 15.165 4.229 26.584 12.687 34.257 6.767 6.163 15.165 9.244 25.194 9.244 5.86 0 11.419-.997 16.675-2.99v-25.829h-22.113v-22.656H429.8Z"})})}})})()})();