FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
progress-bar
/
build
Edit File: index.js
(()=>{"use strict";var e,l={746:()=>{const e=window.wp.blocks,l=window.wp.i18n,o=window.wp.blockEditor,a=window.wp.components,t=window.wp.element,n=window.wp.compose,r=window.ReactJSXRuntime,s=()=>(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,r.jsx)("p",{children:(0,r.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M0 34.7721L6.88004 38.677V15.8055L20.4542 7.80977L23.9872 9.4833L30.4953 5.57841L20.4542 -7.62939e-06L0 11.9006V34.7721Z",fill:"#38DAC7"}),(0,r.jsx)("path",{d:"M32.9284 6.87939L34.2126 7.61318L12.3825 19.904L12.1991 40.45L20.6376 45.8616L41.0001 33.6625V35.4969L20.6376 47.6043L10.8232 41.2755V18.9868L32.9284 6.87939Z",fill:"#5566CA"}),(0,r.jsx)("path",{d:"M37.6063 9.53936L36.2305 8.71385L14.217 21.3716V38.9824L20.5459 43.5685L41.0001 31.3694V29.5349L20.5459 41.8258L15.5928 38.2486V22.1054L37.6063 9.53936Z",fill:"#5566CA"}),(0,r.jsx)("path",{d:"M41.0001 11.3738L39.5325 10.5483L17.3356 23.2061V37.2397L20.5459 39.6244L41.0001 27.4253V25.6826L20.5459 37.79L18.9866 36.5976V24.1233L41.0001 11.3738Z",fill:"#5566CA"})]})}),(0,r.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,l.__)("Access Without Limits!","cozy-addons")}),(0,r.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,l.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,r.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,r.jsx)("button",{className:"cozy-block-premium-button",style:{backgroundColor:"#5566ca",borderRadius:"20px",padding:"10px",border:"none",color:"#fff",fontFamily:"Inter",fontSize:"10px",fontWeight:"500",cursor:"pointer"},children:(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,r.jsx)("div",{children:(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M9.29768 0.0630875L0.24397 5.2847C-0.109583 5.48778 -0.0646564 5.97987 0.286944 6.12828L2.36334 6.99919L7.97527 2.05487C8.0827 1.95919 8.23506 2.10565 8.14325 2.21695L3.43767 7.94822V9.52017C3.43767 9.98102 3.99437 10.1626 4.26784 9.8287L5.50821 8.31924L7.94206 9.33857C8.21943 9.45573 8.53588 9.28194 8.58666 8.98317L9.99306 0.547365C10.0595 0.152913 9.6356 -0.132186 9.29768 0.0630875Z",fill:"white"})})}),(0,r.jsx)("div",{children:(0,l.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),i=[{label:(0,l.__)("Thin","cozy-addons"),value:"100"},{label:(0,l.__)("Extra Light","cozy-addons"),value:"200"},{label:(0,l.__)("Light","cozy-addons"),value:"300"},{label:(0,l.__)("Normal","cozy-addons"),value:"400"},{label:(0,l.__)("Medium","cozy-addons"),value:"500"},{label:(0,l.__)("Semi Bold","cozy-addons"),value:"600"},{label:(0,l.__)("Bold","cozy-addons"),value:"700"},{label:(0,l.__)("Extra Bold","cozy-addons"),value:"800"}],d=(0,t.memo)((({attributes:e,clientId:o,blockId:a})=>{const t=`\n #${a}, .${a} .label-wrapper.display-flex.justify-spread {\n font: ${e.typography.fontWeight} ${e.typography.fontSize}px ${e.typography.fontFamily};\n color: ${e.typography.color};\n }\n #${a} .before-progress, #${a} .after-progress, .${a} .label-wrapper.display-flex.justify-spread .before-progress, .${a} .label-wrapper.display-flex.justify-spread .after-progress {\n font: ${e.labelTypography.fontWeight} ${e.labelTypography.fontSize}px ${e.labelTypography.fontFamily};\n color: ${e.labelTypography.color};\n }\n .${a} .label-wrapper.display-flex.justify-spread {\n margin-bottom: ${e.label.marginBottom}px;\n }\n #${a} {\n border-style: ${e.containerStyles.border.type};\n border-width: ${e.containerStyles.border.width.top}px ${e.containerStyles.border.width.right}px ${e.containerStyles.border.width.bottom}px ${e.containerStyles.border.width.left}px;\n border-color: ${e.containerStyles.border.color};\n }\n #${a}:not(.layout-circle) {\n padding: ${e.containerStyles.padding.top}px ${e.containerStyles.padding.right}px ${e.containerStyles.padding.bottom}px ${e.containerStyles.padding.left}px;\n background-color: ${e.containerStyles.bgColor};\n border-radius: ${e.containerStyles.borderRadius.top}px ${e.containerStyles.borderRadius.right}px ${e.containerStyles.borderRadius.bottom}px ${e.containerStyles.borderRadius.left}px;\n }\n #${a}:not(.layout-circle) .cozy-progress-bar {\n background-color: ${e.bgColor};\n border-radius: ${e.borderRadius.top}px ${e.borderRadius.right}px ${e.borderRadius.bottom}px ${e.borderRadius.left}px;\n }\n #${a}.layout-default .cozy-progress-bar {\n height: ${e.height}px;\n }\n #${a}.layout-default:not(.label-align-spread) .label-wrapper{\n gap: ${e.label.gap}px;\n }\n #${a}.layout-vertical {\n height: ${e.height}px;\n }\n #${a}.layout-vertical .cozy-progress-bar {\n width: ${e.width}px;\n }\n #${a}.layout-circle {\n width: ${e.layoutCircle.circumference}px;\n height: ${e.layoutCircle.circumference}px;\n }\n #${a}.layout-circle .cozy-progress-bar {\n background: conic-gradient(${e.layoutCircle.primaryColor} ${e.progress}%, ${e.layoutCircle.secondaryColor} ${e.progress}%);\n padding: ${e.containerStyles.padding.top}px ${e.containerStyles.padding.right}px ${e.containerStyles.padding.bottom}px ${e.containerStyles.padding.left}px;\n }\n #${a}.layout-circle .cozy-progress-bar .label-wrapper {\n width: ${e.layoutCircle.circumference-e.layoutCircle.width}px;\n height: ${e.layoutCircle.circumference-e.layoutCircle.width}px;\n background-color: ${e.containerStyles.bgColor};\n }\n `,s=(0,n.useRefEffect)((l=>{const o=l.querySelector(".cozy-progress-bar");null!==o&&"default"===e.layout&&(o.style.height="",o.style.width=`${e.progress}%`),null!==o&&"vertical"===e.layout&&(o.style.height=`${e.progress}%`,o.style.width="")}),[e]);return(0,r.jsxs)(r.Fragment,{children:[""!=e.labelTypography.fontFamily&&null!=e.labelTypography.fontFamily&&(0,r.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${e.labelTypography.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),""!=e.typography.fontFamily&&null!=e.typography.fontFamily&&(0,r.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${e.typography.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:t}}),"default"===e.layout&&e.label.enabled&&"outside"===e.label.position&&(0,r.jsxs)("div",{className:"label-wrapper display-flex justify-spread",children:[e.label.before.length>0&&(0,r.jsx)("div",{className:"before-progress",children:(0,l.__)(e.label.before,"cozy-addons")}),(0,r.jsxs)("div",{className:"progress",children:[e.progress,"%"]}),e.label.after.length>0&&(0,r.jsx)("div",{className:"after-progress",children:(0,l.__)(e.label.after,"cozy-addons")})]}),(0,r.jsx)("div",{className:`cozy-block-progress-bar layout-${e.layout} ${e.showSpiral?"show-spiral":""} label-position-${e.label.position} label-align-${e.label.alignment}`,id:a,ref:s,children:(0,r.jsxs)("div",{className:"cozy-progress-bar",children:[(0,r.jsx)("div",{className:"spiral"}),"vertical"!==e.layout&&e.label.enabled&&"inside"===e.label.position&&(0,r.jsxs)("div",{className:"label-wrapper",children:[e.label.before.length>0&&(0,r.jsx)("div",{className:"before-progress",children:(0,l.__)(e.label.before,"cozy-addons")}),(0,r.jsxs)("div",{className:"progress",children:[e.progress,"%"]}),e.label.after.length>0&&(0,r.jsx)("div",{className:"after-progress",children:(0,l.__)(e.label.after,"cozy-addons")})]}),"vertical"===e.layout&&e.label.enabled&&(0,r.jsx)("div",{className:"label-wrapper",children:(0,r.jsxs)("div",{className:"progress",children:[e.progress,"%"]})})]})})]})})),c=JSON.parse('{"UU":"cozy-block/progress-bar","DD":"Progress Bar","h_":"Keep your audience informed and intrigued with our \'Progress Bar\' block, offering dynamic circular, horizontal, and vertical progress indicators for an interactive and visually engaging user experience."}'),y=(0,r.jsxs)("svg",{width:"27",height:"20",viewBox:"0 0 27 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{width:"27",height:"9",fill:"#0C50FF"}),(0,r.jsx)("rect",{x:"2",y:"2",width:"14",height:"5",fill:"white"}),(0,r.jsx)("rect",{y:"11",width:"27",height:"9",fill:"#0C50FF"}),(0,r.jsx)("rect",{x:"2",y:"13",width:"20",height:"5",fill:"white"}),(0,r.jsx)("path",{fill:"none",d:"M2 19L7 12.5",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M5 18.5L10 12",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M7 19L12 12.5",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M10 18.5L15 12",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M12 19L17 12.5",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M15 18.5L20 12",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M17 19L22 12.5",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M19 19.5L24 13",stroke:"#0C50FF",strokeWidth:"0.5"}),(0,r.jsx)("path",{fill:"none",d:"M1 17.5L6 11",stroke:"#0C50FF",strokeWidth:"0.5"})]});(0,e.registerBlockType)(c.UU,{title:(0,l.__)(c.DD,"cozy-addons"),description:(0,l.__)(c.h_,"cozy-addons"),icon:{src:y},example:{attributes:{cover:cozyBlockAssets.imageDir+"/preview_post_slider.jpg"},viewportWidth:335},edit:function({attributes:e,setAttributes:n,clientId:c}){e.blockClientId=c;const y=`cozyBlock_${c.replace(/-/gi,"_")}`,p=(0,o.useBlockProps)({className:`cozy-block-wrapper ${y} ${"circle"===e.layout?"display-flex block-align-"+e.layoutCircle.alignment:""}`}),[b,h]=(0,t.useState)(!0),g=(l,o)=>{let a={...e.containerStyles.padding};a={...a,top:Math.abs(o),right:Math.abs(o),bottom:Math.abs(o),left:Math.abs(o)},n(b?{...e,containerStyles:{...e.containerStyles,padding:a}}:{...e,containerStyles:{...e.containerStyles,padding:{...e.containerStyles.padding,[l]:Math.abs(o)}}})},[u,x]=(0,t.useState)(!0),_=(l,o)=>{let a={...e.containerStyles.borderRadius};a={...a,top:Math.abs(o),right:Math.abs(o),bottom:Math.abs(o),left:Math.abs(o)},n(u?{...e,containerStyles:{...e.containerStyles,borderRadius:a}}:{...e,containerStyles:{...e.containerStyles,borderRadius:{...e.containerStyles.borderRadius,[l]:Math.abs(o)}}})},[C,m]=(0,t.useState)(!0),f=(l,o)=>{let a={...e.containerStyles.border.width};a={...a,top:Math.abs(o),right:Math.abs(o),bottom:Math.abs(o),left:Math.abs(o)},n(C?{...e,containerStyles:{...e.containerStyles,border:{...e.containerStyles.border,width:a}}}:{...e,containerStyles:{...e.containerStyles,border:{...e.containerStyles.border,width:{...e.containerStyles.border.width,[l]:Math.abs(o)}}}})},[v,j]=(0,t.useState)(!0),z=(l,o)=>{let a={...e.borderRadius};a={...a,top:Math.abs(o),right:Math.abs(o),bottom:Math.abs(o),left:Math.abs(o)},n(v?{...e,borderRadius:a}:{...e,borderRadius:{...e.borderRadius,[l]:Math.abs(o)}})},w=function(){let e=[{label:"Default",value:""}];if("object"==typeof cozyBlockAssets.googleFonts)for(let l in cozyBlockAssets.googleFonts)e.push({label:cozyBlockAssets.googleFonts[l],value:l});return e}(),[S,L]=(0,t.useState)("general");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{...p,children:["circle"===e.layout&&(0,r.jsx)(o.BlockControls,{children:(0,r.jsx)(o.AlignmentToolbar,{value:e.layoutCircle.alignment,onChange:l=>n({...e,layoutCircle:{...e.layoutCircle,alignment:l}})})}),(0,r.jsx)(d,{attributes:e,clientId:c,blockId:y})]}),(0,r.jsxs)(o.InspectorControls,{group:"settings",children:[(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Progress Bar","cozy-addons"),opened:"general"===S,onToggle:()=>L("general"),children:[!cozyBlockAssets.isPremium&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Layout","cozy-addons"),options:[{label:(0,l.__)("Default","cozy-addons"),value:"default"},{label:(0,l.__)("Circle (Pro)","cozy-addons"),value:"default"},{label:(0,l.__)("Vertical (Pro)","cozy-addons"),value:"default"}],value:e.layout,onChange:l=>n({...e,layout:l})})}),cozyBlockAssets.isPremium&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Layout","cozy-addons"),options:[{label:(0,l.__)("Default","cozy-addons"),value:"default"},{label:(0,l.__)("Circle","cozy-addons"),value:"circle"},{label:(0,l.__)("Vertical","cozy-addons"),value:"vertical"}],value:e.layout,onChange:l=>{n("circle"===l?{...e,layout:l,label:{...e.label,position:"inside",alignment:"center"},typography:{...e.typography,fontSize:30,color:"#000"},containerStyles:{...e.containerStyles,bgColor:"#fff"},progress:70}:"vertical"===l?{...e,layout:l,height:200,label:{...e.label,position:"",alignment:""}}:{...e,layout:l,height:20,label:{...e.label,position:"inside",alignment:"center"}})}})}),"vertical"===e.layout&&(0,r.jsx)(a.TextControl,{label:(0,l.__)("Width","cozy-addons"),type:"number",min:1,step:1,value:e.width,onChange:l=>n({...e,width:Math.abs(l)})}),"circle"!==e.layout&&(0,r.jsx)(a.TextControl,{label:(0,l.__)("Height","cozy-addons"),type:"number",min:5,step:1,value:e.height,onChange:l=>n({...e,height:Math.abs(l)})}),"circle"===e.layout&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.RangeControl,{label:(0,l.__)("Progress Width","cozy-addons"),min:1,max:50,step:1,value:e.layoutCircle.width,onChange:l=>n({...e,layoutCircle:{...e.layoutCircle,width:Math.abs(l)}})}),(0,r.jsx)(a.TextControl,{label:(0,l.__)("Circumference","cozy-addons"),type:"number",min:10,step:1,value:e.layoutCircle.circumference,onChange:l=>n({...e,layoutCircle:{...e.layoutCircle,circumference:Math.abs(l)}})})]}),(0,r.jsx)(a.RangeControl,{label:(0,l.__)("Progress","cozy-addons"),min:0,max:100,step:.1,value:e.progress,onChange:l=>n({...e,progress:l})}),(0,r.jsx)(a.ToggleControl,{label:(0,l.__)("Enable Label","cozy-addons"),checked:e.label.enabled,onChange:l=>n({...e,label:{...e.label,enabled:l}})}),"circle"!==e.layout&&(0,r.jsx)(a.ToggleControl,{label:(0,l.__)("Show Spiral","cozy-addons"),checked:e.showSpiral,onChange:l=>n({...e,showSpiral:l})})]}),"vertical"!==e.layout&&e.label.enabled&&(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Progress Label","cozy-addons"),opened:"progress-label"===S,onToggle:()=>L("progress-label"),children:["default"===e.layout&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Label Position","cozy-addons"),options:[{label:(0,l.__)("Inside Bar","cozy-addons"),value:"inside"},{label:(0,l.__)("Outside Bar","cozy-addons"),value:"outside"}],value:e.label.position,onChange:l=>n({...e,label:{...e.label,position:l}})}),"outside"===e.label.position&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.RangeControl,{label:(0,l.__)("Gap","cozy-addons"),min:0,max:100,step:1,value:e.label.marginBottom,onChange:l=>n({...e,label:{...e.label,marginBottom:Math.abs(l)}})})}),"outside"!==e.label.position&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Alignment","cozy-addons"),options:[{label:(0,l.__)("Left","cozy-addons"),value:"left"},{label:(0,l.__)("Center","cozy-addons"),value:"center"},{label:(0,l.__)("Right","cozy-addons"),value:"right"},{label:(0,l.__)("Spread","cozy-addons"),value:"spread"}],value:e.label.alignment,onChange:l=>n({...e,label:{...e.label,alignment:l}})}),"spread"!==e.label.alignment&&(0,r.jsx)(a.RangeControl,{label:(0,l.__)("Gap","cozy-addons"),min:0,max:50,step:1,value:e.label.gap,onChange:l=>n({...e,label:{...e.label,gap:Math.abs(l)}})})]})]}),(0,r.jsx)(a.TextControl,{label:(0,l.__)("Label before progress","cozy-addons"),type:"string",value:e.label.before,onChange:l=>n({...e,label:{...e.label,before:l}})}),(0,r.jsx)(a.TextControl,{label:(0,l.__)("Label after progress","cozy-addons"),type:"string",value:e.label.after,onChange:l=>n({...e,label:{...e.label,after:l}})})]}),!cozyBlockAssets.isPremium&&(0,r.jsx)(s,{})]},"setting"),(0,r.jsxs)(o.InspectorControls,{group:"styles",children:[(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Container Styles","cozy-addons"),opened:"container-styles"===S,onToggle:()=>L("container-styles"),children:[(0,r.jsxs)(a.BaseControl,{children:[(0,r.jsx)(a.BaseControl.VisualLabel,{children:(0,l.__)("Padding","cozy-addons")}),(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,r.jsx)("button",{className:"cozy-link-styles "+(b?"":"cozy-attr-link-disabled"),onClick:()=>h(!b),children:(0,r.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Top","cozy-addons"),value:e.containerStyles.padding.top,onChange:e=>g("top",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Right","cozy-addons"),value:e.containerStyles.padding.right,onChange:e=>g("right",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Bottom","cozy-addons"),value:e.containerStyles.padding.bottom,onChange:e=>g("bottom",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,value:e.containerStyles.padding.left,label:(0,l.__)("Left","cozy-addons"),onChange:e=>g("left",e)})]})]}),(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Border Type","cozy-addons"),value:e.containerStyles.border.type,options:[{label:(0,l.__)("None","cozy-addons"),value:"none"},{label:(0,l.__)("Solid","cozy-addons"),value:"solid"},{label:(0,l.__)("Double","cozy-addons"),value:"double"},{label:(0,l.__)("Dotted","cozy-addons"),value:"dotted"},{label:(0,l.__)("Dashed","cozy-addons"),value:"dashed"},{label:(0,l.__)("Groove","cozy-addons"),value:"groove"}],onChange:l=>n({...e,containerStyles:{...e.containerStyles,border:{...e.containerStyles.border,type:l}}})}),"none"!==e.containerStyles.border.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.BaseControl,{children:[(0,r.jsx)(a.BaseControl.VisualLabel,{children:(0,l.__)("Border Width","cozy-addons")}),(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,r.jsx)("button",{className:"cozy-link-styles "+(C?"":"cozy-attr-link-disabled"),onClick:()=>m(!C),children:(0,r.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Top","cozy-addons"),value:e.containerStyles.border.width.top,onChange:e=>f("top",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Right","cozy-addons"),value:e.containerStyles.border.width.right,onChange:e=>f("right",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,value:e.containerStyles.border.width.bottom,label:(0,l.__)("Bottom","cozy-addons"),onChange:e=>f("bottom",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("Left","cozy-addons"),value:e.containerStyles.border.width.left,onChange:e=>f("left",e)})]})]}),(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Border Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Normal","cozy-addons"),value:e.containerStyles.border.color,onChange:l=>n({...e,containerStyles:{...e.containerStyles,border:{...e.containerStyles.border,color:l}}})}]})]}),"circle"!==e.layout&&(0,r.jsxs)(a.BaseControl,{children:[(0,r.jsx)(a.BaseControl.VisualLabel,{children:(0,l.__)("Border Radius","cozy-addons")}),(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,r.jsx)("button",{className:"cozy-link-styles "+(u?"":"cozy-attr-link-disabled"),onClick:()=>x(!u),children:(0,r.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("TopL","cozy-addons"),value:e.containerStyles.borderRadius.top,onChange:e=>_("top",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("TopR","cozy-addons"),value:e.containerStyles.borderRadius.right,onChange:e=>_("right",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,value:e.containerStyles.borderRadius.left,label:(0,l.__)("BottomL","cozy-addons"),onChange:e=>_("left",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("BottomR","cozy-addons"),value:e.containerStyles.borderRadius.bottom,onChange:e=>_("bottom",e)})]})]}),(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Background Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Normal","cozy-addons"),value:e.containerStyles.bgColor,onChange:l=>n({...e,containerStyles:{...e.containerStyles,bgColor:l}})}]})]}),(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Progress Bar Styles","cozy-addons"),opened:"progress-bar-styles"===S,onToggle:()=>L("progress-bar-styles"),children:["circle"!==e.layout&&(0,r.jsxs)(a.BaseControl,{children:[(0,r.jsx)(a.BaseControl.VisualLabel,{children:(0,l.__)("Border Radius","cozy-addons")}),(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,r.jsx)("button",{className:"cozy-link-styles "+(v?"":"cozy-attr-link-disabled"),onClick:()=>j(!v),children:(0,r.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,r.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("TopL","cozy-addons"),value:e.borderRadius.top,onChange:e=>z("top",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("TopR","cozy-addons"),value:e.borderRadius.right,onChange:e=>z("right",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,value:e.borderRadius.left,label:(0,l.__)("BottomL","cozy-addons"),onChange:e=>z("left",e)}),(0,r.jsx)(a.TextControl,{type:"number",step:1,label:(0,l.__)("BottomR","cozy-addons"),value:e.borderRadius.bottom,onChange:e=>z("bottom",e)})]})]}),"circle"!==e.layout&&(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Background Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Normal","cozy-addons"),value:e.bgColor,onChange:l=>n({...e,bgColor:l})}]}),"circle"===e.layout&&(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Background Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Primary","cozy-addons"),value:e.layoutCircle.primaryColor,onChange:l=>n({...e,layoutCircle:{...e.layoutCircle,primaryColor:l}})},{label:(0,l.__)("Secondary","cozy-addons"),value:e.layoutCircle.secondaryColor,onChange:l=>n({...e,layoutCircle:{...e.layoutCircle,secondaryColor:l}})}]})]}),e.label.enabled&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Typography","cozy-addons"),opened:"typography"===S,onToggle:()=>L("typography"),children:[(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Font Family","cozy-addons"),options:w,value:e.typography.fontFamily,onChange:l=>n({...e,typography:{...e.typography,fontFamily:l}})}),(0,r.jsx)(a.TextControl,{label:(0,l.__)("Font Size","cozy-addons"),type:"number",min:10,value:e.typography.fontSize,onChange:l=>n({...e,typography:{...e.typography,fontSize:Math.abs(l)}})}),(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Font Weight","cozy-addons"),options:[{label:(0,l.__)("Thin","cozy-addons"),value:100},{label:(0,l.__)("Extra Light","cozy-addons"),value:200},{label:(0,l.__)("Light","cozy-addons"),value:300},{label:(0,l.__)("Normal","cozy-addons"),value:400},{label:(0,l.__)("Medium","cozy-addons"),value:500},{label:(0,l.__)("Semi Bold","cozy-addons"),value:600},{label:(0,l.__)("Bold","cozy-addons"),value:700},{label:(0,l.__)("Extra Bold","cozy-addons"),value:800}],value:e.typography.fontWeight,onChange:l=>n({...e,typography:{...e.typography,fontWeight:l}})}),(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Normal","cozy-addons"),value:e.typography.color,onChange:l=>n({...e,typography:{...e.typography,color:l}})}]})]}),(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Label Typography","cozy-addons"),opened:"label-typography"===S,onToggle:()=>L("label-typography"),children:[(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Font Family","cozy-addons"),options:w,value:e.labelTypography.fontFamily,onChange:l=>n({...e,labelTypography:{...e.labelTypography,fontFamily:l}})}),(0,r.jsx)(a.TextControl,{label:(0,l.__)("Font Size","cozy-addons"),type:"number",min:10,value:e.labelTypography.fontSize,onChange:l=>n({...e,labelTypography:{...e.labelTypography,fontSize:Math.abs(l)}})}),(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Font Weight","cozy-addons"),options:i,value:e.labelTypography.fontWeight,onChange:l=>n({...e,labelTypography:{...e.labelTypography,fontWeight:l}})}),(0,r.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,l.__)("Color","cozy-addons"),colorSettings:[{label:(0,l.__)("Normal","cozy-addons"),value:e.labelTypography.color,onChange:l=>n({...e,labelTypography:{...e.labelTypography,color:l}})}]})]})]})]},"style")]})},save:function({attributes:e}){const o=`cozyBlock_${(a=e.blockClientId,a.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var a;return(0,r.jsxs)(r.Fragment,{children:["default"===e.layout&&e.label.enabled&&"outside"===e.label.position&&(0,r.jsxs)("div",{className:"label-wrapper display-flex justify-spread",children:[e.label.before.length>0&&(0,r.jsx)("div",{className:"before-progress",children:(0,l.__)(e.label.before,"cozy-addons")}),(0,r.jsx)("div",{className:"progress",children:"0%"}),e.label.after.length>0&&(0,r.jsx)("div",{className:"after-progress",children:(0,l.__)(e.label.after,"cozy-addons")})]}),(0,r.jsx)("div",{className:`cozy-block-progress-bar layout-${e.layout} ${e.showSpiral?"show-spiral":""} label-position-${e.label.position} label-align-${e.label.alignment}`,id:o,children:(0,r.jsxs)("div",{className:"cozy-progress-bar",children:[(0,r.jsx)("div",{className:"spiral"}),"vertical"!==e.layout&&e.label.enabled&&"inside"===e.label.position&&(0,r.jsxs)("div",{className:"label-wrapper",children:[e.label.before.length>0&&(0,r.jsx)("div",{className:"before-progress",children:(0,l.__)(e.label.before,"cozy-addons")}),(0,r.jsx)("div",{className:"progress",children:"0%"}),e.label.after.length>0&&(0,r.jsx)("div",{className:"after-progress",children:(0,l.__)(e.label.after,"cozy-addons")})]}),"vertical"===e.layout&&e.label.enabled&&(0,r.jsx)("div",{className:"label-wrapper",children:(0,r.jsx)("div",{className:"progress",children:"0%"})})]})})]})}})}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return l[e](n,n.exports,a),n.exports}a.m=l,e=[],a.O=(l,o,t,n)=>{if(!o){var r=1/0;for(c=0;c<e.length;c++){for(var[o,t,n]=e[c],s=!0,i=0;i<o.length;i++)(!1&n||r>=n)&&Object.keys(a.O).every((e=>a.O[e](o[i])))?o.splice(i--,1):(s=!1,n<r&&(r=n));if(s){e.splice(c--,1);var d=t();void 0!==d&&(l=d)}}return l}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[o,t,n]},a.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={57:0,350:0};a.O.j=l=>0===e[l];var l=(l,o)=>{var t,n,[r,s,i]=o,d=0;if(r.some((l=>0!==e[l]))){for(t in s)a.o(s,t)&&(a.m[t]=s[t]);if(i)var c=i(a)}for(l&&l(o);d<r.length;d++)n=r[d],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(c)},o=globalThis.webpackChunkprogress_bar=globalThis.webpackChunkprogress_bar||[];o.forEach(l.bind(null,0)),o.push=l.bind(null,o.push.bind(o))})();var t=a.O(void 0,[350],(()=>a(746)));t=a.O(t)})();
Save
Back