(()=>{var e,t={843:(e,t,a)=>{"use strict";const i=window.wp.blocks;(0,window.wp.hooks.addFilter)("blockEditor.useSetting.before","MFB/blockEditor.useSetting.before",((e,t,a,i)=>"mfb/meta-field-block"!==i?e:!!["color.text","color.background","color.link"].includes(t)||e));const n=window.React,l=window.wp.i18n,o=window.wp.blockEditor,r=window.wp.components,s=["div","h1","h2","h3","h4","h5","h6","span","p","header","footer","section"],c={className:"mfb-tagname-dropdown"},d=({value:e})=>(0,n.createElement)("strong",{style:{fontFamily:"sans-serif",fontWeight:800,fontSize:"1.3em",textAlign:"center",letterSpacing:"-1px"}},e.toUpperCase());function p({value:e,onChange:t}){return(0,n.createElement)(r.ToolbarDropdownMenu,{popoverProps:c,label:(0,l.__)("Change tag name","display-a-meta-field-as-block"),text:(0,n.createElement)(d,{value:e}),icon:null,controls:s.map((a=>{{const i=a===e;return{key:a,title:(0,n.createElement)(d,{value:a}),label:a,isActive:i,onClick(){t(a)},role:"menuitemradio"}}}))})}var f=a(856),m=a.n(f),u=a(967),y=a.n(u);const g=({value:e,isLoading:t,fieldType:a,type:i,className:l,TagName:s="div",textAlign:c,prefix:d,suffix:p,prefixSettings:f,suffixSettings:u,displayLayout:g="",showOutline:h=!1})=>{const b="div"===s?"div":"span",_=d?(0,n.createElement)(b,{className:"prefix",style:{...f,...f?.gap?.top?{"--mfb--gap":(0,o.getSpacingPresetCssVar)(f.gap.top)}:{}},dangerouslySetInnerHTML:{__html:m().sanitize(d)}}):null,v=p?(0,n.createElement)(b,{className:"suffix",style:{...u,...u?.gap?.top?{"--mfb--gap":(0,o.getSpacingPresetCssVar)(u.gap.top)}:{}},dangerouslySetInnerHTML:{__html:m().sanitize(p)}}):null;return(0,n.createElement)(s,{...(0,o.useBlockProps)({className:y()(l,{[`is-${i}-field`]:i,[`is-${a}-field`]:a,[`has-text-align-${c}`]:c,[`is-display-${g}`]:g}),style:h?{minHeight:"1em",outline:"1px dashed"}:null})},_,t?(0,n.createElement)(r.Spinner,null):(0,n.createElement)(b,{className:"value",dangerouslySetInnerHTML:{__html:e?m().sanitize(e):e}}),v)},h=({fieldType:e,fieldTypeOptions:t,fieldTypeHelpMessages:a,setAttributes:i,fieldName:o,setFieldName:s,fieldNameHelp:c})=>{var d;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.SelectControl,{label:(0,l.__)("Field type","display-a-meta-field-as-block"),value:e,onChange:e=>i({fieldType:e}),options:t,help:null!==(d=a[e])&&void 0!==d?d:(0,l.__)("Choose a field type","display-a-meta-field-as-block")}),(0,n.createElement)(r.TextControl,{autoComplete:"off",label:(0,l.__)("Field name","display-a-meta-field-as-block"),value:o,onChange:s,help:c}))},b=({setAttributes:e,hideEmpty:t,hasEmptyMessage:a=!0,emptyMessage:i})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.ToggleControl,{label:(0,l.__)("Hide block if the value is empty","display-a-meta-field-as-block"),checked:t,onChange:t=>e({hideEmpty:t})}),!t&&a&&(0,n.createElement)(r.TextControl,{label:(0,l.__)("Empty message","display-a-meta-field-as-block"),value:i,onChange:t=>e({emptyMessage:t}),help:(0,l.__)("Display this text if the value is empty.","display-a-meta-field-as-block")})),_=window.lodash,v=window.wp.element,k=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),E=(0,l.__)("This data type is not supported!","display-a-meta-field-as-block"),x=(0,l.__)("No value","display-a-meta-field-as-block"),T=(0,l.__)("No value","display-a-meta-field-as-block"),S=[{label:(0,l.__)("Default 'meta'","display-a-meta-field-as-block"),value:"meta"},{label:(0,l.__)("ACF - Advanced Custom Fields","display-a-meta-field-as-block"),value:"acf"},{label:(0,l.__)("Dynamic field","display-a-meta-field-as-block"),value:"dynamic"},{label:(0,l.__)("Custom rest field","display-a-meta-field-as-block"),value:"rest_field"}],w={meta:(0,n.createElement)(v.Fragment,null,(0,l.__)("Fields are registered with ","display-a-meta-field-as-block"),(0,n.createElement)(r.ExternalLink,{href:"https://developer.wordpress.org/reference/functions/register_meta/"},"register_meta"),(0,l.__)(" and 'show_in_rest' setting is enable.","display-a-meta-field-as-block")),acf:(0,n.createElement)(v.Fragment,null,(0,l.__)("Fields are registered with ","display-a-meta-field-as-block"),(0,n.createElement)(r.ExternalLink,{href:"https://wordpress.org/plugins/advanced-custom-fields/"},"Advanced Custom Fields"),(0,l.__)(" and 'Show in REST API' setting is ON.","display-a-meta-field-as-block")),rest_field:(0,n.createElement)(v.Fragment,null,(0,l.__)("Fields are registered with ","display-a-meta-field-as-block"),(0,n.createElement)(r.ExternalLink,{href:"https://developer.wordpress.org/reference/functions/register_rest_field/"},"register_rest_field."),(0,l.__)("The 'rest field' and the 'custom field' should be the same name. Or adding a filter for the hook `apply_filters( 'meta_field_block_get_block_content', $content, $attributes, $block, $object_id, $object_type )` to get value for front end.","display-a-meta-field-as-block")),dynamic:(0,n.createElement)(v.Fragment,null,(0,l.__)("You can use any field whose value is a string or can be converted to a string. The changes made by the hook `meta_field_block_get_block_content` can be seen on both the front end and the editor. You can also run a shortcode by inputting it in the field name.","display-a-meta-field-as-block"))},A=["footnotes","_acf_changed"],N=({fieldName:e,fieldType:t,metaFields:a,ACFFields:i,ACFFieldObject:n,restFieldValue:l,settingFieldValue:o,dynamicValue:r})=>{let s;var c;if(e)if("meta"===t)"object"===k(a)&&(s=null!==(c=a[e])&&void 0!==c?c:"");else if("acf"===t){var d;"object"===k(i)&&null!==(d=i[e])&&void 0!==d&&d?s=i[e]:"object"===k(n)&&n?.field?.key===e&&(s=n)}else s="option"===t?o:"dynamic"===t?r:l;return s},C=(0,l.__)("Prefix and suffix","display-a-meta-field-as-block"),F=(0,l.__)("Prefix","display-a-meta-field-as-block"),O=(0,l.__)("Suffix","display-a-meta-field-as-block"),D=window.wp.data,L=window.wp.coreData,M=window.wp.editor,R=window.wp.url,I=window.wp.apiFetch;var H=a.n(I);const j=({setAttributes:e,labelAsPrefix:t,prefix:a,suffix:i,fieldType:o,displayLayout:s})=>(0,n.createElement)(n.Fragment,null,"acf"===o&&(0,n.createElement)(r.ToggleControl,{label:(0,l.__)("Use field label as prefix","display-a-meta-field-as-block"),checked:t,onChange:t=>e({labelAsPrefix:t})}),(0,n.createElement)(r.TextControl,{label:F,value:a,onChange:t=>e({prefix:t}),help:(0,l.__)("Display before the field value.","display-a-meta-field-as-block")}),(0,n.createElement)(r.TextControl,{label:O,value:i,onChange:t=>e({suffix:t}),help:(0,l.__)("Display after the field value.","display-a-meta-field-as-block")}),(0,n.createElement)(r.SelectControl,{label:(0,l.__)("Display layout","display-a-meta-field-as-block"),options:[{value:"inline-block",label:(0,l.__)("Inline block")},{value:"block",label:(0,l.__)("Block")},{value:"",label:(0,l.__)("Auto")}],value:s,onChange:t=>e({displayLayout:t}),help:(0,l.__)("Choose basic layout for prefix, value and suffix. This block does not provide any CSS style for the meta field.","display-a-meta-field-as-block")})),P=({label:e,fontSizeValue:t,fontWeight:a,fontStyle:i,lineHeight:l,onChange:s})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.BaseControl,{label:e}),(0,n.createElement)(r.__experimentalGrid,{className:"typography-settings",columns:2,columnGap:"8px",rowGap:"16px"},(0,n.createElement)("div",{style:{gridColumn:"span 2"}},(0,n.createElement)(o.FontSizePicker,{value:t,onChange:s("fontSize"),withReset:!1,withSlider:!0,__nextHasNoMarginBottom:!0,size:"__unstable-large"})),(0,n.createElement)(o.__experimentalFontAppearanceControl,{value:{fontWeight:a,fontStyle:i},onChange:s("fontAppearance"),hasFontStyles:!0,hasFontWeights:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0}),(0,n.createElement)(o.LineHeightControl,{value:l,onChange:s("lineHeight"),size:"__unstable-large",__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto"}))),z=({setAttributes:e,attributes:t})=>{const{showOutline:a,prefix:i,suffix:s,fieldType:c,labelAsPrefix:d,prefixSettings:p,suffixSettings:f}=t,m=!!i||"acf"===c&&d,u=!!s,y=(0,o.useSetting)("typography.fontSizes"),g=(t,a)=>i=>n=>{if("fontAppearance"!==i)if("fontSize"===i){const e=(0,o.getFontSizeObjectByValue)(y,n).slug;n={fontSizeValue:n,fontSize:e?`var(--wp--preset--font-size--${e}, ${n})`:n}}else n={[i]:n};a=a?{...a,...n}:{...n},e({[t]:a})},h=(t,a)=>i=>{a=a?{...a,gap:i}:{gap:i},e({[t]:a})},b=(0,l.__)("Margin","display-a-meta-field-as-block");return(0,n.createElement)(o.InspectorControls,{group:"styles"},(m||u)&&(0,n.createElement)(r.__experimentalToolsPanel,{label:C,resetAll:()=>{e({prefixSettings:void 0,suffixSettings:void 0})}},m&&(0,n.createElement)(r.__experimentalToolsPanelItem,{label:F,hasValue:()=>m&&p,onDeselect:()=>e({prefixSettings:void 0})},(0,n.createElement)(P,{label:F,...p,onChange:g("prefixSettings",p)}),(0,n.createElement)("div",{style:{marginTop:"16px"}},(0,n.createElement)(o.__experimentalSpacingSizesControl,{label:b,values:p?.gap,onChange:h("prefixSettings",p),sides:["top"],showSideInLabel:!1}))),u&&(0,n.createElement)(r.__experimentalToolsPanelItem,{label:O,hasValue:()=>u&&f,onDeselect:()=>e({suffixSettings:void 0})},(0,n.createElement)(P,{label:O,...f,onChange:g("suffixSettings",f)}),(0,n.createElement)("div",{style:{marginTop:"16px"}},(0,n.createElement)(o.__experimentalSpacingSizesControl,{label:b,values:f?.gap,onChange:h("suffixSettings",f),sides:["top"],showSideInLabel:!1})))),(0,n.createElement)(r.PanelBody,{title:(0,l.__)("Block style settings")},(0,n.createElement)(r.ToggleControl,{label:(0,l.__)("Show block outline","display-a-meta-field-as-block"),checked:a,onChange:t=>e({showOutline:t}),help:(0,l.__)("Highlight the block on the Editor only.","display-a-meta-field-as-block")})))};var U,B;function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t"text"===e?.fieldSettings?.type},{name:"textarea-field",title:(0,l.__)("Textarea","display-a-meta-field-as-block"),description:(0,l.__)("Display a textarea field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"textarea"===e?.fieldSettings?.type},{name:"image-field",title:(0,l.__)("Image","display-a-meta-field-as-block"),description:(0,l.__)("Display a image field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"image"===e?.fieldSettings?.type},{name:"link-field",title:(0,l.__)("Link","display-a-meta-field-as-block"),description:(0,l.__)("Display a link field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"link"===e?.fieldSettings?.type},{name:"select-field",title:(0,l.__)("Select","display-a-meta-field-as-block"),description:(0,l.__)("Display a select field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"select"===e?.fieldSettings?.type},{name:"true_false-field",title:(0,l.__)("True/false","display-a-meta-field-as-block"),description:(0,l.__)("Display a true/false field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"true_false"===e?.fieldSettings?.type},{name:"wysiwyg-field",title:(0,l.__)("Editor","display-a-meta-field-as-block"),description:(0,l.__)("Display a wysiwyg field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"wysiwyg"===e?.fieldSettings?.type},{name:"relationship-field",title:(0,l.__)("Relationship","display-a-meta-field-as-block"),description:(0,l.__)("Display a relationship field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"relationship"===e?.fieldSettings?.type},{name:"post_object-field",title:(0,l.__)("Post Object","display-a-meta-field-as-block"),description:(0,l.__)("Display a post object field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"post_object"===e?.fieldSettings?.type},{name:"number-field",title:(0,l.__)("Number","display-a-meta-field-as-block"),description:(0,l.__)("Display a number field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"number"===e?.fieldSettings?.type},{name:"email-field",title:(0,l.__)("Email","display-a-meta-field-as-block"),description:(0,l.__)("Display an email field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"email"===e?.fieldSettings?.type},{name:"url-field",title:(0,l.__)("URL","display-a-meta-field-as-block"),description:(0,l.__)("Display a URL field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"url"===e?.fieldSettings?.type},{name:"oembed-field",title:(0,l.__)("Embed","display-a-meta-field-as-block"),description:(0,l.__)("Display an embed field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"oembed"===e?.fieldSettings?.type},{name:"page_link-field",title:(0,l.__)("Page link","display-a-meta-field-as-block"),description:(0,l.__)("Display a page link field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"page_link"===e?.fieldSettings?.type},{name:"file-field",title:(0,l.__)("File","display-a-meta-field-as-block"),description:(0,l.__)("Display a file field.","display-a-meta-field-as-block"),scope:[],isActive:e=>"file"===e?.fieldSettings?.type}];(0,i.registerBlockType)(W,{icon:function(e){return n.createElement("svg",q({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 256 256"},e),U||(U=n.createElement("path",{d:"M31.672 74.043q-10.838 0-15.54 3.118-5.275 3.504-5.275 12.698v23.64q0 11.164-9.403 12.531v3.94q9.404 1.424 9.403 12.641v23.42q0 8.1 3.957 11.712 4.587 4.214 16.858 4.214h1.491v-3.777h-.689q-8.143 0-11.467-2.353-3.783-2.627-3.784-10.014v-23.31q0-10.452-10.837-14.557 10.837-3.885 10.837-14.446V90.187q0-6.512 2.808-9.195 3.27-3.118 12.443-3.118h.69v-3.83zm191.166 0v3.831h.689q9.173 0 12.442 3.118 2.808 2.683 2.808 9.195v23.312q0 10.56 10.837 14.446-10.836 4.105-10.837 14.556v23.312q0 7.388-3.784 10.014-3.324 2.354-11.467 2.354h-.688v3.776h1.49q12.271 0 16.857-4.214 3.958-3.612 3.958-11.712v-23.42q0-11.218 9.403-12.641v-3.94q-9.404-1.368-9.403-12.53V89.858q0-9.194-5.276-12.698-4.7-3.118-15.539-3.118z"})),B||(B=n.createElement("path",{d:"M99.742 169.265H83.248v-55.26l-11.917 35.861H59.89l-11.916-35.86v55.26h-15.63v-82.53h19.256l14.465 41.402 14.42-41.402h19.258zm62.478-66.567h-29.577v15.354h27.418v15.962h-27.418v35.251H116.15v-82.53h46.07zm66.449 41.292q0 5.987-1.9 10.698-1.856 4.711-5.138 7.814-3.8 3.659-8.376 5.21-4.533 1.553-11.529 1.553h-28.065v-82.53h24.957q7.772 0 11.356.666 3.627.666 7.167 2.938 3.67 2.383 5.44 6.43 1.814 3.99 1.814 9.144 0 5.986-2.461 10.587-2.461 4.545-6.952 7.095v.443q6.304 1.607 9.974 6.65 3.713 5.044 3.713 13.302m-21.244-33.92q0-2.05-.82-4.1-.776-2.052-2.805-3.049-1.815-.888-4.533-.943-2.678-.11-7.557-.11h-1.556v17.458h2.593q3.928 0 6.691-.166t4.36-1.108q2.246-1.275 2.937-3.27.69-2.051.69-4.711m4.06 33.589q0-3.937-1.21-6.042-1.165-2.161-4.014-3.215-1.944-.72-5.355-.776-3.41-.055-7.123-.055h-3.629v20.563h1.21q6.995 0 10.018-.056 3.022-.055 5.569-1.44 2.59-1.387 3.54-3.66.993-2.326.993-5.32","aria-label":"MFB"})))},edit:function({attributes:e,attributes:{fieldType:t="meta",fieldName:a,fieldSettings:i={},hideEmpty:s,emptyMessage:c="",tagName:d="div",textAlign:f,labelAsPrefix:m,prefix:u,suffix:y,prefixSettings:F,suffixSettings:O,displayLayout:I="",showOutline:P=!1},setAttributes:U,isSelected:B,context:{postId:q,postType:W}}){const{postId:G,postType:V}=(({postType:e,postId:t})=>{const{getCurrentPostId:a,getCurrentPostType:i}=(0,D.useSelect)(M.store);return e||(e=i()),t||(t=a()),{postType:e,postId:t}})({postId:q,postType:W}),{data:$,loading:Y}=((e,t={},a=[])=>{const[i,n]=(0,v.useState)(!1),[l,o]=(0,v.useState)(),[r,s]=(0,v.useState)();a=[e.fieldType,e.fieldName,...a];const c=(0,v.useCallback)((()=>{n(!0),o(void 0),s(void 0),H()({path:(0,R.addQueryArgs)("/mfb/v1/getDynamicField",{attributes:e,...t}),headers:{"Content-Type":"application/json"},method:"GET"}).then(s).catch(o).finally((()=>n(!1)))}),a);return(0,v.useEffect)((()=>{var t,a;"dynamic"===(null!==(t=e.fieldType)&&void 0!==t?t:"")&&null!==(a=e.fieldName)&&void 0!==a&&a?c():(l&&o(void 0),r&&s(void 0))}),[c]),{loading:i,error:l,data:r}})(e,{postId:G}),{ACFFields:K,metaFields:X,restFieldNames:Z,restFieldValue:J}=(({kind:e="postType",name:t,id:a,fieldName:i})=>{const[n]=(0,L.useEntityProp)(e,t,"acf",a),[l]=(0,L.useEntityProp)(e,t,"meta",a),[o]=(0,L.useEntityProp)(e,t,"mfb_rest_fields",a),[r]=(0,L.useEntityProp)(e,t,i,a);return{ACFFields:n,metaFields:l,restFieldNames:o,restFieldValue:r}})({name:V,id:G,fieldName:a}),[Q,ee]=(({value:e,onChange:t,delay:a=500})=>{const[i,n]=(0,v.useState)(e),l=((e,t=500)=>{const[a,i]=(0,v.useState)(e);let n;return(0,v.useEffect)((()=>(n&&clearTimeout(n),n=setTimeout((()=>{i(e)}),t),()=>clearTimeout(n))),[e,t]),a})(i,a),o=(0,v.useCallback)(t);return(0,v.useEffect)((()=>{l!==e&&o(l)}),[l,e,o]),[i,n]})({value:a,onChange:e=>{let a={fieldName:e,fieldSettings:{...i,type:void 0,key:void 0}};if("acf"===t){const l=N({fieldType:t,fieldName:e,ACFFields:K});if("object"===k(l)){var n;const e=null!==(n=l?.field)&&void 0!==n?n:{};a={...a,fieldSettings:{...i,type:e?.type,key:e?.key}}}}U(a)}}),te=N({fieldType:t,fieldName:a,metaFields:X,ACFFields:K,restFieldValue:J,dynamicValue:$}),ae=(({fieldType:e,fieldName:t,hideEmpty:a,emptyMessage:i,rawValue:n})=>{let o;return t?(0,_.isNil)(n)?o=(0,l.sprintf)((0,l.__)("MFB - %s","display-a-meta-field-as-block"),t):(o=n,"acf"===e&&"object"===k(n)&&(o=n?.simple_value_formatted),o=(({fieldValue:e,hideEmpty:t,emptyMessage:a})=>(e&&["object","array"].includes(k(e))&&(e=E),e||0===e||(e=t?x:a||T),e))({fieldValue:o,hideEmpty:a,emptyMessage:i})):o=(0,l.__)('This is the Meta Field Block. Please input "Field Name"',"display-a-meta-field-as-block"),o})({rawValue:te,fieldType:t,fieldName:a,hideEmpty:s,emptyMessage:c}),ie=(({fieldType:e,metaFields:t,ACFFields:a,restFieldNames:i,settingFieldNames:o})=>{let r,s=(0,l.__)("Input the field name. ","display-a-meta-field-as-block");"meta"===e?"object"===k(t)&&(r=Object.keys((0,_.omit)(t,A))):"acf"===e?"object"===k(a)&&(r=Object.keys(a)):"rest_field"===e?r=i:"option"===e&&(r=o);let c=null;return r&&r.length&&(c=r.map(((e,t)=>(0,n.createElement)(v.Fragment,{key:e},(0,n.createElement)("code",{key:e},e),t{let t="";var a;return"object"===k(e)&&(t=null!==(a=e?.field?.label)&&void 0!==a?a:""),t})(te):"");return(0,n.createElement)(n.Fragment,null,B&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.BlockControls,{group:"block"},(0,n.createElement)(p,{value:d,onChange:e=>U({tagName:e})}),(0,n.createElement)(o.AlignmentControl,{value:f,onChange:e=>U({textAlign:e})})),(0,n.createElement)(o.InspectorControls,{group:"settings"},(0,n.createElement)(r.PanelBody,{title:(0,l.__)("Meta field settings","display-a-meta-field-as-block")},(0,n.createElement)(h,{setAttributes:U,fieldType:t,fieldTypeOptions:S,fieldTypeHelpMessages:w,fieldName:Q,setFieldName:ee,fieldNameHelp:ie}),(0,n.createElement)(b,{setAttributes:U,hideEmpty:s,emptyMessage:c})),(0,n.createElement)(r.PanelBody,{title:C,initialOpen:!(!ne&&!y)},(0,n.createElement)(j,{setAttributes:U,prefix:u,suffix:y,labelAsPrefix:m,fieldType:t,displayLayout:I}))),(0,n.createElement)(z,{setAttributes:U,attributes:e})),(0,n.createElement)(g,{value:ae,fieldType:t,isLoading:Y,TagName:d,textAlign:f,prefix:ne,suffix:y,prefixSettings:F,suffixSettings:O,displayLayout:I,showOutline:P}))},variations:G})},856:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,a){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,a)}function a(e,i,n){return a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,a,i){var n=[null];n.push.apply(n,a);var l=new(Function.bind.apply(e,n));return i&&t(l,i.prototype),l},a.apply(null,arguments)}function i(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(e,t):void 0}}(e)||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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,i=new Array(t);a1?a-1:0),n=1;n/gm),G=p(/\${[\w\W]*}/gm),V=p(/^data-[\-\w.\u00B7-\uFFFF]/),$=p(/^aria-[\-\w]+$/),Y=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=p(/^(?:\w+script|data):/i),X=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=p(/^html$/i),J=function(){return"undefined"==typeof window?null:window};return function t(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J(),n=function(e){return t(e)};if(n.version="2.4.7",n.removed=[],!a||!a.document||9!==a.document.nodeType)return n.isSupported=!1,n;var l=a.document,o=a.document,r=a.DocumentFragment,s=a.HTMLTemplateElement,c=a.Node,p=a.Element,f=a.NodeFilter,m=a.NamedNodeMap,u=void 0===m?a.NamedNodeMap||a.MozNamedAttrMap:m,y=a.HTMLFormElement,g=a.DOMParser,N=a.trustedTypes,Q=p.prototype,ee=O(Q,"cloneNode"),te=O(Q,"nextSibling"),ae=O(Q,"childNodes"),ie=O(Q,"parentNode");if("function"==typeof s){var ne=o.createElement("template");ne.content&&ne.content.ownerDocument&&(o=ne.content.ownerDocument)}var le=function(t,a){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var i=null,n="data-tt-policy-suffix";a.currentScript&&a.currentScript.hasAttribute(n)&&(i=a.currentScript.getAttribute(n));var l="dompurify"+(i?"#"+i:"");try{return t.createPolicy(l,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+l+" could not be created."),null}}(N,l),oe=le?le.createHTML(""):"",re=o,se=re.implementation,ce=re.createNodeIterator,de=re.createDocumentFragment,pe=re.getElementsByTagName,fe=l.importNode,me={};try{me=F(o).documentMode?o.documentMode:{}}catch(e){}var ue={};n.isSupported="function"==typeof ie&&se&&void 0!==se.createHTMLDocument&&9!==me;var ye,ge,he=q,be=W,_e=G,ve=V,ke=$,Ee=K,xe=X,Te=Y,Se=null,we=C({},[].concat(i(D),i(L),i(M),i(I),i(j))),Ae=null,Ne=C({},[].concat(i(P),i(z),i(U),i(B))),Ce=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Fe=null,Oe=null,De=!0,Le=!0,Me=!1,Re=!0,Ie=!1,He=!1,je=!1,Pe=!1,ze=!1,Ue=!1,Be=!1,qe=!0,We=!1,Ge=!0,Ve=!1,$e={},Ye=null,Ke=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Xe=null,Ze=C({},["audio","video","img","source","image","track"]),Je=null,Qe=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",it=at,nt=!1,lt=null,ot=C({},[et,tt,at],k),rt=["application/xhtml+xml","text/html"],st=null,ct=o.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},pt=function(t){st&&st===t||(t&&"object"===e(t)||(t={}),t=F(t),ye=ye=-1===rt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ge="application/xhtml+xml"===ye?k:v,Se="ALLOWED_TAGS"in t?C({},t.ALLOWED_TAGS,ge):we,Ae="ALLOWED_ATTR"in t?C({},t.ALLOWED_ATTR,ge):Ne,lt="ALLOWED_NAMESPACES"in t?C({},t.ALLOWED_NAMESPACES,k):ot,Je="ADD_URI_SAFE_ATTR"in t?C(F(Qe),t.ADD_URI_SAFE_ATTR,ge):Qe,Xe="ADD_DATA_URI_TAGS"in t?C(F(Ze),t.ADD_DATA_URI_TAGS,ge):Ze,Ye="FORBID_CONTENTS"in t?C({},t.FORBID_CONTENTS,ge):Ke,Fe="FORBID_TAGS"in t?C({},t.FORBID_TAGS,ge):{},Oe="FORBID_ATTR"in t?C({},t.FORBID_ATTR,ge):{},$e="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Le=!1!==t.ALLOW_DATA_ATTR,Me=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Ie=t.SAFE_FOR_TEMPLATES||!1,He=t.WHOLE_DOCUMENT||!1,ze=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,Be=t.RETURN_TRUSTED_TYPE||!1,Pe=t.FORCE_BODY||!1,qe=!1!==t.SANITIZE_DOM,We=t.SANITIZE_NAMED_PROPS||!1,Ge=!1!==t.KEEP_CONTENT,Ve=t.IN_PLACE||!1,Te=t.ALLOWED_URI_REGEXP||Te,it=t.NAMESPACE||at,Ce=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&dt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&dt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Le=!1),Ue&&(ze=!0),$e&&(Se=C({},i(j)),Ae=[],!0===$e.html&&(C(Se,D),C(Ae,P)),!0===$e.svg&&(C(Se,L),C(Ae,z),C(Ae,B)),!0===$e.svgFilters&&(C(Se,M),C(Ae,z),C(Ae,B)),!0===$e.mathMl&&(C(Se,I),C(Ae,U),C(Ae,B))),t.ADD_TAGS&&(Se===we&&(Se=F(Se)),C(Se,t.ADD_TAGS,ge)),t.ADD_ATTR&&(Ae===Ne&&(Ae=F(Ae)),C(Ae,t.ADD_ATTR,ge)),t.ADD_URI_SAFE_ATTR&&C(Je,t.ADD_URI_SAFE_ATTR,ge),t.FORBID_CONTENTS&&(Ye===Ke&&(Ye=F(Ye)),C(Ye,t.FORBID_CONTENTS,ge)),Ge&&(Se["#text"]=!0),He&&C(Se,["html","head","body"]),Se.table&&(C(Se,["tbody"]),delete Fe.tbody),d&&d(t),st=t)},ft=C({},["mi","mo","mn","ms","mtext"]),mt=C({},["foreignobject","desc","title","annotation-xml"]),ut=C({},["title","style","font","a","script"]),yt=C({},L);C(yt,M),C(yt,R);var gt=C({},I);C(gt,H);var ht=function(e){_(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},bt=function(e,t){try{_(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){_(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ae[e])if(ze||Ue)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){var t,a;if(Pe)e=""+e;else{var i=E(e,/^[\r\n\t ]+/);a=i&&i[0]}"application/xhtml+xml"===ye&&it===at&&(e=''+e+"");var n=le?le.createHTML(e):e;if(it===at)try{t=(new g).parseFromString(n,ye)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(it,"template",null);try{t.documentElement.innerHTML=nt?oe:n}catch(e){}}var l=t.body||t.documentElement;return e&&a&&l.insertBefore(o.createTextNode(a),l.childNodes[0]||null),it===at?pe.call(t,He?"html":"body")[0]:He?t.documentElement:l},vt=function(e){return ce.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},kt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Et=function(e,t,a){ue[e]&&h(ue[e],(function(e){e.call(n,t,a,st)}))},xt=function(e){var t,a;if(Et("beforeSanitizeElements",e,null),(a=e)instanceof y&&("string"!=typeof a.nodeName||"string"!=typeof a.textContent||"function"!=typeof a.removeChild||!(a.attributes instanceof u)||"function"!=typeof a.removeAttribute||"function"!=typeof a.setAttribute||"string"!=typeof a.namespaceURI||"function"!=typeof a.insertBefore||"function"!=typeof a.hasChildNodes))return ht(e),!0;if(w(/[\u0080-\uFFFF]/,e.nodeName))return ht(e),!0;var i=ge(e.nodeName);if(Et("uponSanitizeElement",e,{tagName:i,allowedTags:Se}),e.hasChildNodes()&&!kt(e.firstElementChild)&&(!kt(e.content)||!kt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return ht(e),!0;if("select"===i&&w(/