@wazobiatech/wazui 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PictureBlot-CKKGvAzx.js → PictureBlot-C8VNGhSZ.js} +2 -2
- package/dist/{PictureBlot-CKKGvAzx.js.map → PictureBlot-C8VNGhSZ.js.map} +1 -1
- package/dist/{PictureBlot-CYPdPHUi.cjs → PictureBlot-CrMuPhFR.cjs} +2 -2
- package/dist/{PictureBlot-CYPdPHUi.cjs.map → PictureBlot-CrMuPhFR.cjs.map} +1 -1
- package/dist/{index-Bb60sVeo.js → index-DW2LVzR7.js} +3 -3
- package/dist/index-DW2LVzR7.js.map +4 -0
- package/dist/{index-Co-WcIlL.cjs → index-ElL3MKkT.cjs} +4 -4
- package/dist/index-ElL3MKkT.cjs.map +4 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{quill-yK20wTJ8.cjs → quill-CLxn7l6G.cjs} +2 -2
- package/dist/{quill-yK20wTJ8.cjs.map → quill-CLxn7l6G.cjs.map} +1 -1
- package/dist/{quill-w5lKDASh.js → quill-DPikl742.js} +2 -2
- package/dist/{quill-w5lKDASh.js.map → quill-DPikl742.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-Bb60sVeo.js.map +0 -4
- package/dist/index-Co-WcIlL.cjs.map +0 -4
|
@@ -514,7 +514,7 @@ Valid keys: `+JSON.stringify(Object.keys(C),null," "));var _=U(Q,eA,I,W,nA+"."+
|
|
|
514
514
|
*/var dP;function rnA(){return dP||(dP=1,(function(A){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=r(s,n(o)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)e.call(s,o)&&s[o]&&(a=r(a,o));return a}function r(s,a){return a?s?s+" "+a:s+a:s}A.exports?(t.default=t,A.exports=t):window.classNames=t})()})(Um)),Um.exports}var snA=rnA();const JA=Xc(snA);function anA(A,e){var t=H4({},e);return{stencilSize:function(n,r){var s=xe(A.stencilSize)?A.stencilSize(n,r):A.stencilSize;return Kn(oA(oA({},s),{aspectRatio:AtA(t.aspectRatio,vo(Ae(s)))}))}}}function G9(A,e){var t=A.boundary,n=xe(e.stencilSize)?e.stencilSize(A,e):e.stencilSize;return(n.width>t.width||n.height>t.height)&&(n=Kn({sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minWidth:0,minHeight:0},width:n.width,height:n.height,aspectRatio:{minimum:Ae(n),maximum:Ae(n)}})),n}function onA(A,e){var t=G9(A,oA(oA({},e),{stencilSize:e.stencilSize})),n=Ar(A,e);return{maxWidth:n.maxWidth*t.width/A.boundary.width,maxHeight:n.maxHeight*t.height/A.boundary.height,minWidth:0,minHeight:0}}function inA(A,e){var t=A.imageSize,n=A.visibleArea,r=A.boundary,s=er(A,e),a=ya(A,e),o=xe(e.stencilSize)?e.stencilSize(A,e):e.stencilSize,l=n||t,c,u;return Ae(l)>Ae(r)?(c=o.height*l.height/r.height,u=c*Ae(o)):(u=o.width*l.width/r.width,c=u/Ae(o)),Kn({width:u,height:c,aspectRatio:a,sizeRestrictions:s})}function lnA(A,e){var t=Ae(G9(A,e));return{minimum:t,maximum:t}}function cnA(A,e){if(En(A)){var t=Lt(A),n=G9(A,e);t.visibleArea=Pr(t.visibleArea,t.coordinates.width*t.boundary.width/(t.visibleArea.width*n.width));var r=S9(t.visibleArea,Ar(t,e));return r!==1&&(t.visibleArea=Pr(t.visibleArea,r),t.coordinates=Pr(t.coordinates,r)),t.visibleArea=Dt(t.visibleArea,Fn(ke(t.coordinates),ke(t.visibleArea))),t.visibleArea=We(t.visibleArea,Wn(t,e)),t.coordinates=We(t.coordinates,wa(vn(t.visibleArea),Wn(t,e))),t}return A}function unA(A,e,t){return t&&t.immediately?cnA(A,e):A}function fnA(A,e){if(En(A)){var t=Lt(A),n={width:0,height:0};Ae(t.boundary)>Ae(t.coordinates)?(n.height=t.boundary.height*.8,n.width=n.height*Ae(t.coordinates)):(n.width=t.boundary.width*.8,n.height=n.width*Ae(t.coordinates)),t.visibleArea=Pr(t.visibleArea,t.coordinates.width*t.boundary.width/(t.visibleArea.width*n.width));var r=S9(t.visibleArea,Ar(t,e));return t.visibleArea=Pr(t.visibleArea,r),r!==1&&(n.height/=r,n.width/=r),t.visibleArea=Dt(t.visibleArea,Fn(ke(t.coordinates),ke(t.visibleArea))),t.visibleArea=We(t.visibleArea,Wn(t,e)),t.coordinates=We(t.coordinates,wa(vn(t.visibleArea),mn(t,e))),t}return A}function dnA(A,e,t){return t.immediately?fnA(A,e):A}function gnA(A){process.env.NODE_ENV==="development"&&console.warn("Deprecation warning: ".concat(A))}function vnA(){var A=y.useRef([]);return function(e){A.current.indexOf(e)===-1&&(gnA(e),A.current.push(e))}}function mnA(A){return y.forwardRef(A)}function pnA(){var A=y.useRef(!0);return A.current?(A.current=!1,!0):A.current}var Rl=function(A,e){var t=pnA();y.useEffect(function(){if(!t)return A()},e)};function Z4(A){var e=Ze(y.useState(A),2),t=e[0],n=e[1],r=Ze(y.useState(null),2),s=r[0],a=r[1],o=y.useRef(A);return Rl(function(){s&&s(t,o.current)},[s]),[t,function(l,c){o.current=t,n(l),a(function(){return c})}]}var hnA=(function(A){Tr(e,A);function e(t,n){var r=A.call(this)||this;return r.props=t,r.notify=n,r.data={state:null,transitions:!1,interactions:BtA()},r}return e.prototype.getProps=function(){return this.props()},e.prototype.setData=function(t){this.data=t,this.notify()},e.prototype.getData=function(){return this.data},e})(StA);function S4(){var A=Ze(y.useState({}),2);A[0];var e=A[1];return function(){e({})}}function wnA(A){var e=y.useRef(A);return e.current=A,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.current.apply(e,zr([],Ze(t),!1))}}function ynA(A){var e=S4(),t=wnA(function(){var r=A(),s=r.settings,a=oa(r,["settings"]),o=oA({imageRestriction:io.fitArea,transformImage:{adjustStencil:!0}},s),l=oA({transitions:!0},a);return oA({settings:oA(oA({},o),ZtA(o))},l)}),n=y.useRef(new hnA(t,e));return n.current}function PnA(A){var e=A.src,t=A.onLoadingStart,n=A.onLoadingEnd,r=A.onError,s=A.onLoad,a=A.crossOrigin,o=A.checkOrientation,l=A.canvas,c=A.unloadTime,u=Ze(y.useState(null),2),f=u[0],d=u[1],g=Ze(y.useState(!1),2),v=g[0],m=g[1],p=Ze(Z4(!1),2),h=p[0],w=p[1],x=y.useRef(null);return y.useEffect(function(){if(x.current!==e)if(x.current=e||null,w(!1),e){m(!0),t==null||t();var b=[enA(e,{crossOrigin:nt(a)?l:a,checkOrientation:o})];h&&c&&b.push(tP(c)),Promise.all(b).then(function(z){var D=Ze(z,1),M=D[0];x.current===e&&d(M)}).catch(function(){x.current===e&&(r==null||r())}).finally(function(){x.current===e&&(n==null||n(),m(!1))})}else c?tP(c).then(function(){x.current===e&&d(null)}):d(null)},[e,f]),y.useEffect(function(){f&&w(!0,function(){s==null||s(f)})},[f]),{isLoading:function(){return v},isLoaded:function(){return h},getImage:function(){return f},setImage:d}}var V4=function(A){var e=y.useRef(A),t=function(){e.current&&e.current()};y.useEffect(function(){e.current=A},[A]),y.useEffect(function(){return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),function(){window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[])};function xnA(A,e){e===void 0&&(e=!0);var t=Ze(y.useState(e),2),n=t[0],r=t[1];return y.useLayoutEffect(function(){n&&!A.hasInteractions()&&A.reconcileState()}),{pause:function(){r(!1)},resume:function(){r(!0)}}}function bnA(A){var e=this,t=A(),n=t.src,r=t.onReady,s=t.onError,a=t.onUpdate,o=t.canvas,l=o===void 0?!0:o,c=t.unloadTime,u=c===void 0?500:c,f=t.crossOrigin,d=f===void 0?!0:f,g=t.checkOrientation,v=g===void 0?!0:g,m=t.autoReconcileState,p=m===void 0?!0:m,h=y.useRef(null),w=y.useRef(null),x=y.useRef(null),b=y.useRef(null),z=Ze(Z4(null),2),D=z[0],M=z[1],B=ynA(function(){return oA(oA({},A()),{getInstance:function(){return b.current}})}),H=PnA({src:n,crossOrigin:d,checkOrientation:v,unloadTime:u,canvas:l,onError:function(){b.current&&(s==null||s(b.current))}}),k=xnA(B,p),Y=function(){return Op(e,void 0,void 0,function(){var X,q,J;return ed(this,function(G){switch(G.label){case 0:return w.current?(k.pause(),X=H.getImage(),[4,(J=w.current)===null||J===void 0?void 0:J.stretchTo(X)]):[3,2];case 1:q=G.sent(),M(X,function(){q&&X?B.reset(q,X):B.clear()}),k.resume(),G.label=2;case 2:return[2]}})})},T=function(){return Op(e,void 0,void 0,function(){var X,q,J,G;return ed(this,function(O){switch(O.label){case 0:return w.current?(k.pause(),X=H.getImage(),[4,(G=w.current)===null||G===void 0?void 0:G.stretchTo(X)]):[3,2];case 1:q=O.sent(),q&&X?(J=B.getState(),J?(q.width!==J.boundary.width||q.height!==J.boundary.height)&&(B.setBoundary(q),B.reconcileState()):B.reset(q,X)):B.clear(),k.resume(),O.label=2;case 2:return[2]}})})},S={reset:function(){return Y()},refresh:function(){return T()},setImage:function(X){return M(X)},reconcileState:B.reconcileState,moveCoordinates:B.moveCoordinates,moveCoordinatesEnd:B.moveCoordinatesEnd,resizeCoordinates:B.resizeCoordinates,clear:B.clear,resizeCoordinatesEnd:B.resizeCoordinatesEnd,moveImage:B.moveImage,flipImage:B.flipImage,zoomImage:B.zoomImage,rotateImage:B.rotateImage,transformImage:B.transformImage,transformImageEnd:B.transformImageEnd,setCoordinates:B.setCoordinates,setVisibleArea:B.setVisibleArea,startTransitions:B.startTransitions,setState:B.setState,hasInteractions:B.hasInteractions,getStencilCoordinates:B.getStencilCoordinates,getCoordinates:B.getCoordinates,getVisibleArea:B.getVisibleArea,getTransforms:B.getTransforms,getTransitions:B.getTransitions,getInteractions:B.getInteractions,getSettings:B.getSettings,getState:B.getState,getDefaultState:function(){var X=B.getState(),q=H.getImage();return X&&q?B.createDefaultState(X.boundary,q):null},getCanvas:function(X){var q=B.getState();return h.current&&x.current&&q?x.current.draw(q,h.current,X):null},getImage:function(){return D?oA({},D):null},isLoading:H.isLoading,isLoaded:H.isLoaded};return V4(function(){T()}),Rl(function(){Y()},[H.getImage()]),Rl(function(){b.current&&D&&(r==null||r(b.current))},[D]),Rl(function(){b.current&&(a==null||a(b.current))},[H.isLoaded(),H.isLoading()]),y.useImperativeHandle(b,function(){return S}),{cropper:S,refs:{image:h,boundary:w,canvas:x},image:D}}var I9=y.forwardRef(function(A,e){var t=A.className,n=A.style,r=A.stretcherClassName,s=A.contentClassName,a=A.stretchAlgorithm,o=a===void 0?ItA:a,l=A.sizeAlgorithm,c=l===void 0?HtA:l,u=A.children,f=y.useRef(null),d=y.useRef(null);return y.useImperativeHandle(e,function(){return{reset:function(){var g=f.current;g&&(g.style.height="",g.style.width="")},stretchTo:function(g){var v=f.current,m=d.current;if(g!=null&&g.width&&(g!=null&&g.height)&&v&&m){o(m,v,g);var p=c(m,g);return Promise.resolve(p.width&&p.height?p:null)}else return v&&(v.style.height="",v.style.width=""),Promise.resolve(null)}}}),y.createElement("div",{ref:d,style:n,className:JA("advanced-cropper-boundary",t)},y.createElement("div",{ref:f,className:JA(["advanced-cropper-boundary__stretcher",r])}),y.createElement("div",{className:JA(["advanced-cropper-boundary__content",s])},u))});I9.displayName="StretchableBoundary";var X4=function(A){var e=A.visible,t=A.className,n=A.style,r=A.children;return y.createElement("div",{style:n,className:JA(t,"advanced-cropper-fade",!!e&&"advanced-cropper-fade--visible")},r)},znA=function(A){var e=A.cropper,t=A.children,n=A.className,r=A.style,s=e?e.getState():null,a=e?e.isLoaded():!1;return y.createElement("div",{className:JA(n,"advanced-cropper-wrapper"),style:r},y.createElement(X4,{visible:s&&a,className:"advanced-cropper-wrapper__fade"},t))};function Y4(A){A.preventDefault()}var G4=y.forwardRef(function(A,e){var t=A.className,n=A.style,r=A.cropper,s=A.crossOrigin,a=s===void 0?!0:s,o=r.getState(),l=r.getTransitions(),c=r.getImage(),u=c&&o?tnA(c,o,l):{},f=c?c.src:void 0;return f?y.createElement("img",{key:f,ref:e,className:JA("advanced-cropper-background-image",t),src:f,crossOrigin:a===!0?"anonymous":a||void 0,style:oA(oA({},u),n),onMouseDown:Y4}):null});G4.displayName="CropperBackgroundImage";var I4=y.forwardRef(function(A,e){var t=y.useRef(null),n=y.useRef(null);return y.useImperativeHandle(e,function(){return{draw:function(r,s,a){return a===void 0&&(a={}),s&&t.current&&n.current?GtA(r,s,t.current,n.current,a):null}}}),y.createElement(y.Fragment,null,y.createElement("canvas",{className:"advanced-cropper-canvas",ref:t}),y.createElement("canvas",{className:"advanced-cropper-canvas",ref:n}))});I4.displayName="CropperCanvas";var wv=(function(A){Tr(e,A);function e(t){var n=A.call(this,t)||this;return n.processMove=function(r,s){var a,o=n.container.current;if(o&&n.touches.length){var l=o.getBoundingClientRect(),c=l.left,u=l.top;if(n.touches.length===1&&s.length===1&&n.props.onMove){var f={left:Math.abs(s[0].clientX-n.anchor.left-c)<Math.abs(n.touches[0].clientX-n.anchor.left-c),top:Math.abs(s[0].clientY-n.anchor.top-u)<Math.abs(n.touches[0].clientY-n.anchor.top-u)},d={left:0,top:0};(!n.props.useAnchor||!f.left)&&(d.left=s[0].clientX-n.touches[0].clientX),(!n.props.useAnchor||!f.top)&&(d.top=s[0].clientY-n.touches[0].clientY),(a=n.props)===null||a===void 0||a.onMove(d,r),n.touches=zr([],Ze(s),!1)}}},n.processEnd=function(){var r=n.props,s=r.onMoveEnd,a=r.onLeave;!n.props.disabled&&n.touches.length&&(s==null||s()),n.hovered&&(a==null||a(),n.hovered=!1),n.touches=[]},n.initAnchor=function(r){var s=n.container.current;if(s){var a=s.getBoundingClientRect(),o=a.left,l=a.top;n.anchor={left:r.clientX-o,top:r.clientY-l}}},n.onMouseOver=function(){var r=n.props,s=r.onEnter,a=r.disabled;!n.hovered&&!a&&(n.hovered=!0,s==null||s())},n.onMouseLeave=function(){var r=n.props.onLeave;n.hovered&&!n.touches.length&&(n.hovered=!1,r==null||r())},n.onTouchStart=function(r){var s=n.props,a=s.onEnter,o=s.onMoveStart,l=s.disabled;if(r.cancelable){n.touches=Array.from(r.touches);var c=!l&&r.touches.length===1;c&&(n.touches=Array.from(r.touches),o==null||o()),!n.hovered&&!l&&(n.hovered=!0,a==null||a()),(n.started||c)&&(r.preventDefault(),r.stopPropagation())}},n.onTouchEnd=function(){n.started=!1,n.processEnd()},n.onTouchMove=function(r){n.touches.length>=1&&(n.started?(n.processMove(r,Array.from(r.touches)),r.preventDefault(),r.stopPropagation()):b4({left:n.touches[0].clientX,top:n.touches[0].clientY},{left:r.touches[0].clientX,top:r.touches[0].clientY})>(n.props.activationDistance||0)&&(n.initAnchor({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY}),n.started=!0))},n.onMouseDown=function(r){var s=n.props,a=s.onMoveStart,o=s.disabled;if(!o&&r.button===0){var l={clientX:r.clientX,clientY:r.clientY};n.touches=[l],n.initAnchor(l),r.stopPropagation(),a==null||a()}},n.onMouseMove=function(r){!n.props.disabled&&n.touches.length&&(n.processMove(r,[{clientX:r.clientX,clientY:r.clientY}]),r.preventDefault&&r.cancelable&&r.preventDefault(),r.stopPropagation())},n.onMouseUp=function(){n.processEnd()},n.touches=[],n.hovered=!1,n.started=!1,n.anchor={left:0,top:0},n.container=y.createRef(),n}return e.prototype.componentWillUnmount=function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd);var t=this.container.current;t&&(t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("mousedown",this.onMouseDown))},e.prototype.componentDidMount=function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1});var t=this.container.current;t&&(t.addEventListener("touchstart",this.onTouchStart,{passive:!1}),t.addEventListener("mousedown",this.onMouseDown,{passive:!1}))},e.prototype.componentDidUpdate=function(t){this.props.disabled&&!t.disabled&&(this.touches=[])},e.prototype.render=function(){var t=this.props,n=t.children,r=t.className;return y.createElement("div",{className:JA("advanced-cropper-draggable-element",r),ref:this.container,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},n)},e.defaultProps={disabled:!1,activationDistance:30,useAnchor:!0,rerender:!0},e})(y.Component),DnA=function(A){var e=A.position,t=A.className,n=A.disabled,r=A.onDrag,s=A.onDragEnd,a=A.onLeave,o=A.onEnter,l=A.children;return y.createElement(wv,{className:JA(["advanced-cropper-line-wrapper",e&&"advanced-cropper-line-wrapper--".concat(e),n&&"advanced-cropper-line-wrapper--disabled",t]),disabled:n,onMove:r,onMoveEnd:s,onLeave:a,onEnter:o,activationDistance:0},y.createElement("div",{className:JA(["advanced-cropper-line-wrapper__content",e&&"advanced-cropper-line-wrapper__content--".concat(e)])},l))},Q9=function(A){var e,t,n=A.position,r=A.hoverClassName,s=A.wrapperClassName,a=A.defaultClassName,o=A.disabled,l=A.onMove,c=A.onMoveEnd,u=Ze(y.useState(!1),2),f=u[0],d=u[1],g=function(){d(!0)},v=function(){d(!1)};return y.createElement(DnA,{className:JA("advanced-cropper-simple-line-wrapper",s,(e={},e["advanced-cropper-simple-line-wrapper--".concat(n)]=!!n,e)),position:n,disabled:o,onDrag:l,onDragEnd:c,onLeave:v,onEnter:g},y.createElement("div",{className:JA("advanced-cropper-simple-line",f&&"advanced-cropper-simple-line--hover",a,f&&r,(t={},t["advanced-cropper-simple-line--".concat(n)]=!!n,t))}))},BnA=function(A){var e=A.horizontalPosition,t=A.verticalPosition,n=A.className,r=A.disabled,s=A.onDrag,a=A.onDragEnd,o=A.onLeave,l=A.onEnter,c=A.children,u=A.style,f=e||t?W2(e,t).snakeCase:null;return y.createElement("div",{style:u,className:JA(n,"advanced-cropper-handler-wrapper",f&&"advanced-cropper-handler-wrapper--".concat(f),r&&"advanced-cropper-handler-wrapper--disabled")},y.createElement(wv,{className:"advanced-cropper-handler-wrapper__draggable",disabled:r,onMove:s,onMoveEnd:a,onLeave:o,onEnter:l,activationDistance:0},c))},L9=function(A){var e,t=A.verticalPosition,n=A.horizontalPosition,r=A.hoverClassName,s=A.wrapperClassName,a=A.defaultClassName,o=A.wrapperStyle,l=A.disabled,c=A.onMove,u=A.onMoveEnd,f=Ze(y.useState(!1),2),d=f[0],g=f[1],v=function(){g(!0)},m=function(){g(!1)};return y.createElement(BnA,{style:o,className:JA("advanced-cropper-simple-handler-wrapper",s,t&&"advanced-cropper-simple-handler-wrapper--".concat(t),n&&"advanced-cropper-simple-handler-wrapper--".concat(n),n&&t&&"advanced-cropper-simple-handler-wrapper--".concat(n,"-").concat(t),d&&"advanced-cropper-simple-handler-wrapper--hover"),verticalPosition:t,horizontalPosition:n,disabled:l,onDrag:c,onDragEnd:u,onLeave:m,onEnter:v},y.createElement("div",{className:JA("advanced-cropper-simple-handler",d&&"advanced-cropper-simple-handler--hover",a,d&&r,(e={},e["advanced-cropper-simple-handler--".concat(t)]=!!t,e["advanced-cropper-simple-handler--".concat(n)]=!!n,e["advanced-cropper-simple-handler--".concat(n,"-").concat(t)]=n&&t,e))}))},MnA=["east","west",null],CnA=["south","north",null],Q4=function(A){var e=A.style,t=A.className,n=A.children,r=A.onResize,s=A.onResizeEnd,a=A.handlerComponent,o=a===void 0?L9:a,l=A.handlers,c=l===void 0?{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}:l,u=A.handlerClassNames,f=u===void 0?{}:u,d=A.handlerWrapperClassNames,g=d===void 0?{}:d,v=A.lines,m=v===void 0?{west:!0,north:!0,east:!0,south:!0}:v,p=A.lineComponent,h=p===void 0?Q9:p,w=A.lineClassNames,x=w===void 0?{}:w,b=A.lineWrapperClassNames,z=b===void 0?{}:b,D=A.disabled,M=D===void 0?!1:D,B=A.reference,H=B===void 0?null:B,k=Ze(y.useState(null),2),Y=k[0],T=k[1],S=y.useMemo(function(){var O=[];return MnA.forEach(function(Z){CnA.forEach(function(C){if(Z!==C){var j=W2(Z,C),N=j.snakeCase,V=j.camelCase;N&&V&&O.push({name:V,className:N,verticalPosition:C,horizontalPosition:Z})}})}),O},[]),X=y.useMemo(function(){var O=[];return S.forEach(function(Z){WeA(Z.name)&&(La(m)?m[Z.name]:m)&&O.push({name:Z.name,component:h,className:JA(x.default,x[Z.name],M&&x.disabled),wrapperClassName:JA("advanced-cropper-bounding-box__line","advanced-cropper-bounding-box__line--".concat(Z.name),z.default,z[Z.name],M&&z.disabled),hoverClassName:x.hover,verticalPosition:Z.verticalPosition,horizontalPosition:Z.horizontalPosition,disabled:M})}),O},[S,m,h,x,z,M]),q=y.useMemo(function(){var O=[];return S.forEach(function(Z){(La(c)?c[Z.name]:c)&&O.push({name:Z.name,component:o,className:JA(f.default,f[Z.name]),containerClassName:JA("advanced-cropper-bounding-box__handler-wrapper","advanced-cropper-bounding-box__handler-wrapper--".concat(Z.className)),wrapperClassName:JA("advanced-cropper-bounding-box__handler","advanced-cropper-bounding-box__handler--".concat(Z.className),g.default,g[Z.name]),hoverClassName:f.hover,verticalPosition:Z.verticalPosition,horizontalPosition:Z.horizontalPosition,disabled:M})}),O},[S,c,o,f,g,M]),J=function(O,Z){return function(C,j){var N=C.left,V=C.top,I={left:N,top:V},W;if(!Z&&O?W="width":Z&&!O&&(W="height"),!M){if(r){var nA=W2(O,Z).camelCase;nA&&r(nA,I,{reference:Y||H,preserveAspectRatio:j&&j.shiftKey,respectDirection:W,compensate:!0})}Y||T(H)}}},G=function(){s==null||s(),T(null)};return y.createElement("div",{className:JA("advanced-cropper-bounding-box",t),style:e},n,y.createElement("div",null,X.map(function(O){return y.createElement(O.component,{key:O.name,defaultClassName:O.className,hoverClassName:O.hoverClassName,wrapperClassName:O.wrapperClassName,position:O.name,disabled:O.disabled,onMove:J(O.horizontalPosition,O.verticalPosition),onMoveEnd:G})})),y.createElement("div",null,q.map(function(O){var Z=y.createElement(O.component,{defaultClassName:O.className,hoverClassName:O.hoverClassName,wrapperClassName:O.wrapperClassName,horizontalPosition:O.horizontalPosition,verticalPosition:O.verticalPosition,disabled:O.disabled,onMove:J(O.horizontalPosition,O.verticalPosition),onMoveEnd:G});return y.createElement("div",{key:O.name,className:O.containerClassName},Z)})))},L4=function(A){var e=A.className,t=A.children;return y.createElement("div",{className:JA("advanced-cropper-stencil-overlay",e)},t)};function jnA(A){A===void 0&&(A=null);var e=y.useRef(new VtA),t=Ze(y.useState(!1),2),n=t[0],r=t[1];return[function(s){A&&A.active?e.current.start(oA(oA({},A),{onStart:function(){r(!0)},onProgress:function(a){s(a)},onStop:function(){r(!1)}})):e.current.active||s(1)},n]}var OnA=function(A){var e=A.className,t=A.transitions,n=A.children,r=oa(A,["className","transitions","children"]),s=y.useRef(null),a=y.useRef(r),o=Ze(y.useState(r),2),l=o[0],c=o[1],u=Ze(jnA(t),2),f=u[0],d=u[1];y.useLayoutEffect(function(){if(!$o(l,r)){c(r);var m=d?oA({},a.current):l;f(function(p){var h=["left","top","height","width"];h.forEach(function(w){var x=r[w],b=m[w];a.current[w]=Ee(b)&&Ee(x)?b+(x-b)*p:x}),s.current&&(s.current.style.width="".concat(a.current.width,"px"),s.current.style.height="".concat(a.current.height,"px"),s.current.style.transform="translate3d(".concat(a.current.left,"px, ").concat(a.current.top,"px, 0px)"))})}},[l,d,r.width,r.height,r.top,r.left]);var g=d?a.current:r,v={left:0,top:0,width:"".concat(g.width,"px"),height:"".concat(g.height,"px"),transform:"translate3d(".concat(g.left,"px, ").concat(g.top,"px, 0px)")};return y.createElement("div",{ref:s,className:JA("advanced-cropper-artificial-transition",e),style:v},n)},q4=function(A){var e=A.className,t=A.transitions,n=A.width,r=A.height,s=A.left,a=A.top,o=A.children;return y.createElement(OnA,{className:JA("advanced-cropper-stencil-wrapper",e),transitions:t,width:n,height:r,top:a,left:s},o)},J4=function(A){var e=A.columns,t=e===void 0?3:e,n=A.rows,r=n===void 0?3:n,s=A.visible,a=s===void 0?!1:s,o=A.className,l=[],c=Ze(y.useState(t),2),u=c[0],f=c[1],d=Ze(y.useState(r),2),g=d[0],v=d[1];Rl(function(){a&&(v(r),f(t))},[a,t,r]);for(var m=0;m<g;m++){for(var p=[],h=0;h<u;h++)p.push(y.createElement("div",{key:h,className:JA("advanced-cropper-stencil-grid__cell",m===0&&"advanced-cropper-stencil-grid__cell--top",m===g-1&&"advanced-cropper-stencil-grid__cell--bottom",h===0&&"advanced-cropper-stencil-grid__cell--left",h===u-1&&"advanced-cropper-stencil-grid__cell--right")}));l.push(y.createElement("div",{key:m,className:"advanced-cropper-stencil-grid__row"},p))}return y.createElement("div",{className:JA("advanced-cropper-stencil-grid",a&&"advanced-cropper-stencil-grid--visible",o)},l)},R4=y.forwardRef(function(A,e){var t=A.cropper,n=A.coordinates,r=A.aspectRatio,s=A.minAspectRatio,a=A.maxAspectRatio,o=A.handlerComponent,l=o===void 0?L9:o,c=A.handlers,u=c===void 0?{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}:c,f=A.handlerClassNames,d=f===void 0?{}:f,g=A.handlerWrapperClassNames,v=g===void 0?{}:g,m=A.lines,p=m===void 0?{west:!0,north:!0,east:!0,south:!0}:m,h=A.lineComponent,w=h===void 0?Q9:h,x=A.lineClassNames,b=x===void 0?{}:x,z=A.lineWrapperClassNames,D=z===void 0?{}:z,M=A.resizable,B=M===void 0?!0:M,H=A.movable,k=H===void 0?!0:H,Y=A.grid,T=A.gridClassName,S=A.className,X=A.movingClassName,q=A.resizingClassName,J=A.previewClassName,G=A.boundingBoxClassName,O=A.overlayClassName,Z=A.draggableAreaClassName,C=A.disabled,j=t.getState(),N=t.getTransitions(),V=t.getInteractions(),I=B&&!C,W=k&&!C;y.useImperativeHandle(e,function(){return{aspectRatio:vo(r||{minimum:s,maximum:a})}});var nA=function(DA){t&&W&&t.moveCoordinates(DA)},Q=function(){t&&t.moveCoordinatesEnd()},tA=function(DA,YA,bA){t&&I&&t.resizeCoordinates(DA,YA,bA)},AA=function(){t&&t.resizeCoordinatesEnd()},eA=n?xe(n)?n(j):n:V9(j),U=eA.width,_=eA.height,gA=eA.left,uA=eA.top;return j&&y.createElement(q4,{className:JA("advanced-cropper-rectangle-stencil",S,V.moveCoordinates&&X,V.resizeCoordinates&&q,{"advanced-cropper-rectangle-stencil--movable":W,"advanced-cropper-rectangle-stencil--moving":V.moveCoordinates,"advanced-cropper-rectangle-stencil--resizable":I,"advanced-cropper-rectangle-stencil--resizing":V.resizeCoordinates,"advanced-cropper-rectangle-stencil--disabled":C}),width:U,height:_,left:gA,top:uA,transitions:N},y.createElement(Q4,{reference:j.coordinates,className:JA(G,"advanced-cropper-rectangle-stencil__bounding-box"),handlers:u,handlerComponent:l,handlerClassNames:d,handlerWrapperClassNames:v,lines:p,lineComponent:w,lineClassNames:b,lineWrapperClassNames:D,onResize:tA,onResizeEnd:AA,disabled:!I},y.createElement(wv,{disabled:!W,onMove:nA,onMoveEnd:Q,className:JA("advanced-cropper-rectangle-stencil__draggable-area",Z)},y.createElement(L4,{className:JA("advanced-cropper-rectangle-stencil__overlay",O)},Y&&y.createElement(J4,{visible:t.hasInteractions(),columns:V.transformImage.rotate?9:3,rows:V.transformImage.rotate?9:3,className:JA("advanced-cropper-rectangle-stencil__grid",T)}),y.createElement("div",{className:JA("advanced-cropper-rectangle-stencil__preview",J)})))))});R4.displayName="RectangleStencil";function TnA(A){return y.useMemo(function(){return Bu(A,{touch:!0},{touch:!1})},[A])}function EnA(A){return y.useMemo(function(){return Bu(A,{touch:!0,wheel:{ratio:.1}},{touch:!1,wheel:!1})},[A])}function NnA(A){return y.useMemo(function(){return Bu(A,{touch:!0,mouse:!0},{touch:!1,mouse:!1})},[A])}var HnA=(function(){function A(e){var t=e.active;this.active=t,this.defaultPrevented=!1}return A.prototype.preventDefault=function(){this.defaultPrevented=!0},A})(),knA=(function(A){Tr(e,A);function e(t){var n=A.call(this,t)||this;return n.processMove=function(r){var s=n.props,a=s.onTransform,o=s.touchScale,l=s.touchMove,c=s.touchRotate,u=n.container.current;u&&a&&(a(ztA(r,n.touches,u,{scale:o,rotate:c,move:l})),n.touches=r)},n.processEnd=function(){var r=n.props.onTransformEnd;n.transforming&&(n.transforming=!1,r&&r())},n.processStart=function(){n.transforming=!0,n.debouncedProcessEnd.clear()},n.processEvent=function(r){var s=n.props,a=s.onEvent,o=s.disabled,l=s.preventDefault,c=l===void 0?!0:l,u=new HnA({active:n.transforming});return a?a(u,r):c&&(r.preventDefault(),r.stopPropagation()),!o&&!u.defaultPrevented},n.onWheel=function(r){var s=n.props,a=s.onTransform,o=s.wheelScale,l=n.container.current;o&&n.processEvent(r)&&(n.processStart(),a&&l&&a(DtA(r,l,o===!0?.1:o.ratio)),n.touches.length||n.debouncedProcessEnd())},n.onTouchStart=function(r){var s=n.props,a=s.touchMove,o=s.touchScale,l=s.touchRotate;if(r.cancelable&&(a||(o||l)&&r.touches.length>1)&&n.processEvent(r)){var c=n.container.current;if(c){var u=c.getBoundingClientRect(),f=u.left,d=u.top,g=u.bottom,v=u.right;n.touches=Array.from(r.touches).filter(function(m){return m.clientX>f&&m.clientX<v&&m.clientY>d&&m.clientY<g})}}},n.onTouchEnd=function(r){r.touches.length===0&&(n.touches=[],n.processEnd())},n.onTouchMove=function(r){if(n.touches.length){var s=zr([],Ze(r.touches),!1).filter(function(a){return!a.identifier||n.touches.find(function(o){return o.identifier===a.identifier})});n.processEvent(r)&&(n.processMove(s),n.processStart())}},n.onMouseDown=function(r){var s=n.props.mouseMove;if(s&&"buttons"in r&&r.buttons===1&&n.processEvent(r)){var a={clientX:r.clientX,clientY:r.clientY};n.touches=[a],n.processStart()}},n.onMouseMove=function(r){n.touches.length&&n.processEvent(r)&&n.processMove([{clientX:r.clientX,clientY:r.clientY}])},n.onMouseUp=function(){n.touches=[],n.processEnd()},n.transforming=!1,n.touches=[],n.anchor={left:0,top:0},n.container=y.createRef(),n.debouncedProcessEnd=D4(n.processEnd,t.timeout),n}return e.prototype.shouldComponentUpdate=function(){return!0},e.prototype.componentWillUnmount=function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd);var t=this.container.current;t&&(t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("wheel",this.onWheel))},e.prototype.componentDidMount=function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1});var t=this.container.current;t&&(t.addEventListener("touchstart",this.onTouchStart,{passive:!1}),t.addEventListener("mousedown",this.onMouseDown,{passive:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}))},e.prototype.render=function(){var t=this.props,n=t.className,r=t.children,s=t.style;return y.createElement("div",{className:n,style:s,ref:this.container},r)},e.defaultProps={touchMove:!0,mouseMove:!0,touchScale:!0,touchRotate:!1,wheelScale:!0,timeout:500},e})(y.Component),ZnA=function(A){var e=A.scaleImage,t=e===void 0?!0:e,n=A.moveImage,r=n===void 0?!0:n,s=A.rotateImage,a=s===void 0?!1:s,o=A.children,l=A.className,c=A.style,u=A.cropper,f=A.timeout,d=A.disabled,g=u.getTransitions(),v=TnA(a),m=EnA(t),p=NnA(r);return y.createElement(knA,{className:l,style:c,onTransform:u.transformImage,onTransformEnd:u.transformImageEnd,touchMove:p.touch,mouseMove:p.mouse,touchScale:m.touch,wheelScale:m.wheel,touchRotate:v.touch,disabled:g.active||d,preventDefault:!d,timeout:f},o)},SnA=function(A,e){var t=A.style,n=A.className,r=A.stencilComponent,s=r===void 0?R4:r,a=A.stencilConstraints,o=a===void 0?H4:a,l=A.stencilProps,c=l===void 0?{}:l,u=A.wrapperComponent,f=u===void 0?znA:u,d=A.wrapperProps,g=d===void 0?{}:d,v=A.backgroundComponent,m=v===void 0?G4:v,p=A.backgroundProps,h=p===void 0?{}:p,w=A.backgroundClassName,x=A.backgroundWrapperComponent,b=x===void 0?ZnA:x,z=A.backgroundWrapperProps,D=z===void 0?{}:z,M=A.boundaryComponent,B=M===void 0?I9:M,H=A.boundaryProps,k=A.boundaryClassName,Y=A.canvas,T=Y===void 0?!0:Y,S=A.crossOrigin,X=S===void 0?!0:S,q=A.disabled,J=A.settings,G=oa(A,["style","className","stencilComponent","stencilConstraints","stencilProps","wrapperComponent","wrapperProps","backgroundComponent","backgroundProps","backgroundClassName","backgroundWrapperComponent","backgroundWrapperProps","boundaryComponent","boundaryProps","boundaryClassName","canvas","crossOrigin","disabled","settings"]),O=y.useRef(null),Z=bnA(function(){return oA(oA({},G),{crossOrigin:X,stencilProps:c,canvas:T,settings:oA(oA({},J),o(J,oA(oA({},c),O.current)))})}),C=Z.cropper,j=Z.image,N=Z.refs,V=s,I=f,W=b,nA=m,Q=B;y.useImperativeHandle(e,function(){return C});var tA={loading:C.isLoading(),loaded:C.isLoaded()};return y.createElement(I,oA({},g,{disabled:q,className:JA("advanced-cropper",n),cropper:C,style:t},tA),y.createElement(Q,oA({},H,{ref:N.boundary,className:JA("advanced-cropper__boundary",k)}),y.createElement(W,oA({},D,{disabled:q,cropper:C,className:"advanced-cropper__background-wrapper"}),C.getState()&&y.createElement(nA,oA({},h,{ref:N.image,crossOrigin:X,cropper:C,className:JA("advanced-cropper__background",w)})),y.createElement(V,oA({},c,{disabled:q,ref:O,cropper:C,image:j}))),T&&y.createElement(I4,{ref:N.canvas})))},F4=mnA(SnA),W4=["transformImage","moveCoordinates","resizeCoordinates","defaultCoordinates","defaultVisibleArea","areaPositionRestrictions","areaSizeRestrictions","sizeRestrictions","positionRestrictions","aspectRatio","minWidth","minHeight","maxWidth","maxHeight","defaultSize","defaultPosition","defaultTransforms","imageRestriction","priority"];function K4(A,e){e===void 0&&(e=W4);var t={settings:{},props:{}};return Object.keys(A).forEach(function(n){e.some(function(r){return r===n})?t.settings[n]=A[n]:t.props[n]=A[n]}),t}var U4=y.forwardRef(function(A,e){var t=K4(A,zr(zr([],Ze(W4),!1),["stencilSize"],!1));return y.createElement(F4,oA({postProcess:unA,stencilConstraints:anA},t.props,{settings:oA(oA({defaultSize:inA,aspectRatio:lnA,sizeRestrictions:ktA(onA)},t.settings),{transformImage:oA(oA({},t.settings.transformImage),{adjustStencil:!1})}),ref:e}))});U4.displayName="FixedCropper";var _4=y.forwardRef(function(A,e){var t=K4(A),n=t.props,r=t.settings,s=r.stencilSize,a=r.autoZoom,o=oa(r,["stencilSize","autoZoom"]),l=vnA();return nt(a)||(n.postProcess||s?l("prop 'autoZoom' is deprecated now and will be removed, use 'postProcess' prop to pass your auto zoom function."):(l("prop 'autoZoom' is deprecated now and will be removed, use 'postProcess' prop to pass your auto zoom function. The 'postProcess' automatically set to 'hybridAutoZoom'"),n.postProcess=dnA)),nt(s)?y.createElement(F4,oA({},n,{ref:e,settings:o})):(l("prop 'stencilSize' is deprecated for <Cropper/> component now and will be removed, use <FixedCropper/> component instead."),y.createElement(U4,oA({ref:e,stencilSize:s},o,n)))});_4.displayName="CropperComponent";var VnA=y.forwardRef(function(A,e){var t=A.cropper,n=A.coordinates,r=A.handlerComponent,s=r===void 0?L9:r,a=A.handlers,o=a===void 0?{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}:a,l=A.handlerClassNames,c=l===void 0?{}:l,u=A.handlerWrapperClassNames,f=u===void 0?{}:u,d=A.lines,g=d===void 0?{west:!0,north:!0,east:!0,south:!0}:d,v=A.lineComponent,m=v===void 0?Q9:v,p=A.lineClassNames,h=p===void 0?{}:p,w=A.lineWrapperClassNames,x=w===void 0?{}:w,b=A.resizable,z=b===void 0?!0:b,D=A.movable,M=D===void 0?!0:D,B=A.grid,H=A.gridClassName,k=A.className,Y=A.movingClassName,T=A.resizingClassName,S=A.previewClassName,X=A.boundingBoxClassName,q=A.overlayClassName,J=A.draggableAreaClassName,G=A.disabled,O=t.getState(),Z=t.getTransitions(),C=t.getInteractions(),j=z&&!G,N=M&&!G;y.useImperativeHandle(e,function(){return{aspectRatio:1,boundingBox:"circle"}});var V=function(_){t&&N&&t.moveCoordinates(_)},I=function(){t&&t.moveCoordinatesEnd()},W=function(_,gA,uA){t&&j&&t.resizeCoordinates(_,gA,uA)},nA=function(){t&&t.resizeCoordinatesEnd()},Q=n?xe(n)?n(O):n:V9(O),tA=Q.width,AA=Q.height,eA=Q.left,U=Q.top;return O&&y.createElement(q4,{className:JA("advanced-cropper-circle-stencil",k,C.moveCoordinates&&Y,C.resizeCoordinates&&T,{"advanced-cropper-circle-stencil--movable":N,"advanced-cropper-circle-stencil--moving":C.moveCoordinates,"advanced-cropper-circle-stencil--resizable":j,"advanced-cropper-circle-stencil--resizing":C.resizeCoordinates,"advanced-cropper-circle-stencil--disabled":G}),width:tA,height:AA,left:eA,top:U,transitions:Z},y.createElement(Q4,{reference:O.coordinates,className:JA(X,"advanced-cropper-circle-stencil__bounding-box"),handlers:o,handlerComponent:s,handlerClassNames:c,handlerWrapperClassNames:f,lines:g,lineComponent:m,lineClassNames:h,lineWrapperClassNames:x,onResize:W,onResizeEnd:nA,disabled:!j},y.createElement(wv,{disabled:!N,onMove:V,onMoveEnd:I,className:JA("advanced-cropper-circle-stencil__draggable-area",J)},y.createElement(L4,{className:JA("advanced-cropper-circle-stencil__overlay",q)},B&&y.createElement(J4,{visible:t.hasInteractions(),columns:C.transformImage.rotate?9:3,rows:C.transformImage.rotate?9:3,className:JA("advanced-cropper-circle-stencil__grid",H)}),y.createElement("div",{className:JA("advanced-cropper-circle-stencil__preview",S)})))))});VnA.displayName="CircleStencil";var XnA=y.forwardRef(function(A,e){var t=A.src,n=A.crossOrigin,r=n===void 0?!0:n,s=oa(A,["src","crossOrigin"]);return t?y.createElement("img",oA({key:t,ref:e,src:t,className:JA("advanced-cropper-source"),crossOrigin:r===!0?"anonymous":r||void 0},s)):null});XnA.displayName="CropperSource";var YnA=function(A){var e=A.children,t=A.cropper,n=A.className,r=A.style;return y.createElement("div",{className:JA(n,"cropper-preview-wrapper"),style:r},y.createElement(X4,{visible:t==null?void 0:t.isLoaded(),className:"cropper-preview-wrapper__fade"},e))},GnA=function(A){var e=A.className,t=A.cropper,n=A.crossOrigin,r=n===void 0?!0:n,s=A.size,a=A.style,o=t.getState(),l=t.getTransitions(),c=t.getImage(),u=s&&c&&(o!=null&&o.coordinates)?nnA(c,o,s,l):{},f=c?c.src:void 0;return f?y.createElement("img",{key:f,className:JA("advanced-cropper-background-image",e),src:f,crossOrigin:r===!0?"anonymous":r||void 0,style:oA(oA({},u),a),onMouseDown:Y4}):null};y.forwardRef(function(A,e){var t,n,r,s,a=A.className,o=A.contentClassName,l=A.state,c=l===void 0?null:l,u=A.image,f=u===void 0?null:u,d=A.transitions,g=d===void 0?null:d,v=A.backgroundComponent,m=v===void 0?GnA:v,p=A.backgroundProps,h=A.backgroundClassName,w=A.boundaryComponent,x=w===void 0?I9:w,b=A.boundaryProps,z=A.boundaryClassName,D=A.wrapperComponent,M=D===void 0?YnA:D,B=A.wrapperProps,H=A.loaded,k=H===void 0?!0:H,Y=A.loading,T=Y===void 0?!1:Y,S=A.style,X=A.cropper,q=S4(),J=y.useRef(null),G=y.useRef(null),O=X||(G.current?G:{current:{getState:function(){return c},getTransitions:function(){return g},getImage:function(){return f},isLoaded:function(){return k},isLoading:function(){return T}}}),Z=Ze(y.useState(null),2),C=Z[0],j=Z[1],N=(n=(t=O.current)===null||t===void 0?void 0:t.getState())===null||n===void 0?void 0:n.coordinates,V=(s=(r=O.current)===null||r===void 0?void 0:r.getImage())===null||s===void 0?void 0:s.src,I=C?{width:"".concat(C.width,"px"),height:"".concat(C.height,"px")}:{},W=function(){var AA,eA,U=(eA=(AA=O.current)===null||AA===void 0?void 0:AA.getState())===null||eA===void 0?void 0:eA.coordinates;J.current&&U&&J.current.stretchTo(U).then(function(_){_&&U?ta(Ae(U),Ae(_))?j({width:_.width,height:_.width/Ae(U)}):j({width:_.height*Ae(U),height:_.height}):j(null)}),q()};V4(W),y.useLayoutEffect(W,[N==null?void 0:N.height,N==null?void 0:N.width]),y.useImperativeHandle(e,function(){return{refresh:W,update:function(AA){AA?G.current=AA:G.current=null,W()}}});var nA=M,Q=m,tA=x;return y.createElement(nA,oA({},B,{className:JA(a,"advanced-cropper-preview"),cropper:O.current,style:S}),y.createElement(tA,oA({ref:J,stretchAlgorithm:QtA},b,{className:JA("advanced-cropper-preview__boundary",z)}),y.createElement("div",{className:JA(o,"advanced-cropper-preview__content"),style:I},O.current&&y.createElement(Q,oA({},p,{cropper:O.current,size:C,className:JA(h,"advanced-cropper-preview__image",V&&"advanced-cropper-preview__image--visible")})))))});const _m={custom:null,"1:1":{width:800,height:800},"16:9":{width:1920,height:1080},"3:2":{width:1200,height:800},"4:3":{width:1024,height:768}},InA=()=>{const{state:{activeMedia:A},cropperRef:e,transformations:t,setTransformations:n,config:{cropperAspectRatio:r,viewOnly:s}}=Hr(),[a,o]=y.useState(null),[l,c]=y.useState(""),[u,f]=y.useState("desktop"),[d,g]=y.useState(r||"custom"),v=!((A==null?void 0:A.media)instanceof File)&&s,m=()=>{if(!r)return null;const[T,S]=r.split(":"),X=parseInt(T,10),q=parseInt(S,10);return isNaN(X)||isNaN(q)?null:{width:X,height:q}},p=()=>{if(r){const S=m();return S?S.width/S.height:void 0}if(d==="custom")return;const T=_m[d];return T?T.width/T.height:void 0};y.useEffect(()=>{var S,X;if(!(A!=null&&A.media)||!e.current)return;if(!((A==null?void 0:A.media)instanceof File)){c(((S=A.media)==null?void 0:S.url)||((X=A.media)==null?void 0:X.src)),H(!0);return}const T=new FileReader;T.onload=q=>{var J;e.current&&((J=q.target)!=null&&J.result)&&c(q.target.result.toString())},T.readAsDataURL(A==null?void 0:A.media),H(!0)},[A]),y.useEffect(()=>{r&&g(r)},[r]);const h=[{icon:$S,label:"desktop",size:"1920x1080"},{icon:VV,label:"tablet",size:"1024x768"},{icon:TV,label:"mobile",size:"414x896"}],w=()=>r?[]:Object.keys(_m).map(T=>{let S=j7;return(T==="16:9"||T==="3:2"||T==="4:3")&&(S=C7),{icon:S,label:T}}),x=T=>{const S=T.getImage(),X=T.getCoordinates();let q;X&&(q=Iy(X,(S==null?void 0:S.width)||0,(S==null?void 0:S.height)||0)),n(J=>({...J,[u]:{...J[u],coordinates:X,pillowCropBox:q||void 0,aspectRatio:r||d||"custom",originalImageWidth:(S==null?void 0:S.width)||0,originalImageHeight:(S==null?void 0:S.height)||0}}))},b=T=>{T&&(e.current&&e.current.reset(),f(T),setTimeout(()=>{z(T)},100))},z=T=>{const S=t[T];if(!(!e.current||!S)){if(S.rotation)for(let X=0;X<S.rotation/90;X++)e.current.rotateImage(90);if((S.flipHorizontal||S.flipVertical)&&e.current.flipImage(S.flipHorizontal||!1,S.flipVertical||!1),S.coordinates)e.current.setCoordinates(S.coordinates);else{const X=e.current.getImage();e.current.setCoordinates({height:X==null?void 0:X.height,left:0,top:0,width:X==null?void 0:X.width})}S.aspectRatio&&g(S.aspectRatio)}},D=(T,S)=>{if(e.current){e.current.flipImage(T,S);const X=e.current.getCoordinates(),q=e.current.getImage();n(J=>{var G,O,Z,C;return{...J,[u]:{...J[u],coordinates:X,flipHorizontal:T?!((G=J[u])!=null&&G.flipHorizontal):(O=J[u])==null?void 0:O.flipHorizontal,flipVertical:S?!((Z=J[u])!=null&&Z.flipVertical):(C=J[u])==null?void 0:C.flipVertical,originalImageWidth:(q==null?void 0:q.width)||0,originalImageHeight:(q==null?void 0:q.height)||0}}})}},M=()=>{if(!d||!a||!e.current)return;let T;if(r){const I=m();if(!I)return;T=I}else{const I=_m[d];if(!I)return;T=I}const S=a.width,X=a.height,q=T.width,J=T.height,G=S/q,O=X/J,Z=Math.min(G,O),C=q*Z,j=J*Z,N={width:C,height:j,left:(S-C)/2,top:(X-j)/2};e.current.setCoordinates(N);const V=Iy(N,S,X);n(I=>({...I,[u]:{...I[u],coordinates:N,pillowCropBox:V,aspectRatio:r||d,originalImageWidth:S,originalImageHeight:X}}))},B=()=>{if(e.current){e.current.rotateImage(-90);const T=e.current.getCoordinates(),S=e.current.getImage();n(X=>{var q;return{...X,[u]:{...X[u],coordinates:T,rotation:(((q=X[u])==null?void 0:q.rotation)||0)+90,originalImageWidth:(S==null?void 0:S.width)||0,originalImageHeight:(S==null?void 0:S.height)||0}}})}},H=(T=!1)=>{if(e.current){const S={rotation:0,flipHorizontal:!1,flipVertical:!1,aspectRatio:r||"custom",coordinates:void 0,pillowCropBox:void 0,originalImageWidth:0,originalImageHeight:0};n(T?{desktop:S,tablet:S,mobile:S}:q=>({...q,[u]:S})),e.current.reset();const X=e.current.getImage();X&&e.current.setCoordinates({height:X==null?void 0:X.height,left:0,top:0,width:X==null?void 0:X.width}),r||g("custom")}};y.useEffect(()=>{M()},[d]);const k=w(),Y=!r&&k.length>0;return i.jsxs("div",{className:"flex flex-col items-center space-y-4 h-full bg-muted p-4 px-6 ",children:[i.jsxs("div",{className:E("w-full flex justify-between items-center",{hidden:!v}),children:[i.jsx(gd,{type:"single",value:u,onValueChange:b,className:"flex-1",children:h.map(T=>i.jsx(vd,{value:T.label,className:"text-muted-foreground text-xs p-2 rounded-none gap-1 md:px-4 capitalize flex-col bg-transparent data-[state=on]:bg-transparent data-[state=on]:border-b-2 data-[state=on]:border-primary data-[state=on]:text-[#434343]",children:i.jsx(T.icon,{className:E("h-[16px] w-[20px]",{"text-[#434343]":T.label==u}),strokeWidth:2})},T.label))}),i.jsx(ge,{size:"sm",variant:"outline",onClick:()=>H(),children:"Reset"})]}),i.jsxs("div",{className:"bg-background overflow-hidden rounded border w-md 3xl:w-160 flex flex-col flex-1",children:[i.jsx(_4,{ref:e,src:l,onChange:v?x:void 0,onReady:T=>{const S=T.getImage();o(S),T.setCoordinates({height:S==null?void 0:S.height,left:0,top:0,width:S==null?void 0:S.width})},stencilProps:v?{movable:!0,resizable:!0,lines:!0,handlers:!0,overlayClassName:"bg-[#3338533D]",aspectRatio:p()}:{movable:!1,resizable:!1,lines:!1,handlers:!1},crossOrigin:!1,backgroundWrapperProps:{scaleImage:v,moveImage:v},resizeCoordinates:v,canvas:!0,className:"!max-h-[25rem] flex-1 w-md 3xl:w-160 relative bg-[red]",disabled:!v}),i.jsxs("div",{className:"flex gap-2 justify-center items-center text-muted-foreground text-xs p-4 border-t",children:[v&&Y&&i.jsxs(i.Fragment,{children:[i.jsx(gd,{type:"single",value:d,onValueChange:T=>g(T||"custom"),className:"gap-2",children:k.map(T=>i.jsxs(vd,{value:T.label,className:"group text-muted-foreground text-xs h-fit p-2 rounded gap-1 capitalize flex-col bg-transparent data-[state=on]:bg-primary/40 data-[state=on]:text-[#434343]",children:[i.jsx(T.icon,{className:"h-[16px] w-[20px]",strokeWidth:2}),T.label]},T.label))}),i.jsx("div",{className:"w-px h-8 bg-border mx-2"})]}),r&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium ",children:[i.jsx(j7,{className:"h-4 w-4"}),r]}),v&&i.jsx("div",{className:"w-px h-8 bg-border mx-2"})]}),v&&i.jsxs(i.Fragment,{children:[i.jsxs(ge,{variant:"ghost",className:"flex-col gap-1 !p-2 h-fit",onClick:B,children:[i.jsx(DV,{className:"h-4 w-4"}),"Rotate"]}),i.jsxs(ge,{variant:"ghost",className:"flex-col gap-1 !p-2 h-fit",onClick:()=>D(!0,!1),children:[i.jsx(XS,{className:"h-4 w-4"}),"Flip H"]}),i.jsxs(ge,{variant:"ghost",className:"flex-col gap-1 !p-2 h-fit",onClick:()=>D(!1,!0),children:[i.jsx(GS,{className:"h-4 w-4"}),"Flip V"]})]})]})]})]})},QnA=()=>{const{handleMediaUpdate:A,handleMediaAction:e,state:{activeMedia:t,activeTab:n},handleMediaSelect:r,config:s,mutations:{editMutationPending:a,uploadMutationPending:o}}=Hr(),l=(t==null?void 0:t.type)==="add"||(t==null?void 0:t.type)==="edit",c=a||o,[u,f]=y.useState({title:"",description:"",alternative_text:"",caption:"",url:""});y.useEffect(()=>{var m;if(!(t!=null&&t.media))return;const v={title:(t==null?void 0:t.media)instanceof File?t.media.name:((m=t.media)==null?void 0:m.title)??"",alternative_text:(t==null?void 0:t.media)instanceof File?t.media.name:t.media.alternative_text??"",caption:t.media.caption??"",url:t.media.url??""};f(v)},[t]);const d=y.useCallback((v,m)=>{f(p=>({...p,[v]:m}))},[]),g=y.useCallback(v=>{var m;if(v.preventDefault(),s!=null&&s.viewOnly&&!((t==null?void 0:t.media)instanceof File))r({...t.media,...u});else{const p=u;(t==null?void 0:t.media)instanceof File||(p.uuid=(m=t==null?void 0:t.media)==null?void 0:m.uuid),A(p)}},[s==null?void 0:s.viewOnly,t.media,r,u,A]);return i.jsx(Mt,{open:l,onOpenChange:()=>e(""),children:i.jsx(wt,{className:"sm:max-w-[70%] sm:max-h-[50rem] p-6 gap-4 items-start overflow-auto",children:i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs(rn,{className:"h-fit w-fit",children:[i.jsx(d0,{children:i.jsx("h1",{className:"text-left text-md",children:"Edit Image"})}),i.jsx(yg,{className:" text-start text-muted-foreground text-base",children:"Modify your image to your preference"})]}),i.jsxs("div",{className:" flex-1 h-0 w-full overflow-auto grid grid-cols-[2fr_1fr] gap-4",children:[i.jsx(InA,{}),i.jsxs("form",{className:"max-w-full flex flex-col justify-between items-center gap-3",onSubmit:g,children:[i.jsx("div",{className:"w-full justify-start h-fit bg-muted border text-base font-bold p-4 py-2 rounded",children:"Image Properties"}),i.jsxs("div",{className:"space-y-3 w-full overflow-y-auto h-10 flex-1",children:[i.jsx(tt,{label:"Title",value:u.title,onChange:v=>d("title",v),inputProps:{placeholder:"Type here"}}),i.jsx(tt,{label:i.jsxs("span",{className:"flex justify-between gap-2",children:["Alternative Text",i.jsx(Bi,{children:i.jsxs(Zs,{children:[i.jsx(Ss,{asChild:!0,children:i.jsx(M7,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(Vs,{children:i.jsx("p",{children:"Alternative text helps screen-reading tools describe images to visually impaired readers."})})]})})]}),value:u.alternative_text,onChange:v=>d("alternative_text",v),inputProps:{placeholder:"Describe the image",minLength:10,onInvalid:v=>{const m=v.target;m.validity.tooShort&&m.setCustomValidity("Alternative text must be at least 10 characters")},onInput:v=>{v.target.setCustomValidity("")}}}),i.jsx(tt,{label:i.jsxs("span",{className:"flex justify-between gap-2",children:["Description",i.jsx(Bi,{children:i.jsxs(Zs,{children:[i.jsx(Ss,{asChild:!0,children:i.jsx(M7,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(Vs,{children:i.jsx("p",{className:"max-w-xs",children:"Add a caption to display below the image"})})]})})]}),type:"textarea",value:u.caption,onChange:v=>d("caption",v),textareaProps:{placeholder:"Image caption",rows:4}})]}),i.jsx(pn,{className:"w-full items-center mt-auto mb-4",children:i.jsx(ge,{type:"submit",isLoading:c,disabled:c,className:"w-full rounded capitalize",children:(t==null?void 0:t.media)instanceof File?"Upload Image":s.viewOnly||n!=null&&n.viewOnly?"add image":"Save Changes"})})]})]})]})})})},LnA=()=>{const{state:{activeMedia:A},mutations:{deleteMutationPending:e},handleMediaAction:t,handleMediaDelete:n}=Hr(),r=()=>t("");return i.jsx(Mt,{open:A.type=="delete",onOpenChange:r,children:i.jsxs(wt,{className:"max-w-[370px] p-0 overflow-hidden",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{className:"text-md",children:i.jsx("h1",{children:"Remove Image?"})})}),i.jsx(gs,{className:"px-4 text-base",children:"Are you sure you want to delete this image?"}),i.jsxs(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:[i.jsx(ge,{variant:"outline",className:"rounded",onClick:r,children:"No, don't delete"}),i.jsx(ge,{className:"rounded",variant:"destructive",onClick:n,isLoading:e,disabled:e,children:"Delete"})]})]})})},qnA=({className:A})=>{var n;const{dispatch:e,config:t}=Hr();return i.jsxs("div",{className:E("w-full h-[100vh] flex-1 flex flex-col p-6 overflow-hidden gap-4",A),children:[i.jsxs("div",{children:[i.jsx("h1",{"data-testid":"header",className:" text-3xl font-[UniversalFeature]",children:"Media Library"}),i.jsx("p",{className:"text-base text-muted-foreground",children:"Select your preferred image choice"})]}),i.jsxs(Ig,{defaultValue:(n=Xl[0])==null?void 0:n.id,onValueChange:r=>e({type:"SET_ACTIVE_TAB",payload:Xl.find(s=>s.id==r)}),className:"p-0 w-full flex-1 flex flex-col",children:[i.jsxs("div",{className:"w-full max-w-full overflow-hidden flex items-center justify-between gap-4",children:[i.jsx(lu,{className:"h-fit flex-1 p-0 justify-start bg-transparent border-0 overflow-hidden",children:Xl.map((r,s)=>i.jsxs(cu,{value:r.id,className:"px-4 py-2 rounded-none rounded-t flex items-center justify-center gap-2 data-[state=active]:border-b-3 data-[state=active]:border-[#6FFFF0] data-[state=active]:bg-accent data-[state=active]:text-accent-foreground data-[state=active]:shadow-none border-0",children:[r.icon&&i.jsx("img",{alt:r.label,src:E9(r.icon),className:"h-5 w-5"}),r.label]},r.id+s))}),i.jsx(ceA,{})]}),Xl.map(r=>i.jsx(QeA,{tab:r,viewOnly:!!t.viewOnly},r.id))]}),i.jsx(QnA,{}),i.jsx(LnA,{})]})},gP={success:i.jsx(Gs,{className:"w-20 h-20 text-primary-foreground/70"}),error:i.jsx(Xh,{className:"w-20 h-20 text-white"}),warning:i.jsx(Jh,{className:"w-20 h-20 text-yellow-500"}),info:i.jsx(Gs,{className:"w-20 h-20 text-primary-foreground"}),action:i.jsx(Gs,{className:"w-20 h-20 text-primary-foreground/90"})},JnA=()=>{const{isVisible:A,currentModal:e,hideModal:t}=EC(),[n,r]=y.useState(!1);if(!e)return null;const{type:s,title:a,message:o,icon:l,confirmText:c="OK",cancelText:u="Cancel",onAction:f,onCancel:d,variant:g="default",size:v="md"}=e,m=async()=>{if(f){r(!0);try{await f()}catch(x){console.error("Modal confirm action failed:",x)}finally{r(!1)}}t()},p=()=>{d&&d(),t()},h={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"},w=()=>{switch(s){case"error":return"destructive";case"warning":return"outline";case"success":return"default";default:return g}};return i.jsx(Mt,{"data-testid":"action-modal",open:A,onOpenChange:t,children:i.jsxs(wt,{className:E("p-8 sm:max-w-[400px] ",h[v]),children:[i.jsxs(rn,{className:"flex items-center justify-around text-center space-y-4",children:[(l||gP[s])&&i.jsx("div",{className:E("flex justify-center items-center p-4 text-3xl bg-primary/50 w-20 h-20 rounded-full border border-primary ",{"bg-destructive/90 border-destructive":s=="error"}),children:l||gP[s]}),i.jsx(sn,{children:i.jsx("h1",{className:"text-md capitalize text-center",children:a})}),o&&i.jsx(gs,{className:"text-sm lowercase first-letter:uppercase text-center text-muted-foreground px-10",children:o})]}),i.jsxs(pn,{className:"flex justify-center space-x-4 mt-4",children:[(f||s==="action")&&i.jsx(pA,{className:"flex-1 rounded",variant:"outline",onClick:m,disabled:n,children:n?"Processing...":c}),i.jsx(pA,{variant:w(),onClick:p,disabled:n,className:"flex-1 rounded",children:u})]})]})})},Yi=({children:A})=>{const[e,t]=y.useState(!1),[n,r]=y.useState(null),s=y.useRef(null),a=y.useCallback(c=>{s.current&&clearTimeout(s.current),r(c),t(!0),c.autoClose&&c.autoClose>0&&(s.current=setTimeout(()=>{o()},c.autoClose))},[]),o=y.useCallback(()=>{s.current&&clearTimeout(s.current),t(!1),r(null)},[]);y.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const l={showModal:a,hideModal:o,isVisible:e,currentModal:n};return i.jsxs(TC.Provider,{value:l,children:[A,i.jsx(JnA,{})]})},$4=({className:A,config:e,onChange:t,image:n})=>i.jsx(Yi,{children:i.jsx(oeA,{config:e,onChange:t,image:n,children:i.jsx(qnA,{className:A})})}),eh=({open:A=!0,config:e,onChange:t,handleToggleOpen:n,className:r,image:s})=>i.jsx(Mt,{open:A,onOpenChange:n,children:i.jsx(wt,{className:E("sm:max-w-[70%] h-[90%] shadow-lg p-0",r),children:i.jsx($4,{config:e,onChange:t,className:"h-full",image:s})})}),RnA=()=>{const{state:A,dispatch:e,imageGalleryConfig:t}=On(),{showImageGallery:n,value:r}=A,s=()=>{e({type:"TOGGLE_IMAGE_GALLERY"})},a=()=>{e({type:"SET_VALUE",payload:""})},o=f=>{f&&e({type:"SELECT_IMAGE",payload:f}),e({type:"TOGGLE_IMAGE_GALLERY",payload:!1})};if(!t)return null;const l=r,c=(l==null?void 0:l.url)||(l==null?void 0:l.src)||"";return(t==null?void 0:t.type)==="inline"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("div",{className:"w-20 h-15 rounded-sm overflow-hidden bg-gray-100 flex items-center justify-center shrink-0",children:c?i.jsx(us,{url:c,alt:l.alternative_text,classname:"w-full h-full object-cover"}):i.jsx(jeA,{className:"w-6 h-6 text-gray-400"})}),i.jsxs("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:[c?i.jsxs(i.Fragment,{children:[i.jsxs(pA,{size:"sm",onClick:s,className:"h-8 px-3 text-sm",children:[i.jsx(Us,{className:"w-4 h-4 mr-1"}),"Edit image"]}),i.jsxs(pA,{variant:"outline",size:"sm",onClick:a,className:"h-8 px-3 text-sm ",children:[i.jsx(Mi,{className:"w-4 h-4 mr-1 text-red-600"}),"Remove image"]})]}):i.jsxs(pA,{size:"sm",onClick:s,className:"h-8 px-3 text-sm",children:[i.jsx($y,{className:"w-4 h-4 mr-1"}),"Upload image"]}),i.jsx("div",{className:"text-xs text-gray-500 shrink-0 w-full",children:"Use JPEG, PNG, or GIF. Best size: 200x200 pixels. Keep it under 2MB"})]})]}),i.jsx(eh,{config:{...t,viewOnly:!0},open:n,onChange:o,image:l,handleToggleOpen:f=>e({type:"TOGGLE_IMAGE_GALLERY",payload:f})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:E("flex-1 overflow-hidden",{"border-2 border-dashed ":!c}),children:[c&&i.jsxs("div",{className:"relative w-full max-h-full overflow-hidden flex-1 flex items-center justify-center",children:[i.jsx(us,{url:c,alt:l.alternative_text,classname:"min-h-20 waz-input-box-content"}),i.jsxs("div",{className:"flex items-center gap-1 absolute top-2 right-2 z-10",children:[i.jsx(pA,{variant:"ghost",size:"icon",className:"rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] bg-background w-7 h-7",onClick:s,children:i.jsx(Us,{color:"gray",fontSize:6})}),i.jsx(pA,{variant:"ghost",size:"icon",className:"rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] bg-background w-7 h-7",onClick:a,children:i.jsx(Mi,{color:"red",size:"small"})})]})]}),!c&&i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 h-50",onClick:s,children:[i.jsx($y,{className:"text-muted-forground"}),i.jsxs("p",{className:"text-sm text-center",children:[i.jsx("span",{className:"text-[#EE6F71] cursor-pointer",children:"Click to open media library"})," ",i.jsx("br",{}),"PNG, JPG, JPEG"]})]})]}),i.jsx(eh,{config:{...t,viewOnly:!0},open:n,onChange:o,image:l,handleToggleOpen:f=>e({type:"TOGGLE_IMAGE_GALLERY",payload:f})})]})};function Aj(A){return RA({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"},child:[]}]})(A)}function ej(A){return RA({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"},child:[]}]})(A)}function tj(A){return RA({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M331.5 235.7c2.2 .9 4.2 1.9 6.3 2.8c29.2 14.1 50.6 35.2 61.8 61.4c15.7 36.5 17.2 95.8-30.3 143.2c-36.2 36.2-80.3 52.5-142.6 53h-.3c-70.2-.5-124.1-24.1-160.4-70.2c-32.3-41-48.9-98.1-49.5-169.6V256v-.2C17 184.3 33.6 127.2 65.9 86.2C102.2 40.1 156.2 16.5 226.4 16h.3c70.3 .5 124.9 24 162.3 69.9c18.4 22.7 32 50 40.6 81.7l-40.4 10.8c-7.1-25.8-17.8-47.8-32.2-65.4c-29.2-35.8-73-54.2-130.5-54.6c-57 .5-100.1 18.8-128.2 54.4C72.1 146.1 58.5 194.3 58 256c.5 61.7 14.1 109.9 40.3 143.3c28 35.6 71.2 53.9 128.2 54.4c51.4-.4 85.4-12.6 113.7-40.9c32.3-32.2 31.7-71.8 21.4-95.9c-6.1-14.2-17.1-26-31.9-34.9c-3.7 26.9-11.8 48.3-24.7 64.8c-17.1 21.8-41.4 33.6-72.7 35.3c-23.6 1.3-46.3-4.4-63.9-16c-20.8-13.8-33-34.8-34.3-59.3c-2.5-48.3 35.7-83 95.2-86.4c21.1-1.2 40.9-.3 59.2 2.8c-2.4-14.8-7.3-26.6-14.6-35.2c-10-11.7-25.6-17.7-46.2-17.8H227c-16.6 0-39 4.6-53.3 26.3l-34.4-23.6c19.2-29.1 50.3-45.1 87.8-45.1h.8c62.6 .4 99.9 39.5 103.7 107.7l-.2 .2zm-156 68.8c1.3 25.1 28.4 36.8 54.6 35.3c25.6-1.4 54.6-11.4 59.5-73.2c-13.2-2.9-27.8-4.4-43.4-4.4c-4.8 0-9.6 .1-14.4 .4c-42.9 2.4-57.2 23.2-56.2 41.8l-.1 .1z"},child:[]}]})(A)}function Mu(A){return RA({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(A)}function nj(A){return RA({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(A)}function th(A){return RA({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"},child:[]}]})(A)}function FnA(A){return RA({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z"},child:[]}]})(A)}function rj(A){return RA({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376l0 103.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"},child:[]}]})(A)}const WnA=()=>{const{state:{value:A},dispatch:e,optionsQuery:{data:t,isLoading:n,fetchNextPage:r,hasNextPage:s,isFetchingNextPage:a},selectProps:o}=On(),l=y.useMemo(()=>{const h=(t==null?void 0:t.pages.flatMap(w=>w==null?void 0:w.data))??[];if(Array.isArray(A)){const w=A.filter(x=>typeof x=="object"&&"label"in x&&"value"in x);return[...w.filter(x=>x==null?void 0:x.value),...h.filter(x=>!w.some(b=>b.value==x.value))]}else return typeof A=="object"&&A&&"label"in A&&"value"in A&&(A!=null&&A.value)?[A,...h.filter(w=>w.value!==A.value)]:h},[t,A]),[c,u]=P.useState(!1),{ref:f,inView:d}=mv(),g=y.useCallback(h=>{e({type:"SET_OPTIONS_SEARCH_VALUE",payload:h})},[e]),v=y.useCallback(h=>{if(o!=null&&o.multiple){let w=[];A&&Array.isArray(A)&&A.every(b=>typeof b=="object"&&"label"in b&&"value"in b)&&(w=A);const x=w.find(b=>b.value===h.value)?w.filter(b=>b.value!==h.value):[...w,h];e({type:"SET_VALUE",payload:x})}else e({type:"SET_VALUE",payload:h}),u(!1)},[o==null?void 0:o.multiple,A,e]),m=(o==null?void 0:o.placeholder)||"Select...",p=y.useMemo(()=>{var w;const h={label:m,options:""};if(!A)return h;if(o!=null&&o.multiple){if(!Array.isArray(A))return h;const x=A.filter(B=>typeof B=="object"&&"label"in B&&"value"in B);if(!x.length)return h;const b=o.maximumLabelItems||x.length,D=x.slice(0,b).map(B=>B.label||B.value).join(", ");return{label:x.length>b?`${D} +${x.length-b}`:D,options:x.map(B=>B.label||B.value).join(", ")}}if(typeof A=="object"&&A&&"label"in A&&"value"in A){const x=A.label||A.value||m;return{label:x,options:x}}if(typeof A=="object"&&A&&"value"in A){const x=((w=l.find(b=>b.value===A.value))==null?void 0:w.label)||A.value||m;return{label:x,options:x}}return h},[o==null?void 0:o.multiple,o==null?void 0:o.maximumLabelItems,A,m,l]);return P.useEffect(()=>{d&&s&&!a&&r()},[d,s,a,r]),i.jsxs(ua,{open:c,onOpenChange:u,modal:!1,children:[i.jsx(fa,{asChild:!0,children:i.jsxs(pA,{variant:"ghost",role:"combobox","aria-expanded":c,className:"w-full justify-between h-10 bg-background !p-2 rounded-none hover:bg-background",children:[i.jsx("span",{className:E("w-full text-left overflow-x-auto no-scrollbar capitalize",{"opacity-50":p.label==m}),children:p.label}),i.jsx(yS,{className:"opacity-50"})]})}),i.jsx(vs,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:i.jsxs(nu,{children:[i.jsx(P0,{placeholder:(o==null?void 0:o.searchPlaceholder)||"Search options...",className:"h-10",onValueChange:o!=null&&o.queryConfig?g:void 0}),i.jsxs(Dg,{children:[i.jsx(Bg,{className:"flex items-center justify-center p-3 ",children:n?i.jsx(wi,{className:"h-6 w-6 animate-spin"}):"No Options found."}),i.jsx(Mg,{children:l.map(h=>{var w,x;return i.jsxs(Cg,{value:h.label,onSelect:()=>v(h),className:"capitalize",children:[h.label,i.jsx(nj,{className:E("ml-auto",(x=(w=p==null?void 0:p.options)==null?void 0:w.toString())!=null&&x.split(",").includes(h.label)||p.options.toString().includes(h.value)?"opacity-100":"opacity-0")})]},h.value)})}),s&&i.jsx("div",{ref:f,className:"w-full flex justify-center",children:a?i.jsx(wi,{className:"h-6 w-6 animate-spin"}):i.jsx(pA,{variant:"ghost",onClick:()=>r(),children:"Load more"})})]})]})})]})},sj=y.createContext(void 0),po=()=>{const A=y.useContext(sj);if(A===void 0)throw new Error("useWysiwyg must be used within a WysiwygProvider");return A},KnA=({icon:A,title:e,description:t,handleClick:n,className:r})=>i.jsxs(pA,{onClick:n,variant:"ghost",className:E("w-full h-fit flex items-center justify-start gap-4 p-3 rounded-none m-0 hover:bg-accent",r),children:[A,i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsx("span",{className:"p-0",children:e}),i.jsx("span",{className:"text-sm text-muted-foreground",children:t})]})]}),UnA=()=>{const{handleInitiateEmbed:A}=po(),e=n=>{A==null||A(n)},t=[{icon:i.jsx(KS,{className:"w-[40px] text-[#FBBC9A]"}),title:"Picture",description:"jpeg, png",type:"image"},{icon:i.jsx(qV,{size:"10",className:"text-[#FBBC9A]"}),title:"Video",description:"JW player, Youtube, Vimeo",type:"video"},{icon:i.jsx(qh,{size:"10",className:"text-[#FBBC9A]"}),title:"Social",description:"Instagram, Twitter, Tiktok, Snapchat, Facebook",type:"link"}];return i.jsxs(ua,{children:[i.jsx(fa,{asChild:!0,children:i.jsx(pA,{variant:"ghost",size:"icon",className:"p-1 h-6 w-6 rounded-full bg-gray-200 hover:bg-muted text-muted-foreground",children:i.jsx(Dn,{})})}),i.jsxs(vs,{className:"w-fit p-0 bg-background",align:"start",sideOffset:5,children:[i.jsx("div",{className:"p-4 border-b leading-[18px]",children:i.jsx("span",{className:"text-md",children:"Embeds"})}),i.jsx("div",{children:t.map(n=>i.jsx(KnA,{icon:n.icon,title:n.title,description:n.description,handleClick:()=>e(n.type),className:""},n.type))})]})]})};function _nA(A){return RA({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5.82843 6.99955L8.36396 9.53509L6.94975 10.9493L2 5.99955L6.94975 1.0498L8.36396 2.46402L5.82843 4.99955H13C17.4183 4.99955 21 8.58127 21 12.9996C21 17.4178 17.4183 20.9996 13 20.9996H4V18.9996H13C16.3137 18.9996 19 16.3133 19 12.9996C19 9.68584 16.3137 6.99955 13 6.99955H5.82843Z"},child:[]}]})(A)}function $nA(A){return RA({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16 7H11C7.68629 7 5 9.68629 5 13C5 16.3137 7.68629 19 11 19H20V21H11C6.58172 21 3 17.4183 3 13C3 8.58172 6.58172 5 11 5H16V1L22 6L16 11V7Z"},child:[]}]})(A)}function ArA(A){return RA({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M19 21H5C4.44772 21 4 20.5523 4 20V11L1 11L11.3273 1.6115C11.7087 1.26475 12.2913 1.26475 12.6727 1.6115L23 11L20 11V20C20 20.5523 19.5523 21 19 21ZM6 19H18V9.15745L12 3.7029L6 9.15745V19ZM8 15H16V17H8V15Z"},child:[]}]})(A)}function erA(A){return RA({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"},child:[]}]})(A)}const vP=()=>{const{quillObj:A,state:e}=po(),t=()=>{A&&A.history&&A.history.undo()},n=()=>{A&&A.history&&A.history.redo()};return i.jsxs("div",{className:"bg-muted order-2 w-full p-2 h-fit flex items-center justify-center gap-4 border-b",children:[i.jsx(UnA,{}),i.jsxs("div",{id:e.toolbarId,className:"!bg-transparent w-full !border-0 !p-0 h-fit flex flex-row gap-2 flex-wrap ql-toolbar",children:[i.jsx("span",{className:E("ql-formats","!rounded-sm !w-[120px] flex justify-between"),children:i.jsxs("select",{className:"ql-header !text-base !font-bold !w-full !m-0","data-tooltip":"Text Format",children:[i.jsx("option",{value:"",children:"Normal Text"}),i.jsx("option",{value:"1",className:"",children:"Heading 1"}),i.jsx("option",{value:"2",className:"",children:"Heading 2"}),i.jsx("option",{value:"3",className:"!",children:"Heading 3"}),i.jsx("option",{value:"4",className:"!",children:"Heading 4"}),i.jsx("option",{value:"5",className:"!",children:"Heading 5"}),i.jsx("option",{value:"6",className:"!",children:"Heading 6"})]})}),i.jsxs("span",{className:"ql-formats",children:[i.jsx("button",{className:"ql-bold","data-tooltip":"Bold (Ctrl+B)"}),i.jsx("button",{className:"ql-italic","data-tooltip":"Italic (Ctrl+I)"}),i.jsx("button",{className:"ql-underline","data-tooltip":"Underline (Ctrl+U)"}),i.jsx("button",{className:"ql-strike","data-tooltip":"Strike through"})]}),i.jsxs("span",{className:"ql-formats",children:[i.jsx("select",{className:"ql-align","data-tooltip":"Text Alignment"}),i.jsx("select",{className:"ql-color","data-tooltip":"Text Color"}),i.jsx("select",{className:"ql-background","data-tooltip":"Background Color"})]}),i.jsxs("span",{className:"ql-formats",children:[i.jsx("button",{className:"ql-blockquote","data-tooltip":"Blockquote"}),i.jsx("button",{className:"ql-code-block","data-tooltip":"Code Block"})]}),i.jsxs("span",{className:"ql-formats",children:[i.jsx("button",{className:"ql-list",value:"ordered","data-tooltip":"Numbered List"}),i.jsx("button",{className:"ql-list",value:"bullet","data-tooltip":"Bullet List"}),i.jsx("button",{className:"ql-indent",value:"-1","data-tooltip":"Decrease Indent"}),i.jsx("button",{className:"ql-indent",value:"+1","data-tooltip":"Increase Indent"})]}),i.jsx("span",{className:"ql-formats",children:i.jsx("button",{className:"ql-link","data-tooltip":"Insert Link (Ctrl+K)"})}),i.jsxs("span",{className:"ql-formats",children:[i.jsx("button",{onClick:t,"data-tooltip":"Undo (Ctrl+Z)",children:i.jsx(_nA,{className:"text-xl"})}),i.jsx("button",{className:"ql-redo",onClick:n,"data-tooltip":"Redo (Ctrl+Y)",children:i.jsx($nA,{className:"text-xl"})})]})]})]})};function trA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 3H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM9 9H5V5h4v4zm11 4h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1zm-1 6h-4v-4h4v4zM17 3c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2zM7 13c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2z"},child:[]}]})(A)}function nrA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 2H10c-1.103 0-2 .897-2 2v4H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h10c1.103 0 2-.897 2-2v-4h4c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM4 20V10h10l.002 10H4zm16-6h-4v-4c0-1.103-.897-2-2-2h-4V4h10v10z"},child:[]}]})(A)}function rrA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 15c0-4.625-3.507-8.441-8-8.941V4h-2v2.059c-4.493.5-8 4.316-8 8.941v2h18v-2zM5 15c0-3.859 3.141-7 7-7s7 3.141 7 7H5zm-3 3h20v2H2z"},child:[]}]})(A)}function srA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(A)}const arA=({selectedText:A})=>{const{dispatch:e,handleContentChange:t,handleInitiateEmbed:n,quillObj:r}=po(),s=[{label:"Cut",action:"cut",disabled:!A,shortcut:"Ctrl+X"},{label:"Copy",action:"copy",disabled:!A,shortcut:"Ctrl+C"},{label:"Paste",action:"paste",disabled:!1,shortcut:"Ctrl+V"},{type:"separator"},{label:"Add Link",action:"link",disabled:!A,shortcut:"Ctrl+K"},{label:"Remove Link",action:"removeLink",disabled:!A,shortcut:""},{type:"separator"},{label:"Insert Image",action:"insertImage",disabled:!1,shortcut:""},{label:"Insert Video",action:"insertVideo",disabled:!1,shortcut:""},{label:"Insert Social Link",action:"insertSocial",disabled:!1,shortcut:""}],a=y.useCallback(()=>{var c;(c=r==null?void 0:r.root)!=null&&c.innerHTML&&t(r.root.innerHTML)},[r,t]),o=()=>{const c=document.querySelector('[data-state="open"]');c&&c.setAttribute("data-state","closed"),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0}))},l=y.useCallback(async c=>{if(!r)return;const u=r.getSelection();try{switch(c){case"cut":if(u&&u.length>0){const f=r.getText(u.index,u.length);await navigator.clipboard.writeText(f),r.deleteText(u.index,u.length),a()}break;case"copy":if(u&&u.length>0){const f=r.getText(u.index,u.length);await navigator.clipboard.writeText(f)}break;case"paste":try{const f=await navigator.clipboard.readText();u&&(r.insertText(u.index,f),a())}catch(f){console.warn("Failed to read clipboard:",f)}break;case"link":if(o(),u&&u.length>0){setTimeout(()=>{r.formatText(u.index,u.length,"link","https://","api"),a()},100);return}break;case"removeLink":u&&u.length>0&&(r.formatText(u.index,u.length,"link",!1),a());break;case"insertImage":o(),n("image");break;case"insertVideo":o(),n("video");break;case"insertSocial":o(),n("link");break}}catch(f){console.error("Context menu action failed:",f)}},[r,a,n]);return i.jsxs(L8,{className:"w-50",children:[s.map((c,u)=>c.type==="separator"?i.jsx(q8,{},u):i.jsxs(Vp,{inset:!0,disabled:c.disabled,className:E("w-full text-left text-sm hover:bg-accent flex items-center justify-between !px-2 !py-2"),onClick:()=>!c.disabled&&l(c.action),children:[i.jsx("span",{children:c.label}),c.shortcut&&i.jsx(J8,{className:"text-xs text-gray-400 ml-4",children:c.shortcut})]},u)),i.jsxs(Vp,{inset:!0,disabled:!A,className:E("w-full text-left text-sm hover:bg-accent flex items-center justify-start !px-2 !py-2 "),onClick:()=>{o(),e({type:"TOGGLE_EMBED_POST",payload:!0})},children:[i.jsx(srA,{className:"text-md text-current"}),i.jsx("span",{children:"Insert Article"})]})]})},mP=()=>{const[A,e]=y.useState(""),{dispatch:t,state:{content:n,embedType:r,embedValue:s,quillRef:a},handleContentChange:o,blogPostsConfig:l,quillObj:c,imageGalleryConfig:u}=po(),f=r&&s?{type:r,value:s}:void 0,d=((u==null?void 0:u.apolloUri)||"").replaceAll("/graphql",""),g=y.useCallback(m=>{var p,h,w,x;if(!c){console.warn("Quill editor not available for embed");return}try{const b=c.getSelection(!0)||{index:c.getLength(),length:0},z=document.getElementById("editorParent"),D=(z==null?void 0:z.scrollTop)||0,{type:M,value:B}=m;switch(M){case"link":{const[k,Y]=B.split("||>>");k&&Y&&(c.insertText(b.index,k,"user"),c.setSelection(b.index,k.length),c.formatText(b.index,k.length,"link",Y));break}case"post":{const k=s;if(l!=null&&l.postBaseURL&&(k!=null&&k.slug)){const Y=c.getSelection();Y&&Y.length>0&&c.formatText(Y.index,Y.length,"link",l.postBaseURL+k.slug)}break}case"image":{const k=B,{desktop:Y,tablet:T,mobile:S,url:X}=Cc({url:k.url,transformationsUrl:d}),q=(h=(p=k==null?void 0:k.src)==null?void 0:p.includes)!=null&&h.call(p,"unsplash")?"Unsplash":"Pexels",J=`${k!=null&&k.photographer?`Photo by
|
|
515
515
|
<a href=${(w=k==null?void 0:k.photographer)==null?void 0:w.url} style="color: inherit;">${(x=k==null?void 0:k.photographer)==null?void 0:x.name}</a> on
|
|
516
516
|
<a href=${k==null?void 0:k.src} style="color: inherit;">${q}</a>`:(k==null?void 0:k.caption)??""}`,O={sources:[{srcset:cf(S),media:"(max-width: 640px)",type:"image/webp"},{srcset:cf(Y),media:"(min-width: 1025px)",type:"image/webp"},{srcset:cf(T),media:"(max-width: 1024px)",type:"image/webp"}],fallbackSrc:cf(X),alt:(k==null?void 0:k.caption)||(k==null?void 0:k.alternate_text)||"",caption:J};c.insertEmbed(b.index,"picture",O,"user"),setTimeout(()=>{const Z=c.getLength(),C=b.index+1;C>=Z-1&&(c.insertText(C,`
|
|
517
|
-
`,"user"),c.setSelection(C+1,0))},100);break}case"htmlembed":c.clipboard.dangerouslyPasteHTML(b.index,B,"user");break;default:c.insertEmbed(b.index,M,B);break}z&&(z.scrollTop=D);const H=c.root.innerHTML;o(H),t({type:"RESET_EMBED"})}catch(b){console.error("Failed to handle embed:",b),t({type:"RESET_EMBED"})}},[c,t,o,l,s]);y.useEffect(()=>{f&&g(f)},[f,g]),y.useEffect(()=>{var p;if(!c)return;const m=h=>{const w=h&&h.length>0?c.getText(h.index,h.length):"";e(w.trim())};return(p=c==null?void 0:c.on)==null||p.call(c,"selection-change",m),()=>{var h;(h=c==null?void 0:c.off)==null||h.call(c,"selection-change",m)}},[c]);const v=y.useCallback(()=>{if(!n||n.trim().length===0)return 0;const m=n.replace(/<[^>]*>/g,"").trim();return m.length===0?0:m.split(/\s+/).filter(p=>p.length>0).length},[n]);return i.jsx(I8,{children:i.jsxs("div",{className:"flex order-3 h-full flex-col w-full relative bg-background",children:[i.jsx(Q8,{className:"w-full h-10 grow flex flex-col items-center justify-center overflow-auto",children:i.jsx("div",{id:"editorParent",className:"flex w-full h-10 flex-1 items-center justify-center overflow-auto pb-10",children:i.jsx("div",{ref:a,id:"editor",className:"quill-editor text-md flex-1"})})}),i.jsx(arA,{selectedText:A}),i.jsxs("div",{className:"flex justify-end text-sm text-muted-foreground border p-2 absolute bottom-0 right-0 w-full bg-muted",children:[v()," word count"]})]})})},yv=A=>new Promise(e=>{const t=setTimeout(()=>yv(A),10);typeof A<"u"&&(clearTimeout(t),e(null))}),Go=({src:A=null,innerHTML:e=null,tag:t="head",async:n=!1,id:r=null})=>new Promise((s,a)=>{const o=document.createElement("script");A&&(o.src=A),e&&(o.innerHTML=e),r&&(o.id=r),n&&(o.async=!0),o.defer=!0,o.onload=()=>{s()},o.onerror=a;const l=document.getElementsByTagName(t)[0];l?l.appendChild(o):a(new Error(`Target element "${t}" not found`))}),orA=(A="")=>{const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n=e.querySelector("span"),r=(n==null?void 0:n.style.width.replace("px",""))??"560",s=(n==null?void 0:n.style.height.replace("px",""))??"600";t.setAttribute("width",r),t.setAttribute("height",s);const a=t.getAttribute("src"),o=new URL(a);return o.searchParams.append("width",r),o.searchParams.append("height",s),t.setAttribute("src",o.toString()),t.outerHTML},irA=(A="")=>{const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n="560",r="720",s=t.getAttribute("src"),a=new URL(s);return a.searchParams.append("width",n),a.searchParams.append("height",r),t.setAttribute("src",a.toString()),t.setAttribute("width",n),t.setAttribute("height",r),t.outerHTML},lrA=(A="")=>{var o,l;const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n=((o=t==null?void 0:t.getAttribute("height"))==null?void 0:o.replace("px",""))??"",r=((l=t==null?void 0:t.getAttribute("width"))==null?void 0:l.replace("px",""))??"",s=(t==null?void 0:t.getAttribute("src"))||"",a=new URL(s);return a.searchParams.append("height",n),a.searchParams.append("width",r),t==null||t.setAttribute("src",a.toString()),t.outerHTML},crA=async()=>{await Go({src:"https://www.instagram.com/embed.js"}),await Go({src:"https://platform.twitter.com/widgets.js"}),await Go({src:"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v14.0",tag:"body"}),await Go({src:"//embed.redditmedia.com/widgets/platform.js"})},urA=A=>A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/)||A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/)||A.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/),frA=A=>A.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/),Io=A=>{var n;const e=urA(A);if(e&&((n=e[2])==null?void 0:n.length)===11)return{embed:!0,url:"https://www.youtube.com/embed/"+e[2]+"?showinfo=0"};const t=frA(A);return t?{embed:!0,url:(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/"}:{url:A,embed:!1}},pP=(A,e,t)=>{if(A&&"reportValidity"in A){const n=xA(t,e);A.setCustomValidity(n&&n.message||""),A.reportValidity()}},nh=(A,e)=>{for(const t in e.fields){const n=e.fields[t];n&&n.ref&&"reportValidity"in n.ref?pP(n.ref,t,A):n&&n.refs&&n.refs.forEach(r=>pP(r,t,A))}},hP=(A,e)=>{e.shouldUseNativeValidation&&nh(A,e);const t={};for(const n in A){const r=xA(e.fields,n),s=Object.assign(A[n]||{},{ref:r&&r.ref});if(drA(e.names||Object.keys(A),n)){const a=Object.assign({},xA(t,n));Be(a,"root",s),Be(t,n,a)}else Be(t,n,s)}return t},drA=(A,e)=>{const t=wP(e);return A.some(n=>wP(n).match(`^${t}\\.\\d+`))};function wP(A){return A.replace(/\]|\[/g,"")}function aj(A,e,t){function n(o,l){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(A),e(o,l);for(const u in a.prototype)u in o||Object.defineProperty(o,u,{value:a.prototype[u].bind(o)});o._zod.constr=a,o._zod.def=l}const r=(t==null?void 0:t.Parent)??Object;class s extends r{}Object.defineProperty(s,"name",{value:A});function a(o){var l;const c=t!=null&&t.Parent?new s:this;n(c,o),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var l,c;return t!=null&&t.Parent&&o instanceof t.Parent?!0:(c=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:c.has(A)}}),Object.defineProperty(a,"name",{value:A}),a}class grA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const vrA={};function oj(A){return vrA}function mrA(A,e){return typeof e=="bigint"?e.toString():e}const ij=Error.captureStackTrace?Error.captureStackTrace:(...A)=>{};function gf(A){return typeof A=="string"?A:A==null?void 0:A.message}function lj(A,e,t){var r,s,a,o,l,c;const n={...A,path:A.path??[]};if(!A.message){const u=gf((a=(s=(r=A.inst)==null?void 0:r._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,A))??gf((o=e==null?void 0:e.error)==null?void 0:o.call(e,A))??gf((l=t.customError)==null?void 0:l.call(t,A))??gf((c=t.localeError)==null?void 0:c.call(t,A))??"Invalid input";n.message=u}return delete n.inst,delete n.continue,e!=null&&e.reportInput||delete n.input,n}const cj=(A,e)=>{A.name="$ZodError",Object.defineProperty(A,"_zod",{value:A._zod,enumerable:!1}),Object.defineProperty(A,"issues",{value:e,enumerable:!1}),Object.defineProperty(A,"message",{get(){return JSON.stringify(e,mrA,2)},enumerable:!0}),Object.defineProperty(A,"toString",{value:()=>A.message,enumerable:!1})},prA=aj("$ZodError",cj),uj=aj("$ZodError",cj,{Parent:Error}),hrA=A=>(e,t,n,r)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},s);if(a instanceof Promise)throw new grA;if(a.issues.length){const o=new((r==null?void 0:r.Err)??A)(a.issues.map(l=>lj(l,s,oj())));throw ij(o,r==null?void 0:r.callee),o}return a.value},wrA=hrA(uj),yrA=A=>async(e,t,n,r)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=e._zod.run({value:t,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((r==null?void 0:r.Err)??A)(a.issues.map(l=>lj(l,s,oj())));throw ij(o,r==null?void 0:r.callee),o}return a.value},PrA=yrA(uj);function yP(A,e){try{var t=A()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}function xrA(A,e){for(var t={};A.length;){var n=A[0],r=n.code,s=n.message,a=n.path.join(".");if(!t[a])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];t[a]={message:o.message,type:o.code}}else t[a]={message:s,type:r};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return A.push(f)})}),e){var l=t[a].types,c=l&&l[n.code];t[a]=C0(a,e,t,r,c?[].concat(c,n.message):n.message)}A.shift()}return t}function brA(A,e){for(var t={};A.length;){var n=A[0],r=n.code,s=n.message,a=n.path.join(".");if(!t[a])if(n.code==="invalid_union"&&n.errors.length>0){var o=n.errors[0][0];t[a]={message:o.message,type:o.code}}else t[a]={message:s,type:r};if(n.code==="invalid_union"&&n.errors.forEach(function(u){return u.forEach(function(f){return A.push(f)})}),e){var l=t[a].types,c=l&&l[n.code];t[a]=C0(a,e,t,r,c?[].concat(c,n.message):n.message)}A.shift()}return t}function Pv(A,e,t){if(t===void 0&&(t={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(A))return function(n,r,s){try{return Promise.resolve(yP(function(){return Promise.resolve(A[t.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(a){return s.shouldUseNativeValidation&&nh({},s),{errors:{},values:t.raw?Object.assign({},n):a}})},function(a){if((function(o){return Array.isArray(o==null?void 0:o.issues)})(a))return{values:{},errors:hP(xrA(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(A))return function(n,r,s){try{return Promise.resolve(yP(function(){return Promise.resolve((t.mode==="sync"?wrA:PrA)(A,n,e)).then(function(a){return s.shouldUseNativeValidation&&nh({},s),{errors:{},values:t.raw?Object.assign({},n):a}})},function(a){if((function(o){return o instanceof prA})(a))return{values:{},errors:hP(brA(a.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const zrA=["background","color","size","font"],DrA=(A,e)=>(e.ops=e.ops.map(t=>{const n=t.attributes;if(!n)return t;const r={...n};return zrA.forEach(s=>delete r[s]),Object.keys(r).length>0?{...t,attributes:r}:{insert:t.insert}}),e),BrA={history:{delay:500,maxStack:100,userOnly:!0},clipboard:{matchers:[["*",DrA]]}},MrA=["header","size","bold","italic","underline","align","list","indent","link","strike","image","video","color","blockquote","background","code-block","picture"],fj=He({url:vA().url("Invalid URL, enter valid URL")}),CrA=A=>{if(typeof window>"u"||!A)return A;const e=document.createElement("div");return e.innerHTML=A,e.querySelectorAll(".ql-picture-caption").forEach(t=>{const n=t;n.removeAttribute("contenteditable"),n.removeAttribute("data-editing"),n.removeAttribute("data-original-caption"),n.style.border="1px solid transparent",n.innerHTML.trim()==="Click to edit caption..."&&(n.innerHTML="")}),e.innerHTML},jrA=()=>{const{state:{showEmbedVideo:A},dispatch:e,handleAddEmbed:t}=po(),[n,r]=y.useState(Io("")),s=()=>{e({type:"TOGGLE_EMBED_VIDEO",payload:!1})},a=()=>{t("video",n.url),r(Io("")),s()},o=Tg({resolver:Pv(fj),defaultValues:{url:""},reValidateMode:"onChange",mode:"onChange"}),l=async()=>{if(!c)throw new Error("Validation failed");a(),o.reset()},c=o.formState.isValid;return y.useEffect(()=>{const u=o.watch(async(f,{name:d,values:g})=>{d=="url"&&r(Io(g.url??""))});return()=>u.unsubscribe()},[o]),i.jsx(Mt,{open:A,onOpenChange:s,children:i.jsxs(wt,{className:"p-0 overflow-hidden rounded-xl border-0",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{children:i.jsx("h1",{className:"text-md",children:"Embed Video"})})}),i.jsxs("div",{className:"px-4 space-y-4 flex items-center justify-center flex-wrap",children:[c&&i.jsx("div",{className:"w-full [&_video]:max-h-50 [&_video]:lg:max-h-80",children:i.jsx(tt,{label:"Video Preview",type:"video",value:n.url,linkProps:{className:"min-h-70 ![&_video]:lg:max-h-50"},onChange:u=>r(Io(u))})}),i.jsx(uo,{control:o.control,name:"url",render:({field:u,fieldState:f})=>i.jsx(tt,{label:"Video Url",onChange:u.onChange,error:f.error,inputProps:{name:u.name,value:u.value,className:"underline",placeholder:"Video URL"}})},"url")]}),i.jsx(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:i.jsx(ge,{className:"rounded",variant:"primary",onClick:l,disabled:!c,children:"Embed"})})]})})};function OrA(A){return RA({attr:{version:"1.1",viewBox:"0 0 20 16"},child:[{tag:"path",attr:{d:"M13 11.5l1.5 1.5 5-5-5-5-1.5 1.5 3.5 3.5z"},child:[]},{tag:"path",attr:{d:"M7 4.5l-1.5-1.5-5 5 5 5 1.5-1.5-3.5-3.5z"},child:[]},{tag:"path",attr:{d:"M10.958 2.352l1.085 0.296-3 11-1.085-0.296 3-11z"},child:[]}]})(A)}const TrA={title:"",content:"",showEmbedVideo:!1,showEmbedLink:!1,showEmbedImage:!1,showEmbedPost:!1,embedType:null,embedValue:"",error:!1,isLoading:!1,toolbarId:"",editorContainerId:""},ErA=(A,e)=>{switch(e.type){case"SET_TITLE":return{...A,title:e.payload};case"SET_CONTENT":return{...A,content:e.payload};case"TOGGLE_EMBED_VIDEO":return{...A,showEmbedVideo:e.payload};case"TOGGLE_EMBED_LINK":return{...A,showEmbedLink:e.payload};case"TOGGLE_EMBED_IMAGE":return{...A,showEmbedImage:e.payload};case"TOGGLE_EMBED_POST":return{...A,showEmbedPost:e.payload};case"SET_EMBED":return{...A,embedType:e.payload.type,embedValue:e.payload.value};case"INITIATE_EMBED":return{...A,embedType:e.payload,showEmbedVideo:e.payload==="video",showEmbedLink:e.payload==="link",showEmbedImage:e.payload==="image"};case"RESET_EMBED":return{...A,embedType:"",embedValue:"",showEmbedVideo:!1,showEmbedLink:!1,showEmbedImage:!1};case"SET_ERROR":return{...A,error:e.payload};case"SET_LOADING":return{...A,isLoading:e.payload};default:return A}};function NrA({url:A}){const e=lv(A||"",300),t=y.useCallback(async()=>{if(ve.NEXT_PUBLIC_TWITTER_EMBED_ENDPOINT)return(await Qe.post(ve.NEXT_PUBLIC_TWITTER_EMBED_ENDPOINT||"",{url:e})).data;throw console.error("Invalid Twitter Embed Configuration"),Error("Invalid Twitter Embed Configuration")},[e]);return Pu({queryKey:[e],queryFn:t,staleTime:300*1e3,gcTime:600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!1})}const HrA=({value:A,label:e,removeCaption:t})=>{const n={text:s=>i.jsx("iframe",{className:"",allowFullScreen:!0,src:Io(s).url}),tiktok:s=>i.jsx(krA,{url:s,className:"custom__embed tiktok__embed"}),twitter:s=>i.jsx(ZrA,{url:s}),instagram:(s,a)=>i.jsx(VrA,{value:s,removeCaption:a}),facebook:(s,a)=>i.jsx(SrA,{value:s,removeCaption:a}),reddit:()=>i.jsx(XrA,{url:A})};y.useEffect(()=>{crA()},[]);const r=n[e];if(!["text","facebook","tiktok","instagram","twitter","reddit"].includes(e)||!A)return i.jsx("div",{className:"w-fit max-h-[20vh] overflow-auto flex items-center justify-center border border-[#ccc]",children:i.jsx(OrA,{size:30})});if(r)return i.jsx(i.Fragment,{children:r(A,t)})},krA=({url:A="",className:e=""})=>{const[t,n]=y.useState(null);return y.useEffect(()=>{const r=async a=>{try{const o=await fetch(`https://www.tiktok.com/oembed?url=${encodeURIComponent(a)}`),{html:l=""}=await o.json();return l}catch(o){return console.error({summary:`TikTok Embed Fetch Failed For: ${a}`,message:o==null?void 0:o.message}),null}};(async()=>{if(!A)return;const a=await r(A);n(a)})().then(()=>{Go({src:"https://www.tiktok.com/embed.js"})})},[A]),i.jsx("div",{className:e,dangerouslySetInnerHTML:{__html:t??""}})},ZrA=({url:A=""})=>{var s;const[e,t]=y.useState(null),n=y.useRef(null),r=NrA({url:A});return y.useEffect(()=>{const a=r.data;if(r.isError||!(a!=null&&a.embedHtml)||!n.current)return;t(a.embedHtml||null),(async()=>{await new Promise(l=>setTimeout(l,100)),window.twttr&&window.twttr.widgets&&n.current&&window.twttr.widgets.load(n.current)})()},[r.data,r.isError]),y.useEffect(()=>{if(!window.twttr){const a=document.createElement("script");a.src="https://platform.twitter.com/widgets.js",a.async=!0,document.body.appendChild(a)}},[]),i.jsxs("div",{className:"relative w-full max-w-[550px] min-h-20",children:[r.isLoading&&i.jsx("div",{className:"absolute h-full w-full inset-0 bg-secondary/20 animate-pulse rounded"}),r.isFetched&&i.jsx("div",{className:"w-full",ref:n,dangerouslySetInnerHTML:{__html:e}}),r.isError&&i.jsx("div",{className:"p-4 border border-red-200 bg-red-50 rounded text-red-600",children:(s=r.error)==null?void 0:s.message})]})},SrA=({value:A,removeCaption:e})=>(y.useEffect(()=>{(async()=>{var n,r,s;await yv(window.FB),(s=(r=(n=window.FB)==null?void 0:n.XFBML)==null?void 0:r.parse)==null||s.call(r)})()},[A,e]),i.jsx("div",{className:"fb-post custom__embed","data-href":A,"data-show-text":`${!e}`,children:i.jsx("blockquote",{cite:A,className:"fb-xfbml-parse-ignore"})})),VrA=({value:A,removeCaption:e})=>(y.useEffect(()=>{(async()=>{var n,r,s;await yv(window.instgrm),(s=(r=(n=window.instgrm)==null?void 0:n.Embeds)==null?void 0:r.process)==null||s.call(r)})()},[A,e]),i.jsx("div",{dangerouslySetInnerHTML:{__html:`<blockquote class="instagram-media" ${e?"":"data-instgrm-captioned"} data-instgrm-permalink="${A}?utm_source=ig_embed&utm_campaign=loading" data-instgrm-version="13" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="${A}?utm_source=ig_embed&utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;"> View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="${A}?utm_source=ig_embed&utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by </a></p></div></blockquote>`}})),XrA=({url:A=""})=>{const e=y.useRef(null);return y.useEffect(()=>{(async()=>{!A||!e.current||(window.rembeddit||(await Go({src:"//embed.redditmedia.com/widgets/platform.js"}),await yv(window.rembeddit)),setTimeout(()=>{if(window.rembeddit&&e.current)try{window.rembeddit.createEmbeds()}catch(n){console.warn("Reddit embed processing failed:",n)}},500))})()},[A]),i.jsx("div",{className:"w-full max-w-[600px] p-2 relative",children:i.jsx("div",{className:"custom__embed p-4",ref:e,children:i.jsx("blockquote",{className:"reddit-embed-bq","data-card-created":Date.now(),children:i.jsx("a",{href:A,children:A})})})})},$m=[{label:"Text",value:"text"},{label:"Instagram",value:"instagram"},{label:"Facebook",value:"facebook"},{label:"X",value:"twitter"},{label:"Reddit",value:"reddit"},{label:"TikTok",value:"tiktok"}],YrA=()=>{var v;const{state:{showEmbedLink:A},dispatch:e,handleAddEmbed:t}=po(),[n,r]=y.useState(((v=$m[0])==null?void 0:v.value)||"text"),[s,a]=y.useState(""),o=y.useRef(null),l=Tg({resolver:Pv(fj),defaultValues:{url:""},reValidateMode:"onChange",mode:"onChange"}),c=l.formState.isValid,u=m=>{t("htmlembed",m),d(),a("")},f=async()=>{var m,p,h,w,x;try{if(!c)throw new Error("Validation failed");switch(n){case"text":u((m=o.current)==null?void 0:m.innerHTML);break;case"tiktok":case"twitter":u(irA((p=o.current)==null?void 0:p.innerHTML));break;case"facebook":u(orA((h=o.current)==null?void 0:h.innerHTML));break;case"instagram":case"reddit":u(lrA((w=o.current)==null?void 0:w.innerHTML));break;default:break}r(((x=$m[0])==null?void 0:x.value)||"text"),a("")}catch(b){console.log(b)}},d=()=>{e({type:"TOGGLE_EMBED_LINK",payload:!1})},g=m=>{const p=m;p!=null&&p.value&&r(p.value)};return y.useEffect(()=>{const m=l.watch((p,{name:h,values:w})=>{h=="url"&&a(w.url??"")});return()=>m.unsubscribe()},[l]),i.jsx(Mt,{open:A,onOpenChange:d,children:i.jsxs(wt,{className:"sm:max-w-[600px] p-0 overflow-hidden rounded border-0",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{children:i.jsx("h1",{className:"text-md",children:"Embed Link"})})}),i.jsx("div",{className:"mx-auto mb-5 w-fit max-h-90 overflow-auto",id:"postembed",ref:o,children:c&&i.jsx(HrA,{label:n,removeCaption:!1,value:s})}),i.jsxs("div",{className:"px-4 space-y-4",children:[i.jsx(tt,{label:"Social Media Platform",type:"select",value:{value:n,label:n},selectProps:{options:$m,dataKey:"social-media-platforms"},onChange:g}),i.jsx(uo,{control:l.control,name:"url",render:({field:m,fieldState:p})=>i.jsx(wr,{className:"flex-1",children:i.jsx(fo,{className:"w-full",children:i.jsx(tt,{label:"URL",inputProps:{name:m.name,value:m.value,className:"underline",placeholder:"URL"},error:p.error,onChange:m.onChange})})})},"url")]}),i.jsxs(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:[i.jsx(ge,{className:"rounded",variant:"primary",onClick:f,disabled:!c,children:"Embed"}),i.jsx(ge,{variant:"outline",className:"rounded",onClick:d,children:"Cancel"})]})]})})},dj=({open:A=!0,onSave:e,handleToggleOpen:t,className:n,selectedPosts:r,columns:s,queryConfig:a,defaultState:o,gridCard:l,postType:c,filterFields:u,postBaseURL:f,apolloUri:d,...g})=>{const v=m=>{e==null||e(m),t==null||t(!1)};return i.jsx(Mt,{open:A,onOpenChange:t,children:i.jsx(wt,{className:E("sm:max-w-[80%] md:max-w-[80%] h-[90%] shadow-lg p-0 overflow-hidden",n),children:i.jsx(hn,{columns:s,selectedPosts:r,queryConfig:a,defaultState:o,gridCard:l,postType:c,postBaseURL:f,filterFields:u,isSelect:!0,rootClassName:"h-full",gridColumnStyle:"repeat(auto-fit, minmax(210px, 1fr))",onSave:v,apolloUri:d,...g})})})},GrA=({className:A})=>{const{state:e,imageGalleryConfig:t,dispatch:n,handleAddEmbed:r,asChild:s,blogPostsConfig:a}=po(),{showEmbedImage:o,showEmbedPost:l}=e,c=d=>{n({type:"TOGGLE_EMBED_IMAGE",payload:d})},u=d=>{r("image",d),c(!1)},f=d=>{d[0]&&r("post",d[0]),n({type:"TOGGLE_EMBED_POST",payload:!1})};return i.jsxs(i.Fragment,{children:[!s&&i.jsxs("div",{className:E("w-full h-full flex-1 flex flex-col no-scrollbar gap-2 border-1",A),"data-testid":"editor",children:[i.jsx(vP,{}),i.jsx(mP,{})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx(vP,{}),i.jsx(mP,{})]}),i.jsx(jrA,{}),i.jsx(YrA,{}),t&&i.jsx(eh,{config:{...t,viewOnly:!0},open:o,onChange:d=>d&&u(d),handleToggleOpen:c}),a&&i.jsx(dj,{...a,open:l,selectedPosts:[],onSave:f,handleToggleOpen:d=>n({type:"TOGGLE_EMBED_POST",payload:d})})]})},IrA=({children:A,onChange:e,imageGalleryConfig:t,content:n,asChild:r,blogPostsConfig:s,twitterEmbedConfig:a})=>{const o=y.useRef(null),[l,c]=y.useState(null),u=y.useRef(""),f=y.useMemo(()=>({toolbarId:`toolbar-${Date.now()}`,editorContainerId:`editorParent-${Date.now()}`}),[]),[d,g]=y.useReducer(ErA,{...TrA,toolbarId:f.toolbarId,editorContainerId:f.editorContainerId,content:n||"",quillRef:o}),v=y.useCallback(w=>{const x=CrA(w);g({type:"SET_CONTENT",payload:x}),u.current=x,e==null||e(x)},[e]),m=w=>{setTimeout(()=>{g({type:"INITIATE_EMBED",payload:w})},100)},p=(w,x)=>{g({type:"SET_EMBED",payload:{type:w,value:x}})};y.useEffect(()=>{let w=null;return(async()=>{if(!(typeof window>"u"))try{const z=(await Promise.resolve().then(()=>require("./quill-yK20wTJ8.cjs"))).default,M=await(await Promise.resolve().then(()=>require("./PictureBlot-CYPdPHUi.cjs"))).default();M&&z.register("formats/picture",M,!0),o.current&&(w=new z(o.current,{theme:"snow",modules:{...BrA,toolbar:{container:`#${f.toolbarId}`}},formats:MrA,placeholder:"Add content"}),n&&n.trim()!==""&&(w==null||w.clipboard.dangerouslyPasteHTML(n,"silent"),u.current=n),w.on("text-change",()=>{if(w){const B=w.root.innerHTML;v(B)}}),w.root.addEventListener("keydown",B=>{var H,k;if(B.key==="Enter"&&w){const Y=w.getSelection();if(Y){const T=w.getLength();if(Y.index>=T-1){const q=w.root.lastElementChild;if(q!=null&&q.classList.contains("ql-picture-container")){B.preventDefault(),w.insertText(T,`
|
|
517
|
+
`,"user"),c.setSelection(C+1,0))},100);break}case"htmlembed":c.clipboard.dangerouslyPasteHTML(b.index,B,"user");break;default:c.insertEmbed(b.index,M,B);break}z&&(z.scrollTop=D);const H=c.root.innerHTML;o(H),t({type:"RESET_EMBED"})}catch(b){console.error("Failed to handle embed:",b),t({type:"RESET_EMBED"})}},[c,t,o,l,s]);y.useEffect(()=>{f&&g(f)},[f,g]),y.useEffect(()=>{var p;if(!c)return;const m=h=>{const w=h&&h.length>0?c.getText(h.index,h.length):"";e(w.trim())};return(p=c==null?void 0:c.on)==null||p.call(c,"selection-change",m),()=>{var h;(h=c==null?void 0:c.off)==null||h.call(c,"selection-change",m)}},[c]);const v=y.useCallback(()=>{if(!n||n.trim().length===0)return 0;const m=n.replace(/<[^>]*>/g,"").trim();return m.length===0?0:m.split(/\s+/).filter(p=>p.length>0).length},[n]);return i.jsx(I8,{children:i.jsxs("div",{className:"flex order-3 h-full flex-col w-full relative bg-background",children:[i.jsx(Q8,{className:"w-full h-10 grow flex flex-col items-center justify-center overflow-auto",children:i.jsx("div",{id:"editorParent",className:"flex w-full h-10 flex-1 items-center justify-center overflow-auto pb-10",children:i.jsx("div",{ref:a,id:"editor",className:"quill-editor text-md flex-1"})})}),i.jsx(arA,{selectedText:A}),i.jsxs("div",{className:"flex justify-end text-sm text-muted-foreground border p-2 absolute bottom-0 right-0 w-full bg-muted",children:[v()," word count"]})]})})},yv=A=>new Promise(e=>{const t=setTimeout(()=>yv(A),10);typeof A<"u"&&(clearTimeout(t),e(null))}),Go=({src:A=null,innerHTML:e=null,tag:t="head",async:n=!1,id:r=null})=>new Promise((s,a)=>{const o=document.createElement("script");A&&(o.src=A),e&&(o.innerHTML=e),r&&(o.id=r),n&&(o.async=!0),o.defer=!0,o.onload=()=>{s()},o.onerror=a;const l=document.getElementsByTagName(t)[0];l?l.appendChild(o):a(new Error(`Target element "${t}" not found`))}),orA=(A="")=>{const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n=e.querySelector("span"),r=(n==null?void 0:n.style.width.replace("px",""))??"560",s=(n==null?void 0:n.style.height.replace("px",""))??"600";t.setAttribute("width",r),t.setAttribute("height",s);const a=t.getAttribute("src"),o=new URL(a);return o.searchParams.append("width",r),o.searchParams.append("height",s),t.setAttribute("src",o.toString()),t.outerHTML},irA=(A="")=>{const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n="560",r="720",s=t.getAttribute("src"),a=new URL(s);return a.searchParams.append("width",n),a.searchParams.append("height",r),t.setAttribute("src",a.toString()),t.setAttribute("width",n),t.setAttribute("height",r),t.outerHTML},lrA=(A="")=>{var o,l;const e=document.createElement("div");e.innerHTML=A;const t=e.querySelector("iframe"),n=((o=t==null?void 0:t.getAttribute("height"))==null?void 0:o.replace("px",""))??"",r=((l=t==null?void 0:t.getAttribute("width"))==null?void 0:l.replace("px",""))??"",s=(t==null?void 0:t.getAttribute("src"))||"",a=new URL(s);return a.searchParams.append("height",n),a.searchParams.append("width",r),t==null||t.setAttribute("src",a.toString()),t.outerHTML},crA=async()=>{await Go({src:"https://www.instagram.com/embed.js"}),await Go({src:"https://platform.twitter.com/widgets.js"}),await Go({src:"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v14.0",tag:"body"}),await Go({src:"//embed.redditmedia.com/widgets/platform.js"})},urA=A=>A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/)||A.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/)||A.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/),frA=A=>A.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/),Io=A=>{var n;const e=urA(A);if(e&&((n=e[2])==null?void 0:n.length)===11)return{embed:!0,url:"https://www.youtube.com/embed/"+e[2]+"?showinfo=0"};const t=frA(A);return t?{embed:!0,url:(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/"}:{url:A,embed:!1}},pP=(A,e,t)=>{if(A&&"reportValidity"in A){const n=xA(t,e);A.setCustomValidity(n&&n.message||""),A.reportValidity()}},nh=(A,e)=>{for(const t in e.fields){const n=e.fields[t];n&&n.ref&&"reportValidity"in n.ref?pP(n.ref,t,A):n&&n.refs&&n.refs.forEach(r=>pP(r,t,A))}},hP=(A,e)=>{e.shouldUseNativeValidation&&nh(A,e);const t={};for(const n in A){const r=xA(e.fields,n),s=Object.assign(A[n]||{},{ref:r&&r.ref});if(drA(e.names||Object.keys(A),n)){const a=Object.assign({},xA(t,n));Be(a,"root",s),Be(t,n,a)}else Be(t,n,s)}return t},drA=(A,e)=>{const t=wP(e);return A.some(n=>wP(n).match(`^${t}\\.\\d+`))};function wP(A){return A.replace(/\]|\[/g,"")}function aj(A,e,t){function n(o,l){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(A),e(o,l);for(const u in a.prototype)u in o||Object.defineProperty(o,u,{value:a.prototype[u].bind(o)});o._zod.constr=a,o._zod.def=l}const r=(t==null?void 0:t.Parent)??Object;class s extends r{}Object.defineProperty(s,"name",{value:A});function a(o){var l;const c=t!=null&&t.Parent?new s:this;n(c,o),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var l,c;return t!=null&&t.Parent&&o instanceof t.Parent?!0:(c=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:c.has(A)}}),Object.defineProperty(a,"name",{value:A}),a}class grA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const vrA={};function oj(A){return vrA}function mrA(A,e){return typeof e=="bigint"?e.toString():e}const ij=Error.captureStackTrace?Error.captureStackTrace:(...A)=>{};function gf(A){return typeof A=="string"?A:A==null?void 0:A.message}function lj(A,e,t){var r,s,a,o,l,c;const n={...A,path:A.path??[]};if(!A.message){const u=gf((a=(s=(r=A.inst)==null?void 0:r._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,A))??gf((o=e==null?void 0:e.error)==null?void 0:o.call(e,A))??gf((l=t.customError)==null?void 0:l.call(t,A))??gf((c=t.localeError)==null?void 0:c.call(t,A))??"Invalid input";n.message=u}return delete n.inst,delete n.continue,e!=null&&e.reportInput||delete n.input,n}const cj=(A,e)=>{A.name="$ZodError",Object.defineProperty(A,"_zod",{value:A._zod,enumerable:!1}),Object.defineProperty(A,"issues",{value:e,enumerable:!1}),Object.defineProperty(A,"message",{get(){return JSON.stringify(e,mrA,2)},enumerable:!0}),Object.defineProperty(A,"toString",{value:()=>A.message,enumerable:!1})},prA=aj("$ZodError",cj),uj=aj("$ZodError",cj,{Parent:Error}),hrA=A=>(e,t,n,r)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},s);if(a instanceof Promise)throw new grA;if(a.issues.length){const o=new((r==null?void 0:r.Err)??A)(a.issues.map(l=>lj(l,s,oj())));throw ij(o,r==null?void 0:r.callee),o}return a.value},wrA=hrA(uj),yrA=A=>async(e,t,n,r)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=e._zod.run({value:t,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((r==null?void 0:r.Err)??A)(a.issues.map(l=>lj(l,s,oj())));throw ij(o,r==null?void 0:r.callee),o}return a.value},PrA=yrA(uj);function yP(A,e){try{var t=A()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}function xrA(A,e){for(var t={};A.length;){var n=A[0],r=n.code,s=n.message,a=n.path.join(".");if(!t[a])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];t[a]={message:o.message,type:o.code}}else t[a]={message:s,type:r};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return A.push(f)})}),e){var l=t[a].types,c=l&&l[n.code];t[a]=C0(a,e,t,r,c?[].concat(c,n.message):n.message)}A.shift()}return t}function brA(A,e){for(var t={};A.length;){var n=A[0],r=n.code,s=n.message,a=n.path.join(".");if(!t[a])if(n.code==="invalid_union"&&n.errors.length>0){var o=n.errors[0][0];t[a]={message:o.message,type:o.code}}else t[a]={message:s,type:r};if(n.code==="invalid_union"&&n.errors.forEach(function(u){return u.forEach(function(f){return A.push(f)})}),e){var l=t[a].types,c=l&&l[n.code];t[a]=C0(a,e,t,r,c?[].concat(c,n.message):n.message)}A.shift()}return t}function Pv(A,e,t){if(t===void 0&&(t={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(A))return function(n,r,s){try{return Promise.resolve(yP(function(){return Promise.resolve(A[t.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(a){return s.shouldUseNativeValidation&&nh({},s),{errors:{},values:t.raw?Object.assign({},n):a}})},function(a){if((function(o){return Array.isArray(o==null?void 0:o.issues)})(a))return{values:{},errors:hP(xrA(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(A))return function(n,r,s){try{return Promise.resolve(yP(function(){return Promise.resolve((t.mode==="sync"?wrA:PrA)(A,n,e)).then(function(a){return s.shouldUseNativeValidation&&nh({},s),{errors:{},values:t.raw?Object.assign({},n):a}})},function(a){if((function(o){return o instanceof prA})(a))return{values:{},errors:hP(brA(a.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const zrA=["background","color","size","font"],DrA=(A,e)=>(e.ops=e.ops.map(t=>{const n=t.attributes;if(!n)return t;const r={...n};return zrA.forEach(s=>delete r[s]),Object.keys(r).length>0?{...t,attributes:r}:{insert:t.insert}}),e),BrA={history:{delay:500,maxStack:100,userOnly:!0},clipboard:{matchers:[["*",DrA]]}},MrA=["header","size","bold","italic","underline","align","list","indent","link","strike","image","video","color","blockquote","background","code-block","picture"],fj=He({url:vA().url("Invalid URL, enter valid URL")}),CrA=A=>{if(typeof window>"u"||!A)return A;const e=document.createElement("div");return e.innerHTML=A,e.querySelectorAll(".ql-picture-caption").forEach(t=>{const n=t;n.removeAttribute("contenteditable"),n.removeAttribute("data-editing"),n.removeAttribute("data-original-caption"),n.style.border="1px solid transparent",n.innerHTML.trim()==="Click to edit caption..."&&(n.innerHTML="")}),e.innerHTML},jrA=()=>{const{state:{showEmbedVideo:A},dispatch:e,handleAddEmbed:t}=po(),[n,r]=y.useState(Io("")),s=()=>{e({type:"TOGGLE_EMBED_VIDEO",payload:!1})},a=()=>{t("video",n.url),r(Io("")),s()},o=Tg({resolver:Pv(fj),defaultValues:{url:""},reValidateMode:"onChange",mode:"onChange"}),l=async()=>{if(!c)throw new Error("Validation failed");a(),o.reset()},c=o.formState.isValid;return y.useEffect(()=>{const u=o.watch(async(f,{name:d,values:g})=>{d=="url"&&r(Io(g.url??""))});return()=>u.unsubscribe()},[o]),i.jsx(Mt,{open:A,onOpenChange:s,children:i.jsxs(wt,{className:"p-0 overflow-hidden rounded-xl border-0",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{children:i.jsx("h1",{className:"text-md",children:"Embed Video"})})}),i.jsxs("div",{className:"px-4 space-y-4 flex items-center justify-center flex-wrap",children:[c&&i.jsx("div",{className:"w-full [&_video]:max-h-50 [&_video]:lg:max-h-80",children:i.jsx(tt,{label:"Video Preview",type:"video",value:n.url,linkProps:{className:"min-h-70 ![&_video]:lg:max-h-50"},onChange:u=>r(Io(u))})}),i.jsx(uo,{control:o.control,name:"url",render:({field:u,fieldState:f})=>i.jsx(tt,{label:"Video Url",onChange:u.onChange,error:f.error,inputProps:{name:u.name,value:u.value,className:"underline",placeholder:"Video URL"}})},"url")]}),i.jsx(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:i.jsx(ge,{className:"rounded",variant:"primary",onClick:l,disabled:!c,children:"Embed"})})]})})};function OrA(A){return RA({attr:{version:"1.1",viewBox:"0 0 20 16"},child:[{tag:"path",attr:{d:"M13 11.5l1.5 1.5 5-5-5-5-1.5 1.5 3.5 3.5z"},child:[]},{tag:"path",attr:{d:"M7 4.5l-1.5-1.5-5 5 5 5 1.5-1.5-3.5-3.5z"},child:[]},{tag:"path",attr:{d:"M10.958 2.352l1.085 0.296-3 11-1.085-0.296 3-11z"},child:[]}]})(A)}const TrA={title:"",content:"",showEmbedVideo:!1,showEmbedLink:!1,showEmbedImage:!1,showEmbedPost:!1,embedType:null,embedValue:"",error:!1,isLoading:!1,toolbarId:"",editorContainerId:""},ErA=(A,e)=>{switch(e.type){case"SET_TITLE":return{...A,title:e.payload};case"SET_CONTENT":return{...A,content:e.payload};case"TOGGLE_EMBED_VIDEO":return{...A,showEmbedVideo:e.payload};case"TOGGLE_EMBED_LINK":return{...A,showEmbedLink:e.payload};case"TOGGLE_EMBED_IMAGE":return{...A,showEmbedImage:e.payload};case"TOGGLE_EMBED_POST":return{...A,showEmbedPost:e.payload};case"SET_EMBED":return{...A,embedType:e.payload.type,embedValue:e.payload.value};case"INITIATE_EMBED":return{...A,embedType:e.payload,showEmbedVideo:e.payload==="video",showEmbedLink:e.payload==="link",showEmbedImage:e.payload==="image"};case"RESET_EMBED":return{...A,embedType:"",embedValue:"",showEmbedVideo:!1,showEmbedLink:!1,showEmbedImage:!1};case"SET_ERROR":return{...A,error:e.payload};case"SET_LOADING":return{...A,isLoading:e.payload};default:return A}};function NrA({url:A}){const e=lv(A||"",300),t=y.useCallback(async()=>{if(ve.NEXT_PUBLIC_TWITTER_EMBED_ENDPOINT)return(await Qe.post(ve.NEXT_PUBLIC_TWITTER_EMBED_ENDPOINT||"",{url:e})).data;throw console.error("Invalid Twitter Embed Configuration"),Error("Invalid Twitter Embed Configuration")},[e]);return Pu({queryKey:[e],queryFn:t,staleTime:300*1e3,gcTime:600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!1})}const HrA=({value:A,label:e,removeCaption:t})=>{const n={text:s=>i.jsx("iframe",{className:"",allowFullScreen:!0,src:Io(s).url}),tiktok:s=>i.jsx(krA,{url:s,className:"custom__embed tiktok__embed"}),twitter:s=>i.jsx(ZrA,{url:s}),instagram:(s,a)=>i.jsx(VrA,{value:s,removeCaption:a}),facebook:(s,a)=>i.jsx(SrA,{value:s,removeCaption:a}),reddit:()=>i.jsx(XrA,{url:A})};y.useEffect(()=>{crA()},[]);const r=n[e];if(!["text","facebook","tiktok","instagram","twitter","reddit"].includes(e)||!A)return i.jsx("div",{className:"w-fit max-h-[20vh] overflow-auto flex items-center justify-center border border-[#ccc]",children:i.jsx(OrA,{size:30})});if(r)return i.jsx(i.Fragment,{children:r(A,t)})},krA=({url:A="",className:e=""})=>{const[t,n]=y.useState(null);return y.useEffect(()=>{const r=async a=>{try{const o=await fetch(`https://www.tiktok.com/oembed?url=${encodeURIComponent(a)}`),{html:l=""}=await o.json();return l}catch(o){return console.error({summary:`TikTok Embed Fetch Failed For: ${a}`,message:o==null?void 0:o.message}),null}};(async()=>{if(!A)return;const a=await r(A);n(a)})().then(()=>{Go({src:"https://www.tiktok.com/embed.js"})})},[A]),i.jsx("div",{className:e,dangerouslySetInnerHTML:{__html:t??""}})},ZrA=({url:A=""})=>{var s;const[e,t]=y.useState(null),n=y.useRef(null),r=NrA({url:A});return y.useEffect(()=>{const a=r.data;if(r.isError||!(a!=null&&a.embedHtml)||!n.current)return;t(a.embedHtml||null),(async()=>{await new Promise(l=>setTimeout(l,100)),window.twttr&&window.twttr.widgets&&n.current&&window.twttr.widgets.load(n.current)})()},[r.data,r.isError]),y.useEffect(()=>{if(!window.twttr){const a=document.createElement("script");a.src="https://platform.twitter.com/widgets.js",a.async=!0,document.body.appendChild(a)}},[]),i.jsxs("div",{className:"relative w-full max-w-[550px] min-h-20",children:[r.isLoading&&i.jsx("div",{className:"absolute h-full w-full inset-0 bg-secondary/20 animate-pulse rounded"}),r.isFetched&&i.jsx("div",{className:"w-full",ref:n,dangerouslySetInnerHTML:{__html:e}}),r.isError&&i.jsx("div",{className:"p-4 border border-red-200 bg-red-50 rounded text-red-600",children:(s=r.error)==null?void 0:s.message})]})},SrA=({value:A,removeCaption:e})=>(y.useEffect(()=>{(async()=>{var n,r,s;await yv(window.FB),(s=(r=(n=window.FB)==null?void 0:n.XFBML)==null?void 0:r.parse)==null||s.call(r)})()},[A,e]),i.jsx("div",{className:"fb-post custom__embed","data-href":A,"data-show-text":`${!e}`,children:i.jsx("blockquote",{cite:A,className:"fb-xfbml-parse-ignore"})})),VrA=({value:A,removeCaption:e})=>(y.useEffect(()=>{(async()=>{var n,r,s;await yv(window.instgrm),(s=(r=(n=window.instgrm)==null?void 0:n.Embeds)==null?void 0:r.process)==null||s.call(r)})()},[A,e]),i.jsx("div",{dangerouslySetInnerHTML:{__html:`<blockquote class="instagram-media" ${e?"":"data-instgrm-captioned"} data-instgrm-permalink="${A}?utm_source=ig_embed&utm_campaign=loading" data-instgrm-version="13" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="${A}?utm_source=ig_embed&utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;"> View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="${A}?utm_source=ig_embed&utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by </a></p></div></blockquote>`}})),XrA=({url:A=""})=>{const e=y.useRef(null);return y.useEffect(()=>{(async()=>{!A||!e.current||(window.rembeddit||(await Go({src:"//embed.redditmedia.com/widgets/platform.js"}),await yv(window.rembeddit)),setTimeout(()=>{if(window.rembeddit&&e.current)try{window.rembeddit.createEmbeds()}catch(n){console.warn("Reddit embed processing failed:",n)}},500))})()},[A]),i.jsx("div",{className:"w-full max-w-[600px] p-2 relative",children:i.jsx("div",{className:"custom__embed p-4",ref:e,children:i.jsx("blockquote",{className:"reddit-embed-bq","data-card-created":Date.now(),children:i.jsx("a",{href:A,children:A})})})})},$m=[{label:"Text",value:"text"},{label:"Instagram",value:"instagram"},{label:"Facebook",value:"facebook"},{label:"X",value:"twitter"},{label:"Reddit",value:"reddit"},{label:"TikTok",value:"tiktok"}],YrA=()=>{var v;const{state:{showEmbedLink:A},dispatch:e,handleAddEmbed:t}=po(),[n,r]=y.useState(((v=$m[0])==null?void 0:v.value)||"text"),[s,a]=y.useState(""),o=y.useRef(null),l=Tg({resolver:Pv(fj),defaultValues:{url:""},reValidateMode:"onChange",mode:"onChange"}),c=l.formState.isValid,u=m=>{t("htmlembed",m),d(),a("")},f=async()=>{var m,p,h,w,x;try{if(!c)throw new Error("Validation failed");switch(n){case"text":u((m=o.current)==null?void 0:m.innerHTML);break;case"tiktok":case"twitter":u(irA((p=o.current)==null?void 0:p.innerHTML));break;case"facebook":u(orA((h=o.current)==null?void 0:h.innerHTML));break;case"instagram":case"reddit":u(lrA((w=o.current)==null?void 0:w.innerHTML));break;default:break}r(((x=$m[0])==null?void 0:x.value)||"text"),a("")}catch(b){console.log(b)}},d=()=>{e({type:"TOGGLE_EMBED_LINK",payload:!1})},g=m=>{const p=m;p!=null&&p.value&&r(p.value)};return y.useEffect(()=>{const m=l.watch((p,{name:h,values:w})=>{h=="url"&&a(w.url??"")});return()=>m.unsubscribe()},[l]),i.jsx(Mt,{open:A,onOpenChange:d,children:i.jsxs(wt,{className:"sm:max-w-[600px] p-0 overflow-hidden rounded border-0",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{children:i.jsx("h1",{className:"text-md",children:"Embed Link"})})}),i.jsx("div",{className:"mx-auto mb-5 w-fit max-h-90 overflow-auto",id:"postembed",ref:o,children:c&&i.jsx(HrA,{label:n,removeCaption:!1,value:s})}),i.jsxs("div",{className:"px-4 space-y-4",children:[i.jsx(tt,{label:"Social Media Platform",type:"select",value:{value:n,label:n},selectProps:{options:$m,dataKey:"social-media-platforms"},onChange:g}),i.jsx(uo,{control:l.control,name:"url",render:({field:m,fieldState:p})=>i.jsx(wr,{className:"flex-1",children:i.jsx(fo,{className:"w-full",children:i.jsx(tt,{label:"URL",inputProps:{name:m.name,value:m.value,className:"underline",placeholder:"URL"},error:p.error,onChange:m.onChange})})})},"url")]}),i.jsxs(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:[i.jsx(ge,{className:"rounded",variant:"primary",onClick:f,disabled:!c,children:"Embed"}),i.jsx(ge,{variant:"outline",className:"rounded",onClick:d,children:"Cancel"})]})]})})},dj=({open:A=!0,onSave:e,handleToggleOpen:t,className:n,selectedPosts:r,columns:s,queryConfig:a,defaultState:o,gridCard:l,postType:c,filterFields:u,postBaseURL:f,apolloUri:d,...g})=>{const v=m=>{e==null||e(m),t==null||t(!1)};return i.jsx(Mt,{open:A,onOpenChange:t,children:i.jsx(wt,{className:E("sm:max-w-[80%] md:max-w-[80%] h-[90%] shadow-lg p-0 overflow-hidden",n),children:i.jsx(hn,{columns:s,selectedPosts:r,queryConfig:a,defaultState:o,gridCard:l,postType:c,postBaseURL:f,filterFields:u,isSelect:!0,rootClassName:"h-full",gridColumnStyle:"repeat(auto-fit, minmax(210px, 1fr))",onSave:v,apolloUri:d,...g})})})},GrA=({className:A})=>{const{state:e,imageGalleryConfig:t,dispatch:n,handleAddEmbed:r,asChild:s,blogPostsConfig:a}=po(),{showEmbedImage:o,showEmbedPost:l}=e,c=d=>{n({type:"TOGGLE_EMBED_IMAGE",payload:d})},u=d=>{r("image",d),c(!1)},f=d=>{d[0]&&r("post",d[0]),n({type:"TOGGLE_EMBED_POST",payload:!1})};return i.jsxs(i.Fragment,{children:[!s&&i.jsxs("div",{className:E("w-full h-full flex-1 flex flex-col no-scrollbar gap-2 border-1",A),"data-testid":"editor",children:[i.jsx(vP,{}),i.jsx(mP,{})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx(vP,{}),i.jsx(mP,{})]}),i.jsx(jrA,{}),i.jsx(YrA,{}),t&&i.jsx(eh,{config:{...t,viewOnly:!0},open:o,onChange:d=>d&&u(d),handleToggleOpen:c}),a&&i.jsx(dj,{...a,open:l,selectedPosts:[],onSave:f,handleToggleOpen:d=>n({type:"TOGGLE_EMBED_POST",payload:d})})]})},IrA=({children:A,onChange:e,imageGalleryConfig:t,content:n,asChild:r,blogPostsConfig:s,twitterEmbedConfig:a})=>{const o=y.useRef(null),[l,c]=y.useState(null),u=y.useRef(""),f=y.useMemo(()=>({toolbarId:`toolbar-${Date.now()}`,editorContainerId:`editorParent-${Date.now()}`}),[]),[d,g]=y.useReducer(ErA,{...TrA,toolbarId:f.toolbarId,editorContainerId:f.editorContainerId,content:n||"",quillRef:o}),v=y.useCallback(w=>{const x=CrA(w);g({type:"SET_CONTENT",payload:x}),u.current=x,e==null||e(x)},[e]),m=w=>{setTimeout(()=>{g({type:"INITIATE_EMBED",payload:w})},100)},p=(w,x)=>{g({type:"SET_EMBED",payload:{type:w,value:x}})};y.useEffect(()=>{let w=null;return(async()=>{if(!(typeof window>"u"))try{const z=(await Promise.resolve().then(()=>require("./quill-CLxn7l6G.cjs"))).default,M=await(await Promise.resolve().then(()=>require("./PictureBlot-CrMuPhFR.cjs"))).default();M&&z.register("formats/picture",M,!0),o.current&&(w=new z(o.current,{theme:"snow",modules:{...BrA,toolbar:{container:`#${f.toolbarId}`}},formats:MrA,placeholder:"Add content"}),n&&n.trim()!==""&&(w==null||w.clipboard.dangerouslyPasteHTML(n,"silent"),u.current=n),w.on("text-change",()=>{if(w){const B=w.root.innerHTML;v(B)}}),w.root.addEventListener("keydown",B=>{var H,k;if(B.key==="Enter"&&w){const Y=w.getSelection();if(Y){const T=w.getLength();if(Y.index>=T-1){const q=w.root.lastElementChild;if(q!=null&&q.classList.contains("ql-picture-container")){B.preventDefault(),w.insertText(T,`
|
|
518
518
|
`,"user"),w.setSelection(T+1,0);return}}const[S]=w.getLeaf(Y.index);if((k=(H=S==null?void 0:S.domNode)==null?void 0:H.closest)==null?void 0:k.call(H,".ql-picture-container")){B.preventDefault();const q=Y.index;w.insertText(q+1,`
|
|
519
519
|
`,"user"),w.setSelection(q+2,0)}}}}),w.on("text-change",(B,H,k)=>{if(k==="user"){if(document.querySelector('.ql-picture-caption[data-editing="true"]'))return;setTimeout(()=>{if(!w)return;const T=w.root.innerHTML,S=/<p[^>]*class="[^"]*ql-align-[^"]*"[^>]*><br><\/p>/g,X=T.replace(S,"<p><br></p>");if(/^<p[^>]*class="[^"]*ql-align-[^"]*"[^>]*><br><\/p>$/.test(T.trim()))w.root.innerHTML="<p><br></p>",w.setSelection(0,0);else if(X!==T){w.root.innerHTML=X;const J=w.getSelection();J&&w.setSelection(J.index,J.length)}},100)}}),c(w))}catch(b){console.error("Failed to load Quill editor:",b)}})(),()=>{w&&w.off("text-change"),c(null)}},[o]),y.useEffect(()=>{if(!l)return;const w=n||"";if(w!==u.current&&!l.hasFocus()){if(l.root.innerHTML===w){u.current=w;return}l.clipboard.dangerouslyPasteHTML(w,"silent"),g({type:"SET_CONTENT",payload:w}),u.current=w}},[n,l]);const h={state:d,dispatch:g,handleContentChange:v,handleInitiateEmbed:m,handleAddEmbed:p,imageGalleryConfig:t,blogPostsConfig:s,onChange:e,asChild:r,quillObj:l,setQuillObj:c,twitterEmbedConfig:a};return i.jsx(sj.Provider,{value:h,children:A})},QrA=({className:A,onChange:e,initialValue:t,content:n,imageGalleryConfig:r,blogPostsConfig:s,asChild:a,twitterEmbedConfig:o})=>i.jsx(IrA,{content:n||t,onChange:e,imageGalleryConfig:r,asChild:a,blogPostsConfig:s,twitterEmbedConfig:o,children:i.jsx(GrA,{className:A})}),LrA=()=>{const{state:A,dispatch:e,onChange:t,linkProps:n}=On(),{value:r}=A,[s,a]=P.useState(!0),[o,l]=P.useState(0),[c,u]=P.useState(0),[f,d]=P.useState(0),[g,v]=P.useState(""),[m,p]=P.useState(0),[h,w]=P.useState(!1),[x,b]=P.useState({x:0,y:0}),z=P.useRef(null),D=P.useRef(null),M=P.useRef(null),B=P.useRef(null),H=Io(r),k=()=>{e({type:"SET_VALUE",payload:""}),t&&t("")},Y=P.useCallback(()=>{z.current&&(s?z.current.play():z.current.pause(),a(!s))},[s]),T=P.useCallback(()=>{if(z.current){const Z=z.current.currentTime,C=z.current.duration;l(Z),d(C>0?Z/C*100:0),D.current&&(D.current.currentTime=Z)}},[]),S=P.useCallback(()=>{z.current&&(u(z.current.duration),G(H.url))},[H.url]),X=P.useCallback(Z=>{if(M.current&&z.current&&c>0){const C=M.current.getBoundingClientRect(),j=(Z.clientX-C.left)/C.width*c;if(p(j),b({x:Z.clientX-C.left,y:C.top-10}),w(!0),B.current&&z.current){const N=B.current,V=N.getContext("2d");if(V){const I=document.createElement("video");I.src=H.url,I.currentTime=j,I.muted=!0,I.addEventListener("seeked",()=>{V.drawImage(I,0,0,N.width,N.height)},{once:!0})}}}},[c,H]),q=P.useCallback(()=>{w(!1)},[]),J=P.useCallback(Z=>{if(M.current&&z.current&&c>0){const C=M.current.getBoundingClientRect(),j=(Z.clientX-C.left)/C.width*c;z.current.currentTime=j,l(j),d(j/c*100)}},[c]),G=P.useCallback(Z=>{try{const C=Z.split("/"),j=C[C.length-1];if(j&&j.includes(".")){const I=j.split(".").slice(0,-1).join("."),nA=decodeURIComponent(I).replace(/[_-]/g," ").replace(/\s+/g," ").trim();if(nA){v(nA);return}}const N=new URL(Z).pathname.split("/").filter(Boolean);if(N.length>0){const I=N[N.length-1],W=decodeURIComponent(I).replace(/[_-]/g," ").replace(/\s+/g," ").trim();if(W&&!W.includes(".")){v(W);return}}const V=new URL(Z).hostname;V.includes("youtube")||V.includes("youtu.be")?v("YouTube Video"):V.includes("vimeo")?v("Vimeo Video"):V.includes("twitch")?v("Twitch Video"):v("Video")}catch(C){console.log(C),v("Video")}},[]);P.useEffect(()=>{const Z=z.current,C=D.current;return Z&&(Z.src=H.url,Z.addEventListener("timeupdate",T),Z.addEventListener("loadedmetadata",S),Z.addEventListener("pause",()=>a(!0)),Z.addEventListener("play",()=>a(!1))),C&&(C.src=H.url,C.muted=!0),()=>{Z&&(Z.removeEventListener("timeupdate",T),Z.removeEventListener("loadedmetadata",S),Z.removeEventListener("pause",()=>a(!0)),Z.removeEventListener("play",()=>a(!1)))}},[r,T,S]),P.useEffect(()=>{setTimeout(()=>{s||Y()},2e3)},[r]);const O=Z=>{const C=Math.floor(Z/60),j=Math.floor(Z%60);return`${C}:${j.toString().padStart(2,"0")}`};return i.jsxs("div",{className:"flex-1 overflow-hidden h-full flex flex-col items-center justify-center gap-2 bg-background",children:[r&&!(H!=null&&H.embed)&&i.jsxs("div",{className:"group relative w-full h-full flex-1 flex items-center justify-center overflow-hidden ",children:[i.jsx("video",{className:"w-full h-100 flex-1",src:H.url,ref:z,children:"Your browser does not support the video tag."}),i.jsxs("div",{className:"hidden group-hover:flex absolute w-full h-full flex-col justify-between p-4 bg-gradient-to-b from-transparent via-transparent via-60% to-black/50 ",children:[i.jsxs("div",{className:"flex-1 flex gap-1 justify-end",children:[i.jsx(pA,{variant:"ghost",size:"icon",className:"bg-background rounded-md shadow-[0px_4.29px_12.86px_0px_#00000012] h-7 w-7",onClick:Y,children:s?i.jsx(Lh,{}):i.jsx(dV,{})}),i.jsx(pA,{variant:"ghost",size:"icon",onClick:k,className:"bg-background shadow-[0px_4.29px_12.86px_0px_#00000012] rounded-md h-7 w-7",children:i.jsx(Mi,{className:"text-destructive",size:"small"})})]}),i.jsxs("div",{className:"h-fit flex flex-col gap-2",children:[i.jsx("p",{className:"text-background capitalize text-xl",children:g||"Loading..."}),i.jsxs("div",{className:"flex w-full justify-between items-center",children:[i.jsx("p",{className:"text-background",children:"Video Player"}),i.jsxs("span",{className:"text-sm text-background",children:[O(o)," / ",O(c)]})]}),i.jsx("div",{className:"relative",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs("div",{className:"flex-1 relative",children:[i.jsxs("div",{ref:M,className:"h-[2px] bg-background/50 rounded-full cursor-pointer relative overflow-hidden",onMouseMove:X,onMouseLeave:q,onClick:J,children:[i.jsx("div",{className:"h-full bg-background rounded-full transition-all duration-[1000]",style:{width:`${f}%`}}),h&&i.jsx("div",{className:"absolute top-0 w-0.5 h-full bg-white/80 pointer-events-none",style:{left:`${m/c*100}%`,transform:"translateX(-50%)"}})]}),h&&i.jsx("div",{className:"absolute z-50 pointer-events-none",style:{left:`${x.x}px`,bottom:"100%",transform:"translateX(-50%)",marginBottom:"4px"},children:i.jsx("canvas",{ref:B,width:120,height:68,className:"rounded border border-background mb-1"})})]})})})]})]})]}),r&&(H==null?void 0:H.embed)&&i.jsx("iframe",{className:E("w-full h-full",n==null?void 0:n.className),allowFullScreen:!0,src:H.url}),!r&&i.jsxs("div",{"data-testid":"no-video",className:"flex flex-col w-full h-80 items-center justify-center gap-2 text-muted-foreground",children:[i.jsx(g4,{className:"text-xl"}),i.jsx("p",{className:"text-xs text-center",children:"No video to display"})]})]})},qrA=()=>{const{state:A,dispatch:e,blogPostsConfig:t,label:n}=On(),{showPostsModal:r,value:s}=A,a=()=>{e({type:"TOGGLE_POSTS_MODAL"})},o=u=>{const f=c.filter(d=>d.uuid!==u.uuid);e({type:"SET_VALUE",payload:f})},l=u=>{e({type:"SET_VALUE",payload:u})};if(!t)return null;const c=s;return i.jsxs("div",{className:E("flex-1 bg-background space-y-2"),children:[i.jsxs("div",{className:"w-full flex items-center justify-between gap-2",children:[i.jsx(ge,{size:"icon",variant:"primary",className:"bg-muted rounded-full",onClick:a,children:i.jsx(Dn,{})}),i.jsx("div",{className:"flex-1 text-sm ",children:n}),!!c.length&&i.jsxs("p",{className:"text-sm p-2 bg-muted text-muted-foreground rounded",children:[c.length," selected articles"]})]}),i.jsx("div",{className:"space-y-1 max-h-60 overflow-y-auto",children:c.map(u=>{const f=u.featured_image?JSON.parse(u.featured_image):null;return i.jsxs("div",{className:"gap-2 flex flex-row items-center justify-between w-full waz_shadow py-2","data-testid":"post-row",children:[f!=null&&f.src?i.jsx("img",{src:Cc({url:f==null?void 0:f.src,width:80,height:64}).url,alt:"Post Image",className:"w-[3rem] h-10 rounded-sm object-cover flex-shrink-0"}):i.jsx("div",{className:"w-[3rem] h-10 bg-muted rounded-sm flex items-center justify-center","data-testid":"post-no-image",children:i.jsxs("div",{className:"flex flex-col items-center text-muted-foreground",children:[i.jsx(FS,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[9px]",children:"No image"})]})}),i.jsx("a",{className:" flex-1 hover:underline cursor-pointer text-sm line-clamp-1",href:t.postBaseURL+u.slug,target:"_blank",rel:"noopener noreferrer",children:ts(u.title)}),i.jsx(ge,{size:"icon",variant:"ghost",onClick:()=>o(u),"data-testid":"remove-post",children:i.jsx(ss,{})})]},u.uuid)})}),i.jsx(dj,{...t,selectedPosts:c,open:r,onSave:l,handleToggleOpen:u=>e({type:"TOGGLE_POSTS_MODAL",payload:u})})]})};function JrA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"},child:[]}]})(A)}function RrA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(A)}function FrA(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"},child:[]}]})(A)}function q9(A){return RA({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"},child:[]}]})(A)}const WrA=()=>{const{state:{value:A,showEditLinkModal:e},dispatch:t,onChange:n,label:r,linkProps:s,error:a}=On(),[o,l]=y.useState(A),c=()=>{t({type:"SET_VALUE",payload:o}),n&&n(o),u()},u=()=>{t({type:"TOGGLE_EDIT_LINK_MODAL"})};return y.useEffect(()=>{l(A)},[A]),i.jsx(i.Fragment,{children:i.jsx(Mt,{open:e,onOpenChange:u,children:i.jsxs(wt,{className:"p-0 border-none overflow-hidden rounded-xl",children:[i.jsx(rn,{className:"bg-secondary p-4 py-4 items-start",children:i.jsx(sn,{children:i.jsxs("h1",{className:"text-md capitalize",children:["Edit ",r]})})}),i.jsx("div",{className:"p-4 py-2",children:i.jsx(tt,{label:i.jsxs("span",{className:"flex gap-2 items-center text-sm ",children:[r,a&&i.jsxs("span",{className:"flex items-center justify-center gap-1",children:[i.jsx(q9,{className:"text-destructive text-xl"}),i.jsx("span",{className:" capitalize text-xs text-muted-foreground",children:a==null?void 0:a.message})]})]}),value:o,type:"textarea",onChange:f=>l(f.toString()),textareaProps:{...s,className:E("underline text-[#101828] text-sm",s==null?void 0:s.className)}})}),i.jsx(pn,{className:"flex flex-row p-4 pt-0 gap-4 justify-end mt-4",children:i.jsx(ge,{className:"rounded",variant:"primary",onClick:c,disabled:o.toString().includes(" "),children:"Save"})})]})})})},KrA=()=>{const{state:{value:A},dispatch:e,optionsQuery:{data:t,isLoading:n,fetchNextPage:r,hasNextPage:s,isFetchingNextPage:a},selectProps:o}=On(),l=P.useMemo(()=>(t==null?void 0:t.pages.flatMap(b=>b==null?void 0:b.data).filter(b=>b!=null))??[],[t]),[c,u]=P.useState(""),[f,d]=P.useState(!1),{ref:g,inView:v}=mv(),m=P.useRef(null),p=b=>{d(!0),u(b),e({type:"SET_OPTIONS_SEARCH_VALUE",payload:b})},h=b=>{let z=[];A&&Array.isArray(A)&&A.every(B=>typeof B=="object"&&"label"in B&&"value"in B)&&(z=A);const D=z.find(B=>B.value===b.value);let M;(o==null?void 0:o.multiple)===!1?M=D?[]:[b]:M=D?z.filter(B=>B.value!==b.value):[...z,b],e({type:"SET_VALUE",payload:M}),u("")},w=P.useMemo(()=>A?Array.isArray(A)?A.every(z=>typeof z=="object"&&"label"in z&&"value"in z)?A:[]:[]:[],[A]),x=b=>{var D;const z=(D=m.current)==null?void 0:D.value;b.key=="Enter"&&(b.preventDefault(),m.current&&z&&(o!=null&&o.createNewOption)&&(h({label:z,value:z}),m.current.value=""))};return P.useEffect(()=>{v&&s&&!a&&r()},[v,s,a,r]),i.jsxs(ua,{open:f&&(!!(o!=null&&o.queryConfig)||!!(o!=null&&o.options)),onOpenChange:d,modal:!1,children:[i.jsx(fa,{asChild:!0,onClick:b=>b.preventDefault(),children:i.jsxs("div",{className:E("w-full flex flex-wrap gap-2 p-2 items-center bg-background ",o==null?void 0:o.className),children:[w.map((b,z)=>i.jsxs(Je,{className:"flex h-fit gap-2 p-1 px-2 items-center bg-[#86FC6540] text-current capitalize",children:[b.label||b.value,i.jsx(ss,{onClick:()=>h(b),className:"h-4 w-4 p-1 bg-[#65FB3A] rounded-full"})]},b.value||b.label||z)),i.jsx(It,{ref:m,placeholder:o==null?void 0:o.placeholder,className:"p-0 min-w-30 flex-1 border-none shadow-none bg-transparent hover:bg-transparent focus:bg-transparent focus:ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none focus-visible:outline-none",value:c,onChange:b=>p(b.target.value),onKeyDown:x,onFocus:()=>d(!0)})]})}),i.jsx(vs,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",onOpenAutoFocus:b=>b.preventDefault(),children:i.jsx(nu,{shouldFilter:!1,children:i.jsxs(Dg,{className:"text-sm",children:[i.jsx(Bg,{className:"flex items-center justify-center p-3 ",children:n?i.jsx(wi,{className:"h-6 w-6 animate-spin"}):"No Options found."}),i.jsxs(Mg,{children:[l.map(b=>b&&i.jsxs(Cg,{value:b.value,onSelect:()=>h(b),className:"capitalize",children:[b.label,i.jsx(nj,{className:E("ml-auto",w.some(z=>b.value===z.value)?"opacity-100":"opacity-0")})]},b.value)),s&&i.jsx("div",{ref:g,className:"w-full flex justify-center",children:a?i.jsx(MeA,{className:"h-6 w-6 animate-spin"}):i.jsx(pA,{variant:"ghost",onClick:()=>r(),children:"Load more"})})]})]})})})]})};function rh({defaultValue:A,onChange:e}){const[t,n]=P.useState(A!=null&&A.length?new Date(A):void 0),r=s=>{n(s),e==null||e(s)};return i.jsxs(ua,{children:[i.jsx(fa,{asChild:!0,children:i.jsxs(pA,{variant:"outline",className:E("w-fit flex-1 justify-start text-left font-normal cursor-pointer h-10",!t&&"text-muted-foreground"),children:[i.jsx(fg,{}),t?Ne(t,"PPP"):i.jsx("span",{children:"Pick a date"})]})}),i.jsxs(vs,{className:"flex w-auto flex-col space-y-2 p-2",children:[i.jsxs(bi,{defaultValue:"0",onValueChange:s=>r(Ot(new Date,parseInt(s))),children:[i.jsx(eo,{children:i.jsx(zi,{placeholder:"Select"})}),i.jsxs(to,{position:"popper",children:[i.jsx(pr,{value:"-30",children:"Last 30 days"}),i.jsx(pr,{value:"-7",children:"Last Week"}),i.jsx(pr,{value:"-1",children:"Yesterday"}),i.jsx(pr,{value:"0",children:"Today"})]})]}),i.jsx("div",{className:"rounded-md border",children:i.jsx(Au,{mode:"single",disabled:s=>Date.now()<s.getTime(),selected:t,onSelect:s=>s&&r(s)})})]})]})}function UrA(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];return y.useMemo(()=>n=>{e.forEach(r=>r(n))},e)}const xv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function al(A){const e=Object.prototype.toString.call(A);return e==="[object Window]"||e==="[object global]"}function J9(A){return"nodeType"in A}function an(A){var e,t;return A?al(A)?A:J9(A)&&(e=(t=A.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function R9(A){const{Document:e}=an(A);return A instanceof e}function Cu(A){return al(A)?!1:A instanceof an(A).HTMLElement}function gj(A){return A instanceof an(A).SVGElement}function ol(A){return A?al(A)?A.document:J9(A)?R9(A)?A:Cu(A)||gj(A)?A.ownerDocument:document:document:document}const Mr=xv?y.useLayoutEffect:y.useEffect;function F9(A){const e=y.useRef(A);return Mr(()=>{e.current=A}),y.useCallback(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.current==null?void 0:e.current(...n)},[])}function _rA(){const A=y.useRef(null),e=y.useCallback((n,r)=>{A.current=setInterval(n,r)},[]),t=y.useCallback(()=>{A.current!==null&&(clearInterval(A.current),A.current=null)},[]);return[e,t]}function Tc(A,e){e===void 0&&(e=[A]);const t=y.useRef(A);return Mr(()=>{t.current!==A&&(t.current=A)},e),t}function ju(A,e){const t=y.useRef();return y.useMemo(()=>{const n=A(t.current);return t.current=n,n},[...e])}function Vd(A){const e=F9(A),t=y.useRef(null),n=y.useCallback(r=>{r!==t.current&&(e==null||e(r,t.current)),t.current=r},[]);return[t,n]}function sh(A){const e=y.useRef();return y.useEffect(()=>{e.current=A},[A]),e.current}let Ap={};function Ou(A,e){return y.useMemo(()=>{if(e)return e;const t=Ap[A]==null?0:Ap[A]+1;return Ap[A]=t,A+"-"+t},[A,e])}function vj(A){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((s,a)=>{const o=Object.entries(a);for(const[l,c]of o){const u=s[l];u!=null&&(s[l]=u+A*c)}return s},{...e})}}const Ai=vj(1),Ec=vj(-1);function $rA(A){return"clientX"in A&&"clientY"in A}function W9(A){if(!A)return!1;const{KeyboardEvent:e}=an(A.target);return e&&A instanceof e}function AsA(A){if(!A)return!1;const{TouchEvent:e}=an(A.target);return e&&A instanceof e}function ah(A){if(AsA(A)){if(A.touches&&A.touches.length){const{clientX:e,clientY:t}=A.touches[0];return{x:e,y:t}}else if(A.changedTouches&&A.changedTouches.length){const{clientX:e,clientY:t}=A.changedTouches[0];return{x:e,y:t}}}return $rA(A)?{x:A.clientX,y:A.clientY}:null}const ds=Object.freeze({Translate:{toString(A){if(!A)return;const{x:e,y:t}=A;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(A){if(!A)return;const{scaleX:e,scaleY:t}=A;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(A){if(A)return[ds.Translate.toString(A),ds.Scale.toString(A)].join(" ")}},Transition:{toString(A){let{property:e,duration:t,easing:n}=A;return e+" "+t+"ms "+n}}}),PP="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function esA(A){return A.matches(PP)?A:A.querySelector(PP)}const tsA={display:"none"};function nsA(A){let{id:e,value:t}=A;return y.createElement("div",{id:e,style:tsA},t)}function rsA(A){let{id:e,announcement:t,ariaLiveType:n="assertive"}=A;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return y.createElement("div",{id:e,style:r,role:"status","aria-live":n,"aria-atomic":!0},t)}function ssA(){const[A,e]=y.useState("");return{announce:y.useCallback(n=>{n!=null&&e(n)},[]),announcement:A}}const mj=y.createContext(null);function asA(A){const e=y.useContext(mj);y.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(A)},[A,e])}function osA(){const[A]=y.useState(()=>new Set),e=y.useCallback(n=>(A.add(n),()=>A.delete(n)),[A]);return[y.useCallback(n=>{let{type:r,event:s}=n;A.forEach(a=>{var o;return(o=a[r])==null?void 0:o.call(a,s)})},[A]),e]}const isA={draggable:`
|
|
520
520
|
To pick up a draggable item, press the space bar.
|
|
@@ -1826,7 +1826,7 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
1826
1826
|
post_uuid
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
`),huA=(A,e)=>{if(!A)return null;const t=e.find(r=>r.uuid===A);if(t)return t.uuid;const n=e.find(r=>{if(!r.metadata)return!1;try{return JSON.parse(r.metadata)._original_author_uuid===A}catch{return!1}});return n?n.uuid:null},wuA=(A,e,t)=>{const n=t?huA(A,e):A;if(t&&!n)throw new Error("The selected author is not available for this blog. Please select an author from the Author dropdown.");return{author_uuid:n??void 0}},yuA=({post_uuid:A,post_base_url:e,base_url:t,blog_uuid:n,images_url:r,image_library_uuid:s,user_config:a,authors:o=[],className:l="",from_blog_uuid:c,generateSuggestions:u,slug_pattern:f=/^\/[a-z0-9-]+(?:\/[a-z0-9-]+)+\/[a-z0-9-]+$/i})=>{const[d,g]=y.useState(!1),[v,m]=y.useState(0),[p,h]=y.useState(!1),w=y.useRef([]),[x,b]=y.useState(""),[z,D]=y.useState(""),[M,B]=y.useState([]);y.useEffect(()=>{if(!n||!c){B([]);return}let C=!1;return xn.query({query:Ov,variables:{blog_uuid:n,first:1e3,page:1},fetchPolicy:"network-only"}).then(j=>{var N,V;C||B(((V=(N=j.data)==null?void 0:N.authors)==null?void 0:V.data)||[])}).catch(j=>{C||(console.error("Failed to load target blog authors:",j),B([]))}),()=>{C=!0}},[n,c]);const H=(C,j)=>{if(!f)return!0;if(!f.test(C))return!1;const N=j.startsWith("/")?j:`/${j}`;return C.toLowerCase().startsWith(`${N}/`.toLowerCase())},k=C=>{var AA,eA,U,_,gA,uA,DA,YA;let j={},N={};const V={},I={},{categorySlug:W,articleSlug:nA}=ib(C.slug);b(W||""),D((AA=C.category)==null?void 0:AA.uuid),m(C.status);try{const bA=JSON.parse((C==null?void 0:C.metadata)||"{}");j=bA.utmGenerator,I.meta_remove_from_snap_rss=(bA==null?void 0:bA.remove_from_snap_rss)||!1,I.meta_websiteUrl=j==null?void 0:j.websiteUrl,I.meta_campaignSource=j==null?void 0:j.campaignSource,I.meta_campaignMedium=j==null?void 0:j.campaignMedium,I.meta_campaignName=j==null?void 0:j.campaignName,I.meta_campaignId=j==null?void 0:j.campaignId,I.meta_campaignContent=j==null?void 0:j.campaignContent}catch(bA){console.log(bA)}try{N=JSON.parse((C==null?void 0:C.featured_image)||"{}")}catch(bA){console.log(bA)}try{const bA=C.postConfig,Oe=Ul.fromRecord(JSON.parse((bA==null?void 0:bA.social_preview_config)||"{}"));V.is_feature_article=(bA==null?void 0:bA.is_feature_article)??!1,V.is_in_sitemap=(bA==null?void 0:bA.is_in_sitemap)??!1,V.exclude_from_msn_feed=(bA==null?void 0:bA.exclude_from_msn_feed)??!1,[Oe.open_graph,Oe.twitter_cards,Oe.seo_cards].forEach(ne=>{ne&&Object.entries(ne).map(([L,$])=>{try{V[L]=JSON.parse($)}catch(F){console.log(F),V[L]=$}})})}catch(bA){console.log(bA)}C.slug&&g(!0),C.excerpt&&h(!0);const Q=(eA=C.category)!=null&&eA.parent?(U=C.category)==null?void 0:U.parent:C.category,tA=((_=C.faqs)==null?void 0:_.map(bA=>({id:bA.uuid,uuid:bA.uuid,question:bA.question,answer:bA.answer})))||[];return w.current=tA,{...C,faqs:tA,author:{label:(gA=C==null?void 0:C.author)==null?void 0:gA.name,value:(uA=C==null?void 0:C.author)==null?void 0:uA.uuid},seo_status:{value:(C==null?void 0:C.seo_status)||"indexed"},slug:nA,featured_image:N,published_at:Y(C.published_at),category:{value:Q==null?void 0:Q.uuid,label:Q==null?void 0:Q.name,other:Q==null?void 0:Q.slug,subs:((Q==null?void 0:Q.subCategories)||[]).map(bA=>({value:bA.uuid,label:bA.name,other:bA.slug}))},tags:((YA=(DA=C==null?void 0:C.tags)==null?void 0:DA.map)==null?void 0:YA.call(DA,bA=>({value:bA.uuid,label:bA.name})))||[],...I,...V}},Y=C=>{if(!C)return null;if(C instanceof Date)return Number.isNaN(C.getTime())?null:C;if(typeof C=="number"){const W=new Date(C);return Number.isNaN(W.getTime())?null:W}if(typeof C!="string")return null;const j=C.trim();if(!j)return null;const N=/[zZ]|[+-]\d{2}:?\d{2}$/.test(j),V=j.replace(" ","T")+(N?"":"Z"),I=new Date(V);return Number.isNaN(I.getTime())?null:I},T=C=>{const j=Y(C);return j?j.toISOString().replace("T"," ").substring(0,19):null},S=C=>{var uA,DA,YA,bA,Oe,ne,L;let j,N="{}";const V=C.related_posts||[],I=[];V!=null&&V.length&&V.forEach(($,F)=>$.uuid&&I.push({uuid:$.uuid,position:F}));const W=C.follow_up_posts||[],nA=[];W!=null&&W.length&&W.forEach(($,F)=>$.uuid&&nA.push({uuid:$.uuid,position:F}));try{j=Ul.toRecord(Ul.fromRecord({title:C.title,description:C.description,open_graph:{"og:title":C["og:title"]||C.title,"og:image":JSON.stringify(C["og:image"]||C.featured_image),"og:description":C["og:description"]||C.excerpt},twitter_cards:{"twitter:title":C["twitter:title"]||C.title,"twitter:image":JSON.stringify(C["twitter:image"]||C.featured_image),"twitter:description":C["twitter:description"]||C.excerpt},seo_cards:{"seo:url":C["seo:url"]||C.slug,"seo:title":C["seo:title"]||C.title,"seo:image":JSON.stringify(C["seo:image"]||C.featured_image),"seo:description":C["seo:description"]||C.excerpt}})),N=JSON.stringify(j)}catch($){console.log($)}const Q=C.category,tA=(uA=Q==null?void 0:Q.subs)==null?void 0:uA.find($=>String($.value)===String(z)),AA=(tA==null?void 0:tA.other)||x||(Q==null?void 0:Q.other)||"";let eA=`${AA.startsWith("/")?AA:"/"+AA}`,U=`${eA}/${C.slug}`.toLowerCase();if(C.status==!0&&(H(U,eA)||(eA=`${(((DA=C.category)==null?void 0:DA.other)||"").startsWith("/")?(YA=C.category)==null?void 0:YA.other:"/"+((bA=C.category)==null?void 0:bA.other)}`,U=`${eA}/${C.slug}`),!H(U,eA)))throw new Error(`Invalid article permalink "${U}" for category "${eA}". Please select the correct category to prefill the permalink.`);const _=(Oe=C==null?void 0:C.author)==null?void 0:Oe.value,{author_uuid:gA}=wuA(_,M,c);return{author_uuid:gA,seo_status:(ne=C==null?void 0:C.seo_status)==null?void 0:ne.value,blog_uuid:n,category_uuids:z?[z]:[],tags:(L=C==null?void 0:C.tags)==null?void 0:L.map($=>$.label),content:C.content,excerpt:C.excerpt,featured_image:JSON.stringify(C.featured_image),metadata:JSON.stringify({remove_from_snap_rss:C==null?void 0:C.meta_remove_from_snap_rss,utmGenerator:{websiteUrl:C==null?void 0:C.meta_websiteUrl,campaignSource:C==null?void 0:C.meta_campaignSource,campaignMedium:C==null?void 0:C.meta_campaignMedium,campaignName:C==null?void 0:C.meta_campaignName,campaignId:C==null?void 0:C.meta_campaignId,campaignContent:C==null?void 0:C.meta_campaignContent}}),published_at:T(C.published_at),status:C.status,title:C.title,uuid:C.uuid,slug:`${eA}/${C.slug}`.toLowerCase(),is_featured_article:C.is_feature_article,is_in_sitemap:C.is_in_sitemap,exclude_from_msn_feed:C.exclude_from_msn_feed,related_posts:I,follow_up_posts:nA,social_preview_config:N}},{groups:X,mainForm:q}=guA({blog_uuid:n,image_library_uuid:s,images_url:r,status:v,post_base_url:e,generateSuggestions:u,authors:o,category_slug:x,category_id:z,setCategoryId:D,setCategorySlug:b}),J=/^[a-zA-Z0-9\-_~#[\]()]+$/,G=He({title:vA({message:""}).min(2,"Title should be min of 2 characters"),excerpt:vA({message:""}).min(2,"Min 2"),content:vA({message:""}).min(1,"this field is required"),slug:vA({message:""}).min(1,"This field is required").regex(J,"Invalid slug format. Use letters, numbers, hyphens only"),featured_image:He({url:vA({message:"Featured image URL is required"}).min(1,"Featured image URL is required")},{message:"Featured image is required"}),category:He({value:vA({message:"Category is required"}).min(1,"Category is required")},{message:"Category is required"}),author:He({value:vA({message:"Author is required"}).min(1,"Author is required")},{message:"Author is required"})}),O=y.useCallback(async(C,{uuid:j})=>{var tA,AA;const N=(C.getValues("faqs")||[]).map(eA=>({...eA})),V=w.current,I=[];let W=!1,nA=0;for(const eA of N){try{if(eA.uuid)await xn.mutate({mutation:muA,variables:{uuid:eA.uuid,question:eA.question,answer:eA.answer,position:nA}}),I.push(eA);else{const _=(AA=(tA=(await xn.mutate({mutation:vuA,variables:{post_uuid:j,question:eA.question,answer:eA.answer,position:nA}})).data)==null?void 0:tA.createFaq)==null?void 0:AA.uuid,gA={...eA,id:_||eA.id,uuid:_||eA.id};I.push(gA)}}catch(U){console.error("FAQ sync error:",U),W=!0;break}nA++}if(!W){const eA=new Set(N.map(U=>U.uuid).filter(Boolean));for(const U of V)if(U.uuid&&!eA.has(U.uuid))try{await xn.mutate({mutation:puA,variables:{uuid:U.uuid}})}catch(_){console.error("FAQ delete error:",_)}}const Q=W?[...I,...N.slice(I.length)]:I;C.setValue("faqs",Q,{shouldDirty:W}),w.current=Q},[]),Z=y.useCallback((C,j,N)=>{var tA,AA,eA,U;if(!N)return;const V=N.category,I=N.title||"",W=(tA=N.content||"")==null?void 0:tA.toString(),nA=`${mi(I,{strictMode:!0})}`.toLowerCase(),Q=SE(W,{maxLength:160}).trim();["title","categories","tags"].includes(j)&&!d&&C.setValue("slug",nA),j=="category"&&(b((AA=(V==null?void 0:V.other)||(V==null?void 0:V.label)||"")==null?void 0:AA.toString().toLowerCase().replace(/ /g,"-")),D(V.value)),j=="content"&&!p&&C.setValue("excerpt",Q),j=="excerpt"&&((eA=N.excerpt)==null?void 0:eA.toString())!=Q&&h(!0),j=="slug"&&((U=N.slug)==null?void 0:U.toString())!=nA&&g(!0),j=="status"&&m(N.status)},[d,p]);return i.jsx(qt,{client:xn,children:i.jsx(Yu,{post_uuid:A,className:l,groups:X,mainForm:q,type:"Article",initialState:{formValues:{author:{value:a==null?void 0:a.uuid,label:a==null?void 0:a.name},meta_remove_from_snap_rss:!0,is_in_sitemap:!0,exclude_from_msn_feed:!1,seo_status:{value:"indexed",label:"Indexed"}},isCreate:!!c},validators:G,requiredDraftFields:["title","author"],postQueryConfig:{fetch:{query:c?BiA:DiA,variables:{blog_uuid:c||n},dataKey:"post",cacheKey:"post"},update:{query:CiA,dataKey:"updatePost",mutationInvalidateKey:"posts"},create:{query:MiA,dataKey:"createPost",mutationInvalidateKey:"posts"}},submitFieldsMapper:S,formFieldsMapper:k,postBaseUrl:e,baseUrl:t,onChange:Z,onAfterSave:O,autoSave:!0,showSchedule:!0,user_config:a})})},PuA=({post_base_url:A,base_url:e,user_config:t})=>{const[n,r]=y.useState(""),[s,a]=y.useState({url:void 0}),[o,l]=y.useState(!1),c=Lj(A,t),u=He({url:vA({message:"*"}).min(1,"this field is required").url("should be a valid url")}),f=g=>{var v;try{r(g.toString());const m=u.safeParse({url:n});m.success?a({url:void 0}):a({url:{message:((v=m.error.errors[0])==null?void 0:v.message)||"Invalid input",type:""}})}catch(m){console.log(m)}},d=async()=>{var g,v,m;try{const p=u.safeParse({url:n}),h=(g=URL.parse(n))==null?void 0:g.pathname;if(l(!0),p.success)a({url:void 0}),await(c==null?void 0:c(h,!1,"Triggered by clear page cache",!0)),r("");else{a({url:{message:((m=(v=p==null?void 0:p.error)==null?void 0:v.errors[0])==null?void 0:m.message)||"Invalid input",type:""}});return}}catch(p){console.error("Cache revalidation error:",p),l(!1)}finally{l(!1)}};return i.jsxs("div",{className:E("flex flex-col items-start justify-between gap-5 p-4 pb-0 max-w-4xl",{}),"data-testid":"main-form",children:[i.jsx("h1",{className:E("text-3xl font-bold font-[UniversalFeature] !m-0",{}),children:"Clear Cache"}),i.jsx("div",{className:"w-full flex items-center justify-between flex-wrap gap-2 ",children:i.jsx(_9,{url:e,pageTitle:"Clear Cache"})}),i.jsxs("div",{className:"flex items-center justify-between bg-accent/50 gap-2 p-4 rounded",children:[i.jsx(erA,{className:"text-xl"}),i.jsx("p",{className:"flex-1 text-sm",children:"By clearing the cache for a specific page, you're ensuring that the most recent updates such as content edits are immediately visible to your website audience."})]}),i.jsx(tt,{value:n,label:"Target Url",onChange:f,type:"input",error:s.url}),i.jsx("div",{className:E("flex gap-4 w-full justify-end "),children:i.jsxs(ge,{className:E(" p-4 waz_shadow font-bold text-[#101828] text-base px-4 gap-1",{}),disabled:o,onClick:d,children:["Clear Cache",o?i.jsx(wi,{className:"animate-spin"}):""]})})]})},xuA=A=>i.jsx(Yi,{children:i.jsx(qt,{client:xn,children:i.jsx(PuA,{...A})})});function buA({post_base_url:A}){return[{accessorKey:"source",header:"URL",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,n=`${A}/${t==null?void 0:t.source}`;return i.jsx("a",{className:"text-sm hover:underline cursor-pointer line-clamp-3 block",href:n,target:"_blank",rel:"noopener noreferrer",children:n})}},{accessorKey:"user",header:"Cleared By",cell:({row:e})=>{var n;const t=e.original;return i.jsx("div",{className:E("min-w-50",{"opacity-40":t.status==0}),children:i.jsx("p",{className:"text-sm ",children:(n=t.user)==null?void 0:n.name})})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:e})=>{const t=e.original,n=new Re("en-US");return i.jsx("div",{className:E("text-sm min-w-20",{"opacity-40":t.status==0}),children:n.format(new Date(t.updated_at))})}},{accessorKey:"type",header:"Status",cell:({row:e})=>{const t=e.original;return i.jsx("div",{className:E("min-w-30",{"opacity-40":t.status==0}),children:t.type=="Permanent"?i.jsx(Je,{variant:"outline",className:"border-[#229954] text-[#229954]",children:"Successful"}):i.jsx(Je,{variant:"outline",className:"border-destructive text-destructive",children:"Failed"})})}}]}const zuA=[{id:"created_at",label:"Created Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})},{id:"updated_at",label:"Updated Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})},{id:"published_at",label:"Published Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})}];Ie.ALL;const DuA=({post_base_url:A,site_uuid:e})=>{const t=buA({post_base_url:A});return i.jsx(hn,{postType:"Cache History",postTypeSng:"Redirect",showCTA:!1,columns:t,queryConfig:{fetch:{query:O6,variables:{site:e,include_drafts:!0},dataKey:"redirects"},delete:{query:T6,variables:{site_uuid:e,include_drafts:!0},dataKey:"redirects"}},toggleView:!1,filterFields:zuA,tableRowHeight:90,rootClassName:"h-full"})},BuA=({score:A,size:e=120})=>{const r=.75+A/100*.3999999999999999,s=Math.round(e*r),a=s/2,o=(s-30)/2,l=2*Math.PI*o,c=Math.round(28*r),u=l-A/100*l,f=Math.round(12*r),d=l-(100-A)/100*l,g=A/100*360,v=A>=70?"#22c55e":A>=40?"#f59e0b":"#ef4444";return i.jsxs("div",{className:"relative flex items-center justify-center",style:{width:s,height:s},children:[i.jsxs("svg",{width:s,height:s,children:[i.jsx("circle",{cx:a,cy:a,r:o,fill:"none",stroke:"#d1d5db",strokeWidth:f,strokeDasharray:l,strokeDashoffset:d,strokeLinecap:"butt",transform:`rotate(${-90+g} ${a} ${a})`}),i.jsx("circle",{cx:a,cy:a,r:o,fill:"none",stroke:v,strokeWidth:c,strokeDasharray:l,strokeDashoffset:u,strokeLinecap:"butt",transform:`rotate(-90 ${a} ${a})`,style:{transition:"stroke-dashoffset 0.6s ease"}})]}),i.jsxs("span",{className:"absolute text-2xl font-bold text-foreground",children:[A,"%"]})]})},MuA=({severity:A})=>{const e={high:{label:"High",className:"bg-red-100 text-red-700 border-red-200",dot:"bg-red-500"},medium:{label:"Medium",className:"bg-amber-100 text-amber-700 border-amber-200",dot:"bg-amber-500"},low:{label:"Low",className:"bg-amber-100 text-amber-700 border-amber-200",dot:"bg-amber-500"}},{label:t,className:n,dot:r}=e[A];return i.jsxs(Je,{variant:"outline",className:E("inline-flex items-center gap-1.5 text-[10px] uppercase font-bold",n),children:[i.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",r)}),t]})},ux=({status:A,label:e})=>{const t={good:{defaultLabel:"Good",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},warning:{defaultLabel:"Partial",bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500"},bad:{defaultLabel:"Missing",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"},missing:{defaultLabel:"Missing",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}}[A];return i.jsxs("span",{className:E("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium",t.bg,t.text),children:[i.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",t.dot)}),e??t.defaultLabel]})},CuA=({status:A})=>A==="good"?i.jsx(Gs,{size:14,className:"text-green-500",strokeWidth:3}):A==="warning"?i.jsx(Jh,{size:14,className:"text-amber-500"}):i.jsx(ss,{size:14,className:"text-red-500",strokeWidth:3}),S6=()=>{const{form:A}=kr(),[e,t]=y.useState(!1),[n,r]=y.useState(new Set),[s,a]=y.useState(null),o=y.useCallback(()=>{const w=A.getValues();return{title:w.title||"",content:w.body||w.content||"",excerpt:w.excerpt||"",seoTitle:w["seo:title"]||"",seoDescription:w["seo:description"]||"",slug:w.slug||""}},[A]),l=y.useCallback(()=>{const{title:w,content:x,excerpt:b,seoTitle:z,seoDescription:D,slug:M}=o(),B=z||w||"",H=D||b||"",k=(x||"").replace(/<[^>]*>/g," "),Y=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","must","shall","can","need","dare","ought","used","to","of","in","for","on","with","at","by","from","as","into","through","during","before","after","above","below","between","under","and","but","or","yet","so","if","because","although","though","while","where","when","that","which","who","whom","whose","what","this","these","those","i","me","my","myself","we","our","ours","ourselves","you","your","yours","yourself","yourselves","he","him","his","himself","she","her","hers","herself","it","its","itself","they","them","their","theirs","themselves","what","which","who","whom","this","that","these","those","am","it","its","s","t","just","don","now"]),T=k.toLowerCase().replace(/[^a-z0-9\s]/g,"").split(/\s+/).filter(F=>F.length>3&&!Y.has(F)),S={};T.forEach(F=>S[F]=(S[F]||0)+1);const X=Object.entries(S).sort((F,aA)=>aA[1]-F[1]).slice(0,4).map(([F])=>F);let q=0,J=!1;if(X.length>0){J=X.some(iA=>B.toLowerCase().includes(iA));const F=X.some(iA=>H.toLowerCase().includes(iA)),aA=X.some(iA=>k.toLowerCase().includes(iA)),lA=(x.match(/<h2[^>]*>/gi)||[]).filter(iA=>X.some(fA=>iA.toLowerCase().includes(fA))).length;q=Math.min(100,Math.round((J?30:0)+(F?20:0)+(aA?25:0)+Math.min(lA*10,25)))}const G=B.length,O=H.length,Z=x.match(/<img[^>]*>/gi)||[],C=Z.filter(F=>F.includes("alt=")).length,j=M.length>0,N=Math.min(100,Math.round((G>=30&&G<=60?30:G>0?15:0)+(O>=120&&O<=155?25:O>0?10:0)+(Z.length>0?C/Z.length*25:10)+(j?20:0))),V=(x.match(/<h1[^>]*>/gi)||[]).length,I=(x.match(/<h2[^>]*>/gi)||[]).length,W=(x.match(/<h3[^>]*>/gi)||[]).length,nA=(x.match(/<h4[^>]*>/gi)||[]).length,tA=(x.match(/<h[2-6][^>]*>/gi)||[]).map(F=>{var aA;return parseInt(((aA=F.match(/<h([2-6])/i))==null?void 0:aA[1])||"0",10)});let AA=!0,eA=1;for(const F of tA){if(F>eA+1){AA=!1;break}eA=F}tA.length===0&&(AA=!1);const U=k.split(/\s+/).filter(Boolean).length,_=(x.match(/href="\//gi)||[]).length,gA=Math.min(100,Math.round((V===0&&AA?25:V===0?15:0)+(I>=2?25:I>0?15:0)+(U>=300?25:U>=100?15:5)+Math.min(_*10,25))),uA=(x.match(/href="https?:\/\//gi)||[]).length,DA=Math.min(100,Math.round(_*15+uA*10)),YA=Math.round((q+N+gA+DA)/4),bA=[{label:"Keyword",score:q,color:"#f97316"},{label:"On-page",score:N,color:"#3b82f6"},{label:"Structure",score:gA,color:"#ec4899"},{label:"Linking",score:DA,color:"#22c55e"}],Oe=(()=>{if(X.length===0)return"0%";const F=k.toLowerCase();return`${(X.reduce((lA,iA)=>lA+(F.match(new RegExp(iA,"g"))||[]).length,0)/Math.max(T.length,1)*100).toFixed(2)}%`})(),ne=(()=>{if(X.length===0)return"warning";const F=k.toLowerCase(),lA=X.reduce((iA,fA)=>iA+(F.match(new RegExp(fA,"g"))||[]).length,0)/Math.max(T.length,1);return lA>=.01&&lA<=.03?"good":lA<.01?"warning":"bad"})(),L=[{id:"keywords",title:"Keywords usage",items:[{label:"Primary keyword in title",value:"",status:J?"good":"missing"},{label:"Keyword in intro (first 600 characters)",value:"",status:X.some(F=>k.slice(0,600).toLowerCase().includes(F))?"good":"missing"},{label:"Keyword density",value:Oe,status:ne},{label:"Meta description contains keyword",value:"",status:X.some(F=>H.toLowerCase().includes(F))?"good":"warning"}]},{id:"onpage",title:"On-page elements",items:[{label:"Meta title length",value:`${G} characters`,status:G>=30&&G<=75?"good":G>75?"warning":"bad",showValueWithDot:!0},{label:"Meta description length",value:`${O} characters`,status:O>=120&&O<=160?"good":O>160?"warning":"bad",showValueWithDot:!0},{label:"Canonical URL set",value:"",status:j?"good":"warning",badgeLabel:j?"Set":"Missing"}]},{id:"structure",title:"Structure",items:[{label:`Heading hierarchy (${[I&&"H2",W&&"H3",nA&&"H4"].filter(Boolean).join(", ")||"none"})`,value:"",status:V===0&&AA&&I>=1?"good":I>0?"warning":"bad",badgeLabel:V===0&&AA&&I>=1?"Good":"Missing"},{label:"Slug quality",value:j?M:"Missing",status:j&&M.length<60?"good":j?"warning":"bad",showValueWithDot:!0},{label:"Content length for SEO",value:`${U.toLocaleString()} words`,status:U>=300?"good":U>=100?"warning":"bad",showValueWithDot:!0}]},{id:"linking",title:"Linking",items:[{label:"Internal links",value:`${_} found`,status:_>0?"good":"warning",showValueWithDot:!0},{label:"External links",value:`${uA} found`,status:uA>0?"good":"warning",showValueWithDot:!0},{label:"Image alt text coverage",value:`${C}/${Z.length}`,status:Z.length>0&&C===Z.length?"good":"warning",showValueWithDot:!0}]}],$=[];return!J&&X[0]&&$.push({id:"1",title:"Target keyword missing from title",description:`"${X[0]}" does not appear in the article title. This is the strongest on-page signal for ranking.`,severity:"high",suggestion:`Add "${X[0]}" within the first 60 characters of the title.`}),(G<30||G>75)&&$.push({id:"2",title:"Title length suboptimal",description:`Your title is ${G} characters. Ideal length is 30–60 characters for full display in search results.`,severity:"medium",suggestion:"Aim for 30–60 characters to avoid truncation in SERPs."}),(O<120||O>160)&&$.push({id:"3",title:"Meta description length issue",description:`Your meta description is ${O} characters. Recommended length is 120–155 characters.`,severity:"medium",suggestion:"Write a compelling description between 120–155 characters."}),U<300&&$.push({id:"4",title:"Content too short",description:`Your article has only ${U} words. Thin content struggles to rank competitively.`,severity:"high",suggestion:"Expand to at least 300+ words with valuable, original content."}),Z.length>0&&C<Z.length&&$.push({id:"5",title:"Missing image alt text",description:`${Z.length-C} image(s) lack alt text, hurting accessibility and image SEO.`,severity:"low",suggestion:"Add descriptive alt text to all images."}),V>0&&$.push({id:"6",title:"H1 heading in article body",description:`Found ${V} H1 heading(s) in the article body. The blog page already renders the article title as H1, so the body should use H2-H6 only.`,severity:"medium",suggestion:"Replace H1 tags with H2 tags in the article body."}),{overallScore:YA,categories:bA,targetKeywords:X,metrics:L,issues:$}},[o]),c=y.useCallback(()=>{t(!0),setTimeout(()=>{try{const w=l();a(w)}catch(w){console.error("SEO analysis error:",w),a({overallScore:0,categories:[],targetKeywords:[],metrics:[],issues:[]})}finally{t(!1)}},100)},[l]);y.useEffect(()=>{c()},[]);const u=A.watch("title"),f=A.watch("body")||A.watch("content"),d=A.watch("excerpt"),g=A.watch("seo:title"),v=A.watch("seo:description"),m=A.watch("slug"),p=y.useRef(null);y.useEffect(()=>(p.current&&clearTimeout(p.current),s&&(p.current=setTimeout(()=>{c()},400)),()=>{p.current&&clearTimeout(p.current)}),[u,f,d,g,v,m]);const h=w=>{r(x=>{const b=new Set(x);return b.has(w)?b.delete(w):b.add(w),b})};return s?i.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Overall SEO score"}),i.jsxs(pA,{variant:"outline",size:"sm",className:"rounded-[4px] border border-primary text-secondary-foreground hover:bg-primary text-[12px] font-medium leading-[26px] px-2 py-1 min-h-[26px] gap-[6px]",onClick:c,disabled:e,children:[i.jsx(rd,{size:13,className:E(e&&"animate-spin","text-secondary-foreground")}),"Re-run"]})]}),i.jsxs("div",{className:"flex items-center gap-6 border-[.5px] border-[#E8E8E8] bg-muted rounded-[4px] py-[16px] pl-[30px] pr-[16px]",children:[i.jsx(BuA,{score:s.overallScore}),i.jsx("div",{className:"flex-1 flex flex-col gap-2.5",children:s.categories.map(w=>i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex justify-between text-[12px] font-medium text-[#28434F]",children:[i.jsx("span",{children:w.label}),i.jsxs("span",{className:"font-semibold text-[#000000E5]",children:[w.score,"%"]})]}),i.jsx("div",{className:"h-[3px] w-full rounded-full bg-[#EBEBEB] overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${w.score}%`,backgroundColor:w.color}})})]},w.label))})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Target keywords"}),i.jsx("div",{className:"flex flex-wrap bg-muted p-3 border-[#E8E8E8] border-[.5px] rounded-[4px] gap-3",children:s.targetKeywords.length>0?s.targetKeywords.map(w=>i.jsx(Je,{variant:"outline",className:"rounded-full gap-2 px-3 py-[2px] text-[12px] font-medium leading-[21px] border-[#5969702E] text-[#212529]",children:w},w)):i.jsx("span",{className:"text-xs text-[#252525]",children:"No keywords detected yet."})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Metrics"}),s.metrics.map(w=>{const x=n.has(w.id);return i.jsxs(Jz,{open:x,onOpenChange:()=>h(w.id),children:[i.jsx(Rz,{asChild:!0,children:i.jsxs("button",{className:E("flex items-center justify-between w-full py-2 px-3 transition-colors text-left",x?"bg-primary/30 rounded-tl-[4px] rounded-tr-[4px]":"bg-muted border border-[#E8E8E8] hover:bg-primary/10 rounded-[4px]"),children:[i.jsxs("span",{className:"flex items-center gap-[6px] text-[14px] font-medium leading-[26px] text-[#252525]",children:[i.jsx(Lh,{size:10,className:"transition-transform duration-200",fill:"currentColor",style:{color:w.items.every(b=>b.status==="good")?"#22c55e":w.items.some(b=>b.status==="bad"||b.status==="missing")?"#ef4444":"#f59e0b"}}),w.title]}),x?i.jsx(Wc,{size:22,className:"text-[#1E1E1E]"}):i.jsx(co,{size:22,className:"text-[#1E1E1E]"})]})}),i.jsx(Fz,{children:i.jsx("div",{className:"flex flex-col border border-t-0 border-[#E8E8E8] rounded-b-md -mt-1",children:w.items.map((b,z)=>i.jsxs("div",{className:E("flex items-center justify-between text-[12px] py-3 px-3 font-medium leading-[22px]",z!==w.items.length-1&&"border-b border-[#E8E8E8]"),children:[i.jsx("span",{className:"text-[#242424]",children:b.label}),i.jsx("span",{className:"flex items-center gap-2 font-medium text-foreground",children:b.showValueWithDot?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#252525] font-semibold",children:b.value}),i.jsx(CuA,{status:b.status})]}):b.value?i.jsx("span",{className:"text-[#252525]",children:b.value}):i.jsx(ux,{status:b.status,label:b.badgeLabel})})]},z))})})]},w.id)})]}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Issues to fix"}),s.issues.length===0?i.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 bg-green-50 rounded-lg p-3",children:[i.jsx(ux,{status:"good"}),"No issues found — great job!"]}):s.issues.map(w=>i.jsxs("div",{className:"flex flex-col gap-2 rounded-[4px] border-[.5px] border-[#E8E8E8] bg-muted p-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-[14px] font-medium leading-[26px] text-[#0F0F0F]",children:w.title}),i.jsx(MuA,{severity:w.severity})]}),i.jsx("p",{className:"text-[14px] text-[#525252] leading-[22px]",children:w.description}),i.jsxs("div",{className:"flex items-center rounded-[4px] bg-[#EFF6FF] py-[6px] px-3 gap-[10px] mt-1 border border-[#2787FF4D]",children:[i.jsx(dg,{size:16,color:"#2787FF",className:"shrink-0"}),i.jsx("p",{className:"text-[12px] text-left font-medium text-[#0F0F0F] leading-[18px]",children:w.suggestion})]})]},w.id))]})]}):i.jsxs("div",{className:"flex items-center justify-center h-40 text-[#252525]",children:[i.jsx(rd,{className:"animate-spin mr-2 text-primary",size:18}),"Analysing SEO…"]})},juA=dA`
|
|
1829
|
+
`),huA=(A,e)=>{if(!A)return null;const t=e.find(r=>r.uuid===A);if(t)return t.uuid;const n=e.find(r=>{if(!r.metadata)return!1;try{return JSON.parse(r.metadata)._original_author_uuid===A}catch{return!1}});return n?n.uuid:null},wuA=(A,e,t)=>{const n=t?huA(A,e):A;if(t&&!n)throw new Error("The selected author is not available for this blog. Please select an author from the Author dropdown.");return{author_uuid:n??void 0}},yuA=({post_uuid:A,post_base_url:e,base_url:t,blog_uuid:n,images_url:r,image_library_uuid:s,user_config:a,authors:o=[],className:l="",from_blog_uuid:c,generateSuggestions:u,slug_pattern:f=/^\/[a-z0-9-]+(?:\/[a-z0-9-]+)+\/[a-z0-9-]+$/i})=>{const[d,g]=y.useState(!1),[v,m]=y.useState(0),[p,h]=y.useState(!1),w=y.useRef([]),[x,b]=y.useState(""),[z,D]=y.useState(""),[M,B]=y.useState([]);y.useEffect(()=>{if(!n||!c){B([]);return}let C=!1;return xn.query({query:Ov,variables:{blog_uuid:n,first:1e3,page:1},fetchPolicy:"network-only"}).then(j=>{var N,V;C||B(((V=(N=j.data)==null?void 0:N.authors)==null?void 0:V.data)||[])}).catch(j=>{C||(console.error("Failed to load target blog authors:",j),B([]))}),()=>{C=!0}},[n,c]);const H=(C,j)=>{if(!f)return!0;if(!f.test(C))return!1;const N=j.startsWith("/")?j:`/${j}`;return C.toLowerCase().startsWith(`${N}/`.toLowerCase())},k=C=>{var AA,eA,U,_,gA,uA,DA,YA;let j={},N={};const V={},I={},{categorySlug:W,articleSlug:nA}=ib(C.slug);b(W||""),D((AA=C.category)==null?void 0:AA.uuid),m(C.status);try{const bA=JSON.parse((C==null?void 0:C.metadata)||"{}");j=bA.utmGenerator,I.meta_remove_from_snap_rss=(bA==null?void 0:bA.remove_from_snap_rss)||!1,I.meta_websiteUrl=j==null?void 0:j.websiteUrl,I.meta_campaignSource=j==null?void 0:j.campaignSource,I.meta_campaignMedium=j==null?void 0:j.campaignMedium,I.meta_campaignName=j==null?void 0:j.campaignName,I.meta_campaignId=j==null?void 0:j.campaignId,I.meta_campaignContent=j==null?void 0:j.campaignContent}catch(bA){console.log(bA)}try{N=JSON.parse((C==null?void 0:C.featured_image)||"{}")}catch(bA){console.log(bA)}try{const bA=C.postConfig,Oe=Ul.fromRecord(JSON.parse((bA==null?void 0:bA.social_preview_config)||"{}"));V.is_feature_article=(bA==null?void 0:bA.is_feature_article)??!1,V.is_in_sitemap=(bA==null?void 0:bA.is_in_sitemap)??!1,V.exclude_from_msn_feed=(bA==null?void 0:bA.exclude_from_msn_feed)??!1,[Oe.open_graph,Oe.twitter_cards,Oe.seo_cards].forEach(ne=>{ne&&Object.entries(ne).map(([L,$])=>{try{V[L]=JSON.parse($)}catch(F){console.log(F),V[L]=$}})})}catch(bA){console.log(bA)}C.slug&&g(!0),C.excerpt&&h(!0);const Q=(eA=C.category)!=null&&eA.parent?(U=C.category)==null?void 0:U.parent:C.category,tA=((_=C.faqs)==null?void 0:_.map(bA=>({id:bA.uuid,uuid:bA.uuid,question:bA.question,answer:bA.answer})))||[];return w.current=tA,{...C,faqs:tA,author:{label:(gA=C==null?void 0:C.author)==null?void 0:gA.name,value:(uA=C==null?void 0:C.author)==null?void 0:uA.uuid},seo_status:{value:(C==null?void 0:C.seo_status)||"indexed"},slug:nA,featured_image:N,published_at:Y(C.published_at),category:{value:Q==null?void 0:Q.uuid,label:Q==null?void 0:Q.name,other:Q==null?void 0:Q.slug,subs:((Q==null?void 0:Q.subCategories)||[]).map(bA=>({value:bA.uuid,label:bA.name,other:bA.slug}))},tags:((YA=(DA=C==null?void 0:C.tags)==null?void 0:DA.map)==null?void 0:YA.call(DA,bA=>({value:bA.uuid,label:bA.name})))||[],...I,...V}},Y=C=>{if(!C)return null;if(C instanceof Date)return Number.isNaN(C.getTime())?null:C;if(typeof C=="number"){const W=new Date(C);return Number.isNaN(W.getTime())?null:W}if(typeof C!="string")return null;const j=C.trim();if(!j)return null;const N=/[zZ]|[+-]\d{2}:?\d{2}$/.test(j),V=j.replace(" ","T")+(N?"":"Z"),I=new Date(V);return Number.isNaN(I.getTime())?null:I},T=C=>{const j=Y(C);return j?j.toISOString().replace("T"," ").substring(0,19):null},S=C=>{var uA,DA,YA,bA,Oe,ne,L;let j,N="{}";const V=C.related_posts||[],I=[];V!=null&&V.length&&V.forEach(($,F)=>$.uuid&&I.push({uuid:$.uuid,position:F}));const W=C.follow_up_posts||[],nA=[];W!=null&&W.length&&W.forEach(($,F)=>$.uuid&&nA.push({uuid:$.uuid,position:F}));try{j=Ul.toRecord(Ul.fromRecord({title:C.title,description:C.description,open_graph:{"og:title":C["og:title"]||C.title,"og:image":JSON.stringify(C["og:image"]||C.featured_image),"og:description":C["og:description"]||C.excerpt},twitter_cards:{"twitter:title":C["twitter:title"]||C.title,"twitter:image":JSON.stringify(C["twitter:image"]||C.featured_image),"twitter:description":C["twitter:description"]||C.excerpt},seo_cards:{"seo:url":C["seo:url"]||C.slug,"seo:title":C["seo:title"]||C.title,"seo:image":JSON.stringify(C["seo:image"]||C.featured_image),"seo:description":C["seo:description"]||C.excerpt}})),N=JSON.stringify(j)}catch($){console.log($)}const Q=C.category,tA=(uA=Q==null?void 0:Q.subs)==null?void 0:uA.find($=>String($.value)===String(z)),AA=(tA==null?void 0:tA.other)||x||(Q==null?void 0:Q.other)||"";let eA=`${AA.startsWith("/")?AA:"/"+AA}`,U=`${eA}/${C.slug}`.toLowerCase();if(C.status==!0&&(H(U,eA)||(eA=`${(((DA=C.category)==null?void 0:DA.other)||"").startsWith("/")?(YA=C.category)==null?void 0:YA.other:"/"+((bA=C.category)==null?void 0:bA.other)}`,U=`${eA}/${C.slug}`),!H(U,eA)))throw new Error(`Invalid article permalink "${U}" for category "${eA}". Please select the correct category to prefill the permalink.`);const _=(Oe=C==null?void 0:C.author)==null?void 0:Oe.value,{author_uuid:gA}=wuA(_,M,c);return{author_uuid:gA,seo_status:(ne=C==null?void 0:C.seo_status)==null?void 0:ne.value,blog_uuid:n,category_uuids:z?[z]:[],tags:(L=C==null?void 0:C.tags)==null?void 0:L.map($=>$.label),content:C.content,excerpt:C.excerpt,featured_image:JSON.stringify(C.featured_image),metadata:JSON.stringify({remove_from_snap_rss:C==null?void 0:C.meta_remove_from_snap_rss,utmGenerator:{websiteUrl:C==null?void 0:C.meta_websiteUrl,campaignSource:C==null?void 0:C.meta_campaignSource,campaignMedium:C==null?void 0:C.meta_campaignMedium,campaignName:C==null?void 0:C.meta_campaignName,campaignId:C==null?void 0:C.meta_campaignId,campaignContent:C==null?void 0:C.meta_campaignContent}}),published_at:T(C.published_at),status:C.status,title:C.title,uuid:C.uuid,slug:`${eA}/${C.slug}`.toLowerCase(),is_featured_article:C.is_feature_article,is_in_sitemap:C.is_in_sitemap,exclude_from_msn_feed:C.exclude_from_msn_feed,related_posts:I,follow_up_posts:nA,social_preview_config:N}},{groups:X,mainForm:q}=guA({blog_uuid:n,image_library_uuid:s,images_url:r,status:v,post_base_url:e,generateSuggestions:u,authors:o,category_slug:x,category_id:z,setCategoryId:D,setCategorySlug:b}),J=/^[a-zA-Z0-9\-_~#[\]()]+$/,G=He({title:vA({message:""}).min(2,"Title should be min of 2 characters"),excerpt:vA({message:""}).min(2,"Min 2"),content:vA({message:""}).min(1,"this field is required"),slug:vA({message:""}).min(1,"This field is required").regex(J,"Invalid slug format. Use letters, numbers, hyphens only"),featured_image:He({url:vA({message:"Featured image URL is required"}).min(1,"Featured image URL is required")},{message:"Featured image is required"}),category:He({value:vA({message:"Category is required"}).min(1,"Category is required")},{message:"Category is required"}),author:He({value:vA({message:"Author is required"}).min(1,"Author is required")},{message:"Author is required"})}),O=y.useCallback(async(C,{uuid:j})=>{var tA,AA;const N=(C.getValues("faqs")||[]).map(eA=>({...eA})),V=w.current,I=[];let W=!1,nA=0;for(const eA of N){try{if(eA.uuid)await xn.mutate({mutation:muA,variables:{uuid:eA.uuid,question:eA.question,answer:eA.answer,position:nA}}),I.push(eA);else{const _=(AA=(tA=(await xn.mutate({mutation:vuA,variables:{post_uuid:j,question:eA.question,answer:eA.answer,position:nA}})).data)==null?void 0:tA.createFaq)==null?void 0:AA.uuid,gA={...eA,id:_||eA.id,uuid:_||eA.id};I.push(gA)}}catch(U){console.error("FAQ sync error:",U),W=!0;break}nA++}if(!W){const eA=new Set(N.map(U=>U.uuid).filter(Boolean));for(const U of V)if(U.uuid&&!eA.has(U.uuid))try{await xn.mutate({mutation:puA,variables:{uuid:U.uuid}})}catch(_){console.error("FAQ delete error:",_)}}const Q=W?[...I,...N.slice(I.length)]:I;C.setValue("faqs",Q,{shouldDirty:W}),w.current=Q},[]),Z=y.useCallback((C,j,N)=>{var tA,AA,eA,U;if(!N)return;const V=N.category,I=N.title||"",W=(tA=N.content||"")==null?void 0:tA.toString(),nA=`${mi(I,{strictMode:!0})}`.toLowerCase(),Q=SE(W,{maxLength:160}).trim();["title","categories","tags"].includes(j)&&!d&&C.setValue("slug",nA),j=="category"&&(b((AA=(V==null?void 0:V.other)||(V==null?void 0:V.label)||"")==null?void 0:AA.toString().toLowerCase().replace(/ /g,"-")),D(V.value)),j=="content"&&!p&&C.setValue("excerpt",Q),j=="excerpt"&&((eA=N.excerpt)==null?void 0:eA.toString())!=Q&&h(!0),j=="slug"&&((U=N.slug)==null?void 0:U.toString())!=nA&&g(!0),j=="status"&&m(N.status)},[d,p]);return i.jsx(qt,{client:xn,children:i.jsx(Yu,{post_uuid:A,className:l,groups:X,mainForm:q,type:"Article",initialState:{formValues:{author:{value:a==null?void 0:a.uuid,label:a==null?void 0:a.name},meta_remove_from_snap_rss:!0,is_in_sitemap:!0,exclude_from_msn_feed:!0,seo_status:{value:"indexed",label:"Indexed"}},isCreate:!!c},validators:G,requiredDraftFields:["title","author"],postQueryConfig:{fetch:{query:c?BiA:DiA,variables:{blog_uuid:c||n},dataKey:"post",cacheKey:"post"},update:{query:CiA,dataKey:"updatePost",mutationInvalidateKey:"posts"},create:{query:MiA,dataKey:"createPost",mutationInvalidateKey:"posts"}},submitFieldsMapper:S,formFieldsMapper:k,postBaseUrl:e,baseUrl:t,onChange:Z,onAfterSave:O,autoSave:!0,showSchedule:!0,user_config:a})})},PuA=({post_base_url:A,base_url:e,user_config:t})=>{const[n,r]=y.useState(""),[s,a]=y.useState({url:void 0}),[o,l]=y.useState(!1),c=Lj(A,t),u=He({url:vA({message:"*"}).min(1,"this field is required").url("should be a valid url")}),f=g=>{var v;try{r(g.toString());const m=u.safeParse({url:n});m.success?a({url:void 0}):a({url:{message:((v=m.error.errors[0])==null?void 0:v.message)||"Invalid input",type:""}})}catch(m){console.log(m)}},d=async()=>{var g,v,m;try{const p=u.safeParse({url:n}),h=(g=URL.parse(n))==null?void 0:g.pathname;if(l(!0),p.success)a({url:void 0}),await(c==null?void 0:c(h,!1,"Triggered by clear page cache",!0)),r("");else{a({url:{message:((m=(v=p==null?void 0:p.error)==null?void 0:v.errors[0])==null?void 0:m.message)||"Invalid input",type:""}});return}}catch(p){console.error("Cache revalidation error:",p),l(!1)}finally{l(!1)}};return i.jsxs("div",{className:E("flex flex-col items-start justify-between gap-5 p-4 pb-0 max-w-4xl",{}),"data-testid":"main-form",children:[i.jsx("h1",{className:E("text-3xl font-bold font-[UniversalFeature] !m-0",{}),children:"Clear Cache"}),i.jsx("div",{className:"w-full flex items-center justify-between flex-wrap gap-2 ",children:i.jsx(_9,{url:e,pageTitle:"Clear Cache"})}),i.jsxs("div",{className:"flex items-center justify-between bg-accent/50 gap-2 p-4 rounded",children:[i.jsx(erA,{className:"text-xl"}),i.jsx("p",{className:"flex-1 text-sm",children:"By clearing the cache for a specific page, you're ensuring that the most recent updates such as content edits are immediately visible to your website audience."})]}),i.jsx(tt,{value:n,label:"Target Url",onChange:f,type:"input",error:s.url}),i.jsx("div",{className:E("flex gap-4 w-full justify-end "),children:i.jsxs(ge,{className:E(" p-4 waz_shadow font-bold text-[#101828] text-base px-4 gap-1",{}),disabled:o,onClick:d,children:["Clear Cache",o?i.jsx(wi,{className:"animate-spin"}):""]})})]})},xuA=A=>i.jsx(Yi,{children:i.jsx(qt,{client:xn,children:i.jsx(PuA,{...A})})});function buA({post_base_url:A}){return[{accessorKey:"source",header:"URL",meta:{width:"grow"},cell:({row:e})=>{const t=e.original,n=`${A}/${t==null?void 0:t.source}`;return i.jsx("a",{className:"text-sm hover:underline cursor-pointer line-clamp-3 block",href:n,target:"_blank",rel:"noopener noreferrer",children:n})}},{accessorKey:"user",header:"Cleared By",cell:({row:e})=>{var n;const t=e.original;return i.jsx("div",{className:E("min-w-50",{"opacity-40":t.status==0}),children:i.jsx("p",{className:"text-sm ",children:(n=t.user)==null?void 0:n.name})})}},{accessorKey:"updated_at",header:"Last Modified",cell:({row:e})=>{const t=e.original,n=new Re("en-US");return i.jsx("div",{className:E("text-sm min-w-20",{"opacity-40":t.status==0}),children:n.format(new Date(t.updated_at))})}},{accessorKey:"type",header:"Status",cell:({row:e})=>{const t=e.original;return i.jsx("div",{className:E("min-w-30",{"opacity-40":t.status==0}),children:t.type=="Permanent"?i.jsx(Je,{variant:"outline",className:"border-[#229954] text-[#229954]",children:"Successful"}):i.jsx(Je,{variant:"outline",className:"border-destructive text-destructive",children:"Failed"})})}}]}const zuA=[{id:"created_at",label:"Created Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})},{id:"updated_at",label:"Updated Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})},{id:"published_at",label:"Published Date",type:MA.DATE,icon:i.jsx(dn,{color:"red"})}];Ie.ALL;const DuA=({post_base_url:A,site_uuid:e})=>{const t=buA({post_base_url:A});return i.jsx(hn,{postType:"Cache History",postTypeSng:"Redirect",showCTA:!1,columns:t,queryConfig:{fetch:{query:O6,variables:{site:e,include_drafts:!0},dataKey:"redirects"},delete:{query:T6,variables:{site_uuid:e,include_drafts:!0},dataKey:"redirects"}},toggleView:!1,filterFields:zuA,tableRowHeight:90,rootClassName:"h-full"})},BuA=({score:A,size:e=120})=>{const r=.75+A/100*.3999999999999999,s=Math.round(e*r),a=s/2,o=(s-30)/2,l=2*Math.PI*o,c=Math.round(28*r),u=l-A/100*l,f=Math.round(12*r),d=l-(100-A)/100*l,g=A/100*360,v=A>=70?"#22c55e":A>=40?"#f59e0b":"#ef4444";return i.jsxs("div",{className:"relative flex items-center justify-center",style:{width:s,height:s},children:[i.jsxs("svg",{width:s,height:s,children:[i.jsx("circle",{cx:a,cy:a,r:o,fill:"none",stroke:"#d1d5db",strokeWidth:f,strokeDasharray:l,strokeDashoffset:d,strokeLinecap:"butt",transform:`rotate(${-90+g} ${a} ${a})`}),i.jsx("circle",{cx:a,cy:a,r:o,fill:"none",stroke:v,strokeWidth:c,strokeDasharray:l,strokeDashoffset:u,strokeLinecap:"butt",transform:`rotate(-90 ${a} ${a})`,style:{transition:"stroke-dashoffset 0.6s ease"}})]}),i.jsxs("span",{className:"absolute text-2xl font-bold text-foreground",children:[A,"%"]})]})},MuA=({severity:A})=>{const e={high:{label:"High",className:"bg-red-100 text-red-700 border-red-200",dot:"bg-red-500"},medium:{label:"Medium",className:"bg-amber-100 text-amber-700 border-amber-200",dot:"bg-amber-500"},low:{label:"Low",className:"bg-amber-100 text-amber-700 border-amber-200",dot:"bg-amber-500"}},{label:t,className:n,dot:r}=e[A];return i.jsxs(Je,{variant:"outline",className:E("inline-flex items-center gap-1.5 text-[10px] uppercase font-bold",n),children:[i.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",r)}),t]})},ux=({status:A,label:e})=>{const t={good:{defaultLabel:"Good",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},warning:{defaultLabel:"Partial",bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500"},bad:{defaultLabel:"Missing",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"},missing:{defaultLabel:"Missing",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}}[A];return i.jsxs("span",{className:E("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium",t.bg,t.text),children:[i.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",t.dot)}),e??t.defaultLabel]})},CuA=({status:A})=>A==="good"?i.jsx(Gs,{size:14,className:"text-green-500",strokeWidth:3}):A==="warning"?i.jsx(Jh,{size:14,className:"text-amber-500"}):i.jsx(ss,{size:14,className:"text-red-500",strokeWidth:3}),S6=()=>{const{form:A}=kr(),[e,t]=y.useState(!1),[n,r]=y.useState(new Set),[s,a]=y.useState(null),o=y.useCallback(()=>{const w=A.getValues();return{title:w.title||"",content:w.body||w.content||"",excerpt:w.excerpt||"",seoTitle:w["seo:title"]||"",seoDescription:w["seo:description"]||"",slug:w.slug||""}},[A]),l=y.useCallback(()=>{const{title:w,content:x,excerpt:b,seoTitle:z,seoDescription:D,slug:M}=o(),B=z||w||"",H=D||b||"",k=(x||"").replace(/<[^>]*>/g," "),Y=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","must","shall","can","need","dare","ought","used","to","of","in","for","on","with","at","by","from","as","into","through","during","before","after","above","below","between","under","and","but","or","yet","so","if","because","although","though","while","where","when","that","which","who","whom","whose","what","this","these","those","i","me","my","myself","we","our","ours","ourselves","you","your","yours","yourself","yourselves","he","him","his","himself","she","her","hers","herself","it","its","itself","they","them","their","theirs","themselves","what","which","who","whom","this","that","these","those","am","it","its","s","t","just","don","now"]),T=k.toLowerCase().replace(/[^a-z0-9\s]/g,"").split(/\s+/).filter(F=>F.length>3&&!Y.has(F)),S={};T.forEach(F=>S[F]=(S[F]||0)+1);const X=Object.entries(S).sort((F,aA)=>aA[1]-F[1]).slice(0,4).map(([F])=>F);let q=0,J=!1;if(X.length>0){J=X.some(iA=>B.toLowerCase().includes(iA));const F=X.some(iA=>H.toLowerCase().includes(iA)),aA=X.some(iA=>k.toLowerCase().includes(iA)),lA=(x.match(/<h2[^>]*>/gi)||[]).filter(iA=>X.some(fA=>iA.toLowerCase().includes(fA))).length;q=Math.min(100,Math.round((J?30:0)+(F?20:0)+(aA?25:0)+Math.min(lA*10,25)))}const G=B.length,O=H.length,Z=x.match(/<img[^>]*>/gi)||[],C=Z.filter(F=>F.includes("alt=")).length,j=M.length>0,N=Math.min(100,Math.round((G>=30&&G<=60?30:G>0?15:0)+(O>=120&&O<=155?25:O>0?10:0)+(Z.length>0?C/Z.length*25:10)+(j?20:0))),V=(x.match(/<h1[^>]*>/gi)||[]).length,I=(x.match(/<h2[^>]*>/gi)||[]).length,W=(x.match(/<h3[^>]*>/gi)||[]).length,nA=(x.match(/<h4[^>]*>/gi)||[]).length,tA=(x.match(/<h[2-6][^>]*>/gi)||[]).map(F=>{var aA;return parseInt(((aA=F.match(/<h([2-6])/i))==null?void 0:aA[1])||"0",10)});let AA=!0,eA=1;for(const F of tA){if(F>eA+1){AA=!1;break}eA=F}tA.length===0&&(AA=!1);const U=k.split(/\s+/).filter(Boolean).length,_=(x.match(/href="\//gi)||[]).length,gA=Math.min(100,Math.round((V===0&&AA?25:V===0?15:0)+(I>=2?25:I>0?15:0)+(U>=300?25:U>=100?15:5)+Math.min(_*10,25))),uA=(x.match(/href="https?:\/\//gi)||[]).length,DA=Math.min(100,Math.round(_*15+uA*10)),YA=Math.round((q+N+gA+DA)/4),bA=[{label:"Keyword",score:q,color:"#f97316"},{label:"On-page",score:N,color:"#3b82f6"},{label:"Structure",score:gA,color:"#ec4899"},{label:"Linking",score:DA,color:"#22c55e"}],Oe=(()=>{if(X.length===0)return"0%";const F=k.toLowerCase();return`${(X.reduce((lA,iA)=>lA+(F.match(new RegExp(iA,"g"))||[]).length,0)/Math.max(T.length,1)*100).toFixed(2)}%`})(),ne=(()=>{if(X.length===0)return"warning";const F=k.toLowerCase(),lA=X.reduce((iA,fA)=>iA+(F.match(new RegExp(fA,"g"))||[]).length,0)/Math.max(T.length,1);return lA>=.01&&lA<=.03?"good":lA<.01?"warning":"bad"})(),L=[{id:"keywords",title:"Keywords usage",items:[{label:"Primary keyword in title",value:"",status:J?"good":"missing"},{label:"Keyword in intro (first 600 characters)",value:"",status:X.some(F=>k.slice(0,600).toLowerCase().includes(F))?"good":"missing"},{label:"Keyword density",value:Oe,status:ne},{label:"Meta description contains keyword",value:"",status:X.some(F=>H.toLowerCase().includes(F))?"good":"warning"}]},{id:"onpage",title:"On-page elements",items:[{label:"Meta title length",value:`${G} characters`,status:G>=30&&G<=75?"good":G>75?"warning":"bad",showValueWithDot:!0},{label:"Meta description length",value:`${O} characters`,status:O>=120&&O<=160?"good":O>160?"warning":"bad",showValueWithDot:!0},{label:"Canonical URL set",value:"",status:j?"good":"warning",badgeLabel:j?"Set":"Missing"}]},{id:"structure",title:"Structure",items:[{label:`Heading hierarchy (${[I&&"H2",W&&"H3",nA&&"H4"].filter(Boolean).join(", ")||"none"})`,value:"",status:V===0&&AA&&I>=1?"good":I>0?"warning":"bad",badgeLabel:V===0&&AA&&I>=1?"Good":"Missing"},{label:"Slug quality",value:j?M:"Missing",status:j&&M.length<60?"good":j?"warning":"bad",showValueWithDot:!0},{label:"Content length for SEO",value:`${U.toLocaleString()} words`,status:U>=300?"good":U>=100?"warning":"bad",showValueWithDot:!0}]},{id:"linking",title:"Linking",items:[{label:"Internal links",value:`${_} found`,status:_>0?"good":"warning",showValueWithDot:!0},{label:"External links",value:`${uA} found`,status:uA>0?"good":"warning",showValueWithDot:!0},{label:"Image alt text coverage",value:`${C}/${Z.length}`,status:Z.length>0&&C===Z.length?"good":"warning",showValueWithDot:!0}]}],$=[];return!J&&X[0]&&$.push({id:"1",title:"Target keyword missing from title",description:`"${X[0]}" does not appear in the article title. This is the strongest on-page signal for ranking.`,severity:"high",suggestion:`Add "${X[0]}" within the first 60 characters of the title.`}),(G<30||G>75)&&$.push({id:"2",title:"Title length suboptimal",description:`Your title is ${G} characters. Ideal length is 30–60 characters for full display in search results.`,severity:"medium",suggestion:"Aim for 30–60 characters to avoid truncation in SERPs."}),(O<120||O>160)&&$.push({id:"3",title:"Meta description length issue",description:`Your meta description is ${O} characters. Recommended length is 120–155 characters.`,severity:"medium",suggestion:"Write a compelling description between 120–155 characters."}),U<300&&$.push({id:"4",title:"Content too short",description:`Your article has only ${U} words. Thin content struggles to rank competitively.`,severity:"high",suggestion:"Expand to at least 300+ words with valuable, original content."}),Z.length>0&&C<Z.length&&$.push({id:"5",title:"Missing image alt text",description:`${Z.length-C} image(s) lack alt text, hurting accessibility and image SEO.`,severity:"low",suggestion:"Add descriptive alt text to all images."}),V>0&&$.push({id:"6",title:"H1 heading in article body",description:`Found ${V} H1 heading(s) in the article body. The blog page already renders the article title as H1, so the body should use H2-H6 only.`,severity:"medium",suggestion:"Replace H1 tags with H2 tags in the article body."}),{overallScore:YA,categories:bA,targetKeywords:X,metrics:L,issues:$}},[o]),c=y.useCallback(()=>{t(!0),setTimeout(()=>{try{const w=l();a(w)}catch(w){console.error("SEO analysis error:",w),a({overallScore:0,categories:[],targetKeywords:[],metrics:[],issues:[]})}finally{t(!1)}},100)},[l]);y.useEffect(()=>{c()},[]);const u=A.watch("title"),f=A.watch("body")||A.watch("content"),d=A.watch("excerpt"),g=A.watch("seo:title"),v=A.watch("seo:description"),m=A.watch("slug"),p=y.useRef(null);y.useEffect(()=>(p.current&&clearTimeout(p.current),s&&(p.current=setTimeout(()=>{c()},400)),()=>{p.current&&clearTimeout(p.current)}),[u,f,d,g,v,m]);const h=w=>{r(x=>{const b=new Set(x);return b.has(w)?b.delete(w):b.add(w),b})};return s?i.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Overall SEO score"}),i.jsxs(pA,{variant:"outline",size:"sm",className:"rounded-[4px] border border-primary text-secondary-foreground hover:bg-primary text-[12px] font-medium leading-[26px] px-2 py-1 min-h-[26px] gap-[6px]",onClick:c,disabled:e,children:[i.jsx(rd,{size:13,className:E(e&&"animate-spin","text-secondary-foreground")}),"Re-run"]})]}),i.jsxs("div",{className:"flex items-center gap-6 border-[.5px] border-[#E8E8E8] bg-muted rounded-[4px] py-[16px] pl-[30px] pr-[16px]",children:[i.jsx(BuA,{score:s.overallScore}),i.jsx("div",{className:"flex-1 flex flex-col gap-2.5",children:s.categories.map(w=>i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex justify-between text-[12px] font-medium text-[#28434F]",children:[i.jsx("span",{children:w.label}),i.jsxs("span",{className:"font-semibold text-[#000000E5]",children:[w.score,"%"]})]}),i.jsx("div",{className:"h-[3px] w-full rounded-full bg-[#EBEBEB] overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${w.score}%`,backgroundColor:w.color}})})]},w.label))})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Target keywords"}),i.jsx("div",{className:"flex flex-wrap bg-muted p-3 border-[#E8E8E8] border-[.5px] rounded-[4px] gap-3",children:s.targetKeywords.length>0?s.targetKeywords.map(w=>i.jsx(Je,{variant:"outline",className:"rounded-full gap-2 px-3 py-[2px] text-[12px] font-medium leading-[21px] border-[#5969702E] text-[#212529]",children:w},w)):i.jsx("span",{className:"text-xs text-[#252525]",children:"No keywords detected yet."})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Metrics"}),s.metrics.map(w=>{const x=n.has(w.id);return i.jsxs(Jz,{open:x,onOpenChange:()=>h(w.id),children:[i.jsx(Rz,{asChild:!0,children:i.jsxs("button",{className:E("flex items-center justify-between w-full py-2 px-3 transition-colors text-left",x?"bg-primary/30 rounded-tl-[4px] rounded-tr-[4px]":"bg-muted border border-[#E8E8E8] hover:bg-primary/10 rounded-[4px]"),children:[i.jsxs("span",{className:"flex items-center gap-[6px] text-[14px] font-medium leading-[26px] text-[#252525]",children:[i.jsx(Lh,{size:10,className:"transition-transform duration-200",fill:"currentColor",style:{color:w.items.every(b=>b.status==="good")?"#22c55e":w.items.some(b=>b.status==="bad"||b.status==="missing")?"#ef4444":"#f59e0b"}}),w.title]}),x?i.jsx(Wc,{size:22,className:"text-[#1E1E1E]"}):i.jsx(co,{size:22,className:"text-[#1E1E1E]"})]})}),i.jsx(Fz,{children:i.jsx("div",{className:"flex flex-col border border-t-0 border-[#E8E8E8] rounded-b-md -mt-1",children:w.items.map((b,z)=>i.jsxs("div",{className:E("flex items-center justify-between text-[12px] py-3 px-3 font-medium leading-[22px]",z!==w.items.length-1&&"border-b border-[#E8E8E8]"),children:[i.jsx("span",{className:"text-[#242424]",children:b.label}),i.jsx("span",{className:"flex items-center gap-2 font-medium text-foreground",children:b.showValueWithDot?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#252525] font-semibold",children:b.value}),i.jsx(CuA,{status:b.status})]}):b.value?i.jsx("span",{className:"text-[#252525]",children:b.value}):i.jsx(ux,{status:b.status,label:b.badgeLabel})})]},z))})})]},w.id)})]}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("h4",{className:"font-medium text-[#252525] text-base leading-[26px]",children:"Issues to fix"}),s.issues.length===0?i.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 bg-green-50 rounded-lg p-3",children:[i.jsx(ux,{status:"good"}),"No issues found — great job!"]}):s.issues.map(w=>i.jsxs("div",{className:"flex flex-col gap-2 rounded-[4px] border-[.5px] border-[#E8E8E8] bg-muted p-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-[14px] font-medium leading-[26px] text-[#0F0F0F]",children:w.title}),i.jsx(MuA,{severity:w.severity})]}),i.jsx("p",{className:"text-[14px] text-[#525252] leading-[22px]",children:w.description}),i.jsxs("div",{className:"flex items-center rounded-[4px] bg-[#EFF6FF] py-[6px] px-3 gap-[10px] mt-1 border border-[#2787FF4D]",children:[i.jsx(dg,{size:16,color:"#2787FF",className:"shrink-0"}),i.jsx("p",{className:"text-[12px] text-left font-medium text-[#0F0F0F] leading-[18px]",children:w.suggestion})]})]},w.id))]})]}):i.jsxs("div",{className:"flex items-center justify-center h-40 text-[#252525]",children:[i.jsx(rd,{className:"animate-spin mr-2 text-primary",size:18}),"Analysing SEO…"]})},juA=dA`
|
|
1830
1830
|
query GetRecipesByCategoryUuid($category_uuid: ID!, $perPage: Int!, $page: Int!) {
|
|
1831
1831
|
getRecipesByCategoryUuid(
|
|
1832
1832
|
input: { category_uuid: $category_uuid, perPage: $perPage, page: $page }
|
|
@@ -2636,5 +2636,5 @@ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}
|
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
2638
|
}
|
|
2639
|
-
`;function mdA({searchValue:A,apolloUri:e}){const t=y.useMemo(()=>({query:vdA,variables:{first:350},dataKey:"users"}),[]),n=go(e),r=lv(A||"",300),s=y.useCallback(async({pageParam:a=1})=>{if(t!=null&&t.query){const o=t==null?void 0:t.query,l=t==null?void 0:t.variables,f=(await n.query({query:o,variables:{...l||{},search:r,page:a}})).data[t.dataKey];return{paginatorInfo:f.paginatorInfo||{currentPage:1,lastPage:1},data:f==null?void 0:f.data}}else throw console.error("Invalid Query Configuration"),Error("Invalid Query Configuration")},[n,t,r]);return iv({queryKey:[t==null?void 0:t.dataKey,r],queryFn:s,getNextPageParam:a=>{var o,l;if(((o=a==null?void 0:a.paginatorInfo)==null?void 0:o.currentPage)<((l=a==null?void 0:a.paginatorInfo)==null?void 0:l.lastPage))return a.paginatorInfo.currentPage+1},initialPageParam:1,staleTime:300*1e3,gcTime:600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!1})}const vx={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ATHENS_APP_ID:"ak_707d0dcd4ecff2cfd9361b2fed7bfb79",VITE_ATHENS_APP_SECRET:"sk_797fe529520c182ab5986999c35d8528ab12e543b5093190be91e4c871dbeb4f",VITE_BLOG_UUID:"eee6c05f-eaa2-4e68-9e31-c14b3a3f96e3",VITE_DOLOS_TRANSFORMATION_ENDPOINT:"https://images.twistedfood.co.uk",VITE_DOLOS_URL:"https://dolos.hivedeck.com/graphql",VITE_GRAPH_QL_URL:"https://devapi.junglecreations.com/graphql",VITE_MERCURY_TOKEN_ENDPOINT:"https://mercury.tiadara.com/project/token",VITE_MUSE_ENDPOINT:"https://muse.tiadara.com/graphql",VITE_MUSE_GRAPHQL_URL:"https://muse.tiadara.com/graphql",VITE_MUSE_TOKEN:"token",VITE_NPM_TOKEN:"",VITE_PHOENIX_ENDPOINT:"https://phoenix.hogfort.com/graphql",VITE_PORTAL_GRAPHQL_ENDPOINT:"https://devapi.junglecreations.com/graphql",VITE_PROJECT_TOKEN:"token",VITE_PROJECT_UUID:"c26038a7-fc3b-4992-aa50-a4fdf8340aa3",VITE_RECIPES_ENDPOINT:"https://devrecipes.junglecreations.com/graphql",VITE_RECIPE_GRAPHQL_URL:"https://devrecipes.junglecreations.com/graphql",VITE_REVALIDATION_TWISTEDFOOD_TOKEN:"token",VITE_REVALIDATION_VT_TOKEN:"df870c4335ad9d4402dfccdf7000a3c9"},R6=He({NEXT_PUBLIC_DOLOS_URL:vA().default("https://localhost:3001"),NEXT_PUBLIC_RECIPE_GRAPHQL_URL:vA().default("https://localhost:3002"),NEXT_PUBLIC_PHOENIX_ENDPOINT:vA().default("https://localhost:3004"),NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:vA().default("https://localhost:3005/token"),NEXT_PUBLIC_ATHENS_APP_ID:vA().default("dev-athens-id"),NEXT_PUBLIC_ATHENS_APP_SECRET:vA().default("dev-athens-secret"),NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:vA().default("dev-revalidation-token"),NEXT_PUBLIC_REVALIDATION_VT_TOKEN:vA().default("dev-vt-token"),NEXT_PUBLIC_MUSE_GRAPHQL_URL:vA().optional()});function lw(){var t,n,r,s;const A=typeof window<"u";if(typeof process<"u"&&((t=process.env)==null?void 0:t.NODE_ENV)==="test")return{NEXT_PUBLIC_DOLOS_URL:process.env.NEXT_PUBLIC_DOLOS_URL||"https://fallback.test",NEXT_PUBLIC_RECIPE_GRAPHQL_URL:process.env.NEXT_PUBLIC_RECIPE_GRAPHQL_URL||"https://fallback.test",NEXT_PUBLIC_PHOENIX_ENDPOINT:process.env.NEXT_PUBLIC_PHOENIX_ENDPOINT||"https://fallback.test",NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:process.env.NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT||"https://fallback.test",NEXT_PUBLIC_ATHENS_APP_ID:process.env.NEXT_PUBLIC_ATHENS_APP_ID||"fallback-id",NEXT_PUBLIC_ATHENS_APP_SECRET:process.env.NEXT_PUBLIC_ATHENS_APP_SECRET||"fallback-secret",NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:process.env.NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN||"fallback-token",NEXT_PUBLIC_REVALIDATION_VT_TOKEN:process.env.NEXT_PUBLIC_REVALIDATION_VT_TOKEN||"fallback-token",NEXT_PUBLIC_MUSE_GRAPHQL_URL:process.env.NEXT_PUBLIC_MUSE_GRAPHQL_URL||""};let e={};if(typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Xv&&Xv.tagName.toUpperCase()==="SCRIPT"&&Xv.src||new URL("index-Co-WcIlL.cjs",document.baseURI).href}<"u"&&vx)e=vx;else if(typeof process<"u"&&process.env)e=process.env;else if(A&&typeof window<"u"){const a=window;(n=a.__NEXT_DATA__)!=null&&n.env?e=a.__NEXT_DATA__.env:(r=a.__NEXT_DATA__)!=null&&r.runtimeConfig?e=a.__NEXT_DATA__.runtimeConfig:(s=a.process)!=null&&s.env&&(e=a.process.env)}return{NEXT_PUBLIC_DOLOS_URL:e.NEXT_PUBLIC_DOLOS_URL,NEXT_PUBLIC_RECIPE_GRAPHQL_URL:e.NEXT_PUBLIC_RECIPE_GRAPHQL_URL,NEXT_PUBLIC_PHOENIX_ENDPOINT:e.NEXT_PUBLIC_PHOENIX_ENDPOINT,NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:e.NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT,NEXT_PUBLIC_ATHENS_APP_ID:e.NEXT_PUBLIC_ATHENS_APP_ID,NEXT_PUBLIC_ATHENS_APP_SECRET:e.NEXT_PUBLIC_ATHENS_APP_SECRET,NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:e.NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN,NEXT_PUBLIC_REVALIDATION_VT_TOKEN:e.NEXT_PUBLIC_REVALIDATION_VT_TOKEN,NEXT_PUBLIC_MUSE_GRAPHQL_URL:e.NEXT_PUBLIC_MUSE_GRAPHQL_URL}}const F6=y.createContext(null);function pdA({children:A,env:e}){const t=e||lw(),n=R6.parse(t);return i.jsx(F6.Provider,{value:n,children:A})}function hdA(){const A=y.useContext(F6);if(A)return A;const e=lw();return R6.parse(e)}Re.addDefaultLocale(QT);Re.addLocale(LT);exports.Alert=lX;exports.AlertDescription=uX;exports.AlertTitle=cX;exports.AuthorsComponent=gdA;exports.Badge=Je;exports.BlogCategoryContent=n6;exports.BlogPostContentComponent=yuA;exports.BlogPostsComponent=TiA;exports.BlogStatus=Ie;exports.BlogTagContent=z6;exports.Breadcrumb=lz;exports.BreadcrumbEllipsis=fX;exports.BreadcrumbItem=Np;exports.BreadcrumbLink=uz;exports.BreadcrumbList=cz;exports.BreadcrumbPage=fz;exports.BreadcrumbSeparator=dz;exports.Button=pA;exports.Calendar=Au;exports.Card=Rn;exports.CardContent=os;exports.CardDescription=Nz;exports.CardFooter=eu;exports.CardHeader=as;exports.CardTitle=Pi;exports.CategoriesComponent=YiA;exports.Checkbox=Gz;exports.ClearCacheHistory=DuA;exports.Collapsible=Jz;exports.CollapsibleContent=Fz;exports.CollapsibleTrigger=Rz;exports.ColumnFaceting=gB;exports.ColumnFiltering=bB;exports.ColumnGrouping=zB;exports.ColumnOrdering=BB;exports.ColumnPinning=MB;exports.ColumnSizing=CB;exports.ColumnVisibility=OB;exports.Command=nu;exports.CommandDialog=KI;exports.CommandEmpty=Bg;exports.CommandGroup=Mg;exports.CommandInput=P0;exports.CommandItem=Cg;exports.CommandList=Dg;exports.CommandSeparator=w8;exports.CommandShortcut=y8;exports.ContextMenu=I8;exports.ContextMenuCheckboxItem=TQ;exports.ContextMenuContent=L8;exports.ContextMenuGroup=DQ;exports.ContextMenuItem=Vp;exports.ContextMenuLabel=NQ;exports.ContextMenuPortal=BQ;exports.ContextMenuRadioGroup=CQ;exports.ContextMenuRadioItem=EQ;exports.ContextMenuSeparator=q8;exports.ContextMenuShortcut=J8;exports.ContextMenuSub=MQ;exports.ContextMenuSubContent=OQ;exports.ContextMenuSubTrigger=jQ;exports.ContextMenuTrigger=Q8;exports.Dialog=Mt;exports.DialogClose=WI;exports.DialogContent=wt;exports.DialogDescription=gs;exports.DialogFooter=pn;exports.DialogHeader=rn;exports.DialogOverlay=y0;exports.DialogPortal=h8;exports.DialogTitle=sn;exports.DialogTrigger=FI;exports.DropdownMenu=RV;exports.DropdownMenuCheckboxItem=$V;exports.DropdownMenuContent=KV;exports.DropdownMenuGroup=UV;exports.DropdownMenuItem=_V;exports.DropdownMenuLabel=tX;exports.DropdownMenuPortal=FV;exports.DropdownMenuRadioGroup=AX;exports.DropdownMenuRadioItem=eX;exports.DropdownMenuSeparator=nX;exports.DropdownMenuShortcut=rX;exports.DropdownMenuSub=sX;exports.DropdownMenuSubContent=oX;exports.DropdownMenuSubTrigger=aX;exports.DropdownMenuTrigger=WV;exports.FaqManager=Z6;exports.FilterFieldType=MA;exports.Form=T0;exports.FormControl=fo;exports.FormDescription=oD;exports.FormField=uo;exports.FormItem=wr;exports.FormLabel=E0;exports.FormMessage=iD;exports.FormResponsesComponent=odA;exports.GlobalFaceting=TB;exports.GlobalFiltering=EB;exports.Headers=dB;exports.Input=It;exports.Label=Eg;exports.PagesComponent=KfA;exports.Popover=ua;exports.PopoverContent=vs;exports.PopoverTrigger=fa;exports.PurgeCacheWrapper=xuA;exports.QualityScoreSection=k6;exports.QueryProvider=FoA;exports.RadioGroup=k0;exports.RadioGroupItem=Z0;exports.RecipeCategories=afA;exports.RecipeContentComponentWithApollo=XuA;exports.RecipeTags=WuA;exports.RecipesComponent=wcA;exports.RedirectsComponent=CcA;exports.RowExpanding=NB;exports.RowPagination=HB;exports.RowPinning=kB;exports.RowSelection=ZB;exports.RowSorting=VB;exports.Select=bi;exports.SelectContent=to;exports.SelectGroup=vq;exports.SelectItem=pr;exports.SelectLabel=h5;exports.SelectScrollDownButton=X0;exports.SelectScrollUpButton=V0;exports.SelectSeparator=w5;exports.SelectTrigger=eo;exports.SelectValue=zi;exports.Separator=P5;exports.Sheet=Y0;exports.SheetClose=xq;exports.SheetContent=G0;exports.SheetDescription=L0;exports.SheetFooter=b5;exports.SheetHeader=I0;exports.SheetTitle=Q0;exports.SheetTrigger=x5;exports.Sidebar=eJ;exports.SidebarContent=lJ;exports.SidebarFooter=oJ;exports.SidebarGroup=cJ;exports.SidebarGroupAction=fJ;exports.SidebarGroupContent=dJ;exports.SidebarGroupLabel=uJ;exports.SidebarHeader=aJ;exports.SidebarInput=sJ;exports.SidebarInset=rJ;exports.SidebarMenu=gJ;exports.SidebarMenuAction=hJ;exports.SidebarMenuBadge=wJ;exports.SidebarMenuButton=pJ;exports.SidebarMenuItem=vJ;exports.SidebarMenuSkeleton=yJ;exports.SidebarMenuSub=PJ;exports.SidebarMenuSubButton=bJ;exports.SidebarMenuSubItem=xJ;exports.SidebarProvider=AJ;exports.SidebarRail=nJ;exports.SidebarSeparator=iJ;exports.SidebarTrigger=tJ;exports.Skeleton=fd;exports.Switch=R0;exports.Table=vR;exports.TableBody=pR;exports.TableCaption=xR;exports.TableCell=PR;exports.TableFooter=hR;exports.TableHead=yR;exports.TableHeader=mR;exports.TableRow=wR;exports.Tabs=Ig;exports.TabsContent=Qg;exports.TabsList=lu;exports.TabsTrigger=cu;exports.TagsComponent=ccA;exports.Textarea=uu;exports.ThemeProvider=qoA;exports.Toaster=gR;exports.Toggle=oB;exports.ToggleGroup=gd;exports.ToggleGroupItem=vd;exports.Tooltip=Zs;exports.TooltipContent=Vs;exports.TooltipProvider=Bi;exports.TooltipTrigger=Ss;exports.TopicsComponent=pcA;exports.WazUIBlogComponent=hn;exports.WazUIBlogDashboard=IfA;exports.WazUIButton=ge;exports.WazUIEnvironmentProvider=pdA;exports.WazUIPostActions=QoA;exports.WazUIPostCategories=Vu;exports.WazUIPostStatistics=Xu;exports.WazUIPostTags=ll;exports.WazUiCreateBlogContent=Yu;exports.WazUiGqlMediaLibrary=$4;exports.WazUiPostCard=$9;exports.WazuiActionModalProvider=Yi;exports._getVisibleLeafColumns=Wo;exports.aggregationFns=Mf;exports.badgeVariants=iz;exports.buildHeaderGroups=El;exports.cleanHTML=ts;exports.commonjsGlobal=Ff;exports.createCell=uB;exports.createColumn=fB;exports.createColumnHelper=zR;exports.createNextConfig=ZC;exports.createRow=gu;exports.createTable=XB;exports.debugNextConfig=SC;exports.defaultColumnSizing=Nl;exports.env=ve;exports.expandRows=e9;exports.fetchMercuryToken=T9;exports.filterFns=ar;exports.flattenBy=_0;exports.flexRender=A2;exports.functionalUpdate=Kr;exports.getAutoDetectedEnvironment=lw;exports.getCoreRowModel=YB;exports.getDefaultExportFromCjs=Xc;exports.getEnv=VC;exports.getExpandedRowModel=QR;exports.getFacetedMinMaxValues=LR;exports.getFacetedRowModel=RR;exports.getFacetedUniqueValues=FR;exports.getFilteredRowModel=IB;exports.getGroupedRowModel=WR;exports.getMemoOptions=XA;exports.getPaginationRowModel=QB;exports.getSortedRowModel=LB;exports.isFunction=du;exports.isNumberArray=cB;exports.isRowSelected=qg;exports.isSubRowSelected=md;exports.makeStateUpdater=tn;exports.memo=VA;exports.noop=DR;exports.orderColumns=DB;exports.passiveEventSupported=jB;exports.reSplitAlphaNumeric=pd;exports.selectRowsFn=Cf;exports.shouldAutoRemoveFilter=Kp;exports.sortingFns=Eo;exports.toggleVariants=U0;exports.useAuthors=mdA;exports.useFormField=su;exports.useReactTable=qB;exports.useSidebar=iu;exports.useTheme=JoA;exports.useWazUIEnvironment=hdA;exports.withReactQuery=KoA;
|
|
2640
|
-
//# sourceMappingURL=index-
|
|
2639
|
+
`;function mdA({searchValue:A,apolloUri:e}){const t=y.useMemo(()=>({query:vdA,variables:{first:350},dataKey:"users"}),[]),n=go(e),r=lv(A||"",300),s=y.useCallback(async({pageParam:a=1})=>{if(t!=null&&t.query){const o=t==null?void 0:t.query,l=t==null?void 0:t.variables,f=(await n.query({query:o,variables:{...l||{},search:r,page:a}})).data[t.dataKey];return{paginatorInfo:f.paginatorInfo||{currentPage:1,lastPage:1},data:f==null?void 0:f.data}}else throw console.error("Invalid Query Configuration"),Error("Invalid Query Configuration")},[n,t,r]);return iv({queryKey:[t==null?void 0:t.dataKey,r],queryFn:s,getNextPageParam:a=>{var o,l;if(((o=a==null?void 0:a.paginatorInfo)==null?void 0:o.currentPage)<((l=a==null?void 0:a.paginatorInfo)==null?void 0:l.lastPage))return a.paginatorInfo.currentPage+1},initialPageParam:1,staleTime:300*1e3,gcTime:600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!1})}const vx={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ATHENS_APP_ID:"ak_707d0dcd4ecff2cfd9361b2fed7bfb79",VITE_ATHENS_APP_SECRET:"sk_797fe529520c182ab5986999c35d8528ab12e543b5093190be91e4c871dbeb4f",VITE_BLOG_UUID:"eee6c05f-eaa2-4e68-9e31-c14b3a3f96e3",VITE_DOLOS_TRANSFORMATION_ENDPOINT:"https://images.twistedfood.co.uk",VITE_DOLOS_URL:"https://dolos.hivedeck.com/graphql",VITE_GRAPH_QL_URL:"https://devapi.junglecreations.com/graphql",VITE_MERCURY_TOKEN_ENDPOINT:"https://mercury.tiadara.com/project/token",VITE_MUSE_ENDPOINT:"https://muse.tiadara.com/graphql",VITE_MUSE_GRAPHQL_URL:"https://muse.tiadara.com/graphql",VITE_MUSE_TOKEN:"token",VITE_NPM_TOKEN:"",VITE_PHOENIX_ENDPOINT:"https://phoenix.hogfort.com/graphql",VITE_PORTAL_GRAPHQL_ENDPOINT:"https://devapi.junglecreations.com/graphql",VITE_PROJECT_TOKEN:"token",VITE_PROJECT_UUID:"c26038a7-fc3b-4992-aa50-a4fdf8340aa3",VITE_RECIPES_ENDPOINT:"https://devrecipes.junglecreations.com/graphql",VITE_RECIPE_GRAPHQL_URL:"https://devrecipes.junglecreations.com/graphql",VITE_REVALIDATION_TWISTEDFOOD_TOKEN:"token",VITE_REVALIDATION_VT_TOKEN:"df870c4335ad9d4402dfccdf7000a3c9"},R6=He({NEXT_PUBLIC_DOLOS_URL:vA().default("https://localhost:3001"),NEXT_PUBLIC_RECIPE_GRAPHQL_URL:vA().default("https://localhost:3002"),NEXT_PUBLIC_PHOENIX_ENDPOINT:vA().default("https://localhost:3004"),NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:vA().default("https://localhost:3005/token"),NEXT_PUBLIC_ATHENS_APP_ID:vA().default("dev-athens-id"),NEXT_PUBLIC_ATHENS_APP_SECRET:vA().default("dev-athens-secret"),NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:vA().default("dev-revalidation-token"),NEXT_PUBLIC_REVALIDATION_VT_TOKEN:vA().default("dev-vt-token"),NEXT_PUBLIC_MUSE_GRAPHQL_URL:vA().optional()});function lw(){var t,n,r,s;const A=typeof window<"u";if(typeof process<"u"&&((t=process.env)==null?void 0:t.NODE_ENV)==="test")return{NEXT_PUBLIC_DOLOS_URL:process.env.NEXT_PUBLIC_DOLOS_URL||"https://fallback.test",NEXT_PUBLIC_RECIPE_GRAPHQL_URL:process.env.NEXT_PUBLIC_RECIPE_GRAPHQL_URL||"https://fallback.test",NEXT_PUBLIC_PHOENIX_ENDPOINT:process.env.NEXT_PUBLIC_PHOENIX_ENDPOINT||"https://fallback.test",NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:process.env.NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT||"https://fallback.test",NEXT_PUBLIC_ATHENS_APP_ID:process.env.NEXT_PUBLIC_ATHENS_APP_ID||"fallback-id",NEXT_PUBLIC_ATHENS_APP_SECRET:process.env.NEXT_PUBLIC_ATHENS_APP_SECRET||"fallback-secret",NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:process.env.NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN||"fallback-token",NEXT_PUBLIC_REVALIDATION_VT_TOKEN:process.env.NEXT_PUBLIC_REVALIDATION_VT_TOKEN||"fallback-token",NEXT_PUBLIC_MUSE_GRAPHQL_URL:process.env.NEXT_PUBLIC_MUSE_GRAPHQL_URL||""};let e={};if(typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Xv&&Xv.tagName.toUpperCase()==="SCRIPT"&&Xv.src||new URL("index-ElL3MKkT.cjs",document.baseURI).href}<"u"&&vx)e=vx;else if(typeof process<"u"&&process.env)e=process.env;else if(A&&typeof window<"u"){const a=window;(n=a.__NEXT_DATA__)!=null&&n.env?e=a.__NEXT_DATA__.env:(r=a.__NEXT_DATA__)!=null&&r.runtimeConfig?e=a.__NEXT_DATA__.runtimeConfig:(s=a.process)!=null&&s.env&&(e=a.process.env)}return{NEXT_PUBLIC_DOLOS_URL:e.NEXT_PUBLIC_DOLOS_URL,NEXT_PUBLIC_RECIPE_GRAPHQL_URL:e.NEXT_PUBLIC_RECIPE_GRAPHQL_URL,NEXT_PUBLIC_PHOENIX_ENDPOINT:e.NEXT_PUBLIC_PHOENIX_ENDPOINT,NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT:e.NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT,NEXT_PUBLIC_ATHENS_APP_ID:e.NEXT_PUBLIC_ATHENS_APP_ID,NEXT_PUBLIC_ATHENS_APP_SECRET:e.NEXT_PUBLIC_ATHENS_APP_SECRET,NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN:e.NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN,NEXT_PUBLIC_REVALIDATION_VT_TOKEN:e.NEXT_PUBLIC_REVALIDATION_VT_TOKEN,NEXT_PUBLIC_MUSE_GRAPHQL_URL:e.NEXT_PUBLIC_MUSE_GRAPHQL_URL}}const F6=y.createContext(null);function pdA({children:A,env:e}){const t=e||lw(),n=R6.parse(t);return i.jsx(F6.Provider,{value:n,children:A})}function hdA(){const A=y.useContext(F6);if(A)return A;const e=lw();return R6.parse(e)}Re.addDefaultLocale(QT);Re.addLocale(LT);exports.Alert=lX;exports.AlertDescription=uX;exports.AlertTitle=cX;exports.AuthorsComponent=gdA;exports.Badge=Je;exports.BlogCategoryContent=n6;exports.BlogPostContentComponent=yuA;exports.BlogPostsComponent=TiA;exports.BlogStatus=Ie;exports.BlogTagContent=z6;exports.Breadcrumb=lz;exports.BreadcrumbEllipsis=fX;exports.BreadcrumbItem=Np;exports.BreadcrumbLink=uz;exports.BreadcrumbList=cz;exports.BreadcrumbPage=fz;exports.BreadcrumbSeparator=dz;exports.Button=pA;exports.Calendar=Au;exports.Card=Rn;exports.CardContent=os;exports.CardDescription=Nz;exports.CardFooter=eu;exports.CardHeader=as;exports.CardTitle=Pi;exports.CategoriesComponent=YiA;exports.Checkbox=Gz;exports.ClearCacheHistory=DuA;exports.Collapsible=Jz;exports.CollapsibleContent=Fz;exports.CollapsibleTrigger=Rz;exports.ColumnFaceting=gB;exports.ColumnFiltering=bB;exports.ColumnGrouping=zB;exports.ColumnOrdering=BB;exports.ColumnPinning=MB;exports.ColumnSizing=CB;exports.ColumnVisibility=OB;exports.Command=nu;exports.CommandDialog=KI;exports.CommandEmpty=Bg;exports.CommandGroup=Mg;exports.CommandInput=P0;exports.CommandItem=Cg;exports.CommandList=Dg;exports.CommandSeparator=w8;exports.CommandShortcut=y8;exports.ContextMenu=I8;exports.ContextMenuCheckboxItem=TQ;exports.ContextMenuContent=L8;exports.ContextMenuGroup=DQ;exports.ContextMenuItem=Vp;exports.ContextMenuLabel=NQ;exports.ContextMenuPortal=BQ;exports.ContextMenuRadioGroup=CQ;exports.ContextMenuRadioItem=EQ;exports.ContextMenuSeparator=q8;exports.ContextMenuShortcut=J8;exports.ContextMenuSub=MQ;exports.ContextMenuSubContent=OQ;exports.ContextMenuSubTrigger=jQ;exports.ContextMenuTrigger=Q8;exports.Dialog=Mt;exports.DialogClose=WI;exports.DialogContent=wt;exports.DialogDescription=gs;exports.DialogFooter=pn;exports.DialogHeader=rn;exports.DialogOverlay=y0;exports.DialogPortal=h8;exports.DialogTitle=sn;exports.DialogTrigger=FI;exports.DropdownMenu=RV;exports.DropdownMenuCheckboxItem=$V;exports.DropdownMenuContent=KV;exports.DropdownMenuGroup=UV;exports.DropdownMenuItem=_V;exports.DropdownMenuLabel=tX;exports.DropdownMenuPortal=FV;exports.DropdownMenuRadioGroup=AX;exports.DropdownMenuRadioItem=eX;exports.DropdownMenuSeparator=nX;exports.DropdownMenuShortcut=rX;exports.DropdownMenuSub=sX;exports.DropdownMenuSubContent=oX;exports.DropdownMenuSubTrigger=aX;exports.DropdownMenuTrigger=WV;exports.FaqManager=Z6;exports.FilterFieldType=MA;exports.Form=T0;exports.FormControl=fo;exports.FormDescription=oD;exports.FormField=uo;exports.FormItem=wr;exports.FormLabel=E0;exports.FormMessage=iD;exports.FormResponsesComponent=odA;exports.GlobalFaceting=TB;exports.GlobalFiltering=EB;exports.Headers=dB;exports.Input=It;exports.Label=Eg;exports.PagesComponent=KfA;exports.Popover=ua;exports.PopoverContent=vs;exports.PopoverTrigger=fa;exports.PurgeCacheWrapper=xuA;exports.QualityScoreSection=k6;exports.QueryProvider=FoA;exports.RadioGroup=k0;exports.RadioGroupItem=Z0;exports.RecipeCategories=afA;exports.RecipeContentComponentWithApollo=XuA;exports.RecipeTags=WuA;exports.RecipesComponent=wcA;exports.RedirectsComponent=CcA;exports.RowExpanding=NB;exports.RowPagination=HB;exports.RowPinning=kB;exports.RowSelection=ZB;exports.RowSorting=VB;exports.Select=bi;exports.SelectContent=to;exports.SelectGroup=vq;exports.SelectItem=pr;exports.SelectLabel=h5;exports.SelectScrollDownButton=X0;exports.SelectScrollUpButton=V0;exports.SelectSeparator=w5;exports.SelectTrigger=eo;exports.SelectValue=zi;exports.Separator=P5;exports.Sheet=Y0;exports.SheetClose=xq;exports.SheetContent=G0;exports.SheetDescription=L0;exports.SheetFooter=b5;exports.SheetHeader=I0;exports.SheetTitle=Q0;exports.SheetTrigger=x5;exports.Sidebar=eJ;exports.SidebarContent=lJ;exports.SidebarFooter=oJ;exports.SidebarGroup=cJ;exports.SidebarGroupAction=fJ;exports.SidebarGroupContent=dJ;exports.SidebarGroupLabel=uJ;exports.SidebarHeader=aJ;exports.SidebarInput=sJ;exports.SidebarInset=rJ;exports.SidebarMenu=gJ;exports.SidebarMenuAction=hJ;exports.SidebarMenuBadge=wJ;exports.SidebarMenuButton=pJ;exports.SidebarMenuItem=vJ;exports.SidebarMenuSkeleton=yJ;exports.SidebarMenuSub=PJ;exports.SidebarMenuSubButton=bJ;exports.SidebarMenuSubItem=xJ;exports.SidebarProvider=AJ;exports.SidebarRail=nJ;exports.SidebarSeparator=iJ;exports.SidebarTrigger=tJ;exports.Skeleton=fd;exports.Switch=R0;exports.Table=vR;exports.TableBody=pR;exports.TableCaption=xR;exports.TableCell=PR;exports.TableFooter=hR;exports.TableHead=yR;exports.TableHeader=mR;exports.TableRow=wR;exports.Tabs=Ig;exports.TabsContent=Qg;exports.TabsList=lu;exports.TabsTrigger=cu;exports.TagsComponent=ccA;exports.Textarea=uu;exports.ThemeProvider=qoA;exports.Toaster=gR;exports.Toggle=oB;exports.ToggleGroup=gd;exports.ToggleGroupItem=vd;exports.Tooltip=Zs;exports.TooltipContent=Vs;exports.TooltipProvider=Bi;exports.TooltipTrigger=Ss;exports.TopicsComponent=pcA;exports.WazUIBlogComponent=hn;exports.WazUIBlogDashboard=IfA;exports.WazUIButton=ge;exports.WazUIEnvironmentProvider=pdA;exports.WazUIPostActions=QoA;exports.WazUIPostCategories=Vu;exports.WazUIPostStatistics=Xu;exports.WazUIPostTags=ll;exports.WazUiCreateBlogContent=Yu;exports.WazUiGqlMediaLibrary=$4;exports.WazUiPostCard=$9;exports.WazuiActionModalProvider=Yi;exports._getVisibleLeafColumns=Wo;exports.aggregationFns=Mf;exports.badgeVariants=iz;exports.buildHeaderGroups=El;exports.cleanHTML=ts;exports.commonjsGlobal=Ff;exports.createCell=uB;exports.createColumn=fB;exports.createColumnHelper=zR;exports.createNextConfig=ZC;exports.createRow=gu;exports.createTable=XB;exports.debugNextConfig=SC;exports.defaultColumnSizing=Nl;exports.env=ve;exports.expandRows=e9;exports.fetchMercuryToken=T9;exports.filterFns=ar;exports.flattenBy=_0;exports.flexRender=A2;exports.functionalUpdate=Kr;exports.getAutoDetectedEnvironment=lw;exports.getCoreRowModel=YB;exports.getDefaultExportFromCjs=Xc;exports.getEnv=VC;exports.getExpandedRowModel=QR;exports.getFacetedMinMaxValues=LR;exports.getFacetedRowModel=RR;exports.getFacetedUniqueValues=FR;exports.getFilteredRowModel=IB;exports.getGroupedRowModel=WR;exports.getMemoOptions=XA;exports.getPaginationRowModel=QB;exports.getSortedRowModel=LB;exports.isFunction=du;exports.isNumberArray=cB;exports.isRowSelected=qg;exports.isSubRowSelected=md;exports.makeStateUpdater=tn;exports.memo=VA;exports.noop=DR;exports.orderColumns=DB;exports.passiveEventSupported=jB;exports.reSplitAlphaNumeric=pd;exports.selectRowsFn=Cf;exports.shouldAutoRemoveFilter=Kp;exports.sortingFns=Eo;exports.toggleVariants=U0;exports.useAuthors=mdA;exports.useFormField=su;exports.useReactTable=qB;exports.useSidebar=iu;exports.useTheme=JoA;exports.useWazUIEnvironment=hdA;exports.withReactQuery=KoA;
|
|
2640
|
+
//# sourceMappingURL=index-ElL3MKkT.cjs.map
|