"use strict";(self["webpackChunktutor"]=self["webpackChunktutor"]||[]).push([["410"],{19251:function(e,t,n){n.d(t,{Aw:()=>o,L4:()=>s,bO:()=>l});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);const a={display:"none"};function o(e){let{id:t,value:n}=e;return i().createElement("div",{id:t,style:a},n)}function s(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;// Hide element visually but keep it readable by screen readers
const a={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 i().createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":true},n)}function l(){const[e,t]=(0,r.useState)("");const n=(0,r.useCallback)(e=>{if(e!=null){t(e)}},[]);return{announce:n,announcement:e}}//# sourceMappingURL=accessibility.esm.js.map
},15871:function(e,t,n){n.d(t,{AN:()=>eA,FR:()=>m,Hd:()=>tS,MS:()=>_,Mp:()=>tc,PM:()=>th,Pf:()=>eK,Sj:()=>W,Vy:()=>k,fF:()=>tf,fp:()=>D,sl:()=>U,uN:()=>em,vL:()=>ef,y$:()=>C,zM:()=>tm});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(75206);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(74979);/* import */var l=n(19251);const d=/*#__PURE__*/(0,r.createContext)(null);function c(e){const t=(0,r.useContext)(d);(0,r.useEffect)(()=>{if(!t){throw new Error("useDndMonitor must be used within a children of <DndContext>")}const n=t(e);return n},[e,t])}function u(){const[e]=(0,r.useState)(()=>new Set);const t=(0,r.useCallback)(t=>{e.add(t);return()=>e.delete(t)},[e]);const n=(0,r.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return(t=e[n])==null?void 0:t.call(e,r)})},[e]);return[n,t]}const p={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "};const v={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;if(n){return"Draggable item "+t.id+" was moved over droppable area "+n.id+"."}return"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;if(n){return"Draggable item "+t.id+" was dropped over droppable area "+n.id}return"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function h(e){let{announcements:t=v,container:n,hiddenTextDescribedById:o,screenReaderInstructions:d=p}=e;const{announce:u,announcement:h}=(0,l/* .useAnnouncement */.bO)();const f=(0,s/* .useUniqueId */.YG)("DndLiveRegion");const[g,_]=(0,r.useState)(false);(0,r.useEffect)(()=>{_(true)},[]);c((0,r.useMemo)(()=>({onDragStart(e){let{active:n}=e;u(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;if(t.onDragMove){u(t.onDragMove({active:n,over:r}))}},onDragOver(e){let{active:n,over:r}=e;u(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;u(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;u(t.onDragCancel({active:n,over:r}))}}),[u,t]));if(!g){return null}const m=i().createElement(i().Fragment,null,i().createElement(l/* .HiddenText */.Aw,{id:o,value:d.draggable}),i().createElement(l/* .LiveRegion */.L4,{id:f,announcement:h}));return n?(0,a.createPortal)(m,n):m}var f;(function(e){e["DragStart"]="dragStart";e["DragMove"]="dragMove";e["DragEnd"]="dragEnd";e["DragCancel"]="dragCancel";e["DragOver"]="dragOver";e["RegisterDroppable"]="registerDroppable";e["SetDroppableDisabled"]="setDroppableDisabled";e["UnregisterDroppable"]="unregisterDroppable"})(f||(f={}));function g(){}function _(e,t){return(0,r.useMemo)(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,r.useMemo)(()=>[...t].filter(e=>e!=null),[...t])}const b=/*#__PURE__*/Object.freeze({x:0,y:0});/**
 * Returns the distance between two points
 */function y(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,s/* .getEventCoordinates */.e_)(e);if(!n){return"0 0"}const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}/**
 * Sort collisions from smallest to greatest value
 */function x(e,t){let{data:{value:n}}=e;let{data:{value:r}}=t;return n-r}/**
 * Sort collisions from greatest to smallest value
 */function A(e,t){let{data:{value:n}}=e;let{data:{value:r}}=t;return r-n}/**
 * Returns the coordinates of the corners of a given rectangle:
 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
 */function Y(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function k(e,t){if(!e||e.length===0){return null}const[n]=e;return t?n[t]:n}/**
 * Returns the coordinates of the center of a given ClientRect
 */function I(e,t,n){if(t===void 0){t=e.left}if(n===void 0){n=e.top}return{x:t+e.width*.5,y:n+e.height*.5}}/**
 * Returns the closest rectangles from an array of rectangles to the center of a given
 * rectangle.
 */const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=I(t,t.left,t.top);const a=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=y(I(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(x)};/**
 * Returns the closest rectangles from an array of rectangles to the corners of
 * another rectangle.
 */const C=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Y(t);const a=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=Y(r);const o=i.reduce((e,t,r)=>{return e+y(n[r],t)},0);const s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(x)};/**
 * Returns the intersecting rectangle area between two rectangles
 */function E(e,t){const n=Math.max(t.top,e.top);const r=Math.max(t.left,e.left);const i=Math.min(t.left+t.width,e.left+e.width);const a=Math.min(t.top+t.height,e.top+e.height);const o=i-r;const s=a-n;if(r<i&&n<a){const n=t.width*t.height;const r=e.width*e.height;const i=o*s;const a=i/(n+r-i);return Number(a.toFixed(4))}// Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)
return 0}/**
 * Returns the rectangles that has the greatest intersection area with a given
 * rectangle in an array of rectangles.
 */const q=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e;const a=n.get(r);if(a){const n=E(a,t);if(n>0){i.push({id:r,data:{droppableContainer:e,value:n}})}}}return i.sort(A)};/**
 * Check if a given point is contained within a bounding rectangle
 */function T(e,t){const{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}/**
 * Returns the rectangles that the pointer is hovering over
 */const S=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r){return[]}const i=[];for(const e of t){const{id:t}=e;const a=n.get(t);if(a&&T(r,a)){/* There may be more than a single rectangle intersecting
       * with the pointer coordinates. In order to sort the
       * colliding rectangles, we measure the distance between
       * the pointer and the corners of the intersecting rectangle
       */const n=Y(a);const o=n.reduce((e,t)=>{return e+y(r,t)},0);const s=Number((o/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(x)};function M(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function H(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:b}function z(e){return function t(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const K=/*#__PURE__*/z(1);function O(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function F(e,t,n){const r=O(t);if(!r){return e}const{scaleX:i,scaleY:a,x:o,y:s}=r;const l=e.left-o-(1-i)*parseFloat(n);const d=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1));const c=i?e.width/i:e.width;const u=a?e.height/a:e.height;return{width:c,height:u,top:d,right:l+c,bottom:d+u,left:l}}const P={ignoreTransform:false};/**
 * Returns the bounding client rect of an element relative to the viewport.
 */function W(e,t){if(t===void 0){t=P}let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,s/* .getWindow */.zk)(e).getComputedStyle(e);if(t){n=F(n,t,r)}}const{top:r,left:i,width:a,height:o,bottom:l,right:d}=n;return{top:r,left:i,width:a,height:o,bottom:l,right:d}}/**
 * Returns the bounding client rect of an element relative to the viewport.
 *
 * @remarks
 * The ClientRect returned by this method does not take into account transforms
 * applied to the element it measures.
 *
 */function N(e){return W(e,{ignoreTransform:true})}function L(e){const t=e.innerWidth;const n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function B(e,t){if(t===void 0){t=(0,s/* .getWindow */.zk)(e).getComputedStyle(e)}return t.position==="fixed"}function R(e,t){if(t===void 0){t=(0,s/* .getWindow */.zk)(e).getComputedStyle(e)}const n=/(auto|scroll|overlay)/;const r=["overflow","overflowX","overflowY"];return r.some(e=>{const r=t[e];return typeof r==="string"?n.test(r):false})}function U(e,t){const n=[];function r(i){if(t!=null&&n.length>=t){return n}if(!i){return n}if((0,s/* .isDocument */.wz)(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement)){n.push(i.scrollingElement);return n}if(!(0,s/* .isHTMLElement */.sb)(i)||(0,s/* .isSVGElement */.xZ)(i)){return n}if(n.includes(i)){return n}const a=(0,s/* .getWindow */.zk)(e).getComputedStyle(i);if(i!==e){if(R(i,a)){n.push(i)}}if(B(i,a)){return n}return r(i.parentNode)}if(!e){return n}return r(e)}function j(e){const[t]=U(e,1);return t!=null?t:null}function V(e){if(!s/* .canUseDOM */.Sw||!e){return null}if((0,s/* .isWindow */.l6)(e)){return e}if(!(0,s/* .isNode */.Ll)(e)){return null}if((0,s/* .isDocument */.wz)(e)||e===(0,s/* .getOwnerDocument */.TW)(e).scrollingElement){return window}if((0,s/* .isHTMLElement */.sb)(e)){return e}return null}function Q(e){if((0,s/* .isWindow */.l6)(e)){return e.scrollX}return e.scrollLeft}function G(e){if((0,s/* .isWindow */.l6)(e)){return e.scrollY}return e.scrollTop}function X(e){return{x:Q(e),y:G(e)}}var Z;(function(e){e[e["Forward"]=1]="Forward";e[e["Backward"]=-1]="Backward"})(Z||(Z={}));function J(e){if(!s/* .canUseDOM */.Sw||!e){return false}return e===document.scrollingElement}function $(e){const t={x:0,y:0};const n=J(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth};const r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};const i=e.scrollTop<=t.y;const a=e.scrollLeft<=t.x;const o=e.scrollTop>=r.y;const s=e.scrollLeft>=r.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:r,minScroll:t}}const ee={x:.2,y:.2};function et(e,t,n,r,i){let{top:a,left:o,right:s,bottom:l}=n;if(r===void 0){r=10}if(i===void 0){i=ee}const{isTop:d,isBottom:c,isLeft:u,isRight:p}=$(e);const v={x:0,y:0};const h={x:0,y:0};const f={height:t.height*i.y,width:t.width*i.x};if(!d&&a<=t.top+f.height){// Scroll Up
v.y=Z.Backward;h.y=r*Math.abs((t.top+f.height-a)/f.height)}else if(!c&&l>=t.bottom-f.height){// Scroll Down
v.y=Z.Forward;h.y=r*Math.abs((t.bottom-f.height-l)/f.height)}if(!p&&s>=t.right-f.width){// Scroll Right
v.x=Z.Forward;h.x=r*Math.abs((t.right-f.width-s)/f.width)}else if(!u&&o<=t.left+f.width){// Scroll Left
v.x=Z.Backward;h.x=r*Math.abs((t.left+f.width-o)/f.width)}return{direction:v,speed:h}}function en(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function er(e){return e.reduce((e,t)=>{return(0,s/* .add */.WQ)(e,X(t))},b)}function ei(e){return e.reduce((e,t)=>{return e+Q(t)},0)}function ea(e){return e.reduce((e,t)=>{return e+G(t)},0)}function eo(e,t){if(t===void 0){t=W}if(!e){return}const{top:n,left:r,bottom:i,right:a}=t(e);const o=j(e);if(!o){return}if(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth){e.scrollIntoView({block:"center",inline:"center"})}}const es=[["x",["left","right"],ei],["y",["top","bottom"],ea]];class el{constructor(e,t){this.rect=void 0;this.width=void 0;this.height=void 0;this.top=void 0;this.bottom=void 0;this.right=void 0;this.left=void 0;const n=U(t);const r=er(n);this.rect={...e};this.width=e.width;this.height=e.height;for(const[e,t,i]of es){for(const a of t){Object.defineProperty(this,a,{get:()=>{const t=i(n);const o=r[e]-t;return this.rect[a]+o},enumerable:true})}}Object.defineProperty(this,"rect",{enumerable:false})}}class ed{constructor(e){this.target=void 0;this.listeners=[];this.removeAll=()=>{this.listeners.forEach(e=>{var t;return(t=this.target)==null?void 0:t.removeEventListener(...e)})};this.target=e}add(e,t,n){var r;(r=this.target)==null?void 0:r.addEventListener(e,t,n);this.listeners.push([e,t,n])}}function ec(e){// If the `event.target` element is removed from the document events will still be targeted
// at it, and hence won't always bubble up to the window or document anymore.
// If there is any risk of an element being removed while it is being dragged,
// the best practice is to attach the event listeners directly to the target.
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
const{EventTarget:t}=(0,s/* .getWindow */.zk)(e);return e instanceof t?e:(0,s/* .getOwnerDocument */.TW)(e)}function eu(e,t){const n=Math.abs(e.x);const r=Math.abs(e.y);if(typeof t==="number"){return Math.sqrt(n**2+r**2)>t}if("x"in t&&"y"in t){return n>t.x&&r>t.y}if("x"in t){return n>t.x}if("y"in t){return r>t.y}return false}var ep;(function(e){e["Click"]="click";e["DragStart"]="dragstart";e["Keydown"]="keydown";e["ContextMenu"]="contextmenu";e["Resize"]="resize";e["SelectionChange"]="selectionchange";e["VisibilityChange"]="visibilitychange"})(ep||(ep={}));function ev(e){e.preventDefault()}function eh(e){e.stopPropagation()}var ef;(function(e){e["Space"]="Space";e["Down"]="ArrowDown";e["Right"]="ArrowRight";e["Left"]="ArrowLeft";e["Up"]="ArrowUp";e["Esc"]="Escape";e["Enter"]="Enter";e["Tab"]="Tab"})(ef||(ef={}));const eg={start:[ef.Space,ef.Enter],cancel:[ef.Esc],end:[ef.Space,ef.Enter,ef.Tab]};const e_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ef.Right:return{...n,x:n.x+25};case ef.Left:return{...n,x:n.x-25};case ef.Down:return{...n,y:n.y+25};case ef.Up:return{...n,y:n.y-25}}return undefined};class em{constructor(e){this.props=void 0;this.autoScrollEnabled=false;this.referenceCoordinates=void 0;this.listeners=void 0;this.windowListeners=void 0;this.props=e;const{event:{target:t}}=e;this.props=e;this.listeners=new ed((0,s/* .getOwnerDocument */.TW)(t));this.windowListeners=new ed((0,s/* .getWindow */.zk)(t));this.handleKeyDown=this.handleKeyDown.bind(this);this.handleCancel=this.handleCancel.bind(this);this.attach()}attach(){this.handleStart();this.windowListeners.add(ep.Resize,this.handleCancel);this.windowListeners.add(ep.VisibilityChange,this.handleCancel);setTimeout(()=>this.listeners.add(ep.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;const n=e.node.current;if(n){eo(n)}t(b)}handleKeyDown(e){if((0,s/* .isKeyboardEvent */.kx)(e)){const{active:t,context:n,options:r}=this.props;const{keyboardCodes:i=eg,coordinateGetter:a=e_,scrollBehavior:o="smooth"}=r;const{code:l}=e;if(i.end.includes(l)){this.handleEnd(e);return}if(i.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:d}=n.current;const c=d?{x:d.left,y:d.top}:b;if(!this.referenceCoordinates){this.referenceCoordinates=c}const u=a(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=(0,s/* .subtract */.Re)(u,c);const r={x:0,y:0};const{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code;const{isTop:a,isRight:s,isLeft:l,isBottom:d,maxScroll:c,minScroll:p}=$(n);const v=en(n);const h={x:Math.min(i===ef.Right?v.right-v.width/2:v.right,Math.max(i===ef.Right?v.left:v.left+v.width/2,u.x)),y:Math.min(i===ef.Down?v.bottom-v.height/2:v.bottom,Math.max(i===ef.Down?v.top:v.top+v.height/2,u.y))};const f=i===ef.Right&&!s||i===ef.Left&&!l;const g=i===ef.Down&&!d||i===ef.Up&&!a;if(f&&h.x!==u.x){const e=n.scrollLeft+t.x;const a=i===ef.Right&&e<=c.x||i===ef.Left&&e>=p.x;if(a&&!t.y){// We don't need to update coordinates, the scroll adjustment alone will trigger
// logic to auto-detect the new container we are over
n.scrollTo({left:e,behavior:o});return}if(a){r.x=n.scrollLeft-e}else{r.x=i===ef.Right?n.scrollLeft-c.x:n.scrollLeft-p.x}if(r.x){n.scrollBy({left:-r.x,behavior:o})}break}else if(g&&h.y!==u.y){const e=n.scrollTop+t.y;const a=i===ef.Down&&e<=c.y||i===ef.Up&&e>=p.y;if(a&&!t.x){// We don't need to update coordinates, the scroll adjustment alone will trigger
// logic to auto-detect the new container we are over
n.scrollTo({top:e,behavior:o});return}if(a){r.y=n.scrollTop-e}else{r.y=i===ef.Down?n.scrollTop-c.y:n.scrollTop-p.y}if(r.y){n.scrollBy({top:-r.y,behavior:o})}break}}this.handleMove(e,(0,s/* .add */.WQ)((0,s/* .subtract */.Re)(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault();n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault();this.detach();t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault();this.detach();t()}detach(){this.listeners.removeAll();this.windowListeners.removeAll()}}em.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=eg,onActivation:i}=t;let{active:a}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const t=a.activatorNode.current;if(t&&e.target!==t){return false}e.preventDefault();i==null?void 0:i({event:e.nativeEvent});return true}return false}}];function eb(e){return Boolean(e&&"distance"in e)}function ey(e){return Boolean(e&&"delay"in e)}class ew{constructor(e,t,n){var r;if(n===void 0){n=ec(e.event.target)}this.props=void 0;this.events=void 0;this.autoScrollEnabled=true;this.document=void 0;this.activated=false;this.initialCoordinates=void 0;this.timeoutId=null;this.listeners=void 0;this.documentListeners=void 0;this.windowListeners=void 0;this.props=e;this.events=t;const{event:i}=e;const{target:a}=i;this.props=e;this.events=t;this.document=(0,s/* .getOwnerDocument */.TW)(a);this.documentListeners=new ed(this.document);this.listeners=new ed(n);this.windowListeners=new ed((0,s/* .getWindow */.zk)(a));this.initialCoordinates=(r=(0,s/* .getEventCoordinates */.e_)(i))!=null?r:b;this.handleStart=this.handleStart.bind(this);this.handleMove=this.handleMove.bind(this);this.handleEnd=this.handleEnd.bind(this);this.handleCancel=this.handleCancel.bind(this);this.handleKeydown=this.handleKeydown.bind(this);this.removeTextSelection=this.removeTextSelection.bind(this);this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;this.listeners.add(e.move.name,this.handleMove,{passive:false});this.listeners.add(e.end.name,this.handleEnd);if(e.cancel){this.listeners.add(e.cancel.name,this.handleCancel)}this.windowListeners.add(ep.Resize,this.handleCancel);this.windowListeners.add(ep.DragStart,ev);this.windowListeners.add(ep.VisibilityChange,this.handleCancel);this.windowListeners.add(ep.ContextMenu,ev);this.documentListeners.add(ep.Keydown,this.handleKeydown);if(t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options})){return this.handleStart()}if(ey(t)){this.timeoutId=setTimeout(this.handleStart,t.delay);this.handlePending(t);return}if(eb(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll();this.windowListeners.removeAll();// Wait until the next event loop before removing document listeners
// This is necessary because we listen for `click` and `selection` events on the document
setTimeout(this.documentListeners.removeAll,50);if(this.timeoutId!==null){clearTimeout(this.timeoutId);this.timeoutId=null}}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this;const{onStart:t}=this.props;if(e){this.activated=true;// Stop propagation of click events once activation constraints are met
this.documentListeners.add(ep.Click,eh,{capture:true});// Remove any text selection from the document
this.removeTextSelection();// Prevent further text selection while dragging
this.documentListeners.add(ep.SelectionChange,this.removeTextSelection);t(e)}}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this;const{onMove:a,options:{activationConstraint:o}}=i;if(!r){return}const l=(t=(0,s/* .getEventCoordinates */.e_)(e))!=null?t:b;const d=(0,s/* .subtract */.Re)(r,l);// Constraint validation
if(!n&&o){if(eb(o)){if(o.tolerance!=null&&eu(d,o.tolerance)){return this.handleCancel()}if(eu(d,o.distance)){return this.handleStart()}}if(ey(o)){if(eu(d,o.tolerance)){return this.handleCancel()}}this.handlePending(o,d);return}if(e.cancelable){e.preventDefault()}a(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach();if(!this.activated){e(this.props.active)}t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach();if(!this.activated){e(this.props.active)}t()}handleKeydown(e){if(e.code===ef.Esc){this.handleCancel()}}removeTextSelection(){var e;(e=this.document.getSelection())==null?void 0:e.removeAllRanges()}}const ex={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eA extends ew{constructor(e){const{event:t}=e;// Pointer events stop firing if the target is unmounted while dragging
// Therefore we attach listeners to the owner document instead
const n=(0,s/* .getOwnerDocument */.TW)(t.target);super(e,ex,n)}}eA.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;if(!n.isPrimary||n.button!==0){return false}r==null?void 0:r({event:n});return true}}];const eY={move:{name:"mousemove"},end:{name:"mouseup"}};var ek;(function(e){e[e["RightClick"]=2]="RightClick"})(ek||(ek={}));class eI extends ew{constructor(e){super(e,eY,(0,s/* .getOwnerDocument */.TW)(e.event.target))}}eI.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;if(n.button===ek.RightClick){return false}r==null?void 0:r({event:n});return true}}];const eD={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class eC extends ew{constructor(e){super(e,eD)}static setup(){// Adding a non-capture and non-passive `touchmove` listener in order
// to force `event.preventDefault()` calls to work in dynamically added
// touchmove event handlers. This is required for iOS Safari.
window.addEventListener(eD.move.name,e,{capture:false,passive:false});return function t(){window.removeEventListener(eD.move.name,e)};// We create a new handler because the teardown function of another sensor
// could remove our event listener if we use a referentially equal listener.
function e(){}}}eC.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;const{touches:i}=n;if(i.length>1){return false}r==null?void 0:r({event:n});return true}}];var eE;(function(e){e[e["Pointer"]=0]="Pointer";e[e["DraggableRect"]=1]="DraggableRect"})(eE||(eE={}));var eq;(function(e){e[e["TreeOrder"]=0]="TreeOrder";e[e["ReversedTreeOrder"]=1]="ReversedTreeOrder"})(eq||(eq={}));function eT(e){let{acceleration:t,activator:n=eE.Pointer,canScroll:i,draggingRect:a,enabled:o,interval:l=5,order:d=eq.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:p,delta:v,threshold:h}=e;const f=eM({delta:v,disabled:!o});const[g,_]=(0,s/* .useInterval */.$$)();const m=(0,r.useRef)({x:0,y:0});const b=(0,r.useRef)({x:0,y:0});const y=(0,r.useMemo)(()=>{switch(n){case eE.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case eE.DraggableRect:return a}},[n,a,c]);const w=(0,r.useRef)(null);const x=(0,r.useCallback)(()=>{const e=w.current;if(!e){return}const t=m.current.x*b.current.x;const n=m.current.y*b.current.y;e.scrollBy(t,n)},[]);const A=(0,r.useMemo)(()=>d===eq.TreeOrder?[...u].reverse():u,[d,u]);(0,r.useEffect)(()=>{if(!o||!u.length||!y){_();return}for(const e of A){if((i==null?void 0:i(e))===false){continue}const n=u.indexOf(e);const r=p[n];if(!r){continue}const{direction:a,speed:o}=et(e,r,y,t,h);for(const e of["x","y"]){if(!f[e][a[e]]){o[e]=0;a[e]=0}}if(o.x>0||o.y>0){_();w.current=e;g(x,l);m.current=o;b.current=a;return}}m.current={x:0,y:0};b.current={x:0,y:0};_()},[t,x,i,_,o,l,JSON.stringify(y),JSON.stringify(f),g,u,A,p,JSON.stringify(h)])}const eS={x:{[Z.Backward]:false,[Z.Forward]:false},y:{[Z.Backward]:false,[Z.Forward]:false}};function eM(e){let{delta:t,disabled:n}=e;const r=(0,s/* .usePrevious */.ZC)(t);return(0,s/* .useLazyMemo */.KG)(e=>{if(n||!r||!e){// Reset scroll intent tracking when auto-scrolling is disabled
return eS}const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};// Keep track of the user intent to scroll in each direction for both axis
return{x:{[Z.Backward]:e.x[Z.Backward]||i.x===-1,[Z.Forward]:e.x[Z.Forward]||i.x===1},y:{[Z.Backward]:e.y[Z.Backward]||i.y===-1,[Z.Forward]:e.y[Z.Forward]||i.y===1}}},[n,t,r])}function eH(e,t){const n=t!=null?e.get(t):undefined;const r=n?n.node.current:null;return(0,s/* .useLazyMemo */.KG)(e=>{var n;if(t==null){return null}// In some cases, the draggable node can unmount while dragging
// This is the case for virtualized lists. In those situations,
// we fall back to the last known value for that node.
return(n=r!=null?r:e)!=null?n:null},[r,t])}function ez(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;const i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var eK;(function(e){e[e["Always"]=0]="Always";e[e["BeforeDragging"]=1]="BeforeDragging";e[e["WhileDragging"]=2]="WhileDragging"})(eK||(eK={}));var eO;(function(e){e["Optimized"]="optimized"})(eO||(eO={}));const eF=/*#__PURE__*/new Map;function eP(e,t){let{dragging:n,dependencies:i,config:a}=t;const[o,l]=(0,r.useState)(null);const{frequency:d,measure:c,strategy:u}=a;const p=(0,r.useRef)(e);const v=m();const h=(0,s/* .useLatestValue */.YN)(v);const f=(0,r.useCallback)(function(e){if(e===void 0){e=[]}if(h.current){return}l(t=>{if(t===null){return e}return t.concat(e.filter(e=>!t.includes(e)))})},[h]);const g=(0,r.useRef)(null);const _=(0,s/* .useLazyMemo */.KG)(t=>{if(v&&!n){return eF}if(!t||t===eF||p.current!==e||o!=null){const t=new Map;for(let n of e){if(!n){continue}if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){// This container does not need to be re-measured
t.set(n.id,n.rect.current);continue}const e=n.node.current;const r=e?new el(c(e),e):null;n.rect.current=r;if(r){t.set(n.id,r)}}return t}return t},[e,o,n,v,c]);(0,r.useEffect)(()=>{p.current=e},[e]);(0,r.useEffect)(()=>{if(v){return}f()},[n,v]);(0,r.useEffect)(()=>{if(o&&o.length>0){l(null)}},[JSON.stringify(o)]);(0,r.useEffect)(()=>{if(v||typeof d!=="number"||g.current!==null){return}g.current=setTimeout(()=>{f();g.current=null},d)},[d,v,f,...i]);return{droppableRects:_,measureDroppableContainers:f,measuringScheduled:o!=null};function m(){switch(u){case eK.Always:return false;case eK.BeforeDragging:return n;default:return!n}}}function eW(e,t){return(0,s/* .useLazyMemo */.KG)(n=>{if(!e){return null}if(n){return n}return typeof t==="function"?t(e):e},[t,e])}function eN(e,t){return eW(e,t)}/**
 * Returns a new MutationObserver instance.
 * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
 */function eL(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */._q)(t);const a=(0,r.useMemo)(()=>{if(n||typeof window==="undefined"||typeof window.MutationObserver==="undefined"){return undefined}const{MutationObserver:e}=window;return new e(i)},[i,n]);(0,r.useEffect)(()=>{return()=>a==null?void 0:a.disconnect()},[a]);return a}/**
 * Returns a new ResizeObserver instance bound to the `onResize` callback.
 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`.
 */function eB(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */._q)(t);const a=(0,r.useMemo)(()=>{if(n||typeof window==="undefined"||typeof window.ResizeObserver==="undefined"){return undefined}const{ResizeObserver:e}=window;return new e(i)},[n]);(0,r.useEffect)(()=>{return()=>a==null?void 0:a.disconnect()},[a]);return a}function eR(e){return new el(W(e),e)}function eU(e,t,n){if(t===void 0){t=eR}const[i,a]=(0,r.useState)(null);function o(){a(r=>{if(!e){return null}if(e.isConnected===false){var i;// Fall back to last rect we measured if the element is
// no longer connected to the DOM.
return(i=r!=null?r:n)!=null?i:null}const a=t(e);if(JSON.stringify(r)===JSON.stringify(a)){return r}return a})}const l=eL({callback(t){if(!e){return}for(const n of t){const{type:t,target:r}=n;if(t==="childList"&&r instanceof HTMLElement&&r.contains(e)){o();break}}}});const d=eB({callback:o});(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{o();if(e){d==null?void 0:d.observe(e);l==null?void 0:l.observe(document.body,{childList:true,subtree:true})}else{d==null?void 0:d.disconnect();l==null?void 0:l.disconnect()}},[e]);return i}function ej(e){const t=eW(e);return H(e,t)}const eV=[];function eQ(e){const t=(0,r.useRef)(e);const n=(0,s/* .useLazyMemo */.KG)(n=>{if(!e){return eV}if(n&&n!==eV&&e&&t.current&&e.parentNode===t.current.parentNode){return n}return U(e)},[e]);(0,r.useEffect)(()=>{t.current=e},[e]);return n}function eG(e){const[t,n]=(0,r.useState)(null);const i=(0,r.useRef)(e);// To-do: Throttle the handleScroll callback
const a=(0,r.useCallback)(e=>{const t=V(e.target);if(!t){return}n(e=>{if(!e){return null}e.set(t,X(t));return new Map(e)})},[]);(0,r.useEffect)(()=>{const t=i.current;if(e!==t){r(t);const o=e.map(e=>{const t=V(e);if(t){t.addEventListener("scroll",a,{passive:true});return[t,X(t)]}return null}).filter(e=>e!=null);n(o.length?new Map(o):null);i.current=e}return()=>{r(e);r(t)};function r(e){e.forEach(e=>{const t=V(e);t==null?void 0:t.removeEventListener("scroll",a)})}},[a,e]);return(0,r.useMemo)(()=>{if(e.length){return t?Array.from(t.values()).reduce((e,t)=>(0,s/* .add */.WQ)(e,t),b):er(e)}return b},[e,t])}function eX(e,t){if(t===void 0){t=[]}const n=(0,r.useRef)(null);(0,r.useEffect)(()=>{n.current=null},t);(0,r.useEffect)(()=>{const t=e!==b;if(t&&!n.current){n.current=e}if(!t&&n.current){n.current=null}},[e]);return n.current?(0,s/* .subtract */.Re)(e,n.current):b}function eZ(e){(0,r.useEffect)(()=>{if(!s/* .canUseDOM */.Sw){return}const t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(const e of t){e==null?void 0:e()}}},// eslint-disable-next-line react-hooks/exhaustive-deps
e.map(e=>{let{sensor:t}=e;return t}))}function eJ(e,t){return(0,r.useMemo)(()=>{return e.reduce((e,n)=>{let{eventName:r,handler:i}=n;e[r]=e=>{i(e,t)};return e},{})},[e,t])}function e$(e){return(0,r.useMemo)(()=>e?L(e):null,[e])}const e0=[];function e1(e,t){if(t===void 0){t=W}const[n]=e;const i=e$(n?(0,s/* .getWindow */.zk)(n):null);const[a,o]=(0,r.useState)(e0);function l(){o(()=>{if(!e.length){return e0}return e.map(e=>J(e)?i:new el(t(e),e))})}const d=eB({callback:l});(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{d==null?void 0:d.disconnect();l();e.forEach(e=>d==null?void 0:d.observe(e))},[e]);return a}function e2(e){if(!e){return null}if(e.children.length>1){return e}const t=e.children[0];return(0,s/* .isHTMLElement */.sb)(t)?t:e}function e4(e){let{measure:t}=e;const[n,i]=(0,r.useState)(null);const a=(0,r.useCallback)(e=>{for(const{target:n}of e){if((0,s/* .isHTMLElement */.sb)(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}}},[t]);const o=eB({callback:a});const l=(0,r.useCallback)(e=>{const n=e2(e);o==null?void 0:o.disconnect();if(n){o==null?void 0:o.observe(n)}i(n?t(n):null)},[t,o]);const[d,c]=(0,s/* .useNodeRef */.lk)(l);return(0,r.useMemo)(()=>({nodeRef:d,rect:n,setRef:c}),[n,d,c])}const e6=[{sensor:eA,options:{}},{sensor:em,options:{}}];const e5={current:{}};const e8={draggable:{measure:N},droppable:{measure:N,strategy:eK.WhileDragging,frequency:eO.Optimized},dragOverlay:{measure:W}};class e3 extends Map{get(e){var t;return e!=null?(t=super.get(e))!=null?t:undefined:undefined}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return(t=(n=this.get(e))==null?void 0:n.node.current)!=null?t:undefined}}const e7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new e3,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:g},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:e8,measureDroppableContainers:g,windowRect:null,measuringScheduled:false};const e9={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:g,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:g};const te=/*#__PURE__*/(0,r.createContext)(e9);const tt=/*#__PURE__*/(0,r.createContext)(e7);function tn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e3}}}function tr(e,t){switch(t.type){case f.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case f.DragMove:if(e.draggable.active==null){return e}return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case f.DragEnd:case f.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case f.RegisterDroppable:{const{element:n}=t;const{id:r}=n;const i=new e3(e.droppable.containers);i.set(r,n);return{...e,droppable:{...e.droppable,containers:i}}}case f.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t;const a=e.droppable.containers.get(n);if(!a||r!==a.key){return e}const o=new e3(e.droppable.containers);o.set(n,{...a,disabled:i});return{...e,droppable:{...e.droppable,containers:o}}}case f.UnregisterDroppable:{const{id:n,key:r}=t;const i=e.droppable.containers.get(n);if(!i||r!==i.key){return e}const a=new e3(e.droppable.containers);a.delete(n);return{...e,droppable:{...e.droppable,containers:a}}}default:{return e}}}function ti(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=(0,r.useContext)(te);const o=(0,s/* .usePrevious */.ZC)(i);const l=(0,s/* .usePrevious */.ZC)(n==null?void 0:n.id);// Restore keyboard focus on the activator node
(0,r.useEffect)(()=>{if(t){return}if(!i&&o&&l!=null){if(!(0,s/* .isKeyboardEvent */.kx)(o)){return}if(document.activeElement===o.target){// No need to restore focus
return}const e=a.get(l);if(!e){return}const{activatorNode:t,node:n}=e;if(!t.current&&!n.current){return}requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e){continue}const t=(0,s/* .findFirstFocusableNode */.ag)(e);if(t){t.focus();break}}})}},[i,t,a,l,o]);return null}function ta(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>{return t({transform:e,...r})},n):n}function to(e){return(0,r.useMemo)(()=>({draggable:{...e8.draggable,...e==null?void 0:e.draggable},droppable:{...e8.droppable,...e==null?void 0:e.droppable},dragOverlay:{...e8.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ts(e){let{activeNode:t,measure:n,initialRect:i,config:a=true}=e;const o=(0,r.useRef)(false);const{x:l,y:d}=typeof a==="boolean"?{x:a,y:a}:a;(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{const e=!l&&!d;if(e||!t){o.current=false;return}if(o.current||!i){// Return early if layout shift scroll compensation was already attempted
// or if there is no initialRect to compare to.
return}// Get the most up to date node ref for the active draggable
const r=t==null?void 0:t.node.current;if(!r||r.isConnected===false){// Return early if there is no attached node ref or if the node is
// disconnected from the document.
return}const a=n(r);const s=H(a,i);if(!l){s.x=0}if(!d){s.y=0}// Only perform layout shift scroll compensation once
o.current=true;if(Math.abs(s.x)>0||Math.abs(s.y)>0){const e=j(r);if(e){e.scrollBy({top:s.y,left:s.x})}}},[t,l,d,i,n])}const tl=/*#__PURE__*/(0,r.createContext)({...b,scaleX:1,scaleY:1});var td;(function(e){e[e["Uninitialized"]=0]="Uninitialized";e[e["Initializing"]=1]="Initializing";e[e["Initialized"]=2]="Initialized"})(td||(td={}));const tc=/*#__PURE__*/(0,r.memo)(function e(e){var t,n,o,l;let{id:c,accessibility:p,autoScroll:v=true,children:g,sensors:_=e6,collisionDetection:m=q,measuring:b,modifiers:y,...w}=e;const x=(0,r.useReducer)(tr,undefined,tn);const[A,Y]=x;const[I,D]=u();const[C,E]=(0,r.useState)(td.Uninitialized);const T=C===td.Initialized;const{draggable:{active:S,nodes:H,translate:z},droppable:{containers:O}}=A;const F=S!=null?H.get(S):null;const P=(0,r.useRef)({initial:null,translated:null});const W=(0,r.useMemo)(()=>{var e;return S!=null?{id:S,// It's possible for the active node to unmount while dragging
data:(e=F==null?void 0:F.data)!=null?e:e5,rect:P}:null},[S,F]);const N=(0,r.useRef)(null);const[L,B]=(0,r.useState)(null);const[R,U]=(0,r.useState)(null);const j=(0,s/* .useLatestValue */.YN)(w,Object.values(w));const V=(0,s/* .useUniqueId */.YG)("DndDescribedBy",c);const Q=(0,r.useMemo)(()=>O.getEnabled(),[O]);const G=to(b);const{droppableRects:X,measureDroppableContainers:Z,measuringScheduled:J}=eP(Q,{dragging:T,dependencies:[z.x,z.y],config:G.droppable});const $=eH(H,S);const ee=(0,r.useMemo)(()=>R?(0,s/* .getEventCoordinates */.e_)(R):null,[R]);const et=eO();const en=eN($,G.draggable.measure);ts({activeNode:S!=null?H.get(S):null,config:et.layoutShiftCompensation,initialRect:en,measure:G.draggable.measure});const er=eU($,G.draggable.measure,en);const ei=eU($?$.parentElement:null);const ea=(0,r.useRef)({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null});const eo=O.getNodeFor((t=ea.current.over)==null?void 0:t.id);const es=e4({measure:G.dragOverlay.measure});// Use the rect of the drag overlay if it is mounted
const el=(n=es.nodeRef.current)!=null?n:$;const ed=T?(o=es.rect)!=null?o:er:null;const ec=Boolean(es.nodeRef.current&&es.rect);// The delta between the previous and new position of the draggable node
// is only relevant when there is no drag overlay
const eu=ej(ec?null:er);// Get the window rect of the dragging node
const ep=e$(el?(0,s/* .getWindow */.zk)(el):null);// Get scrollable ancestors of the dragging node
const ev=eQ(T?eo!=null?eo:$:null);const eh=e1(ev);// Apply modifiers
const ef=ta(y,{transform:{x:z.x-eu.x,y:z.y-eu.y,scaleX:1,scaleY:1},activatorEvent:R,active:W,activeNodeRect:er,containerNodeRect:ei,draggingNodeRect:ed,over:ea.current.over,overlayNodeRect:es.rect,scrollableAncestors:ev,scrollableAncestorRects:eh,windowRect:ep});const eg=ee?(0,s/* .add */.WQ)(ee,z):null;const e_=eG(ev);// Represents the scroll delta since dragging was initiated
const em=eX(e_);// Represents the scroll delta since the last time the active node rect was measured
const eb=eX(e_,[er]);const ey=(0,s/* .add */.WQ)(ef,em);const ew=ed?K(ed,ef):null;const ex=W&&ew?m({active:W,collisionRect:ew,droppableRects:X,droppableContainers:Q,pointerCoordinates:eg}):null;const eA=k(ex,"id");const[eY,ek]=(0,r.useState)(null);// When there is no drag overlay used, we need to account for the
// window scroll delta
const eI=ec?ef:(0,s/* .add */.WQ)(ef,eb);const eD=M(eI,(l=eY==null?void 0:eY.rect)!=null?l:null,er);const eC=(0,r.useRef)(null);const eE=(0,r.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(N.current==null){return}const i=H.get(N.current);if(!i){return}const o=e.nativeEvent;const s=new n({active:N.current,activeNode:i,event:o,options:r,// Sensors need to be instantiated with refs for arguments that change over time
// otherwise they are frozen in time with the stale arguments
context:ea,onAbort(e){const t=H.get(e);if(!t){return}const{onDragAbort:n}=j.current;const r={id:e};n==null?void 0:n(r);I({type:"onDragAbort",event:r})},onPending(e,t,n,r){const i=H.get(e);if(!i){return}const{onDragPending:a}=j.current;const o={id:e,constraint:t,initialCoordinates:n,offset:r};a==null?void 0:a(o);I({type:"onDragPending",event:o})},onStart(e){const t=N.current;if(t==null){return}const n=H.get(t);if(!n){return}const{onDragStart:r}=j.current;const i={activatorEvent:o,active:{id:t,data:n.data,rect:P}};(0,a.unstable_batchedUpdates)(()=>{r==null?void 0:r(i);E(td.Initializing);Y({type:f.DragStart,initialCoordinates:e,active:t});I({type:"onDragStart",event:i});B(eC.current);U(o)})},onMove(e){Y({type:f.DragMove,coordinates:e})},onEnd:l(f.DragEnd),onCancel:l(f.DragCancel)});eC.current=s;function l(e){return async function t(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=ea.current;let s=null;if(t&&i){const{cancelDrop:a}=j.current;s={activatorEvent:o,active:t,collisions:n,delta:i,over:r};if(e===f.DragEnd&&typeof a==="function"){const t=await Promise.resolve(a(s));if(t){e=f.DragCancel}}}N.current=null;(0,a.unstable_batchedUpdates)(()=>{Y({type:e});E(td.Uninitialized);ek(null);B(null);U(null);eC.current=null;const t=e===f.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=j.current[t];e==null?void 0:e(s);I({type:t,event:s})}})}}},[H]);const eq=(0,r.useCallback)((e,t)=>{return(n,r)=>{const i=n.nativeEvent;const a=H.get(r);if(N.current!==null||// No active draggable
!a||// Event has already been captured
i.dndKit||i.defaultPrevented){return}const o={active:a};const s=e(n,t.options,o);if(s===true){i.dndKit={capturedBy:t.sensor};N.current=r;eE(n,t)}}},[H,eE]);const eS=ez(_,eq);eZ(_);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{if(er&&C===td.Initializing){E(td.Initialized)}},[er,C]);(0,r.useEffect)(()=>{const{onDragMove:e}=j.current;const{active:t,activatorEvent:n,collisions:r,over:i}=ea.current;if(!t||!n){return}const o={active:t,activatorEvent:n,collisions:r,delta:{x:ey.x,y:ey.y},over:i};(0,a.unstable_batchedUpdates)(()=>{e==null?void 0:e(o);I({type:"onDragMove",event:o})})},[ey.x,ey.y]);(0,r.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=ea.current;if(!e||N.current==null||!t||!i){return}const{onDragOver:o}=j.current;const s=r.get(eA);const l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null;const d={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,a.unstable_batchedUpdates)(()=>{ek(l);o==null?void 0:o(d);I({type:"onDragOver",event:d})})},[eA]);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{ea.current={activatorEvent:R,active:W,activeNode:$,collisionRect:ew,collisions:ex,droppableRects:X,draggableNodes:H,draggingNode:el,draggingNodeRect:ed,droppableContainers:O,over:eY,scrollableAncestors:ev,scrollAdjustedTranslate:ey};P.current={initial:ed,translated:ew}},[W,$,ex,ew,H,el,ed,X,O,eY,ev,ey]);eT({...et,delta:z,draggingRect:ew,pointerCoordinates:eg,scrollableAncestors:ev,scrollableAncestorRects:eh});const eM=(0,r.useMemo)(()=>{const e={active:W,activeNode:$,activeNodeRect:er,activatorEvent:R,collisions:ex,containerNodeRect:ei,dragOverlay:es,draggableNodes:H,droppableContainers:O,droppableRects:X,over:eY,measureDroppableContainers:Z,scrollableAncestors:ev,scrollableAncestorRects:eh,measuringConfiguration:G,measuringScheduled:J,windowRect:ep};return e},[W,$,er,R,ex,ei,es,H,O,X,eY,Z,ev,eh,G,J,ep]);const eK=(0,r.useMemo)(()=>{const e={activatorEvent:R,activators:eS,active:W,activeNodeRect:er,ariaDescribedById:{draggable:V},dispatch:Y,draggableNodes:H,over:eY,measureDroppableContainers:Z};return e},[R,eS,W,er,Y,V,H,eY,Z]);return i().createElement(d.Provider,{value:D},i().createElement(te.Provider,{value:eK},i().createElement(tt.Provider,{value:eM},i().createElement(tl.Provider,{value:eD},g)),i().createElement(ti,{disabled:(p==null?void 0:p.restoreFocus)===false})),i().createElement(h,{...p,hiddenTextDescribedById:V}));function eO(){const e=(L==null?void 0:L.autoScrollEnabled)===false;const t=typeof v==="object"?v.enabled===false:v===false;const n=T&&!e&&!t;if(typeof v==="object"){return{...v,enabled:n}}return{enabled:n}}});const tu=/*#__PURE__*/(0,r.createContext)(null);const tp="button";const tv="Draggable";function th(e){let{id:t,data:n,disabled:i=false,attributes:a}=e;const o=(0,s/* .useUniqueId */.YG)(tv);const{activators:l,activatorEvent:d,active:c,activeNodeRect:u,ariaDescribedById:p,draggableNodes:v,over:h}=(0,r.useContext)(te);const{role:f=tp,roleDescription:g="draggable",tabIndex:_=0}=a!=null?a:{};const m=(c==null?void 0:c.id)===t;const b=(0,r.useContext)(m?tl:tu);const[y,w]=(0,s/* .useNodeRef */.lk)();const[x,A]=(0,s/* .useNodeRef */.lk)();const Y=eJ(l,t);const k=(0,s/* .useLatestValue */.YN)(n);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{v.set(t,{id:t,key:o,node:y,activatorNode:x,data:k});return()=>{const e=v.get(t);if(e&&e.key===o){v.delete(t)}}},[v,t]);const I=(0,r.useMemo)(()=>({role:f,tabIndex:_,"aria-disabled":i,"aria-pressed":m&&f===tp?true:undefined,"aria-roledescription":g,"aria-describedby":p.draggable}),[i,f,_,m,g,p.draggable]);return{active:c,activatorEvent:d,activeNodeRect:u,attributes:I,isDragging:m,listeners:i?undefined:Y,node:y,over:h,setNodeRef:w,setActivatorNodeRef:A,transform:b}}function tf(){return(0,r.useContext)(tt)}const tg="Droppable";const t_={timeout:25};function tm(e){let{data:t,disabled:n=false,id:i,resizeObserverConfig:a}=e;const o=(0,s/* .useUniqueId */.YG)(tg);const{active:l,dispatch:d,over:c,measureDroppableContainers:u}=(0,r.useContext)(te);const p=(0,r.useRef)({disabled:n});const v=(0,r.useRef)(false);const h=(0,r.useRef)(null);const g=(0,r.useRef)(null);const{disabled:_,updateMeasurementsFor:m,timeout:b}={...t_,...a};const y=(0,s/* .useLatestValue */.YN)(m!=null?m:i);const w=(0,r.useCallback)(()=>{if(!v.current){// ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
// assuming the element is rendered and displayed.
v.current=true;return}if(g.current!=null){clearTimeout(g.current)}g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]);g.current=null},b)},[b]);const x=eB({callback:w,disabled:_||!l});const A=(0,r.useCallback)((e,t)=>{if(!x){return}if(t){x.unobserve(t);v.current=false}if(e){x.observe(e)}},[x]);const[Y,k]=(0,s/* .useNodeRef */.lk)(A);const I=(0,s/* .useLatestValue */.YN)(t);(0,r.useEffect)(()=>{if(!x||!Y.current){return}x.disconnect();v.current=false;x.observe(Y.current)},[Y,x]);(0,r.useEffect)(()=>{d({type:f.RegisterDroppable,element:{id:i,key:o,disabled:n,node:Y,rect:h,data:I}});return()=>d({type:f.UnregisterDroppable,key:o,id:i})},[i]);(0,r.useEffect)(()=>{if(n!==p.current.disabled){d({type:f.SetDroppableDisabled,id:i,key:o,disabled:n});p.current.disabled=n}},[i,o,n,d]);return{active:l,rect:h,isOver:(c==null?void 0:c.id)===i,node:Y,over:c,setNodeRef:k}}function tb(e){let{animation:t,children:n}=e;const[a,o]=(0,r.useState)(null);const[l,d]=(0,r.useState)(null);const c=(0,s/* .usePrevious */.ZC)(n);if(!n&&!a&&c){o(c)}(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{if(!l){return}const e=a==null?void 0:a.key;const n=a==null?void 0:a.props.id;if(e==null||n==null){o(null);return}Promise.resolve(t(n,l)).then(()=>{o(null)})},[t,a,l]);return i().createElement(i().Fragment,null,n,a?(0,r.cloneElement)(a,{ref:d}):null)}const ty={x:0,y:0,scaleX:1,scaleY:1};function tw(e){let{children:t}=e;return i().createElement(te.Provider,{value:e9},i().createElement(tl.Provider,{value:ty},t))}const tx={position:"fixed",touchAction:"none"};const tA=e=>{const t=(0,s/* .isKeyboardEvent */.kx)(e);return t?"transform 250ms ease":undefined};const tY=/*#__PURE__*/(0,r.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:o,className:l,rect:d,style:c,transform:u,transition:p=tA}=e;if(!d){return null}const v=a?u:{...u,scaleX:1,scaleY:1};const h={...tx,width:d.width,height:d.height,top:d.top,left:d.left,transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(v),transformOrigin:a&&r?w(r,d):undefined,transition:typeof p==="function"?p(r):p,...c};return i().createElement(n,{className:l,style:h,ref:t},o)});const tk=e=>t=>{let{active:n,dragOverlay:r}=t;const i={};const{styles:a,className:o}=e;if(a!=null&&a.active){for(const[e,t]of Object.entries(a.active)){if(t===undefined){continue}i[e]=n.node.style.getPropertyValue(e);n.node.style.setProperty(e,t)}}if(a!=null&&a.dragOverlay){for(const[e,t]of Object.entries(a.dragOverlay)){if(t===undefined){continue}r.node.style.setProperty(e,t)}}if(o!=null&&o.active){n.node.classList.add(o.active)}if(o!=null&&o.dragOverlay){r.node.classList.add(o.dragOverlay)}return function e(){for(const[e,t]of Object.entries(i)){n.node.style.setProperty(e,t)}if(o!=null&&o.active){n.node.classList.remove(o.active)}}};const tI=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(t)},{transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(n)}]};const tD={duration:250,easing:"ease",keyframes:tI,sideEffects:/*#__PURE__*/tk({styles:{active:{opacity:"0"}}})};function tC(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return(0,s/* .useEvent */._q)((e,a)=>{if(t===null){return}const o=n.get(e);if(!o){return}const l=o.node.current;if(!l){return}const d=e2(a);if(!d){return}const{transform:c}=(0,s/* .getWindow */.zk)(a).getComputedStyle(a);const u=O(c);if(!u){return}const p=typeof t==="function"?t:tE(t);eo(l,i.draggable.measure);return p({active:{id:e,data:o.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function tE(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...tD,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...l}=e;if(!t){// Do not animate if animation duration is zero.
return}const d={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top};const c={scaleX:s.scaleX!==1?a.rect.width*s.scaleX/o.rect.width:1,scaleY:s.scaleY!==1?a.rect.height*s.scaleY/o.rect.height:1};const u={x:s.x-d.x,y:s.y-d.y,...c};const p=i({...l,active:a,dragOverlay:o,transform:{initial:s,final:u}});const[v]=p;const h=p[p.length-1];if(JSON.stringify(v)===JSON.stringify(h)){// The start and end keyframes are the same, infer that there is no animation needed.
return}const f=r==null?void 0:r({active:a,dragOverlay:o,...l});const g=o.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{f==null?void 0:f();e()}})}}let tq=0;function tT(e){return(0,r.useMemo)(()=>{if(e==null){return}tq++;return tq},[e])}const tS=/*#__PURE__*/i().memo(e=>{let{adjustScale:t=false,children:n,dropAnimation:a,style:o,transition:s,modifiers:l,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:p,active:v,activeNodeRect:h,containerNodeRect:f,draggableNodes:g,droppableContainers:_,dragOverlay:m,over:b,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:A}=tf();const Y=(0,r.useContext)(tl);const k=tT(v==null?void 0:v.id);const I=ta(l,{activatorEvent:p,active:v,activeNodeRect:h,containerNodeRect:f,draggingNodeRect:m.rect,over:b,overlayNodeRect:m.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:Y,windowRect:A});const D=eW(h);const C=tC({config:a,draggableNodes:g,droppableContainers:_,measuringConfiguration:y});// We need to wait for the active node to be measured before connecting the drag overlay ref
// otherwise collisions can be computed against a mispositioned drag overlay
const E=D?m.setRef:undefined;return i().createElement(tw,null,i().createElement(tb,{animation:C},v&&k?i().createElement(tY,{key:k,id:v.id,ref:E,as:d,activatorEvent:p,adjustScale:t,className:c,transition:s,rect:D,style:{zIndex:u,...o},transform:I},n):null))});//# sourceMappingURL=core.esm.js.map
},18831:function(e,t,n){n.d(t,{Q_:()=>c});/* import */var r=n(74979);function i(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const a=e=>{let{transform:t}=e;return{...t,y:0}};function o(e,t,n){const r={...e};if(t.top+e.y<=n.top){r.y=n.top-t.top}else if(t.bottom+e.y>=n.top+n.height){r.y=n.top+n.height-t.bottom}if(t.left+e.x<=n.left){r.x=n.left-t.left}else if(t.right+e.x>=n.left+n.width){r.x=n.left+n.width-t.right}return r}const s=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;if(!n||!t){return r}return o(r,n,t)};const l=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const i=r[0];if(!t||!i){return n}return o(n,t,i)};const d=e=>{let{transform:t}=e;return{...t,x:0}};const c=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;if(!n||!r){return t}return o(t,n,r)};const u=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:r}=e;if(n&&t){const e=getEventCoordinates(t);if(!e){return r}const i=e.x-n.left;const a=e.y-n.top;return{...r,x:r.x+i-n.width/2,y:r.y+a-n.height/2}}return r};//# sourceMappingURL=modifiers.esm.js.map
},43627:function(e,t,n){n.d(t,{JR:()=>z,_G:()=>b,gB:()=>A,gl:()=>T,uU:()=>k});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(15871);/* import */var o=n(74979);/**
 * Move an array item to a different position. Returns a new array with the item moved to the new position.
 */function s(e,t,n){const r=e.slice();r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]);return r}/**
 * Swap an array item to a different position. Returns a new array with the item swapped to the new position.
 */function l(e,t,n){const r=e.slice();r[t]=e[n];r[n]=e[t];return r}function d(e,t){return e.reduce((e,n,r)=>{const i=t.get(n);if(i){e[r]=i}return e},Array(e.length))}function c(e){return e!==null&&e>=0}function u(e,t){if(e===t){return true}if(e.length!==t.length){return false}for(let n=0;n<e.length;n++){if(e[n]!==t[n]){return false}}return true}function p(e){if(typeof e==="boolean"){return{draggable:e,droppable:e}}return e}// To-do: We should be calculating scale transformation
const v=/* unused pure expression or super */null&&{scaleX:1,scaleY:1};const h=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:a,index:o}=e;const s=(t=n[i])!=null?t:r;if(!s){return null}const l=f(n,o,i);if(o===i){const e=n[a];if(!e){return null}return{x:i<a?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...v}}if(o>i&&o<=a){return{x:-s.width-l,y:0,...v}}if(o<i&&o>=a){return{x:s.width+l,y:0,...v}}return{x:0,y:0,...v}};function f(e,t,n){const r=e[t];const i=e[t-1];const a=e[t+1];if(!r||!i&&!a){return 0}if(n<t){return i?r.left-(i.left+i.width):a.left-(r.left+r.width)}return a?a.left-(r.left+r.width):r.left-(i.left+i.width)}const g=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const a=s(t,r,n);const o=t[i];const l=a[i];if(!l||!o){return null}return{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}};const _=e=>{let{activeIndex:t,index:n,rects:r,overIndex:i}=e;let a;let o;if(n===t){a=r[n];o=r[i]}if(n===i){a=r[n];o=r[t]}if(!o||!a){return null}return{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}};// To-do: We should be calculating scale transformation
const m={scaleX:1,scaleY:1};const b=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:a,overIndex:o}=e;const s=(t=a[n])!=null?t:r;if(!s){return null}if(i===n){const e=a[o];if(!e){return null}return{x:0,y:n<o?e.top+e.height-(s.top+s.height):e.top-s.top,...m}}const l=y(a,i,n);if(i>n&&i<=o){return{x:0,y:-s.height-l,...m}}if(i<n&&i>=o){return{x:0,y:s.height+l,...m}}return{x:0,y:0,...m}};function y(e,t,n){const r=e[t];const i=e[t-1];const a=e[t+1];if(!r){return 0}if(n<t){return i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0}return a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0}const w="Sortable";const x=/*#__PURE__*/i().createContext({activeIndex:-1,containerId:w,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:g,disabled:{draggable:false,droppable:false}});function A(e){let{children:t,id:n,items:s,strategy:l=g,disabled:c=false}=e;const{active:v,dragOverlay:h,droppableRects:f,over:_,measureDroppableContainers:m}=(0,a/* .useDndContext */.fF)();const b=(0,o/* .useUniqueId */.YG)(w,n);const y=Boolean(h.rect!==null);const A=(0,r.useMemo)(()=>s.map(e=>typeof e==="object"&&"id"in e?e.id:e),[s]);const Y=v!=null;const k=v?A.indexOf(v.id):-1;const I=_?A.indexOf(_.id):-1;const D=(0,r.useRef)(A);const C=!u(A,D.current);const E=I!==-1&&k===-1||C;const q=p(c);(0,o/* .useIsomorphicLayoutEffect */.Es)(()=>{if(C&&Y){m(A)}},[C,A,Y,m]);(0,r.useEffect)(()=>{D.current=A},[A]);const T=(0,r.useMemo)(()=>({activeIndex:k,containerId:b,disabled:q,disableTransforms:E,items:A,overIndex:I,useDragOverlay:y,sortedRects:d(A,f),strategy:l}),[k,b,q.draggable,q.droppable,E,A,I,f,y,l]);return i().createElement(x.Provider,{value:T},t)}const Y=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return s(n,r,i).indexOf(t)};const k=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:d}=e;if(!d||!r){return false}if(s!==a&&i===o){return false}if(n){return true}return o!==i&&t===l};const I={duration:200,easing:"ease"};const D="transform";const C=/*#__PURE__*/o/* .CSS.Transition.toString */.Ks.Transition.toString({property:D,duration:0,easing:"linear"});const E={roleDescription:"sortable"};/*
 * When the index of an item changes while sorting,
 * we need to temporarily disable the transforms
 */function q(e){let{disabled:t,index:n,node:i,rect:s}=e;const[l,d]=(0,r.useState)(null);const c=(0,r.useRef)(n);(0,o/* .useIsomorphicLayoutEffect */.Es)(()=>{if(!t&&n!==c.current&&i.current){const e=s.current;if(e){const t=(0,a/* .getClientRect */.Sj)(i.current,{ignoreTransform:true});const n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};if(n.x||n.y){d(n)}}}if(n!==c.current){c.current=n}},[t,n,i,s]);(0,r.useEffect)(()=>{if(l){d(null)}},[l]);return l}function T(e){let{animateLayoutChanges:t=k,attributes:n,disabled:i,data:s,getNewIndex:l=Y,id:d,strategy:u,resizeObserverConfig:p,transition:v=I}=e;const{items:h,containerId:f,activeIndex:g,disabled:_,disableTransforms:m,sortedRects:b,overIndex:y,useDragOverlay:w,strategy:A}=(0,r.useContext)(x);const T=S(i,_);const M=h.indexOf(d);const H=(0,r.useMemo)(()=>({sortable:{containerId:f,index:M,items:h},...s}),[f,s,M,h]);const z=(0,r.useMemo)(()=>h.slice(h.indexOf(d)),[h,d]);const{rect:K,node:O,isOver:F,setNodeRef:P}=(0,a/* .useDroppable */.zM)({id:d,data:H,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:z,...p}});const{active:W,activatorEvent:N,activeNodeRect:L,attributes:B,setNodeRef:R,listeners:U,isDragging:j,over:V,setActivatorNodeRef:Q,transform:G}=(0,a/* .useDraggable */.PM)({id:d,data:H,attributes:{...E,...n},disabled:T.draggable});const X=(0,o/* .useCombinedRefs */.jn)(P,R);const Z=Boolean(W);const J=Z&&!m&&c(g)&&c(y);const $=!w&&j;const ee=$&&J?G:null;const et=u!=null?u:A;const en=J?ee!=null?ee:et({rects:b,activeNodeRect:L,activeIndex:g,overIndex:y,index:M}):null;const er=c(g)&&c(y)?l({id:d,items:h,activeIndex:g,overIndex:y}):M;const ei=W==null?void 0:W.id;const ea=(0,r.useRef)({activeId:ei,items:h,newIndex:er,containerId:f});const eo=h!==ea.current.items;const es=t({active:W,containerId:f,isDragging:j,isSorting:Z,id:d,index:M,items:h,newIndex:ea.current.newIndex,previousItems:ea.current.items,previousContainerId:ea.current.containerId,transition:v,wasDragging:ea.current.activeId!=null});const el=q({disabled:!es,index:M,node:O,rect:K});(0,r.useEffect)(()=>{if(Z&&ea.current.newIndex!==er){ea.current.newIndex=er}if(f!==ea.current.containerId){ea.current.containerId=f}if(h!==ea.current.items){ea.current.items=h}},[Z,er,f,h]);(0,r.useEffect)(()=>{if(ei===ea.current.activeId){return}if(ei!=null&&ea.current.activeId==null){ea.current.activeId=ei;return}const e=setTimeout(()=>{ea.current.activeId=ei},50);return()=>clearTimeout(e)},[ei]);return{active:W,activeIndex:g,attributes:B,data:H,rect:K,index:M,newIndex:er,items:h,isOver:F,isSorting:Z,isDragging:j,listeners:U,node:O,overIndex:y,over:V,setNodeRef:X,setActivatorNodeRef:Q,setDroppableNodeRef:P,setDraggableNodeRef:R,transform:el!=null?el:en,transition:ed()};function ed(){if(el||// Or to prevent items jumping to back to their "new" position when items change
eo&&ea.current.newIndex===M){return C}if($&&!(0,o/* .isKeyboardEvent */.kx)(N)||!v){return undefined}if(Z||es){return o/* .CSS.Transition.toString */.Ks.Transition.toString({...v,property:D})}return undefined}}function S(e,t){var n,r;if(typeof e==="boolean"){return{draggable:e,// Backwards compatibility
droppable:false}}return{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function M(e){if(!e){return false}const t=e.data.current;if(t&&"sortable"in t&&typeof t.sortable==="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable){return true}return false}const H=[a/* .KeyboardCode.Down */.vL.Down,a/* .KeyboardCode.Right */.vL.Right,a/* .KeyboardCode.Up */.vL.Up,a/* .KeyboardCode.Left */.vL.Left];const z=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:l,scrollableAncestors:d}}=t;if(H.includes(e.code)){e.preventDefault();if(!n||!r){return}const t=[];s.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled){return}const o=i.get(n.id);if(!o){return}switch(e.code){case a/* .KeyboardCode.Down */.vL.Down:if(r.top<o.top){t.push(n)}break;case a/* .KeyboardCode.Up */.vL.Up:if(r.top>o.top){t.push(n)}break;case a/* .KeyboardCode.Left */.vL.Left:if(r.left>o.left){t.push(n)}break;case a/* .KeyboardCode.Right */.vL.Right:if(r.left<o.left){t.push(n)}break}});const c=(0,a/* .closestCorners */.y$)({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null});let u=(0,a/* .getFirstCollision */.Vy)(c,"id");if(u===(l==null?void 0:l.id)&&c.length>1){u=c[1].id}if(u!=null){const e=s.get(n.id);const t=s.get(u);const l=t?i.get(t.id):null;const c=t==null?void 0:t.node.current;if(c&&l&&e&&t){const n=(0,a/* .getScrollableAncestors */.sl)(c);const i=n.some((e,t)=>d[t]!==e);const s=K(e,t);const u=O(e,t);const p=i||!s?{x:0,y:0}:{x:u?r.width-l.width:0,y:u?r.height-l.height:0};const v={x:l.left,y:l.top};const h=p.x&&p.y?v:(0,o/* .subtract */.Re)(v,p);return h}}}return undefined};function K(e,t){if(!M(e)||!M(t)){return false}return e.data.current.sortable.containerId===t.data.current.sortable.containerId}function O(e,t){if(!M(e)||!M(t)){return false}if(!K(e,t)){return false}return e.data.current.sortable.index<t.data.current.sortable.index}//# sourceMappingURL=sortable.esm.js.map
},74979:function(e,t,n){n.d(t,{$$:()=>g,Es:()=>h,KG:()=>m,Ks:()=>q,Ll:()=>l,Re:()=>k,Sw:()=>o,TW:()=>v,WQ:()=>Y,YG:()=>x,YN:()=>_,ZC:()=>y,_q:()=>f,ag:()=>S,e_:()=>E,jn:()=>a,kx:()=>D,l6:()=>s,lk:()=>b,sb:()=>u,wz:()=>c,xZ:()=>p,zk:()=>d});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
const o=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined";function s(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||// In Electron context the Window object serializes to [object global]
t==="[object global]"}function l(e){return"nodeType"in e}function d(e){var t,n;if(!e){return window}if(s(e)){return e}if(!l(e)){return window}return(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window}function c(e){const{Document:t}=d(e);return e instanceof t}function u(e){if(s(e)){return false}return e instanceof d(e).HTMLElement}function p(e){return e instanceof d(e).SVGElement}function v(e){if(!e){return document}if(s(e)){return e.document}if(!l(e)){return document}if(c(e)){return e}if(u(e)||p(e)){return e.ownerDocument}return document}/**
 * A hook that resolves to useEffect on the server and useLayoutEffect on the client
 * @param callback {function} Callback function that is invoked when the dependencies of the hook change
 */const h=o?r.useLayoutEffect:r.useEffect;function f(e){const t=(0,r.useRef)(e);h(()=>{t.current=e});return(0,r.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return t.current==null?void 0:t.current(...n)},[])}function g(){const e=(0,r.useRef)(null);const t=(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]);const n=(0,r.useCallback)(()=>{if(e.current!==null){clearInterval(e.current);e.current=null}},[]);return[t,n]}function _(e,t){if(t===void 0){t=[e]}const n=(0,r.useRef)(e);h(()=>{if(n.current!==e){n.current=e}},t);return n}function m(e,t){const n=(0,r.useRef)();return(0,r.useMemo)(()=>{const t=e(n.current);n.current=t;return t},[...t])}function b(e){const t=f(e);const n=(0,r.useRef)(null);const i=(0,r.useCallback)(e=>{if(e!==n.current){t==null?void 0:t(e,n.current)}n.current=e},[]);return[n,i]}function y(e){const t=(0,r.useRef)();(0,r.useEffect)(()=>{t.current=e},[e]);return t.current}let w={};function x(e,t){return(0,r.useMemo)(()=>{if(t){return t}const n=w[e]==null?0:w[e]+1;w[e]=n;return e+"-"+n},[e,t])}function A(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,i]of r){const r=t[n];if(r!=null){t[n]=r+e*i}}return t},{...t})}}const Y=/*#__PURE__*/A(1);const k=/*#__PURE__*/A(-1);function I(e){return"clientX"in e&&"clientY"in e}function D(e){if(!e){return false}const{KeyboardEvent:t}=d(e.target);return t&&e instanceof t}function C(e){if(!e){return false}const{TouchEvent:t}=d(e.target);return t&&e instanceof t}/**
 * Returns the normalized x and y coordinates for mouse and touch events.
 */function E(e){if(C(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}if(I(e)){return{x:e.clientX,y:e.clientY}}return null}const q=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e){return}const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e){return}const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(!e){return}return[q.Translate.toString(e),q.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}});const T="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function S(e){if(e.matches(T)){return e}return e.querySelector(T)}//# sourceMappingURL=utilities.esm.js.map
},25631:function(e,t,n){n.d(t,{A:()=>l});/* import */var r=n(31601);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(76314);/* import */var o=/*#__PURE__*/n.n(a);// Imports
var s=o()(i());// Module
s.push([e.id,`/* Variables declaration */
.rdp-root {
  --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */
  --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */

  --rdp-day-height: 44px; /* The height of the day cells. */
  --rdp-day-width: 44px; /* The width of the day cells. */

  --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */
  --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */
  --rdp-day_button-height: 42px; /* The height of the day cells. */
  --rdp-day_button-width: 42px; /* The width of the day cells. */

  --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */
  --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */
  --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */
  --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */

  --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */

  --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */

  --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */
  --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */
  --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */
  --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */

  --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */
  --rdp-range_middle-color: inherit; /* The color of the range text. */

  --rdp-range_start-color: white; /* The color of the range text. */
  --rdp-range_start-background: linear-gradient(
    var(--rdp-gradient-direction),
    transparent 50%,
    var(--rdp-range_middle-background-color) 50%
  ); /* Used for the background of the start of the selected range. */
  --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */

  --rdp-range_end-background: linear-gradient(
    var(--rdp-gradient-direction),
    var(--rdp-range_middle-background-color) 50%,
    transparent 50%
  ); /* Used for the background of the end of the selected range. */
  --rdp-range_end-color: white; /* The color of the range text. */
  --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */

  --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */
  --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */

  --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */
  --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */
  --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */
  --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */

  --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */
  --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */
  --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */

  --rdp-gradient-direction: 90deg;

  --rdp-animation_duration: 0.3s;
  --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);
}

.rdp-root[dir="rtl"] {
  --rdp-gradient-direction: -90deg;
}

.rdp-root[data-broadcast-calendar="true"] {
  --rdp-outside-opacity: unset;
}

/* Root of the component. */
.rdp-root {
  position: relative; /* Required to position the navigation toolbar. */
  box-sizing: border-box;
}

.rdp-root * {
  box-sizing: border-box;
}

.rdp-day {
  width: var(--rdp-day-width);
  height: var(--rdp-day-height);
  text-align: center;
}

.rdp-day_button {
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  justify-content: center;
  align-items: center;
  display: flex;

  width: var(--rdp-day_button-width);
  height: var(--rdp-day_button-height);
  border: var(--rdp-day_button-border);
  border-radius: var(--rdp-day_button-border-radius);
}

.rdp-day_button:disabled {
  cursor: revert;
}

.rdp-caption_label {
  z-index: 1;

  position: relative;
  display: inline-flex;
  align-items: center;

  white-space: nowrap;
  border: 0;
}

.rdp-dropdown:focus-visible ~ .rdp-caption_label {
  outline: 5px auto Highlight;
  /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */
  outline: 5px auto -webkit-focus-ring-color;
}

.rdp-button_next,
.rdp-button_previous {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -moz-appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  appearance: none;

  width: var(--rdp-nav_button-width);
  height: var(--rdp-nav_button-height);
}

.rdp-button_next:disabled,
.rdp-button_next[aria-disabled="true"],
.rdp-button_previous:disabled,
.rdp-button_previous[aria-disabled="true"] {
  cursor: revert;

  opacity: var(--rdp-nav_button-disabled-opacity);
}

.rdp-chevron {
  display: inline-block;
  fill: var(--rdp-accent-color);
}

.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
  transform: rotate(180deg);
  transform-origin: 50%;
}

.rdp-dropdowns {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--rdp-dropdown-gap);
}
.rdp-dropdown {
  z-index: 2;

  /* Reset */
  opacity: 0;
  appearance: none;
  position: absolute;
  inset-block-start: 0;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: inherit;
  border: none;
  line-height: inherit;
}

.rdp-dropdown_root {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
  opacity: var(--rdp-disabled-opacity);
}

.rdp-month_caption {
  display: flex;
  align-content: center;
  height: var(--rdp-nav-height);
  font-weight: bold;
  font-size: large;
}

.rdp-root[data-nav-layout="around"] .rdp-month,
.rdp-root[data-nav-layout="after"] .rdp-month {
  position: relative;
}

.rdp-root[data-nav-layout="around"] .rdp-month_caption {
  justify-content: center;
  margin-inline-start: var(--rdp-nav_button-width);
  margin-inline-end: var(--rdp-nav_button-width);
  position: relative;
}

.rdp-root[data-nav-layout="around"] .rdp-button_previous {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: var(--rdp-nav-height);
  display: inline-flex;
}

.rdp-root[data-nav-layout="around"] .rdp-button_next {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  height: var(--rdp-nav-height);
  display: inline-flex;
  justify-content: center;
}

.rdp-months {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--rdp-months-gap);
  max-width: fit-content;
}

.rdp-month_grid {
  border-collapse: collapse;
}

.rdp-nav {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;

  display: flex;
  align-items: center;

  height: var(--rdp-nav-height);
}

.rdp-weekday {
  opacity: var(--rdp-weekday-opacity);
  padding: var(--rdp-weekday-padding);
  font-weight: 500;
  font-size: smaller;
  text-align: var(--rdp-weekday-text-align);
  text-transform: var(--rdp-weekday-text-transform);
}

.rdp-week_number {
  opacity: var(--rdp-week_number-opacity);
  font-weight: 400;
  font-size: small;
  height: var(--rdp-week_number-height);
  width: var(--rdp-week_number-width);
  border: var(--rdp-week_number-border);
  border-radius: var(--rdp-week_number-border-radius);
  text-align: var(--rdp-weeknumber-text-align);
}

/* DAY MODIFIERS */
.rdp-today:not(.rdp-outside) {
  color: var(--rdp-today-color);
}

.rdp-selected {
  font-weight: bold;
  font-size: large;
}

.rdp-selected .rdp-day_button {
  border: var(--rdp-selected-border);
}

.rdp-outside {
  opacity: var(--rdp-outside-opacity);
}

.rdp-disabled {
  opacity: var(--rdp-disabled-opacity);
}

.rdp-hidden {
  visibility: hidden;
  color: var(--rdp-range_start-color);
}

.rdp-range_start {
  background: var(--rdp-range_start-background);
}

.rdp-range_start .rdp-day_button {
  background-color: var(--rdp-range_start-date-background-color);
  color: var(--rdp-range_start-color);
}

.rdp-range_middle {
  background-color: var(--rdp-range_middle-background-color);
}

.rdp-range_middle .rdp-day_button {
  border: unset;
  border-radius: unset;
  color: var(--rdp-range_middle-color);
}

.rdp-range_end {
  background: var(--rdp-range_end-background);
  color: var(--rdp-range_end-color);
}

.rdp-range_end .rdp-day_button {
  color: var(--rdp-range_start-color);
  background-color: var(--rdp-range_end-date-background-color);
}

.rdp-range_start.rdp-range_end {
  background: revert;
}

.rdp-focusable {
  cursor: pointer;
}

@keyframes rdp-slide_in_left {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes rdp-slide_in_right {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes rdp-slide_out_left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes rdp-slide_out_right {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

.rdp-weeks_before_enter {
  animation: rdp-slide_in_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_before_exit {
  animation: rdp-slide_out_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_after_enter {
  animation: rdp-slide_in_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_after_exit {
  animation: rdp-slide_out_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_after_enter {
  animation: rdp-slide_in_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_before_exit {
  animation: rdp-slide_out_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_before_enter {
  animation: rdp-slide_in_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_after_exit {
  animation: rdp-slide_out_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

@keyframes rdp-fade_in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rdp-fade_out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.rdp-caption_after_enter {
  animation: rdp-fade_in var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_after_exit {
  animation: rdp-fade_out var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_before_enter {
  animation: rdp-fade_in var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_before_exit {
  animation: rdp-fade_out var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}
`,""]);// Exports
/* export default */const l=s},76314:function(e){/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/e.exports=function(e){var t=[];// return the list of modules as css string
t.toString=function t(){return this.map(function(t){var n="";var r=typeof t[5]!=="undefined";if(t[4]){n+="@supports (".concat(t[4],") {")}if(t[2]){n+="@media ".concat(t[2]," {")}if(r){n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")}n+=e(t);if(r){n+="}"}if(t[2]){n+="}"}if(t[4]){n+="}"}return n}).join("")};// import a list of modules into the list
t.i=function e(e,n,r,i,a){if(typeof e==="string"){e=[[null,e,undefined]]}var o={};if(r){for(var s=0;s<this.length;s++){var l=this[s][0];if(l!=null){o[l]=true}}}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);if(r&&o[c[0]]){continue}if(typeof a!=="undefined"){if(typeof c[5]==="undefined"){c[5]=a}else{c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}");c[5]=a}}if(n){if(!c[2]){c[2]=n}else{c[1]="@media ".concat(c[2]," {").concat(c[1],"}");c[2]=n}}if(i){if(!c[4]){c[4]="".concat(i)}else{c[1]="@supports (".concat(c[4],") {").concat(c[1],"}");c[4]=i}}t.push(c)}};return t}},31601:function(e){e.exports=function(e){return e[1]}},35975:function(e,t,n){n.d(t,{A:()=>s});/* import */var r=n(92890);/* import */var i=n(10123);/* import */var a=n(619);/* import */var o=n(70551);/**
 * @name eachMinuteOfInterval
 * @category Interval Helpers
 * @summary Return the array of minutes within the specified time interval.
 *
 * @description
 * Returns the array of minutes within the specified time interval.
 *
 * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
 * @param {Object} [options] - an object with options.
 * @param {Number} [options.step=1] - the step to increment by. The step must be equal to or greater than 1
 * @throws {TypeError} 1 argument required
 * @returns {Date[]} the array with starts of minutes from the minute of the interval start to the minute of the interval end
 * @throws {RangeError} `options.step` must be a number equal to or greater than 1
 * @throws {RangeError} The start of an interval cannot be after its end
 * @throws {RangeError} Date in interval cannot be `Invalid Date`
 *
 * @example
 * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03
 * const result = eachMinuteOfInterval({
 *   start: new Date(2014, 9, 14, 13),
 *   end: new Date(2014, 9, 14, 13, 3)
 * })
 * //=> [
 * //   Wed Oct 14 2014 13:00:00,
 * //   Wed Oct 14 2014 13:01:00,
 * //   Wed Oct 14 2014 13:02:00,
 * //   Wed Oct 14 2014 13:03:00
 * // ]
 */function s(e,t){var n;(0,o/* ["default"] */.A)(1,arguments);var s=(0,a/* ["default"] */.A)((0,i["default"])(e.start));var l=(0,i["default"])(e.end);var d=s.getTime();var c=l.getTime();if(d>=c){throw new RangeError("Invalid interval")}var u=[];var p=s;var v=Number((n=t===null||t===void 0?void 0:t.step)!==null&&n!==void 0?n:1);if(v<1||isNaN(v))throw new RangeError("`options.step` must be a number equal to or greater than 1");while(p.getTime()<=c){u.push((0,i["default"])(p));p=(0,r["default"])(p,v)}return u}},67901:function(e,t,n){n.r(t);n.d(t,{"default":()=>o});/* import */var r=n(94188);/* import */var i=n(10123);/* import */var a=n(70551);/**
 * @name setHours
 * @category Hour Helpers
 * @summary Set the hours to the given date.
 *
 * @description
 * Set the hours to the given date.
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Number} hours - the hours of the new date
 * @returns {Date} the new date with the hours set
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Set 4 hours to 1 September 2014 11:30:00:
 * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
 * //=> Mon Sep 01 2014 04:30:00
 */function o(e,t){(0,a/* ["default"] */.A)(2,arguments);var n=(0,i["default"])(e);var o=(0,r/* ["default"] */.A)(t);n.setHours(o);return n}},67375:function(e,t,n){n.r(t);n.d(t,{"default":()=>o});/* import */var r=n(94188);/* import */var i=n(10123);/* import */var a=n(70551);/**
 * @name setMinutes
 * @category Minute Helpers
 * @summary Set the minutes to the given date.
 *
 * @description
 * Set the minutes to the given date.
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Number} minutes - the minutes of the new date
 * @returns {Date} the new date with the minutes set
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Set 45 minutes to 1 September 2014 11:30:40:
 * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
 * //=> Mon Sep 01 2014 11:45:40
 */function o(e,t){(0,a/* ["default"] */.A)(2,arguments);var n=(0,i["default"])(e);var o=(0,r/* ["default"] */.A)(t);n.setMinutes(o);return n}},619:function(e,t,n){n.d(t,{A:()=>a});/* import */var r=n(10123);/* import */var i=n(70551);/**
 * @name startOfMinute
 * @category Minute Helpers
 * @summary Return the start of a minute for the given date.
 *
 * @description
 * Return the start of a minute for the given date.
 * The result will be in the local timezone.
 *
 * @param {Date|Number} date - the original date
 * @returns {Date} the start of a minute
 * @throws {TypeError} 1 argument required
 *
 * @example
 * // The start of a minute for 1 December 2014 22:15:45.400:
 * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
 * //=> Mon Dec 01 2014 22:15:00
 */function a(e){(0,i/* ["default"] */.A)(1,arguments);var t=(0,r["default"])(e);t.setSeconds(0,0);return t}},99972:function(e,t,n){/* import */var r=n(85072);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(97825);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(77659);/* import */var l=/*#__PURE__*/n.n(s);/* import */var d=n(55056);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(10540);/* import */var p=/*#__PURE__*/n.n(u);/* import */var v=n(41113);/* import */var h=/*#__PURE__*/n.n(v);/* import */var f=n(25631);var g={};g.styleTagTransform=h();g.setAttributes=c();g.insert=l().bind(null,"head");g.domAPI=o();g.insertStyleElement=p();var _=i()(f/* ["default"] */.A,g);/* unused export default */var m=f/* ["default"] */.A&&f/* ["default"].locals */.A.locals?f/* ["default"].locals */.A.locals:undefined},85072:function(e){var t=[];function n(e){var n=-1;for(var r=0;r<t.length;r++){if(t[r].identifier===e){n=r;break}}return n}function r(e,r){var a={};var o=[];for(var s=0;s<e.length;s++){var l=e[s];var d=r.base?l[0]+r.base:l[0];var c=a[d]||0;var u="".concat(d," ").concat(c);a[d]=c+1;var p=n(u);var v={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(p!==-1){t[p].references++;t[p].updater(v)}else{var h=i(v,r);r.byIndex=s;t.splice(s,0,{identifier:u,updater:h,references:1})}o.push(u)}return o}function i(e,t){var n=t.domAPI(t);n.update(e);var r=function t(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer){return}n.update(e=t)}else{n.remove()}};return r}e.exports=function(e,i){i=i||{};e=e||[];var a=r(e,i);return function e(e){e=e||[];for(var o=0;o<a.length;o++){var s=a[o];var l=n(s);t[l].references--}var d=r(e,i);for(var c=0;c<a.length;c++){var u=a[c];var p=n(u);if(t[p].references===0){t[p].updater();t.splice(p,1)}}a=d}}},77659:function(e){var t={};/* istanbul ignore next  */function n(e){if(typeof t[e]==="undefined"){var n=document.querySelector(e);// Special case to return head of iframe instead of iframe itself
if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
n=n.contentDocument.head}catch(e){// istanbul ignore next
n=null}}t[e]=n}return t[e]}/* istanbul ignore next  */function r(e,t){var r=n(e);if(!r){throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.")}r.appendChild(t)}e.exports=r},10540:function(e){/* istanbul ignore next  */function t(e){var t=document.createElement("style");e.setAttributes(t,e.attributes);e.insert(t,e.options);return t}e.exports=t},55056:function(e,t,n){/* istanbul ignore next  */function r(e){var t=true?n.nc:0;if(t){e.setAttribute("nonce",t)}}e.exports=r},97825:function(e){/* istanbul ignore next  */function t(e,t,n){var r="";if(n.supports){r+="@supports (".concat(n.supports,") {")}if(n.media){r+="@media ".concat(n.media," {")}var i=typeof n.layer!=="undefined";if(i){r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")}r+=n.css;if(i){r+="}"}if(n.media){r+="}"}if(n.supports){r+="}"}var a=n.sourceMap;if(a&&typeof btoa!=="undefined"){r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")}// For old IE
/* istanbul ignore if  */t.styleTagTransform(r,e,t.options)}function n(e){// istanbul ignore if
if(e.parentNode===null){return false}e.parentNode.removeChild(e)}/* istanbul ignore next  */function r(e){if(typeof document==="undefined"){return{update:function e(){},remove:function e(){}}}var r=e.insertStyleElement(e);return{update:function n(n){t(r,e,n)},remove:function e(){n(r)}}}e.exports=r},41113:function(e){/* istanbul ignore next  */function t(e,t){if(t.styleSheet){t.styleSheet.cssText=e}else{while(t.firstChild){t.removeChild(t.firstChild)}t.appendChild(document.createTextNode(e))}}e.exports=t},45063:function(e,t,n){e.exports=n.p+"js/images/3d-d74232c4.png"},74469:function(e,t,n){e.exports=n.p+"js/images/black-and-white-a1d197c0.png"},20108:function(e,t,n){e.exports=n.p+"js/images/concept-ad427b25.png"},86160:function(e,t,n){e.exports=n.p+"js/images/dreamy-72eab497.png"},77628:function(e,t,n){e.exports=n.p+"js/images/filmic-91db8802.png"},59120:function(e,t,n){e.exports=n.p+"js/images/illustration-19074f05.png"},62646:function(e,t,n){e.exports=n.p+"js/images/neon-bfde2ac7.png"},85712:function(e,t,n){e.exports=n.p+"js/images/none-2088b52b.jpg"},39550:function(e,t,n){e.exports=n.p+"js/images/painting-db63dd8a.png"},36732:function(e,t,n){e.exports=n.p+"js/images/photo-7d69e05e.png"},73788:function(e,t,n){e.exports=n.p+"js/images/retro-bcc8eda3.png"},18866:function(e,t,n){e.exports=n.p+"js/images/sketch-319bbedf.png"},82465:function(e,t,n){e.exports=n.p+"js/images/not-found-2x-5f9812df.webp"},90368:function(e,t,n){e.exports=n.p+"js/images/not-found-4fa6c9c0.webp"},47403:function(e,t,n){e.exports=n.p+"js/images/generate-image-2x-7d387dcf.webp"},99786:function(e,t,n){e.exports=n.p+"js/images/generate-image-3e5f50a6.webp"},31602:function(e,t,n){// EXPORTS
n.d(t,{A:()=>/* binding */q});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var r=n(71893);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(55456);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var a=n(2445);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var o=n(70540);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_define_property.js
var s=n(50467);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Alert.tsx
var l=n(51550);// EXTERNAL MODULE: external "React"
var d=n(41594);// CONCATENATED MODULE: ./assets/react/v3/shared/components/ComponentErrorBoundary.tsx
class c extends d.Component{static getDerivedStateFromError(e){return{hasError:true,error:e}}componentDidCatch(e,t){var n,r;// eslint-disable-next-line no-console
console.error("Error rendering ".concat(this.props.componentName,":"),e,t);(n=(r=this.props).onError)===null||n===void 0?void 0:n.call(r,e,t)}render(){var{children:e,fallback:t,showError:n}=this.props;var{hasError:r,error:i}=this.state;if(r){if(t){return t}return n?/*#__PURE__*/(0,a/* .jsxs */.FD)(l/* ["default"] */.A,{type:"danger",children:["Error rendering ",this.props.componentName,": ",(i===null||i===void 0?void 0:i.message)||(i===null||i===void 0?void 0:i.toString())]}):null}return e}constructor(...e){super(...e),(0,s._)(this,"state",{hasError:false,error:null})}}(0,s._)(c,"defaultProps",{showError:true,componentName:"Component"});/* export default */const u=c;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/ContentRenderer.tsx
var p=e=>{var{component:t}=e;return/*#__PURE__*/(0,a/* .jsx */.Y)(u,{componentName:"content",children:t})};/* export default */const v=p;// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormCheckbox.tsx
var h=n(79489);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormDateInput.tsx
var f=n(31108);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFileUploader.tsx
var g=n(10878);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormImageInput.tsx
var _=n(13095);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInput.tsx
var m=n(35304);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormRadioGroup.tsx
var b=n(91072);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var y=n(59976);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSwitch.tsx
var w=n(39246);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var x=n(61046);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTimeInput.tsx
var A=n(27205);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var Y=n(83890);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormWPEditor.tsx
var k=n(37196);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var I=n(49785);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/FieldRenderer.tsx
var D=e=>{var{name:t,label:n,buttonText:o,helpText:s,infoText:d,placeholder:c,type:p,options:v,defaultValue:D,rules:C,form:E}=e;// eslint-disable-next-line @typescript-eslint/no-explicit-any
var q=e=>{var I=(()=>{switch(p){case"text":return/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"number":return/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:n,placeholder:c,helpText:s}));case"password":return/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"password",label:n,placeholder:c,helpText:s}));case"textarea":return/*#__PURE__*/(0,a/* .jsx */.Y)(x/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"select":return/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,options:v||[],placeholder:c,helpText:s}));case"radio":return/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,options:v||[]}));case"checkbox":return/*#__PURE__*/(0,a/* .jsx */.Y)(h/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n}));case"switch":return/*#__PURE__*/(0,a/* .jsx */.Y)(w/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,helpText:s}));case"date":return/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"time":return/*#__PURE__*/(0,a/* .jsx */.Y)(A/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"image":return/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s,infoText:d}));case"video":return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s,infoText:d}));case"uploader":return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s}));case"WPEditor":return/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));default:return/*#__PURE__*/(0,a/* .jsxs */.FD)(l/* ["default"] */.A,{type:"danger",children:["Unsupported field type: ",p]})}})();return/*#__PURE__*/(0,a/* .jsx */.Y)(u,{componentName:"field ".concat(t),onError:(e,n)=>{// eslint-disable-next-line no-console
console.warn("Field ".concat(t," failed to render:"),{error:e,errorInfo:n})},children:I})};return/*#__PURE__*/(0,a/* .jsx */.Y)(I/* .Controller */.xI,{name:t,control:E.control,defaultValue:D!==null&&D!==void 0?D:"",rules:C,render:e=>q(e)})};/* export default */const C=D;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/CourseBuilderSlot.tsx
var E=e=>{var{section:t,namePrefix:n,form:s}=e;var{fields:l,contents:d}=(0,o/* .useCourseBuilderSlot */._)();var c=()=>{var e=t.split(".");// eslint-disable-next-line @typescript-eslint/no-explicit-any
var n=l;for(var r of e){if(!n[r])return[];n=n[r]}return Array.isArray(n)?n:[]};var u=()=>{var e=t.split(".");// eslint-disable-next-line @typescript-eslint/no-explicit-any
var n=d;for(var r of e){if(!n[r])return[];n=n[r]}return Array.isArray(n)?n:[]};return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[c().map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(C,(0,i._)((0,r._)({form:s},e),{name:n?"".concat(n).concat(e.name):e.name}),e.name)),u().map((e,t)=>{var{component:n}=e;return/*#__PURE__*/(0,a/* .jsx */.Y)(v,{component:n},t)})]})};/* export default */const q=E},74843:function(e,t,n){n.d(t,{A:()=>P});/* import */var r=n(41374);/* import */var i=n(71893);/* import */var a=n(55456);/* import */var o=n(84577);/* import */var s=n(2445);/* import */var l=n(17437);/* import */var d=n(12470);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(53429);/* import */var p=n(41594);/* import */var v=/*#__PURE__*/n.n(p);/* import */var h=n(49785);/* import */var f=n(42338);/* import */var g=n(76017);/* import */var _=n(79489);/* import */var m=n(31108);/* import */var b=n(35304);/* import */var y=n(59976);/* import */var w=n(61046);/* import */var x=n(27205);/* import */var A=n(4892);/* import */var Y=n(95729);/* import */var k=n(10840);/* import */var I=n(24219);/* import */var D=n(57148);/* import */var C=n(87018);/* import */var E=n(85398);/* import */var q=n(3620);/* import */var T=n(5081);/* import */var S=n(84133);/* import */var M=n(36154);/* import */var H=n(51298);/* import */var z=n(6192);function K(){var e=(0,o._)(["\n      box-shadow: ",";\n    "]);K=function t(){return e};return e}var O=(0,T/* .getCourseId */.p)();var F=e=>{var{onCancel:t,data:n,topicId:o,meetingId:l}=e;var{ref:c,isScrolling:v}=(0,C/* .useIsScrolling */.$)({defaultValue:true});var k=(0,q/* .useGoogleMeetDetailsQuery */.OJ)(l?l:"",o?o:"");var I=n!==null&&n!==void 0?n:k.data;var T,M,K;var F=(0,D/* .useFormWithGlobalError */.p)({defaultValues:{meeting_name:(T=I===null||I===void 0?void 0:I.post_title)!==null&&T!==void 0?T:"",meeting_summary:(M=I===null||I===void 0?void 0:I.post_content)!==null&&M!==void 0?M:"",meeting_start_date:(I===null||I===void 0?void 0:I.meeting_data.start_datetime)?(0,u["default"])(new Date(I.meeting_data.start_datetime),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_start_time:(I===null||I===void 0?void 0:I.meeting_data.start_datetime)?(0,u["default"])(new Date(I.meeting_data.start_datetime),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_end_date:(I===null||I===void 0?void 0:I.meeting_data.end_datetime)?(0,u["default"])(new Date(I.meeting_data.end_datetime),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_end_time:(I===null||I===void 0?void 0:I.meeting_data.end_datetime)?(0,u["default"])(new Date(I.meeting_data.end_datetime),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_timezone:(K=I===null||I===void 0?void 0:I.meeting_data.timezone)!==null&&K!==void 0?K:"",meeting_enrolledAsAttendee:(I===null||I===void 0?void 0:I.meeting_data.attendees)==="Yes"},shouldFocusError:true,mode:"onChange"});var P=(0,E/* .useSaveGoogleMeetMutation */.Cz)();var N=A/* .tutorConfig.timezones */.P.timezones;var L=Object.keys(N).map(e=>({label:N[e],value:e}));var B=e=>(0,r._)(function*(){if(!O){return}var n=yield P.mutateAsync((0,a._)((0,i._)({},I&&{"post-id":Number(I.ID),"event-id":I.meeting_data.id},o&&{topic_id:o}),{course_id:O,meeting_title:e.meeting_name,meeting_summary:e.meeting_summary,meeting_start_date:e.meeting_start_date,meeting_start_time:e.meeting_start_time,meeting_end_date:e.meeting_end_date,meeting_end_time:e.meeting_end_time,meeting_attendees_enroll_students:e.meeting_enrolledAsAttendee?"Yes":"No",meeting_timezone:e.meeting_timezone,attendees:e.meeting_enrolledAsAttendee?"Yes":"No"}));if(n.status_code===200||n.status_code===201){t();F.reset()}})();(0,p.useEffect)(()=>{if((0,H/* .isDefined */.O9)(I)){F.reset({meeting_name:I.post_title,meeting_summary:I.post_content,meeting_start_date:I.meeting_data.start_datetime?(0,u["default"])(new Date(I.meeting_data.start_datetime),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_start_time:I.meeting_data.start_datetime?(0,u["default"])(new Date(I.meeting_data.start_datetime),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_end_date:I.meeting_data.end_datetime?(0,u["default"])(new Date(I.meeting_data.end_datetime),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_end_time:I.meeting_data.end_datetime?(0,u["default"])(new Date(I.meeting_data.end_datetime),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_timezone:I.meeting_data.timezone,meeting_enrolledAsAttendee:I.meeting_data.attendees==="Yes"})}var e=setTimeout(()=>{F.setFocus("meeting_name")},250);return()=>{clearTimeout(e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[I]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.container,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.formWrapper,ref:c,children:/*#__PURE__*/(0,s/* .jsxs */.FD)(S/* ["default"] */.A,{when:!k.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_name",control:F.control,rules:{required:(0,d.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Name","tutor"),placeholder:(0,d.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_summary",control:F.control,rules:{required:(0,d.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Summary","tutor"),placeholder:(0,d.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.dateLabel,children:(0,d.__)("Meeting Start Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_start_date",control:F.control,rules:{required:(0,d.__)("Start date is required","tutor"),validate:z/* .invalidDateRule */.Kh},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,d.__)("Start date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_start_time",control:F.control,rules:{required:(0,d.__)("Start time is required","tutor"),validate:z/* .invalidTimeRule */.XA},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(x/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,d.__)("Start time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.dateLabel,children:(0,d.__)("Meeting End Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_end_date",control:F.control,rules:{required:(0,d.__)("End date is required","tutor"),validate:{invalidDate:z/* .invalidDateRule */.Kh,checkEndDate:e=>{var t=F.watch("meeting_start_date");var n=e;if(t&&n){return new Date(t)>new Date(n)?(0,d.__)("End date should be greater than start date","tutor"):undefined}return undefined}},deps:["meeting_start_date"]},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,d.__)("End date","tutor"),disabledBefore:F.watch("meeting_start_date")||new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_end_time",control:F.control,rules:{required:(0,d.__)("End time is required","tutor"),validate:{invalidTime:z/* .invalidTimeRule */.XA,checkEndTime:e=>{var t=F.watch("meeting_start_date");var n=F.watch("meeting_start_time");var r=F.watch("meeting_end_date");var i=e;if(t&&r&&n&&i){return new Date("".concat(t," ").concat(n))>new Date("".concat(r," ").concat(i))?(0,d.__)("End time should be greater than start time","tutor"):undefined}return undefined}},deps:["meeting_start_time","meeting_start_date","meeting_end_date"]},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(x/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,d.__)("End time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_timezone",control:F.control,rules:{required:(0,d.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Timezone","tutor"),placeholder:(0,d.__)("Select timezone","tutor"),options:L,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_enrolledAsAttendee",control:F.control,render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Add enrolled students as attendees","tutor")}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.buttonWrapper({isScrolling:v}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:t,children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-google-meeting",loading:P.isPending,variant:"primary",size:"small",onClick:F.handleSubmit(B),children:I||l?(0,d.__)("Update Meeting","tutor"):(0,d.__)("Create Meeting","tutor")})]})]})};/* export default */const P=F;var W={container:/*#__PURE__*/(0,l/* .css */.AH)(M/* .styleUtils.display.flex */.x.display.flex("column"),"    background:",k/* .colorTokens.background.white */.I6.background.white,";padding-block:",k/* .spacing["12"] */.YK["12"],";border-radius:",k/* .borderRadius.card */.Vq.card,";box-shadow:",k/* .shadow.popover */.r7.popover,";",I/* .typography.caption */.I.caption("regular"),";* > label{font-size:",k/* .fontSize["15"] */.J["15"],";color:",k/* .colorTokens.text.title */.I6.text.title,";}"),formWrapper:/*#__PURE__*/(0,l/* .css */.AH)(M/* .styleUtils.display.flex */.x.display.flex("column"),";",M/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding-inline:",k/* .spacing["12"] */.YK["12"],";padding-bottom:",k/* .spacing["8"] */.YK["8"],";gap:",k/* .spacing["12"] */.YK["12"],";height:400px;"),dateLabel:/*#__PURE__*/(0,l/* .css */.AH)(I/* .typography.caption */.I.caption("medium"),"    color:",k/* .colorTokens.text.title */.I6.text.title,";"),meetingDateTimeWrapper:/*#__PURE__*/(0,l/* .css */.AH)(M/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",k/* .spacing["6"] */.YK["6"],";"),meetingDateTime:/*#__PURE__*/(0,l/* .css */.AH)(M/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",k/* .spacing["6"] */.YK["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,l/* .css */.AH)(M/* .styleUtils.display.flex */.x.display.flex(),"    padding-top:",k/* .spacing["8"] */.YK["8"],";padding-inline:",k/* .spacing["12"] */.YK["12"],";justify-content:flex-end;gap:",k/* .spacing["8"] */.YK["8"],";z-index:",k/* .zIndex.positive */.fE.positive,";",t&&(0,l/* .css */.AH)(K(),k/* .shadow.scrollable */.r7.scrollable))}}},78759:function(e,t,n){n.d(t,{A:()=>F});/* import */var r=n(41374);/* import */var i=n(71893);/* import */var a=n(55456);/* import */var o=n(84577);/* import */var s=n(2445);/* import */var l=n(17437);/* import */var d=n(12470);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(53429);/* import */var p=n(41594);/* import */var v=/*#__PURE__*/n.n(p);/* import */var h=n(49785);/* import */var f=n(42338);/* import */var g=n(76017);/* import */var _=n(31108);/* import */var m=n(35304);/* import */var b=n(61046);/* import */var y=n(27205);/* import */var w=n(10840);/* import */var x=n(24219);/* import */var A=n(57148);/* import */var Y=n(85398);/* import */var k=n(3620);/* import */var I=n(5081);/* import */var D=n(59976);/* import */var C=n(4892);/* import */var E=n(95729);/* import */var q=n(84133);/* import */var T=n(87018);/* import */var S=n(36154);/* import */var M=n(51298);/* import */var H=n(6192);function z(){var e=(0,o._)(["\n      box-shadow: ",";\n    "]);z=function t(){return e};return e}var K=(0,I/* .getCourseId */.p)();var O=e=>{var{onCancel:t,data:n,meetingHost:o,topicId:l,meetingId:c}=e;var v;var{ref:w,isScrolling:x}=(0,T/* .useIsScrolling */.$)({defaultValue:true});var I=(0,k/* .useZoomMeetingDetailsQuery */.gK)(c?c:"",l?l:"");var S=n!==null&&n!==void 0?n:I.data;var z,O;var F=(O=(z=S===null||S===void 0?void 0:S.meeting_starts_at)!==null&&z!==void 0?z:S===null||S===void 0?void 0:S.meeting_data.start_time)!==null&&O!==void 0?O:"";var W,N,L,B,R,U;var j=(0,A/* .useFormWithGlobalError */.p)({defaultValues:{meeting_name:(W=S===null||S===void 0?void 0:S.post_title)!==null&&W!==void 0?W:"",meeting_summary:(N=S===null||S===void 0?void 0:S.post_content)!==null&&N!==void 0?N:"",meeting_date:F?(0,u["default"])(new Date(F),E/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_time:F?(0,u["default"])(new Date(F),E/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_duration:(S===null||S===void 0?void 0:S.meeting_data.duration)?String(S===null||S===void 0?void 0:S.meeting_data.duration):"40",meeting_duration_unit:(L=S===null||S===void 0?void 0:S.meeting_data.duration_unit)!==null&&L!==void 0?L:"min",meeting_timezone:(B=S===null||S===void 0?void 0:S.meeting_data.timezone)!==null&&B!==void 0?B:"",auto_recording:(R=S===null||S===void 0?void 0:(v=S.meeting_data.settings)===null||v===void 0?void 0:v.auto_recording)!==null&&R!==void 0?R:"none",meeting_password:(U=S===null||S===void 0?void 0:S.meeting_data.password)!==null&&U!==void 0?U:"",meeting_host:Object.keys(o).length===1?Object.keys(o)[0]:""},shouldFocusError:true,mode:"onChange"});var V=(0,Y/* .useSaveZoomMeetingMutation */.s1)();var Q=C/* .tutorConfig.timezones */.P.timezones;var G=Object.keys(Q).map(e=>({label:Q[e],value:e}));var X=Object.keys(o).map(e=>({label:o[e],value:e}));var Z=e=>(0,r._)(function*(){if(!K){return}var n=yield V.mutateAsync((0,a._)((0,i._)({},S&&{meeting_id:Number(S.ID)},l&&{topic_id:Number(l)}),{course_id:K,meeting_title:e.meeting_name,meeting_summary:e.meeting_summary,meeting_date:e.meeting_date,meeting_time:e.meeting_time,meeting_duration:Number(e.meeting_duration),meeting_duration_unit:e.meeting_duration_unit,meeting_timezone:e.meeting_timezone,auto_recording:e.auto_recording,meeting_password:e.meeting_password,click_form:l?"course_builder":"metabox",meeting_host:e.meeting_host}));if(n.data){t();j.reset()}})();(0,p.useEffect)(()=>{if((0,M/* .isDefined */.O9)(S)){var e;var t;j.reset({meeting_name:S.post_title,meeting_summary:S.post_content,meeting_date:F?(0,u["default"])(new Date(F),E/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_time:F?(0,u["default"])(new Date(F),E/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_duration:String(S.meeting_data.duration),meeting_duration_unit:S.meeting_data.duration_unit,meeting_timezone:S.meeting_data.timezone,auto_recording:(t=(e=S.meeting_data.settings)===null||e===void 0?void 0:e.auto_recording)!==null&&t!==void 0?t:"none",meeting_password:S.meeting_data.password,meeting_host:S.meeting_data.host_id})}var n=setTimeout(()=>{j.setFocus("meeting_name")},250);return()=>{clearTimeout(n)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[S]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:P.container,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:P.formWrapper,ref:w,children:/*#__PURE__*/(0,s/* .jsxs */.FD)(q/* ["default"] */.A,{when:!I.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_name",control:j.control,rules:{required:(0,d.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Name","tutor"),placeholder:(0,d.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_summary",control:j.control,rules:{required:(0,d.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Summary","tutor"),placeholder:(0,d.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:P.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_date",control:j.control,rules:{required:(0,d.__)("Date is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Date","tutor"),placeholder:(0,d.__)("Enter meeting date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_time",control:j.control,rules:{required:(0,d.__)("Time is required","tutor"),validate:H/* .invalidTimeRule */.XA},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,d.__)("Start time","tutor")}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:P.meetingTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_duration",control:j.control,rules:{required:(0,d.__)("Duration is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Duration","tutor"),placeholder:(0,d.__)("Duration","tutor"),type:"number",selectOnFocus:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_duration_unit",control:j.control,rules:{required:(0,d.__)("Duration unit is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(D/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:/*#__PURE__*/(0,s/* .jsx */.Y)("span",{children:" "}),options:[{label:(0,d.__)("Minutes","tutor"),value:"min"},{label:(0,d.__)("Hours","tutor"),value:"hr"}]}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_timezone",control:j.control,rules:{required:(0,d.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(D/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Timezone","tutor"),placeholder:(0,d.__)("Select timezone","tutor"),options:G,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"auto_recording",control:j.control,rules:{required:(0,d.__)("Auto recording is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(D/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Auto Recording","tutor"),placeholder:(0,d.__)("Select auto recording option","tutor"),options:[{label:(0,d.__)("No recordings","tutor"),value:"none"},{label:(0,d.__)("Local","tutor"),value:"local"},{label:(0,d.__)("Cloud","tutor"),value:"cloud"}]}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_password",control:j.control,rules:{required:(0,d.__)("Password is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Password","tutor"),placeholder:(0,d.__)("Enter meeting password","tutor"),type:"password",isPassword:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .Controller */.xI,{name:"meeting_host",control:j.control,rules:{required:(0,d.__)("Meeting host is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(D/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,d.__)("Meeting Host","tutor"),placeholder:(0,d.__)("Enter meeting host","tutor"),options:X,disabled:(0,M/* .isDefined */.O9)(S),selectOnFocus:true,isSearchable:true}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:P.buttonWrapper({isScrolling:x}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:t,children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-zoom-meeting",loading:V.isPending,variant:"primary",size:"small",onClick:j.handleSubmit(Z),children:S||c?(0,d.__)("Update Meeting","tutor"):(0,d.__)("Create Meeting","tutor")})]})]})};/* export default */const F=O;var P={container:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),"    background:",w/* .colorTokens.background.white */.I6.background.white,";padding-block:",w/* .spacing["12"] */.YK["12"],";border-radius:",w/* .borderRadius.card */.Vq.card,";box-shadow:",w/* .shadow.popover */.r7.popover,";",x/* .typography.caption */.I.caption("regular"),";* > label{font-size:",w/* .fontSize["15"] */.J["15"],";color:",w/* .colorTokens.text.title */.I6.text.title,";}"),formWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),";",S/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding-inline:",w/* .spacing["12"] */.YK["12"],";padding-bottom:",w/* .spacing["8"] */.YK["8"],";gap:",w/* .spacing["12"] */.YK["12"],";height:400px;"),meetingDateTimeWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",w/* .spacing["6"] */.YK["6"],";"),meetingTimeWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",w/* .spacing["6"] */.YK["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),"    padding-top:",w/* .spacing["8"] */.YK["8"],";padding-inline:",w/* .spacing["12"] */.YK["12"],";justify-content:flex-end;gap:",w/* .spacing["8"] */.YK["8"],";z-index:",w/* .zIndex.positive */.fE.positive,";",t&&(0,l/* .css */.AH)(z(),w/* .shadow.scrollable */.r7.scrollable))}}},67915:function(e,t,n){n.d(t,{A:()=>_});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(47767);/* import */var d=n(42338);/* import */var c=n(90209);/* import */var u=n(95729);/* import */var p=n(10840);/* import */var v=n(24219);/* import */var h=n(84133);function f(){var e=(0,r._)(["\n      transform: rotate(180deg);\n    "]);f=function t(){return e};return e}var g=e=>{var{title:t,backUrl:n,rightButton:r,isExternalUrl:a}=e;var s=(0,l/* .useNavigate */.Zp)();var p=()=>{if(n){if(a){window.location.href=n;return}s(n)}else{s(-1)}};return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:m.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:m.left,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{isIconOnly:true,size:"small",variant:"text","aria-label":(0,o.__)("Back","tutor"),buttonCss:m.button({isRTL:u/* .isRTL */.V8}),onClick:p,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{name:"back",width:32,height:32})})}),/*#__PURE__*/(0,i/* .jsx */.Y)("h6",{css:m.title,children:t})]}),r]})};/* export default */const _=g;var m={wrapper:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),left:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["16"] */.YK["16"],";"),button:e=>{var{isRTL:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("padding:0;border-radius:",p/* .borderRadius["2"] */.Vq["2"],";",t&&(0,a/* .css */.AH)(f()))},title:/*#__PURE__*/(0,a/* .css */.AH)(v/* .typography.heading6 */.I.heading6("medium"),";")}},14238:function(e,t,n){n.d(t,{A:()=>y});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(2445);/* import */var o=n(46306);/* import */var s=n(21094);/* import */var l=n(42338);/* import */var d=n(90209);/* import */var c=n(95729);/* import */var u=n(10840);/* import */var p=n(84133);/* import */var v=n(78635);/* import */var h=n(17437);/* import */var f=n(12470);/* import */var g=/*#__PURE__*/n.n(f);/* import */var _=n(49785);/* import */var m=n(47767);var b=e=>{var{styleModifier:t}=e;var{steps:n,setSteps:g}=(0,s/* .useCourseNavigator */._)();var b=(0,m/* .useNavigate */.Zp)();var y=(0,v/* .useCurrentPath */.G)(o/* ["default"] */.A);var x=(0,_/* .useFormContext */.xW)();var A=n.findIndex(e=>e.path===y);var Y=Math.max(-1,A-1);var k=Math.min(n.length,A+1);var I=n[Y];var D=n[k];var C=x.watch("post_title");var E=()=>{g(e=>{return e.map((e,t)=>{if(t===A){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===Y){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(I.path)};var q=()=>{g(e=>{return e.map((e,t)=>{if(t===A){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===k){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(D.path)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[w.wrapper,t],children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{when:A>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* ["default"] */.A,{variant:"tertiary",iconPosition:"right",size:"small",onClick:E,buttonCss:/*#__PURE__*/(0,h/* .css */.AH)("padding:",u/* .spacing["4"] */.YK["4"],";svg{color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:Y<0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(d/* ["default"] */.A,{name:!c/* .isRTL */.V8?"chevronLeft":"chevronRight",height:24,width:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{when:A<n.length-1&&C,children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* ["default"] */.A,{variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(d/* ["default"] */.A,{name:!c/* .isRTL */.V8?"chevronRight":"chevronLeft",height:24,width:24}),iconPosition:"right",size:"small",onClick:q,buttonCss:/*#__PURE__*/(0,h/* .css */.AH)("padding:",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["12"] */.YK["12"],";svg{color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:!C||k>=n.length,children:(0,f.__)("Next","tutor")})})]})};/* export default */const y=b;var w={wrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:flex;justify-content:end;height:32px;align-items:center;gap:",u/* .spacing["16"] */.YK["16"],";")}},80280:function(e,t,n){// ESM COMPAT FLAG
n.r(t);// EXPORTS
n.d(t,{"default":()=>/* binding */ar});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var r=n(71893);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(55456);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var a=n(2445);// EXTERNAL MODULE: ./node_modules/@dnd-kit/core/dist/core.esm.js
var o=n(15871);// EXTERNAL MODULE: ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js
var s=n(18831);// EXTERNAL MODULE: ./node_modules/@dnd-kit/sortable/dist/sortable.esm.js
var l=n(43627);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var d=n(17437);// EXTERNAL MODULE: external "wp.i18n"
var c=n(12470);// EXTERNAL MODULE: external "React"
var u=n(41594);var p=/*#__PURE__*/n.n(u);// EXTERNAL MODULE: external "ReactDOM"
var v=n(75206);// EXTERNAL MODULE: ./node_modules/react-router/dist/index.js
var h=n(47767);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Button.tsx
var f=n(42338);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/LoadingSpinner.tsx
var g=n(76017);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/SVGIcon.tsx
var _=n(90209);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/EmptyState.tsx
var m=n(19595);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
var b=n(84577);// EXTERNAL MODULE: ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js
var y=n(74979);// EXTERNAL MODULE: ./node_modules/@react-spring/web/dist/react-spring_web.modern.mjs
var w=n(55787);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
var x=n(41374);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
var A=n(97665);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var Y=n(49785);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ProBadge.tsx
var k=n(91196);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Tooltip.tsx
var I=n(92229);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/ConfirmationPopover.tsx
var D=n(95759);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Popover.tsx
var C=n(35198);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/additional/meeting/ZoomMeetingForm.tsx
var E=n(78759);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormDateInput.tsx
var q=n(31108);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFileUploader.tsx
var T=n(10878);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInput.tsx
var S=n(35304);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInputWithContent.tsx
var M=n(49201);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var H=n(59976);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_without_properties.js + 1 modules
var z=n(31105);// EXTERNAL MODULE: ./assets/react/v3/shared/config/styles.ts
var K=n(10840);// EXTERNAL MODULE: ./assets/react/v3/shared/config/typography.ts
var O=n(24219);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/For.tsx
var F=n(8501);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/Show.tsx
var P=n(84133);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useAnimation.tsx
var W=n(47617);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useDebounce.ts
var N=n(68118);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/style-utils.ts
var L=n(36154);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/util.ts + 4 modules
var B=n(85713);// EXTERNAL MODULE: ./assets/react/v3/public/images/not-found-2x.webp
var R=n(82465);// EXTERNAL MODULE: ./assets/react/v3/public/images/not-found.webp
var U=n(90368);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFieldWrapper.tsx
var j=n(66279);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/FormTopicPrerequisites.tsx
function V(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);V=function t(){return e};return e}function Q(){var e=(0,b._)(["\n        background-color: ",";\n        border-color: ",";\n\n        [data-visually-hidden] {\n          opacity: 1;\n        }\n      "]);Q=function t(){return e};return e}function G(){var e=(0,b._)(["\n      padding-left: ",";\n    "]);G=function t(){return e};return e}var X={lesson:{name:"lesson",color:K/* .colorTokens.icon["default"] */.I6.icon["default"]},tutor_quiz:{name:"quiz",color:K/* .colorTokens.design.warning */.I6.design.warning},tutor_assignments:{name:"assignment",color:K/* .colorTokens.icon.processing */.I6.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"quiz",color:K/* .colorTokens.icon.warning */.I6.icon.warning}};var Z=e=>{var{field:t,fieldState:n,options:o,onChange:s=B/* .noop */.lQ,handleSearchOnChange:l,label:p,placeholder:v="",disabled:h,readOnly:f,loading:b,isSearchable:y=false,helpText:w}=e;var x=t.value||[];var A=x.map(e=>String(e));var Y=o.reduce((e,t)=>{return t.contents.reduce((e,t)=>{if(A.includes(String(t.ID))){e.push(t)}return e},e)},[]);var k=(0,u.useRef)(null);var[I,D]=(0,u.useState)(false);var[E,q]=(0,u.useState)("");var T=(0,N/* .useDebounce */.d)(E);var S=o.reduce((e,t)=>{var n=t.contents.filter(e=>e.post_type!=="tutor-google-meet"&&e.post_type!=="tutor_zoom_meeting"&&!A.includes(String(e.ID)));if(n.length===0){return e}if(t.title.toLowerCase().includes(T.toLowerCase())){e.push((0,i._)((0,r._)({},t),{contents:n}))}else{var a=t.contents.filter(e=>e.post_title.toLowerCase().includes(T.toLowerCase()));if(a.length===0){return e}e.push((0,i._)((0,r._)({},t),{contents:a}))}return e},[]);(0,u.useEffect)(()=>{if(l){l(T)}else{// Handle local filter
}},[T,l]);var M=e=>{if(Array.isArray(x)){var n=x.filter(t=>String(t)!==String(e));t.onChange(n);s(n)}};return/*#__PURE__*/(0,a/* .jsx */.Y)(j/* ["default"] */.A,{fieldState:n,field:t,label:p,disabled:h,readOnly:f,helpText:w,children:e=>{var{css:n}=e,o=(0,z._)(e,["css"]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:$.mainWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:k,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:$.inputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:$.leftIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"search",width:24,height:24})}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},o),{onClick:e=>{e.stopPropagation();D(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();D(e=>!e)}if(e.key==="Tab"){D(false)}},className:"tutor-input-field",css:[n,$.input],autoComplete:"off",readOnly:f||!y,placeholder:v,value:E,onChange:e=>{q(e.target.value)}}))]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:x.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!b,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{size:"small",emptyStateImage:U,emptyStateImage2x:R,imageAltText:(0,c.__)("Illustration of a no course selected","tutor"),title:(0,c.__)("No topic content selected","tutor"),description:(0,c.__)("Select a topic content to add as a prerequisite","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:$.courseList,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:Y,children:e=>{var t;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:$.groupItems({onPopover:false}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:$.iconAndTitle({onPopover:false}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:((t=X[e.post_type])===null||t===void 0?void 0:t.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.AH)("color:",X[e.post_type].color,";")}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:$.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-question-count":true,css:O/* .typography.tiny */.I.tiny(),children:/* translators: %d is the number of questions */(0,c.sprintf)((0,c.__)("(%d questions)","tutor"),e.total_question)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:$.removeButton,"data-visually-hidden":true,onClick:()=>M(e.ID),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"times",width:14,height:14})})]},e.ID)}})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{triggerRef:k,isOpen:I,dependencies:[S.length],animationType:W/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>{D(false);q("")},children:/*#__PURE__*/(0,a/* .jsx */.Y)("ul",{css:[$.options],children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:S.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("li",{css:$.emptyOption,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,c.__)("No topics content found","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:S,children:e=>/*#__PURE__*/(0,a/* .jsxs */.FD)("li",{css:$.group,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:$.groupTitle,title:e.title,children:e.title}),/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:e.contents,children:e=>{var n;return/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:$.groupItems({onPopover:true}),onClick:()=>{var n=[...x,e.ID];t.onChange(n);s(n);D(false);q("")},children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:$.iconAndTitle({onPopover:true}),"data-content-icon":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:((n=X[e.post_type])===null||n===void 0?void 0:n.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.AH)("color:",X[e.post_type].color,";")}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:$.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-question-count":true,css:O/* .typography.tiny */.I.tiny(),children:/* translators: %d is the number of questions */(0,c.sprintf)((0,c.__)("(%d questions)","tutor"),e.total_question)})})]})},e.ID)}})]},e.id)})})})})]})}})};/* export default */const J=Z;var $={mainWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;"),inputWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:flex;justify-content:space-between;align-items:center;position:relative;"),leftIcon:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;left:",K/* .spacing["8"] */.YK["8"],";top:",K/* .spacing["8"] */.YK["8"],";color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;"),input:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";width:100%;padding-right:",K/* .spacing["32"] */.YK["32"],";padding-left:",K/* .spacing["36"] */.YK["36"],";",L/* .styleUtils.textEllipsis */.x.textEllipsis,";border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&.tutor-input-field{padding-right:",K/* .spacing["32"] */.YK["32"],";padding-left:",K/* .spacing["36"] */.YK["36"],";}"),courseList:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["8"] */.YK["8"],";max-height:256px;height:100%;margin-top:",K/* .spacing["8"] */.YK["8"],";",L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding:1px;"),options:/*#__PURE__*/(0,d/* .css */.AH)("z-index:",K/* .zIndex.dropdown */.fE.dropdown,";background-color:",K/* .colorTokens.background.white */.I6.background.white,";list-style-type:none;box-shadow:",K/* .shadow.popover */.r7.popover,";padding:",K/* .spacing["4"] */.YK["4"]," 0;margin:0;max-height:400px;border-radius:",K/* .borderRadius["6"] */.Vq["6"],";",L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),removeButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";position:absolute;top:50%;right:",K/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",K/* .borderRadius.circle */.Vq.circle,";background:",K/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",K/* .colorTokens.background.white */.I6.background.white,";}svg{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",K/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",K/* .shadow.focus */.r7.focus,";}"),emptyOption:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption("medium"),";padding:",K/* .spacing["8"] */.YK["8"],";text-align:center;"),group:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["10"] */.YK["10"]," 0;:not(:last-child){border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),groupTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small("semiBold"),";",L/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";padding-inline:",K/* .spacing["10"] */.YK["10"],";margin-bottom:",K/* .spacing["8"] */.YK["8"],";"),groupItems:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;width:100%;padding:",K/* .spacing["10"] */.YK["10"]," ",K/* .spacing["8"] */.YK["8"],";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";border:1px solid transparent;display:flex;justify-content:space-between;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";cursor:",t?"pointer":"default",";[data-content-icon]{display:flex;height:",t?"20px":"24px",";}[data-visually-hidden]{opacity:0;}",!t&&(0,d/* .css */.AH)(V(),K/* .shadow.card */.r7.card),"    &:hover,&:focus,&:active{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";",!t&&(0,d/* .css */.AH)(Q(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.stroke["default"] */.I6.stroke["default"]),"}",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},title:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";"),iconAndTitle:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";display:flex;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";",t&&(0,d/* .css */.AH)(G(),K/* .spacing["16"] */.YK["16"]),"    svg{flex-shrink:0;}span{text-align:left;",L/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}[data-question-count]{flex-shrink:0;text-decoration:none;}")}};// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormWPEditor.tsx
var ee=n(37196);// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/ModalWrapper.tsx
var et=n(39643);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/CourseBuilderSlot.tsx + 3 modules
var en=n(31602);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var er=n(70540);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/services/curriculum.ts
var ei=n(3620);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/utils/utils.ts
var ea=n(5081);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSwitch.tsx
var eo=n(39246);// EXTERNAL MODULE: ./assets/react/v3/shared/config/config.ts
var es=n(4892);// EXTERNAL MODULE: ./assets/react/v3/shared/config/constants.ts
var el=n(95729);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useFormWithGlobalError.ts
var ed=n(57148);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/validation.ts
var ec=n(6192);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/AssignmentModal.tsx
var eu=(0,ea/* .getCourseId */.p)();var ep=[{label:(0,c.__)("Weeks","tutor"),value:"weeks"},{label:(0,c.__)("Days","tutor"),value:"days"},{label:(0,c.__)("Hours","tutor"),value:"hours"}];var ev=e=>{var{assignmentId:t="",topicId:n,closeModal:o,icon:s,title:l,subtitle:d,contentDripType:p}=e;var v;var{fields:h}=(0,er/* .useCourseBuilderSlot */._)();var m=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var b=((v=es/* .tutorConfig.settings */.P.settings)===null||v===void 0?void 0:v.chatgpt_enable)==="on";var y=(0,ei/* .useAssignmentDetailsQuery */.pR)(t,n);var w=(0,ei/* .useSaveAssignmentMutation */.$2)(eu);var k=(0,A/* .useQueryClient */.jE)();var{data:I}=y;var D=k.getQueryData(["Topic",eu]);var C=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{title:"",summary:"",attachments:[],time_duration:{value:"0",time:"weeks"},deadline_from_start:false,total_mark:10,pass_mark:5,upload_files_limit:1,upload_file_size_limit:2,is_retry_allowed:true,attempts_allowed:5,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var E=C.formState.dirtyFields&&Object.keys(C.formState.dirtyFields).length>0;var z=C.watch("is_retry_allowed");(0,u.useEffect)(()=>{if(I){var e,t,n;C.reset((0,r._)({title:I.post_title||"",summary:(0,B/* .normalizeLineEndings */.EW)(I.post_content)||"",attachments:I.attachments||[],time_duration:{value:I.assignment_option.time_duration.value||"0",time:I.assignment_option.time_duration.time||"weeks"},deadline_from_start:I.assignment_option.deadline_from_start==="1"?true:false,total_mark:I.assignment_option.total_mark||10,pass_mark:I.assignment_option.pass_mark||5,upload_files_limit:I.assignment_option.upload_files_limit||1,upload_file_size_limit:I.assignment_option.upload_file_size_limit||2,is_retry_allowed:I.assignment_option.is_retry_allowed==="1"?true:false,attempts_allowed:I.assignment_option.attempts_allowed||10,content_drip_settings:{unlock_date:(I===null||I===void 0?void 0:(e=I.content_drip_settings)===null||e===void 0?void 0:e.unlock_date)||"",after_xdays_of_enroll:(I===null||I===void 0?void 0:(t=I.content_drip_settings)===null||t===void 0?void 0:t.after_xdays_of_enroll)||"",prerequisites:(I===null||I===void 0?void 0:(n=I.content_drip_settings)===null||n===void 0?void 0:n.prerequisites)||[]}},Object.fromEntries((0,B/* .findSlotFields */.DE)({fields:h.Curriculum.Lesson}).map(e=>[e,I[e]]))),{keepDirty:false})}var i=setTimeout(()=>{C.setFocus("title")},0);return()=>{clearTimeout(i)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[I]);var K=e=>(0,x._)(function*(){var r=(0,ei/* .convertAssignmentDataToPayload */.sC)(e,t,n,p,(0,B/* .findSlotFields */.DE)({fields:h.Curriculum.Assignment}));var i=yield w.mutateAsync(r);if(i.status_code===200||i.status_code===201){o({action:"CONFIRM"})}})();return/*#__PURE__*/(0,a/* .jsx */.Y)(et/* ["default"] */.A,{onClose:()=>o({action:"CLOSE"}),icon:E?/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"warning",width:24,height:24}):s,title:E?el/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":l,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?d:"",maxWidth:1070,actions:E&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(t){C.reset()}else{o({action:"CLOSE"})}},children:t?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-assignment",loading:w.isPending,variant:"primary",size:"small",onClick:C.handleSubmit(K),children:t?(0,c.__)("Update","tutor"):(0,c.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:ef.wrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!y.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.assignmentInfo,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"title",control:C.control,rules:(0,r._)({required:(0,c.__)("Assignment title is required","tutor")},(0,ec/* .maxLimitRule */.wA)(255)),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Title","tutor"),placeholder:(0,c.__)("Enter Assignment Title","tutor"),generateWithAi:!m||b,isClearable:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"summary",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ee/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Content","tutor"),placeholder:(0,c.__)("Enter Assignment Content","tutor"),generateWithAi:!m||b}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Assignment.after_description",form:C})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.rightPanel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"attachments",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Attachments","tutor"),buttonText:(0,c.__)("Upload Attachment","tutor"),selectMultiple:true}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="specific_days",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.after_xdays_of_enroll",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Available after days","tutor")]}),helpText:(0,c.__)("This assignment will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="unlock_by_date",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.unlock_date",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(q/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Unlock Date","tutor")]}),placeholder:(0,c.__)("Select Unlock Date","tutor"),helpText:(0,c.__)("This assignment will be available from the given date. Leave empty to make it available immediately.","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="after_finishing_prerequisites",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.prerequisites",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(J,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:D.reduce((e,a)=>{if(String(a.id)===String(n)){e.push((0,i._)((0,r._)({},a),{contents:a.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(a)}return e},[])||[],isSearchable:true,helpText:(0,c.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ef.timeLimit,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"time_duration.value",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Time Limit","tutor"),placeholder:"0",dataAttribute:"data-time-limit",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"time_duration.time",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(H/* ["default"] */.A,(0,i._)((0,r._)({},e),{options:ep,removeOptionsMinWidth:true,dataAttribute:"data-time-limit-unit"}))})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"deadline_from_start",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Set Deadline From Assignment Start Time","tutor"),helpText:(0,c.__)("Each student will get their own deadline based on when they start the assignment.","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"total_mark",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Total Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"pass_mark",control:C.control,rules:{validate:e=>{if(Number(e)>Number(C.getValues("total_mark"))){return(0,c.__)("Pass mark cannot be greater than total mark","tutor")}return true}},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Minimum Pass Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"upload_files_limit",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:"0",type:"number",label:(0,c.__)("File Upload Limit","tutor"),helpText:(0,c.__)("Define the number of files that a student can upload in this assignment. Input 0 to disable the option to upload.","tutor"),selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"upload_file_size_limit",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Maximum File Size Limit","tutor"),placeholder:"0",content:(0,c.__)("MB","tutor"),contentPosition:"right"}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"is_retry_allowed",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Allow Assignment Resubmission","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:z,children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"attempts_allowed",control:C.control,rules:(0,i._)((0,r._)({},(0,ec/* .requiredRule */.WN)()),{validate:e=>{if(e>=1&&e<=20){return true}return(0,c.__)("Allowed attempts must be between 1 and 20","tutor")}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Maximum Resubmission Attempts","tutor"),helpText:(0,c.__)("Set how many times students can resubmit even after the deadline.","tutor"),selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Assignment.bottom_of_sidebar",form:C})]})]})})})};/* export default */const eh=ev;var ef={wrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:1fr 338px;width:100%;height:100%;padding-inline:",K/* .spacing["32"] */.YK["32"],";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",K/* .spacing["24"] */.YK["24"],";}",K/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",K/* .spacing["16"] */.YK["16"],";}"),assignmentInfo:/*#__PURE__*/(0,d/* .css */.AH)("padding-block:",K/* .spacing["24"] */.YK["24"],";padding-right:",K/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",K/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",K/* .zIndex.positive */.fE.positive,";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}"),rightPanel:/*#__PURE__*/(0,d/* .css */.AH)("border-left:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",K/* .spacing["16"] */.YK["16"],";padding-block:",K/* .spacing["24"] */.YK["24"],";padding-left:",K/* .spacing["32"] */.YK["32"],";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),timeLimit:/*#__PURE__*/(0,d/* .css */.AH)("display:grid;align-items:end;grid-template-columns:1fr 100px;& input{border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&[data-time-limit]{border-radius:",K/* .borderRadius["6"] */.Vq["6"]," 0 0 ",K/* .borderRadius["6"] */.Vq["6"],";border-right:none;&:focus{border-right:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";z-index:",K/* .zIndex.positive */.fE.positive,";}}&[data-time-limit-unit]{border-radius:0 ",K/* .borderRadius["6"] */.Vq["6"]," ",K/* .borderRadius["6"] */.Vq["6"]," 0;}}"),uploadAttachment:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["8"] */.YK["8"],";"),uploadLabel:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),"    color:",K/* .colorTokens.text.title */.I6.text.title,";"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",K/* .spacing["4"] */.YK["4"],";color:",K/* .colorTokens.icon.success */.I6.icon.success,";}")};// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormImageInput.tsx
var eg=n(13095);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var e_=n(83890);// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/Modal.tsx
var em=n(1448);// EXTERNAL MODULE: ./node_modules/date-fns/esm/format/index.js
var eb=n(53429);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Skeleton.tsx
var ey=n(8875);// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/Table.tsx
function ew(){var e=(0,b._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n    "]);ew=function t(){return e};return e}function ex(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);ex=function t(){return e};return e}function eA(){var e=(0,b._)(["\n      &:nth-of-type(even) {\n        background-color: ",";\n      }\n    "]);eA=function t(){return e};return e}function eY(){var e=(0,b._)(["\n        background-color: ",";\n      "]);eY=function t(){return e};return e}function ek(){var e=(0,b._)(["\n        background-color: ",";\n      "]);ek=function t(){return e};return e}function eI(){var e=(0,b._)(["\n        :last-of-type {\n          border-bottom: none;\n        }\n      "]);eI=function t(){return e};return e}var eD={bodyRowSelected:K/* .colorTokens.background.active */.I6.background.active,bodyRowHover:K/* .colorTokens.background.hover */.I6.background.hover};var eC=e=>{var{columns:t,data:n,entireHeader:r=null,headerHeight:i=60,noHeader:o=false,isStriped:s=false,isRounded:l=false,stripedBySelectedIndex:c=[],colors:u={},isBordered:p=true,loading:v=false,itemsPerPage:h=1,querySortProperties:f,querySortDirections:g={},onSortClick:m,renderInLastRow:b,rowStyle:y,sortIcons:w={asc:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"sortASC",height:16,width:16}),desc:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"sortDESC",height:16,width:16})}}=e;var x=(e,n)=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:[eq.tableRow({isBordered:p,isStriped:s}),eq.bodyTr({colors:u,isSelected:c.includes(e),isRounded:l}),y],children:t.map((e,t)=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("td",{css:[eq.td,{width:e.width}],children:n(e)},t)})},e)};var A=e=>{var t=null;var n=e.sortProperty;if(!n){return e.Header}if(f===null||f===void 0?void 0:f.includes(n)){if((g===null||g===void 0?void 0:g[n])==="asc"){t=w.asc}else{t=w.desc}}return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:eq.headerWithIcon,onClick:()=>m===null||m===void 0?void 0:m(n),children:[e.Header,t&&t]})};var Y=()=>{if(r){return/*#__PURE__*/(0,a/* .jsx */.Y)("th",{css:eq.th,colSpan:t.length,children:r})}return t.map((e,t)=>{if(e.Header!==null){return/*#__PURE__*/(0,a/* .jsx */.Y)("th",{css:[eq.th,e.css,{width:e.width}],colSpan:e.headerColSpan,children:A(e)},t)}})};var k=()=>{if(v){return(0,B/* .range */.y1)(h).map(e=>x(e,()=>/*#__PURE__*/(0,a/* .jsx */.Y)(ey/* ["default"] */.A,{animation:true,height:20,width:"".concat((0,B/* .getRandom */.G0)(40,80),"%")})))}if(!n.length){return/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:eq.tableRow({isBordered:false,isStriped:false}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("td",{colSpan:t.length,css:[eq.td,/*#__PURE__*/(0,d/* .css */.AH)("text-align:center;")],children:"No Data!"})})}var e=n.map((e,t)=>{return x(t,n=>{return"Cell"in n?n.Cell(e,t):n.accessor(e,t)})});if(b){b=/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("td",{css:eq.td,children:b})},e.length);e.push(b)}return e};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eq.tableContainer({isRounded:l}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("table",{css:eq.table,children:[!o&&/*#__PURE__*/(0,a/* .jsx */.Y)("thead",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:[eq.tableRow({isBordered:p,isStriped:s}),{height:i}],children:Y()})}),/*#__PURE__*/(0,a/* .jsx */.Y)("tbody",{children:k()})]})})};/* export default */const eE=eC;var eq={tableContainer:e=>{var{isRounded:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:block;width:100%;overflow-x:auto;",t&&(0,d/* .css */.AH)(ew(),K/* .colorTokens.stroke.divider */.I6.stroke.divider,K/* .borderRadius["6"] */.Vq["6"]))},headerWithIcon:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";",O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";display:flex;gap:",K/* .spacing["8"] */.YK["8"],";align-items:center;svg{color:",K/* .colorTokens.text.primary */.I6.text.primary,";}"),table:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;border-collapse:collapse;border:none;"),tableRow:e=>{var{isBordered:t,isStriped:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)(t&&(0,d/* .css */.AH)(ex(),K/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",n&&(0,d/* .css */.AH)(eA(),K/* .colorTokens.background.active */.I6.background.active))},th:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";background-color:",K/* .colorTokens.background.white */.I6.background.white,";color:",K/* .colorTokens.text.primary */.I6.text.primary,";padding:0 ",K/* .spacing["16"] */.YK["16"],";border:none;"),bodyTr:e=>{var{colors:t,isSelected:n,isRounded:r}=e;var{bodyRowDefault:i,bodyRowSelectedHover:a,bodyRowHover:o=eD.bodyRowHover,bodyRowSelected:s=eD.bodyRowSelected}=t;return/*#__PURE__*/(0,d/* .css */.AH)(i&&(0,d/* .css */.AH)(eY(),i),"      &:hover{background-color:",n&&a?a:o,";}",n&&(0,d/* .css */.AH)(ek(),s)," ",r&&(0,d/* .css */.AH)(eI()))},td:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";padding:",K/* .spacing["16"] */.YK["16"],";border:none;")};// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/BasicModalWrapper.tsx
var eT=n(25405);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/CheckBox.tsx
var eS=n(52117);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useQuery.js
var eM=n(97286);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/api.ts
var eH=n(53127);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/endpoints.ts
var ez=n(37381);// CONCATENATED MODULE: ./assets/react/v3/shared/services/h5p.ts
var eK=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].GET_H5P_LESSON_CONTENT */.A.GET_H5P_LESSON_CONTENT,{search_filter:e})};var eO=(e,t)=>{return(0,eM/* .useQuery */.I)({queryKey:["H5PLessonContents",e],queryFn:()=>eK(e).then(e=>e.data),enabled:t==="lesson"})};var eF=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].GET_H5P_QUIZ_CONTENT */.A.GET_H5P_QUIZ_CONTENT,{search_filter:e})};var eP=(e,t)=>{return(0,eM/* .useQuery */.I)({queryKey:["H5PQuizContents",e],queryFn:()=>eF(e).then(e=>e.data),enabled:t==="tutor_h5p_quiz"})};// CONCATENATED MODULE: ./assets/react/v3/shared/components/modals/H5PContentListModal.tsx
var eW=e=>{var{title:t,closeModal:n,onAddContent:o,contentType:s,addedContentIds:l=[]}=e;var d=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{search:""}});var p=(0,N/* .useDebounce */.d)(d.watch("search"),300);var v=eP(p,s);var h=eO(p,s);var[g,m]=(0,u.useState)([]);var b=s==="tutor_h5p_quiz"?v.data:h.data;var y=b===null||b===void 0?void 0:b.output.filter(e=>!l.includes(String(e.id)));var w=[{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-index":true,css:eL.tableLabel,children:(y===null||y===void 0?void 0:y.length)?/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:e=>{if(e){m((y===null||y===void 0?void 0:y.filter(e=>!l.includes(String(e.id))))||[])}else{m([])}},checked:g.length===((y===null||y===void 0?void 0:y.filter(e=>!l.includes(String(e.id))))||[]).length,isIndeterminate:g.length>0&&g.length<((y===null||y===void 0?void 0:y.filter(e=>!l.includes(String(e.id))))||[]).length}):"#"}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:O/* .typography.caption */.I.caption(),children:/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:t=>{if(t){m([...g,e])}else{m(g.filter(t=>t.id!==e.id))}},checked:g.map(e=>e.id).includes(e.id)&&!l.includes(String(e.id))})})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.tableLabel,children:(0,c.__)("Title","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.title,children:e.title})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.tableLabel,children:(0,c.__)("Content Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:O/* .typography.caption */.I.caption(),children:e.content_type})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.tableLabel,children:(0,c.__)("Created At","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:O/* .typography.caption */.I.caption(),children:(0,eb["default"])(new Date(e.updated_at),el/* .DateFormats.yearMonthDayHourMinuteSecond */.UA.yearMonthDayHourMinuteSecond)})}}];return/*#__PURE__*/(0,a/* .jsxs */.FD)(eT/* ["default"] */.A,{title:/* translators: %s is the number of selected items */g.length>0?(0,c.sprintf)((0,c.__)("%s selected","tutor"),g.length):t,onClose:()=>n({action:"CLOSE"}),maxWidth:920,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.searchWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:d.control,name:"search",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Search by title","tutor"),showVerticalBar:false,content:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"search",width:24,height:24})}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eL.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eE,{columns:w,data:y||[],loading:v.isLoading||h.isLoading})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y===null||y===void 0?void 0:y.length,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eL.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>n({action:"CLOSE"}),children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"submit",size:"small",variant:"primary",onClick:()=>{o(g);n({action:"CONFIRM"})},disabled:!g.length,children:(0,c.__)("Add","tutor")})]})})]})};/* export default */const eN=eW;var eL={searchWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;padding:",K/* .spacing["20"] */.YK["20"],";"),tableWrapper:/*#__PURE__*/(0,d/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;tr{td:first-of-type{padding-left:",K/* .spacing["20"] */.YK["20"],";}td:last-of-type{padding-right:",K/* .spacing["20"] */.YK["20"],";}}"),tableLabel:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body("medium"),";text-align:left;color:",K/* .colorTokens.text.primary */.I6.text.primary,";&[data-index]{padding-left:",K/* .spacing["4"] */.YK["4"],";}"),title:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),"    width:100%;text-align:left;",O/* .typography.caption */.I.caption(),";min-width:340px;max-width:400px;"),footer:/*#__PURE__*/(0,d/* .css */.AH)("box-shadow:",K/* .shadow.dividerTop */.r7.dividerTop,";height:56px;display:flex;align-items:center;justify-content:end;gap:",K/* .spacing["16"] */.YK["16"],";padding-inline:",K/* .spacing["16"] */.YK["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useVisibilityControl.tsx
var eB=n(91612);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx
var eR=(0,ea/* .getCourseId */.p)();var eU=e=>{var{lessonId:t="",topicId:n,closeModal:o,icon:s,title:l,subtitle:d,contentDripType:p}=e;var v,h,m,b;var y=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var w=((v=es/* .tutorConfig.settings */.P.settings)===null||v===void 0?void 0:v.chatgpt_enable)==="on";var D=es/* .tutorConfig.enable_lesson_classic_editor */.P.enable_lesson_classic_editor==="1";var C=((h=es/* .tutorConfig.settings */.P.settings)===null||h===void 0?void 0:h.hide_admin_bar_for_users)==="off";var E=(m=es/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||m===void 0?void 0:m.includes(el/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var H=(b=es/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||b===void 0?void 0:b.includes(el/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var z=D&&(E||H&&C);var K=(0,ei/* .useLessonDetailsQuery */.Cx)(t,n);var O=(0,ei/* .useSaveLessonMutation */.K3)(eR);var F=(0,A/* .useQueryClient */.jE)();var{showModal:W}=(0,em/* .useModal */.h)();var{data:N,isLoading:L}=K;var R=F.getQueryData(["Topic",eR]);var{fields:U}=(0,er/* .useCourseBuilderSlot */._)();var j=(0,eB/* ["default"] */.A)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME);var V=(0,eB/* ["default"] */.A)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW */.qP.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW);var Q=(0,eB/* ["default"] */.A)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.qP.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE);var G=(0,eB/* ["default"] */.A)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO);var X=(0,eB/* ["default"] */.A)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES */.qP.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES);var Z=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{title:"",description:"",thumbnail:null,tutor_attachments:[],lesson_preview:false,video:null,duration:{hour:0,minute:0,second:0},content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var $=Z.formState.dirtyFields&&Object.keys(Z.formState.dirtyFields).length>0;var ea=Boolean(p!==""||j||Q||G||X||(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW)&&V);(0,u.useEffect)(()=>{if(N&&!L){var e,t,n,i,a,o;Z.reset((0,r._)({title:N.post_title||"",description:(0,B/* .normalizeLineEndings */.EW)(N.post_content)||"",thumbnail:{id:N.thumbnail_id?Number(N.thumbnail_id):0,title:"",url:N.thumbnail||""},tutor_attachments:N.attachments||[],lesson_preview:N.is_preview||false,video:N.video||null,duration:{hour:((e=N.video.runtime)===null||e===void 0?void 0:e.hours)||0,minute:((t=N.video.runtime)===null||t===void 0?void 0:t.minutes)||0,second:((n=N.video.runtime)===null||n===void 0?void 0:n.seconds)||0},content_drip_settings:{unlock_date:(N===null||N===void 0?void 0:(i=N.content_drip_settings)===null||i===void 0?void 0:i.unlock_date)||"",after_xdays_of_enroll:(N===null||N===void 0?void 0:(a=N.content_drip_settings)===null||a===void 0?void 0:a.after_xdays_of_enroll)||"",prerequisites:(N===null||N===void 0?void 0:(o=N.content_drip_settings)===null||o===void 0?void 0:o.prerequisites)||[]}},Object.fromEntries((0,B/* .findSlotFields */.DE)({fields:U.Curriculum.Lesson}).map(e=>[e,N[e]]))))}var s=document.querySelector(".button.insert-media.add_media");var l=document.querySelector(".add-h5p-content-button");if(s&&l){s.after(l)}var d=setTimeout(()=>{Z.setFocus("title")},0);return()=>{clearTimeout(d)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[N,L]);var eu=e=>(0,x._)(function*(){var r=(0,ei/* .convertLessonDataToPayload */.R6)(e,t,n,p,(0,B/* .findSlotFields */.DE)({fields:U.Curriculum.Lesson}));var i=yield O.mutateAsync(r);if(i.data){o({action:"CONFIRM"})}})();var ep=()=>{var e=Z.getValues("description");var t=e.match(/\[h5p id="(\d+)"\]/g)||[];var n=t.map(e=>{var t;var n=((t=e.match(/\[h5p id="(\d+)"\]/))===null||t===void 0?void 0:t[1])||"";return String(n)});var r=t=>{var n=e=>{return'[h5p id="'.concat(e.id,'"]')};var r=t.map(n);Z.setValue("description","".concat(e,"\n").concat(r.join("\n")),{shouldDirty:true})};W({component:eN,props:{title:(0,c.__)("Select H5P Content","tutor"),onAddContent:r,contentType:"lesson",addedContentIds:n}})};return/*#__PURE__*/(0,a/* .jsx */.Y)(et/* ["default"] */.A,{onClose:()=>o({action:"CLOSE"}),icon:$?/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"warning",width:24,height:24}):s,title:$?el/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":l,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?d:"",maxWidth:1070,actions:$&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(t){Z.reset()}else{o({action:"CLOSE"})}},children:t?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-lesson",loading:O.isPending,variant:"primary",size:"small",onClick:Z.handleSubmit(eu),children:t?(0,c.__)("Update","tutor"):(0,c.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.wrapper({hasRightSidebar:ea}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!K.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.lessonInfo({hasRightSidebar:ea}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"title",control:Z.control,rules:(0,r._)({required:(0,c.__)("Lesson title is required.","tutor")},(0,ec/* .maxLimitRule */.wA)(255)),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Name","tutor"),placeholder:(0,c.__)("Enter Lesson Name","tutor"),generateWithAi:!y||w,isClearable:true}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.description,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"description",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ee/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.descriptionLabel,children:[(0,c.__)("Content","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:z,children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Save the lesson first to use the WP Editor.","tutor"),delay:200,disabled:!!t,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{window.open("".concat(es/* .tutorConfig.site_url */.P.site_url,"/wp-admin/post.php?post=").concat(t,"&action=edit"),"_blank","noopener")},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24}),buttonCss:eV.wpEditorButton,disabled:!t,children:(0,c.__)("WP Editor","tutor")})})})]}),placeholder:(0,c.__)("Enter Lesson Description","tutor"),generateWithAi:!y||w}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y&&(0,B/* .isAddonEnabled */.GR)(el/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!y,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:eV.addH5PContentButton({isPro:false}),type:"reset",className:"add-h5p-content-button",disabled:true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-button-text":true,children:(0,c.__)("Add H5P Content","tutor")})})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{className:"add-h5p-content-button",css:eV.addH5PContentButton,type:"button",onClick:ep,children:(0,c.__)("Add H5P Content","tutor")})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Lesson.after_description",form:Z})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.rightPanel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"thumbnail",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eg/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Featured Image","tutor"),buttonText:(0,c.__)("Upload Image","tutor"),infoText:/* translators: %s is the maximum allowed upload file size (e.g., "2MB") */(0,c.sprintf)((0,c.__)("JPEG, PNG, GIF, and WebP formats, up to %s","tutor"),(0,B/* .formatBytes */.z3)(Number((es/* .tutorConfig */.P===null||es/* .tutorConfig */.P===void 0?void 0:es/* .tutorConfig.max_upload_size */.P.max_upload_size)||0))),visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.qP.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"video",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(e_/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Video","tutor"),buttonText:(0,c.__)("Upload Video","tutor"),infoText:(0,c.sprintf)((0,c.__)("MP4, and WebM formats, up to %s","tutor"),(0,B/* .formatBytes */.z3)(Number((es/* .tutorConfig */.P===null||es/* .tutorConfig */.P===void 0?void 0:es/* .tutorConfig.max_upload_size */.P.max_upload_size)||0))),onGetDuration:e=>{Z.setValue("duration.hour",e.hours);Z.setValue("duration.minute",e.minutes);Z.setValue("duration.second",e.seconds)},visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:j,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.durationWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eV.additionLabel,children:(0,c.__)("Video Playback Time","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.duration,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"duration.hour",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eV.durationContent,children:(0,c.__)("hour","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"duration.minute",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eV.durationContent,children:(0,c.__)("min","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"duration.second",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eV.durationContent,children:(0,c.__)("sec","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))})]})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="specific_days",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.after_xdays_of_enroll",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Available after days","tutor")]}),helpText:(0,c.__)("This lesson will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="unlock_by_date",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.unlock_date",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(q/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Unlock Date","tutor")]}),placeholder:(0,c.__)("Select Unlock Date","tutor"),helpText:(0,c.__)("This lesson will be available from the given date. Leave empty to make it available immediately.","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p==="after_finishing_prerequisites",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"content_drip_settings.prerequisites",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(J,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:R.reduce((e,a)=>{if(String(a.id)===String(n)){e.push((0,i._)((0,r._)({},a),{contents:a.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(a)}return e},[])||[],isSearchable:true,helpText:(0,c.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"tutor_attachments",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Exercise Files","tutor"),buttonText:(0,c.__)("Upload Attachment","tutor"),selectMultiple:true,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES */.qP.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!y||V&&(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.lessonPreview,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"lesson_preview",control:Z.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{disabled:!y,label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.previewLabel,children:[(0,c.__)("Lesson Preview","tutor"),!y&&/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})]}),helpText:(0,c.__)("If checked, any user/guest can view this lesson without enrolling in the course.","tutor"),visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW */.qP.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:Z.watch("lesson_preview"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.previewInfo,children:(0,c.__)("This lesson is now available for preview. Users and guests can view it without enrolling in the course.","tutor")})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Lesson.bottom_of_sidebar",form:Z})]})]})})})};/* export default */const ej=eU;var eV={wrapper:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,d/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:",t?"1fr 338px":"1fr",";height:100%;width:100%;padding-inline:",K/* .spacing["32"] */.YK["32"],";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",K/* .spacing["24"] */.YK["24"],";}",K/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",K/* .spacing["16"] */.YK["16"],";}")},lessonInfo:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,d/* .css */.AH)("padding-block:",K/* .spacing["20"] */.YK["20"],";padding-right:",t&&K/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",K/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",K/* .zIndex.positive */.fE.positive,";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}")},description:/*#__PURE__*/(0,d/* .css */.AH)("position:relative;"),descriptionLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;height:32px;"),addH5PContentButton:e=>{var{isPro:t=true}=e;return/*#__PURE__*/(0,d/* .css */.AH)("text-decoration:none;font-size:13px;line-height:2.15384615;min-height:30px;margin:0;padding:",!t?"0px":"0 10px",";cursor:pointer;border:1px solid #3e64de;border-radius:3px;white-space:nowrap;box-sizing:border-box;color:#3e64de;border-color:#3e64de;background:transparent;[data-button-text]{",L/* .styleUtils.flexCenter */.x.flexCenter(),";padding:0 10px;}:hover:not(:disabled){background:",K/* .colorTokens.background.white */.I6.background.white,";color:#3e64de;}:disabled{cursor:not-allowed;position:relative;top:auto;left:auto;opacity:0.5;}")},rightPanel:/*#__PURE__*/(0,d/* .css */.AH)("border-left:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",K/* .spacing["16"] */.YK["16"],";padding-block:",K/* .spacing["20"] */.YK["20"],";padding-left:",K/* .spacing["32"] */.YK["32"],";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),durationWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["8"] */.YK["8"],";"),duration:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";"),durationContent:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";"),additionLabel:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),"    color:",K/* .colorTokens.text.title */.I6.text.title,";"),lessonPreview:/*#__PURE__*/(0,d/* .css */.AH)("background-color:",K/* .colorTokens.background.white */.I6.background.white,";padding:",K/* .spacing["12"] */.YK["12"],";border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",K/* .borderRadius["8"] */.Vq["8"],";"),previewLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",K/* .spacing["4"] */.YK["4"],";color:",K/* .colorTokens.icon.success */.I6.icon.success,";}"),previewInfo:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(),";text-align:center;color:",K/* .colorTokens.text.title */.I6.text.title,";padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["24"] */.YK["24"],";background:",K/* .colorTokens.background.status.success */.I6.background.status.success,";border-radius:",K/* .borderRadius["4"] */.Vq["4"],";margin-top:",K/* .spacing["12"] */.YK["12"],";"),wpEditorButton:/*#__PURE__*/(0,d/* .css */.AH)("margin-left:",K/* .spacing["4"] */.YK["4"],";color:",K/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}&:hover:not(:disabled){text-decoration:underline;}")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Toast.tsx
var eQ=n(45549);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var eG=n(61046);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Tabs.tsx
var eX=n(28109);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/contexts/QuizModalContext.tsx
var eZ=/*#__PURE__*/(0,u.createContext)(null);var eJ=()=>{var e=(0,u.useContext)(eZ);if(!e){throw new Error("useQuizModalContext must be used within a QuizModalContextProvider")}return e};var e$=e=>{var{children:t,quizId:n,contentType:r,validationError:i}=e;var[o,s]=(0,u.useState)("");var l=(0,Y/* .useFormContext */.xW)();var d=l.watch("questions")||[];var c=(0,u.useRef)(d);var[p,v]=(0,u.useState)(i||null);var h=d.findIndex(e=>e.question_id===o);(0,u.useEffect)(()=>{if(d.length===0){s("")}else if(c.current.length!==0&&c.current.length<d.length){var e=d.find(e=>!c.current.some(t=>String(t.question_id)===String(e.question_id)));s((e===null||e===void 0?void 0:e.question_id)||"")}else if(h===-1){s(d[0].question_id)}c.current=d;// eslint-disable-next-line react-hooks/exhaustive-deps
},[d.length]);(0,u.useEffect)(()=>{if(h===-1&&o){s("")}},[h,o]);return/*#__PURE__*/(0,a/* .jsx */.Y)(eZ.Provider,{value:{activeQuestionIndex:h,activeQuestionId:o,setActiveQuestionId:s,quizId:n,validationError:p,setValidationError:v,contentType:r},children:typeof t==="function"?t({activeQuestionIndex:h,activeQuestionId:o,setActiveQuestionId:s,setValidationError:v}):t})};// EXTERNAL MODULE: ./assets/react/v3/shared/utils/types.ts
var e0=n(51298);// CONCATENATED MODULE: ./assets/react/v3/shared/utils/quiz.ts
var e1=(e,t)=>{if(t===e){return null}if(e===e0/* .QuizDataStatus.NEW */.cW.NEW){return e0/* .QuizDataStatus.NEW */.cW.NEW}if((e===e0/* .QuizDataStatus.UPDATE */.cW.UPDATE||e===e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE)&&t===e0/* .QuizDataStatus.UPDATE */.cW.UPDATE){return e0/* .QuizDataStatus.UPDATE */.cW.UPDATE}return e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE};var e2=e=>{if(e){var t=e.question_type;if(t==="h5p"){return true}var n=e.question_answers||[];var r=n.every(e=>e.is_saved);var i=n.some(e=>e.is_correct==="1");if(n.length===0&&t!=="open_ended"&&t!=="short_answer"){return{message:(0,c.__)("Please add an option.","tutor"),type:"add_option"}}if(!r){return{message:(0,c.__)("Please finish editing all newly created options.","tutor"),type:"save_option"}}if(["true_false","multiple_choice"].includes(t)&&!i){return{message:(0,c.__)("Please select a correct answer.","tutor"),type:"correct_option"}}if(t==="matching"){var a=e.question_settings.is_image_matching;var o=n.every(e=>e.answer_title);if(!o){return{message:(0,c.__)("Please add titles to all options.","tutor"),type:"save_option"}}if(a){var s=n.every(e=>e.image_url);if(!s){return{message:(0,c.__)("Please add images to all options.","tutor"),type:"question"}}}else{var l=n.every(e=>e.answer_two_gap_match);if(!l){return{message:(0,c.__)("Please add matched text to all options.","tutor"),type:"save_option"}}}}}return true};var e4=e=>{var t=e=>{if(e.image_url){return e.answer_view_format==="text_image"?e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE}return e.answer_view_format==="text"?e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE};if(e.question_settings){e.question_settings.answer_required=!!Number(e.question_settings.answer_required);e.question_settings.show_question_mark=!!Number(e.question_settings.show_question_mark);e.question_settings.randomize_question=!!Number(e.question_settings.randomize_question)}e.question_answers=e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:t(e),is_saved:true,answer_view_format:e.image_url?"text_image":"text"}));e.question_description=(0,B/* .normalizeLineEndings */.EW)(e.question_description)||"";e.answer_explanation=e.answer_explanation==='<p><br data-mce-bogus="1"></p>'?"":(0,B/* .normalizeLineEndings */.EW)(e.answer_explanation)||"";switch(e.question_type){case"single_choice":{return(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"multiple_choice",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,i._)((0,r._)({},e.question_settings),{question_type:"multiple_choice",has_multiple_correct_answer:false})})}case"multiple_choice":{return(0,i._)((0,r._)({},e),{_data_status:e.question_settings.has_multiple_correct_answer?e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,i._)((0,r._)({},e.question_settings),{has_multiple_correct_answer:e.question_settings.has_multiple_correct_answer?!!Number(e.question_settings.has_multiple_correct_answer):true})})}case"matching":{return(0,i._)((0,r._)({},e),{_data_status:e.question_settings.is_image_matching?e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,i._)((0,r._)({},e.question_settings),{is_image_matching:e.question_settings.is_image_matching?!!Number(e.question_settings.is_image_matching):false})})}case"image_matching":{return(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"matching",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,i._)((0,r._)({},e.question_settings),{question_type:"matching",is_image_matching:true})})}default:return(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE})}};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionConditions.tsx
var e6={true_false:{label:(0,c.__)("True/False","tutor"),icon:"quizTrueFalse"},multiple_choice:{label:(0,c.__)("Multiple Choice","tutor"),icon:"quizMultiChoice"},open_ended:{label:(0,c.__)("Open Ended/Essay","tutor"),icon:"quizEssay"},fill_in_the_blank:{label:(0,c.__)("Fill in the Blanks","tutor"),icon:"quizFillInTheBlanks"},short_answer:{label:(0,c.__)("Short Answer","tutor"),icon:"quizShortAnswer"},matching:{label:(0,c.__)("Matching","tutor"),icon:"quizImageMatching"},image_answering:{label:(0,c.__)("Image Answering","tutor"),icon:"quizImageAnswer"},ordering:{label:(0,c.__)("Ordering","tutor"),icon:"quizOrdering"},h5p:{label:(0,c.__)("H5P","tutor"),icon:"quizTrueFalse"}};var e5=["multiple_choice","matching","image_answering"];var e8=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,setValidationError:o}=eJ();var s=(0,Y/* .useFormContext */.xW)();var l=s.watch("questions.".concat(e,".question_type"));var u=s.watch("questions.".concat(e,"._data_status"));if(!t){return/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:e7.emptyQuestions,children:(0,c.__)("Create/Select a question to view details","tutor")})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:e7.questionTypeWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:O/* .typography.caption */.I.caption("medium"),children:(0,c.__)("Question Type","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:e7.questionType,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:l?e6[l].icon:"quizTrueFalse",width:32,height:32}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:l?e6[l].label:""})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:e7.conditions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,c.__)("Conditions:","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:e7.conditionControls,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:l==="multiple_choice",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.has_multiple_correct_answer"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Multiple Correct Answer","tutor"),onChange:t=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}// Reset all answers to incorrect on multiple correct answer toggle from true to false
    if(!t){s.setValue("questions.".concat(e,".question_answers"),s.getValues("questions.".concat(e,".question_answers")).map(e=>{return(0,i._)((0,r._)({},e),{is_correct:"0"})}))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:l==="matching",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.is_image_matching"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Image Matching","tutor"),onChange:t=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}if((n===null||n===void 0?void 0:n.type)==="question"&&!t){o(null)}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.answer_required"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Answer Required","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:e5.includes(l),children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.randomize_question"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Randomize Choice","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.question_mark"),rules:{min:0},render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Point For This Question","tutor"),type:"number",isInlineLabel:true,placeholder:"0",style:/*#__PURE__*/(0,d/* .css */.AH)("max-width:80px;"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:s.control,name:"questions.".concat(e,".question_settings.show_question_mark"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,c.__)("Display Points","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Quiz.bottom_of_question_sidebar",namePrefix:"questions.".concat(e,"."),form:s})]})]})]},"".concat(t,"-").concat(e))};/* export default */const e3=e8;var e7={emptyQuestions:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["24"] */.YK["24"]," ",K/* .spacing["24"] */.YK["24"],";",O/* .typography.caption */.I.caption("medium"),";"),questionTypeWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["24"] */.YK["24"]," ",K/* .spacing["24"] */.YK["24"],";gap:",K/* .spacing["10"] */.YK["10"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),questionType:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["10"] */.YK["10"],";"),conditions:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["24"] */.YK["24"]," ",K/* .spacing["24"] */.YK["24"],";p{",O/* .typography.body */.I.body("medium"),";color:",K/* .colorTokens.text.primary */.I6.text.primary,";}"),conditionControls:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["16"] */.YK["16"],";margin-top:",K/* .spacing["16"] */.YK["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Alert.tsx
var e9=n(51550);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx
function te(){var e=(0,b._)(["\n      background-color: ",";\n      padding: "," ",";\n\n      &:hover {\n        background-color: ",";\n      }\n    "]);te=function t(){return e};return e}function tt(){var e=(0,b._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);tt=function t(){return e};return e}function tn(){var e=(0,b._)(["\n      padding: 0;\n    "]);tn=function t(){return e};return e}function tr(){var e=(0,b._)(["\n        background-color: transparent;\n      "]);tr=function t(){return e};return e}function ti(){var e=(0,b._)(["\n        resize: vertical;\n      "]);ti=function t(){return e};return e}function ta(){var e=(0,b._)(["\n      opacity: 1;\n    "]);ta=function t(){return e};return e}var to=e=>{var{label:t,field:n,fieldState:r,disabled:i,loading:o,placeholder:s,helpText:l,onChange:d}=e;var p;var v=(p=n.value)!==null&&p!==void 0?p:"";var[h,g]=(0,u.useState)(false);var[_,m]=(0,u.useState)(v);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tl.wrapper({hasValue:!!v&&!h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:h||v,children:/*#__PURE__*/(0,a/* .jsx */.Y)("label",{css:tl.answerLabel,children:t})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tl.editorWrapper({isEdit:h}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tl.container({isEdit:h||!!v}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!v&&!h,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(ee/* ["default"] */.A,{field:n,fieldState:r,disabled:i,helpText:l,loading:o,readOnly:!h,onChange:d,placeholder:s,autoFocus:true,isMinimal:true}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tl.placeholder,children:s})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-action-buttons":true,css:tl.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{n.onChange(_);g(false)},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:()=>{var e;m((e=n.value)!==null&&e!==void 0?e:"");g(false)},disabled:n.value===_,children:(0,c.__)("Ok","tutor")})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:()=>{if(!h&&!i){g(true)}},onKeyDown:e=>{if((e.key==="Enter"||e.key===" ")&&!h){g(true)}},"data-overlay":true,tabIndex:0,role:"button"})})]})})]})};/* export default */const ts=to;var tl={wrapper:e=>{var{hasValue:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["10"] */.YK["10"],";border-radius:",K/* .borderRadius.card */.Vq.card,";",t&&(0,d/* .css */.AH)(te(),K/* .colorTokens.color.success["30"] */.I6.color.success["30"],K/* .spacing["12"] */.YK["12"],K/* .spacing["24"] */.YK["24"],K/* .colorTokens.color.success["40"] */.I6.color.success["40"]))},editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;max-height:400px;overflow-y:scroll;",t&&(0,d/* .css */.AH)(tt()))},container:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",K/* .spacing["16"] */.YK["16"],";min-height:48px;height:100%;width:100%;inset:0;border-radius:",K/* .borderRadius["6"] */.Vq["6"],";transition:background 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",K/* .borderRadius.card */.Vq.card,";}}& label{",O/* .typography.caption */.I.caption(),"      margin-bottom:",K/* .spacing["6"] */.YK["6"],";color:",K/* .colorTokens.text.title */.I6.text.title,";}",t&&(0,d/* .css */.AH)(tn()),"    &:hover{background-color:",K/* .colorTokens.background.white */.I6.background.white,";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";cursor:text;[data-action-buttons]{opacity:1;}",t&&(0,d/* .css */.AH)(tr()),"}")},inputContainer:e=>/*#__PURE__*/(0,d/* .css */.AH)("position:relative;display:flex;& textarea{",O/* .typography.caption */.I.caption(),"      color:",K/* .colorTokens.text.title */.I6.text.title,";height:auto;padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["12"] */.YK["12"],";resize:none;",e&&(0,d/* .css */.AH)(ti()),"}"),clearButton:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;right:",K/* .spacing["2"] */.YK["2"],";top:",K/* .spacing["2"] */.YK["2"],";width:36px;height:36px;border-radius:",K/* .borderRadius["2"] */.Vq["2"],";background:transparent;button{padding:",K/* .spacing["10"] */.YK["10"],";}"),placeholder:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["24"] */.YK["24"],";",O/* .typography.caption */.I.caption(),"    color:",K/* .colorTokens.text.hints */.I6.text.hints,";display:flex;align-items:center;height:100%;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.AH)(ta()))},answer:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["24"] */.YK["24"],";border-radius:",K/* .borderRadius.card */.Vq.card,";display:flex;flex-direction:column;gap:",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.success.fill30 */.I6.background.success.fill30,";color:",K/* .colorTokens.text.title */.I6.text.title,";transition:background 0.15s ease-in-out;&:hover{background-color:",K/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,";}"),answerLabel:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),"    color:",K/* .colorTokens.text.title */.I6.text.title,";"),answerParagraph:/*#__PURE__*/(0,d/* .css */.AH)("pre{",L/* .styleUtils.overflowXAuto */.x.overflowXAuto,"}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx
function td(){var e=(0,b._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);td=function t(){return e};return e}function tc(){var e=(0,b._)(["\n      &:hover,\n      &:has([data-overlay]:focus-visible) {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: 1;\n        }\n      }\n    "]);tc=function t(){return e};return e}function tu(){var e=(0,b._)(["\n      padding-inline: 0;\n    "]);tu=function t(){return e};return e}function tp(){var e=(0,b._)(["\n      opacity: 1;\n    "]);tp=function t(){return e};return e}var tv=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var th=e=>{var{label:t,field:n,fieldState:r,disabled:i=false,loading:o,placeholder:s,helpText:l,onChange:d}=e;var p;var v=(p=n.value)!==null&&p!==void 0?p:"";var[h,g]=(0,u.useState)(false);var[_,m]=(0,u.useState)(v);var b=()=>{n.onChange(_);g(false)};var y=()=>{g(false);m(n.value||"")};var w=()=>{if(!h&&!i){g(true)}};var x=e=>{if((e.key==="Enter"||e.key===" ")&&!h){e.preventDefault();g(true)}};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tg.editorWrapper({isEdit:h}),tabIndex:-1,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tg.container({isEdit:h,isDisabled:i}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!h&&(!tv||!v),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tg.editorContainer,"aria-hidden":!h,// @ts-ignore
inert:!h?"":undefined,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:tv,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(eG/* ["default"] */.A,{field:n,fieldState:r,label:t,disabled:i,helpText:l,loading:o,readOnly:!h,onChange:d,placeholder:s,autoResize:true,maxHeight:400}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(ee/* ["default"] */.A,{field:n,fieldState:r,label:t,disabled:i,helpText:l,loading:o,readOnly:!h,onChange:d,placeholder:s,min_height:100,max_height:400,autoFocus:true,toolbar1:"bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | ".concat(tv?" codesample":""," | wp_adv"),toolbar2:"formatselect strikethrough hr wp_more forecolor pastetext removeformat charmap outdent indent undo redo wp_help fullscreen tutor_button undoRedoDropdown"})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tg.placeholder,dangerouslySetInnerHTML:{__html:v||s||""},tabIndex:-1,"aria-hidden":"true"})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-action-buttons":true,css:tg.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:b,children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:y,disabled:v===_,children:(0,c.__)("Ok","tutor")})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:w,onKeyDown:x,"data-overlay":true,tabIndex:0,role:"button","aria-label":v?(0,c.__)("Edit description","tutor"):(0,c.__)("Add description","tutor")})})]})})};/* export default */const tf=th;var tg={editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;max-height:400px;overflow-y:auto;border-radius:",K/* .borderRadius["6"] */.Vq["6"],";",t&&(0,d/* .css */.AH)(td()))},container:e=>{var{isEdit:t,isDisabled:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",K/* .spacing["16"] */.YK["16"],";min-height:64px;height:100%;width:100%;inset:0;padding-inline:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"],";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";transition:background-color 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;cursor:pointer;&:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",K/* .borderRadius.card */.Vq.card,";}}& label{",O/* .typography.caption */.I.caption(),";margin-bottom:",K/* .spacing["6"] */.YK["6"],";color:",K/* .colorTokens.text.title */.I6.text.title,";}",!n&&(0,d/* .css */.AH)(tc(),!t&&K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.text.subdued */.I6.text.subdued)," ",t&&(0,d/* .css */.AH)(tu()))},editorContainer:/*#__PURE__*/(0,d/* .css */.AH)("position:relative;width:100%;"),placeholder:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),"    color:",K/* .colorTokens.text.hints */.I6.text.hints,";height:100%;inset:0;padding-block:",K/* .spacing["8"] */.YK["8"],";overflow-x:hidden;pointer-events:none;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.AH)(tp()))}};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx
function t_(){var e=(0,b._)(["\n      min-height: 40px;\n      padding-inline: "," ",";\n      border-radius: ",";\n    "]);t_=function t(){return e};return e}function tm(){var e=(0,b._)(["\n      &:hover {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: ",";\n        }\n      }\n    "]);tm=function t(){return e};return e}function tb(){var e=(0,b._)(["\n      display: block;\n      background-color: ",";\n      color: ",";\n      padding: 0;\n      cursor: default;\n    "]);tb=function t(){return e};return e}function ty(){var e=(0,b._)(["\n        ","\n      "]);ty=function t(){return e};return e}function tw(){var e=(0,b._)(["\n      ","\n      padding: "," ",";\n      border-radius: ",";\n    "]);tw=function t(){return e};return e}function tx(){var e=(0,b._)(["\n      opacity: 1;\n    "]);tx=function t(){return e};return e}var tA=e=>{var{maxLimit:t,maxHeight:n,field:o,fieldState:s,disabled:l,readOnly:d,loading:p,placeholder:v,helpText:h,onChange:g,onKeyDown:m,isHidden:b,isSecondary:y=false,removeBorder:w,dataAttribute:x,isInlineLabel:A=false,style:Y,wrapperCss:k,selectOnFocus:I=false,size:D="regular",isEdit:C,onToggleEdit:E}=e;var q;var T=(q=o.value)!==null&&q!==void 0?q:"";var S=(0,u.useRef)(null);var M=(0,e0/* .isDefined */.O9)(C);var[H,z]=(0,u.useState)(!T?true:false);var K=M?C:H;var[O,F]=(0,u.useState)(T);var W=undefined;if(t){W={maxLimit:t,inputCharacter:T.toString().length}}var N=(0,r._)({},(0,e0/* .isDefined */.O9)(x)&&{[x]:true});(0,u.useEffect)(()=>{if(K&&S.current){S.current.focus();F(T)}U();// eslint-disable-next-line react-hooks/exhaustive-deps
},[K]);var L=e=>{if(!M){z(e)}E===null||E===void 0?void 0:E(e)};var B=()=>{L(false)};var R=()=>{o.onChange(O);L(false)};var U=()=>{if(S.current){var e=S.current;var t=e.offsetHeight;var r=e.scrollHeight;if(r>t){if(n&&r>n){e.style.height="".concat(n,"px");e.style.overflowY="auto"}else{e.style.height="".concat(r,"px");e.style.overflowY="hidden"}}}};return/*#__PURE__*/(0,a/* .jsx */.Y)(j/* ["default"] */.A,{field:o,fieldState:s,disabled:l,readOnly:d,loading:p,helpText:h,isHidden:b,characterCount:W,isSecondary:y,removeBorder:w,isInlineLabel:A,inputStyle:Y,children:e=>{return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{role:"button",css:[tk.container({isEdit:K,isDisabled:l||false,size:D}),k],"aria-label":(0,c.__)("Question title field","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!K,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-placeholder":true,css:tk.placeholder({size:D}),onClick:()=>!l&&L(true),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){L(true)}},children:o.value||v})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:K,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tk.inputContainer({hasValueChanged:!!O&&o.value!==O,size:D}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("textarea",(0,i._)((0,r._)({},o,e,N),{className:"tutor-input-field",rows:2,ref:e=>{o.ref(e);// @ts-ignore
S.current=e;// this is not ideal but it is the only way to set ref to the input element
},value:T,placeholder:v,onChange:e=>{var{value:t}=e.target;o.onChange(t);if(g){g(t)}},onKeyDown:e=>{if(e.key==="Enter"&&(e.ctrlKey||e.metaKey)){e.preventDefault();B()}else if(e.key==="Escape"){e.preventDefault();R()}m===null||m===void 0?void 0:m(e.key)},onInput:U,onPaste:U,onFocus:e=>{if(I){e.target.select()}},autoComplete:"off"}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-action-buttons":true,css:tk.actionButtonWrapper({isEdit:K}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:K,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:tk.actionButton,variant:"text",size:"small",onClick:()=>L(true),"aria-label":(0,c.__)("Edit question title","tutor"),"data-question-title-edit-button":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",height:24,width:24})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o.value!==O&&o.value,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:tk.actionButton,variant:"text",size:"small",onClick:B,disabled:o.value===O,"aria-label":(0,c.__)("Save question title","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"checkMark",height:24,width:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!!T&&O,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:tk.actionButton,variant:"text",size:"small",onClick:R,"aria-label":(0,c.__)("Cancel question title","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"lineCross",height:24,width:24})})})]})})})]})}})};/* export default */const tY=tA;var tk={container:e=>{var{isEdit:t,isDisabled:n,size:r}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";grid-template-columns:1fr auto;min-height:50px;padding-inline:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"],";padding-block:",K/* .spacing["8"] */.YK["8"],";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";",r==="small"&&(0,d/* .css */.AH)(t_(),K/* .spacing["4"] */.YK["4"],K/* .spacing["8"] */.YK["8"],K/* .borderRadius["4"] */.Vq["4"])," ",!n&&(0,d/* .css */.AH)(tm(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.text.subdued */.I6.text.subdued,!n?1:0)," ",t&&(0,d/* .css */.AH)(tb(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.text.subdued */.I6.text.subdued)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-action-buttons]{opacity:1;}}")},inputContainer:e=>{var{hasValueChanged:t,size:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;display:flex;transition:background 0.15s ease-in-out;& textarea{",O/* .typography.heading6 */.I.heading6(),"      color:",K/* .colorTokens.text.primary */.I6.text.primary,";border:none;background:none;padding:0;width:100%;padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";&.tutor-input-field{padding-right:",t?K/* .spacing["64"] */.YK["64"]:K/* .spacing["32"] */.YK["32"],";}",n==="small"&&(0,d/* .css */.AH)(ty(),O/* .typography.caption */.I.caption()),"}")},placeholder:e=>{var{size:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.heading6 */.I.heading6(),"    color:",K/* .colorTokens.text.hints */.I6.text.hints,";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";",t==="small"&&(0,d/* .css */.AH)(tw(),O/* .typography.caption */.I.caption(),K/* .spacing["4"] */.YK["4"],K/* .spacing["8"] */.YK["8"],K/* .borderRadius["4"] */.Vq["4"]))},actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:",t?"absolute":"static",";height:100%;right:",K/* .spacing["4"] */.YK["4"],";top:0;display:flex;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.AH)(tx()))},actionButton:/*#__PURE__*/(0,d/* .css */.AH)("padding:0;color:",K/* .colorTokens.icon.subdued */.I6.icon.subdued,";")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx
function tI(){var e=(0,b._)(["\n      background-color: ",";\n      box-shadow: 0 0 0 1px ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);tI=function t(){return e};return e}function tD(){var e=(0,b._)(["\n      color: ",";\n    "]);tD=function t(){return e};return e}function tC(){var e=(0,b._)(["\n      color: ",";\n\n      span {\n        color: ",";\n      }\n    "]);tC=function t(){return e};return e}var tE=e=>{var{field:t,questionId:n,validationError:o,setValidationError:s}=e;var l,d,p,v;var h;var g=(h=t.value)!==null&&h!==void 0?h:{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:n,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"text",answer_order:0,is_correct:"0"};var m=(0,u.useRef)(null);var b=(l=g.answer_two_gap_match)===null||l===void 0?void 0:l.split("|");var[y,w]=(0,u.useState)(!g.answer_title||!g.answer_two_gap_match);var[A,Y]=(0,u.useState)(g);var k=((p=g.answer_title)===null||p===void 0?void 0:(d=p.match(/{dash}/g))===null||d===void 0?void 0:d.length)||0;var D=((v=g.answer_two_gap_match)===null||v===void 0?void 0:v.split("|").length)||0;var C=!!(g.answer_title&&g.answer_two_gap_match&&k!==D);(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(m.current)&&y){m.current.focus()}},[y]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.option,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.optionLabel({isEditing:y}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.optionTitle,children:(0,c.__)("Fill in the blanks","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:g.is_saved&&!y,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.optionActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();w(true)},"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!g.is_saved||y,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.optionPlaceholder({isTitle:!!g.answer_title}),children:g.answer_title?g.answer_title.replace(/{dash}/g,"_____"):(0,c.__)("Question title...","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tT.optionPlaceholder({isCorrectAnswer:b===null||b===void 0?void 0:b.length}),children:b&&b.length>0?/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:b,children:(e,t)=>/*#__PURE__*/(0,a/* .jsxs */.FD)(u.Fragment,{children:[e,/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t<(b?b.length-1:0),children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:"|"})})]},t)}):(0,c.__)("Correct Answer(s)...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},t),{ref:m,type:"text",placeholder:(0,c.__)("Question title...","tutor"),value:g.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{t.onChange((0,i._)((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,x._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&g.answer_title){t.onChange((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));w(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,c.__)("Please make sure to use the variable {dash} in your question title to show the blanks in your question. You can use multiple {dash} variables in one question.","tutor")})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},t),{type:"text",placeholder:(0,c.__)("Correct Answer(s)...","tutor"),value:b===null||b===void 0?void 0:b.join("|"),onClick:e=>{e.stopPropagation()},onChange:e=>{t.onChange((0,i._)((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>(0,x._)(function*(){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&g.answer_two_gap_match){t.onChange((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((o===null||o===void 0?void 0:o.type)==="save_option"){s===null||s===void 0?void 0:s(null)}w(false)}})()})),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:C,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.errorMessage,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,c.__)("Match the number of answers to the number of blanks {dash} in your question.","tutor")})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,c.__)("Separate multiple answers by a vertical bar |. 1 answer per {dash} variable is defined in the question. Example: Apple | Banana | Orange","tutor")})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tT.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:g.is_saved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();w(false);t.onChange(A)},children:(0,c.__)("Cancel","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,x._)(function*(){e.stopPropagation();if(C){return}t.onChange((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));Y((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((o===null||o===void 0?void 0:o.type)==="save_option"){s===null||s===void 0?void 0:s(null)}w(false)})(),disabled:!g.answer_title||!g.answer_two_gap_match||C,children:(0,c.__)("Ok","tutor")})]})]})})})]})})};/* export default */const tq=tE;var tT={option:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";transition:box-shadow 0.15s ease-in-out;background-color:",K/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(tI(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.stroke.brand */.I6.stroke.brand,K/* .colorTokens.stroke.brand */.I6.stroke.brand))},optionHeader:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:space-between;align-items:center;"),optionTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption("medium"),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";"),optionActions:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;gap:",K/* .spacing["8"] */.YK["8"],";align-items:center;"),actionButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;cursor:pointer;"),optionBody:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;"),optionInputWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,";gap:",K/* .spacing["16"] */.YK["16"],";"),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;"),optionPlaceholder:e=>{var{isTitle:t,isCorrectAnswer:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",K/* .spacing["4"] */.YK["4"],";display:flex;align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";",t&&(0,d/* .css */.AH)(tD(),K/* .colorTokens.text.hints */.I6.text.hints)," ",n&&(0,d/* .css */.AH)(tC(),K/* .colorTokens.text.success */.I6.text.success,K/* .colorTokens.stroke.border */.I6.stroke.border))},inputWithHints:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;gap:",K/* .spacing["4"] */.YK["4"],";",O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),errorMessage:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;gap:",K/* .spacing["4"] */.YK["4"],";",O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.error */.I6.text.error,";align-items:flex-start;color:",K/* .colorTokens.text.error */.I6.text.error,";svg{flex-shrink:0;color:",K/* .colorTokens.icon.error */.I6.icon.error,";}"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/FillinTheBlanks.tsx
var tS=()=>{var e=(0,Y/* .useFormContext */.xW)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:o,setValidationError:s}=eJ();var{fields:l}=(0,Y/* .useFieldArray */.jz)({control:e.control,name:"questions.".concat(n,".question_answers")});return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tH.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(tq,(0,i._)((0,r._)({},e),{questionId:t,validationError:o,setValidationError:s}))},l.length?JSON.stringify(l[0]):"")})};/* export default */const tM=tS;var tH={optionWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",K/* .spacing["40"] */.YK["40"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ImageInput.tsx
var tz=n(2971);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useWpMedia.ts
var tK=n(35804);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/dndkit.ts
var tO=n(29245);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx
function tF(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);tF=function t(){return e};return e}function tP(){var e=(0,b._)(["\n      background-color: ",";\n    "]);tP=function t(){return e};return e}function tW(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);tW=function t(){return e};return e}var tN=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var tL=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:o,field:s,isOverlay:d=false,questionId:p,validationError:v,setValidationError:h}=e;var g;var m=(g=s.value)!==null&&g!==void 0?g:{answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:p,belongs_question_type:"image_answering"};var b=(0,u.useRef)(null);var[w,A]=(0,u.useState)(!m.answer_title&&!m.image_id&&!m.image_url);var[Y,D]=(0,u.useState)(m);var{attributes:C,listeners:E,setNodeRef:q,transform:T,transition:S,isDragging:M}=(0,l/* .useSortable */.gl)({id:s.value.answer_id||0,animateLayoutChanges:tO/* .animateLayoutChanges */.J});var{openMediaLibrary:H,resetFiles:z}=(0,tK/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n}=e;s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n}))}},initialFiles:s.value.image_id?{id:Number(m.image_id),url:m.image_url||"",title:m.image_url||""}:null});var O={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(T),transition:S,opacity:M?.3:undefined};var F=()=>{s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));z()};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(b.current)&&w){b.current.focus()}},[w]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},C),{css:tR.option,ref:q,style:O,tabIndex:-1,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.optionLabel({isEditing:w,isOverlay:d,isDragging:M}),onClick:()=>{A(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){A(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:L/* .styleUtils.optionCounter */.x.optionCounter({isEditing:w}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!w&&m.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},E),{type:"button",css:L/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:d}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();A(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!tN,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(m)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();o()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tR.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:m.image_url,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tR.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tR.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:m.image_url,alt:m.image_url})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:tR.optionPlaceholder,children:m.answer_title||(0,c.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:L/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(tz/* ["default"] */.A,{value:{id:Number(m.image_id),url:m.image_url||"",title:m.image_url||""},buttonText:(0,c.__)("Upload Image","tutor"),infoText:(0,c.__)("Standard Size: 700x430 pixels","tutor"),uploadHandler:H,clearHandler:F,emptyImageCss:tR.emptyImageInput,previewImageCss:tR.previewImageInput}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{ref:b,type:"text",placeholder:(0,c.__)("Input answer here","tutor"),value:m.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,x._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&m.answer_title){s.onChange((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((v===null||v===void 0?void 0:v.type)==="save_option"){h===null||h===void 0?void 0:h(null)}A(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsxs */.FD)("p",{children:[(0,c.__)("Students need to type their answers exactly as you write them here. Use ","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:{fontWeight:K/* .fontWeight.semiBold */.Wy.semiBold},children:(0,c.__)("small caps","tutor")}),(0,c.__)(" when writing the answer.","tutor")]})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tR.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();A(false);s.onChange(Y);if(!m.is_saved){o();if((v===null||v===void 0?void 0:v.type)==="save_option"){h===null||h===void 0?void 0:h(null)}}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,x._)(function*(){e.stopPropagation();s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));D((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((v===null||v===void 0?void 0:v.type)==="save_option"){h===null||h===void 0?void 0:h(null)}A(false)})(),disabled:!m.answer_title||!m.image_id,children:(0,c.__)("Ok","tutor")})]})]})})})]})}))};/* export default */const tB=tL;var tR={option:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isOverlay:n,isDragging:r}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["20"] */.YK["20"],";width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(tF(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.stroke.brand */.I6.stroke.brand,K/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",r&&(0,d/* .css */.AH)(tP(),K/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",n&&(0,d/* .css */.AH)(tW(),K/* .shadow.drag */.r7.drag)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",K/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",K/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.AH)("background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",K/* .spacing["4"] */.YK["4"],";"),inputWithHints:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["4"] */.YK["4"],";",O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/ImageAnswering.tsx
var tU=()=>{var[e,t]=(0,u.useState)(null);var n=(0,Y/* .useFormContext */.xW)();var{activeQuestionIndex:d,activeQuestionId:p,validationError:h,setValidationError:g}=eJ();var{fields:m,append:b,insert:y,remove:w,move:x}=(0,Y/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(d,".question_answers")});var A=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));var k=(0,u.useMemo)(()=>{if(!e){return null}return m.find(t=>t.answer_id===e)},[e,m]);var I=()=>{b({_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:p,belongs_question_type:"image_answering",answer_order:m.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(d,".question_answers.").concat(m.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var D=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;y(a,n)};var C=(e,t)=>{w(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:tV.optionWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:A,collisionDetection:o/* .closestCenter */.fp,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=m.findIndex(e=>e.answer_id===n.id);var a=m.findIndex(e=>e.answer_id===r.id);x(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:m.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:m,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(tB,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>D(t,e),onRemoveOption:()=>C(t,e),index:t,questionId:p,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:k,children:t=>{var o=m.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(tB,(0,i._)((0,r._)({},e),{onDuplicateOption:B/* .noop */.lQ,onRemoveOption:B/* .noop */.lQ,index:o,isOverlay:true,questionId:p}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:I,buttonContentCss:tV.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* export default */const tj=tU;var tV={optionWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["12"] */.YK["12"],";padding-left:",K/* .spacing["40"] */.YK["40"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",K/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx
function tQ(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);tQ=function t(){return e};return e}function tG(){var e=(0,b._)(["\n      background-color: ",";\n    "]);tG=function t(){return e};return e}function tX(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);tX=function t(){return e};return e}function tZ(){var e=(0,b._)(["\n      gap: ",";\n    "]);tZ=function t(){return e};return e}var tJ=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var t$=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:o,field:s,isOverlay:d=false,isImageMatching:p,questionId:v,validationError:h,setValidationError:g}=e;var m;var b;var w=(b=s.value)!==null&&b!==void 0?b:{answer_id:"",answer_title:"",answer_two_gap_match:"",is_correct:"0",belongs_question_id:v,belongs_question_type:"matching"};var A=(0,u.useRef)(null);var[Y,D]=(0,u.useState)(!w.answer_title||p?!w.image_url:!w.answer_two_gap_match);var[C,E]=(0,u.useState)(w);var{attributes:q,listeners:T,setNodeRef:S,transform:M,transition:H,isDragging:z}=(0,l/* .useSortable */.gl)({id:s.value.answer_id||0,animateLayoutChanges:tO/* .animateLayoutChanges */.J});var{openMediaLibrary:K,resetFiles:O}=(0,tK/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n}=e;s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n}))}},initialFiles:((m=s.value)===null||m===void 0?void 0:m.image_id)?{id:Number(s.value.image_id),url:s.value.image_url||"",title:""}:null});var F={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(M),transition:H,opacity:z?.3:undefined};var W=()=>{s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));O()};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(A.current)&&Y){A.current.focus()}},[Y]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},q),{css:t1.option,ref:S,tabIndex:-1,style:F,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t1.optionLabel({isEditing:Y,isDragging:z,isOverlay:d}),onClick:()=>{D(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){D(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t1.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:L/* .styleUtils.optionCounter */.x.optionCounter({isEditing:Y}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!Y&&w.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},T),{type:"button",css:L/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:d}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t1.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();D(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!tJ,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(w)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,"data-visually-hidden":true,onClick:e=>{e.stopPropagation();o()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:t1.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:Y,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t1.placeholderWrapper({isImageMatching:p}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:t1.optionPlaceholder,children:w.answer_title||(0,c.__)("Answer title...","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w.image_url,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:t1.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:t1.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:w.image_url,alt:w.image_url})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:t1.optionPlaceholder,children:!p?w.answer_two_gap_match:w.answer_title})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:L/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:p,children:/*#__PURE__*/(0,a/* .jsx */.Y)(tz/* ["default"] */.A,{value:{id:Number(w.image_id),url:w.image_url||"",title:w.image_url||""},infoText:(0,c.__)("Standard Size: 700x430 pixels","tutor"),uploadHandler:K,clearHandler:W,emptyImageCss:t1.emptyImageInput,previewImageCss:t1.previewImageInput})}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{type:"text",ref:A,placeholder:!p?(0,c.__)("Question","tutor"):(0,c.__)("Image matched text..","tutor"),value:w.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,x._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&w.answer_title&&w.answer_two_gap_match){s.onChange((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));D(false)}})()})),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!p,children:/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{type:"text",placeholder:(0,c.__)("Matched option..","tutor"),value:w.answer_two_gap_match,onClick:e=>{e.stopPropagation()},onChange:e=>{s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>{e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&w.answer_title&&w.answer_two_gap_match){s.onChange((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}D(false)}}}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t1.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();D(false);s.onChange(C);if(!w.is_saved){if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}o()}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>{e.stopPropagation();s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));E((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}D(false)},disabled:!w.answer_title||(p?!w.image_id:!w.answer_two_gap_match),children:(0,c.__)("Ok","tutor")})]})]})})})]})}))};/* export default */const t0=t$;var t1={option:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(tQ(),K/* .colorTokens.background.white */.I6.background.white,K/* .colorTokens.stroke.brand */.I6.stroke.brand,K/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",n&&(0,d/* .css */.AH)(tG(),K/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",r&&(0,d/* .css */.AH)(tX(),K/* .shadow.drag */.r7.drag)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["8"] */.YK["8"],";place-self:center end;"),actionButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";",L/* .styleUtils.display.flex */.x.display.flex(),"    color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:pointer;&:disabled{cursor:not-allowed;color:",K/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}"),optionBody:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:e=>{var{isImageMatching:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;",t&&(0,d/* .css */.AH)(tZ(),K/* .spacing["12"] */.YK["12"]))},imagePlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",K/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",K/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.AH)("background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",K/* .spacing["4"] */.YK["4"],";"),optionInputWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;gap:",K/* .spacing["12"] */.YK["12"],";"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/Matching.tsx
var t2=()=>{var[e,t]=(0,u.useState)(null);var n=(0,Y/* .useFormContext */.xW)();var{activeQuestionIndex:d,activeQuestionId:p,validationError:h,setValidationError:g}=eJ();var{fields:m,append:b,insert:y,remove:w,move:x}=(0,Y/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(d,".question_answers")});var A=(0,Y/* .useWatch */.FH)({control:n.control,name:"questions.".concat(d,".question_settings.is_image_matching"),defaultValue:false});var k=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));var I=(0,u.useMemo)(()=>{if(!e){return null}return m.find(t=>t.answer_id===e)},[e,m]);var D=()=>{b({_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:p,belongs_question_type:A?"image_matching":"matching",answer_order:m.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(d,".question_answers.").concat(m.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var C=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;y(a,n)};var E=(e,t)=>{w(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:t6.optionWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:k,collisionDetection:o/* .closestCenter */.fp,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=m.findIndex(e=>e.answer_id===n.id);var a=m.findIndex(e=>e.answer_id===r.id);x(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:m.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:m,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(t0,(0,i._)((0,r._)({},n),{index:t,onDuplicateOption:e=>C(t,e),onRemoveOption:()=>E(t,e),isImageMatching:A,questionId:p,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:I,children:t=>{var o=m.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(t0,(0,i._)((0,r._)({},e),{index:o,onDuplicateOption:B/* .noop */.lQ,onRemoveOption:B/* .noop */.lQ,isOverlay:true,isImageMatching:A,questionId:p}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:D,buttonContentCss:t6.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* export default */const t4=t2;var t6={optionWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["12"] */.YK["12"],";padding-left:",K/* .spacing["40"] */.YK["40"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",K/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx
function t5(){var e=(0,b._)(["\n        fill: none;\n      "]);t5=function t(){return e};return e}function t8(){var e=(0,b._)(["\n          fill: ",";\n        "]);t8=function t(){return e};return e}function t3(){var e=(0,b._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n        ","\n      }\n    "]);t3=function t(){return e};return e}function t7(){var e=(0,b._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);t7=function t(){return e};return e}function t9(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);t9=function t(){return e};return e}function ne(){var e=(0,b._)(["\n      background-color: ",";\n    "]);ne=function t(){return e};return e}function nt(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);nt=function t(){return e};return e}var nn=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var nr=e=>{var{field:t,onDuplicateOption:n,onRemoveOption:o,onCheckCorrectAnswer:s,index:d,isOverlay:p=false,questionId:v,hasMultipleCorrectAnswer:h=false,questionType:g="multiple_choice",validationError:m,setValidationError:b}=e;var w,A;var Y;var D=(Y=t.value)!==null&&Y!==void 0?Y:{answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:v,belongs_question_type:"multiple_choice"};var C=(0,u.useRef)(null);var[E,q]=(0,u.useState)(!D.is_saved||!D.answer_title&&!D.image_url);var[T,S]=(0,u.useState)((0,e0/* .isDefined */.O9)(D.image_id)&&(0,e0/* .isDefined */.O9)(D.image_url));var[M,H]=(0,u.useState)(D);var{attributes:z,listeners:K,setNodeRef:O,transform:F,transition:W,isDragging:N}=(0,l/* .useSortable */.gl)({id:((w=t.value)===null||w===void 0?void 0:w.answer_id)||0,animateLayoutChanges:tO/* .animateLayoutChanges */.J});var{openMediaLibrary:R,resetFiles:U}=(0,tK/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:n,url:a}=e;t.onChange((0,i._)((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:n,image_url:a,answer_view_format:"text_image"}));S(true)}},initialFiles:((A=t.value)===null||A===void 0?void 0:A.image_id)?{id:Number(t.value.image_id),url:t.value.image_url||"",title:""}:null});var j={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(F),transition:W,opacity:N?.3:undefined};var V=()=>{U();t.onChange((0,i._)((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:"",answer_view_format:"text"}));S(false)};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(C.current)&&E){C.current.focus()}},[E]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},z),{css:na.option({isSelected:!!Number(D.is_correct),isMultipleChoice:h}),tabIndex:-1,ref:O,style:j,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:g==="multiple_choice",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:L/* .styleUtils.optionCheckButton */.x.optionCheckButton,"data-check-button":true,type:"button",onClick:s,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:h,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:Number(D.is_correct)?"checkFilled":"check",height:32,width:32}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:Number(D.is_correct)?"checkSquareFilled":"checkSquare",height:32,width:32})})},D.is_correct)}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.optionLabel({isSelected:!!Number(D.is_correct),isEditing:E,isDragging:N,isOverlay:p}),onClick:()=>{q(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){q(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.optionHeader({isEditing:E}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.optionCounterAndButton,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:L/* .styleUtils.optionCounter */.x.optionCounter({isSelected:!!Number(D.is_correct),isEditing:E}),children:String.fromCharCode(65+d)}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:E,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!T,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"removeImage",width:24,height:24}),onClick:e=>{e.stopPropagation();V()},children:(0,c.__)("Remove Image","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"addImage",width:24,height:24}),onClick:e=>{e.stopPropagation();R()},children:(0,c.__)("Add Image","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!E&&D.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},K),{type:"button",css:L/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:p}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();q(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!nn,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(D)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();o()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:na.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:E,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:D.image_url,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:na.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:D.image_url,alt:D.image_url})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:na.optionPlaceholder,children:D.answer_title||(0,c.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:L/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:T,children:/*#__PURE__*/(0,a/* .jsx */.Y)(tz/* ["default"] */.A,{value:{id:Number(D.image_id),url:D.image_url||"",title:(0,c.__)("Image","tutor")},buttonText:(0,c.__)("Upload Image","tutor"),infoText:(0,c.__)("Size: 700x430 pixels","tutor"),uploadHandler:R,clearHandler:V,emptyImageCss:na.emptyImageInput,previewImageCss:na.previewImageInput})}),/*#__PURE__*/(0,a/* .jsx */.Y)("textarea",(0,i._)((0,r._)({},t),{ref:C,placeholder:(0,c.__)("Write option...","tutor"),value:D.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{var{value:n}=e.target;t.onChange((0,i._)((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:n}))},onKeyDown:e=>(0,x._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&D.answer_title){t.onChange((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((m===null||m===void 0?void 0:m.type)==="save_option"){b===null||b===void 0?void 0:b(null)}q(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:na.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();q(false);t.onChange(M);if(!D.is_saved){if((m===null||m===void 0?void 0:m.type)==="save_option"){b===null||b===void 0?void 0:b(null)}o()}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,x._)(function*(){e.stopPropagation();t.onChange((0,i._)((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));H((0,i._)((0,r._)({},D,e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(D._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((m===null||m===void 0?void 0:m.type)==="save_option"){b===null||b===void 0?void 0:b(null)}q(false)})(),disabled:!D.answer_title&&!D.image_url,children:(0,c.__)("Ok","tutor")})]})]})})})]})]}))};/* export default */const ni=nr;var na={option:e=>{var{isSelected:t,isMultipleChoice:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";align-items:center;[data-check-button]{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";",!n&&(0,d/* .css */.AH)(t5()),"      &:focus-visible{opacity:1;}}&:hover{[data-check-button]{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}",t&&(0,d/* .css */.AH)(t3(),K/* .colorTokens.bg.success */.I6.bg.success,!n&&(0,d/* .css */.AH)(t8(),K/* .colorTokens.bg.success */.I6.bg.success))," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-check-button]{opacity:1;}}")},optionLabel:e=>{var{isSelected:t,isEditing:n,isDragging:r,isOverlay:i}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(t7(),K/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,K/* .colorTokens.text.primary */.I6.text.primary,K/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",n&&(0,d/* .css */.AH)(t9(),K/* .colorTokens.background.white */.I6.background.white,t?K/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:K/* .colorTokens.stroke.brand */.I6.stroke.brand,t?K/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:K/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",r&&(0,d/* .css */.AH)(ne(),K/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",i&&(0,d/* .css */.AH)(nt(),K/* .shadow.drag */.r7.drag)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:e=>{var{isEditing:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:",!t?"1fr auto 1fr":"1fr",";align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}")},optionCounterAndButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["8"] */.YK["8"],";place-self:center start;button{padding:0;min-height:24px;}"),optionActions:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",K/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",K/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.AH)("background-color:",K/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",K/* .spacing["4"] */.YK["4"],";"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",K/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/MultipleChoiceAndOrdering.tsx
function no(){var e=(0,b._)(["\n      padding-left: ",";\n    "]);no=function t(){return e};return e}function ns(){var e=(0,b._)(["\n      margin-left: ",";\n    "]);ns=function t(){return e};return e}var nl=()=>{var[e,t]=(0,u.useState)(null);var n=(0,Y/* .useFormContext */.xW)();var{activeQuestionIndex:d,activeQuestionId:p,validationError:h,setValidationError:g}=eJ();var m=(0,Y/* .useWatch */.FH)({control:n.control,name:"questions.".concat(d,".question_settings.has_multiple_correct_answer"),defaultValue:false});var b=n.watch("questions.".concat(d,".question_type"));var{fields:y,append:w,insert:x,remove:A,update:k,replace:I,move:D}=(0,Y/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(d,".question_answers")});var C=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));var E=(0,Y/* .useWatch */.FH)({control:n.control,name:"questions.".concat(d,".question_answers"),defaultValue:[]});var q=(0,u.useMemo)(()=>{if(!e){return null}return y.find(t=>t.answer_id===e)},[e,y]);var T=e=>{var t=E[e];if(m){k(e,(0,i._)((0,r._)({},t,e1(t._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(t._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:t.is_correct==="1"?"0":"1"}))}else{var n=E.map(e=>(0,i._)((0,r._)({},e,e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));I(n)}if((h===null||h===void 0?void 0:h.type)==="correct_option"){g(null)}};var S=()=>{w({_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:p,belongs_question_type:b,answer_order:y.length,answer_two_gap_match:"",answer_view_format:"text"},{shouldFocus:true,focusName:"questions.".concat(d,".question_answers.").concat(y.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var M=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;x(a,n)};var H=(e,t)=>{A(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nc.optionWrapper({isOrdering:b==="ordering"}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:C,collisionDetection:o/* .closestCenter */.fp,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=y.findIndex(e=>e.answer_id===n.id);var a=y.findIndex(e=>e.answer_id===r.id);D(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:y.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:y,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(ni,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>M(t,e),onRemoveOption:()=>H(t,e),onCheckCorrectAnswer:()=>T(t),index:t,hasMultipleCorrectAnswer:m,questionType:b,questionId:p,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:q,children:t=>{var o=E.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ni,(0,i._)((0,r._)({},e),{onDuplicateOption:B/* .noop */.lQ,onRemoveOption:B/* .noop */.lQ,onCheckCorrectAnswer:B/* .noop */.lQ,index:o,isOverlay:true,hasMultipleCorrectAnswer:m,questionType:b,questionId:p}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:nc.addOptionButtonWrapper({isOrdering:b==="ordering"}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:S,buttonContentCss:nc.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* export default */const nd=nl;var nc={optionWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["12"] */.YK["12"],";",t&&(0,d/* .css */.AH)(no(),K/* .spacing["40"] */.YK["40"]))},addOptionButtonWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("margin-left:",K/* .spacing["48"] */.YK["48"],";",t&&(0,d/* .css */.AH)(ns(),K/* .spacing["8"] */.YK["8"]))},addOptionButton:/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/OpenEndedAndShortAnswer.tsx
var nu=()=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:nv.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(e9/* ["default"] */.A,{icon:"bulb",children:(0,c.__)("No options are necessary for this question type","tutor")})})};/* export default */const np=nu;var nv={optionWrapper:/*#__PURE__*/(0,d/* .css */.AH)("padding-left:",K/* .spacing["40"] */.YK["40"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",K/* .spacing["8"] */.YK["8"],";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormTrueFalse.tsx
function nh(){var e=(0,b._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);nh=function t(){return e};return e}function nf(){var e=(0,b._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);nf=function t(){return e};return e}function ng(){var e=(0,b._)(["\n      background-color: ",";\n    "]);ng=function t(){return e};return e}function n_(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);n_=function t(){return e};return e}var nm=e=>{var{field:t,onCheckCorrectAnswer:n,isOverlay:o=false,questionId:s}=e;var d;var c=(d=t.value)!==null&&d!==void 0?d:{answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:s,belongs_question_type:"true_false"};var{attributes:u,listeners:p,setNodeRef:v,transform:h,transition:f,isDragging:g}=(0,l/* .useSortable */.gl)({id:c.answer_id||0,animateLayoutChanges:tO/* .animateLayoutChanges */.J});var m={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(h),transition:f,opacity:g?.3:undefined};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},u),{css:ny.option({isSelected:!!Number(c.is_correct),isOverlay:o}),tabIndex:-1,ref:v,style:m,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-check-button":true,type:"button",css:L/* .styleUtils.optionCheckButton */.x.optionCheckButton,onClick:n,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:Number(c.is_correct)?"checkFilled":"check",height:32,width:32})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ny.optionLabel({isSelected:!!Number(c.is_correct),isDragging:g,isOverlay:o}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:c.answer_title}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},p),{type:"button",css:L/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:o}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",height:24,width:24})}))]})]}))};/* export default */const nb=nm;var ny={option:e=>{var{isSelected:t,isOverlay:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";height:48px;align-items:center;[data-check-button]{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";opacity:0;fill:none;flex-shrink:0;&:focus-visible{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}&:hover{[data-check-button]{opacity:",n?0:1,";}}",t&&(0,d/* .css */.AH)(nh(),K/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";text-transform:capitalize;[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}&:focus-within{[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(nf(),K/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,K/* .colorTokens.text.primary */.I6.text.primary,K/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",n&&(0,d/* .css */.AH)(ng(),K/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",r&&(0,d/* .css */.AH)(n_(),K/* .shadow.drag */.r7.drag)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")}};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/TrueFalse.tsx
function nw(){var e=(0,b._)(["\n      [data-check-icon] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);nw=function t(){return e};return e}function nx(){var e=(0,b._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);nx=function t(){return e};return e}var nA=()=>{var[e,t]=(0,u.useState)(null);var n=(0,Y/* .useFormContext */.xW)();var{activeQuestionId:d,activeQuestionIndex:c}=eJ();var{fields:p,move:h,replace:f}=(0,Y/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(c,".question_answers")});var g=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));var _=(0,Y/* .useWatch */.FH)({control:n.control,name:"questions.".concat(c,".question_answers"),defaultValue:[]});var m=(0,u.useMemo)(()=>{if(!e){return null}return p.find(t=>t.answer_id===e)},[e,p]);var b=e=>{var t=p[e];var n=_.map(e=>(0,i._)((0,r._)({},e,e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));f(n)};(0,u.useEffect)(()=>{var e=_.filter(e=>{var t=p.findIndex(t=>t.answer_id===e.answer_id);var n=p[t]||{};return e.is_correct!==n.is_correct});if(e.length===0){return}var t=p.findIndex(t=>t.answer_id===e[0].answer_id);var a=[..._];a[t]=Object.assign({},a[t],{is_correct:"1"});for(var[o,s]of a.entries()){if(o!==t){a[o]=(0,i._)((0,r._)({},s,e1(s._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:e1(s._data_status,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:"0"})}}n.setValue("questions.".concat(c,".question_answers"),a);// eslint-disable-next-line react-hooks/exhaustive-deps
},[_]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:nk.optionWrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:g,collisionDetection:o/* .closestCenter */.fp,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=p.findIndex(e=>e.answer_id===n.id);var a=p.findIndex(e=>e.answer_id===r.id);h(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:p.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:p,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(c,".question_answers.").concat(t),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(nb,(0,i._)((0,r._)({},e),{index:t,onCheckCorrectAnswer:()=>b(t),questionId:d}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:m,children:t=>{var o=p.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"questions.".concat(c,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(nb,(0,i._)((0,r._)({},e),{index:o,onCheckCorrectAnswer:B/* .noop */.lQ,isOverlay:true,questionId:d}))},e)}})}),document.body)]})})};/* export default */const nY=nA;var nk={optionWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["12"] */.YK["12"],";"),option:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";",O/* .typography.caption */.I.caption("medium"),";align-items:center;color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",K/* .spacing["10"] */.YK["10"],";height:48px;align-items:center;[data-check-icon]{opacity:0;transition:opacity 0.15s ease-in-out;fill:none;flex-shrink:0;}&:hover{[data-check-icon]{opacity:1;}}",t&&(0,d/* .css */.AH)(nw(),K/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",K/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.AH)(nx(),K/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,K/* .colorTokens.text.primary */.I6.text.primary,K/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70))},optionDragButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton," ",L/* .styleUtils.flexCenter */.x.flexCenter(),"    transform:rotate(90deg);color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:grab;place-self:center center;&:focus,&:active,&:hover{background:none;color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/usePrevious.tsx
var nI=e=>{var t=(0,u.useRef)();(0,u.useEffect)(()=>{t.current=e},[e]);return t.current};// CONCATENATED MODULE: ./assets/react/v3/public/images/quiz-empty-state-2x.webp
const nD=n.p+"js/images/quiz-empty-state-2x-0a35e435.webp";// CONCATENATED MODULE: ./assets/react/v3/public/images/quiz-empty-state.webp
const nC=n.p+"js/images/quiz-empty-state-c7e2a8d9.webp";// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionForm.tsx
var nE=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var nq=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,contentType:o}=eJ();var s=nI(t);var l=(0,Y/* .useFormContext */.xW)();var d=(0,u.useRef)(null);var p=l.watch("questions.".concat(e,".question_type"));var v=l.watch("questions")||[];var h=l.watch("questions.".concat(e,"._data_status"));var f={true_false:/*#__PURE__*/(0,a/* .jsx */.Y)(nY,{},t),multiple_choice:/*#__PURE__*/(0,a/* .jsx */.Y)(nd,{},t),open_ended:/*#__PURE__*/(0,a/* .jsx */.Y)(np,{},t),fill_in_the_blank:/*#__PURE__*/(0,a/* .jsx */.Y)(tM,{},t),short_answer:/*#__PURE__*/(0,a/* .jsx */.Y)(np,{},t),matching:/*#__PURE__*/(0,a/* .jsx */.Y)(t4,{},t),image_answering:/*#__PURE__*/(0,a/* .jsx */.Y)(tj,{},t),ordering:/*#__PURE__*/(0,a/* .jsx */.Y)(nd,{},t)};(0,u.useEffect)(()=>{if(n&&d.current){d.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[n]);if(!t&&!l.formState.isLoading&&v.length===0){return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nS.emptyState,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:nS.emptyStateImage,src:nC,srcSet:"".concat(nC," 1x, ").concat(nD," 2x"),alt:""}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:nS.emptyStateText,children:(0,c.__)("Enter a quiz title to begin. Choose from a variety of question types to keep things interesting!","tutor")})]})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nS.questionForm(t===s),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nS.questionWithIndex,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nS.questionIndex,children:[e+1,"."]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nS.questionTitleAndDesc,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:l.control,rules:{required:(0,c.__)("Question title is required","tutor")},name:"questions.".concat(e,".question_title"),render:t=>{var n;return/*#__PURE__*/(0,a/* .jsx */.Y)(tY,(0,i._)((0,r._)({},t),{placeholder:(0,c.__)("Write your question here..","tutor"),disabled:o==="tutor_h5p_quiz",onChange:()=>{if(e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}},selectOnFocus:((n=v[e])===null||n===void 0?void 0:n._data_status)===e0/* .QuizDataStatus.NEW */.cW.NEW}))}}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:nS.h5pShortCode,children:'[h5p id: "'.concat(l.watch("questions.".concat(e,".question_description")),'"]')})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_description"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(tf,(0,i._)((0,r._)({},t),{placeholder:(0,c.__)("Description (optional)","tutor"),disabled:o==="tutor_h5p_quiz",onChange:()=>{if(e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Quiz.after_question_description",namePrefix:"questions.".concat(e,"."),form:l})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:d,css:nS.alertWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(e9/* ["default"] */.A,{type:"danger",icon:"warning",children:n===null||n===void 0?void 0:n.message})},Math.random())}),f[p],/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:nE&&p!=="h5p",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:nS.questionAnswer,children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".answer_explanation"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(ts,(0,i._)((0,r._)({},t),{label:(0,c.__)("Answer Explanation","tutor"),placeholder:(0,c.__)("Write answer explanation...","tutor"),onChange:()=>{if(e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})})})]},e)};/* export default */const nT=nq;var nS={questionForm:e=>/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";padding-right:",K/* .spacing["48"] */.YK["48"],";gap:",K/* .spacing["16"] */.YK["16"],";animation:",e?undefined:"fadeIn 0.25s ease-in-out",";@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",K/* .spacing["8"] */.YK["8"],";}"),questionWithIndex:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:flex-start;padding-left:",K/* .spacing["40"] */.YK["40"],";gap:",K/* .spacing["4"] */.YK["4"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",K/* .spacing["8"] */.YK["8"],";}"),questionIndex:/*#__PURE__*/(0,d/* .css */.AH)("margin-top:",K/* .spacing["10"] */.YK["10"],";",O/* .typography.heading6 */.I.heading6(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";"),questionTitleAndDesc:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["8"] */.YK["8"],";width:100%;"),h5pShortCode:/*#__PURE__*/(0,d/* .css */.AH)("margin-left:",K/* .spacing["8"] */.YK["8"],";padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["8"] */.YK["8"],";",O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.white */.I6.text.white,";background-color:#2575be;border-radius:",K/* .borderRadius.card */.Vq.card,";width:fit-content;font-family:'Fire Code',monospace;"),questionAnswer:/*#__PURE__*/(0,d/* .css */.AH)("padding-left:",K/* .spacing["40"] */.YK["40"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",K/* .spacing["8"] */.YK["8"],";}"),emptyState:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.flexCenter */.x.flexCenter("column"),";padding-left:",K/* .spacing["40"] */.YK["40"],";padding-right:",K/* .spacing["48"] */.YK["48"],";gap:",K/* .spacing["16"] */.YK["16"],";"),emptyStateImage:/*#__PURE__*/(0,d/* .css */.AH)("width:220px;height:auto;"),emptyStateText:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;max-width:330px;"),alertWrapper:/*#__PURE__*/(0,d/* .css */.AH)("padding-left:",K/* .spacing["40"] */.YK["40"],";animation:shake 0.3s linear;@keyframes shake{0%{transform:translateX(0);}25%{transform:translateX(-5px);}50%{transform:translateX(5px);}75%{transform:translateX(-5px);}100%{transform:translateX(0);}}")};// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/ThreeDots.tsx
var nM=n(34469);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/Question.tsx
function nH(){var e=(0,b._)(["\n      color: ",";\n      background-color: ",";\n      [data-icon-serial] {\n        border-top-right-radius: 3px;\n        border-bottom-right-radius: 3px;\n        border-color: transparent;\n      }\n    "]);nH=function t(){return e};return e}function nz(){var e=(0,b._)(["\n      [data-three-dots] {\n        opacity: 1;\n      }\n    "]);nz=function t(){return e};return e}function nK(){var e=(0,b._)(["\n      box-shadow: ",";\n      background-color: ",";\n      border-radius: ",";\n\n      :hover {\n        background-color: ",";\n      }\n    "]);nK=function t(){return e};return e}var nO={true_false:"quizTrueFalse",multiple_choice:"quizMultiChoice",open_ended:"quizEssay",fill_in_the_blank:"quizFillInTheBlanks",short_answer:"quizShortAnswer",matching:"quizImageMatching",image_answering:"quizImageAnswer",ordering:"quizOrdering",h5p:"quizH5p"};var nF=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var nP=e=>{var{question:t,index:n,onDuplicateQuestion:o,onRemoveQuestion:s,isOverlay:p=false}=e;var{activeQuestionIndex:v,activeQuestionId:h,validationError:f,setActiveQuestionId:g,setValidationError:m,contentType:b}=eJ();var w=(0,Y/* .useFormContext */.xW)();var[x,A]=(0,u.useState)(false);var I=(0,u.useRef)(null);var D=w.getValues("questions.".concat(v));var{attributes:C,listeners:E,setNodeRef:q,transform:T,transition:S,isDragging:M}=(0,l/* .useSortable */.gl)({id:t.question_id,animateLayoutChanges:tO/* .animateLayoutChanges */.J});var H={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(T),transition:S,opacity:M?.3:undefined,background:M?K/* .colorTokens.stroke.hover */.I6.stroke.hover:undefined};(0,u.useEffect)(()=>{if(h===t.question_id){var e;(e=I.current)===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[h,t.question_id]);return/*#__PURE__*/(0,d/* .createElement */.n)("div",(0,i._)((0,r._)({},C),{key:t.question_id,css:nN.questionItem({isActive:String(h)===String(t.question_id),isDragging:p,isThreeDotsOpen:x}),ref:e=>{q(e);// @ts-expect-error
I.current=e},style:H,onClick:()=>{if(h===t.question_id){return}var e=e2(D);if(e!==true){m(e);return}m(null);g(t.question_id)},onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){if(h===t.question_id){return}var n=e2(D);if(n!==true){m(n);return}m(null);g(t.question_id)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nN.iconAndSerial({isDragging:p}),"data-icon-serial":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-serial":true,children:n+1}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({"data-drag-icon":true},E),{type:"button",css:nN.dragButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{"data-drag-icon":true,name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:nO[t.question_type],width:24,height:24,"data-question-icon":true})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:nN.questionTitle({isActive:String(h)===String(t.question_id)}),children:t.question_title}),/*#__PURE__*/(0,a/* .jsxs */.FD)(nM/* ["default"] */.A,{isOpen:x,onClick:e=>{e.stopPropagation();var t=e2(D);A(true);if(t!==true){m(t)}},animationType:W/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>A(false),dotsOrientation:"vertical",maxWidth:nF?"150px":"160px",isInverse:true,size:"small","data-three-dots":true,children:[!f&&b!=="tutor_h5p_quiz"&&/*#__PURE__*/(0,a/* .jsx */.Y)(nM/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nN.duplicate,children:[(0,c.__)("Duplicate","tutor"),!nF&&/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})]}),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"duplicate",width:24,height:24}),disabled:!nF,onClick:e=>{e.stopPropagation();o(t);A(false)}}),/*#__PURE__*/(0,a/* .jsx */.Y)(nM/* ["default"].Option */.A.Option,{isTrash:true,text:(0,c.__)("Delete","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24}),onClick:e=>{e.stopPropagation();s();A(false)}})]})]}))};/* export default */const nW=nP;var nN={questionItem:e=>{var{isActive:t=false,isDragging:n=false,isThreeDotsOpen:r=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["10"] */.YK["10"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["10"] */.YK["10"]," ",K/* .spacing["28"] */.YK["28"],";display:flex;align-items:center;justify-content:space-between;gap:",K/* .spacing["12"] */.YK["12"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";cursor:pointer;transition:border 0.3s ease-in-out,background-color 0.3s ease-in-out;[data-three-dots]{opacity:0;background:transparent;svg{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";}:focus-visible{opacity:1;}}",t&&(0,d/* .css */.AH)(nH(),K/* .colorTokens.text.brand */.I6.text.brand,K/* .colorTokens.background.white */.I6.background.white)," ",r&&(0,d/* .css */.AH)(nz()),":hover{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";[data-serial]{display:none;}[data-drag-icon]{display:block;}[data-icon-serial]{border-top-right-radius:3px;border-bottom-right-radius:3px;border-color:transparent;}[data-three-dots]{opacity:1;}}:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",K/* .borderRadius.card */.Vq.card,";[data-three-dots]{opacity:1;}}",n&&(0,d/* .css */.AH)(nK(),K/* .shadow.drag */.r7.drag,K/* .colorTokens.background.white */.I6.background.white,K/* .borderRadius.card */.Vq.card,K/* .colorTokens.background.white */.I6.background.white)," ",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["8"] */.YK["8"],";[data-three-dots]{opacity:1;}}")},iconAndSerial:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:1fr 1fr;align-items:center;border-radius:3px 0 0 3px;width:64px;padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["4"] */.YK["4"],";flex-shrink:0;column-gap:",K/* .spacing["12"] */.YK["12"],";place-items:center center;[data-drag-icon]{display:none;color:",K/* .colorTokens.icon.hints */.I6.icon.hints,";cursor:",t?"grabbing":"grab",";}[data-question-icon]{flex-shrink:0;}svg{flex-shrink:0;}[data-serial]{width:24px;display:block;",O/* .typography.caption */.I.caption("medium"),"      text-align:center;flex-grow:1;}")},questionTitle:e=>{var{isActive:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(t?"medium":"regular"),";color:",t?K/* .colorTokens.text.brand */.I6.text.brand:K/* .colorTokens.text.subdued */.I6.text.subdued,";flex-grow:1;")},duplicate:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";"),dragButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";&:focus,&:active,&:hover{background:none;}")};// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/Paginator.tsx
var nL=e=>{var{currentPage:t,onPageChange:n,totalItems:r,itemsPerPage:i}=e;var o=Math.max(Math.ceil(r/i),1);var[s,l]=(0,u.useState)("");(0,u.useEffect)(()=>{l(t.toString())},[t]);var d=e=>{if(e<1||e>o){return}n(e)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nR.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nR.pageStatus,children:[(0,c.__)("Page","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"text",css:nR.paginationInput,value:s,onChange:e=>{var{value:t}=e.currentTarget;var r=t.replace(/[^0-9]/g,"");var i=Number(r);if(i>0&&i<=o){l(r);n(i)}else if(!r){l(r)}},autoComplete:"off"})}),(0,c.__)("of","tutor")," ",/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:o})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:nR.pageController,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:nR.paginationButton,onClick:()=>d(t-1),disabled:t===1,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:!el/* .isRTL */.V8?"chevronLeft":"chevronRight",width:32,height:32})}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:nR.paginationButton,onClick:()=>d(t+1),disabled:t===o,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:!el/* .isRTL */.V8?"chevronRight":"chevronLeft",width:32,height:32})})]})]})};/* export default */const nB=nL;var nR={wrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",K/* .spacing["8"] */.YK["8"],";height:36px;"),pageStatus:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),"    color:",K/* .colorTokens.text.title */.I6.text.title,";min-width:100px;"),paginationInput:/*#__PURE__*/(0,d/* .css */.AH)("outline:0;border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";margin:0 ",K/* .spacing["8"] */.YK["8"],";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding:8px 12px;width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",K/* .spacing["0"] */.YK["0"],";}&[type='number']{-moz-appearance:textfield;}"),pageController:/*#__PURE__*/(0,d/* .css */.AH)("gap:",K/* .spacing["8"] */.YK["8"],";display:flex;justify-content:center;align-items:center;height:100%;"),paginationButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";background:",K/* .colorTokens.background.white */.I6.background.white,";color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";height:32px;width:32px;display:grid;place-items:center;transition:background-color 0.2s ease-in-out,color 0.3s ease-in-out;svg{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background:",K/* .colorTokens.background["default"] */.I6.background["default"],";& > svg{color:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}}&:disabled{background:",K/* .colorTokens.background.white */.I6.background.white,";& > svg{color:",K/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/SearchField.tsx
var nU=e=>{var{onFilterItems:t}=e;var n=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{search:""}});var o=(0,N/* .useDebounce */.d)(n.watch("search"));(0,u.useEffect)(()=>{t((0,r._)({},o.length>0&&{search:o}))},[t,o]);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:n.control,name:"search",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{content:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"search",width:24,height:24}),contentCss:nV.contentCss,placeholder:(0,c.__)("Search...","tutor"),showVerticalBar:false}))})};/* export default */const nj=nU;var nV={contentCss:/*#__PURE__*/(0,d/* .css */.AH)("svg{color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/usePaginatedTable.ts
var nQ=function(){var{limit:e=el/* .ITEMS_PER_PAGE */.re}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var[t,n]=(0,u.useState)({page:1,sortProperty:"",sortDirection:undefined,filter:{}});var i=t;var a=e*Math.max(0,i.page-1);var o=(0,u.useCallback)(e=>{n(t=>(0,r._)({},t,e))},[n]);var s=e=>o({page:e});var l=(0,u.useCallback)(e=>o({page:1,filter:e}),[o]);var d=e=>{var t={};if(e!==i.sortProperty){t={sortDirection:"asc",sortProperty:e}}else{t={sortDirection:i.sortDirection==="asc"?"desc":"asc",sortProperty:e}}o(t)};return{pageInfo:i,onPageChange:s,onColumnSort:d,offset:a,itemsPerPage:e,onFilterItems:l}};// CONCATENATED MODULE: ./assets/react/v3/shared/services/content-bank.ts
var nG=e=>{return eH/* .wpAjaxInstance.get */.b.get(ez/* ["default"].GET_CONTENT_BANK_COLLECTIONS */.A.GET_CONTENT_BANK_COLLECTIONS,{params:e}).then(e=>e.data)};var nX=e=>{return(0,eM/* .useQuery */.I)({queryKey:["ContentBankCollections",e],queryFn:()=>nG((0,r._)({},e)),placeholderData:e=>e,enabled:!!e.page&&!!e.per_page})};var nZ=e=>{return useInfiniteQuery({queryKey:["ContentBankCollectionsInfinity",e],queryFn:t=>{var{pageParam:n=1}=t;return nG(_object_spread_props(_object_spread({},e),{page:n}))},getNextPageParam:e=>e.current_page<e.total_page?e.current_page+1:undefined,initialPageParam:1,enabled:e.isEnabled&&!!e.per_page})};var nJ=e=>{return eH/* .wpAjaxInstance.get */.b.get(ez/* ["default"].GET_CONTENT_BANK_CONTENTS */.A.GET_CONTENT_BANK_CONTENTS,{params:e}).then(e=>e.data)};var n$=e=>{return(0,eM/* .useQuery */.I)({queryFn:()=>nJ(e),queryKey:["ContentBankContents",e],placeholderData:e=>e,enabled:!!e.collection_id})};var n0={"cb-lesson":(0,c.__)("Lesson","tutor"),"cb-assignment":(0,c.__)("Assignment","tutor"),"cb-question":(0,c.__)("Question","tutor")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/CollectionListTable.tsx
function n1(){var e=(0,b._)(["\n      padding-bottom: ",";\n    "]);n1=function t(){return e};return e}function n2(){var e=(0,b._)(["\n      tr {\n        &:last-of-type {\n          border-bottom: none;\n        }\n      }\n      td {\n        padding: 0;\n\n        [aria-disabled='true'] {\n          color: ",";\n        }\n\n        &:hover {\n          [data-collection-title] {\n            &:not([aria-disabled='true']) {\n              color: ",";\n            }\n          }\n        }\n      }\n    "]);n2=function t(){return e};return e}function n4(){var e=(0,b._)(["\n      td {\n        padding: ",";\n      }\n    "]);n4=function t(){return e};return e}function n6(){var e=(0,b._)(["\n      background-color: #e8f4fd;\n      color: ",";\n    "]);n6=function t(){return e};return e}function n5(){var e=(0,b._)(["\n      background-color: #e6f8f1;\n      color: ",";\n    "]);n5=function t(){return e};return e}function n8(){var e=(0,b._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);n8=function t(){return e};return e}var n3=e=>{var{type:t}=e;var n,o;var{pageInfo:s,onPageChange:l,itemsPerPage:d,onFilterItems:p}=nQ();var v=(0,Y/* .useFormContext */.xW)();var h=nX((0,i._)((0,r._)({page:s.page,per_page:d},s.filter.search?{search:String(s.filter.search)}:{}),{hide_empty:1,context:t==="question"?"quiz_builder":"topic"}));var f=(0,u.useMemo)(()=>{var e;var t;return(t=(e=h.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[h.data]);var _;var m=(_=(n=h.data)===null||n===void 0?void 0:n.total_record)!==null&&_!==void 0?_:0;var b;var y=Number((b=(o=h.data)===null||o===void 0?void 0:o.total_page)!==null&&b!==void 0?b:0);var w=(0,u.useMemo)(()=>[{Cell:e=>{var n=Number(e.count_stats.lesson)||0;var r=Number(e.count_stats.assignment)||0;var i=Number(e.count_stats.question)||0;var o=t==="lesson_assignment"?n+r:i;return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{css:n9.collectionItemWrapper,onClick:()=>v.setValue("selectedCollection",e),onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();v.setValue("selectedCollection",e)}},"aria-label":/* translators: %s is the collection title */(0,c.sprintf)((0,c.__)("Select collection: %s","tutor"),e.post_title),tabIndex:0,disabled:o===0,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:n9.title,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-collection-title":true,"aria-disabled":o===0,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(o!==null&&o!==void 0?o:0)>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",o,"tutor"),o)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:n9.title,"aria-disabled":o===0,children:(0,c.__)("No Items","tutor")}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:n9.contentsWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:t==="lesson_assignment",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:n>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:n9.contentBadge({type:"cb-lesson"}),children:/* translators: %d is the number of lessons */(0,c.sprintf)((0,c._n)("%d Lesson","%d Lessons",n,"tutor"),n)})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:r>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:n9.contentBadge({type:"cb-assignment"}),children:/* translators: %d is the number of assignments */(0,c.sprintf)((0,c._n)("%d Assignment","%d Assignments",r,"tutor"),r)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:i>0&&t==="question",children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:n9.contentBadge({type:"cb-question"}),children:/* translators: %d is the number of questions */(0,c.sprintf)((0,c._n)("%d Question","%d Questions",i,"tutor"),i)})})]})})]})}}],[v,t]);if(h.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{"aria-label":(0,c.__)("Loading","tutor")})}if(!h.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:n9.errorMessage,role:"alert","aria-live":"assertive",children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:n9.tableActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(nj,{onFilterItems:p})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:n9.tableWrapper({isLoading:h.isFetching||h.isRefetching,hasPagination:y>1,hasData:f.length>0}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(eE,{noHeader:true,columns:w,data:f,itemsPerPage:d,loading:h.isFetching||h.isRefetching,colors:{bodyRowHover:K/* .colorTokens.background.white */.I6.background.white}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:n9.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(nB,{currentPage:s.page,onPageChange:l,totalItems:m,itemsPerPage:d})})})]})};/* export default */const n7=/*#__PURE__*/p().memo(n3);var n9={tableActions:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["20"] */.YK["20"],";"),tableWrapper:e=>{var{isLoading:t=false,hasPagination:n=false,hasData:r=true}=e;return/*#__PURE__*/(0,d/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;border-top:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";",!n&&(0,d/* .css */.AH)(n1(),K/* .spacing["12"] */.YK["12"])," ",!t&&(0,d/* .css */.AH)(n2(),K/* .colorTokens.text.disable */.I6.text.disable,K/* .colorTokens.text.brand */.I6.text.brand)," ",!r&&(0,d/* .css */.AH)(n4(),K/* .spacing["20"] */.YK["20"]))},paginatorWrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:",K/* .spacing["20"] */.YK["20"]," ",K/* .spacing["16"] */.YK["16"],";"),collectionItemWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";min-height:60px;width:100%;height:100%;padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["24"] */.YK["24"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["20"] */.YK["20"],";",L/* .styleUtils.display.flex */.x.display.flex("row"),";justify-content:space-between;align-items:center;gap:",K/* .spacing["16"] */.YK["16"],";&:hover{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";}&:disabled{cursor:not-allowed;pointer-events:none;background-color:",K/* .colorTokens.background.disable */.I6.background.disable,";}"),contentsWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";flex-shrink:0;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.tiny */.I.tiny("medium"),";padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["8"] */.YK["8"],";border-radius:",K/* .borderRadius["4"] */.Vq["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,d/* .css */.AH)(n6(),K/* .colorTokens.icon.brand */.I6.icon.brand)," ",t==="cb-assignment"&&(0,d/* .css */.AH)(n5(),K/* .colorTokens.icon.processing */.I6.icon.processing)," ",t==="cb-question"&&(0,d/* .css */.AH)(n8()))},title:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.primary */.I6.text.primary,";",L/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),";text-wrap:pretty;div:is(:last-of-type):not(:only-of-type){",O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";}"),errorMessage:/*#__PURE__*/(0,d/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/FilterFields.tsx
function re(){var e=(0,b._)(["\n      padding-right: ",";\n    "]);re=function t(){return e};return e}var rt=e=>{var{onFilterChange:t,initialValues:n,type:o}=e;var s=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:n||{contentTypes:[],order:"asc",questionTypes:[]}});var[l,d]=(0,u.useState)(false);var p=(0,u.useRef)(null);var v=s.watch("order")||"asc";var h=s.watch("contentTypes")||[];var g=s.watch("questionTypes")||[];var m=o==="question";var b=[{label:(0,c.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse"},{label:(0,c.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice"},{label:(0,c.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay"},{label:(0,c.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks"},{label:(0,c.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer"},{label:(0,c.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching"},{label:(0,c.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer"},{label:(0,c.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering"}];return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-filter":true,css:rr.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!m&&h.length>0||m&&g.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",buttonCss:rr.clearButton,onClick:()=>{s.reset({contentTypes:[],questionTypes:[],order:"asc"});t(s.getValues())},children:(0,c.__)("Clear All","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:m,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)(f/* ["default"] */.A,{ref:p,variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"mageFilter",height:16,width:16}),buttonCss:rr.filterButton({hasFilters:g.length>0}),onClick:()=>d(e=>!e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,c.__)("Filters","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:m&&g.length>0,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rr.filterCount,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rr.divider}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:g.length})]})})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isIconOnly:true,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:v==="asc"?"sortASC":"sortDESC",width:18,height:18}),onClick:()=>{var e=v==="asc"?"desc":"asc";s.setValue("order",e);t((0,i._)((0,r._)({},s.getValues()),{order:e}))},"aria-label":(0,c.__)("Order by","tutor")})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{isOpen:l,closeOnEscape:true,animationType:W/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>{s.reset();d(false)},triggerRef:p,maxWidth:!m?"200px":"240px",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rr.filterFieldsWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h6",{children:(0,c.__)("Filter by","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rr.filterFields,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:m,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:b,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rr.questionType,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:e.icon,height:24,width:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.label})]}),checked:g.includes(e.value),onChange:t=>{var n=t?[...g,e.value]:g.filter(t=>t!==e.value);s.setValue("questionTypes",n)}})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rr.filterActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"primary",onClick:()=>{t(s.getValues());d(false)},children:(0,c.__)("Apply Filters","tutor")})})]})})]})};/* export default */const rn=rt;var rr={wrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";gap:",K/* .spacing["12"] */.YK["12"],";"),filterButton:e=>{var{hasFilters:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("height:40px;padding-inline:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.background.white */.I6.background.white,";",t&&(0,d/* .css */.AH)(re(),K/* .spacing["6"] */.YK["6"]))},clearButton:/*#__PURE__*/(0,d/* .css */.AH)("flex-shrink:0;"),questionType:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["12"] */.YK["12"],";color:",K/* .colorTokens.text.primary */.I6.text.primary,";"),divider:/*#__PURE__*/(0,d/* .css */.AH)("width:1px;height:24px;background-color:",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),filterCount:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";margin-left:",K/* .spacing["8"] */.YK["8"],";span{height:26px;width:26px;",L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;justify-content:center;border-radius:",K/* .borderRadius["4"] */.Vq["4"],";background-color:",K/* .colorTokens.primary["50"] */.I6.primary["50"],";color:",K/* .colorTokens.text.brand */.I6.text.brand,";}"),filterFieldsWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";h6{padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["6"] */.YK["6"]," ",K/* .spacing["12"] */.YK["12"],";",O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),filterFields:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["6"] */.YK["6"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["6"] */.YK["6"]," ",K/* .spacing["16"] */.YK["16"],";",L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["16"] */.YK["16"],";background-color:",K/* .colorTokens.surface.tutor */.I6.surface.tutor,";border-radius:",K/* .borderRadius["8"] */.Vq["8"],";"),filterActions:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["6"] */.YK["6"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["12"] */.YK["12"],";button{width:100%;}")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/useIntersectionObserver.ts
var ri=function(){var{threshold:e=0,root:t=null,rootMargin:n="0%",freezeOnceVisible:r=false,dependencies:i=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var a=(0,u.useRef)(null);var[o,s]=(0,u.useState)();var l=(o===null||o===void 0?void 0:o.isIntersecting)&&r;var d=e=>{var[t]=e;s(t)};(0,u.useEffect)(()=>{var r=a.current;var i=(0,e0/* .isDefined */.O9)(window.IntersectionObserver);if(!i||l||!r){if(!r){s(undefined)}return}var o={threshold:e,root:t,rootMargin:n};var c=new IntersectionObserver(d,o);c.observe(r);return()=>c.disconnect();// eslint-disable-next-line react-hooks/exhaustive-deps
},[a.current,e,t,n,l,...i]);return{intersectionEntry:o,intersectionElementRef:a}};/* export default */const ra=ri;// CONCATENATED MODULE: ./assets/react/v3/shared/atoms/Select.tsx
function ro(){var e=(0,b._)(["\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      justify-content: space-between;\n\n      > div {\n        flex: 1;\n      }\n    "]);ro=function t(){return e};return e}function rs(){var e=(0,b._)(["\n      flex: 1;\n    "]);rs=function t(){return e};return e}function rl(){var e=(0,b._)(["\n        cursor: pointer;\n      "]);rl=function t(){return e};return e}function rd(){var e=(0,b._)(["\n        height: 32px;\n      "]);rd=function t(){return e};return e}function rc(){var e=(0,b._)(["\n        color: ",";\n\n        &:hover {\n          text-decoration: underline;\n        }\n      "]);rc=function t(){return e};return e}function ru(){var e=(0,b._)(["\n      pointer-events: none;\n\n      > button {\n        color: ",";\n      }\n    "]);ru=function t(){return e};return e}function rp(){var e=(0,b._)(["\n      > button {\n        ",";\n      }\n    "]);rp=function t(){return e};return e}function rv(){var e=(0,b._)(["\n      background-color: ",";\n      position: relative;\n\n      &::before {\n        content: '';\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 3px;\n        height: 100%;\n        background-color: ",";\n        border-radius: 0 "," "," 0;\n      }\n    "]);rv=function t(){return e};return e}function rh(){var e=(0,b._)(["\n      transform: rotate(180deg);\n    "]);rh=function t(){return e};return e}function rf(){var e=(0,b._)(["\n      display: none;\n    "]);rf=function t(){return e};return e}var rg=20;var r_=e=>{var{options:t,onChange:n=B/* .noop */.lQ,clearOption:r=B/* .noop */.lQ,label:i,placeholder:o="",readOnly:s,isSearchable:l=false,isClearable:d=true,isInlineLabel:p=false,isFontWeight:v=false,value:h,caretSize:m=20,infiniteScroll:b=false,wrapperStyle:y,inputCss:w,disabled:x,size:A="regular",optionsStyleVariant:Y="regular"}=e;var k=(0,B/* .nanoid */.Ak)();var[I,D]=(0,u.useState)("");var[E,q]=(0,u.useState)("");var[T,S]=(0,u.useState)(false);var[M,H]=(0,u.useState)([]);var z=(0,u.useRef)(null);var K=(0,N/* .useDebounce */.d)(E);(0,u.useEffect)(()=>{var e;var n;var r=(n=(e=t.find(e=>String(e.value)===String(h===null||h===void 0?void 0:h.value)))===null||e===void 0?void 0:e.label)!==null&&n!==void 0?n:"";D(r)},[t,h]);var O=(0,u.useMemo)(()=>{H([]);if(l){return t.filter(e=>{var{label:t}=e;return t.toLowerCase().startsWith(K.toLowerCase())})}return t},[K,l,t]);var{intersectionEntry:F,intersectionElementRef:P}=ra();var L=O.length>M.length;(0,u.useEffect)(()=>{if(!b){H(O);return}if(!(F===null||F===void 0?void 0:F.isIntersecting)||!L){return}var e=M.length;var t=e+rg;H(n=>[...n,...O.slice(e,t)]);// eslint-disable-next-line react-hooks/exhaustive-deps
},[O,F===null||F===void 0?void 0:F.isIntersecting]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[rb.mainWrapper,y],children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rb.inputLabelWrapper(p),ref:z,children:[!!i&&/*#__PURE__*/(0,a/* .jsx */.Y)("label",{htmlFor:k,css:rb.label(p),children:i}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[rb.inputWrapper,w],children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{id:k,onClick:()=>S(e=>!e),css:rb.input({isSearchable:l,size:A}),autoComplete:"off",readOnly:s||!l,placeholder:o,value:I,onChange:e=>{D(e.target.value);q(e.target.value)},disabled:x,"data-select":true}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:rb.caretButton,onClick:()=>{S(e=>!e)},disabled:x||s||t.length===0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"chevronDown",width:m,height:m,style:rb.toggleIcon({isOpen:T})})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(C/* ["default"] */.A,{triggerRef:z,isOpen:T,closePopover:()=>S(false),animationType:W/* .AnimationType.slideDown */.J6.slideDown,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("ul",{css:rb.options,children:[M.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)("li",{css:rb.optionItem({isSelected:e.value===(h===null||h===void 0?void 0:h.value),optionsStyleVariant:Y,isDisabled:!!e.disabled}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",buttonCss:rb.optionButton({fontWeight:v?e.value:"inherit"}),onClick:()=>{D(e.label);q("");n(e);S(false)},children:e.label})},String(e.value))),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:P,css:rb.spinnerWrapper({isVisible:L}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{})})]}),d&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rb.clearButton({isDisabled:I===""}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",disabled:I==="",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete"}),onClick:()=>{r();D("");q("");S(false)},children:(0,c.__)("Clear","tutor")})})]})]})};/* export default */const rm=r_;var rb={mainWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;"),inputLabelWrapper:e=>/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:flex;flex-direction:column;gap:",K/* .spacing["4"] */.YK["4"],";",e&&(0,d/* .css */.AH)(ro())),label:e=>/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption()," ",e&&(0,d/* .css */.AH)(rs())),inputWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;position:relative;"),input:e=>{var{isSearchable:t,size:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)("&[data-select]{",O/* .typography.body */.I.body(),";width:100%;height:40px;background-color:",K/* .colorTokens.background.white */.I6.background.white,";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";box-shadow:",K/* .shadow.input */.r7.input,";padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"],";color:",K/* .colorTokens.text.primary */.I6.text.primary,";appearance:textfield;transition:all 0.15s ease-in-out;",!t&&(0,d/* .css */.AH)(rl()),":focus{",L/* .styleUtils.inputFocus */.x.inputFocus,";}:disabled{color:",K/* .colorTokens.text.disable */.I6.text.disable,";cursor:not-allowed;}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";}",n==="small"&&(0,d/* .css */.AH)(rd()),"}")},clearButton:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["8"] */.YK["8"],";border-top:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;justify-content:center;min-height:40px;& > button{padding:0;width:100%;font-size:",K/* .fontSize["12"] */.J["12"],";> span{justify-content:center;}",!t&&(0,d/* .css */.AH)(rc(),K/* .colorTokens.text.title */.I6.text.title),"}")},options:/*#__PURE__*/(0,d/* .css */.AH)("list-style-type:none;max-height:500px;padding:",K/* .spacing["4"] */.YK["4"]," 0;margin:0;",L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),optionItem:e=>{var{isSelected:t=false,isDisabled:n=false,optionsStyleVariant:r="regular"}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";min-height:36px;height:100%;width:100%;display:flex;align-items:center;transition:background-color 0.3s ease-in-out;cursor:pointer;",n&&(0,d/* .css */.AH)(ru(),K/* .colorTokens.text.disable */.I6.text.disable),"    &:hover{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";}",r==="small"&&(0,d/* .css */.AH)(rp(),O/* .typography.caption */.I.caption())," ",t&&(0,d/* .css */.AH)(rv(),K/* .colorTokens.background.active */.I6.background.active,K/* .colorTokens.brand.blue */.I6.brand.blue,K/* .borderRadius["6"] */.Vq["6"],K/* .borderRadius["6"] */.Vq["6"]))},optionButton:e=>{var{fontWeight:t="inherit"}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;justify-content:start;padding:",K/* .spacing["6"] */.YK["6"]," ",K/* .spacing["12"] */.YK["12"],";font-weight:",t,";color:",K/* .colorTokens.text.title */.I6.text.title,";:hover{text-decoration:none;}:focus{box-shadow:none;}")},toggleIcon:e=>{var{isOpen:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:transform 0.3s ease-in-out;",t&&(0,d/* .css */.AH)(rh()))},optionsContainer:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;overflow:hidden auto;min-width:16px;min-height:16px;max-width:calc(100% - 32px);max-height:calc(100% - 32px);"),caretButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";position:absolute;top:0;bottom:0;right:",K/* .spacing["8"] */.YK["8"],";margin:auto 0;display:flex;align-items:center;"),spinnerWrapper:e=>{var{isVisible:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:flex;justify-content:center;align-items:center;",!t&&(0,d/* .css */.AH)(rf()))}};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/ContentListTable.tsx
function ry(){var e=(0,b._)(["\n      background-color: #e8f4fd;\n      color: ",";\n    "]);ry=function t(){return e};return e}function rw(){var e=(0,b._)(["\n      background-color: #e6f8f1;\n      color: ",";\n    "]);rw=function t(){return e};return e}function rx(){var e=(0,b._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);rx=function t(){return e};return e}var rA=()=>{var e,t;var{pageInfo:n,onPageChange:o,itemsPerPage:s,onFilterItems:l}=nQ();var d=(0,Y/* .useFormContext */.xW)();var p=d.watch("selectedCollection");var v=d.watch("existingContentIds");var[h,f]=(0,u.useState)("");var[m,b]=(0,u.useState)("asc");var[y,w]=(0,u.useState)("asc");var x;var A=n$((0,i._)((0,r._)({page:String(n.page),collection_id:(x=p===null||p===void 0?void 0:p.ID)!==null&&x!==void 0?x:null,content_types:h?[h]:["lesson","assignment"]},y?{order:y.toUpperCase()}:{},n.filter.search?{search:String(n.filter.search)}:{}),{exclude:v.map(e=>(0,ea/* .getIdWithoutPrefix */.E)("content-",e))}));var k=((e=A.data)===null||e===void 0?void 0:e.total_record)||0;var I=Number(((t=A.data)===null||t===void 0?void 0:t.total_page)||0);var D;var C=(D=p===null||p===void 0?void 0:p.post_title)!==null&&D!==void 0?D:(0,c.__)("All Contents","tutor");var E=d.watch("contents")||[];var q=E.map(e=>String(e.ID));var T=(0,u.useMemo)(()=>{var e;var t;return(t=(e=A.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[A.data]);var S=()=>{d.setValue("selectedCollection",null);o(1);l({search:""})};var M=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=T.filter(e=>!q.includes(String(e.ID)));d.setValue("contents",[...E,...t]);return}var n=E.filter(e=>!T.map(e=>String(e.ID)).includes(String(e.ID)));d.setValue("contents",n)};var H=()=>{return T.length>0&&T.every(e=>q.includes(String(e.ID)))};var z=()=>{b(e=>e==="asc"?"desc":"asc");return T.sort((e,t)=>{return m==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var K=(0,u.useMemo)(()=>{return[{value:"",label:(0,c.__)("All","tutor")},{value:"lesson",label:(0,c.__)("Lessons","tutor")},...(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS)?[{value:"assignment",label:(0,c.__)("Assignments","tutor")}]:[]]},[]);var O=[{Header:k?/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:M,checked:A.isLoading||A.isRefetching?false:H(),label:(0,c.__)("Title","tutor"),labelCss:rk.tableTitle,isIndeterminate:T.length>0&&!H()&&E.length>0,"aria-label":(0,c.__)("Select all contents","tutor")}):(0,c.__)("# Title","tutor"),sortProperty:"title",Cell:e=>{return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.checkboxWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:()=>{var t=d.watch("contents")||[];var n=t.filter(t=>String(t.ID)!==String(e.ID));var r=n.length===t.length;if(r){d.setValue("contents",[...n,e])}else{d.setValue("contents",n)}},checked:A.isLoading||A.isRefetching?false:q.includes(String(e.ID))}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rk.checkboxLabel,children:e.post_title})]})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-type":true,css:rk.tableTitle,children:(0,c.__)("Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rk.type,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:rk.contentBadge({type:e.post_type}),children:n0[e.post_type]})})}}];if(A.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{})}if(!A.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rk.errorMessage,children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.headerWithAction,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:L/* .styleUtils.backButton */.x.backButton,onClick:S,"aria-label":(0,c.__)("Go back to collection list","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.headerTitle,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:[C," "]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:k,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:["(",/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",k,"tutor"),k),")"]})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.tableActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(nj,{onFilterItems:l}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rk.tableFilters,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(rm,{"aria-label":(0,c.__)("Select content type","tutor"),options:K,value:h?K.find(e=>e.value===h)||K[0]:K[0],onChange:e=>{f(e.value)},isClearable:false,wrapperStyle:rk.selectInput}),/*#__PURE__*/(0,a/* .jsx */.Y)(rn,{type:"lesson_assignment",onFilterChange:e=>{w(e.order||"asc")}})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rk.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eE,{headerHeight:48,isBordered:true,isRounded:true,columns:O,data:T,itemsPerPage:s,loading:A.isFetching||A.isRefetching,rowStyle:rk.tableRow,querySortProperties:["title"],querySortDirections:{title:y},onSortClick:e=>{if(e==="title"){var t=z();return t}}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:I>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rk.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(nB,{currentPage:n.page,onPageChange:o,totalItems:k,itemsPerPage:s})})})]})})};/* export default */const rY=rA;var rk={tableActions:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",K/* .spacing["16"] */.YK["16"],";padding:",K/* .spacing["16"] */.YK["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:0 ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding-inline:",K/* .spacing["20"] */.YK["20"],";}[data-type]{text-align:right;}td{padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["20"] */.YK["20"],";}"),tableRow:/*#__PURE__*/(0,d/* .css */.AH)("border-bottom:1px solid ",K/* .colorTokens.border.tertiary */.I6.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:",K/* .spacing["20"] */.YK["20"]," ",K/* .spacing["16"] */.YK["16"],";"),headerWithAction:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";padding:0 ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body("medium"),";span{&:first-of-type{color:",K/* .colorTokens.text.title */.I6.text.title,";}}span:last-of-type:not(:only-of-type){",O/* .typography.tiny */.I.tiny("medium"),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";}"),wrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small("medium"),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";"),checkboxLabel:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption("medium"),";color:",K/* .colorTokens.text.primary */.I6.text.primary,";"),checkboxWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",K/* .spacing["12"] */.YK["12"],";"),type:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";gap:",K/* .spacing["4"] */.YK["4"],";justify-content:end;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.tiny */.I.tiny("medium"),";padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["8"] */.YK["8"],";border-radius:",K/* .borderRadius["4"] */.Vq["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,d/* .css */.AH)(ry(),K/* .colorTokens.icon.brand */.I6.icon.brand)," ",t==="cb-assignment"&&(0,d/* .css */.AH)(rw(),K/* .colorTokens.icon.processing */.I6.icon.processing),"  \n      ",t==="cb-question"&&(0,d/* .css */.AH)(rx()))},errorMessage:/*#__PURE__*/(0,d/* .css */.AH)("height:100px;",L/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:center;"),tableFilters:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";justify-content:end;align-items:center;gap:",K/* .spacing["12"] */.YK["12"],";"),selectInput:/*#__PURE__*/(0,d/* .css */.AH)("max-width:150px;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/QuestionListTable.tsx
var rI=()=>{var e,t;var{pageInfo:n,onPageChange:i,itemsPerPage:o,onFilterItems:s}=nQ();var l=(0,Y/* .useFormContext */.xW)();var d=l.watch("selectedCollection");var[p,v]=(0,u.useState)([]);var[h,f]=(0,u.useState)("asc");var[m,b]=(0,u.useState)("asc");var y;var w=n$((0,r._)({page:String(n.page),collection_id:(y=d===null||d===void 0?void 0:d.ID)!==null&&y!==void 0?y:null,content_types:["question"],context:"quiz_builder"},m?{order:m.toUpperCase()}:{},p.length?{question_types:p}:{},n.filter.search?{search:String(n.filter.search)}:{}));var x=((e=w.data)===null||e===void 0?void 0:e.total_record)||0;var A=Number(((t=w.data)===null||t===void 0?void 0:t.total_page)||0);var k;var I=(k=d===null||d===void 0?void 0:d.post_title)!==null&&k!==void 0?k:(0,c.__)("All Contents","tutor");var D=l.watch("contents")||[];var C=D.map(e=>String(e.ID));var E=(0,u.useMemo)(()=>{var e;var t;return(t=(e=w.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[w.data]);var q=()=>{l.setValue("selectedCollection",null);i(1);s({search:""})};var T=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=E.filter(e=>!C.includes(String(e.ID)));l.setValue("contents",[...D,...t]);return}var n=D.filter(e=>!E.map(e=>String(e.ID)).includes(String(e.ID)));l.setValue("contents",n)};var S=()=>{return E.length>0&&E.every(e=>C.includes(String(e.ID)))};var M=()=>{f(e=>e==="asc"?"desc":"asc");return E.sort((e,t)=>{return h==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var H=[{label:(0,c.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse",isPro:false},{label:(0,c.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice",isPro:false},{label:(0,c.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay",isPro:false},{label:(0,c.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks",isPro:false},{label:(0,c.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer",isPro:true},{label:(0,c.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching",isPro:true},{label:(0,c.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer",isPro:true},{label:(0,c.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering",isPro:true}];var z=[{Header:x?/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:T,checked:w.isLoading||w.isRefetching?false:S(),label:(0,c.__)("Title","tutor"),labelCss:rC.tableTitle,isIndeterminate:E.length>0&&!S()&&D.length>0,"aria-label":(0,c.__)("Select all questions","tutor")}):(0,c.__)("# Title","tutor"),sortProperty:"title",name:"title",Cell:e=>{var t,n;var r=()=>{var t=l.watch("contents")||[];var n=t.filter(t=>String(t.ID)!==String(e.ID));var r=n.length===t.length;if(r){l.setValue("contents",[...n,e])}else{l.setValue("contents",n)}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.checkboxWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(eS/* ["default"] */.A,{onChange:r,checked:w.isLoading||w.isRefetching?false:C.includes(String(e.ID))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.checkboxLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(t=H.find(t=>t.value===e.question_type))===null||t===void 0?void 0:t.icon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:(n=H.find(t=>t.value===e.question_type))===null||n===void 0?void 0:n.icon,height:24,width:24})}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.post_title})]})]})}}];if(w.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{})}if(!w.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rC.errorMessage,children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.headerWithAction,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:L/* .styleUtils.backButton */.x.backButton,onClick:q,"aria-label":(0,c.__)("Go back to collection list","tutor"),tabIndex:0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.headerTitle,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:[I," "]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:x,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:["(",/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",x,"tutor"),x),")"]})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rC.tableActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(nj,{onFilterItems:s}),/*#__PURE__*/(0,a/* .jsx */.Y)(rn,{type:"question",onFilterChange:e=>{b(e.order);v(e.questionTypes||[])}})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rC.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eE,{headerHeight:56,isBordered:true,isRounded:true,columns:z,data:E,itemsPerPage:o,loading:w.isFetching||w.isRefetching,querySortProperties:["title"],querySortDirections:{title:h},onSortClick:e=>{if(e==="title"){var t=M();return t}},rowStyle:rC.tableRow})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:A>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rC.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(nB,{currentPage:n.page,onPageChange:i,totalItems:x,itemsPerPage:o})})})]})})};/* export default */const rD=rI;var rC={tableActions:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",K/* .spacing["16"] */.YK["16"],";padding:",K/* .spacing["16"] */.YK["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:0 ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";}[data-type]{text-align:right;}"),tableRow:/*#__PURE__*/(0,d/* .css */.AH)("border-bottom:1px solid ",K/* .colorTokens.border.tertiary */.I6.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,d/* .css */.AH)("margin:",K/* .spacing["20"] */.YK["20"]," ",K/* .spacing["16"] */.YK["16"],";"),headerWithAction:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";padding:0 ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body("medium"),";span{&:first-of-type{color:",K/* .colorTokens.text.title */.I6.text.title,";}}span:last-of-type:not(:only-of-type){",O/* .typography.tiny */.I.tiny("medium"),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";}"),wrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small("regular"),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";"),checkboxLabel:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["12"] */.YK["12"],";",O/* .typography.caption */.I.caption("medium"),";color:",K/* .colorTokens.text.primary */.I6.text.primary,";svg{flex-shrink:0;}span{width:100%;",L/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}"),checkboxWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["12"] */.YK["12"],";"),type:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;gap:",K/* .spacing["4"] */.YK["4"],";justify-content:end;"),errorMessage:/*#__PURE__*/(0,d/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/index.tsx
var rE=(0,ea/* .getCourseId */.p)();var rq=e=>{var{closeModal:t,actions:n,onAddContent:o,type:s,topicId:l,contents:d,nextContentOrder:u}=e;var p;var v=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{selectedCollection:null,contents:[],existingContentIds:(p=d===null||d===void 0?void 0:d.map(e=>e.ID))!==null&&p!==void 0?p:[]}});var h=(0,ei/* .useAddContentBankContentToCourseMutation */.SS)();var g=e=>(0,x._)(function*(){o===null||o===void 0?void 0:o(e.contents);if(s==="lesson_assignment"){var n=yield h.mutateAsync({course_id:rE,topic_id:l||"",content_ids:e.contents.map(e=>e.ID),next_content_order:u||0});if(n.status_code===200){t({action:"CONFIRM"});return}}t({action:"CONFIRM"})})();var m=v.watch("selectedCollection");return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .FormProvider */.Op,(0,i._)((0,r._)({},v),{children:/*#__PURE__*/(0,a/* .jsxs */.FD)(eT/* ["default"] */.A,{onClose:()=>t({action:"CLOSE"}),title:(0,c.__)("Content Bank","tutor"),entireHeader:m&&/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:" "}),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentBank",height:24,width:24}),actions:n,maxWidth:720,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!m,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:s==="lesson_assignment",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(rD,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(rY,{})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(n7,{type:s})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:v.watch("selectedCollection"),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rS.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>t({action:"CLOSE"}),children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"primary",onClick:v.handleSubmit(g),disabled:v.watch("contents").length===0,loading:s==="lesson_assignment"&&h.isPending,"data-cy":"add-content-button",children:(0,c.__)("Add","tutor")})]})})]})}))};/* export default */const rT=rq;var rS={footer:/*#__PURE__*/(0,d/* .css */.AH)("box-shadow:0px 1px 0px 0px #e4e5e7 inset;height:56px;display:flex;align-items:center;justify-content:end;gap:",K/* .spacing["16"] */.YK["16"],";padding-inline:",K/* .spacing["16"] */.YK["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/usePortalPopover.tsx
var rM=n(94654);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionList.tsx
var rH=[{label:(0,c.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse",isPro:false},{label:(0,c.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice",isPro:false},{label:(0,c.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay",isPro:false},{label:(0,c.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks",isPro:false},{label:(0,c.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer",isPro:true},{label:(0,c.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching",isPro:true},{label:(0,c.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer",isPro:true},{label:(0,c.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering",isPro:true}];var rz=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var rK=e=>{var{isEditing:t}=e;var[n,d]=(0,u.useState)(null);var[p,h]=(0,u.useState)(false);var g=(0,u.useRef)(null);var m=(0,u.useRef)(null);var b=(0,Y/* .useFormContext */.xW)();var{contentType:y,activeQuestionIndex:w,validationError:x,setActiveQuestionId:A,setValidationError:I}=eJ();var{remove:D,append:E,insert:q,move:T,fields:S}=(0,Y/* .useFieldArray */.jz)({control:b.control,name:"questions"});var{showModal:M}=(0,em/* .useModal */.h)();var H=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));var z=(0,u.useMemo)(()=>{if(!n){return null}return S.find(e=>e.question_id===n)},[n,S]);var K=b.watch("questions")||[];var O=b.getValues("questions.".concat(w));var N=(e,t)=>{var n=e2(O);if(n!==true){I(n);h(false);return}var r=(0,B/* .nanoid */.Ak)();E({_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,question_id:r,/* translators: %d is the question number */question_title:e==="h5p"?t===null||t===void 0?void 0:t.title:(0,c.sprintf)((0,c.__)("Question %d","tutor"),S.length+1),question_description:e==="h5p"?t===null||t===void 0?void 0:t.id:"",question_type:e,question_answers:e==="true_false"?[{answer_id:(0,B/* .nanoid */.Ak)(),_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_title:(0,c.__)("True","tutor"),is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:r,belongs_question_type:"true_false"},{answer_id:(0,B/* .nanoid */.Ak)(),is_saved:true,_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,answer_title:(0,c.__)("False","tutor"),is_correct:"0",answer_order:2,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:r,belongs_question_type:"true_false"}]:e==="fill_in_the_blank"?[{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,B/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:r,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"",answer_order:0,is_correct:"0"}]:[],answer_explanation:"",question_mark:1,question_order:S.length+1,question_settings:{answer_required:false,question_mark:y==="tutor_h5p_quiz"?0:1,question_type:e,randomize_question:false,show_question_mark:false}});I(null);A(r);h(false)};var L=e=>{var t=e2(O);if(t!==true){I(t);h(false);return}var n=e.map(e=>{// Converts a ContentBankContent question to the QuizQuestion format expected by the quiz builder.
var t=e4(e.question);return(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,is_cb_question:true,// this is to ensure unique question_id for each question
question_id:"".concat(t.question_id,"-").concat((0,B/* .nanoid */.Ak)()),question_answers:t.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW}))})});E(n)};var R=e=>{for(var t of e){N("h5p",t)}};var U=(e,t)=>{var n=b.watch("questions.".concat(t));if(!n||x){return}var a=(0,i._)((0,r._)({},e),{question_id:(0,B/* .nanoid */.Ak)(),_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW,question_title:"".concat(n.question_title," (copy)"),question_answers:n.question_answers.map(e=>(0,i._)((0,r._)({},e),{answer_id:(0,B/* .nanoid */.Ak)(),_data_status:e0/* .QuizDataStatus.NEW */.cW.NEW}))});var o=t+1;q(o,a)};var j=(e,t)=>{D(e);if(w===e){A("");I(null)}if(t._data_status!==e0/* .QuizDataStatus.NEW */.cW.NEW){b.setValue("deleted_question_ids",[...b.getValues("deleted_question_ids"),t.question_id])}};var V=e=>{var{active:t,over:n}=e;if(!n||t.id===n.id){return}var r=S.findIndex(e=>e.question_id===t.id);var i=S.findIndex(e=>e.question_id===n.id);T(r,i)};(0,u.useEffect)(()=>{if(g.current){g.current.style.maxHeight="".concat(window.innerHeight-g.current.getBoundingClientRect().top,"px")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[g.current,t]);if(!b.getValues("quiz_title")){return null}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rF.questionsLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,c.__)("Questions","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"add-question",ref:m,type:"button",onClick:()=>{if(y==="tutor_h5p_quiz"){M({component:eN,props:{title:(0,c.__)("Select H5P Content","tutor"),onAddContent:e=>{R(e)},contentType:"tutor_h5p_quiz",addedContentIds:K.map(e=>e.question_description)}})}else{h(true)}},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plusSquareBrand",width:32,height:32})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:g,css:rF.questionList,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:K.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rF.emptyQuestionText,children:(0,c.__)("No questions added yet.","tutor")}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:H,collisionDetection:o/* .closestCenter */.fp,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{d(e.active.id)},onDragEnd:e=>V(e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:K.map(e=>(0,i._)((0,r._)({},e),{id:e.question_id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:K,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(nW,{question:e,index:t,onDuplicateQuestion:e=>{U(e,t)},onRemoveQuestion:()=>j(t,e)},e.question_id)})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:z,children:e=>{var t=S.findIndex(t=>t.question_id===e.question_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(nW,{question:e,index:t,onDuplicateQuestion:B/* .noop */.lQ,onRemoveQuestion:B/* .noop */.lQ,isOverlay:true},e.question_id)}})}),document.body)]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{gap:4,maxWidth:"240px",placement:el/* .CURRENT_VIEWPORT.isAboveTablet */.vN.isAboveTablet?rM/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?rM/* .POPOVER_PLACEMENTS.LEFT */.zA.LEFT:rM/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,triggerRef:m,isOpen:p,closePopover:()=>h(false),animationType:W/* .AnimationType.slideUp */.J6.slideUp,arrow:true,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rF.questionOptionsWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:rF.questionTypeOptionsTitle,children:(0,c.__)("Select Question Type","tutor")}),rH.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:e.isPro&&!rz,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:rF.questionTypeOption,onClick:()=>{N(e.value)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.label})]},e.value),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:rF.questionTypeOption,disabled:true,onClick:B/* .noop */.lQ,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.label}),/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})]})]},e.value)},e.value)),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!rz,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_BANK */.oW.CONTENT_BANK),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rF.addFormContentBankButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:()=>{M({component:rT,props:{title:(0,c.__)("Content Bank","tutor"),type:"question",onAddContent:e=>{L(e)}}});h(false)},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentBank",width:24,height:24}),"data-cy":"add-from-content-bank",children:(0,c.__)("Add from Content Bank","tutor")})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rF.addFormContentBankButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{disabled:true,variant:"secondary",size:"small",onClick:B/* .noop */.lQ,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentBank",width:24,height:24}),children:(0,c.__)("Add from Content Bank","tutor")})})})})]})})]})]})};/* export default */const rO=rK;var rF={questionsLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;gap:",K/* .spacing["4"] */.YK["4"],";align-items:center;justify-content:space-between;border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["28"] */.YK["28"],";",O/* .typography.caption */.I.caption("medium"),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";button{",L/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",K/* .borderRadius["6"] */.Vq["6"],";&:focus,&:active,&:hover{background:none;}svg{color:",K/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";width:100%;height:100%;}:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";}}",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding:",K/* .spacing["16"] */.YK["16"],";}"),questionList:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";scrollbar-gutter:auto;padding:",K/* .spacing["8"] */.YK["8"]," 0 ",K/* .spacing["8"] */.YK["8"]," 0;"),questionTypeOptionsTitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption("medium"),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["20"] */.YK["20"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),addFormContentBankButton:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"],";border-top:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";button{width:100%;}"),questionOptionsWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;padding-block:",K/* .spacing["6"] */.YK["6"],";"),questionTypeOption:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";color:",K/* .colorTokens.text.title */.I6.text.title,";width:100%;padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["20"] */.YK["20"],";transition:background-color 0.3s ease-in-out;display:flex;align-items:center;gap:",K/* .spacing["10"] */.YK["10"],";border:2px solid transparent;div{",L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";}&:focus,&:active,&:hover{background:none;color:",K/* .colorTokens.text.title */.I6.text.title,";}:disabled{cursor:not-allowed;color:",K/* .colorTokens.text.primary */.I6.text.primary,";[data-question-icon]{filter:grayscale(100%);}}:hover:enabled{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";color:",K/* .colorTokens.text.title */.I6.text.title,";}:focus:enabled,:active:enabled{border-color:",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),emptyQuestionText:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.small */.I.small(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["8"] */.YK["8"]," ",K/* .spacing["28"] */.YK["28"],";")};// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/Card.tsx
function rP(){var e=(0,b._)(["\n      box-shadow: none;\n      border: 1px solid ",";\n    "]);rP=function t(){return e};return e}function rW(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);rW=function t(){return e};return e}function rN(){var e=(0,b._)(["\n      padding: "," "," "," ",";\n    "]);rN=function t(){return e};return e}function rL(){var e=(0,b._)(["\n      transform: rotate(180deg);\n    "]);rL=function t(){return e};return e}var rB=e=>{var{children:t,hasBorder:n=false,title:i,subtitle:o,actionTray:s,collapsed:l=false,noSeparator:d=false,hideArrow:c=false,isAlternative:p=false,collapsedAnimationDependencies:v}=e;var h;var[f,g]=(0,u.useState)(l);var m=(0,u.useRef)(null);var[b,y]=(0,w/* .useSpring */.zh)({height:!f?(h=m.current)===null||h===void 0?void 0:h.scrollHeight:0,opacity:!f?1:0,overflow:"hidden",config:{duration:300,easing:e=>e*(2-e)}},[f,...v||[]]);(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(m.current)){y.start({height:!f?m.current.scrollHeight:0,opacity:!f?1:0})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[f,...v||[]]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rU.wrapper(n),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:rU.headerWrapper(f||d,p),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rU.headerAndAction,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rU.header,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{css:rU.title,children:i}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:rU.subtitle,children:o})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rU.actions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:s,children:s}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!c,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:rU.collapseButton({isCollapsed:f}),onClick:()=>g(!f),children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"chevronDown",width:24,height:24,style:rU.arrowUpDown})})})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(w/* .animated.div */.CS.div,{style:(0,r._)({},b),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:m,css:rU.cardBody,children:t})})]})};/* export default */const rR=rB;var rU={wrapper:e=>/*#__PURE__*/(0,d/* .css */.AH)("width:100%;border-radius:",K/* .borderRadius.card */.Vq.card,";background-color:",K/* .colorTokens.background.white */.I6.background.white,";box-shadow:",K/* .shadow.card */.r7.card,";",e&&(0,d/* .css */.AH)(rP(),K/* .colorTokens.stroke.divider */.I6.stroke.divider)),headerWrapper:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["8"] */.YK["8"],";display:flex;flex-direction:column;justify-content:center;gap:",K/* .spacing["4"] */.YK["4"],";",!e&&(0,d/* .css */.AH)(rW(),K/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",t&&(0,d/* .css */.AH)(rN(),K/* .spacing["12"] */.YK["12"],K/* .spacing["16"] */.YK["16"],K/* .spacing["12"] */.YK["12"],K/* .spacing["24"] */.YK["24"])),headerAndAction:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:space-between;align-items:center;"),header:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;padding:",K/* .spacing["4"] */.YK["4"]," ",K/* .spacing["16"] */.YK["16"],";"),subtitle:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";"),title:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body("medium"),";color:",K/* .colorTokens.text.primary */.I6.text.primary,";display:flex;align-items:center;"),collapseButton:e=>{var{isCollapsed:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";display:flex;align-items:center;transition:transform 0.3s ease-in-out;",t&&(0,d/* .css */.AH)(rL()),"    &:focus,&:active,&:hover{background:none;color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";}")},arrowUpDown:/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;justify-content:center;align-items:center;"),cardBody:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["24"] */.YK["24"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["24"] */.YK["24"],";"),actions:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuizSettings.tsx
var rj=(0,ea/* .getCourseId */.p)();var rV=e=>{var{contentDripType:t}=e;var{quizId:n,contentType:o}=eJ();var s=(0,Y/* .useFormContext */.xW)();var l=s.watch("quiz_option.feedback_mode");var d=(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&t==="unlock_sequentially"&&l==="retry";var u=s.watch("quiz_option.content_drip_settings.prerequisites");var p=(0,A/* .useQueryClient */.jE)();var v=p.getQueryData(["Topic",rj]);var h=Object.keys(s.formState.errors).length;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.settings,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(rR,{title:(0,c.__)("Basic Settings","tutor"),collapsedAnimationDependencies:[l,u===null||u===void 0?void 0:u.length,h],children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.formWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.timeWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.time_limit.time_value",control:s.control,rules:(0,ec/* .requiredRule */.WN)(),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Time Limit","tutor"),helpText:(0,c.__)("Set a time limit for this quiz. A value of “0” indicates no time limit","tutor"),selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.time_limit.time_type",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(H/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:" "}),options:[{label:(0,c.__)("Seconds","tutor"),value:"seconds"},{label:(0,c.__)("Minutes","tutor"),value:"minutes"},{label:(0,c.__)("Hours","tutor"),value:"hours"},{label:(0,c.__)("Days","tutor"),value:"days"},{label:(0,c.__)("Weeks","tutor"),value:"weeks"}]}))})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.hide_quiz_time_display",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Hide Quiz Time","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.feedback_mode",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(H/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Feedback Mode","tutor"),leftIcon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"eye",width:32,height:32}),options:[{label:(0,c.__)("Default","tutor"),value:"default",description:(0,c.__)("Answers are shown after finishing the quiz.","tutor")},{label:(0,c.__)("Reveal Mode","tutor"),value:"reveal",description:(0,c.__)("Show answer after attempting the question.","tutor")},{label:(0,c.__)("Retry","tutor"),value:"retry",description:(0,c.__)("Allows students to retake the quiz after their first attempt.","tutor")}]}))})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:l==="retry",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.attempts_allowed",control:s.control,rules:(0,i._)((0,r._)({},(0,ec/* .requiredRule */.WN)()),{validate:e=>{if(e>=0&&e<=20){return true}return(0,c.__)("Allowed attempts must be between 0 and 20","tutor")}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Attempts Allowed","tutor"),helpText:(0,c.__)('Define how many times a student can retake this quiz. Setting it to "0" allows unlimited attempts',"tutor"),selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:d&&o!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.pass_is_required",control:s.control,rules:(0,ec/* .requiredRule */.WN)(),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Passing is Required","tutor"),helpText:(0,c.__)("By enabling this option, the student must have to pass it to access the next quiz","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.passing_grade",control:s.control,rules:(0,ec/* .requiredRule */.WN)(),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Passing Grade","tutor"),helpText:(0,c.__)("Set the minimum score percentage required to pass this quiz","tutor"),content:"%",contentPosition:"right",contentCss:L/* .styleUtils.inputCurrencyStyle */.x.inputCurrencyStyle}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.max_questions_for_answer",rules:(0,ec/* .requiredRule */.WN)(),control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Max Question Allowed to Answer","tutor"),helpText:(0,c.__)("Set the number of quiz questions randomly from your question pool. If the set number exceeds available questions, all questions will be included","tutor"),selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&o!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t==="specific_days",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.content_drip_settings.after_xdays_of_enroll",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Available after days","tutor")]}),helpText:(0,c.__)("This quiz will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t==="unlock_by_date",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.content_drip_settings.unlock_date",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(q/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Unlock Date","tutor")]}),placeholder:(0,c.__)("Select Unlock Date","tutor"),helpText:(0,c.__)("This quiz will be available from the given date. Leave empty to make it available immediately.","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t==="after_finishing_prerequisites",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.content_drip_settings.prerequisites",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(J,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:v.reduce((e,t)=>{e.push((0,i._)((0,r._)({},t),{contents:t.contents.filter(e=>String(e.ID)!==String(n))}));return e},[])||[],isSearchable:true,helpText:(0,c.__)("Select items that should be complete before this item","tutor")}))})})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(rR,{title:(0,c.__)("Advanced Settings","tutor"),collapsedAnimationDependencies:[h],children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.formWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.quiz_auto_start",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Quiz Auto Start","tutor"),helpText:(0,c.__)("When enabled, the quiz begins immediately as soon as the page loads","tutor")}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:rG.questionLayoutAndOrder,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.question_layout_view",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(H/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Question Layout","tutor"),placeholder:(0,c.__)("Select an option","tutor"),options:[{label:(0,c.__)("Single question","tutor"),value:"single_question"},{label:(0,c.__)("Question pagination","tutor"),value:"question_pagination"},{label:(0,c.__)("Question below each other","tutor"),value:"question_below_each_other"}]}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.questions_order",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(H/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Question Order","tutor"),placeholder:(0,c.__)("Select an option","tutor"),options:[{label:(0,c.__)("Random","tutor"),value:"rand"},{label:(0,c.__)("Sorting","tutor"),value:"sorting"},{label:(0,c.__)("Ascending","tutor"),value:"asc"},{label:(0,c.__)("Descending","tutor"),value:"desc"}]}))})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:o!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.hide_question_number_overview",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eo/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,c.__)("Hide Question Number","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.short_answer_characters_limit",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Set Character Limit for Short Answers","tutor"),selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{name:"quiz_option.open_ended_answer_characters_limit",control:s.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Set Character Limit for Open-Ended/Essay Answers","tutor"),selectOnFocus:true}))})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(en/* ["default"] */.A,{section:"Curriculum.Quiz.bottom_of_settings",form:s})]})};/* export default */const rQ=rV;var rG={settings:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["24"] */.YK["24"],";"),formWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",K/* .spacing["20"] */.YK["20"],";"),timeWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    align-items:flex-start;gap:",K/* .spacing["8"] */.YK["8"],";"),questionLayoutAndOrder:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),"    gap:",K/* .spacing["20"] */.YK["20"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{flex-direction:column;}"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",K/* .spacing["4"] */.YK["4"],";color:",K/* .colorTokens.icon.success */.I6.icon.success,";}")};// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useMutation.js
var rX=n(94747);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/services/quiz.ts
var rZ=(e,t)=>{var n,i,a,o,s,l,d,c,u,p,v;return(0,r._)({ID:e.ID,_data_status:e0/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE,quiz_title:(n=e.post_title)!==null&&n!==void 0?n:"",quiz_description:(i=e.post_content)!==null&&i!==void 0?i:"",quiz_option:{time_limit:{time_value:(a=e.quiz_option.time_limit.time_value)!==null&&a!==void 0?a:0,time_type:(o=e.quiz_option.time_limit.time_type)!==null&&o!==void 0?o:"minutes"},hide_quiz_time_display:e.quiz_option.hide_quiz_time_display==="1",feedback_mode:(s=e.quiz_option.feedback_mode)!==null&&s!==void 0?s:"retry",attempts_allowed:(l=e.quiz_option.attempts_allowed)!==null&&l!==void 0?l:10,pass_is_required:e.quiz_option.pass_is_required==="1",passing_grade:(d=e.quiz_option.passing_grade)!==null&&d!==void 0?d:80,max_questions_for_answer:(c=e.quiz_option.max_questions_for_answer)!==null&&c!==void 0?c:10,quiz_auto_start:e.quiz_option.quiz_auto_start==="1",question_layout_view:e.quiz_option.question_layout_view||"single_question",questions_order:(u=e.quiz_option.questions_order)!==null&&u!==void 0?u:"rand",hide_question_number_overview:e.quiz_option.hide_question_number_overview==="1",short_answer_characters_limit:(p=e.quiz_option.short_answer_characters_limit)!==null&&p!==void 0?p:200,open_ended_answer_characters_limit:(v=e.quiz_option.open_ended_answer_characters_limit)!==null&&v!==void 0?v:500,content_drip_settings:e.quiz_option.content_drip_settings||{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:(e.questions||[]).map(e=>e4(e)),deleted_question_ids:[],deleted_answer_ids:[]},Object.fromEntries(t.map(t=>[t,e[t]])))};var rJ=(e,t,n,a,o,s)=>{var l,d;return(0,r._)({course_id:a,topic_id:t,payload:{ID:e.ID,_data_status:e._data_status,post_title:e.quiz_title,post_content:e.quiz_description,quiz_option:(0,r._)({attempts_allowed:e.quiz_option.attempts_allowed,feedback_mode:e.quiz_option.feedback_mode,hide_question_number_overview:e.quiz_option.hide_question_number_overview?"1":"0",hide_quiz_time_display:e.quiz_option.hide_quiz_time_display?"1":"0",max_questions_for_answer:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION)&&e.questions.every(e=>e.question_type==="h5p")?e.questions.length:e.quiz_option.max_questions_for_answer,open_ended_answer_characters_limit:e.quiz_option.open_ended_answer_characters_limit,pass_is_required:e.quiz_option.pass_is_required?"1":"0",passing_grade:e.quiz_option.passing_grade,question_layout_view:e.quiz_option.question_layout_view,questions_order:e.quiz_option.questions_order,quiz_auto_start:e.quiz_option.quiz_auto_start?"1":"0",short_answer_characters_limit:e.quiz_option.short_answer_characters_limit,time_limit:{time_type:e.quiz_option.time_limit.time_type,time_value:e.quiz_option.time_limit.time_value}},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="unlock_sequentially"&&e.quiz_option.feedback_mode==="retry"&&{pass_is_required:e.quiz_option.pass_is_required?"1":"0"},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&{content_drip_settings:(0,r._)({},n==="unlock_by_date"&&{unlock_date:e.quiz_option.content_drip_settings.unlock_date},n==="specific_days"&&{after_xdays_of_enroll:e.quiz_option.content_drip_settings.after_xdays_of_enroll},n==="after_finishing_prerequisites"&&{prerequisites:((l=e.quiz_option.content_drip_settings.prerequisites)===null||l===void 0?void 0:l.length)?e.quiz_option.content_drip_settings.prerequisites:""})},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION)&&e.questions.every(e=>e.question_type==="h5p")&&{quiz_type:"tutor_h5p_quiz"}),questions:e.questions.map(e=>{return(0,r._)((0,i._)((0,r._)((0,i._)((0,r._)({_data_status:e._data_status,question_id:(()=>{if(e.is_cb_question){return String(e.question_id).split("-")[0]}return e.question_id})()},e.is_cb_question&&{is_cb_question:e.is_cb_question}),{question_title:e.question_title,question_description:e.question_description,question_mark:e.question_settings.question_mark}),!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url&&{answer_explanation:e.answer_explanation}),{question_type:e.question_type,question_order:e.question_order,question_settings:(0,r._)({answer_required:e.question_settings.answer_required?"1":"0",question_mark:e.question_settings.question_mark,question_type:e.question_type,randomize_question:e.question_settings.randomize_question?"1":"0",show_question_mark:e.question_settings.show_question_mark?"1":"0"},e.question_type==="multiple_choice"&&{has_multiple_correct_answer:e.question_settings.has_multiple_correct_answer?"1":"0"},e.question_type==="matching"&&{is_image_matching:e.question_settings.is_image_matching?"1":"0"}),question_answers:e.question_answers.map(t=>({_data_status:t._data_status,answer_id:t.answer_id,belongs_question_id:e.question_id,belongs_question_type:e.question_type,answer_title:t.answer_title,is_correct:t.is_correct,image_id:e.question_type==="matching"&&!e.question_settings.is_image_matching?"":t.image_id,image_url:e.question_type==="matching"&&!e.question_settings.is_image_matching?"":t.image_url,answer_two_gap_match:t.answer_two_gap_match,answer_view_format:t.answer_view_format,answer_order:t.answer_order}))}),Object.fromEntries(o.map(t=>[t,e[t]])))})},deleted_question_ids:e.deleted_question_ids,deleted_answer_ids:e.deleted_answer_ids},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.quiz_option.content_drip_settings.unlock_date},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.quiz_option.content_drip_settings.after_xdays_of_enroll},(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((d=e.quiz_option.content_drip_settings.prerequisites)===null||d===void 0?void 0:d.length)?e.quiz_option.content_drip_settings.prerequisites:""},Object.fromEntries(s.map(t=>[t,e[t]])))};var r$=e=>{return{question_id:e.question_id,question_title:e.question_title,question_description:e.question_description,question_type:e.question_type,question_mark:e.question_mark,answer_explanation:e.answer_explanation,"question_settings[question_type]":e.question_type,"question_settings[answer_required]":e.question_settings.answer_required?1:0,"question_settings[question_mark]":e.question_mark}};var r0=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].QUIZ_IMPORT_DATA */.A.QUIZ_IMPORT_DATA,e)};var r1=()=>{var e=(0,A/* .useQueryClient */.jE)();var{showToast:t}=(0,eQ/* .useToast */.d)();return(0,rX/* .useMutation */.n)({mutationFn:r0,onSuccess:n=>{if(n.success){e.invalidateQueries({queryKey:["Topic"]});t({message:(0,c.__)("Quiz imported successfully","tutor"),type:"success"})}else{t({message:n.data.message,type:"danger"})}},onError:e=>{t({message:(0,B/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};var r2=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].QUIZ_EXPORT_DATA */.A.QUIZ_EXPORT_DATA,{quiz_id:e})};var r4=()=>{var{showToast:e}=(0,eQ/* .useToast */.d)();return(0,rX/* .useMutation */.n)({mutationFn:r2,onSuccess:t=>{if(!t.success){e({message:(0,c.__)("Something went wrong.","tutor"),type:"danger"});return}var n="";for(var r of t.data.output_quiz_data){var i=r.join(",");n+="".concat(i,"\r\n")}var a=new Blob([n],{type:"text/csv"});var o=window.webkitURL.createObjectURL(a);var s=document.createElement("a");s.setAttribute("href",o);s.setAttribute("download","tutor-quiz-".concat(t.data.title,".csv"));document.body.appendChild(s);s.click()},onError:t=>{e({message:(0,B/* .convertToErrorMessage */.EL)(t),type:"danger"})}})};var r6=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].SAVE_QUIZ */.A.SAVE_QUIZ,e)};var r5=()=>{var e=(0,A/* .useQueryClient */.jE)();var{showToast:t}=(0,eQ/* .useToast */.d)();return(0,rX/* .useMutation */.n)({mutationFn:r6,onSuccess:n=>{if(n.data){e.setQueryData(["Quiz",n.data.ID],n.data);e.invalidateQueries({queryKey:["Topic"]});t({message:(0,c.__)(n.message,"tutor"),type:"success"})}},onError:e=>{t({message:(0,B/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};var r8=e=>{return eH/* .wpAjaxInstance.get */.b.get(ez/* ["default"].GET_QUIZ_DETAILS */.A.GET_QUIZ_DETAILS,{params:{quiz_id:e}})};var r3=e=>{return(0,eM/* .useQuery */.I)({queryKey:["Quiz",e],queryFn:()=>r8(e).then(e=>e.data),enabled:!!e})};var r7=e=>{return wpAjaxInstance.post(endpoints.GET_H5P_QUIZ_CONTENT_BY_ID,{content_id:e}).then(e=>e.data)};var r9=(e,t)=>{return useQuery({queryKey:["H5PQuizContent",e],queryFn:()=>r7(e),enabled:!!e&&t==="tutor_h5p_quiz"})};var ie=e=>{return eH/* .wpAjaxInstance.post */.b.post(ez/* ["default"].DELETE_QUIZ */.A.DELETE_QUIZ,{quiz_id:e})};var it=()=>{var e=(0,A/* .useQueryClient */.jE)();var{showToast:t}=(0,eQ/* .useToast */.d)();return(0,rX/* .useMutation */.n)({mutationFn:ie,onSuccess:n=>{if(n.status_code===200){t({message:(0,c.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({message:(0,B/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/QuizModal.tsx
function ir(){var e=(0,b._)(["\n      padding-top: ",";\n      padding-inline: 352px 352px; // 352px is the width of the left and right side\n\n      "," {\n        padding: "," "," "," ",";\n        margin: 0 auto;\n      }\n\n      "," {\n        padding-top: ",";\n      }\n    "]);ir=function t(){return e};return e}var ii=(0,ea/* .getCourseId */.p)();var ia=e=>{var{closeModal:t,icon:n,title:o,subtitle:s,quizId:l,topicId:d,contentDripType:p,contentType:v}=e;var{fields:h}=(0,er/* .useCourseBuilderSlot */._)();var[m,b]=(0,u.useState)(false);var[y,w]=(0,u.useState)("details");var[A,k]=(0,u.useState)(!(0,e0/* .isDefined */.O9)(l));var I=(0,u.useRef)(null);var C=r5();var E=r3(l||"");var{showToast:q}=(0,eQ/* .useToast */.d)();var T=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{quiz_option:{time_limit:{time_value:0,time_type:"minutes"},hide_quiz_time_display:false,feedback_mode:"retry",attempts_allowed:10,passing_grade:80,max_questions_for_answer:v==="tutor_h5p_quiz"?0:10,quiz_auto_start:false,question_layout_view:v==="tutor_h5p_quiz"?"question_below_each_other":"single_question",questions_order:"rand",hide_question_number_overview:false,short_answer_characters_limit:200,open_ended_answer_characters_limit:500,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:[]},shouldFocusError:true});var S=T.formState.dirtyFields&&Object.keys(T.formState.dirtyFields).length>0;(0,u.useEffect)(()=>{var e=e=>{if(S){e.preventDefault();return}T.reset()};window.addEventListener("beforeunload",e);return()=>{window.removeEventListener("beforeunload",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[S]);(0,u.useEffect)(()=>{if(!E.data){return}var e=rZ(E.data,(0,B/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz}));T.reset(e);// eslint-disable-next-line react-hooks/exhaustive-deps
},[E.data]);var M=(e,n,r)=>(0,x._)(function*(){if(!e.quiz_title){w("details");Promise.resolve().then(()=>{T.trigger("quiz_title",{shouldFocus:true})});return}if(e.questions.length===0){w("details");q({message:(0,c.__)("Please add a question","tutor"),type:"danger"});return}var i=e.questions[n];var a=e2(i);if(a!==true){r(a);w("details");return}k(false);var o=rJ(e,d,p,ii,(0,B/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz,slotKey:"after_question_description"},{fields:h.Curriculum.Quiz,slotKey:"bottom_of_question_sidebar"}),(0,B/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz,slotKey:"bottom_of_settings"}));var s=yield C.mutateAsync(o);if(s.data){k(false);t({action:"CONFIRM"});T.reset()}})();(0,u.useEffect)(()=>{if(A){T.setFocus("quiz_title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[A]);return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .FormProvider */.Op,(0,i._)((0,r._)({},T),{children:/*#__PURE__*/(0,a/* .jsx */.Y)(e$,{quizId:l||"",contentType:v||"tutor_quiz",children:e=>{var{activeQuestionIndex:d,activeQuestionId:u,setActiveQuestionId:h,setValidationError:x}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)(et/* ["default"] */.A,{onClose:()=>t({action:"CLOSE"}),icon:S?/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"warning",width:24,height:24}):n,title:S?el/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":o,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?s:"",maxWidth:1218,headerChildren:/*#__PURE__*/(0,a/* .jsx */.Y)(eX/* ["default"] */.A,{wrapperCss:is.tabsWrapper,activeTab:y,tabList:[{label:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?(0,c.__)("Question Details","tutor"):"",value:"details",icon:!el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"text",width:24,height:24}):null},{label:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?(0,c.__)("Settings","tutor"):"",value:"settings",icon:!el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"settings",width:24,height:24}):null}],onChange:e=>w(e)}),actions:S&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(S){b(true);return}t()},ref:I,children:l?el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Discard","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y==="settings"||l,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"quiz-next",variant:"primary",size:"small",onClick:()=>w("settings"),children:(0,c.__)("Next","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-quiz",loading:C.isPending,variant:"primary",size:"small",onClick:T.handleSubmit(e=>M(e,d,x)),children:(0,c.__)("Save","tutor")})})]}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:is.wrapper({activeTab:y,isH5pQuiz:v==="tutor_h5p_quiz"}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!E.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y==="details",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:is.left,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:y==="details",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:is.quizTitleWrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:is.quizForm,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:T.control,name:"quiz_title",rules:{required:(0,c.__)("Quiz title is required","tutor")},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(tY,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add quiz title","tutor"),size:"small",isEdit:A,onToggleEdit:e=>{k(e)},wrapperCss:is.quizTitle}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:A,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:T.control,name:"quiz_description",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eG/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a summary","tutor"),enableResize:false,rows:2}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:is.quizFormButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",type:"button",onClick:()=>{if(!T.watch("quiz_title")){t()}k(false)},size:"small",children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-quiz-title",loading:C.isPending,variant:"secondary",type:"submit",size:"small",onClick:()=>{if(!T.getValues("quiz_title")){T.trigger("quiz_title");return}k(false)},children:(0,c.__)("Ok","tutor")})]})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(rO,{isEditing:A})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:is.content({activeTab:y}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y==="settings",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(nT,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(rQ,{contentDripType:p})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:y==="details"&&v!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:is.right,children:/*#__PURE__*/(0,a/* .jsx */.Y)(e3,{})})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{isOpen:m,triggerRef:I,closePopover:()=>b(false),maxWidth:"258px",title:(0,c.__)("Your quiz has unsaved changes. If you cancel, you will lose your progress.","tutor"),message:(0,c.__)("Are you sure you want to continue?","tutor"),animationType:W/* .AnimationType.slideUp */.J6.slideUp,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?rM/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:rM/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,positionModifier:{top:-55,left:l?34:2},confirmButton:{text:(0,c.__)("Yes","tutor"),variant:"primary"},cancelButton:{text:(0,c.__)("No","tutor"),variant:"text"},onConfirmation:()=>{var e;T.reset();x(null);if(!((e=E.data)===null||e===void 0?void 0:e.questions.find(e=>e.question_id===u))){h("")}if(!l){t()}}})]})}})}))};/* export default */const io=ia;var is={wrapper:e=>{var{activeTab:t,isH5pQuiz:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;display:grid;grid-template-columns:",t==="details"?n?"513px 1fr":"352px 1fr 280px":"1fr",";height:100%;",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:100%;grid-template-columns:1fr;height:max-content;}")},tabsWrapper:/*#__PURE__*/(0,d/* .css */.AH)("height:",el/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT,"px;",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{button{min-width:auto;}}"),left:/*#__PURE__*/(0,d/* .css */.AH)("border-right:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),content:e=>{var{activeTab:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding:",K/* .spacing["32"] */.YK["32"]," 0 ",K/* .spacing["48"] */.YK["48"]," ",K/* .spacing["6"] */.YK["6"],";",t==="settings"&&(0,d/* .css */.AH)(ir(),K/* .spacing["24"] */.YK["24"],K/* .Breakpoint.smallTablet */.EA.smallTablet,K/* .spacing["16"] */.YK["16"],K/* .spacing["8"] */.YK["8"],K/* .spacing["24"] */.YK["24"],K/* .spacing["8"] */.YK["8"],K/* .Breakpoint.smallMobile */.EA.smallMobile,K/* .spacing["8"] */.YK["8"]))},right:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.overflowYAuto */.x.overflowYAuto,";",L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["16"] */.YK["16"],";border-left:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),quizTitleWrapper:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["32"] */.YK["32"]," ",K/* .spacing["16"] */.YK["16"]," ",K/* .spacing["28"] */.YK["28"],";border-bottom:1px solid ",K/* .colorTokens.stroke.divider */.I6.stroke.divider,";",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{padding:",K/* .spacing["8"] */.YK["8"],";}"),quizNameWithButton:/*#__PURE__*/(0,d/* .css */.AH)("display:inline-flex;width:100%;transition:all 0.3s ease-in-out;button{display:none;}:hover,:focus-within{button{display:block;}}:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",K/* .borderRadius["6"] */.Vq["6"],";button{display:block;}}",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{button{display:block;}}"),quizTitle:/*#__PURE__*/(0,d/* .css */.AH)("padding:0;[data-placeholder]{padding:0;}[data-question-title-edit-button]{background-color:",K/* .colorTokens.background.white */.I6.background.white,";}&:hover{background-color:transparent;}"),quizForm:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",K/* .spacing["12"] */.YK["12"],";"),quizFormButtonWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:end;margin-top:",K/* .spacing["4"] */.YK["4"],";gap:",K/* .spacing["8"] */.YK["8"],";")};// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/additional/meeting/GoogleMeetForm.tsx
var il=n(74843);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicContent.tsx
function id(){var e=(0,b._)(["\n      background-color: ",";\n      opacity: 0.3;\n    "]);id=function t(){return e};return e}function ic(){var e=(0,b._)(["\n      border-color: ",";\n      background-color: ",";\n      [data-content-icon] {\n        display: flex;\n      }\n      [data-bar-icon] {\n        display: none;\n      }\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);ic=function t(){return e};return e}function iu(){var e=(0,b._)(["\n      [data-content-icon] {\n        display: none;\n      }\n      [data-bar-icon] {\n        display: block;\n      }\n      cursor: grabbing;\n    "]);iu=function t(){return e};return e}var ip={lesson:{name:"lesson",color:K/* .colorTokens.icon["default"] */.I6.icon["default"]},tutor_quiz:{name:"quiz",color:K/* .colorTokens.design.warning */.I6.design.warning},tutor_assignments:{name:"assignment",color:K/* .colorTokens.icon.processing */.I6.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"interactiveQuiz",color:"#C984FE"},"cb-lesson":{name:"lesson",color:K/* .colorTokens.icon["default"] */.I6.icon["default"]},"cb-assignment":{name:"assignment",color:K/* .colorTokens.icon.processing */.I6.icon.processing}};var iv={tutor_assignments:(0,c.__)("Are you sure you want to delete this assignment? All existing assignment submissions will be permanently deleted.","tutor"),tutor_quiz:(0,c.__)("Are you sure you want to delete this quiz? All existing quiz attempts will be permanently deleted.","tutor"),tutor_h5p_quiz:(0,c.__)("Are you sure you want to delete this interactive quiz? All existing quiz attempts will be permanently deleted.","tutor")};var ih={lesson:ej,tutor_quiz:io,tutor_assignments:eh,tutor_h5p_quiz:io};var ig={lesson:(0,c.__)("Lesson","tutor"),tutor_quiz:(0,c.__)("Quiz","tutor"),tutor_assignments:(0,c.__)("Assignment","tutor"),tutor_h5p_quiz:(0,c.__)("Interactive Quiz","tutor")};var i_={lesson:"lesson",tutor_quiz:"quiz",tutor_assignments:"assignment",tutor_h5p_quiz:"interactiveQuiz"};var im=["lesson","tutor_assignments","tutor_quiz","tutor_h5p_quiz","tutor_zoom_meeting","tutor-google-meet"];var ib=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var iy=(0,ea/* .getCourseId */.p)();var iw=e=>{var{type:t,topic:n,content:o,listeners:s,isDragging:l=false,onCopy:p,onDelete:v}=e;var h=(0,ea/* .getIdWithoutPrefix */.E)("topic-",n.id);var f=(0,ea/* .getIdWithoutPrefix */.E)("content-",o.id);var m=(0,A/* .useQueryClient */.jE)();var b=m.getQueryData(["CourseDetails",Number(iy)]);var y=(0,Y/* .useFormContext */.xW)();var[w,q]=(0,u.useState)(null);var[T,S]=(0,u.useState)(false);var M=(0,u.useRef)(null);var H=(0,u.useRef)(null);var z=ip[t]||{name:"lesson",color:K/* .colorTokens.icon["default"] */.I6.icon["default"]};var{showModal:O}=(0,em/* .useModal */.h)();var F=(0,ei/* .useDuplicateContentMutation */.V_)();var N=(0,ei/* .useDeleteContentMutation */.VT)();var R=it();var U=(0,ei/* .useDeleteContentMutation */.VT)();var j=(0,ei/* .useDeleteContentMutation */.VT)();var V=r4();var Q=(0,ei/* .useDeleteContentBankContentMutation */._u)();var G=()=>{var e=t;if(ih[e]){O({component:ih[e],props:(0,r._)({contentDripType:y.watch("contentDripType"),topicId:h,lessonId:f,assignmentId:f,quizId:f,title:ig[e],/* translators: %s is the topic title */subtitle:(0,c.sprintf)((0,c.__)("Topic: %s","tutor"),n.title),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:i_[e],height:24,width:24})},t==="tutor_h5p_quiz"&&{contentType:"tutor_h5p_quiz"}),closeOnEscape:!["tutor_quiz","tutor_h5p_quiz"].includes(t)})}if(t==="tutor_zoom_meeting"){q("tutor_zoom_meeting")}if(t==="tutor-google-meet"){q("tutor-google-meet")}};var X=()=>(0,x._)(function*(){if(["lesson","tutor_assignments"].includes(t)){yield N.mutateAsync(f)}else if(["tutor_quiz","tutor_h5p_quiz"].includes(t)){yield R.mutateAsync(f)}else if(t==="tutor-google-meet"){yield U.mutateAsync(f)}else if(t==="tutor_zoom_meeting"){yield j.mutateAsync(f)}else if(["cb-lesson","cb-assignment"].includes(t)){yield Q.mutateAsync({topicId:h,contentId:f})}S(false);v===null||v===void 0?void 0:v()})();var Z=()=>{var e={lesson:"lesson",tutor_assignments:"assignment",tutor_quiz:"quiz",tutor_h5p_quiz:"quiz"};F.mutateAsync({course_id:iy,content_id:f,content_type:e[t]});p===null||p===void 0?void 0:p()};return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iA.wrapper({isDragging:l,isActive:w===t||T||F.isPending}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({css:iA.iconAndTitle({isDragging:l})},s),{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-content-icon":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:z.name,width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.AH)("color:",z.color,";")})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-bar-icon":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"bars",width:24,height:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("p",{css:iA.title,onClick:G,onKeyDown:B/* .noop */.lQ,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{dangerouslySetInnerHTML:{__html:o.title}}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(t==="tutor_quiz"||t==="tutor_h5p_quiz")&&!!o.total_question,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{"data-question-count":true,children:["(",/* translators: %s is the total number of questions */(0,c.sprintf)((0,c.__)("%s Questions","tutor"),o.total_question),")"]})})]})]})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iA.actions,"data-actions":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t==="tutor_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Export Quiz","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!ib,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{V.mutate(f)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"export",width:24,height:24})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:true,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"export",width:24,height:24})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:im.includes(t),children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"edit-".concat(t),ref:M,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!["tutor_zoom_meeting","tutor_zoom_meeting"].includes(t),children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!F.isPending,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{size:24}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!ib,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"duplicate-".concat(t),type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:Z,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"delete-".concat(t),ref:H,type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{S(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(C/* ["default"] */.A,{triggerRef:M,isOpen:w!==null,closePopover:B/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?rM/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:rM/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w==="tutor_zoom_meeting",children:/*#__PURE__*/(0,a/* .jsx */.Y)(E/* ["default"] */.A,{data:null,topicId:h,meetingHost:(b===null||b===void 0?void 0:b.zoom_users)||{},onCancel:()=>q(null),meetingId:f})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w==="tutor-google-meet",children:/*#__PURE__*/(0,a/* .jsx */.Y)(il/* ["default"] */.A,{data:null,topicId:h,onCancel:()=>q(null),meetingId:f})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{isOpen:T,isLoading:N.isPending||R.isPending||U.isPending||j.isPending||Q.isPending,triggerRef:H,closePopover:B/* .noop */.lQ,maxWidth:"258px",title:(0,c.sprintf)((0,c.__)('Delete "%s"',"tutor"),o.title),message:iv[t]||(0,c.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:W/* .AnimationType.slideUp */.J6.slideUp,confirmButton:{text:(0,c.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,c.__)("Cancel","tutor"),variant:"text"},onConfirmation:X,onCancel:()=>S(false)})]})};/* export default */const ix=/*#__PURE__*/(0,u.memo)(iw,(e,t)=>{return e.content.id===t.content.id&&e.content.title===t.content.title&&e.content.total_question===t.content.total_question&&e.isDragging===t.isDragging});var iA={wrapper:e=>{var{isDragging:t=false,isActive:n=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;padding:",K/* .spacing["10"] */.YK["10"]," ",K/* .spacing["8"] */.YK["8"],";border:1px solid transparent;border-radius:",K/* .borderRadius["6"] */.Vq["6"],";display:flex;justify-content:space-between;align-items:center;opacity:1;",t&&(0,d/* .css */.AH)(id(),K/* .colorTokens.stroke.hover */.I6.stroke.hover),"    [data-content-icon],[data-bar-icon]{display:flex;height:24px;}:hover,:focus-within{border-color:",K/* .colorTokens.stroke.border */.I6.stroke.border,";background-color:",K/* .colorTokens.background.white */.I6.background.white,";[data-content-icon]{display:none;}[data-bar-icon]{display:block;}[data-actions]{opacity:",t?0:1,";}}",n&&(0,d/* .css */.AH)(ic(),K/* .colorTokens.stroke.border */.I6.stroke.border,K/* .colorTokens.background.white */.I6.background.white)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-actions]{opacity:1;}}")},title:/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";cursor:pointer;span{&:first-of-type{",L/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),"}}[data-question-count]{color:",K/* .colorTokens.text.hints */.I6.text.hints,";}"),iconAndTitle:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";cursor:grab;flex-grow:1;[data-bar-icon]{display:none;}",t&&(0,d/* .css */.AH)(iu()))},actions:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;opacity:0;align-items:start;gap:",K/* .spacing["8"] */.YK["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicContentWrapper.tsx
var iY=e=>(0,l/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var ik=e=>{var{topic:t,content:n}=e;var{attributes:o,listeners:s,setNodeRef:d,transform:c,transition:u,isDragging:p}=(0,l/* .useSortable */.gl)({id:n.ID,data:{type:"content"},animateLayoutChanges:iY});var v={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(c),transition:u};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},o),{ref:d,style:v,children:/*#__PURE__*/(0,a/* .jsx */.Y)(ix,{type:n.post_type,topic:t,listeners:s,isDragging:p,content:{id:n.ID,title:n.post_title,total_question:n.total_question||0}})}))};/* export default */const iI=ik;// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/FileUploader.tsx
var iD=e=>{var{acceptedTypes:t,onUpload:n,onError:r,maxFileSize:i=Number((es/* .tutorConfig */.P===null||es/* .tutorConfig */.P===void 0?void 0:es/* .tutorConfig.max_upload_size */.P.max_upload_size)||"")||el/* .MAX_FILE_SIZE */.w3}=e;var a=(0,u.useRef)(null);var o=e=>{var{files:a}=e.target;if(!a||a.length===0){r([(0,c.__)("No files selected","tutor")]);return}var o=[];var s=[];for(var l of[...a]){if(!t.includes((0,B/* .getFileExtensionFromName */.dS)(l.name))){o.push((0,c.__)("Invalid file type","tutor"))}else if(l.size>i){o.push((0,c.__)("Maximum upload size exceeded","tutor"))}else{s.push(l)}}if(s.length){n(s)}if(o.length){r(o)}e.target.value=""};return{fileInputRef:a,handleChange:o}};var iC=e=>{var{onUpload:t,onError:n,acceptedTypes:r,label:i,multiple:a=false,disabled:o=false,maxFileSize:s=formatReadAbleBytesToBytes((tutorConfig===null||tutorConfig===void 0?void 0:tutorConfig.max_upload_size)||"")||MAX_FILE_SIZE}=e;var{fileInputRef:l,handleChange:d}=iD({acceptedTypes:r,onUpload:t,onError:n,maxFileSize:s});return /*#__PURE__*/_jsxs("button",{type:"button",css:iE.uploadButton,onClick:()=>{var e;return(e=l.current)===null||e===void 0?void 0:e.click()},disabled:o,children:[/*#__PURE__*/_jsx("input",{ref:l,type:"file",css:iE.fileInput,accept:r.join(","),onChange:d,multiple:a,disabled:o}),/*#__PURE__*/_jsx(SVGIcon,{name:"storeImage",width:26,height:20}),/*#__PURE__*/_jsx("span",{css:iE.text,children:i})]})};var iE={uploadButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,"    background:",K/* .colorTokens.background["default"] */.I6.background["default"],";border:1px dashed ",K/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",K/* .borderRadius["8"] */.Vq["8"],";display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1;gap:",K/* .spacing["12"] */.YK["12"],";"),fileInput:/*#__PURE__*/(0,d/* .css */.AH)("display:none;"),text:/*#__PURE__*/(0,d/* .css */.AH)("color:",K/* .colorTokens.text.subdued */.I6.text.subdued,";",O/* .typography.body */.I.body())};var iq=e=>{var{onUpload:t,onError:n,acceptedTypes:r,multiple:i=false,disabled:a=false,children:o,maxFileSize:s=Number((tutorConfig===null||tutorConfig===void 0?void 0:tutorConfig.max_upload_size)||"")||MAX_FILE_SIZE}=e,l=_object_without_properties(e,["onUpload","onError","acceptedTypes","multiple","disabled","children","maxFileSize"]);var{fileInputRef:d,handleChange:c}=iD({acceptedTypes:r,onUpload:t,onError:n,maxFileSize:s});return /*#__PURE__*/_jsxs(Button,_object_spread_props(_object_spread({},l),{onClick:()=>{var e;return(e=d.current)===null||e===void 0?void 0:e.click()},disabled:a,children:[/*#__PURE__*/_jsx("input",{ref:d,type:"file",css:iE.fileInput,accept:r.join(","),onChange:c,multiple:i,disabled:a}),o]}))};/* export default */const iT=/* unused pure expression or super */null&&iC;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicFooter.tsx
var iS=(0,ea/* .getCourseId */.p)();var iM=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var iH=(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.oW.TUTOR_GOOGLE_MEET_INTEGRATION)||(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_ZOOM_INTEGRATION */.oW.TUTOR_ZOOM_INTEGRATION);var iz=e=>{var{topic:t,nextContentOrder:n}=e;var r=(0,ea/* .getIdWithoutPrefix */.E)("topic-",t.id);var{showToast:i}=(0,eQ/* .useToast */.d)();var{showModal:o}=(0,em/* .useModal */.h)();var s=(0,Y/* .useFormContext */.xW)();var[l,d]=(0,u.useState)(null);var[p,v]=(0,u.useState)(false);var h=(0,u.useRef)(null);var g=(0,u.useRef)(null);var m=r1();var b=(0,A/* .useQueryClient */.jE)();var y=b.getQueryData(["CourseDetails",Number(iS)]);var{fileInputRef:w,handleChange:I}=iD({acceptedTypes:[".csv"],onUpload:e=>(0,x._)(function*(){yield m.mutateAsync({topic_id:r,csv_file:e[0]});v(false)})(),onError:e=>{for(var t of e){i({message:t,type:"danger"})}v(false)}});return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iO.contentButtons,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iO.leftButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-lesson",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,onClick:()=>{o({component:ej,props:{contentDripType:s.watch("contentDripType"),topicId:r,title:(0,c.__)("Lesson","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"lesson",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,c.sprintf)((0,c.__)("Topic: %s","tutor"),t.title)}})},children:(0,c.__)("Lesson","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,onClick:()=>{o({component:io,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Quiz","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"quiz",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,c.sprintf)((0,c.__)("Topic: %s","tutor"),t.title)},closeOnEscape:false})},children:(0,c.__)("Quiz","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-interactive-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,onClick:()=>{o({component:io,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Interactive Quiz","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"interactiveQuiz",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,c.sprintf)((0,c.__)("Topic: %s","tutor"),t.title),contentType:"tutor_h5p_quiz"},closeOnEscape:false})},children:(0,c.__)("Interactive Quiz","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:true,onClick:B/* .noop */.lQ,children:(0,c.__)("Interactive Quiz","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-assignment",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,onClick:()=>{o({component:eh,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Assignment","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"assignment",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,c.sprintf)((0,c.__)("Topic: %s","tutor"),t.title)}})},children:(0,c.__)("Assignment","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:true,onClick:B/* .noop */.lQ,children:(0,c.__)("Assignment","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iO.rightButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.CONTENT_BANK */.oW.CONTENT_BANK),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentBank",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,"data-cy":"add-from-content-bank",onClick:()=>{o({id:"content-bank-collection-list",component:rT,props:{type:"lesson_assignment",topicId:r,nextContentOrder:n}})},children:(0,c.__)("Content Bank","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"contentBank",width:24,height:24}),disabled:true,onClick:B/* .noop */.lQ,children:(0,c.__)("Content Bank","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM||iH,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:iM,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"import",width:24,height:24}),disabled:true,onClick:B/* .noop */.lQ,children:(0,c.__)("Import Quiz","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:(0,B/* .isAddonEnabled */.GR)(el/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"import",width:24,height:24}),disabled:!t.isSaved,buttonCss:iO.contentButton,onClick:()=>{var e;w===null||w===void 0?void 0:(e=w.current)===null||e===void 0?void 0:e.click()},children:(0,c.__)("Import Quiz","tutor")})})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(nM/* ["default"] */.A,{isOpen:p,onClick:()=>v(true),closePopover:()=>v(false),disabled:!t.isSaved,dotsOrientation:"vertical",maxWidth:iM?"220px":"250px",isInverse:true,closeOnEscape:false,size:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"medium":"small",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM||(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.oW.TUTOR_GOOGLE_MEET_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(nM/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{ref:h,css:iO.threeDotButton,children:[(0,c.__)("Meet live lesson","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iM,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{width:24,height:24,name:"googleMeetColorize",isColorIcon:true}),onClick:()=>d("tutor-google-meet")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM||(0,B/* .isAddonEnabled */.GR)(el/* .Addons.TUTOR_ZOOM_INTEGRATION */.oW.TUTOR_ZOOM_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(nM/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{ref:g,css:iO.threeDotButton,children:[(0,c.__)("Zoom live lesson","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iM,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{width:24,height:24,name:"zoomColorize",isColorIcon:true}),onClick:()=>d("tutor_zoom_meeting")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM||(0,B/* .isAddonEnabled */.GR)(el/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)(nM/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:iO.threeDotButton,children:[(0,c.__)("Import Quiz","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iM,children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iM,onClick:()=>{var e;w===null||w===void 0?void 0:(e=w.current)===null||e===void 0?void 0:e.click()},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"importColorized",width:24,height:24,isColorIcon:true})})})]})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{css:iO.input,type:"file",ref:w,onChange:I,multiple:false,accept:".csv"}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{triggerRef:h,isOpen:l==="tutor-google-meet",closePopover:B/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?rM/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:rM/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,a/* .jsx */.Y)(il/* ["default"] */.A,{topicId:r,data:null,onCancel:()=>{d(null);v(false)}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{triggerRef:g,isOpen:l==="tutor_zoom_meeting",closePopover:B/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?rM/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:rM/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,a/* .jsx */.Y)(E/* ["default"] */.A,{topicId:r,meetingHost:(y===null||y===void 0?void 0:y.zoom_users)||{},data:null,onCancel:()=>{d(null);v(false)}})})]})};/* export default */const iK=/*#__PURE__*/(0,u.memo)(iz,(e,t)=>{return e.topic.id===t.topic.id&&e.topic.isSaved===t.topic.isSaved&&e.nextContentOrder===t.nextContentOrder});var iO={contentButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;"),leftButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";gap:",K/* .spacing["12"] */.YK["12"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{flex-wrap:wrap;}"),rightButtons:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";"),threeDotButton:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["4"] */.YK["4"],";"),contentButton:/*#__PURE__*/(0,d/* .css */.AH)(":hover:not(:disabled){background-color:",K/* .colorTokens.background.white */.I6.background.white,";color:",K/* .colorTokens.text.brand */.I6.text.brand,";outline:1px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),input:/*#__PURE__*/(0,d/* .css */.AH)("display:none !important;")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/useCollapseExpandAnimation.tsx
var iF=e=>{var{ref:t,isOpen:n,heightCalculator:r="scroll"}=e;var i,a;var[o,s]=(0,u.useState)(r==="scroll"?(i=t.current)===null||i===void 0?void 0:i.scrollHeight:(a=t.current)===null||a===void 0?void 0:a.clientHeight);(0,u.useEffect)(()=>{if(t.current){var e=r==="scroll"?t.current.scrollHeight:t.current.clientHeight;s(e)}// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.current,r]);var l=(0,w/* .useSpring */.zh)({height:n?o:0,opacity:n?1:0,overflow:"hidden",config:{duration:300,easing:e=>e*(2-e)}});return l};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicHeader.tsx
function iP(){var e=(0,b._)(["\n        transform: rotate(180deg);\n      "]);iP=function t(){return e};return e}function iW(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);iW=function t(){return e};return e}function iN(){var e=(0,b._)(["\n      padding-bottom: 0;\n    "]);iN=function t(){return e};return e}function iL(){var e=(0,b._)(["\n      [data-visually-hidden] {\n        opacity: 0;\n        transition: ",";\n      }\n\n      :hover,\n      :focus-within {\n        [data-visually-hidden] {\n          opacity: ",";\n        }\n      }\n    "]);iL=function t(){return e};return e}function iB(){var e=(0,b._)(["\n      ",";\n    "]);iB=function t(){return e};return e}function iR(){var e=(0,b._)(["\n      ",";\n    "]);iR=function t(){return e};return e}function iU(){var e=(0,b._)(["\n      padding-right: 0;\n    "]);iU=function t(){return e};return e}var ij=(0,ea/* .getCourseId */.p)();var iV=!!es/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var iQ=e=>{var{topic:t,isEdit:n,listeners:o,isDragging:s,onCollapse:l,onEdit:d,onCopy:p,onDelete:v,setIsEdit:h}=e;var m=(0,ea/* .getIdWithoutPrefix */.E)("topic-",t.id);var b=(0,ed/* .useFormWithGlobalError */.p)({defaultValues:{title:t.title,summary:t.summary},shouldFocusError:true});var[y,A]=(0,u.useState)(false);var C=(0,u.useRef)(null);var E=(0,u.useRef)(null);var q=(0,ei/* .useSaveTopicMutation */.V1)();var T=(0,ei/* .useDuplicateContentMutation */.V_)();var M=(0,ei/* .useDeleteTopicMutation */.$n)(ij);var H=iF({ref:C,isOpen:!t.isCollapsed,heightCalculator:"client"});var z=e=>(0,x._)(function*(){var n=yield q.mutateAsync((0,i._)((0,r._)({},t.isSaved&&{topic_id:m}),{course_id:ij,title:e.title,summary:e.summary}));if(n.data){h(false)}if(n.status_code===201){d===null||d===void 0?void 0:d("topic-".concat(n.data))}})();var K=()=>(0,x._)(function*(){var e=yield T.mutateAsync({course_id:ij,content_id:m,content_type:"topic"});if(e.data){p===null||p===void 0?void 0:p("topic-".concat(e.data))}})();(0,u.useEffect)(()=>{if(n){b.setFocus("title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[n]);return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iX.header({isCollapsed:t.isCollapsed,isEdit:n,isDeletePopoverOpen:y,isDragging:s}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iX.headerContent({isSaved:t.isSaved}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iX.grabberInput,onClick:()=>l(t.id),onKeyDown:e=>{if(e.key==="Enter"){l(t.id)}},children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},t.isSaved?o:{}),{css:iX.grabButton({isDragging:s}),type:"button",disabled:!t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:n,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:iX.title({isEdit:n}),onDoubleClick:()=>h(true),children:b.watch("title")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:iX.title({isEdit:n}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:b.control,name:"title",rules:{required:(0,c.__)("Title is required","tutor")},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a title","tutor"),isSecondary:true}))})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iX.actions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!n,children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"edit-topic",type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:()=>{h(true);if(t.isCollapsed){l===null||l===void 0?void 0:l(t.id)}},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!T.isPending,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{size:24}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!iV,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"duplicate-topic",type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:K,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:true,onClick:B/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"delete-topic",type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,"data-visually-hidden":true,ref:E,onClick:()=>{A(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"delete",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:L/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:()=>{l===null||l===void 0?void 0:l(t.id)},"data-toggle-collapse":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"chevronDown",width:24,height:24})})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:n,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t.summary.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(w/* .animated.div */.CS.div,{style:(0,r._)({},H),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:iX.description({isEdit:n}),ref:C,onDoubleClick:()=>h(true),children:b.watch("summary")})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:iX.description({isEdit:n}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* .Controller */.xI,{control:b.control,name:"summary",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eG/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a summary","tutor"),isSecondary:true,rows:2,enableResize:true}))})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:iX.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(!b.formState.isValid&&!t.isSaved){v===null||v===void 0?void 0:v()}b.reset();h(false)},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-topic",loading:q.isPending,variant:"secondary",size:"small",onClick:b.handleSubmit(z),children:(0,c.__)("Ok","tutor")})]})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{isOpen:y,triggerRef:E,isLoading:M.isPending,closePopover:B/* .noop */.lQ,maxWidth:"258px",title:/* translators: %s is the topic title */(0,c.sprintf)((0,c.__)('Delete topic "%s"',"tutor"),t.title),message:(0,c.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:W/* .AnimationType.slideUp */.J6.slideUp,confirmButton:{text:(0,c.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,c.__)("Cancel","tutor"),variant:"text"},onConfirmation:()=>(0,x._)(function*(){yield M.mutateAsync(m);A(false);v===null||v===void 0?void 0:v()})(),onCancel:()=>A(false)})]})};/* export default */const iG=/*#__PURE__*/(0,u.memo)(iQ,(e,t)=>{return e.topic.id===t.topic.id&&e.topic.isSaved===t.topic.isSaved&&e.topic.isCollapsed===t.topic.isCollapsed&&e.isEdit===t.isEdit});var iX={header:e=>{var{isCollapsed:t,isEdit:n,isDeletePopoverOpen:r,isDragging:i}=e;return/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";",L/* .styleUtils.display.flex */.x.display.flex("column"),";[data-toggle-collapse]{transition:transform 0.3s ease-in-out;",!t&&(0,d/* .css */.AH)(iP()),"}",!t&&(0,d/* .css */.AH)(iW(),K/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",!n&&(0,d/* .css */.AH)(iN())," ",!n&&!r&&(0,d/* .css */.AH)(iL(),!i?"opacity 0.3s ease-in-out":"none",i?0:1)," ",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},headerContent:e=>{var{isSaved:t=true}=e;return/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:",t?"1fr auto":"1fr",";gap:",K/* .spacing["12"] */.YK["12"],";width:100%;padding-bottom:",K/* .spacing["12"] */.YK["12"],";")},grabberInput:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";svg{color:",K/* .colorTokens.color.black["40"] */.I6.color.black["40"],";flex-shrink:0;}"),grabButton:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.resetButton */.x.resetButton,";",L/* .styleUtils.flexCenter */.x.flexCenter(),";cursor:",t?"grabbing":"grab",";:disabled{cursor:not-allowed;}&:focus,&:active,&:hover{background:none;}&:focus-visible{outline:2px solid ",K/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;border-radius:",K/* .borderRadius["2"] */.Vq["2"],";}")},title:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";width:100%;",!t&&(0,d/* .css */.AH)(iB(),L/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)))},description:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)(O/* .typography.caption */.I.caption(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";padding-inline:",K/* .spacing["8"] */.YK["8"],";margin-left:",K/* .spacing["24"] */.YK["24"],";padding-bottom:",K/* .spacing["12"] */.YK["12"],";",!t&&(0,d/* .css */.AH)(iR(),L/* .styleUtils.text.ellipsis */.x.text.ellipsis(2))," ",t&&(0,d/* .css */.AH)(iU()))},footer:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;text-align:right;",L/* .styleUtils.display.flex */.x.display.flex(),";gap:",K/* .spacing["8"] */.YK["8"],";justify-content:end;"),actions:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex(),";align-items:start;gap:",K/* .spacing["8"] */.YK["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/Topic.tsx
function iZ(){var e=(0,b._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);iZ=function t(){return e};return e}function iJ(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);iJ=function t(){return e};return e}var i$=e=>(0,l/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var i0=e=>{var{topic:t,onDelete:n,onCopy:o,onCollapse:s,onEdit:d,isOverlay:c=false}=e;var p,v;var[h,f]=(0,u.useState)(false);var[g,_]=(0,u.useState)(!t.isSaved);var m=(0,u.useRef)(null);var b=(0,u.useRef)(null);var[x,A]=(0,w/* .useSpring */.zh)({height:!t.isCollapsed?(p=m.current)===null||p===void 0?void 0:p.scrollHeight:0,opacity:!t.isCollapsed?1:0,overflow:"hidden",config:{duration:300,easing:e=>e*(2-e)}},[t.contents.length]);(0,u.useEffect)(()=>{var e=e=>{if((0,e0/* .isDefined */.O9)(b.current)&&!b.current.contains(e.target)){f(false)}};document.addEventListener("click",e);return()=>document.removeEventListener("click",e)},[g]);var{attributes:Y,listeners:k,setNodeRef:I,transform:D,transition:C,isDragging:E}=(0,l/* .useSortable */.gl)({id:t.id,data:{type:"topic"},animateLayoutChanges:i$});var q=(0,u.useCallback)(e=>{if(e){I(e);// eslint-disable-next-line @typescript-eslint/no-explicit-any
b.current=e}},[I]);var T={transform:y/* .CSS.Transform.toString */.Ks.Transform.toString(D),transition:C,opacity:E?.3:undefined,background:E?K/* .colorTokens.stroke.hover */.I6.stroke.hover:undefined};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.O9)(m.current)){A.start({height:!t.isCollapsed?m.current.scrollHeight:0,opacity:!t.isCollapsed?1:0})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.isCollapsed,t.contents.length]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},t.isSaved?Y:{}),{css:i2.wrapper({isActive:h||g,isOverlay:c}),onClick:()=>f(true),onKeyDown:B/* .noop */.lQ,tabIndex:-1,ref:q,style:T,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(iG,{isActive:h,isDragging:E,isEdit:g,listeners:k,onCollapse:e=>{s===null||s===void 0?void 0:s(e)},onDelete:n,onEdit:e=>{d===null||d===void 0?void 0:d(e)},onCopy:e=>{o===null||o===void 0?void 0:o(e)},topic:t,setIsEdit:_}),/*#__PURE__*/(0,a/* .jsx */.Y)(w/* .animated.div */.CS.div,{style:(0,r._)({},x),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:i2.content,ref:m,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(P/* ["default"] */.A,{when:!t.isCollapsed,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:t.contents.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:t.contents.map(e=>(0,i._)((0,r._)({},e),{id:e.ID})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:t.contents,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(iI,{topic:t,content:e},e.ID)})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(iK,{topic:t,nextContentOrder:(t===null||t===void 0?void 0:(v=t.contents)===null||v===void 0?void 0:v.length)+1||1})]})})})]}))};/* export default */const i1=i0;var i2={wrapper:e=>{var{isActive:t=false,isOverlay:n=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",K/* .borderRadius["8"] */.Vq["8"],";transition:background-color 0.3s ease-in-out,border-color 0.3s ease-in-out;background-color:",K/* .colorTokens.bg.white */.I6.bg.white,";width:100%;",t&&(0,d/* .css */.AH)(iZ(),K/* .colorTokens.stroke.brand */.I6.stroke.brand,K/* .colorTokens.background.hover */.I6.background.hover),":hover{background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";}",n&&(0,d/* .css */.AH)(iJ(),K/* .shadow.drag */.r7.drag))},content:/*#__PURE__*/(0,d/* .css */.AH)("padding:",K/* .spacing["16"] */.YK["16"],";",L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["12"] */.YK["12"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicDragOverlay.tsx
var i4=e=>{var{title:t}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:i5.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"dragVertical",width:24,height:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:t})]})};/* export default */const i6=i4;var i5={wrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",K/* .spacing["8"] */.YK["8"],";border:1px solid ",K/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",K/* .borderRadius["8"] */.Vq["8"],";background-color:",K/* .colorTokens.background.hover */.I6.background.hover,";padding:",K/* .spacing["12"] */.YK["12"]," ",K/* .spacing["16"] */.YK["16"],";box-shadow:",K/* .shadow.drag */.r7.drag,";",O/* .typography.body */.I.body(),";color:",K/* .colorTokens.text.hints */.I6.text.hints,";cursor:grabbing;svg{color:",K/* .colorTokens.color.black["40"] */.I6.color.black["40"],";flex-shrink:0;}")};// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/layouts/CanvasHead.tsx
var i8=n(67915);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/layouts/Navigator.tsx
var i3=n(14238);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/config/route-configs.ts + 1 modules
var i7=n(45748);// CONCATENATED MODULE: ./assets/react/v3/public/images/curriculum-empty-state-2x.webp
const i9=n.p+"js/images/curriculum-empty-state-2x-a99700d1.webp";// CONCATENATED MODULE: ./assets/react/v3/public/images/curriculum-empty-state.webp
const ae=n.p+"js/images/curriculum-empty-state-2ba0e1ef.webp";// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/pages/Curriculum.tsx
var at=(0,ea/* .getCourseId */.p)();var an=()=>{var e=(0,h/* .useNavigate */.Zp)();(0,u.useEffect)(()=>{if(!at){e(i7/* .CourseBuilderRouteConfigs.Home.buildLink */.P.Home.buildLink(),{replace:true})}},[e]);var[t,n]=(0,u.useState)(true);var[d,p]=(0,u.useState)(false);var[b,y]=(0,u.useState)(null);var[w,x]=(0,u.useState)([]);var A=(0,u.useRef)([]);var Y=(0,ei/* .useCourseTopicQuery */.me)(at);var k=(0,ei/* .useUpdateCourseContentOrderMutation */.Id)();(0,u.useEffect)(()=>{if(w.length===0){return}p(true);var e=2;var n=0;var a=[];var o=()=>{x(o=>{var s=[...o];for(var l=0;l<e&&n<s.length;l++,n++){var d=s[n];if(d.isSaved&&d.isCollapsed!==t){s[n]=(0,i._)((0,r._)({},d),{isCollapsed:t});if(!t){a.push(d.id)}}}return s});if(n<w.length){setTimeout(o,0)}else{A.current=t?[]:a;p(false)}};o();// eslint-disable-next-line react-hooks/exhaustive-deps
},[t]);(0,u.useEffect)(()=>{var e;if(!((e=Y.data)===null||e===void 0?void 0:e.length)){return}var t=e=>{return Y.data.map((t,n)=>{var a="topic-".concat(t.id);var o=n===0;var s=A.current.includes(a);var l=e.length?!s:!o;if(o&&!e.length){A.current=[a]}return(0,i._)((0,r._)({},t),{id:a,isCollapsed:l,isSaved:true,contents:t.contents.map(e=>{return(0,i._)((0,r._)({},e),{ID:"content-".concat(e.ID)})})})})};x(t)},[Y.data]);var I=(0,u.useMemo)(()=>{if(!b){return null}var e=b.toString().includes("topic")?"topic":"content";var t=w.flatMap(e=>e.contents);var n=e==="topic"?w.find(e=>e.id===b):t.find(e=>e.ID===b);return n},[b,w]);var D=(0,o/* .useSensors */.FR)((0,o/* .useSensor */.MS)(o/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,o/* .useSensor */.MS)(o/* .KeyboardSensor */.uN,{coordinateGetter:l/* .sortableKeyboardCoordinates */.JR}));if(!at){return null}if(Y.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{})}var C=(e,t)=>{if(t==="topic"){return w.find(t=>t.id===e)}if(t==="content"){return w.find(t=>t.contents.find(t=>t.ID===e))}};var E=e=>{var{active:t,over:n}=e;if(!n||!t){return}if(t.id.toString().includes("content")&&n.id.toString().includes("content")&&t.id!==n.id){var r=C(t.id,"content");var i=C(n.id,"content");if(!r||!i)return;var a=w.findIndex(e=>e.id===r.id);var o=w.findIndex(e=>e.id===i.id);if(i.isCollapsed||a===o){return}var s=r.contents.findIndex(e=>e.ID===t.id);var l=i.contents.findIndex(e=>e.ID===n.id);var d=[...w];var[c]=d[a].contents.splice(s,1);d[o].contents.splice(l,0,c);x(d)}if(t.id.toString().includes("content")&&(n===null||n===void 0?void 0:n.id.toString().includes("topic"))&&t.id!==n.id){var u=C(t.id,"content");var p=C(n.id,"topic");if(!u||!p||p.contents.length>0||p.isCollapsed){return}var v=w.findIndex(e=>e.id===u.id);var h=w.findIndex(e=>e.id===p.id);if(v===h){return}var f=u.contents.findIndex(e=>e.ID===t.id);var g=[...w];var[_]=g[v].contents.splice(f,1);g[h].contents.push(_);x(g)}};var q=e=>{var t,n;var{active:i,over:a}=e;if(!a){y(null);return}var o=[...w];if(i.id.toString().includes("topic")&&(a===null||a===void 0?void 0:a.id.toString().includes("topic"))&&i&&i.id!==a.id){var s=w.findIndex(e=>e.id===i.id);var l=w.findIndex(e=>e.id===a.id);o=(0,B/* .moveTo */.tw)(o,s,l);x(o)}if(i.id.toString().includes("content")&&(a===null||a===void 0?void 0:a.id.toString().includes("content"))&&i&&i.id!==a.id){var d=C(i.id,"content");var c=C(a.id,"content");if(!d||!c||c.isCollapsed){return}var u=w.findIndex(e=>e.id===d.id);var p=w.findIndex(e=>e.id===c.id);var v=d.contents.findIndex(e=>e.ID===i.id);var h=c.contents.findIndex(e=>e.ID===a.id);if(u===p){o[u].contents=(0,B/* .moveTo */.tw)(o[u].contents,v,h);x(o)}else{var[f]=o[u].contents.splice(v,1);o[p].contents.splice(h,0,f);x(o)}}if(i.id.toString().includes("content")&&a.id.toString().includes("topic")&&i&&i.id!==a.id){var g=C(i.id,"content");var _=C(a.id,"topic");if(!g||!_||_.isCollapsed){return}var m=w.findIndex(e=>e.id===g.id);var b=w.findIndex(e=>e.id===_.id);var A=g.contents.findIndex(e=>e.ID===i.id);var[I]=o[m].contents.splice(A,1);o[b].contents.push(I);x(o)}var D=o.reduce((e,t,n)=>{var r=0;e[n]={topic_id:(0,ea/* .getIdWithoutPrefix */.E)("topic-",t.id),lesson_ids:t.contents.reduce((e,t)=>{e[r]=(0,ea/* .getIdWithoutPrefix */.E)("content-",t.ID);r++;return e},{})};return e},{});k.mutate((0,r._)({tutor_topics_lessons_sorting:D},i.id.toString().includes("content")&&{"content_parent[parent_topic_id]":(n=Y.data)===null||n===void 0?void 0:(t=n.find(e=>e.contents.find(e=>String(e.ID)===(0,ea/* .getIdWithoutPrefix */.E)("content-",a.id))))===null||t===void 0?void 0:t.id,"content_parent[content_id]":(0,ea/* .getIdWithoutPrefix */.E)("content-",i.id)}));y(null)};var T=(e,t)=>{x(t=>t.filter((t,n)=>n!==e));A.current=A.current.filter(e=>e!==t)};var S=e=>{x(t=>t.map(t=>{if(t.id===e){return(0,i._)((0,r._)({},t),{isCollapsed:!t.isCollapsed})}return t}));if(!A.current.includes(e)){A.current=[...A.current,e]}else{A.current=A.current.filter(t=>t!==e)}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ai.container,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ai.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(i8/* ["default"] */.A,{title:(0,c.__)("Curriculum","tutor"),backUrl:"/basics",rightButton:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w.some(e=>e.isSaved),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>n(e=>!e),disabled:d,children:t?(0,c.__)("Expand All","tutor"):(0,c.__)("Collapse All","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:ai.content,children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:!Y.isLoading&&Y.data&&(Y.data.length>0||w.length>0),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{emptyStateImage:ae,emptyStateImage2x:i9,imageAltText:(0,c.__)("Empty State Illustration","tutor"),title:(0,c.__)("Start building your course!","tutor"),description:(0,c.__)("Add Topics, Lessons, and Quizzes to get started.","tutor"),actions:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plusSquareBrand",width:24,height:25}),onClick:()=>{x(()=>{return[{id:(0,B/* .nanoid */.Ak)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]})},children:(0,c.__)("Add Topic","tutor")})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ai.topicWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(o/* .DndContext */.Mp,{sensors:D,collisionDetection:o/* .closestCorners */.y$,measuring:tO/* .droppableMeasuringStrategy */.s,modifiers:[s/* .restrictToWindowEdges */.Q_],onDragStart:e=>{y(e.active.id)},onDragOver:e=>E(e),onDragEnd:e=>q(e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .SortableContext */.gB,{items:w.map(e=>(0,i._)((0,r._)({},e),{id:e.id})),strategy:l/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:w,children:(e,t)=>{return e.isSaved&&/*#__PURE__*/(0,a/* .jsx */.Y)(i1,{topic:(0,i._)((0,r._)({},e),{isCollapsed:(b===null||b===void 0?void 0:b.toString().includes("topic"))?true:e.isCollapsed}),onDelete:()=>T(t,e.id),onCollapse:e=>S(e),onCopy:e=>{A.current=[e]},onEdit:e=>{A.current=[e]}},e.id)}})}),/*#__PURE__*/(0,v.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(o/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:I,children:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)(i6,{title:(b===null||b===void 0?void 0:b.toString().includes("topic"))?e.title:e.post_title})}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)(F/* ["default"] */.A,{each:w,children:(e,t)=>{return!e.isSaved&&/*#__PURE__*/(0,a/* .jsx */.Y)(i1,{topic:(0,i._)((0,r._)({},e),{isCollapsed:false}),onDelete:()=>T(t,e.id),onCollapse:e=>S(e),onCopy:e=>{A.current=[e]},onEdit:e=>{A.current=[e]}},e.id)}})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(P/* ["default"] */.A,{when:w.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:ai.addButtonWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{name:"plusSquareBrand",width:24,height:24}),onClick:()=>{x(e=>{return[...e.map(e=>(0,i._)((0,r._)({},e),{isCollapsed:true})),{id:(0,B/* .nanoid */.Ak)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]});A.current=[]},children:(0,c.__)("Add Topic","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(i3/* ["default"] */.A,{styleModifier:ai.navigator})]})};/* export default */const ar=an;var ai={container:/*#__PURE__*/(0,d/* .css */.AH)("margin-top:",K/* .spacing["32"] */.YK["32"],";width:100%;",K/* .Breakpoint.smallTablet */.EA.smallTablet,"{margin-top:",K/* .spacing["16"] */.YK["16"],";}"),wrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;",L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["16"] */.YK["16"],";margin:0 auto;"),content:/*#__PURE__*/(0,d/* .css */.AH)("margin-top:",K/* .spacing["16"] */.YK["16"],";",K/* .Breakpoint.smallMobile */.EA.smallMobile,"{margin-top:0;}"),topicWrapper:/*#__PURE__*/(0,d/* .css */.AH)(L/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",K/* .spacing["16"] */.YK["16"],";align-items:center;"),addButtonWrapper:/*#__PURE__*/(0,d/* .css */.AH)("path{stroke:",K/* .colorTokens.icon.brand */.I6.icon.brand,";}"),navigator:/*#__PURE__*/(0,d/* .css */.AH)("margin:",K/* .spacing["40"] */.YK["40"]," auto;")}},3620:function(e,t,n){n.d(t,{$2:()=>H,$n:()=>x,Cx:()=>Y,Id:()=>q,K3:()=>I,OJ:()=>W,R6:()=>f,SS:()=>L,V1:()=>y,VT:()=>C,V_:()=>K,_u:()=>R,gK:()=>F,me:()=>m,pR:()=>S,sC:()=>g});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(97286);/* import */var o=n(97665);/* import */var s=n(94747);/* import */var l=n(12470);/* import */var d=/*#__PURE__*/n.n(l);/* import */var c=n(45549);/* import */var u=n(95729);/* import */var p=n(53127);/* import */var v=n(37381);/* import */var h=n(85713);var f=(e,t,n,a,o)=>{var s,l;var d;return(0,r._)((0,i._)((0,r._)((0,i._)((0,r._)((0,i._)((0,r._)({},t&&{lesson_id:t}),{topic_id:n,title:e.title,description:e.description,thumbnail_id:(d=(s=e.thumbnail)===null||s===void 0?void 0:s.id)!==null&&d!==void 0?d:null}),e.video?Object.fromEntries(Object.entries(e.video).map(t=>{var[n,r]=t;var i;return["video[".concat(n,"]"),n==="source"&&!r?"-1":n==="poster_url"&&!((i=e.video)===null||i===void 0?void 0:i.poster)?"":r]})):{}),{"video[runtime][hours]":e.duration.hour||0,"video[runtime][minutes]":e.duration.minute||0,"video[runtime][seconds]":e.duration.second||0}),(0,h/* .isAddonEnabled */.GR)(u/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW)&&{_is_preview:e.lesson_preview?1:0}),{tutor_attachments:(e.tutor_attachments||[]).map(e=>e.id)}),(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((l=e.content_drip_settings.prerequisites)===null||l===void 0?void 0:l.length)?e.content_drip_settings.prerequisites:""},Object.fromEntries(o.map(t=>{return[t,e[t]||""]})))};var g=(e,t,n,a,o)=>{var s;return(0,r._)((0,i._)((0,r._)({},t&&{assignment_id:t}),{topic_id:n,title:e.title,summary:e.summary,attachments:(e.attachments||[]).map(e=>e.id),"assignment_option[time_duration][time]":e.time_duration.time,"assignment_option[time_duration][value]":e.time_duration.value,"assignment_option[deadline_from_start]":e.deadline_from_start?"1":"0","assignment_option[total_mark]":e.total_mark,"assignment_option[pass_mark]":e.pass_mark,"assignment_option[upload_files_limit]":e.upload_files_limit,"assignment_option[upload_file_size_limit]":e.upload_file_size_limit,"assignment_option[is_retry_allowed]":e.is_retry_allowed?"1":"0"}),e.is_retry_allowed&&{"assignment_option[attempts_allowed]":e.attempts_allowed},(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,h/* .isAddonEnabled */.GR)(u/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((s=e.content_drip_settings.prerequisites)===null||s===void 0?void 0:s.length)?e.content_drip_settings.prerequisites:""},Object.fromEntries(o.map(t=>{return[t,e[t]||""]})))};var _=e=>{return p/* .wpAjaxInstance.get */.b.get(v/* ["default"].GET_COURSE_CONTENTS */.A.GET_COURSE_CONTENTS,{params:{course_id:e}})};var m=e=>{return(0,a/* .useQuery */.I)({queryKey:["Topic",e],queryFn:()=>_(e).then(e=>{return e.data.map(e=>(0,i._)((0,r._)({},e),{contents:e.contents.map(e=>(0,i._)((0,r._)({},e),{post_type:e.quiz_type?"tutor_h5p_quiz":e.post_type}))}))}),enabled:!!e})};var b=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].SAVE_TOPIC */.A.SAVE_TOPIC,e)};var y=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:b,onSuccess:n=>{if(n.data){t({message:(0,l.__)("Topic saved successfully","tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})};var w=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].DELETE_TOPIC */.A.DELETE_TOPIC,{topic_id:e})};var x=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:w,onSuccess:(r,i)=>{if(r.status_code===200){n({message:(0,l.__)(r.message,"tutor"),type:"success"});t.setQueryData(["Topic",e],e=>{var t=JSON.parse(JSON.stringify(e));return t.filter(e=>String(e.id)!==String(i))})}},onError:e=>{n({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)});t.invalidateQueries({queryKey:["Topic"]})}})};var A=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(v/* ["default"].GET_LESSON_DETAILS */.A.GET_LESSON_DETAILS,{params:{topic_id:t,lesson_id:e}})};var Y=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["Lesson",e,t],queryFn:()=>A(e,t).then(e=>e.data),enabled:!!e&&!!t})};var k=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].SAVE_LESSON */.A.SAVE_LESSON,e)};var I=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:e=>k(e),onSuccess:(r,i)=>{if(r.data){t.invalidateQueries({queryKey:["Topic",e]});t.invalidateQueries({queryKey:["Lesson",i.lesson_id,i.topic_id]});n({message:(0,l.__)("Lesson saved successfully","tutor"),type:"success"})}},onError:e=>{n({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})};var D=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].DELETE_TOPIC_CONTENT */.A.DELETE_TOPIC_CONTENT,{lesson_id:e})};var C=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:D,onSuccess:n=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})};var E=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].UPDATE_COURSE_CONTENT_ORDER */.A.UPDATE_COURSE_CONTENT_ORDER,e)};var q=()=>{var{showToast:e}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:E,onError:t=>{e({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(t)})}})};var T=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(v/* ["default"].GET_ASSIGNMENT_DETAILS */.A.GET_ASSIGNMENT_DETAILS,{params:{topic_id:t,assignment_id:e}})};var S=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["Assignment",e,t],queryFn:()=>T(e,t).then(e=>e.data),enabled:!!e&&!!t})};var M=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].SAVE_ASSIGNMENT */.A.SAVE_ASSIGNMENT,e)};var H=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:e=>M(e),onSuccess:(r,i)=>{if(r.status_code===200||r.status_code===201){t.invalidateQueries({queryKey:["Topic",Number(e)]});t.invalidateQueries({queryKey:["Assignment",i.assignment_id,i.topic_id]});n({message:(0,l.__)(r.message,"tutor"),type:"success"})}},onError:e=>{n({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})};var z=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].DUPLICATE_CONTENT */.A.DUPLICATE_CONTENT,e)};/**
 *
 * @param quizId pass when duplicating 'answer'
 * @returns useMutation
 */var K=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:z,onSuccess:(r,i)=>{if(r.status_code===200||r.status_code===201){n({message:(0,l.__)(r.message,"tutor"),type:"success"});if(["lesson","assignment","quiz","topic"].includes(i.content_type)){t.invalidateQueries({queryKey:["Topic"]});return}if(["question"].includes(i.content_type)){t.invalidateQueries({queryKey:["Quiz",e]});return}}},onError:(r,i)=>{n({message:(0,h/* .convertToErrorMessage */.EL)(r),type:"danger"});if(["answer"].includes(i.content_type)){t.invalidateQueries({queryKey:["Quiz",e]})}}})};var O=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(v/* ["default"].GET_ZOOM_MEETING_DETAILS */.A.GET_ZOOM_MEETING_DETAILS,{params:{meeting_id:e,topic_id:t}})};var F=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["ZoomMeeting",e],queryFn:()=>O(e,t).then(e=>e.data),enabled:!!e&&!!t})};var P=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(v/* ["default"].GET_GOOGLE_MEET_DETAILS */.A.GET_GOOGLE_MEET_DETAILS,{params:{meeting_id:e,topic_id:t}})};var W=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["GoogleMeet",e],queryFn:()=>P(e,t).then(e=>e.data),enabled:!!e&&!!t})};var N=e=>{return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].ADD_CONTENT_BANK_CONTENT_TO_COURSE */.A.ADD_CONTENT_BANK_CONTENT_TO_COURSE,e)};var L=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:N,onSuccess:(n,r)=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic",r.course_id]})}},onError:e=>{t({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})};var B=e=>{var{topicId:t,contentId:n}=e;return p/* .wpAjaxInstance.post */.b.post(v/* ["default"].DELETE_CONTENT_BANK_CONTENT_FROM_COURSE */.A.DELETE_CONTENT_BANK_CONTENT_FROM_COURSE,{topic_id:t,content_id:n})};var R=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,c/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:B,onSuccess:n=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,h/* .convertToErrorMessage */.EL)(e)})}})}},52117:function(e,t,n){n.d(t,{A:()=>w});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(84577);/* import */var o=n(2445);/* import */var s=n(10840);/* import */var l=n(24219);/* import */var d=n(85713);/* import */var c=n(17437);/* import */var u=n(41594);/* import */var p=/*#__PURE__*/n.n(u);function v(){var e=(0,a._)(["\n      cursor: not-allowed;\n    "]);v=function t(){return e};return e}function h(){var e=(0,a._)(["\n      color: ",";\n    "]);h=function t(){return e};return e}function f(){var e=(0,a._)(["\n        margin-right: ",";\n      "]);f=function t(){return e};return e}function g(){var e=(0,a._)(["\n        background-color: ",";\n      "]);g=function t(){return e};return e}function _(){var e=(0,a._)(["\n      & + span::before {\n        background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='2' fill='none'%3E%3Crect width='10' height='1.5' y='.25' fill='%23fff' rx='.75'/%3E%3C/svg%3E\");\n        background-repeat: no-repeat;\n        background-size: 10px;\n        background-position: center center;\n        background-color: ",";\n        border: 0.5px solid ",";\n      }\n    "]);_=function t(){return e};return e}function m(){var e=(0,a._)(["\n      & + span {\n        cursor: not-allowed;\n\n        &::before {\n          border-color: ",";\n        }\n      }\n    "]);m=function t(){return e};return e}var b=/*#__PURE__*/p().forwardRef((e,t)=>{var{id:n=(0,d/* .nanoid */.Ak)(),name:a,labelCss:s,inputCss:l,label:c="",checked:u,value:v,disabled:h=false,onChange:f,onBlur:g,isIndeterminate:_=false}=e;var m=e=>{f===null||f===void 0?void 0:f(!_?e.target.checked:true,e)};var b=e=>{if(typeof e==="string"){return e}if(typeof e==="number"||typeof e==="boolean"||e===null){return String(e)}if(e===undefined){return""}if(/*#__PURE__*/p().isValidElement(e)){var t;var n=(t=e.props)===null||t===void 0?void 0:t.children;if(typeof n==="string"){return n}if(Array.isArray(n)){return n.map(e=>typeof e==="string"?e:"").filter(Boolean).join(" ")}}return""};return/*#__PURE__*/(0,o/* .jsxs */.FD)("label",{htmlFor:n,css:[y.container({disabled:h}),s],children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},e),{ref:t,id:n,name:a,type:"checkbox",value:v,checked:!!u,disabled:h,"aria-invalid":e["aria-invalid"],onChange:m,onBlur:g,css:[l,y.checkbox({label:!!c,isIndeterminate:_,disabled:h})]})),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{}),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{css:[y.label({isDisabled:h}),s],title:b(c),children:c})]})});var y={container:e=>{var{disabled:t=false}=e;return/*#__PURE__*/(0,c/* .css */.AH)("position:relative;display:flex;align-items:center;cursor:pointer;user-select:none;color:",s/* .colorTokens.text.title */.I6.text.title,";",t&&(0,c/* .css */.AH)(v()))},label:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,c/* .css */.AH)(l/* .typography.caption */.I.caption(),";color:",s/* .colorTokens.text.title */.I6.text.title,";",t&&(0,c/* .css */.AH)(h(),s/* .colorTokens.text.disable */.I6.text.disable))},checkbox:e=>{var{label:t,isIndeterminate:n,disabled:r}=e;return/*#__PURE__*/(0,c/* .css */.AH)("position:absolute;opacity:0 !important;height:0;width:0;& + span{position:relative;cursor:pointer;display:inline-flex;align-items:center;",t&&(0,c/* .css */.AH)(f(),s/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';background-color:",s/* .colorTokens.background.white */.I6.background.white,";border:1px solid ",s/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:3px;width:20px;height:20px;}&:checked + span::before{background-image:url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjE2NTM0NCA0Ljg5OTQ2QzAuMTEzMjM1IDQuODQ0OTcgMC4wNzE3MzQ2IDQuNzgxMTUgMC4wNDI5ODg3IDQuNzExM0MtMC4wMTQzMjk2IDQuNTU1NjQgLTAuMDE0MzI5NiA0LjM4NDQ5IDAuMDQyOTg4NyA0LjIyODg0QzAuMDcxMTU0OSA0LjE1ODY4IDAuMTEyNzIzIDQuMDk0NzUgMC4xNjUzNDQgNC4wNDA2OEwxLjAzMzgyIDMuMjAzNkMxLjA4NDkzIDMuMTQzNCAxLjE0ODkgMy4wOTU1NyAxLjIyMDk2IDMuMDYzNjlDMS4yOTAzMiAzLjAzMjEzIDEuMzY1NTQgMy4wMTU2OSAxLjQ0MTY3IDMuMDE1NDRDMS41MjQxOCAzLjAxMzgzIDEuNjA2MDUgMy4wMzAyOSAxLjY4MTU5IDMuMDYzNjlDMS43NTYyNiAzLjA5NzA3IDEuODIzODYgMy4xNDQ1NyAxLjg4MDcxIDMuMjAzNkw0LjUwMDU1IDUuODQyNjhMMTAuMTI0MSAwLjE4ODIwNUMxMC4xNzk0IDAuMTI5NTQ0IDEwLjI0NTQgMC4wODIwNTQyIDEwLjMxODQgMC4wNDgyOTA4QzEwLjM5NDEgMC4wMTU0NjYxIDEwLjQ3NTkgLTAuMDAwOTcyMDU3IDEwLjU1ODMgNC40NDIyOGUtMDVDMTAuNjM1NyAwLjAwMDQ3NTMxOCAxMC43MTIxIDAuMDE3NDc5NSAxMC43ODI0IDAuMDQ5OTI0MkMxMC44NTI3IDAuMDgyMzY4OSAxMC45MTU0IDAuMTI5NTA5IDEwLjk2NjIgMC4xODgyMDVMMTEuODM0NyAxLjAzNzM0QzExLjg4NzMgMS4wOTE0MiAxMS45Mjg4IDEuMTU1MzQgMTEuOTU3IDEuMjI1NUMxMi4wMTQzIDEuMzgxMTYgMTIuMDE0MyAxLjU1MjMxIDExLjk1NyAxLjcwNzk2QzExLjkyODMgMS43Nzc4MSAxMS44ODY4IDEuODQxNjMgMTEuODM0NyAxLjg5NjEzTDQuOTIyOCA4LjgwOTgyQzQuODcxMjkgOC44NzAyMSA0LjgwNzQ3IDguOTE4NzUgNC43MzU2NiA4Ljk1MjE1QzQuNTgyMDIgOS4wMTU5NSA0LjQwOTQ5IDkuMDE1OTUgNC4yNTU4NCA4Ljk1MjE1QzQuMTg0MDQgOC45MTg3NSA0LjEyMDIyIDguODcwMjEgNC4wNjg3MSA4LjgwOTgyTDAuMTY1MzQ0IDQuODk5NDZaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');background-repeat:no-repeat;background-size:10px 10px;background-position:center center;border-color:transparent;background-color:",s/* .colorTokens.icon.brand */.I6.icon.brand,";border-radius:",s/* .borderRadius["4"] */.Vq["4"],";",r&&(0,c/* .css */.AH)(g(),s/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"]),"}",n&&(0,c/* .css */.AH)(_(),s/* .colorTokens.brand.blue */.I6.brand.blue,s/* .colorTokens.stroke.white */.I6.stroke.white)," ",r&&(0,c/* .css */.AH)(m(),s/* .colorTokens.stroke.disable */.I6.stroke.disable),"    &:focus-visible{& + span{border-radius:",s/* .borderRadius["2"] */.Vq["2"],";outline:2px solid ",s/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")}};/* export default */const w=b},2971:function(e,t,n){n.d(t,{A:()=>y});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(3771);/* import */var d=/*#__PURE__*/n.n(l);/* import */var c=n(42338);/* import */var u=n(90209);/* import */var p=n(10840);/* import */var v=n(24219);/* import */var h=n(84133);/* import */var f=n(76017);function g(){var e=(0,r._)(["\n      width: 168px;\n    "]);g=function t(){return e};return e}function _(){var e=(0,r._)(["\n      width: 168px;\n    "]);_=function t(){return e};return e}var m={large:"regular",regular:"small",small:"small"};var b=e=>{var{buttonText:t=(0,o.__)("Upload Media","tutor"),infoText:n,size:r="regular",value:s,uploadHandler:l,clearHandler:d,emptyImageCss:v,previewImageCss:g,overlayCss:_,replaceButtonText:b,loading:y,disabled:x=false,isClearAble:A=true}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:!y,fallback:/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:w.emptyMedia({size:r,isDisabled:x}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(f/* .LoadingOverlay */.p8,{})}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:s===null||s===void 0?void 0:s.url,fallback:/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{"aria-disabled":x,css:[w.emptyMedia({size:r,isDisabled:x}),v],onClick:e=>{e.stopPropagation();if(x){return}l()},onKeyDown:e=>{if(!x&&e.key==="Enter"){e.preventDefault();l()}},children:[/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:"addImage",width:32,height:32}),/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{disabled:x,size:m[r],variant:"secondary",buttonContentCss:w.buttonText,"data-cy":"upload-media",children:t}),/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:w.infoTexts,children:n})})]}),children:e=>{return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[w.previewWrapper({size:r,isDisabled:x}),g],"data-cy":"media-preview",children:[/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:e,alt:s===null||s===void 0?void 0:s.title,css:w.imagePreview}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[w.hoverPreview,_],"data-hover-buttons-wrapper":true,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{disabled:x,variant:"secondary",size:m[r],buttonCss:/*#__PURE__*/(0,a/* .css */.AH)("margin-top:",A&&p/* .spacing["16"] */.YK["16"],";"),onClick:e=>{e.stopPropagation();l()},"data-cy":"replace-media",children:b||(0,o.__)("Replace Image","tutor")}),/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:A,children:/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{disabled:x,variant:"text",size:m[r],onClick:e=>{e.stopPropagation();d()},"data-cy":"clear-media",children:(0,o.__)("Remove","tutor")})})]})]})}})})};/* export default */const y=b;var w={emptyMedia:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,a/* .css */.AH)("width:100%;height:168px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",p/* .spacing["8"] */.YK["8"],";border:1px dashed ",p/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",p/* .borderRadius["8"] */.Vq["8"],";background-color:",p/* .colorTokens.bg.white */.I6.bg.white,";overflow:hidden;cursor:",n?"not-allowed":"pointer",";",t==="small"&&(0,a/* .css */.AH)(g()),"    svg{color:",p/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover svg{color:",!n&&p/* .colorTokens.brand.blue */.I6.brand.blue,";}")},buttonText:/*#__PURE__*/(0,a/* .css */.AH)("color:",p/* .colorTokens.text.brand */.I6.text.brand,";"),infoTexts:/*#__PURE__*/(0,a/* .css */.AH)(v/* .typography.tiny */.I.tiny(),";color:",p/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;"),previewWrapper:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,a/* .css */.AH)("width:100%;height:168px;border:1px solid ",p/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",p/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;position:relative;background-color:",p/* .colorTokens.bg.white */.I6.bg.white,";",t==="small"&&(0,a/* .css */.AH)(_()),"    &:hover{[data-hover-buttons-wrapper]{display:",n?"none":"flex",";opacity:",n?0:1,";}}")},imagePreview:/*#__PURE__*/(0,a/* .css */.AH)("height:100%;width:100%;object-fit:contain;"),hoverPreview:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;justify-content:center;align-items:center;gap:",p/* .spacing["8"] */.YK["8"],";opacity:0;position:absolute;inset:0;background-color:",d()(p/* .colorTokens.color.black.main */.I6.color.black.main,.6),";button:first-of-type{box-shadow:",p/* .shadow.button */.r7.button,";}button:last-of-type:not(:only-of-type){color:",p/* .colorTokens.text.white */.I6.text.white,";box-shadow:none;}")}},91196:function(e,t,n){n.d(t,{A:()=>h});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(10840);/* import */var s=n(84133);/* import */var l=n(51298);/* import */var d=n(90209);function c(){var e=(0,r._)(["\n      height: ",";\n      display: inline-flex;\n      border-radius: ",";\n      align-items: center;\n      gap: ",";\n      overflow: hidden;\n      background: linear-gradient(88.9deg, #d65702 6.26%, #e5803c 91.4%);\n    "]);c=function t(){return e};return e}function u(){var e=(0,r._)(["\n        padding: 0;\n        padding-inline: ",";\n        margin: 0;\n      "]);u=function t(){return e};return e}function p(){var e=(0,r._)(["\n      display: inline-flex;\n      position: static;\n      transform: none;\n      padding: ",";\n      color: ",";\n      margin-right: ",";\n      font-size: ",";\n      line-height: ",";\n\n      ","\n    "]);p=function t(){return e};return e}var v=e=>{var{children:t,content:n,size:r="regular",textOnly:a}=e;return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:g.wrapper({hasChildren:(0,l/* .isDefined */.O9)(t),size:r}),children:[t,/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{when:!(0,l/* .isDefined */.O9)(t)&&!a,children:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:f[r].iconSize,height:f[r].iconSize})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:g.content({hasChildren:(0,l/* .isDefined */.O9)(t),size:r,textOnly:a}),children:(0,l/* .isDefined */.O9)(t)?/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:r==="tiny"?f[r].iconSize:16}):n})]})};/* export default */const h=v;var f={tiny:{borderRadius:o/* .spacing["10"] */.YK["10"],height:o/* .spacing["10"] */.YK["10"],gap:o/* .spacing["2"] */.YK["2"],iconSize:10,fontSize:"0.5rem",lineHeight:"0.625rem"},small:{borderRadius:o/* .spacing["16"] */.YK["16"],height:o/* .spacing["16"] */.YK["16"],gap:o/* .spacing["4"] */.YK["4"],iconSize:16,fontSize:o/* .fontSize["10"] */.J["10"],lineHeight:o/* .lineHeight["16"] */.K_["16"]},regular:{borderRadius:"22px",height:"22px",gap:"5px",iconSize:22,fontSize:o/* .fontSize["14"] */.J["14"],lineHeight:o/* .lineHeight["18"] */.K_["18"]},large:{borderRadius:"26px",height:"26px",gap:o/* .spacing["6"] */.YK["6"],iconSize:26,fontSize:o/* .fontSize["16"] */.J["16"],lineHeight:o/* .lineHeight["26"] */.K_["26"]}};var g={wrapper:e=>{var{hasChildren:t,size:n="regular"}=e;return/*#__PURE__*/(0,a/* .css */.AH)("position:relative;svg{flex-shrink:0;}",!t&&(0,a/* .css */.AH)(c(),f[n].height,f[n].borderRadius,f[n].gap))},content:e=>{var{hasChildren:t,size:n="regular",textOnly:r}=e;return/*#__PURE__*/(0,a/* .css */.AH)("position:absolute;top:0;right:0;display:flex;flex-shrink:0;transform:translateX(50%) translateY(-50%);",!t&&(0,a/* .css */.AH)(p(),o/* .spacing["2"] */.YK["2"],o/* .colorTokens.icon.white */.I6.icon.white,f[n].gap,f[n].fontSize,f[n].lineHeight,r&&(0,a/* .css */.AH)(u(),o/* .spacing["6"] */.YK["6"])))}}},99689:function(e,t,n){n.d(t,{A:()=>g});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(41594);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(10840);/* import */var d=n(24219);/* import */var c=n(36154);/* import */var u=n(85713);function p(){var e=(0,r._)(["\n      color: ",";\n    "]);p=function t(){return e};return e}function v(){var e=(0,r._)(["\n        margin-right: ",";\n      "]);v=function t(){return e};return e}var h=/*#__PURE__*/s().forwardRef((e,t)=>{var{name:n,checked:r,readOnly:a,disabled:o=false,labelCss:s,label:l,icon:d,value:c,onChange:p,onBlur:v,description:h}=e;var g=(0,u/* .nanoid */.Ak)();return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:f.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("label",{htmlFor:g,css:[f.container(o),s],children:[/*#__PURE__*/(0,i/* .jsx */.Y)("input",{ref:t,id:g,name:n,type:"radio",checked:r,readOnly:a,value:c,disabled:o,onChange:p,onBlur:v,css:[f.radio(l)]}),/*#__PURE__*/(0,i/* .jsx */.Y)("span",{}),d,l]}),h&&/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:f.description,children:h})]})});var f={wrapper:/*#__PURE__*/(0,a/* .css */.AH)(c/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",l/* .spacing["8"] */.YK["8"],";"),container:e=>/*#__PURE__*/(0,a/* .css */.AH)(d/* .typography.caption */.I.caption(),";display:flex;align-items:center;cursor:pointer;user-select:none;",e&&(0,a/* .css */.AH)(p(),l/* .colorTokens.text.disable */.I6.text.disable)),radio:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/*#__PURE__*/(0,a/* .css */.AH)("position:absolute;opacity:0;height:0;width:0;cursor:pointer;& + span{position:relative;cursor:pointer;height:18px;width:18px;background-color:",l/* .colorTokens.background.white */.I6.background.white,";border:2px solid ",l/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:100%;",e&&(0,a/* .css */.AH)(v(),l/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';position:absolute;left:3px;top:3px;background-color:",l/* .colorTokens.background.white */.I6.background.white,";width:8px;height:8px;border-radius:100%;}&:checked + span{border-color:",l/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";}&:checked + span::before{background-color:",l/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";}&:focus-visible{& + span{outline:2px solid ",l/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")},description:/*#__PURE__*/(0,a/* .css */.AH)(d/* .typography.small */.I.small(),";color:",l/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;")};/* export default */const g=h},45257:function(e,t,n){n.d(t,{w:()=>d});/* import */var r=n(2445);/* import */var i=n(10840);/* import */var a=n(63939);/* import */var o=n(17437);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);var d=/*#__PURE__*/l().forwardRef((e,t)=>{var{className:n,variant:i}=e;return/*#__PURE__*/(0,r/* .jsx */.Y)("div",{className:n,ref:t,css:u({variant:i})})});d.displayName="Separator";var c={horizontal:/*#__PURE__*/(0,o/* .css */.AH)("height:1px;width:100%;"),vertical:/*#__PURE__*/(0,o/* .css */.AH)("height:100%;width:1px;"),base:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;background-color:",i/* .colorTokens.stroke.divider */.I6.stroke.divider,";")};var u=(0,a/* .createVariation */.s)({variants:{variant:{horizontal:c.horizontal,vertical:c.vertical}},defaultVariants:{variant:"horizontal"}},c.base)},52664:function(e,t,n){n.d(t,{A:()=>x});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(41594);/* import */var d=/*#__PURE__*/n.n(l);/* import */var c=n(4892);/* import */var u=n(95729);/* import */var p=n(10840);/* import */var v=n(36154);/* import */var h=n(85713);function f(){var e=(0,r._)(["\n        ","\n      "]);f=function t(){return e};return e}function g(){var e=(0,r._)(["\n        border-top-right-radius: ",";\n      "]);g=function t(){return e};return e}function _(){var e=(0,r._)(["\n          ","\n        "]);_=function t(){return e};return e}function m(){var e=(0,r._)(["\n      .mce-tinymce.mce-container {\n        border: ",";\n        border-radius: ",";\n\n        ","\n      }\n    "]);m=function t(){return e};return e}var b=!!c/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;// Without getDefaultSettings function editor does not initiate
if(!window.wp.editor.getDefaultSettings){window.wp.editor.getDefaultSettings=()=>({})}function y(e,t,n,r,i,a,s,l,d,u,p,v,h){var f=v!==null&&v!==void 0?v:r?"bold italic underline | image | ".concat(b?"codesample":""):"formatselect bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | wp_more ".concat(b?" codesample":""," | wp_adv");var g=h!==null&&h!==void 0?h:"strikethrough hr | forecolor pastetext removeformat | charmap | outdent indent | undo redo | wp_help | fullscreen | tutor_button | undoRedoDropdown";f=p?f:f.replaceAll(" | "," ");return{tinymce:{wpautop:true,menubar:false,autoresize_min_height:d||200,autoresize_max_height:u||500,wp_autoresize_on:true,browser_spellcheck:!l,convert_urls:false,end_container_on_empty_block:true,entities:"38,amp,60,lt,62,gt",entity_encoding:"raw",fix_list_elements:true,indent:false,relative_urls:0,remove_script_host:0,plugins:"charmap,colorpicker,hr,lists,image,media,paste,tabfocus,textcolor,fullscreen,wordpress,wpautoresize,wpeditimage,wpemoji,wpgallery,wplink,wpdialogs,wptextpattern,wpview".concat(b?",codesample":""),skin:"light",skin_url:"".concat(c/* .tutorConfig.site_url */.P.site_url,"/wp-content/plugins/tutor/assets/lib/tinymce/light"),submit_patch:true,link_context_toolbar:false,theme:"modern",toolbar:!l,toolbar1:f,toolbar2:r?false:g,content_css:"".concat(c/* .tutorConfig.site_url */.P.site_url,"/wp-includes/css/dashicons.min.css,").concat(c/* .tutorConfig.site_url */.P.site_url,"/wp-includes/js/tinymce/skins/wordpress/wp-content.css,").concat(c/* .tutorConfig.site_url */.P.site_url,"/wp-content/plugins/tutor/assets/lib/tinymce/light/content.min.css"),statusbar:!l,branding:false,// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup:i=>{i.on("init",()=>{if(e&&!l){i.getBody().focus()}if(l){i.setMode("readonly");var t=i.contentDocument.querySelector(".mce-content-body");t.style.backgroundColor="transparent";setTimeout(()=>{var e=t.scrollHeight;if(e){i.iframeElement.style.height="".concat(e,"px")}},500)}});if(!r){i.addButton("tutor_button",{text:(0,o.__)("Tutor ShortCode","tutor"),icon:false,type:"menubutton",menu:[{text:(0,o.__)("Student Registration Form","tutor"),onclick:()=>{i.insertContent("[tutor_student_registration_form]")}},{text:(0,o.__)("Instructor Registration Form","tutor"),onclick:()=>{i.insertContent("[tutor_instructor_registration_form]")}},{text:(0,o.__)("Courses","tutor"),onclick:()=>{i.windowManager.open({title:(0,o.__)("Courses Shortcode","tutor"),body:[{type:"textbox",name:"id",label:(0,o.__)("Course id, separate by (,) comma","tutor"),value:""},{type:"textbox",name:"exclude_ids",label:(0,o.__)("Exclude Course IDS","tutor"),value:""},{type:"textbox",name:"category",label:(0,o.__)("Category IDS","tutor"),value:""},{type:"listbox",name:"orderby",label:(0,o.__)("Order By","tutor"),onselect:()=>{},values:[{text:"ID",value:"ID"},{text:"title",value:"title"},{text:"rand",value:"rand"},{text:"date",value:"date"},{text:"menu_order",value:"menu_order"},{text:"post__in",value:"post__in"}]},{type:"listbox",name:"order",label:(0,o.__)("Order","tutor"),onselect:()=>{},values:[{text:"DESC",value:"DESC"},{text:"ASC",value:"ASC"}]},{type:"textbox",name:"count",label:(0,o.__)("Count","tutor"),value:"6"}],// eslint-disable-next-line @typescript-eslint/no-explicit-any
onsubmit:e=>{i.insertContent('[tutor_course id="'.concat(e.data.id,'" exclude_ids="').concat(e.data.exclude_ids,'" category="').concat(e.data.category,'" orderby="').concat(e.data.orderby,'" order="').concat(e.data.order,'" count="').concat(e.data.count,'"]'))}})}}]})}i.on("change keyup paste",()=>{t(i.getContent())});i.on("focus",()=>{n(true)});i.on("blur",()=>n(false));i.on("FullscreenStateChanged",e=>{var t=document.getElementById("tutor-course-builder");var n=document.getElementById("tutor-course-bundle-builder-root");var r=t||n;if(r){if(e.state){r.style.position="relative";r.style.zIndex="100000"}else{r.removeAttribute("style")}}s===null||s===void 0?void 0:s(e.state)})},wp_keep_scroll_position:false,wpeditimage_html5_captions:true},mediaButtons:!i&&!r&&!l,drag_drop_upload:true,quicktags:a||r||l?false:{buttons:["strong","em","block","del","ins","img","ul","ol","li","code","more","close"]}}}var w=e=>{var{value:t="",onChange:n,isMinimal:r,hideMediaButtons:a,hideQuickTags:o,autoFocus:s=false,onFullScreenChange:d,readonly:c=false,min_height:p,max_height:v,toolbar1:f,toolbar2:g}=e;var _=(0,l.useRef)(null);var{current:m}=(0,l.useRef)((0,h/* .nanoid */.Ak)());var[b,w]=(0,l.useState)(s);var x=e=>{var t=e.target;n(t.value)};var Y=(0,l.useCallback)(e=>{var{tinymce:t}=window;if(!t||b){return}var n=window.tinymce.get(m);if(n){if(e!==n.getContent()){n.setContent(e)}}},[m,b]);(0,l.useEffect)(()=>{Y(t);// eslint-disable-next-line react-hooks/exhaustive-deps
},[t]);(0,l.useEffect)(()=>{if(typeof window.wp!=="undefined"&&window.wp.editor){window.wp.editor.remove(m);window.wp.editor.initialize(m,y(b,n,w,r,a,o,d,c,p,v,u/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile,f,g));var e=_.current;e===null||e===void 0?void 0:e.addEventListener("change",x);e===null||e===void 0?void 0:e.addEventListener("input",x);return()=>{window.wp.editor.remove(m);e===null||e===void 0?void 0:e.removeEventListener("change",x);e===null||e===void 0?void 0:e.removeEventListener("input",x)}}// eslint-disable-next-line react-hooks/exhaustive-deps
},[c]);return/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:A.wrapper({hideQuickTags:o,isMinimal:r,isFocused:b,isReadOnly:c}),children:/*#__PURE__*/(0,i/* .jsx */.Y)("textarea",{"data-cy":"tutor-tinymce",ref:_,id:m,defaultValue:t})})};/* export default */const x=w;var A={wrapper:e=>{var{hideQuickTags:t,isMinimal:n,isFocused:r,isReadOnly:i}=e;return/*#__PURE__*/(0,a/* .css */.AH)("flex:1;.wp-editor-tools{z-index:auto;}.wp-editor-container{border-top-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",p/* .borderRadius["6"] */.Vq["6"],";",r&&!i&&(0,a/* .css */.AH)(f(),v/* .styleUtils.inputFocus */.x.inputFocus),":focus-within{",!i&&v/* .styleUtils.inputFocus */.x.inputFocus,"}}.wp-switch-editor{height:auto;border:1px solid #dcdcde;border-radius:0px;border-top-left-radius:",p/* .borderRadius["4"] */.Vq["4"],";border-top-right-radius:",p/* .borderRadius["4"] */.Vq["4"],";top:2px;padding:3px 8px 4px;font-size:13px;color:#646970;&:focus,&:active,&:hover{background:#f0f0f1;color:#646970;}}.mce-btn button{&:focus,&:active,&:hover{background:none;color:#50575e;}}.mce-toolbar-grp,.quicktags-toolbar{border-top-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";",(t||n)&&(0,a/* .css */.AH)(g(),p/* .borderRadius["6"] */.Vq["6"]),"}.mce-top-part::before{display:none;}.mce-statusbar{border-bottom-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",p/* .borderRadius["6"] */.Vq["6"],";}.mce-tinymce{box-shadow:none;background-color:transparent;}.mce-edit-area{background-color:unset;}",(t||n)&&(0,a/* .css */.AH)(m(),!i?"1px solid ".concat(p/* .colorTokens.stroke["default"] */.I6.stroke["default"]):"none",p/* .borderRadius["6"] */.Vq["6"],r&&!i&&(0,a/* .css */.AH)(_(),v/* .styleUtils.inputFocus */.x.inputFocus)),"    textarea{visibility:visible !important;width:100%;resize:none;border:none;outline:none;padding:",p/* .spacing["10"] */.YK["10"],";}")}}},79489:function(e,t,n){n.d(t,{A:()=>f});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(2445);/* import */var s=n(52117);/* import */var l=n(10840);/* import */var d=n(24219);/* import */var c=n(17437);/* import */var u=n(90209);/* import */var p=n(92229);/* import */var v=n(66279);var h=e=>{var{field:t,fieldState:n,disabled:l,value:d,onChange:c,label:h,description:f,helpText:_,isHidden:m,labelCss:b}=e;return/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{field:t,fieldState:n,isHidden:m,children:e=>{var{css:n}=e,v=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:g.wrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,(0,i._)((0,r._)({},t,v),{inputCss:n,labelCss:b,value:d,disabled:l,checked:t.value,label:h,onChange:()=>{t.onChange(!t.value);if(c){c(!t.value)}}})),_&&/*#__PURE__*/(0,o/* .jsx */.Y)(p/* ["default"] */.A,{content:_,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,o/* .jsx */.Y)(u/* ["default"] */.A,{name:"info",width:20,height:20})})]}),f&&/*#__PURE__*/(0,o/* .jsx */.Y)("p",{css:g.description,children:f})]})}})};/* export default */const f=h;var g={wrapper:/*#__PURE__*/(0,c/* .css */.AH)("display:flex;align-items:center;gap:",l/* .spacing["6"] */.YK["6"],";& > div{display:flex;color:",l/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),description:/*#__PURE__*/(0,c/* .css */.AH)(d/* .typography.small */.I.small(),"    color:",l/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;margin-top:",l/* .spacing["6"] */.YK["6"],";")}},31108:function(e,t,n){n.d(t,{A:()=>D});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(2445);/* import */var s=n(17437);/* import */var l=n(12470);/* import */var d=/*#__PURE__*/n.n(l);/* import */var c=n(86828);/* import */var u=n(53429);/* import */var p=n(41594);/* import */var v=/*#__PURE__*/n.n(p);/* import */var h=n(5170);/* import */var f=n(42338);/* import */var g=n(90209);/* import */var _=n(95729);/* import */var m=n(10840);/* import */var b=n(24219);/* import */var y=n(94654);/* import */var w=n(36154);/* import */var x=n(66279);/* import */var A=n(99972);// Create DayPicker formatters based on WordPress locale
var Y=()=>{if(typeof window==="undefined"||!window.wp||!window.wp.date){return}var{format:e}=wp.date;return{formatMonthDropdown:t=>e("F",t),formatMonthCaption:t=>e("F",t),formatCaption:t=>e("F",t),formatWeekdayName:t=>e("D",t)}};var k=e=>{if(!e)return undefined;return(0,c["default"])(new Date(e))?new Date(e.length===10?e+"T00:00:00":e):undefined};var I=e=>{var{label:t,field:n,fieldState:s,disabled:d,disabledBefore:c,disabledAfter:v,loading:m,placeholder:b,helpText:A,isClearable:I=true,onChange:D,dateFormat:E=_/* .DateFormats.monthDayYear */.UA.monthDayYear}=e;var q=(0,p.useRef)(null);var[T,S]=(0,p.useState)(false);var M=k(n.value);var H=typeof window!=="undefined"&&window.wp&&window.wp.date;var z=M?H?window.wp.date.format("F j, Y",M):(0,u["default"])(M,E):"";var{triggerRef:K,position:O,popoverRef:F}=(0,y/* .usePortalPopover */.tP)({isOpen:T,placement:y/* .POPOVER_PLACEMENTS.BOTTOM_LEFT */.zA.BOTTOM_LEFT});var P=()=>{var e;S(false);(e=q.current)===null||e===void 0?void 0:e.focus()};var W=k(c);var N=k(v);return/*#__PURE__*/(0,o/* .jsx */.Y)(x/* ["default"] */.A,{label:t,field:n,fieldState:s,disabled:d,loading:m,placeholder:b,helpText:A,children:e=>{var{css:t}=e,s=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:C.wrapper,ref:K,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{css:[t,C.input],title:z,ref:e=>{n.ref(e);// @ts-ignore
q.current=e},type:"text",value:z,onClick:e=>{e.stopPropagation();S(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();S(e=>!e)}},autoComplete:"off","data-input":true})),/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{name:"calendarLine",width:30,height:32,style:C.icon}),I&&n.value&&/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{isIconOnly:true,"aria-label":(0,l.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:w/* .styleUtils.inputClearButton */.x.inputClearButton,onClick:()=>{n.onChange("")},icon:/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(y/* .Portal */.ZL,{isOpen:T,onClickOutside:P,onEscape:P,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:C.pickerWrapper,style:{left:O.left,top:O.top},ref:F,children:/*#__PURE__*/(0,o/* .jsx */.Y)(h/* .DayPicker */.h,{dir:_/* .isRTL */.V8?"rtl":"ltr",animate:true,mode:"single",formatters:Y(),disabled:[!!W&&{before:W},!!N&&{after:N}],selected:M,onSelect:e=>{if(e){var t=(0,u["default"])(e,_/* .DateFormats.yearMonthDay */.UA.yearMonthDay);n.onChange(t);P();if(D){D(t)}}},showOutsideDays:true,captionLayout:"dropdown",autoFocus:true,defaultMonth:M||new Date,startMonth:W||new Date(new Date().getFullYear()-10,0),endMonth:N||new Date(new Date().getFullYear()+10,11),weekStartsOn:H?window.wp.date.getSettings().l10n.startOfWeek:0})})})]})}})};/* export default */const D=I;var C={wrapper:/*#__PURE__*/(0,s/* .css */.AH)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,s/* .css */.AH)("&[data-input]{padding-left:",m/* .spacing["40"] */.YK["40"],";}"),icon:/*#__PURE__*/(0,s/* .css */.AH)("position:absolute;top:50%;left:",m/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",m/* .colorTokens.icon["default"] */.I6.icon["default"],";"),pickerWrapper:/*#__PURE__*/(0,s/* .css */.AH)(b/* .typography.body */.I.body("regular"),";position:absolute;background-color:",m/* .colorTokens.background.white */.I6.background.white,";box-shadow:",m/* .shadow.popover */.r7.popover,";border-radius:",m/* .borderRadius["6"] */.Vq["6"],";.rdp-root{--rdp-day-height:40px;--rdp-day-width:40px;--rdp-day_button-height:40px;--rdp-day_button-width:40px;--rdp-nav-height:40px;--rdp-today-color:",m/* .colorTokens.text.title */.I6.text.title,";--rdp-caption-font-size:",m/* .fontSize["18"] */.J["18"],";--rdp-accent-color:",m/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";--rdp-background-color:",m/* .colorTokens.background.hover */.I6.background.hover,";--rdp-accent-color-dark:",m/* .colorTokens.action.primary.active */.I6.action.primary.active,";--rdp-background-color-dark:",m/* .colorTokens.action.primary.hover */.I6.action.primary.hover,";--rdp-selected-color:",m/* .colorTokens.text.white */.I6.text.white,";--rdp-day_button-border-radius:",m/* .borderRadius.circle */.Vq.circle,";--rdp-outside-opacity:0.5;--rdp-disabled-opacity:0.25;}.rdp-months{margin:",m/* .spacing["16"] */.YK["16"],";}.rdp-month_grid{margin:0px;}.rdp-day{padding:0px;}.rdp-nav{--rdp-accent-color:",m/* .colorTokens.text.primary */.I6.text.primary,";button{border-radius:",m/* .borderRadius.circle */.Vq.circle,";&:hover,&:focus,&:active{background-color:",m/* .colorTokens.background.hover */.I6.background.hover,";color:",m/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible:not(:disabled){--rdp-accent-color:",m/* .colorTokens.text.white */.I6.text.white,";background-color:",m/* .colorTokens.background.brand */.I6.background.brand,";}}}.rdp-dropdown_root{.rdp-caption_label{padding:",m/* .spacing["8"] */.YK["8"],";}}.rdp-today{.rdp-day_button{font-weight:",m/* .fontWeight.bold */.Wy.bold,";}}.rdp-selected{color:var(--rdp-selected-color);background-color:var(--rdp-accent-color);border-radius:",m/* .borderRadius.circle */.Vq.circle,";font-weight:",m/* .fontWeight.regular */.Wy.regular,";.rdp-day_button{&:hover,&:focus,&:active{background-color:var(--rdp-accent-color);color:",m/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible{outline:2px solid var(--rdp-accent-color);outline-offset:2px;}&:not(.rdp-outside){color:var(--rdp-selected-color);}}}.rdp-day_button{&:hover,&:focus,&:active{background-color:var(--rdp-background-color);color:",m/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible:not([disabled]){color:var(--rdp-selected-color);opacity:1;background-color:var(--rdp-accent-color);}}")}},10878:function(e,t,n){n.d(t,{A:()=>A});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(42338);/* import */var d=n(90209);/* import */var c=n(66279);/* import */var u=n(10840);/* import */var p=n(24219);/* import */var v=n(8501);/* import */var h=n(84133);/* import */var f=n(85123);/* import */var g=n(35804);/* import */var _=n(36154);function m(){var e=(0,r._)(["\n      background-color: ",";\n      padding: "," 0 "," ",";\n      border: 1px solid ",";\n      border-radius: ",";\n      gap: ",";\n    "]);m=function t(){return e};return e}function b(){var e=(0,r._)(["\n      margin-right: ",";\n    "]);b=function t(){return e};return e}var y={iso:["iso"],dwg:["dwg"],pdf:["pdf"],doc:["doc","docx"],csv:["csv"],xls:["xls","xlsx"],ppt:["ppt","pptx"],zip:["zip"],archive:["rar","7z","tar","gz"],txt:["txt"],rtf:["rtf"],text:["log"],jpg:["jpg"],png:["png"],image:["jpeg","gif","webp","avif"],mp3:["mp3"],fla:["fla"],audio:["ogg","wav","wma"],mp4:["mp4"],avi:["avi"],ai:["ai"],videoFile:["mkv","mpeg","flv","mov","wmv"],svg:["svg"],css:["css"],javascript:["js"],xml:["xml"],html:["html"],exe:["exe"],psd:["psd"],jsonFile:["json"],dbf:["dbf"]};var w=e=>{for(var[t,n]of Object.entries(y)){if(n.includes(e)){return t}}return"file"};var x=e=>{var{field:t,fieldState:n,label:r,helpText:a,buttonText:s=(0,o.__)("Upload Media","tutor"),selectMultiple:u=false,onChange:p,maxFileSize:f,maxFiles:m}=e;var b=t.value;var{openMediaLibrary:y,resetFiles:x}=(0,g/* ["default"] */.A)({options:{multiple:u,maxFiles:m,maxFileSize:f},onChange:e=>{t.onChange(e);if(p){p(e)}},initialFiles:b?Array.isArray(b)?b:[b]:[]});var A=()=>{y()};var k=e=>{x();if(u){var n=(Array.isArray(b)?b:b?[b]:[]).filter(t=>t.id!==e);t.onChange(n.length>0?n:null);if(p){p(n.length>0?n:null)}}else{t.onChange(null);if(p){p(null)}}};return/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{label:r,field:t,fieldState:n,helpText:a,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{when:b,fallback:/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{buttonCss:Y.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:A,children:s}),children:e=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:Y.wrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:Y.attachmentsWrapper,children:/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{each:Array.isArray(e)?e:[e],children:e=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:Y.attachmentCardWrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:Y.attachmentCard,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{style:Y.fileIcon,name:w(e.ext||"file"),height:40,width:40}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:Y.attachmentCardBody,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:Y.attachmentCardTitle,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{title:e.title,css:_/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:e.title}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:Y.fileExtension,children:".".concat(e.ext)})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:Y.attachmentCardSubtitle,children:/*#__PURE__*/(0,i/* .jsx */.Y)("span",{children:"".concat((0,o.__)("Size","tutor"),": ").concat(e.size)})})]})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("button",{type:"button",css:Y.removeButton,onClick:()=>{k(e.id)},children:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:"cross",height:24,width:24})})]},e.id)})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:Y.uploadButtonWrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{buttonCss:Y.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:A,"data-cy":"upload-media",children:s})})]})})}})};/* export default */const A=(0,f/* .withVisibilityControl */.M)(x);var Y={wrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;position:relative;",t&&(0,a/* .css */.AH)(m(),u/* .colorTokens.background.white */.I6.background.white,u/* .spacing["16"] */.YK["16"],u/* .spacing["16"] */.YK["16"],u/* .spacing["16"] */.YK["16"],u/* .colorTokens.stroke["default"] */.I6.stroke["default"],u/* .borderRadius.card */.Vq.card,u/* .spacing["8"] */.YK["8"]))},attachmentsWrapper:/*#__PURE__*/(0,a/* .css */.AH)("max-height:260px;padding-right:",u/* .spacing["16"] */.YK["16"],";",_/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),attachmentCardWrapper:/*#__PURE__*/(0,a/* .css */.AH)(_/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",u/* .spacing["20"] */.YK["20"],";padding:",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["12"] */.YK["12"]," ",u/* .spacing["4"] */.YK["4"]," 0;border-radius:",u/* .borderRadius["6"] */.Vq["6"],";button{opacity:0;}&:hover,&:focus-within{background:",u/* .colorTokens.background.hover */.I6.background.hover,";button{opacity:1;}}",u/* .Breakpoint.smallTablet */.EA.smallTablet,"{button{opacity:1;}}"),attachmentCard:/*#__PURE__*/(0,a/* .css */.AH)(_/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",u/* .spacing["8"] */.YK["8"],";overflow:hidden;"),attachmentCardBody:/*#__PURE__*/(0,a/* .css */.AH)(_/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",u/* .spacing["4"] */.YK["4"],";"),attachmentCardTitle:/*#__PURE__*/(0,a/* .css */.AH)(_/* .styleUtils.display.flex */.x.display.flex(),";",p/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),fileExtension:/*#__PURE__*/(0,a/* .css */.AH)("flex-shrink:0;"),attachmentCardSubtitle:/*#__PURE__*/(0,a/* .css */.AH)(p/* .typography.tiny */.I.tiny("regular")," ",_/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",u/* .spacing["8"] */.YK["8"],";color:",u/* .colorTokens.text.hints */.I6.text.hints,";svg{color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),uploadButtonWrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)(t&&(0,a/* .css */.AH)(b(),u/* .spacing["16"] */.YK["16"]))},uploadButton:/*#__PURE__*/(0,a/* .css */.AH)("width:100%;"),fileIcon:/*#__PURE__*/(0,a/* .css */.AH)("flex-shrink:0;color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";"),removeButton:/*#__PURE__*/(0,a/* .css */.AH)(_/* .styleUtils.crossButton */.x.crossButton,";background:none;transition:none;flex-shrink:0;")}},13095:function(e,t,n){n.d(t,{A:()=>x});/* import */var r=n(2445);/* import */var i=n(12470);/* import */var a=/*#__PURE__*/n.n(i);/* import */var o=n(2971);/* import */var s=n(90209);/* import */var l=n(39655);/* import */var d=n(1448);/* import */var c=n(85544);/* import */var u=n(6463);/* import */var p=n(4892);/* import */var v=n(85123);/* import */var h=n(35804);/* import */var f=n(47403);/* import */var g=n(99786);/* import */var _=n(66279);var m;var b=!!p/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var y=(m=p/* .tutorConfig.settings */.P.settings)===null||m===void 0?void 0:m.chatgpt_key_exist;var w=e=>{var{field:t,fieldState:n,label:a,size:p,helpText:v,buttonText:m=(0,i.__)("Upload Media","tutor"),infoText:w,onChange:x,generateWithAi:A=false,previewImageCss:Y,loading:k,onClickAiButton:I}=e;var{showModal:D}=(0,d/* .useModal */.h)();var{openMediaLibrary:C,resetFiles:E}=(0,h/* ["default"] */.A)({options:{type:"image",multiple:false},onChange:e=>{if(e&&!Array.isArray(e)){var{id:n,url:r,title:i}=e;t.onChange({id:n,url:r,title:i});if(x){x({id:n,url:r,title:i})}}},initialFiles:t.value});var q=t.value;var T=()=>{C()};var S=()=>{E();t.onChange(null);if(x){x(null)}};var M=()=>{if(!b){D({component:c/* ["default"] */.A,props:{image:g,image2x:f}})}else if(!y){D({component:u/* ["default"] */.A,props:{image:g,image2x:f}})}else{D({component:l/* ["default"] */.A,isMagicAi:true,props:{title:(0,i.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,r/* .jsx */.Y)(s/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),field:t,fieldState:n}});I===null||I===void 0?void 0:I()}};return/*#__PURE__*/(0,r/* .jsx */.Y)(_/* ["default"] */.A,{label:a,field:t,fieldState:n,helpText:v,onClickAiButton:M,generateWithAi:A,children:()=>{return/*#__PURE__*/(0,r/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,r/* .jsx */.Y)(o/* ["default"] */.A,{size:p,value:q,uploadHandler:T,clearHandler:S,buttonText:m,infoText:w,previewImageCss:Y,loading:k})})}})};/* export default */const x=(0,v/* .withVisibilityControl */.M)(w)},99281:function(e,t,n){n.d(t,{A:()=>v});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(10840);/* import */var o=n(17437);/* import */var s=n(24219);/* import */var l=n(36154);/* import */var d=n(66279);function c(){var e=(0,r._)(["\n        img {\n          border-color: ",";\n        }\n      "]);c=function t(){return e};return e}function u(){var e=(0,r._)(["\n        outline-color: ",";\n      "]);u=function t(){return e};return e}var p=e=>{var{field:t,fieldState:n,label:r,options:a=[],disabled:o}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{field:t,fieldState:n,label:r,disabled:o,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:h.wrapper,children:a.map((e,n)=>/*#__PURE__*/(0,i/* .jsxs */.FD)("button",{type:"button",css:h.item(t.value===e.value),onClick:()=>{t.onChange(e.value)},disabled:o,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:e.image,alt:e.label,width:64,height:64}),/*#__PURE__*/(0,i/* .jsx */.Y)("p",{children:e.label})]},n))})}})};/* export default */const v=p;var h={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:repeat(4,minmax(64px,1fr));gap:",a/* .spacing["12"] */.YK["12"],";margin-top:",a/* .spacing["4"] */.YK["4"],";"),item:e=>/*#__PURE__*/(0,o/* .css */.AH)(l/* .styleUtils.resetButton */.x.resetButton,";display:flex;flex-direction:column;gap:",a/* .spacing["4"] */.YK["4"],";align-items:center;width:100%;cursor:pointer;input{appearance:none;}p{",s/* .typography.small */.I.small(),";width:100%;",l/* .styleUtils.textEllipsis */.x.textEllipsis,";color:",a/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;}&:hover,&:focus-visible{",!e&&(0,o/* .css */.AH)(c(),a/* .colorTokens.stroke.hover */.I6.stroke.hover),"}img{border-radius:",a/* .borderRadius["6"] */.Vq["6"],";border:2px solid ",a/* .colorTokens.stroke.border */.I6.stroke.border,";outline:2px solid transparent;outline-offset:2px;transition:border-color 0.3s ease;",e&&(0,o/* .css */.AH)(u(),a/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi),"}")}},49201:function(e,t,n){n.d(t,{A:()=>D});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(84577);/* import */var s=n(2445);/* import */var l=n(17437);/* import */var d=n(41594);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(10840);/* import */var p=n(24219);/* import */var v=n(85123);/* import */var h=n(36154);/* import */var f=n(66279);function g(){var e=(0,o._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      box-shadow: ",";\n      background-color: ",";\n    "]);g=function t(){return e};return e}function _(){var e=(0,o._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);_=function t(){return e};return e}function m(){var e=(0,o._)(["\n        border-color: ",";\n      "]);m=function t(){return e};return e}function b(){var e=(0,o._)(["\n          padding-",": ",";\n        "]);b=function t(){return e};return e}function y(){var e=(0,o._)(["\n            padding-",": ",";\n          "]);y=function t(){return e};return e}function w(){var e=(0,o._)(["\n          font-size: ",";\n          font-weight: ",";\n          height: 34px;\n          ",";\n        "]);w=function t(){return e};return e}function x(){var e=(0,o._)(["\n      ","\n    "]);x=function t(){return e};return e}function A(){var e=(0,o._)(["\n      border-right: 1px solid ",";\n    "]);A=function t(){return e};return e}function Y(){var e=(0,o._)(["\n      ","\n    "]);Y=function t(){return e};return e}function k(){var e=(0,o._)(["\n      border-left: 1px solid ",";\n    "]);k=function t(){return e};return e}var I=e=>{var{label:t,content:n,contentPosition:o="left",showVerticalBar:l=true,size:c="regular",type:u="text",field:p,fieldState:v,disabled:h,readOnly:g,loading:_,placeholder:m,helpText:b,onChange:y,onKeyDown:w,isHidden:x,wrapperCss:A,contentCss:Y,removeBorder:k=false,selectOnFocus:I=false}=e;var D=(0,d.useRef)(null);return/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{label:t,field:p,fieldState:v,disabled:h,readOnly:g,loading:_,placeholder:m,helpText:b,isHidden:x,removeBorder:k,children:e=>{var{css:t}=e,d=(0,a._)(e,["css"]);var h;return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:[C.inputWrapper(!!v.error,k),A],children:[o==="left"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:[C.inputLeftContent(l,c),Y],children:n}),/*#__PURE__*/(0,s/* .jsx */.Y)("input",(0,i._)((0,r._)({},p,d),{type:"text",value:(h=p.value)!==null&&h!==void 0?h:"",onChange:e=>{var t=u==="number"?e.target.value.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1"):e.target.value;p.onChange(t);if(y){y(t)}},onKeyDown:e=>w===null||w===void 0?void 0:w(e.key),css:[t,C.input(o,l,c)],autoComplete:"off",ref:e=>{p.ref(e);// @ts-ignore
D.current=e;// this is not ideal but it is the only way to set ref to the input element
},onFocus:()=>{if(!I||!D.current){return}D.current.select()},"data-input":true})),o==="right"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:[C.inputRightContent(l,c),Y],children:n})]})}})};/* export default */const D=(0,v/* .withVisibilityControl */.M)(I);var C={inputWrapper:(e,t)=>/*#__PURE__*/(0,l/* .css */.AH)("display:flex;align-items:center;",!t&&(0,l/* .css */.AH)(g(),u/* .colorTokens.stroke["default"] */.I6.stroke["default"],u/* .borderRadius["6"] */.Vq["6"],u/* .shadow.input */.r7.input,u/* .colorTokens.background.white */.I6.background.white)," ",e&&(0,l/* .css */.AH)(_(),u/* .colorTokens.stroke.danger */.I6.stroke.danger,u/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail),";&:focus-within{",h/* .styleUtils.inputFocus */.x.inputFocus,";",e&&(0,l/* .css */.AH)(m(),u/* .colorTokens.stroke.danger */.I6.stroke.danger),"}"),input:(e,t,n)=>/*#__PURE__*/(0,l/* .css */.AH)("&[data-input]{",p/* .typography.body */.I.body(),";border:none;box-shadow:none;background-color:transparent;padding-",e,":0;",t&&(0,l/* .css */.AH)(b(),e,u/* .spacing["10"] */.YK["10"]),";",n==="large"&&(0,l/* .css */.AH)(w(),u/* .fontSize["24"] */.J["24"],u/* .fontWeight.medium */.Wy.medium,t&&(0,l/* .css */.AH)(y(),e,u/* .spacing["12"] */.YK["12"])),"  \n      &:focus{box-shadow:none;outline:none;}}"),inputLeftContent:(e,t)=>/*#__PURE__*/(0,l/* .css */.AH)(p/* .typography.small */.I.small()," ",h/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",u/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",u/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,l/* .css */.AH)(x(),p/* .typography.body */.I.body())," ",e&&(0,l/* .css */.AH)(A(),u/* .colorTokens.stroke["default"] */.I6.stroke["default"])),inputRightContent:(e,t)=>/*#__PURE__*/(0,l/* .css */.AH)(p/* .typography.small */.I.small()," ",h/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",u/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",u/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,l/* .css */.AH)(Y(),p/* .typography.body */.I.body())," ",e&&(0,l/* .css */.AH)(k(),u/* .colorTokens.stroke["default"] */.I6.stroke["default"]))}},91072:function(e,t,n){n.d(t,{A:()=>v});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(2445);/* import */var s=n(99689);/* import */var l=n(10840);/* import */var d=n(24219);/* import */var c=n(17437);/* import */var u=n(66279);var p=e=>{var{field:t,fieldState:n,label:l,options:d=[],disabled:c,wrapperCss:p,onSelect:v,onSelectRender:f}=e;return/*#__PURE__*/(0,o/* .jsx */.Y)(u/* ["default"] */.A,{field:t,fieldState:n,label:l,disabled:c,children:e=>{var{css:n}=e,l=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:p,children:d.map((e,a)=>/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,(0,i._)((0,r._)({},l),{inputCss:n,value:e.value,label:e.label,disabled:e.disabled||c,labelCss:e.labelCss,checked:t.value===e.value,description:e.description,onChange:()=>{t.onChange(e.value);if(v){v(e)}}})),f&&t.value===e.value&&f(e),e.legend&&/*#__PURE__*/(0,o/* .jsx */.Y)("span",{css:h.radioLegend,children:e.legend})]},a))})}})};/* export default */const v=p;var h={radioLegend:/*#__PURE__*/(0,c/* .css */.AH)("margin-left:",l/* .spacing["28"] */.YK["28"],";",d/* .typography.body */.I.body(),";color:",l/* .colorTokens.text.subdued */.I6.text.subdued,";")}},64194:function(e,t,n){n.d(t,{A:()=>m});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(10840);/* import */var o=n(24219);/* import */var s=n(68118);/* import */var l=n(36154);/* import */var d=n(85713);/* import */var c=n(17437);/* import */var u=n(41594);/* import */var p=/*#__PURE__*/n.n(u);/* import */var v=n(66279);function h(){var e=(0,r._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      padding: "," "," "," ",";\n    "]);h=function t(){return e};return e}function f(){var e=(0,r._)(["\n      background: ",";\n    "]);f=function t(){return e};return e}function g(e,t,n,r){if(!t.current){return 0}var i=t.current.getBoundingClientRect();var a=i.width;var o=e-i.left;var s=Math.max(0,Math.min(o,a));var l=s/a*100;var d=Math.floor(n+l/100*(r-n));return d}var _=e=>{var{field:t,fieldState:n,label:r,min:a=0,max:o=100,isMagicAi:l=false,hasBorder:c=false}=e;var p=(0,u.useRef)(null);var[h,f]=(0,u.useState)(t.value);var _=(0,u.useRef)(null);var m=(0,u.useRef)(null);var y=(0,s/* .useDebounce */.d)(h);(0,u.useEffect)(()=>{t.onChange(y);// eslint-disable-next-line react-hooks/exhaustive-deps
},[y,t.onChange]);(0,u.useEffect)(()=>{var e=false;var t=t=>{if(t.target!==m.current){return}e=true;document.body.style.userSelect="none"};var n=t=>{if(!e||!_.current){return}f(g(t.clientX,_,a,o))};var r=()=>{e=false;document.body.style.userSelect="auto"};window.addEventListener("mousedown",t);window.addEventListener("mousemove",n);window.addEventListener("mouseup",r);return()=>{window.removeEventListener("mousedown",t);window.removeEventListener("mousemove",n);window.removeEventListener("mouseup",r)}},[a,o]);var w=(0,u.useMemo)(()=>{return Math.floor((h-a)/(o-a)*100)},[h,a,o]);return/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{field:t,fieldState:n,label:r,isMagicAi:l,children:()=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.wrapper(c),children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.track,ref:_,onKeyDown:d/* .noop */.lQ,onClick:e=>{f(g(e.clientX,_,a,o))},children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.fill,style:{width:"".concat(w,"%")}}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.thumb(l),style:{left:"".concat(w,"%")},ref:m})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("input",{type:"text",css:b.input,value:String(h),onChange:e=>{f(Number(e.target.value))},ref:p,onFocus:()=>{var e;(e=p.current)===null||e===void 0?void 0:e.select()}})]})})};/* export default */const m=_;var b={wrapper:e=>/*#__PURE__*/(0,c/* .css */.AH)("display:grid;grid-template-columns:1fr 45px;gap:",a/* .spacing["20"] */.YK["20"],";align-items:center;",e&&(0,c/* .css */.AH)(h(),a/* .colorTokens.stroke.disable */.I6.stroke.disable,a/* .borderRadius["6"] */.Vq["6"],a/* .spacing["12"] */.YK["12"],a/* .spacing["10"] */.YK["10"],a/* .spacing["12"] */.YK["12"],a/* .spacing["16"] */.YK["16"])),track:/*#__PURE__*/(0,c/* .css */.AH)("position:relative;height:4px;background-color:",a/* .colorTokens.bg.gray20 */.I6.bg.gray20,";border-radius:",a/* .borderRadius["50"] */.Vq["50"],";width:100%;flex-shrink:0;cursor:pointer;"),fill:/*#__PURE__*/(0,c/* .css */.AH)("position:absolute;left:0;top:0;height:100%;background:",a/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";width:50%;border-radius:",a/* .borderRadius["50"] */.Vq["50"],";"),thumb:e=>/*#__PURE__*/(0,c/* .css */.AH)("position:absolute;top:50%;transform:translate(-50%,-50%);width:20px;height:20px;border-radius:",a/* .borderRadius.circle */.Vq.circle,";&::before{content:'';position:absolute;top:50%;left:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:",a/* .borderRadius.circle */.Vq.circle,";background-color:",a/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;}",e&&(0,c/* .css */.AH)(f(),a/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1)),input:/*#__PURE__*/(0,c/* .css */.AH)(o/* .typography.caption */.I.caption("medium"),";height:32px;border:1px solid ",a/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",a/* .borderRadius["6"] */.Vq["6"],";text-align:center;color:",a/* .colorTokens.text.primary */.I6.text.primary,";&:focus-visible{",l/* .styleUtils.inputFocus */.x.inputFocus,";}")}},27205:function(e,t,n){n.d(t,{A:()=>D});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(2445);/* import */var s=n(17437);/* import */var l=n(67375);/* import */var d=n(67901);/* import */var c=n(35975);/* import */var u=n(53429);/* import */var p=n(41594);/* import */var v=/*#__PURE__*/n.n(p);/* import */var h=n(42338);/* import */var f=n(90209);/* import */var g=n(35198);/* import */var _=n(95729);/* import */var m=n(10840);/* import */var b=n(24219);/* import */var y=n(36154);/* import */var w=n(47617);/* import */var x=n(67198);/* import */var A=n(12470);/* import */var Y=/*#__PURE__*/n.n(A);/* import */var k=n(66279);var I=e=>{var{label:t,field:n,fieldState:s,interval:v=30,disabled:m,loading:b,placeholder:Y,helpText:I,isClearable:D=true}=e;var[E,q]=(0,p.useState)(false);var T=(0,p.useRef)(null);var S=(0,p.useRef)(null);var M=(0,p.useMemo)(()=>{var e=(0,l["default"])((0,d["default"])(new Date,0),0);var t=(0,l["default"])((0,d["default"])(new Date,23),59);var n=(0,c/* ["default"] */.A)({start:e,end:t},{step:v});return n.map(e=>(0,u["default"])(e,_/* .DateFormats.hoursMinutes */.UA.hoursMinutes))},[v]);var{activeIndex:H,setActiveIndex:z}=(0,x/* .useSelectKeyboardNavigation */.v)({options:M.map(e=>({label:e,value:e})),isOpen:E,selectedValue:n.value,onSelect:e=>{n.onChange(e.value);q(false)},onClose:()=>q(false)});(0,p.useEffect)(()=>{if(E&&H>=0&&S.current){S.current.scrollIntoView({block:"nearest",behavior:"smooth"})}},[E,H]);return/*#__PURE__*/(0,o/* .jsx */.Y)(k/* ["default"] */.A,{label:t,field:n,fieldState:s,disabled:m,loading:b,placeholder:Y,helpText:I,children:e=>{var{css:t}=e,s=(0,a._)(e,["css"]);var l;return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:C.wrapper,ref:T,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{ref:n.ref,css:[t,C.input],type:"text",onClick:e=>{e.stopPropagation();q(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();q(e=>!e)}if(e.key==="Tab"){q(false)}},value:(l=n.value)!==null&&l!==void 0?l:"",onChange:e=>{var{value:t}=e.target;n.onChange(t)},autoComplete:"off","data-input":true})),/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"clock",width:32,height:32,style:C.icon}),D&&n.value&&/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{isIconOnly:true,"aria-label":(0,A.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:y/* .styleUtils.inputClearButton */.x.inputClearButton,onClick:()=>n.onChange(""),icon:/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{triggerRef:T,isOpen:E,closePopover:()=>q(false),animationType:w/* .AnimationType.slideDown */.J6.slideDown,children:/*#__PURE__*/(0,o/* .jsx */.Y)("ul",{css:C.list,children:M.map((e,t)=>{return/*#__PURE__*/(0,o/* .jsx */.Y)("li",{css:C.listItem,ref:H===t?S:null,"data-active":H===t,children:/*#__PURE__*/(0,o/* .jsx */.Y)("button",{type:"button",css:C.itemButton,onClick:()=>{n.onChange(e);q(false)},onMouseOver:()=>z(t),onMouseLeave:()=>t!==H&&z(-1),onFocus:()=>z(t),children:e})},t)})})})]})}})};/* export default */const D=I;var C={wrapper:/*#__PURE__*/(0,s/* .css */.AH)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,s/* .css */.AH)("&[data-input]{padding-left:",m/* .spacing["40"] */.YK["40"],";}"),icon:/*#__PURE__*/(0,s/* .css */.AH)("position:absolute;top:50%;left:",m/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",m/* .colorTokens.icon["default"] */.I6.icon["default"],";"),list:/*#__PURE__*/(0,s/* .css */.AH)("height:380px;list-style:none;padding:0;margin:0;",y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),listItem:/*#__PURE__*/(0,s/* .css */.AH)("width:100%;height:40px;cursor:pointer;display:flex;align-items:center;transition:background-color 0.3s ease-in-out;&[data-active='true']{background-color:",m/* .colorTokens.background.hover */.I6.background.hover,";}:hover{background-color:",m/* .colorTokens.background.hover */.I6.background.hover,";}"),itemButton:/*#__PURE__*/(0,s/* .css */.AH)(y/* .styleUtils.resetButton */.x.resetButton,";",b/* .typography.body */.I.body(),";margin:",m/* .spacing["4"] */.YK["4"]," ",m/* .spacing["12"] */.YK["12"],";width:100%;height:100%;&:focus,&:active,&:hover{background:none;color:",m/* .colorTokens.text.primary */.I6.text.primary,";}")}},83890:function(e,t,n){// EXPORTS
n.d(t,{A:()=>/* binding */ee});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
var r=n(41374);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var i=n(71893);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var a=n(55456);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
var o=n(84577);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var s=n(2445);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var l=n(17437);// EXTERNAL MODULE: external "wp.i18n"
var d=n(12470);// EXTERNAL MODULE: external "React"
var c=n(41594);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var u=n(49785);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Button.tsx
var p=n(42338);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ImageInput.tsx
var v=n(2971);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/LoadingSpinner.tsx
var h=n(76017);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/SVGIcon.tsx
var f=n(90209);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Popover.tsx
var g=n(35198);// EXTERNAL MODULE: ./assets/react/v3/shared/config/config.ts
var _=n(4892);// EXTERNAL MODULE: ./assets/react/v3/shared/config/constants.ts
var m=n(95729);// EXTERNAL MODULE: ./assets/react/v3/shared/config/styles.ts
var b=n(10840);// EXTERNAL MODULE: ./assets/react/v3/shared/config/typography.ts
var y=n(24219);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/Show.tsx
var w=n(84133);// EXTERNAL MODULE: ./assets/react/v3/shared/hoc/withVisibilityControl.tsx
var x=n(85123);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useAnimation.tsx
var A=n(47617);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useFormWithGlobalError.ts
var Y=n(57148);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/usePortalPopover.tsx
var k=n(94654);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useWpMedia.ts
var I=n(35804);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useMutation.js
var D=n(94747);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/api.ts
var C=n(53127);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/endpoints.ts
var E=n(37381);// CONCATENATED MODULE: ./assets/react/v3/shared/services/video.ts
var q=e=>{return C/* .wpAjaxInstance.post */.b.post(E/* ["default"].TUTOR_YOUTUBE_VIDEO_DURATION */.A.TUTOR_YOUTUBE_VIDEO_DURATION,{video_id:e})};var T=()=>{return(0,D/* .useMutation */.n)({mutationFn:q})};// EXTERNAL MODULE: ./assets/react/v3/shared/utils/style-utils.ts
var S=n(36154);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/util.ts + 4 modules
var M=n(85713);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/validation.ts
var H=n(6192);// CONCATENATED MODULE: ./assets/react/v3/shared/utils/video.ts
function z(e){return(0,r._)(function*(){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;var n=e.match(t);var r=n?n[5]:null;var i="https://vimeo.com/api/v2/video/".concat(r,".xml");try{var a=yield fetch(i);if(!a.ok){throw new Error((0,d.__)("Failed to fetch the video data","tutor"))}var o=yield a.text();var s=new DOMParser;var l=s.parseFromString(o,"application/xml");var c=l.getElementsByTagName("duration")[0];if(!c||!c.textContent){return null}var u=Number.parseInt(c.textContent,10);return u;// in seconds
}catch(e){// eslint-disable-next-line no-console
console.error("Error fetching video duration:",e);return null}})()}var K=e=>(0,r._)(function*(){var t=document.createElement("video");t.src=e;t.preload="metadata";return new Promise(e=>{t.onloadedmetadata=()=>{e(t.duration)}})})();var O=e=>{var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);if(!t){return 0}var n=t[1]?Number(t[1].replace("H","")):0;var r=t[2]?Number(t[2].replace("M","")):0;var i=t[3]?Number(t[3].replace("S","")):0;return n*3600+r*60+i};/**
 * Generates a thumbnail from different video sources
 * @param {string} source - Video source type ('youtube', 'vimeo', 'external_url', 'html5')
 * @param {string} url - Video URL
 * @returns {Promise<string>} - Base64 encoded thumbnail image
 */var F=(e,t)=>(0,r._)(function*(){if(e==="youtube"){var n=t.match(m/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);var r=n&&n[7].length===11?n[7]:"";return"https://img.youtube.com/vi/".concat(r,"/maxresdefault.jpg")}if(e==="vimeo"){try{var i=t.split("/").pop();var a=yield fetch("https://vimeo.com/api/v2/video/".concat(i,".json"));var o=yield a.json();return o[0].thumbnail_large}catch(e){throw new Error("Failed to get Vimeo thumbnail. Error: ".concat(e))}}if(e==="external_url"||e==="html5"){return new Promise((e,n)=>{try{// Create video element
    var r=document.createElement("video");r.muted=true;r.style.cssText="position: fixed; left: 0; top: 0; width: 1px; height: 1px; object-fit: contain; z-index: -1;";r.crossOrigin="Anonymous";// Create canvas element
    var i=document.createElement("canvas");// Track loading states
    var a=false;var o=false;var s=false;var l=false;var c=()=>{r.src="";r.remove();i.remove();clearTimeout(p)};var u=()=>{if(a&&o&&s&&l){try{i.height=r.videoHeight;i.width=r.videoWidth;var t=i.getContext("2d");if(!t){throw new Error((0,d.__)("Failed to get canvas context","tutor"))}t.drawImage(r,0,0);var u=i.toDataURL("image/png");c();e(u)}catch(e){c();var p=e instanceof Error?e.message:(0,d.__)("Unknown error occurred","tutor");n(new Error("Thumbnail generation failed: ".concat(p)))}}};// Setup event listeners
    r.addEventListener("loadedmetadata",()=>{a=true;if(!r.currentTime||r.currentTime<2){r.currentTime=2;// Take snapshot at 2 seconds
    }});r.addEventListener("loadeddata",()=>{o=true;u()});r.addEventListener("suspend",()=>{s=true;u()});r.addEventListener("seeked",()=>{l=true;u()});r.addEventListener("error",e=>{c();n(new Error("Video loading failed: ".concat(e.message)))});// Set timeout
    // 30 seconds is a reasonable maximum time to wait for video metadata and frame capture
    var p=setTimeout(()=>{c();n(new Error((0,d.__)("Thumbnail generation timed out","tutor")))},3e4);// Add elements to DOM
    document.body.appendChild(r);document.body.appendChild(i);// Start loading the video
    r.src=t}catch(e){var v=e instanceof Error?e.message:"Unknown error occurred";n(new Error("Thumbnail generation failed: ".concat(v)))}})}throw new Error((0,d.__)("Unsupported video source","tutor"))})();// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFieldWrapper.tsx
var P=n(66279);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var W=n(59976);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var N=n(61046);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx
function L(){var e=(0,o._)(["\n      background-color: ",";\n    "]);L=function t(){return e};return e}function B(){var e=(0,o._)(["\n      ",";\n    "]);B=function t(){return e};return e}var R=_/* .tutorConfig.supported_video_sources */.P.supported_video_sources||[];var U=R.filter(e=>e.value!=="html5");var j=R.map(e=>e.value);var V=["vimeo","youtube","html5"];var Q={youtube:(0,d.__)("Paste YouTube Video URL","tutor"),vimeo:(0,d.__)("Paste Vimeo Video URL","tutor"),external_url:(0,d.__)("Paste External Video URL","tutor"),shortcode:(0,d.__)("Paste Video Shortcode","tutor"),embedded:(0,d.__)("Paste Embedded Video Code","tutor")};var G={youtube:"youtube",vimeo:"vimeo",shortcode:"shortcode",embedded:"coding"};var X=(e,t)=>{var n={source:"",source_video_id:"",poster:"",poster_url:"",source_html5:"",source_external_url:"",source_shortcode:"",source_youtube:"",source_vimeo:"",source_embedded:""};return e?(0,i._)({},e,t):(0,i._)({},n,t)};var Z={youtube:e=>{var t=e.match(m/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);return t&&t[7].length===11?t[7]:null},vimeo:e=>{var t=e.match(m/* .VideoRegex.VIMEO */.j8.VIMEO);return(t===null||t===void 0?void 0:t[5])||null},shortcode:e=>{return e.match(m/* .VideoRegex.SHORTCODE */.j8.SHORTCODE)?e:null},url:e=>{return e.match(m/* .VideoRegex.EXTERNAL_URL */.j8.EXTERNAL_URL)?e:null}};var J=e=>{var{source:t,url:n,getYouTubeVideoDurationMutation:i}=e;return(0,r._)(function*(){try{var e=0;switch(t){case"vimeo":var r;e=(r=yield z(n))!==null&&r!==void 0?r:0;break;case"html5":case"external_url":var a;e=(a=yield K(n))!==null&&a!==void 0?a:0;break;case"youtube":{var o=Z.youtube(n);if(o){var s=yield i.mutateAsync(o);e=O(s.data.duration)}break}}if(e){var l=(0,M/* .covertSecondsToHMS */.uu)(Math.floor(e));return l}return null}catch(e){// eslint-disable-next-line no-console
console.error("Error getting video duration:",e);return null}})()};var $=e=>{var{field:t,fieldState:n,label:o,helpText:m,buttonText:b=(0,d.__)("Upload Media","tutor"),infoText:y,onChange:x,supportedFormats:D,loading:C,onGetDuration:E}=e;var q,L,B;var $=(0,Y/* .useFormWithGlobalError */.p)({defaultValues:{videoSource:((q=U[0])===null||q===void 0?void 0:q.value)||"",videoUrl:""}});var ee=T();var[en,er]=(0,c.useState)(false);var[ei,ea]=(0,c.useState)({hours:0,minutes:0,seconds:0});var[eo,es]=(0,c.useState)("");var[el,ed]=(0,c.useState)(false);var ec=(0,c.useRef)(null);var eu=e=>(0,r._)(function*(){if(!e){return}var n=Array.isArray(e)?e[0]:e;var r={source:"html5",source_video_id:n.id.toString(),source_html5:n.url};t.onChange(X(t.value,r));x===null||x===void 0?void 0:x(X(t.value,r));try{er(true);ef();var i=yield F("external_url",n.url);var a=yield K(n.url);if(!a){return}ea((0,M/* .covertSecondsToHMS */.uu)(Math.floor(a)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(a)))}if(i){es(i)}}finally{er(false)}})();var{openMediaLibrary:ep,resetFiles:ev}=(0,I/* ["default"] */.A)({options:{type:(D===null||D===void 0?void 0:D.length)?D.map(e=>"video/".concat(e)).join(","):"video"},onChange:eu});var{openMediaLibrary:eh,resetFiles:ef}=(0,I/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(!e){return}var n=Array.isArray(e)?e[0]:e;var r={poster:n.id.toString(),poster_url:n.url};t.onChange(X(t.value,r));x===null||x===void 0?void 0:x(X(t.value,r))},initialFiles:((L=t.value)===null||L===void 0?void 0:L.poster)?{id:Number(t.value.poster),url:t.value.poster_url,title:""}:null});var eg=$.watch("videoSource")||"";var e_=t.value;(0,c.useEffect)(()=>{var e;if(!e_){return}if(!e_.source){var n,r;$.setValue("videoSource",(n=U[0])===null||n===void 0?void 0:n.value);$.setValue("videoUrl",e_["source_".concat((r=U[0])===null||r===void 0?void 0:r.value)]||"");return}var i=j.includes(e_.source);if(!i){t.onChange(X(e_,{source:""}));return}$.setValue("videoSource",e_.source);$.setValue("videoUrl",e_["source_".concat(e_.source)]||"");if(!e_.poster_url&&V.includes(e_.source)){var a=e_.source;er(true);F(a,e_["source_".concat(a)]||"").then(e=>{er(false);es(e)}).finally(()=>{er(false)})}if(Object.values(ei).some(e=>e>0)){return}if(e_.source==="vimeo"){z(e_["source_vimeo"]||"").then(e=>{if(!e){return}ea((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(["external_url","html5"].includes(e_.source)){K(e_["source_".concat(e_.source)]||"").then(e=>{if(!e){return}ea((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(e_.source==="youtube"&&((e=_/* .tutorConfig.settings */.P.settings)===null||e===void 0?void 0:e.youtube_api_key_exist)){var o;var s=(o=Z.youtube(e_["source_youtube"]||""))!==null&&o!==void 0?o:"";ee.mutateAsync(s).then(e=>{var t=e.data.duration;if(!t){return}var n=O(t);ea((0,M/* .covertSecondsToHMS */.uu)(Math.floor(n)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(n)))}})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[e_]);if(!j.length){return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.emptyMediaWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:o,children:/*#__PURE__*/(0,s/* .jsx */.Y)("label",{children:o})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.emptyMedia({hasVideoSource:false}),children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("p",{css:et.warningText,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"info",height:20,width:20}),(0,d.__)("No video source selected","tutor")]}),/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{buttonCss:et.selectFromSettingsButton,variant:"secondary",size:"small",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"linkExternal",height:24,width:24}),onClick:()=>{window.open(_/* ["default"].VIDEO_SOURCES_SETTINGS_URL */.A.VIDEO_SOURCES_SETTINGS_URL,"_blank","noopener")},children:(0,d.__)("Select from settings","tutor")})]})]})}var em=e=>{if(e==="video"){ep();return}eh()};var eb=e=>{var n=e==="video"?{source:"",source_video_id:"",poster:"",poster_url:""}:{poster:"",poster_url:""};var r=X(e_,n);if(e==="video"){ev()}else{ef()}t.onChange(r);es("");ea({hours:0,minutes:0,seconds:0});if(x){x(r)}};var ey=()=>{if(!(e_===null||e_===void 0?void 0:e_.source)||!j.includes(e_.source)){return false}var e=e_===null||e_===void 0?void 0:e_.source;var t="source_".concat(e);return e_&&e_[t]!==""};var ew=e=>(0,r._)(function*(){er(true);try{var{videoSource:n,videoUrl:r}=e;var i={source:n,["source_".concat(n)]:r};t.onChange(X(e_,i));x===null||x===void 0?void 0:x(X(e_,i));ed(false);var[a,o]=yield Promise.all([J({source:n,url:r,getYouTubeVideoDurationMutation:ee}),V.includes(n)?F(n,r):null]);if(a){ea(a);E===null||E===void 0?void 0:E(a)}if(o){es(o)}}finally{er(false)}})();var ex=e=>{var t=e.trim();if(eg==="embedded")return true;if(eg==="shortcode"){return Z.shortcode(t)?true:(0,d.__)("Invalid Shortcode","tutor")}if(!Z.url(t)){return(0,d.__)("Invalid URL","tutor")}if(eg==="youtube"&&!Z.youtube(t)){return(0,d.__)("Invalid YouTube URL","tutor")}if(eg==="vimeo"&&!Z.vimeo(t)){return(0,d.__)("Invalid Vimeo URL","tutor")}return true};return/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[/*#__PURE__*/(0,s/* .jsx */.Y)(P/* ["default"] */.A,{label:o,field:t,fieldState:n,helpText:m,children:()=>{return/*#__PURE__*/(0,s/* .jsx */.Y)("div",{ref:ec,children:/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:!C,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:et.emptyMedia({hasVideoSource:true}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(h/* .LoadingOverlay */.p8,{})}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:ey(),fallback:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.emptyMedia({hasVideoSource:true}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:j.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"upload-media",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"monitorPlay",height:24,width:24}),onClick:()=>{em("video")},children:b})}),/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:j.filter(e=>e!=="html5").length>0,children:/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:!j.includes("html5"),fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("button",{"data-cy":"add-from-url",type:"button",css:et.urlButton,onClick:()=>{ed(e=>!e)},children:(0,d.__)("Add from URL","tutor")}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"add-from-url",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"plusSquareBrand",height:24,width:24}),onClick:()=>{ed(e=>!e)},children:(0,d.__)("Add from URL","tutor")})})}),/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:j.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.Y)("p",{css:et.infoTexts,children:y})})]}),children:()=>{var e;return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.previewWrapper,"data-cy":"media-preview",children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.videoInfoWrapper,children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.videoInfoCard,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:G[e_===null||e_===void 0?void 0:e_.source]||"video",height:36,width:36}),/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:et.videoInfo,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:et.videoInfoTitle,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:S/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:V.includes((e_===null||e_===void 0?void 0:e_.source)||"")?e_===null||e_===void 0?void 0:e_["source_".concat(e_.source)]:(e=R.find(e=>e.value===(e_===null||e_===void 0?void 0:e_.source)))===null||e===void 0?void 0:e.label})})})]}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.actionButtons,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:eg!=="html5",children:/*#__PURE__*/(0,s/* .jsx */.Y)("button",{type:"button",css:S/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{ed(true)},children:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"edit",height:24,width:24})})}),/*#__PURE__*/(0,s/* .jsx */.Y)("button",{"data-cy":"remove-video",type:"button",css:S/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{eb("video")},children:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"cross",height:24,width:24})})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:et.imagePreview({hasImageInput:V.includes((e_===null||e_===void 0?void 0:e_.source)||"")}),children:/*#__PURE__*/(0,s/* .jsxs */.FD)(w/* ["default"] */.A,{when:V.includes((e_===null||e_===void 0?void 0:e_.source)||""),fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:et.urlData,children:$.watch("videoUrl")}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(v/* ["default"] */.A,{value:e_?{id:Number(e_.poster)||0,url:e_.poster_url||eo,title:""}:null,loading:en,isClearAble:!!(e_===null||e_===void 0?void 0:e_.poster),disabled:["vimeo","youtube"].includes((e_===null||e_===void 0?void 0:e_.source)||""),uploadHandler:()=>em("poster"),clearHandler:()=>eb("poster"),buttonText:(0,d.__)("Upload Thumbnail","tutor"),infoText:(0,d.__)("Upload a thumbnail image for your video","tutor"),emptyImageCss:et.thumbImage,previewImageCss:et.thumbImage,overlayCss:et.thumbImage,replaceButtonText:(0,d.__)("Replace Thumbnail","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,{when:ei.hours>0||ei.minutes>0||ei.seconds>0,children:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.duration,children:[ei.hours>0&&"".concat(ei.hours,"h")," ",ei.minutes,"m ",ei.seconds,"s"]})})]})})]})}})})})}}),/*#__PURE__*/(0,s/* .jsx */.Y)(g/* ["default"] */.A,{triggerRef:ec,isOpen:el,placement:k/* .POPOVER_PLACEMENTS.MIDDLE */.zA.MIDDLE,animationType:A/* .AnimationType.fadeIn */.J6.fadeIn,closePopover:()=>ed(false),positionModifier:{top:17,left:0},maxWidth:"".concat(((B=ec.current)===null||B===void 0?void 0:B.offsetWidth)||300,"px"),children:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.popoverContent,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(u/* .Controller */.xI,{control:$.control,name:"videoSource",rules:(0,i._)({},(0,H/* .requiredRule */.WN)()),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.Y)(W/* ["default"] */.A,(0,a._)((0,i._)({},e),{options:U,disabled:R.length<=1,placeholder:(0,d.__)("Select source","tutor"),hideCaret:R.length<=1}))}}),/*#__PURE__*/(0,s/* .jsx */.Y)(u/* .Controller */.xI,{control:$.control,name:"videoUrl",rules:(0,a._)((0,i._)({},(0,H/* .requiredRule */.WN)()),{validate:ex}),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.Y)(N/* ["default"] */.A,(0,a._)((0,i._)({},e),{inputCss:/*#__PURE__*/(0,l/* .css */.AH)("border-style:dashed;"),rows:2,placeholder:Q[eg]||(0,d.__)("Paste Here","tutor")}))}}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:et.popoverButtonWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{ed(false)},children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"submit-url",variant:"secondary",size:"small",onClick:$.handleSubmit(ew),children:(0,d.__)("Ok","tutor")})]})]})})]})};/* export default */const ee=(0,x/* .withVisibilityControl */.M)($);var et={emptyMediaWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",b/* .spacing["4"] */.YK["4"],";label{",y/* .typography.caption */.I.caption(),";color:",b/* .colorTokens.text.title */.I6.text.title,";}"),emptyMedia:e=>{var{hasVideoSource:t=false}=e;return/*#__PURE__*/(0,l/* .css */.AH)("width:100%;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",b/* .spacing["8"] */.YK["8"],";border:1px dashed ",b/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",b/* .borderRadius["8"] */.Vq["8"],";background-color:",b/* .colorTokens.background.status.warning */.I6.background.status.warning,";",t&&(0,l/* .css */.AH)(L(),b/* .colorTokens.bg.white */.I6.bg.white))},infoTexts:/*#__PURE__*/(0,l/* .css */.AH)(y/* .typography.tiny */.I.tiny(),";color:",b/* .colorTokens.text.subdued */.I6.text.subdued,";"),warningText:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",b/* .spacing["4"] */.YK["4"],";",y/* .typography.caption */.I.caption(),";color:",b/* .colorTokens.text.warning */.I6.text.warning,";"),selectFromSettingsButton:/*#__PURE__*/(0,l/* .css */.AH)("background:",b/* .colorTokens.bg.white */.I6.bg.white,";"),urlData:/*#__PURE__*/(0,l/* .css */.AH)(y/* .typography.caption */.I.caption(),";",S/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",b/* .spacing["8"] */.YK["8"]," ",b/* .spacing["12"] */.YK["12"],";gap:",b/* .spacing["8"] */.YK["8"],";word-break:break-all;"),previewWrapper:/*#__PURE__*/(0,l/* .css */.AH)("width:100%;height:100%;border:1px solid ",b/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",b/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;background-color:",b/* .colorTokens.bg.white */.I6.bg.white,";"),videoInfoWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",b/* .spacing["20"] */.YK["20"],";padding:",b/* .spacing["8"] */.YK["8"]," ",b/* .spacing["12"] */.YK["12"],";"),videoInfoCard:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",b/* .spacing["8"] */.YK["8"],";svg{flex-shrink:0;color:",b/* .colorTokens.icon.hover */.I6.icon.hover,";}"),videoInfo:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",b/* .spacing["4"] */.YK["4"],";"),videoInfoTitle:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";",y/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),imagePreview:e=>{var{hasImageInput:t}=e;return/*#__PURE__*/(0,l/* .css */.AH)("width:100%;max-height:168px;position:relative;overflow:hidden;background-color:",b/* .colorTokens.background["default"] */.I6.background["default"],";",!t&&(0,l/* .css */.AH)(B(),S/* .styleUtils.overflowYAuto */.x.overflowYAuto),";scrollbar-gutter:auto;&:hover{[data-hover-buttons-wrapper]{opacity:1;}}")},duration:/*#__PURE__*/(0,l/* .css */.AH)(y/* .typography.tiny */.I.tiny(),";position:absolute;bottom:",b/* .spacing["12"] */.YK["12"],";right:",b/* .spacing["12"] */.YK["12"],";background-color:rgba(0,0,0,0.5);color:",b/* .colorTokens.text.white */.I6.text.white,";padding:",b/* .spacing["4"] */.YK["4"]," ",b/* .spacing["8"] */.YK["8"],";border-radius:",b/* .borderRadius["6"] */.Vq["6"],";pointer-events:none;"),thumbImage:/*#__PURE__*/(0,l/* .css */.AH)("border-radius:0;border:none;"),urlButton:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.resetButton */.x.resetButton,";",y/* .typography.small */.I.small("medium"),";color:",b/* .colorTokens.text.brand */.I6.text.brand,";border-radius:",b/* .borderRadius["2"] */.Vq["2"],";padding:0 ",b/* .spacing["4"] */.YK["4"],";margin-bottom:",b/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",b/* .colorTokens.text.brand */.I6.text.brand,";}&:focus-visible{outline:2px solid ",b/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),actionButtons:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";gap:",b/* .spacing["4"] */.YK["4"],";"),popover:/*#__PURE__*/(0,l/* .css */.AH)("position:absolute;width:100%;z-index:",b/* .zIndex.dropdown */.fE.dropdown,";background-color:",b/* .colorTokens.bg.white */.I6.bg.white,";border-radius:",b/* .borderRadius.card */.Vq.card,";box-shadow:",b/* .shadow.popover */.r7.popover,";"),popoverContent:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",b/* .spacing["12"] */.YK["12"],";padding:",b/* .spacing["16"] */.YK["16"],";"),popoverButtonWrapper:/*#__PURE__*/(0,l/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),";gap:",b/* .spacing["8"] */.YK["8"],";justify-content:flex-end;")}},37196:function(e,t,n){n.d(t,{A:()=>W});/* import */var r=n(41374);/* import */var i=n(84577);/* import */var a=n(2445);/* import */var o=n(17437);/* import */var s=n(12470);/* import */var l=/*#__PURE__*/n.n(s);/* import */var d=n(3771);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(41594);/* import */var p=/*#__PURE__*/n.n(u);/* import */var v=n(51550);/* import */var h=n(42338);/* import */var f=n(76017);/* import */var g=n(90209);/* import */var _=n(92229);/* import */var m=n(52664);/* import */var b=n(74645);/* import */var y=n(3013);/* import */var w=n(1448);/* import */var x=n(85544);/* import */var A=n(6463);/* import */var Y=n(4892);/* import */var k=n(95729);/* import */var I=n(10840);/* import */var D=n(8501);/* import */var C=n(84133);/* import */var E=n(36154);/* import */var q=n(14631);/* import */var T=n(75510);/* import */var S=n(66279);function M(){var e=(0,i._)(["\n      overflow: hidden;\n      border-radius: ",";\n    "]);M=function t(){return e};return e}var H;var z={droip:"droipColorized",elementor:"elementorColorized",gutenberg:"gutenbergColorized",divi:"diviColorized"};var K=!!Y/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var O=(H=Y/* .tutorConfig.settings */.P.settings)===null||H===void 0?void 0:H.chatgpt_key_exist;var F=e=>{var{editorUsed:t,onBackToWPEditorClick:n,onCustomEditorButtonClick:i}=e;var{showModal:o}=(0,w/* .useModal */.h)();var[l,d]=(0,u.useState)("");return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:N.editorOverlay,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{when:t.name!=="gutenberg",children:/*#__PURE__*/(0,a/* .jsx */.Y)(h/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:N.editWithButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"arrowLeft",height:24,width:24}),loading:l==="back_to",onClick:()=>(0,r._)(function*(){var{action:e}=yield o({component:y/* ["default"] */.A,props:{title:(0,s.__)("Back to WordPress Editor","tutor"),description:/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{type:"warning",icon:"warning",children:(0,s.__)("Warning: Switching to the WordPress default editor may cause issues with your current layout, design, and content.","tutor")}),confirmButtonText:(0,s.__)("Confirm","tutor"),confirmButtonVariant:"primary"},depthIndex:I/* .zIndex.highest */.fE.highest});if(e==="CONFIRM"){try{d("back_to");yield n===null||n===void 0?void 0:n(t.name)}finally{d("")}}})(),children:(0,s.__)("Back to WordPress Editor","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(h/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:N.editWithButton,loading:l==="edit_with",icon:z[t.name]&&/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:z[t.name],height:24,width:24}),onClick:()=>(0,r._)(function*(){try{d("edit_with");yield i===null||i===void 0?void 0:i(t);window.location.href=t.link}finally{d("")}})(),children:/* translators: %s is the editor name */(0,s.sprintf)((0,s.__)("Edit with %s","tutor"),t===null||t===void 0?void 0:t.label)})]})};var P=e=>{var{label:t,field:n,fieldState:i,disabled:o,readOnly:l,loading:d,placeholder:c,helpText:p,onChange:v,generateWithAi:h=false,onClickAiButton:y,hasCustomEditorSupport:M=false,isMinimal:H=false,hideMediaButtons:P=false,hideQuickTags:W=false,editors:L=[],editorUsed:B={name:"classic",label:"Classic Editor",link:""},isMagicAi:R=false,autoFocus:U=false,onCustomEditorButtonClick:j,onBackToWPEditorClick:V,onFullScreenChange:Q,min_height:G,max_height:X,toolbar1:Z,toolbar2:J}=e;var $,ee,et,en,er;var{showModal:ei}=(0,w/* .useModal */.h)();var ea=(($=Y/* .tutorConfig.settings */.P.settings)===null||$===void 0?void 0:$.hide_admin_bar_for_users)==="off";var eo=(et=Y/* .tutorConfig.current_user */.P.current_user)===null||et===void 0?void 0:(ee=et.roles)===null||ee===void 0?void 0:ee.includes(k/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var es=(er=Y/* .tutorConfig.current_user */.P.current_user)===null||er===void 0?void 0:(en=er.roles)===null||en===void 0?void 0:en.includes(k/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var[el,ed]=(0,u.useState)(null);var ec=L.filter(e=>eo||es&&ea||e.name==="droip");var eu=M&&ec.length>0;var ep=eu&&B.name!=="classic";var ev=()=>{if(!K){ei({component:x/* ["default"] */.A,props:{image:T,image2x:q}})}else if(!O){ei({component:A/* ["default"] */.A,props:{image:T,image2x:q}})}else{ei({component:b/* ["default"] */.A,isMagicAi:true,props:{title:(0,s.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),characters:1e3,field:n,fieldState:i,is_html:true}});y===null||y===void 0?void 0:y()}};var eh=/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:N.editorLabel,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:N.labelWithAi,children:[t,/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:N.aiButton,onClick:ev,children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"magicAiColorize",width:32,height:32})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:N.editorsButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,s.__)("Edit with","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:N.customEditorButtons,children:/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{each:ec,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{content:e.label,delay:200,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:N.customEditorButton,disabled:el===e.name,onClick:()=>(0,r._)(function*(){try{ed(e.name);yield j===null||j===void 0?void 0:j(e);window.location.href=e.link}finally{ed(null)}})(),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{when:el===e.name,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* .LoadingOverlay */.p8,{})}),/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:z[e.name],height:24,width:24})]})},e.name)})})]})]});return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* ["default"] */.A,{label:eu?eh:t,field:n,fieldState:i,disabled:o,readOnly:l,placeholder:c,helpText:p,isMagicAi:R,generateWithAi:!eu&&h,onClickAiButton:ev,replaceEntireLabel:eu,children:()=>{if(d){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:E/* .styleUtils.flexCenter */.x.flexCenter(),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.Ay,{size:20,color:I/* .colorTokens.icon["default"] */.I6.icon["default"]})})}var e;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:N.wrapper({isOverlayVisible:ep}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{when:ep,children:/*#__PURE__*/(0,a/* .jsx */.Y)(F,{editorUsed:B,onBackToWPEditorClick:V,onCustomEditorButtonClick:j})}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{value:(e=n.value)!==null&&e!==void 0?e:"",onChange:e=>{n.onChange(e);if(v){v(e)}},isMinimal:H,hideMediaButtons:P,hideQuickTags:W,autoFocus:U,onFullScreenChange:Q,readonly:l,min_height:G,max_height:X,toolbar1:Z,toolbar2:J})]})}})};/* export default */const W=P;var N={wrapper:e=>{var{isOverlayVisible:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;",t&&(0,o/* .css */.AH)(M(),I/* .borderRadius["6"] */.Vq["6"]))},editorLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;width:100%;align-items:center;justify-content:space-between;"),aiButton:/*#__PURE__*/(0,o/* .css */.AH)(E/* .styleUtils.resetButton */.x.resetButton,";",E/* .styleUtils.flexCenter */.x.flexCenter(),";width:32px;height:32px;border-radius:",I/* .borderRadius["4"] */.Vq["4"],";:disabled{cursor:not-allowed;}&:focus-visible{outline:2px solid ",I/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),labelWithAi:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",I/* .spacing["4"] */.YK["4"],";"),editorsButtonWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",I/* .spacing["8"] */.YK["8"],";color:",I/* .colorTokens.text.hints */.I6.text.hints,";"),customEditorButtons:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",I/* .spacing["4"] */.YK["4"],";"),customEditorButton:/*#__PURE__*/(0,o/* .css */.AH)(E/* .styleUtils.resetButton */.x.resetButton,"    display:flex;align-items:center;justify-content:center;position:relative;border-radius:",I/* .borderRadius.circle */.Vq.circle,";&:focus-visible{outline:2px solid ",I/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),editorOverlay:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;height:100%;width:100%;",E/* .styleUtils.flexCenter */.x.flexCenter(),";gap:",I/* .spacing["8"] */.YK["8"],";background-color:",c()(I/* .colorTokens.background.modal */.I6.background.modal,.6),";border-radius:",I/* .borderRadius["6"] */.Vq["6"],";z-index:",I/* .zIndex.positive */.fE.positive,";backdrop-filter:blur(8px);"),editWithButton:/*#__PURE__*/(0,o/* .css */.AH)("background:",I/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";color:",I/* .colorTokens.text.primary */.I6.text.primary,";box-shadow:inset 0 -1px 0 0 ",c()("#1112133D",.24),",0 1px 0 0 ",c()("#1112133D",.8),";")}},6575:function(e,t,n){n.d(t,{f:()=>d});/* import */var r=n(2445);/* import */var i=n(10840);/* import */var a=n(66283);/* import */var o=n(17437);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);var d=/*#__PURE__*/l().forwardRef((e,t)=>{var{src:n,width:i,height:o,brushSize:l,trackStack:d,pointer:u,setTrackStack:p,setPointer:v}=e;var[h,f]=(0,s.useState)(false);var[g,_]=(0,s.useState)({x:0,y:0});var m=(0,s.useRef)(null);var b=e=>{var{canvas:n,context:r}=(0,a/* .getCanvas */.dX)(t);if(!n||!r){return}var i=n.getBoundingClientRect();var o=(e.clientX-i.left)*(n.width/i.width);var s=(e.clientY-i.top)*(n.height/i.height);r.globalCompositeOperation="destination-out";r.beginPath();r.moveTo(o,s);f(true);_({x:o,y:s})};var y=e=>{var{canvas:n,context:r}=(0,a/* .getCanvas */.dX)(t);if(!n||!r||!m.current){return}var i=n.getBoundingClientRect();var o={x:(e.clientX-i.left)*(n.width/i.width),y:(e.clientY-i.top)*(n.height/i.height)};if(h){(0,a/* .drawPath */.kd)(r,o)}m.current.style.left="".concat(o.x,"px");m.current.style.top="".concat(o.y,"px")};var w=e=>{var{canvas:n,context:r}=(0,a/* .getCanvas */.dX)(t);if(!r||!n){return}f(false);r.closePath();var i=n.getBoundingClientRect();var o={x:(e.clientX-i.left)*(n.width/i.width),y:(e.clientY-i.top)*(n.height/i.height)};// Check if the mouse is just clicked but not drag for drawing a path, then draw a circle
if((0,a/* .calculateCartesianDistance */.KG)(g,o)===0){(0,a/* .drawPath */.kd)(r,{x:o.x+1,y:o.y+1})}p(e=>{var t=e.slice(0,u);return[...t,r.getImageData(0,0,1024,1024)]});v(e=>e+1)};var x=()=>{var{canvas:e,context:r}=(0,a/* .getCanvas */.dX)(t);if(!e||!r){return}var i=new Image;i.src=n;i.onload=()=>{r.clearRect(0,0,e.width,e.height);var t=i.width/i.height;var n=e.width/e.height;var a;var o;if(n>t){o=e.height;a=e.height*t}else{a=e.width;o=e.width/t}var s=(e.width-a)/2;var l=(e.height-o)/2;r.drawImage(i,s,l,a,o);if(d.length===0){p([r.getImageData(0,0,e.width,e.height)])}};r.lineJoin="round";r.lineCap="round"};var A=()=>{if(!m.current){return}document.body.style.cursor="none";m.current.style.display="block"};var Y=()=>{if(!m.current){return}document.body.style.cursor="auto";m.current.style.display="none"};(0,s.useEffect)(()=>{x();// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,r/* .jsxs */.FD)("div",{css:c.wrapper,children:[/*#__PURE__*/(0,r/* .jsx */.Y)("canvas",{ref:t,width:i,height:o,onMouseDown:b,onMouseMove:y,onMouseUp:w,onMouseEnter:A,onMouseLeave:Y}),/*#__PURE__*/(0,r/* .jsx */.Y)("div",{ref:m,css:c.customCursor(l)})]})});var c={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",i/* .borderRadius.circle */.Vq.circle,";background:linear-gradient(\n      73.09deg,rgba(255,150,69,0.4) 18.05%,rgba(255,100,113,0.4) 30.25%,rgba(207,110,189,0.4) 55.42%,rgba(164,119,209,0.4) 71.66%,rgba(62,100,222,0.4) 97.9%\n    );border:3px solid ",i/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",i/* .zIndex.highest */.fE.highest,";display:none;")}},31873:function(e,t,n){n.d(t,{A6:()=>h,co:()=>f,i3:()=>p});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(2445);/* import */var o=n(57148);/* import */var s=n(12470);/* import */var l=/*#__PURE__*/n.n(s);/* import */var d=n(41594);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(49785);var p=[(0,s.__)("A serene classroom setting with books and a chalkboard","tutor"),(0,s.__)("An abstract representation of innovation and creativity","tutor"),(0,s.__)("A vibrant workspace with a laptop and coffee cup","tutor"),(0,s.__)("A modern design with digital learning icons","tutor"),(0,s.__)("A futuristic cityscape with a glowing pathway","tutor"),(0,s.__)("A peaceful nature scene with soft colors","tutor"),(0,s.__)("A professional boardroom with sleek visuals","tutor"),(0,s.__)("A stack of books with warm, inviting lighting","tutor"),(0,s.__)("A dynamic collage of technology and education themes","tutor"),(0,s.__)("A bold and minimalistic design with striking colors","tutor")];// eslint-disable-next-line @typescript-eslint/no-explicit-any
var v=/*#__PURE__*/c().createContext(null);var h=()=>{var e=(0,d.useContext)(v);if(!e){throw new Error("useMagicImageGeneration must be used within MagicImageGenerationProvider.")}return e};var f=e=>{var{children:t,field:n,fieldState:s,onCloseModal:l}=e;var c=(0,o/* .useFormWithGlobalError */.p)({defaultValues:{prompt:"",style:"none"}});var[p,h]=(0,d.useState)("generation");var[f,g]=(0,d.useState)("");var[_,m]=(0,d.useState)([null,null,null,null]);var b=(0,d.useCallback)(e=>{h(e)},[]);return/*#__PURE__*/(0,a/* .jsx */.Y)(v.Provider,{value:{state:p,onDropdownMenuChange:b,images:_,setImages:m,currentImage:f,setCurrentImage:g,field:n,fieldState:s,onCloseModal:l},children:/*#__PURE__*/(0,a/* .jsx */.Y)(u/* .FormProvider */.Op,(0,i._)((0,r._)({},c),{children:t}))})}},40528:function(e,t,n){n.d(t,{u:()=>N});/* import */var r=n(41374);/* import */var i=n(71893);/* import */var a=n(55456);/* import */var o=n(2445);/* import */var s=n(66273);/* import */var l=n(90209);/* import */var d=n(99281);/* import */var c=n(61046);/* import */var u=n(10840);/* import */var p=n(24219);/* import */var v=n(8501);/* import */var h=n(84133);/* import */var f=n(36512);/* import */var g=n(45063);/* import */var _=n(74469);/* import */var m=n(20108);/* import */var b=n(86160);/* import */var y=n(77628);/* import */var w=n(59120);/* import */var x=n(62646);/* import */var A=n(85712);/* import */var Y=n(39550);/* import */var k=n(36732);/* import */var I=n(73788);/* import */var D=n(18866);/* import */var C=n(45549);/* import */var E=n(36154);/* import */var q=n(51298);/* import */var T=n(17437);/* import */var S=n(12470);/* import */var M=/*#__PURE__*/n.n(S);/* import */var H=n(41594);/* import */var z=/*#__PURE__*/n.n(H);/* import */var K=n(49785);/* import */var O=n(31873);/* import */var F=n(22951);/* import */var P=n(87233);var W=[{label:(0,S.__)("None","tutor"),value:"none",image:A},{label:(0,S.__)("Photo","tutor"),value:"photo",image:k},{label:(0,S.__)("Neon","tutor"),value:"neon",image:x},{label:(0,S.__)("3D","tutor"),value:"3d",image:g},{label:(0,S.__)("Painting","tutor"),value:"painting",image:Y},{label:(0,S.__)("Sketch","tutor"),value:"sketch",image:D},{label:(0,S.__)("Concept","tutor"),value:"concept_art",image:m},{label:(0,S.__)("Illustration","tutor"),value:"illustration",image:w},{label:(0,S.__)("Dreamy","tutor"),value:"dreamy",image:b},{label:(0,S.__)("Filmic","tutor"),value:"filmic",image:y},{label:(0,S.__)("Retro","tutor"),value:"retrowave",image:I},{label:(0,S.__)("Black & White","tutor"),value:"black-and-white",image:_}];var N=()=>{var e=(0,K/* .useForm */.mN)({defaultValues:{style:"none",prompt:""}});var{images:t,setImages:n}=(0,O/* .useMagicImageGeneration */.A6)();var u=(0,f/* .useMagicImageGenerationMutation */.R8)();var{showToast:p}=(0,C/* .useToast */.d)();var[g,_]=(0,H.useState)(t.every(e=>e===null));var[m,b]=(0,H.useState)([false,false,false,false]);var y=e.watch("style");var w=e.watch("prompt");var x=!y||!w;var A=t.some(q/* .isDefined */.O9);(0,H.useEffect)(()=>{if(u.isError){p({type:"danger",message:u.error.response.data.message})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[u.isError]);(0,H.useEffect)(()=>{e.setFocus("prompt");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("form",{css:P/* .magicAIStyles.wrapper */.C.wrapper,onSubmit:e.handleSubmit(e=>(0,r._)(function*(){b([true,true,true,true]);_(false);try{yield Promise.all(Array.from({length:4}).map((t,r)=>{return u.mutateAsync(e).then(e=>{n(t=>{var n,i;var a=[...t];var o;a[r]=(o=(i=e.data.data)===null||i===void 0?void 0:(n=i[0])===null||n===void 0?void 0:n.b64_json)!==null&&o!==void 0?o:null;return a});b(e=>{var t=[...e];t[r]=false;return t})}).catch(e=>{b(e=>{var t=[...e];t[r]=false;return t});throw e})}))}catch(e){b([false,false,false,false]);_(true)}})()),children:[/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:P/* .magicAIStyles.left */.C.left,children:/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{when:!g,fallback:/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"magicAiPlaceholder",width:72,height:72}),children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:L.images,children:/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{each:t,children:(e,t)=>{return/*#__PURE__*/(0,o/* .jsx */.Y)(F/* .AiImageItem */.z,{src:e,loading:m[t],index:t},t)}})})})}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P/* .magicAIStyles.right */.C.right,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:L.fields,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:L.promptWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(K/* .Controller */.xI,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(c/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,S.__)("Visualize Your Course","tutor"),placeholder:(0,S.__)("Describe the image you want for your course thumbnail","tutor"),rows:4,isMagicAi:true,disabled:u.isPending,enableResize:false}))}),/*#__PURE__*/(0,o/* .jsxs */.FD)("button",{type:"button",css:L.inspireButton,onClick:()=>{var t=O/* .inspirationPrompts.length */.i3.length;var n=Math.floor(Math.random()*t);e.reset((0,a._)((0,i._)({},e.getValues()),{prompt:O/* .inspirationPrompts */.i3[n]}))},disabled:u.isPending,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"bulbLine"}),(0,S.__)("Inspire Me","tutor")]})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(K/* .Controller */.xI,{control:e.control,name:"style",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(d/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,S.__)("Styles","tutor"),options:W,disabled:u.isPending}))})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:P/* .magicAIStyles.rightFooter */.C.rightFooter,children:/*#__PURE__*/(0,o/* .jsxs */.FD)(s/* ["default"] */.A,{type:"submit",disabled:u.isPending||x,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:A?"reload":"magicAi",width:24,height:24}),A?(0,S.__)("Generate Again","tutor"):(0,S.__)("Generate Now","tutor")]})})]})]})};var L={images:/*#__PURE__*/(0,T/* .css */.AH)("display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));grid-template-rows:repeat(2,minmax(150px,1fr));gap:",u/* .spacing["12"] */.YK["12"],";align-self:start;padding:",u/* .spacing["24"] */.YK["24"],";width:100%;height:100%;> div{aspect-ratio:1 / 1;}"),fields:/*#__PURE__*/(0,T/* .css */.AH)("display:flex;flex-direction:column;gap:",u/* .spacing["12"] */.YK["12"],";"),promptWrapper:/*#__PURE__*/(0,T/* .css */.AH)("position:relative;textarea{padding-bottom:",u/* .spacing["40"] */.YK["40"]," !important;}"),inspireButton:/*#__PURE__*/(0,T/* .css */.AH)(E/* .styleUtils.resetButton */.x.resetButton,";",p/* .typography.small */.I.small(),";position:absolute;height:28px;bottom:",u/* .spacing["12"] */.YK["12"],";left:",u/* .spacing["12"] */.YK["12"],";border:1px solid ",u/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",u/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;gap:",u/* .spacing["4"] */.YK["4"],";color:",u/* .colorTokens.text.brand */.I6.text.brand,";padding-inline:",u/* .spacing["12"] */.YK["12"],";background-color:",u/* .colorTokens.background.white */.I6.background.white,";&:hover{background-color:",u/* .colorTokens.background.brand */.I6.background.brand,";color:",u/* .colorTokens.text.white */.I6.text.white,";}&:focus-visible{outline:2px solid ",u/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:disabled{background-color:",u/* .colorTokens.background.disable */.I6.background.disable,";color:",u/* .colorTokens.text.disable */.I6.text.disable,";}")}},22951:function(e,t,n){n.d(t,{z:()=>E});/* import */var r=n(41374);/* import */var i=n(84577);/* import */var a=n(2445);/* import */var o=n(17437);/* import */var s=n(12470);/* import */var l=/*#__PURE__*/n.n(s);/* import */var d=n(41594);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(66273);/* import */var p=n(90209);/* import */var v=n(35198);/* import */var h=n(10840);/* import */var f=n(24219);/* import */var g=n(8501);/* import */var _=n(47617);/* import */var m=n(36512);/* import */var b=n(66283);/* import */var y=n(36154);/* import */var w=n(85713);/* import */var x=n(31873);function A(){var e=(0,i._)(["\n      background-position: top left;\n    "]);A=function t(){return e};return e}function Y(){var e=(0,i._)(["\n      background-position: top right;\n      animation-delay: 0.5s;\n    "]);Y=function t(){return e};return e}function k(){var e=(0,i._)(["\n      background-position: bottom left;\n      animation-delay: 1.5s;\n    "]);k=function t(){return e};return e}function I(){var e=(0,i._)(["\n      background-position: bottom right;\n      animation-delay: 1s;\n    "]);I=function t(){return e};return e}function D(){var e=(0,i._)(["\n      outline-color: ",";\n\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);D=function t(){return e};return e}var C=[{label:(0,s.__)("Magic Fill","tutor"),value:"magic-fill",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"magicWand",width:24,height:24})},// @TODO: will be implemented in the future
// {
//   label: __('Object eraser', __TUTOR_TEXT_DOMAIN__),
//   value: 'magic-erase',
//   icon: <SVGIcon name="eraser" width={24} height={24} />,
// },
// {
//   label: __('Variations', __TUTOR_TEXT_DOMAIN__),
//   value: 'variations',
//   icon: <SVGIcon name="reload" width={24} height={24} />,
// },
{label:(0,s.__)("Download","tutor"),value:"download",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"download",width:24,height:24})}];var E=e=>{var{src:t,loading:n,index:i}=e;var o=(0,d.useRef)(null);var[l,c]=(0,d.useState)(false);var{onDropdownMenuChange:h,setCurrentImage:f,onCloseModal:y,field:A}=(0,x/* .useMagicImageGeneration */.A6)();var Y=(0,m/* .useStoreAIGeneratedImageMutation */.ah)();if(n||!t){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:T.loader(i+1)})}return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:T.image({isActive:Y.isPending}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:t,alt:(0,s.__)("Generated Image","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-actions":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:T.useButton,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(u/* ["default"] */.A,{variant:"primary",disabled:Y.isPending,onClick:()=>(0,r._)(function*(){if(!t){return}var e=yield Y.mutateAsync({image:t});if(e.data){A.onChange(e.data);y()}})(),loading:Y.isPending,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"download",width:24,height:24}),(0,s.__)("Use This","tutor")]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(u/* ["default"] */.A,{variant:"primary",size:"icon",css:T.threeDots,ref:o,onClick:()=>c(true),children:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"threeDotsVertical",width:24,height:24})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{triggerRef:o,isOpen:l,arrow:true,closePopover:()=>{c(false)},animationType:_/* .AnimationType.slideDown */.J6.slideDown,maxWidth:"160px",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:T.dropdownOptions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{each:C,children:(e,n)=>/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:T.dropdownItem,onClick:()=>{switch(e.value){case"magic-fill":{f(t);h(e.value);break}case"download":{var n="".concat((0,w/* .nanoid */.Ak)(),".png");(0,b/* .downloadBase64Image */.JD)(t,n);break}default:break}c(false)},children:[e.icon,e.label]},n)})})})]})};var q=/*#__PURE__*/(0,o/* .keyframes */.i7)("		0%{opacity:0.3;}25%{opacity:0.5;}50%{opacity:0.7;}75%{opacity:0.5;}100%{opacity:0.3;}");var T={loader:e=>/*#__PURE__*/(0,o/* .css */.AH)("border-radius:",h/* .borderRadius["12"] */.Vq["12"],";background:linear-gradient(\n      73.09deg,#ff9645 18.05%,#ff6471 30.25%,#cf6ebd 55.42%,#a477d1 71.66%,#3e64de 97.9%\n    );position:relative;width:100%;height:100%;background-size:612px 612px;opacity:0.3;transition:opacity 0.5s ease;animation:",q," 2s linear infinite;",e===1&&(0,o/* .css */.AH)(A())," ",e===2&&(0,o/* .css */.AH)(Y()),"		",e===3&&(0,o/* .css */.AH)(k()),"		",e===4&&(0,o/* .css */.AH)(I())),image:e=>{var{isActive:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;overflow:hidden;border-radius:",h/* .borderRadius["12"] */.Vq["12"],";position:relative;outline:2px solid transparent;outline-offset:2px;transition:border-radius 0.3s ease;[data-actions]{opacity:0;transition:opacity 0.3s ease;}img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}",t&&(0,o/* .css */.AH)(D(),h/* .colorTokens.stroke.brand */.I6.stroke.brand),"    &:hover,&:focus-within{outline-color:",h/* .colorTokens.stroke.brand */.I6.stroke.brand,";[data-actions]{opacity:1;}}")},threeDots:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:",h/* .spacing["8"] */.YK["8"],";right:",h/* .spacing["8"] */.YK["8"],";border-radius:",h/* .borderRadius["4"] */.Vq["4"],";"),useButton:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;left:50%;bottom:",h/* .spacing["12"] */.YK["12"],";transform:translateX(-50%);button{display:inline-flex;align-items:center;gap:",h/* .spacing["4"] */.YK["4"],";}"),dropdownOptions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;padding-block:",h/* .spacing["8"] */.YK["8"],";"),dropdownItem:/*#__PURE__*/(0,o/* .css */.AH)(f/* .typography.small */.I.small(),";",y/* .styleUtils.resetButton */.x.resetButton,";height:40px;display:flex;gap:",h/* .spacing["10"] */.YK["10"],";align-items:center;transition:background-color 0.3s ease;color:",h/* .colorTokens.text.title */.I6.text.title,";padding-inline:",h/* .spacing["8"] */.YK["8"],";cursor:pointer;svg{color:",h/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background-color:",h/* .colorTokens.background.hover */.I6.background.hover,";}")}},20651:function(e,t,n){n.d(t,{A:()=>M});/* import */var r=n(41374);/* import */var i=n(71893);/* import */var a=n(55456);/* import */var o=n(2445);/* import */var s=n(66273);/* import */var l=n(90209);/* import */var d=n(45257);/* import */var c=n(64194);/* import */var u=n(61046);/* import */var p=n(10840);/* import */var v=n(24219);/* import */var h=n(84133);/* import */var f=n(68118);/* import */var g=n(57148);/* import */var _=n(36512);/* import */var m=n(66283);/* import */var b=n(36154);/* import */var y=n(85713);/* import */var w=n(17437);/* import */var x=n(12470);/* import */var A=/*#__PURE__*/n.n(x);/* import */var Y=n(41594);/* import */var k=/*#__PURE__*/n.n(Y);/* import */var I=n(49785);/* import */var D=n(6575);/* import */var C=n(31873);/* import */var E=n(87233);var q=620;var T=620;var S=()=>{var e=(0,g/* .useFormWithGlobalError */.p)({defaultValues:{brush_size:40,prompt:""}});var t=(0,_/* .useMagicFillImageMutation */.wt)();var n=(0,Y.useRef)(null);var{onDropdownMenuChange:p,currentImage:v,field:b,onCloseModal:A}=(0,C/* .useMagicImageGeneration */.A6)();var k=(0,_/* .useStoreAIGeneratedImageMutation */.ah)();var S=(0,f/* .useDebounce */.d)(e.watch("brush_size",40));var[M,H]=(0,Y.useState)([]);var[K,O]=(0,Y.useState)(1);var F=(0,Y.useCallback)((e,t)=>{var r;var i=(r=n.current)===null||r===void 0?void 0:r.getContext("2d");if(!i){return}for(var a of t.slice(0,e)){i.putImageData(a,0,0)}},[]);(0,Y.useEffect)(()=>{var e;var t=(e=n.current)===null||e===void 0?void 0:e.getContext("2d");if(!t){return}t.lineWidth=S},[S]);(0,Y.useEffect)(()=>{var e=e=>{if(e.metaKey){if(e.shiftKey&&e.key.toUpperCase()==="Z"){F(K+1,M);O(e=>Math.min(e+1,M.length));return}if(e.key.toUpperCase()==="Z"){F(K-1,M);O(e=>Math.max(e-1,1));return}}};window.addEventListener("keydown",e);return()=>{window.removeEventListener("keydown",e)}},[K,M,F]);if(!v){return null}return/*#__PURE__*/(0,o/* .jsxs */.FD)("form",{css:E/* .magicAIStyles.wrapper */.C.wrapper,onSubmit:e.handleSubmit(e=>(0,r._)(function*(){var r=n.current;var i=r===null||r===void 0?void 0:r.getContext("2d");if(!r||!i){return}var a={prompt:e.prompt,image:(0,m/* .getImageData */.M5)(r)};var o=yield t.mutateAsync(a);if(o){var s=new Image;s.onload=()=>{r.width=q;r.height=T;i.drawImage(s,0,0,r.width,r.height);i.lineWidth=S;i.lineJoin="round";i.lineCap="round"};s.src=o}})()),children:[/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:E/* .magicAIStyles.left */.C.left,children:/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.leftWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.actionBar,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.backButtonWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("button",{type:"button",css:z.backButton,onClick:()=>p("generation"),children:/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"arrowLeft"})}),(0,x.__)("Magic Fill","tutor")]}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.actions,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,{variant:"ghost",disabled:M.length===0,onClick:()=>{F(1,M);H(M.slice(0,1));O(1)},children:(0,x.__)("Revert to Original","tutor")}),/*#__PURE__*/(0,o/* .jsx */.Y)(d/* .Separator */.w,{variant:"vertical",css:/*#__PURE__*/(0,w/* .css */.AH)("min-height:16px;")}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.undoRedo,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,{variant:"ghost",size:"icon",disabled:K<=1,onClick:()=>{F(K-1,M);O(e=>Math.max(e-1,1))},children:/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"undo",width:20,height:20})}),/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,{variant:"ghost",size:"icon",disabled:K===M.length,onClick:()=>{F(K+1,M);O(e=>Math.min(e+1,M.length))},children:/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"redo",width:20,height:20})})]})]})]}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.canvasAndLoading,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(D/* .DrawingCanvas */.f,{ref:n,width:q,height:T,src:v,brushSize:S,trackStack:M,pointer:K,setTrackStack:H,setPointer:O}),/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{when:t.isPending,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:z.loading})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:z.footerActions,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:z.footerActionsLeft,children:/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,{variant:"secondary",onClick:()=>{var e="".concat((0,y/* .nanoid */.Ak)(),".png");var{canvas:t}=(0,m/* .getCanvas */.dX)(n);if(!t)return;(0,m/* .downloadBase64Image */.JD)((0,m/* .getImageData */.M5)(t),e)},children:/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"download",width:24,height:24})})})})]})}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:E/* .magicAIStyles.right */.C.right,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.fields,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(I/* .Controller */.xI,{control:e.control,name:"brush_size",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(c/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:"Brush Size",min:1,max:100,isMagicAi:true,hasBorder:true}))}),/*#__PURE__*/(0,o/* .jsx */.Y)(I/* .Controller */.xI,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(u/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,x.__)("Describe the Fill","tutor"),placeholder:(0,x.__)("Write 5 words to describe...","tutor"),rows:4,isMagicAi:true}))})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:[E/* .magicAIStyles.rightFooter */.C.rightFooter,/*#__PURE__*/(0,w/* .css */.AH)("margin-top:auto;")],children:/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:z.footerButtons,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)(s/* ["default"] */.A,{type:"submit",disabled:t.isPending||!e.watch("prompt"),children:[/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,{name:"magicWand",width:24,height:24}),(0,x.__)("Generative Erase","tutor")]}),/*#__PURE__*/(0,o/* .jsx */.Y)(s/* ["default"] */.A,{variant:"primary_outline",disabled:t.isPending,loading:k.isPending,onClick:()=>(0,r._)(function*(){var{canvas:e}=(0,m/* .getCanvas */.dX)(n);if(!e)return;var t=yield k.mutateAsync({image:(0,m/* .getImageData */.M5)(e)});if(t.data){b.onChange(t.data);A()}})(),children:(0,x.__)("Use Image","tutor")})]})})]})]})};/* export default */const M=S;var H={loading:/*#__PURE__*/(0,w/* .keyframes */.i7)("0%{opacity:0;}50%{opacity:0.6;}100%{opacity:0;}"),walker:/*#__PURE__*/(0,w/* .keyframes */.i7)("0%{left:0%;}100%{left:100%;}")};var z={canvasAndLoading:/*#__PURE__*/(0,w/* .css */.AH)("position:relative;z-index:",p/* .zIndex.positive */.fE.positive,";"),loading:/*#__PURE__*/(0,w/* .css */.AH)("position:absolute;top:0;left:0;width:100%;height:100%;background:",p/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";opacity:0.6;transition:0.5s ease opacity;animation:",H.loading," 1s linear infinite;z-index:0;&::before{content:'';position:absolute;top:0;left:0;width:200px;height:100%;background:linear-gradient(\n        270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 51.13%,rgba(255,255,255,0) 100%\n      );animation:",H.walker," 1s linear infinite;}"),actionBar:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),fields:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;flex-direction:column;gap:",p/* .spacing["12"] */.YK["12"],";"),leftWrapper:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;flex-direction:column;gap:",p/* .spacing["8"] */.YK["8"],";padding-block:",p/* .spacing["16"] */.YK["16"],";"),footerButtons:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;flex-direction:column;gap:",p/* .spacing["8"] */.YK["8"],";"),footerActions:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;justify-content:space-between;"),footerActionsLeft:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["12"] */.YK["12"],";"),actions:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["16"] */.YK["16"],";"),undoRedo:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["12"] */.YK["12"],";"),backButtonWrapper:/*#__PURE__*/(0,w/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["8"] */.YK["8"],";",v/* .typography.body */.I.body("medium"),";color:",p/* .colorTokens.text.title */.I6.text.title,";"),backButton:/*#__PURE__*/(0,w/* .css */.AH)(b/* .styleUtils.resetButton */.x.resetButton,";width:24px;height:24px;border-radius:",p/* .borderRadius["4"] */.Vq["4"],";border:1px solid ",p/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;align-items:center;justify-content:center;"),image:/*#__PURE__*/(0,w/* .css */.AH)("width:492px;height:498px;position:relative;img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}"),canvasWrapper:/*#__PURE__*/(0,w/* .css */.AH)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,w/* .css */.AH)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",p/* .borderRadius.circle */.Vq.circle,";background:linear-gradient(\n      73.09deg,rgba(255,150,69,0.4) 18.05%,rgba(255,100,113,0.4) 30.25%,rgba(207,110,189,0.4) 55.42%,rgba(164,119,209,0.4) 71.66%,rgba(62,100,222,0.4) 97.9%\n    );border:3px solid ",p/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",p/* .zIndex.highest */.fE.highest,";display:none;")}},87233:function(e,t,n){n.d(t,{C:()=>a});/* import */var r=n(10840);/* import */var i=n(17437);var a={wrapper:/*#__PURE__*/(0,i/* .css */.AH)("min-width:1000px;display:grid;grid-template-columns:1fr 330px;",r/* .Breakpoint.tablet */.EA.tablet,"{min-width:auto;grid-template-columns:1fr;width:100%;}"),left:/*#__PURE__*/(0,i/* .css */.AH)("display:flex;justify-content:center;align-items:center;background-color:#f7f7f7;z-index:",r/* .zIndex.level */.fE.level,";"),right:/*#__PURE__*/(0,i/* .css */.AH)("padding:",r/* .spacing["20"] */.YK["20"],";display:flex;flex-direction:column;align-items:space-between;z-index:",r/* .zIndex.positive */.fE.positive,";"),rightFooter:/*#__PURE__*/(0,i/* .css */.AH)("display:flex;flex-direction:column;gap:",r/* .spacing["8"] */.YK["8"],";margin-top:auto;padding-top:80px;")}},39655:function(e,t,n){n.d(t,{A:()=>c});/* import */var r=n(2445);/* import */var i=n(31873);/* import */var a=n(40528);/* import */var o=n(20651);/* import */var s=n(25405);function l(){var{state:e}=(0,i/* .useMagicImageGeneration */.A6)();switch(e){case"generation":return/*#__PURE__*/(0,r/* .jsx */.Y)(a/* .ImageGeneration */.u,{});case"magic-fill":return/*#__PURE__*/(0,r/* .jsx */.Y)(o/* ["default"] */.A,{});default:return null}}var d=e=>{var{title:t,icon:n,closeModal:a,field:o,fieldState:d}=e;return/*#__PURE__*/(0,r/* .jsx */.Y)(s/* ["default"] */.A,{onClose:a,title:t,icon:n,maxWidth:1e3,children:/*#__PURE__*/(0,r/* .jsx */.Y)(i/* .MagicImageGenerationProvider */.co,{field:o,fieldState:d,onCloseModal:a,children:/*#__PURE__*/(0,r/* .jsx */.Y)(l,{})})})};/* export default */const c=d},39643:function(e,t,n){n.d(t,{A:()=>f});/* import */var r=n(2445);/* import */var i=n(17437);/* import */var a=n(90209);/* import */var o=n(66238);/* import */var s=n(54527);/* import */var l=n(95729);/* import */var d=n(10840);/* import */var c=n(24219);/* import */var u=n(84133);/* import */var p=n(54203);/* import */var v=n(36154);var h=e=>{var{children:t,onClose:n,title:i,subtitle:l,icon:d,headerChildren:c,entireHeader:v,actions:h,maxWidth:f=1218,blurTriggerElement:_=true}=e;(0,p/* .useScrollLock */.K$)();return/*#__PURE__*/(0,r/* .jsx */.Y)(s/* ["default"] */.A,{blurPrevious:_,children:/*#__PURE__*/(0,r/* .jsxs */.FD)("div",{css:g.container({maxWidth:f}),children:[/*#__PURE__*/(0,r/* .jsx */.Y)("div",{css:g.header({hasHeaderChildren:!!c}),children:/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:v,fallback:/*#__PURE__*/(0,r/* .jsxs */.FD)(r/* .Fragment */.FK,{children:[/*#__PURE__*/(0,r/* .jsxs */.FD)("div",{css:g.headerContent,children:[/*#__PURE__*/(0,r/* .jsxs */.FD)("div",{css:g.iconWithTitle,children:[/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:d,children:d}),/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:i,children:/*#__PURE__*/(0,r/* .jsx */.Y)("h6",{css:g.title,title:typeof i==="string"?i:"",children:i})})]}),/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:l,children:/*#__PURE__*/(0,r/* .jsx */.Y)("span",{css:g.subtitle,children:l})})]}),/*#__PURE__*/(0,r/* .jsx */.Y)("div",{css:g.headerChildren,children:/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:c,children:c})}),/*#__PURE__*/(0,r/* .jsx */.Y)("div",{css:g.actionsWrapper,children:/*#__PURE__*/(0,r/* .jsx */.Y)(u/* ["default"] */.A,{when:h,fallback:/*#__PURE__*/(0,r/* .jsx */.Y)("button",{type:"button",css:g.closeButton,onClick:n,children:/*#__PURE__*/(0,r/* .jsx */.Y)(a/* ["default"] */.A,{name:"times",width:14,height:14})}),children:h})})]}),children:v})}),/*#__PURE__*/(0,r/* .jsx */.Y)("div",{css:g.content,children:/*#__PURE__*/(0,r/* .jsx */.Y)(o/* ["default"] */.A,{children:t})})]})})};/* export default */const f=h;var g={container:e=>{var{maxWidth:t}=e;return/*#__PURE__*/(0,i/* .css */.AH)("position:relative;background:",d/* .colorTokens.background.white */.I6.background.white,";margin:",l/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px auto ",d/* .spacing["24"] */.YK["24"],";height:100%;max-width:",t,"px;box-shadow:",d/* .shadow.modal */.r7.modal,";border-radius:",d/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;bottom:0;z-index:",d/* .zIndex.modal */.fE.modal,";width:100%;",d/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:90%;}")},header:e=>{var{hasHeaderChildren:t}=e;return/*#__PURE__*/(0,i/* .css */.AH)("display:grid;grid-template-columns:",t?"1fr auto 1fr":"1fr auto auto",";gap:",d/* .spacing["8"] */.YK["8"],";align-items:center;width:100%;height:",l/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT,"px;background:",d/* .colorTokens.background.white */.I6.background.white,";border-bottom:1px solid ",d/* .colorTokens.stroke.divider */.I6.stroke.divider,";position:sticky;")},headerContent:/*#__PURE__*/(0,i/* .css */.AH)("place-self:center start;display:inline-flex;align-items:center;gap:",d/* .spacing["12"] */.YK["12"],";padding-left:",d/* .spacing["24"] */.YK["24"],";",d/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",d/* .spacing["16"] */.YK["16"],";}"),headerChildren:/*#__PURE__*/(0,i/* .css */.AH)("place-self:center center;"),iconWithTitle:/*#__PURE__*/(0,i/* .css */.AH)("display:inline-flex;align-items:center;gap:",d/* .spacing["4"] */.YK["4"],";flex-shrink:0;color:",d/* .colorTokens.icon["default"] */.I6.icon["default"],";"),title:/*#__PURE__*/(0,i/* .css */.AH)(c/* .typography.heading6 */.I.heading6("medium"),";color:",d/* .colorTokens.text.title */.I6.text.title,";text-transform:none;letter-spacing:normal;"),subtitle:/*#__PURE__*/(0,i/* .css */.AH)(v/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)," ",c/* .typography.caption */.I.caption(),";color:",d/* .colorTokens.text.hints */.I6.text.hints,";padding-left:",d/* .spacing["12"] */.YK["12"],";border-left:1px solid ",d/* .colorTokens.icon.hints */.I6.icon.hints,";"),actionsWrapper:/*#__PURE__*/(0,i/* .css */.AH)("place-self:center end;display:inline-flex;gap:",d/* .spacing["16"] */.YK["16"],";padding-right:",d/* .spacing["24"] */.YK["24"],";",d/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",d/* .spacing["16"] */.YK["16"],";}"),closeButton:/*#__PURE__*/(0,i/* .css */.AH)(v/* .styleUtils.resetButton */.x.resetButton,";display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",d/* .borderRadius.circle */.Vq.circle,";background:",d/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",d/* .colorTokens.background.white */.I6.background.white,";}svg{color:",d/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",d/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",d/* .shadow.focus */.r7.focus,";}"),content:/*#__PURE__*/(0,i/* .css */.AH)("height:calc(100% - ",l/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT+l/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px);background-color:",d/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";overflow-x:hidden;",v/* .styleUtils.overflowYAuto */.x.overflowYAuto)}},68118:function(e,t,n){n.d(t,{d:()=>a});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);var a=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:300;var[n,i]=(0,r.useState)(e);(0,r.useEffect)(()=>{var n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]);return n}},87018:function(e,t,n){n.d(t,{$:()=>l});/* import */var r=n(71893);/* import */var i=n(51298);/* import */var a=n(41594);/* import */var o=/*#__PURE__*/n.n(a);var s={defaultValue:false};var l=e=>{var t=(0,a.useRef)(null);var n=(0,r._)({},s,e);var[o,l]=(0,a.useState)(n.defaultValue);(0,a.useEffect)(()=>{if(!(0,i/* .isDefined */.O9)(t.current)){return}if(t.current.scrollHeight<=t.current.clientHeight){l(false);return}var e=e=>{var t=e.target;if(t.scrollTop+t.clientHeight>=t.scrollHeight){l(false);return}l(t.scrollTop>=0)};t.current.addEventListener("scroll",e);return()=>{var n;(n=t.current)===null||n===void 0?void 0:n.removeEventListener("scroll",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.current]);return{ref:t,isScrolling:o}}},35804:function(e,t,n){n.d(t,{A:()=>u});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(12470);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var d=n(45549);var c=e=>{var{options:t={},onChange:n,initialFiles:o}=e;var{showToast:l}=(0,d/* .useToast */.d)();var c=(0,s.useMemo)(()=>o?Array.isArray(o)?o:[o]:[],[o]);var u=(0,s.useMemo)(()=>(0,i._)((0,r._)({},t,t.type?{library:{type:t.type}}:{}),{multiple:t.multiple?t.multiple===true?"add":t.multiple:false}),[t]);var[p,v]=(0,s.useState)(c);(0,s.useEffect)(()=>{if(c&&!p.length){v(c)}},[p,c]);var h=(0,s.useCallback)(()=>{var e;if(!((e=window.wp)===null||e===void 0?void 0:e.media)){// eslint-disable-next-line no-console
console.error("WordPress media library is not available");return}var t=window.wp.media(u);t.on("close",()=>{if(t.$el){t.$el.parent().parent().remove()}});t.on("open",()=>{var e=t.state().get("selection");t.$el.attr("data-focus-trap","true");e.reset();p.forEach(t=>{var n=window.wp.media.attachment(t.id);if(n){n.fetch();e.add(n)}})});t.on("select",()=>{var e=t.state().get("selection").toJSON();var r=new Set(e.map(e=>e.id));var i=p.filter(e=>r.has(e.id));var o=e.reduce((e,t)=>{if(i.some(e=>e.id===t.id)){return e}if(u.maxFileSize&&t.filesizeInBytes>u.maxFileSize){l({// translators: %s is the file title
message:(0,a.sprintf)((0,a.__)("%s size exceeds the maximum allowed size","tutor"),t.title),type:"danger"});return e}var n={id:t.id,title:t.title,url:t.url,name:t.title,size:t.filesizeHumanReadable,size_bytes:t.filesizeInBytes,ext:t.filename.split(".").pop()||""};e.push(n);return e},[]);var s=u.multiple?[...i,...o]:o.slice(0,1);if(u.maxFiles&&s.length>u.maxFiles){l({// translators: %d is the maximum number of files allowed
message:(0,a.sprintf)((0,a.__)("Cannot select more than %d files","tutor"),u.maxFiles),type:"warning"});return}v(s);n===null||n===void 0?void 0:n(u.multiple?s:s[0]||null);t.close()});t.open()},[u,n,p,l]);var f=(0,s.useCallback)(()=>{v([]);n===null||n===void 0?void 0:n(u.multiple?[]:null)},[u.multiple,n]);return{openMediaLibrary:h,existingFiles:p,resetFiles:f}};/* export default */const u=c},95759:function(e,t,n){n.d(t,{A:()=>g});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(42338);/* import */var d=n(10840);/* import */var c=n(24219);/* import */var u=n(47617);/* import */var p=n(36154);/* import */var v=n(35198);function h(){var e=(0,r._)(["\n      button:last-of-type {\n        color: ",";\n      }\n    "]);h=function t(){return e};return e}var f=e=>{var{placement:t,triggerRef:n,isOpen:r,title:a,message:s,onConfirmation:d,onCancel:c,isLoading:p=false,gap:h,maxWidth:f,closePopover:g,animationType:m=u/* .AnimationType.slideLeft */.J6.slideLeft,arrow:b=false,confirmButton:y,cancelButton:w,positionModifier:x}=e;var A,Y,k,I,D;return/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{triggerRef:n,isOpen:r,arrow:b,placement:t,closePopover:g,animationType:m,maxWidth:f,positionModifier:x,gap:h,children:/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:_.content,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:_.body,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:_.title,children:a}),/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:_.description,children:s})]}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:_.footer({isDelete:(A=y===null||y===void 0?void 0:y.isDelete)!==null&&A!==void 0?A:false}),children:[/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{variant:(Y=w===null||w===void 0?void 0:w.variant)!==null&&Y!==void 0?Y:"text",size:"small",onClick:c!==null&&c!==void 0?c:g,children:(k=w===null||w===void 0?void 0:w.text)!==null&&k!==void 0?k:(0,o.__)("Cancel","tutor")}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{"data-cy":"confirm-button",variant:(I=y===null||y===void 0?void 0:y.variant)!==null&&I!==void 0?I:"text",onClick:()=>{d();g()},loading:p,size:"small",children:(D=y===null||y===void 0?void 0:y.text)!==null&&D!==void 0?D:(0,o.__)("Ok","tutor")})]})]})})};/* export default */const g=f;var _={content:/*#__PURE__*/(0,a/* .css */.AH)("background-color:",d/* .colorTokens.surface.tutor */.I6.surface.tutor,";box-shadow:",d/* .shadow.popover */.r7.popover,";border-radius:",d/* .borderRadius["6"] */.Vq["6"],";::-webkit-scrollbar{background-color:",d/* .colorTokens.surface.tutor */.I6.surface.tutor,";width:10px;}::-webkit-scrollbar-thumb{background-color:",d/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";border-radius:",d/* .borderRadius["6"] */.Vq["6"],";}"),title:/*#__PURE__*/(0,a/* .css */.AH)(c/* .typography.small */.I.small("medium"),";color:",d/* .colorTokens.text.primary */.I6.text.primary,";"),description:/*#__PURE__*/(0,a/* .css */.AH)(c/* .typography.small */.I.small(),";color:",d/* .colorTokens.text.subdued */.I6.text.subdued,";"),body:/*#__PURE__*/(0,a/* .css */.AH)("padding:",d/* .spacing["16"] */.YK["16"]," ",d/* .spacing["20"] */.YK["20"]," ",d/* .spacing["12"] */.YK["12"],";",p/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",d/* .spacing["8"] */.YK["8"],";"),footer:e=>{var{isDelete:t=false}=e;return/*#__PURE__*/(0,a/* .css */.AH)(p/* .styleUtils.display.flex */.x.display.flex(),";padding:",d/* .spacing["4"] */.YK["4"]," ",d/* .spacing["16"] */.YK["16"]," ",d/* .spacing["8"] */.YK["8"],";justify-content:end;gap:",d/* .spacing["10"] */.YK["10"],";",t&&(0,a/* .css */.AH)(h(),d/* .colorTokens.text.error */.I6.text.error))}}},19595:function(e,t,n){n.d(t,{A:()=>m});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(17437);/* import */var o=n(10840);/* import */var s=n(24219);/* import */var l=n(84133);/* import */var d=n(51298);function c(){var e=(0,r._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      background-color: ",";\n    "]);c=function t(){return e};return e}function u(){var e=(0,r._)(["\n      gap: ",";\n      padding: ",";\n      padding-bottom: ",";\n    "]);u=function t(){return e};return e}function p(){var e=(0,r._)(["\n        max-width: 282px;\n      "]);p=function t(){return e};return e}function v(){var e=(0,r._)(["\n      gap: ",";\n    "]);v=function t(){return e};return e}function h(){var e=(0,r._)(["\n      ",";\n      color: ",";\n    "]);h=function t(){return e};return e}function f(){var e=(0,r._)(["\n      ",";\n      color: ",";\n    "]);f=function t(){return e};return e}function g(){var e=(0,r._)(["\n      gap: ",";\n      margin-top: ",";\n    "]);g=function t(){return e};return e}var _=e=>{var{emptyStateImage:t,emptyStateImage2x:n,imageAltText:r,title:a,size:o="medium",description:s,actions:c,removeBorder:u=true,wrapperCss:p}=e;return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[b.bannerWrapper(o,u,!!(0,d/* .isDefined */.O9)(t)),p],children:[/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:t,children:/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:t,alt:r,srcSet:n?"".concat(n," 2x"):""})}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.messageWrapper(o),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("h5",{css:b.title(o),children:a}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:s,children:/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:b.description(o),children:s})}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:c,children:/*#__PURE__*/(0,i/* .jsx */.Y)("div",{"data-actions":true,css:b.actionWrapper(o),children:c})})]})]})};/* export default */const m=_;var b={bannerWrapper:(e,t,n)=>/*#__PURE__*/(0,a/* .css */.AH)("display:grid;place-items:center;justify-content:center;gap:",o/* .spacing["36"] */.YK["36"],";padding:",n?"".concat(o/* .spacing["16"] */.YK["16"]," ").concat(o/* .spacing["20"] */.YK["20"]):"".concat(o/* .spacing["20"] */.YK["20"]),";",!t&&(0,a/* .css */.AH)(c(),o/* .colorTokens.stroke.divider */.I6.stroke.divider,o/* .borderRadius.card */.Vq.card,o/* .colorTokens.background.white */.I6.background.white)," ",e==="small"&&(0,a/* .css */.AH)(u(),o/* .spacing["12"] */.YK["12"],n?o/* .spacing["12"] */.YK["12"]:o/* .spacing["16"] */.YK["16"],n?o/* .spacing["24"] */.YK["24"]:undefined),"    & img{max-width:640px;width:100%;height:auto;border-radius:",e==="small"?o/* .borderRadius["6"] */.Vq["6"]:o/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;object-position:center;object-fit:cover;",e==="small"&&(0,a/* .css */.AH)(p()),"}"),messageWrapper:e=>/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;max-width:566px;width:100%;gap:",o/* .spacing["12"] */.YK["12"],";text-align:center;",e==="small"&&(0,a/* .css */.AH)(v(),o/* .spacing["8"] */.YK["8"])),title:e=>/*#__PURE__*/(0,a/* .css */.AH)(s/* .typography.heading5 */.I.heading5(),";color:",o/* .colorTokens.text.primary */.I6.text.primary,";",e==="small"&&(0,a/* .css */.AH)(h(),s/* .typography.caption */.I.caption("medium"),o/* .colorTokens.text.primary */.I6.text.primary)),description:e=>/*#__PURE__*/(0,a/* .css */.AH)(s/* .typography.body */.I.body(),";color:",o/* .colorTokens.text.hints */.I6.text.hints,";",e==="small"&&(0,a/* .css */.AH)(f(),s/* .typography.tiny */.I.tiny(),o/* .colorTokens.text.hints */.I6.text.hints)),actionWrapper:e=>/*#__PURE__*/(0,a/* .css */.AH)("margin-top:",o/* .spacing["20"] */.YK["20"],";display:flex;justify-content:center;align-items:center;gap:",o/* .spacing["12"] */.YK["12"],";",e==="small"&&(0,a/* .css */.AH)(g(),o/* .spacing["8"] */.YK["8"],o/* .spacing["8"] */.YK["8"]))}},28109:function(e,t,n){n.d(t,{A:()=>f});/* import */var r=n(84577);/* import */var i=n(2445);/* import */var a=n(10840);/* import */var o=n(36154);/* import */var s=n(17437);/* import */var l=n(41594);/* import */var d=/*#__PURE__*/n.n(l);function c(){var e=(0,r._)(["\n      flex-direction: column;\n      align-items: start;\n      box-shadow: none;\n    "]);c=function t(){return e};return e}function u(){var e=(0,r._)(["\n      width: 3px;\n      height: ","px;\n      top: ","px;\n      bottom: auto;\n      border-radius: 0 "," "," 0;\n    "]);u=function t(){return e};return e}function p(){var e=(0,r._)(["\n      width: 100%;\n      border-bottom: 1px solid ",";\n      justify-content: flex-start;\n\n      &:hover,\n      &:focus,\n      &:active {\n        border-bottom: 1px solid ",";\n      }\n    "]);p=function t(){return e};return e}function v(){var e=(0,r._)(["\n      &,\n      &:hover,\n      &:focus,\n      &:active {\n        background-color: ",";\n        color: ",";\n      }\n\n      & > span {\n        color: ",";\n      }\n\n      & > svg {\n        color: ",";\n      }\n    "]);v=function t(){return e};return e}var h=e=>{var{activeTab:t,onChange:n,tabList:r,orientation:a="horizontal",disabled:o=false,wrapperCss:s}=e;var d=(0,l.useRef)(r.map(()=>/*#__PURE__*/(0,l.createRef)()));var[c,u]=(0,l.useState)();(0,l.useEffect)(()=>{var e=r.reduce((e,t,n)=>{var r,i,a,o;var s=d.current[n];var l={width:((r=s.current)===null||r===void 0?void 0:r.offsetWidth)||0,height:((i=s.current)===null||i===void 0?void 0:i.offsetHeight)||0,left:((a=s.current)===null||a===void 0?void 0:a.offsetLeft)||0,top:((o=s.current)===null||o===void 0?void 0:o.offsetTop)||0};e[t.value]=l;return e},{});u(e)},[r]);return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:g.container,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:[g.wrapper(a),s],role:"tablist",children:r.map((e,r)=>{return/*#__PURE__*/(0,i/* .jsxs */.FD)("button",{onClick:()=>{n(e.value)},css:g.tabButton({isActive:t===e.value,orientation:a}),disabled:o||e.disabled,type:"button",role:"tab","aria-selected":t===e.value?"true":"false",ref:d.current[r],children:[e.icon,e.label,e.count!==undefined&&/*#__PURE__*/(0,i/* .jsxs */.FD)("span",{children:[" (",e.count<10&&e.count>0?"0".concat(e.count):e.count,")"]}),e.activeBadge&&/*#__PURE__*/(0,i/* .jsx */.Y)("span",{css:g.activeBadge})]},r)})}),/*#__PURE__*/(0,i/* .jsx */.Y)("span",{css:g.indicator((c===null||c===void 0?void 0:c[t])||{width:0,height:0,left:0,top:0},a)})]})};/* export default */const f=h;var g={container:/*#__PURE__*/(0,s/* .css */.AH)("position:relative;width:100%;"),wrapper:e=>/*#__PURE__*/(0,s/* .css */.AH)("width:100%;display:flex;justify-items:left;align-items:center;flex-wrap:wrap;box-shadow:",a/* .shadow.tabs */.r7.tabs,";",e==="vertical"&&(0,s/* .css */.AH)(c())),indicator:(e,t)=>/*#__PURE__*/(0,s/* .css */.AH)("width:",e.width,"px;height:3px;position:absolute;left:",e.left,"px;bottom:0;background:",a/* .colorTokens.brand.blue */.I6.brand.blue,";border-radius:",a/* .borderRadius["4"] */.Vq["4"]," ",a/* .borderRadius["4"] */.Vq["4"]," 0 0;transition:all 0.3s cubic-bezier(0.4,0,0.2,1) 0ms;:dir(rtl){left:auto;right:",e.left,"px;}",t==="vertical"&&(0,s/* .css */.AH)(u(),e.height,e.top,a/* .borderRadius["4"] */.Vq["4"],a/* .borderRadius["4"] */.Vq["4"])),tabButton:e=>{var{isActive:t,orientation:n}=e;return/*#__PURE__*/(0,s/* .css */.AH)(o/* .styleUtils.resetButton */.x.resetButton,";font-size:",a/* .fontSize["15"] */.J["15"],";line-height:",a/* .lineHeight["20"] */.K_["20"],";display:flex;justify-content:center;align-items:center;gap:",a/* .spacing["6"] */.YK["6"],";padding:",a/* .spacing["12"] */.YK["12"]," ",a/* .spacing["20"] */.YK["20"],";color:",a/* .colorTokens.text.subdued */.I6.text.subdued,";min-width:130px;position:relative;transition:color 0.3s ease-in-out;border-radius:0px;&:hover,&:focus,&:active{background-color:transparent;color:",a/* .colorTokens.text.subdued */.I6.text.subdued,";box-shadow:none;}& > svg{color:",a/* .colorTokens.icon["default"] */.I6.icon["default"],";}",n==="vertical"&&(0,s/* .css */.AH)(p(),a/* .colorTokens.stroke.border */.I6.stroke.border,a/* .colorTokens.stroke.border */.I6.stroke.border)," ",t&&(0,s/* .css */.AH)(v(),a/* .colorTokens.background.white */.I6.background.white,a/* .colorTokens.text.primary */.I6.text.primary,a/* .colorTokens.text.subdued */.I6.text.subdued,a/* .colorTokens.icon.brand */.I6.icon.brand),"    &:disabled{color:",a/* .colorTokens.text.disable */.I6.text.disable,";&::before{background:",a/* .colorTokens.text.disable */.I6.text.disable,";}}&:focus-visible{outline:2px solid ",a/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",a/* .borderRadius["4"] */.Vq["4"],";}")},activeBadge:/*#__PURE__*/(0,s/* .css */.AH)("display:inline-block;height:8px;width:8px;border-radius:",a/* .borderRadius.circle */.Vq.circle,";background-color:",a/* .colorTokens.color.success["80"] */.I6.color.success["80"],";")}},34469:function(e,t,n){n.d(t,{A:()=>D});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(31105);/* import */var o=n(84577);/* import */var s=n(2445);/* import */var l=n(17437);/* import */var d=n(3771);/* import */var c=/*#__PURE__*/n.n(d);/* import */var u=n(41594);/* import */var p=/*#__PURE__*/n.n(u);/* import */var v=n(90209);/* import */var h=n(10840);/* import */var f=n(24219);/* import */var g=n(47617);/* import */var _=n(94654);/* import */var m=n(36154);/* import */var b=n(35198);function y(){var e=(0,o._)(["\n      padding-block: ",";\n    "]);y=function t(){return e};return e}function w(){var e=(0,o._)(["\n      padding: "," ",";\n      ",";\n    "]);w=function t(){return e};return e}function x(){var e=(0,o._)(["\n      color: ",";\n      svg {\n        color: ",";\n      }\n\n      &:hover:not(:disabled) {\n        color: ",";\n        background-color: ",";\n\n        svg {\n          color: ",";\n        }\n      }\n\n      &:active {\n        color: ",";\n        background-color: ",";\n\n        svg {\n          color: ",";\n        }\n      }\n    "]);x=function t(){return e};return e}function A(){var e=(0,o._)(["\n      background-color: ",";\n      svg {\n        color: ",";\n      }\n    "]);A=function t(){return e};return e}function Y(){var e=(0,o._)(["\n      background-color: ",";\n      :hover {\n        background-color: ",";\n        svg {\n          color: ",";\n        }\n      }\n    "]);Y=function t(){return e};return e}var k=e=>{var{text:t,icon:n,onClick:o,onClosePopover:l,isTrash:d=false,size:c="medium",buttonCss:u,disabled:p}=e,v=(0,a._)(e,["text","icon","onClick","onClosePopover","isTrash","size","buttonCss","disabled"]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("button",(0,i._)((0,r._)({type:"button",css:[C.option({isTrash:d,size:c}),u],onClick:e=>{if(o){o(e)}if(l){l()}},disabled:p},v),{children:[n&&n,/*#__PURE__*/(0,s/* .jsx */.Y)("span",{children:t})]}))};var I=e=>{var{onClick:t,isOpen:n,disabled:o=false,closePopover:l,placement:d=_/* .POPOVER_PLACEMENTS.BOTTOM_RIGHT */.zA.BOTTOM_RIGHT,children:c,animationType:h=g/* .AnimationType.slideLeft */.J6.slideLeft,dotsOrientation:f="horizontal",maxWidth:m="148px",isInverse:y=false,arrow:w=false,size:x="medium",closeOnEscape:A=true,wrapperCss:Y}=e,k=(0,a._)(e,["onClick","isOpen","disabled","closePopover","placement","children","animationType","dotsOrientation","maxWidth","isInverse","arrow","size","closeOnEscape","wrapperCss"]);var I=(0,u.useRef)(null);return/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[/*#__PURE__*/(0,s/* .jsx */.Y)("button",(0,i._)((0,r._)({type:"button",ref:I,onClick:t,css:[C.button({isOpen:n,isInverse:y,isDisabled:o}),Y],disabled:o},k),{children:/*#__PURE__*/(0,s/* .jsx */.Y)(v/* ["default"] */.A,{name:f==="horizontal"?"threeDots":"threeDotsVertical",width:32,height:32})})),/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,{gap:13,maxWidth:m,placement:d,triggerRef:I,isOpen:n,closePopover:l,animationType:h,arrow:w,closeOnEscape:A,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:C.wrapper({size:x}),children:p().Children.map(c,e=>{if(/*#__PURE__*/p().isValidElement(e)){var t={size:x};return /*#__PURE__*/p().cloneElement(e,t)}return e})})})]})};I.Option=k;/* export default */const D=I;var C={wrapper:e=>{var{size:t="medium"}=e;return/*#__PURE__*/(0,l/* .css */.AH)("padding-block:",h/* .spacing["8"] */.YK["8"],";position:relative;",t==="small"&&(0,l/* .css */.AH)(y(),h/* .spacing["4"] */.YK["4"]))},option:e=>{var{isTrash:t=false,size:n="medium"}=e;return/*#__PURE__*/(0,l/* .css */.AH)(m/* .styleUtils.resetButton */.x.resetButton,";",f/* .typography.body */.I.body(),";width:100%;padding:",h/* .spacing["10"] */.YK["10"]," ",h/* .spacing["20"] */.YK["20"],";transition:background-color 0.3s ease-in-out;cursor:pointer;display:flex;align-items:center;gap:",h/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",h/* .colorTokens.text.primary */.I6.text.primary,";}svg{flex-shrink:0;color:",h/* .colorTokens.icon["default"] */.I6.icon["default"],";}",n==="small"&&(0,l/* .css */.AH)(w(),h/* .spacing["8"] */.YK["8"],h/* .spacing["16"] */.YK["16"],f/* .typography.small */.I.small("medium")),":hover:not(:disabled){background-color:",h/* .colorTokens.background.hover */.I6.background.hover,";color:",h/* .colorTokens.text.title */.I6.text.title,";svg{color:",h/* .colorTokens.icon.hover */.I6.icon.hover,";filter:grayscale(0%);}}:disabled{cursor:not-allowed;color:",h/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",h/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}}",t&&(0,l/* .css */.AH)(x(),h/* .colorTokens.text.error */.I6.text.error,h/* .colorTokens.icon.error */.I6.icon.error,h/* .colorTokens.text.error */.I6.text.error,c()(h/* .colorTokens.bg.error */.I6.bg.error,.1),h/* .colorTokens.icon.error */.I6.icon.error,h/* .colorTokens.text.error */.I6.text.error,h/* .colorTokens.color.danger["40"] */.I6.color.danger["40"],h/* .colorTokens.icon.error */.I6.icon.error),":focus-visible{outline:2px solid ",h/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-4px;border-radius:",h/* .borderRadius.input */.Vq.input,";}")},button:e=>{var{isOpen:t=false,isInverse:n=false,isDisabled:r=false}=e;return/*#__PURE__*/(0,l/* .css */.AH)(m/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",h/* .borderRadius.circle */.Vq.circle,";display:flex;justify-content:center;align-items:center;transition:background-color 0.3s ease-in-out;svg{color:",h/* .colorTokens.icon["default"] */.I6.icon["default"],";flex-shrink:0;}:hover{background-color:",h/* .colorTokens.background.hover */.I6.background.hover,";svg{color:",h/* .colorTokens.icon["default"] */.I6.icon["default"],";}}&:focus,&:active{background:none;}&:focus-visible{outline:2px solid ",h/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}",t&&(0,l/* .css */.AH)(A(),h/* .colorTokens.background.hover */.I6.background.hover,h/* .colorTokens.icon.brand */.I6.icon.brand)," ",n&&(0,l/* .css */.AH)(Y(),h/* .colorTokens.background.white */.I6.background.white,h/* .colorTokens.background.white */.I6.background.white,!r&&h/* .colorTokens.icon.brand */.I6.icon.brand),":disabled{cursor:not-allowed;}")}}},29245:function(e,t,n){n.d(t,{J:()=>s,s:()=>l});/* import */var r=n(71893);/* import */var i=n(55456);/* import */var a=n(15871);/* import */var o=n(43627);var s=e=>(0,o/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var l={droppable:{strategy:a/* .MeasuringStrategy.Always */.Pf.Always}}},66283:function(e,t,n){n.d(t,{JD:()=>o,KG:()=>i,M5:()=>d,dX:()=>l,kd:()=>r});function r(e,t){e.lineTo(t.x,t.y);e.stroke()}function i(e,t){var n=t.x-e.x;var r=t.y-e.y;return Math.sqrt(n*n+r*r)}function a(e){var t=atob(e.split(",")[1]);var n=e.split(",")[0].split(":")[1].split(";")[0];var r=new ArrayBuffer(t.length);var i=new Uint8Array(r);for(var a=0;a<t.length;a++){i[a]=t.charCodeAt(a)}return new Blob([r],{type:n})}function o(e,t){var n=a(e);var r=document.createElement("a");r.href=URL.createObjectURL(n);r.download=t;document.body.appendChild(r);r.click();document.body.removeChild(r)}function s(e,t){var n=document.createElement("canvas");n.width=1024;n.height=1024;var r=n.getContext("2d");r===null||r===void 0?void 0:r.putImageData(e,0,0);r===null||r===void 0?void 0:r.drawImage(n,0,0,1024,1024);return new Promise(e=>{n.toBlob(n=>{if(!n){e(null);return}e(new File([n],t,{type:"image/png"}))})})}var l=e=>{if(e&&typeof e!=="function"&&e.current){var t=e.current;var n=t.getContext("2d");return{canvas:t,context:n}}return{canvas:null,context:null}};var d=e=>{return e.toDataURL("image/png")}},38945:function(){/**
 * The symbol to access the `TZDate`'s function to construct a new instance from
 * the provided value. It helps date-fns to inherit the time zone.
 */const e=Symbol.for("constructDateFrom")},44880:function(e,t,n){n.d(t,{B:()=>a});/* import */var r=n(35581);/* import */var i=n(18525);class a extends i/* .TZDateMini */.q{//#region static
static tz(e,...t){return t.length?new a(...t,e):new a(Date.now(),e)}//#endregion
//#region representation
toISOString(){const[e,t,n]=this.tzComponents();const r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){// "Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)";
return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const[e,t,n,r]=this.internal.toUTCString().split(" ");// "Tue Aug 13 2024"
return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const e=this.internal.toUTCString().split(" ")[4];const[t,n,i]=this.tzComponents();// "07:42:23 GMT+0800 (Singapore Standard Time)"
return`${e} GMT${t}${n}${i} (${(0,r/* .tzName */.K)(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}//#endregion
//#region private
tzComponents(){const e=this.getTimezoneOffset();const t=e>0?"-":"+";const n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0");const r=String(Math.abs(e)%60).padStart(2,"0");return[t,n,r]}//#endregion
withTimeZone(e){return new a(+this,e)}//#region date-fns integration
[Symbol.for("constructDateFrom")](e){return new a(+new Date(e),this.timeZone)}}},18525:function(e,t,n){n.d(t,{q:()=>i});/* import */var r=n(90865);class i extends Date{//#region static
constructor(...e){super();if(e.length>1&&typeof e[e.length-1]==="string"){this.timeZone=e.pop()}this.internal=new Date;if(isNaN((0,r/* .tzOffset */.Y)(this.timeZone,this))){this.setTime(NaN)}else{if(!e.length){this.setTime(Date.now())}else if(typeof e[0]==="number"&&(e.length===1||e.length===2&&typeof e[1]!=="number")){this.setTime(e[0])}else if(typeof e[0]==="string"){this.setTime(+new Date(e[0]))}else if(e[0]instanceof Date){this.setTime(+e[0])}else{this.setTime(+new Date(...e));l(this,NaN);o(this)}}}static tz(e,...t){return t.length?new i(...t,e):new i(Date.now(),e)}//#endregion
//#region time zone
withTimeZone(e){return new i(+this,e)}getTimezoneOffset(){const e=-(0,r/* .tzOffset */.Y)(this.timeZone,this);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
return e>0?Math.floor(e):Math.ceil(e)}//#endregion
//#region time
setTime(e){Date.prototype.setTime.apply(this,arguments);o(this);return+this}//#endregion
//#region date-fns integration
[Symbol.for("constructDateFrom")](e){return new i(+new Date(e),this.timeZone)}}// Assign getters and setters
const a=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!a.test(e))return;const t=e.replace(a,"$1UTC");// Filter out methods without UTC counterparts
if(!i.prototype[t])return;if(e.startsWith("get")){// Delegate to internal date's UTC method
i.prototype[e]=function(){return this.internal[t]()}}else{// Assign regular setter
i.prototype[e]=function(){Date.prototype[t].apply(this.internal,arguments);s(this);return+this};// Assign UTC setter
i.prototype[t]=function(){Date.prototype[t].apply(this,arguments);o(this);return+this}}});/**
 * Function syncs time to internal date, applying the time zone offset.
 *
 * @param {Date} date - Date to sync
 */function o(e){e.internal.setTime(+e);e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(0,r/* .tzOffset */.Y)(e.timeZone,e)*60))}/**
 * Function syncs the internal date UTC values to the date. It allows to get
 * accurate timestamp value.
 *
 * @param {Date} date - The date to sync
 */function s(e){// First we transpose the internal values
Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate());Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds());// Now we have to adjust the date to the system time zone
l(e)}/**
 * Function adjusts the date to the system time zone. It uses the time zone
 * differences to calculate the offset and adjust the date.
 *
 * @param {Date} date - Date to adjust
 */function l(e){// Save the time zone offset before all the adjustments
const t=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const n=t>0?Math.floor(t):Math.ceil(t);//#region System DST adjustment
// The biggest problem with using the system time zone is that when we create
// a date from internal values stored in UTC, the system time zone might end
// up on the DST hour:
//
//   $ TZ=America/New_York node
//   > new Date(2020, 2, 8, 1).toString()
//   'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'
//   > new Date(2020, 2, 8, 2).toString()
//   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
//   > new Date(2020, 2, 8, 3).toString()
//   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
//   > new Date(2020, 2, 8, 4).toString()
//   'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'
//
// Here we get the same hour for both 2 and 3, because the system time zone
// has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have
// to adjust the internal date to reflect that.
//
// However we want to adjust only if that's the DST hour the change happenes,
// not the hour where DST moves to.
// We calculate the previous hour to see if the time zone offset has changed
// and we have landed on the DST hour.
const i=new Date(+e);// We use UTC methods here as we don't want to land on the same hour again
// in case of DST.
i.setUTCHours(i.getUTCHours()-1);// Calculate if we are on the system DST hour.
const a=-new Date(+e).getTimezoneOffset();const o=-new Date(+i).getTimezoneOffset();const s=a-o;// Detect the DST shift. System DST change will occur both on
const l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();// Move the internal date when we are on the system DST hour.
if(s&&l)e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);//#endregion
//#region System diff adjustment
// Now we need to adjust the date, since we just applied internal values.
// We need to calculate the difference between the system and date time zones
// and apply it to the date.
const d=a-n;if(d)Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);//#endregion
//#region Seconds System diff adjustment
const c=new Date(+e);// Set the UTC seconds to 0 to isolate the timezone offset in seconds.
c.setUTCSeconds(0);// For negative systemOffset, invert the seconds.
const u=a>0?c.getSeconds():(c.getSeconds()-60)%60;// Calculate the seconds offset based on the timezone offset.
const p=Math.round(-((0,r/* .tzOffset */.Y)(e.timeZone,e)*60))%60;if(p||u){e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p);Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+u)}//#endregion
//#region Post-adjustment DST fix
const v=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const h=v>0?Math.floor(v):Math.ceil(v);const f=-new Date(+e).getTimezoneOffset();const g=f-h;const _=h!==n;const m=g-d;if(_&&m){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);// Now we need to check if got offset change during the post-adjustment.
// If so, we also need both dates to reflect that.
const t=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const n=t>0?Math.floor(t):Math.ceil(t);const i=h-n;if(i){e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i)}}//#endregion
}},75583:function(e,t,n){n.d(t,{BB:()=>/* reexport safe */i.B});/* import */var r=n(38945);/* import */var i=n(44880);/* import */var a=n(18525);/* import */var o=n(61578)},61578:function(e,t,n){/* import */var r=n(44880);/**
 * The function creates accepts a time zone and returns a function that creates
 * a new `TZDate` instance in the time zone from the provided value. Use it to
 * provide the context for the date-fns functions, via the `in` option.
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 *
 * @returns Function that creates a new `TZDate` instance in the time zone
 */const i=e=>t=>TZDate.tz(e,+new Date(t))},35581:function(e,t,n){n.d(t,{K:()=>r});/**
 * Time zone name format.
 *//**
 * The function returns the time zone name for the given date in the specified
 * time zone.
 *
 * It uses the `Intl.DateTimeFormat` API and by default outputs the time zone
 * name in a long format, e.g. "Pacific Standard Time" or
 * "Singapore Standard Time".
 *
 * It is possible to specify the format as the third argument using one of the following options
 *
 * - "short": e.g. "EDT" or "GMT+8".
 * - "long": e.g. "Eastern Daylight Time".
 * - "shortGeneric": e.g. "ET" or "Singapore Time".
 * - "longGeneric": e.g. "Eastern Time" or "Singapore Standard Time".
 *
 * These options correspond to TR35 tokens `z..zzz`, `zzzz`, `v`, and `vvvv` respectively: https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 * @param date - Date object to get the time zone name for
 * @param format - Optional format of the time zone name. Defaults to "long". Can be "short", "long", "shortGeneric", or "longGeneric".
 *
 * @returns Time zone name (e.g. "Singapore Standard Time")
 */function r(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{// Enforces engine to render the time. Without the option JavaScriptCore omits it.
hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g)// Format.JS uses non-breaking spaces
.slice(2)// Skip the hour and AM/PM parts
.join(" ")}},90865:function(e,t,n){n.d(t,{Y:()=>a});const r={};const i={};/**
 * The function extracts UTC offset in minutes from the given date in specified
 * time zone.
 *
 * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
 * mirrored to the sign of the offset in the time zone. For Asia/Singapore
 * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 * @param date - Date to check the offset for
 *
 * @returns UTC offset in minutes
 */function a(e,t){try{const n=r[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format;const a=n(t).split("GMT")[1];if(a in i)return i[a];return s(a,a.split(":"))}catch{// Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH
// See: https://github.com/nodejs/node/issues/53419
if(e in i)return i[e];const t=e?.match(o);if(t)return s(e,t.slice(1));return NaN}}const o=/([+-]\d\d):?(\d\d)?/;function s(e,t){const n=+(t[0]||0);const r=+(t[1]||0);// Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
const a=+(t[2]||0)/60;return i[e]=n*60+r>0?n*60+r+a:n*60-r-a}},5170:function(e,t,n){n.d(t,{h:()=>I});/* import */var r=n(75583);/* import */var i=n(41594);/* import */var a=n(56066);/* import */var o=n(32850);/* import */var s=n(37836);/* import */var l=n(19287);/* import */var d=n(87096);/* import */var c=n(78933);/* import */var u=n(1207);/* import */var p=n(39903);/* import */var v=n(63612);/* import */var h=n(66564);/* import */var f=n(86607);/* import */var g=n(57899);/* import */var _=n(93116);/* import */var m=n(97766);/* import */var b=n(68587);/* import */var y=n(58071);/* import */var w=n(51409);/* import */var x=n(53581);/* import */var A=n(33127);/* import */var Y=n(52044);/* import */var k=n(70684);/**
 * Renders the DayPicker calendar component.
 *
 * @param initialProps - The props for the DayPicker component.
 * @returns The rendered DayPicker component.
 * @group DayPicker
 * @see https://daypicker.dev
 */function I(e){let t=e;if(t.timeZone){t={...e};if(t.today){t.today=new r/* .TZDate */.BB(t.today,t.timeZone)}if(t.month){t.month=new r/* .TZDate */.BB(t.month,t.timeZone)}if(t.defaultMonth){t.defaultMonth=new r/* .TZDate */.BB(t.defaultMonth,t.timeZone)}if(t.startMonth){t.startMonth=new r/* .TZDate */.BB(t.startMonth,t.timeZone)}if(t.endMonth){t.endMonth=new r/* .TZDate */.BB(t.endMonth,t.timeZone)}if(t.mode==="single"&&t.selected){t.selected=new r/* .TZDate */.BB(t.selected,t.timeZone)}else if(t.mode==="multiple"&&t.selected){t.selected=t.selected?.map(e=>new r/* .TZDate */.BB(e,t.timeZone))}else if(t.mode==="range"&&t.selected){t.selected={from:t.selected.from?new r/* .TZDate */.BB(t.selected.from,t.timeZone):undefined,to:t.selected.to?new r/* .TZDate */.BB(t.selected.to,t.timeZone):undefined}}}const{components:n,formatters:I,labels:D,dateLib:C,locale:E,classNames:q}=(0,i.useMemo)(()=>{const e={...a/* .enUS */.c,...t.locale};const n=new o/* .DateLib */.i0({locale:e,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib);return{dateLib:n,components:(0,d/* .getComponents */.P)(t.components),formatters:(0,p/* .getFormatters */.G)(t.formatters),labels:{..._,...t.labels},locale:e,classNames:{...(0,u/* .getDefaultClassNames */.a)(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]);const{captionLayout:T,mode:S,navLayout:M,numberOfMonths:H=1,onDayBlur:z,onDayClick:K,onDayFocus:O,onDayKeyDown:F,onDayMouseEnter:P,onDayMouseLeave:W,onNextClick:N,onPrevClick:L,showWeekNumber:B,styles:R}=t;const{formatCaption:U,formatDay:j,formatMonthDropdown:V,formatWeekNumber:Q,formatWeekNumberHeader:G,formatWeekdayName:X,formatYearDropdown:Z}=I;const J=(0,y/* .useCalendar */._)(t,C);const{days:$,months:ee,navStart:et,navEnd:en,previousMonth:er,nextMonth:ei,goToMonth:ea}=J;const eo=(0,s/* .createGetModifiers */.x)($,t,et,en,C);const{isSelected:es,select:el,selected:ed}=(0,A/* .useSelection */.C)(t,C)??{};const{blur:ec,focused:eu,isFocusTarget:ep,moveFocus:ev,setFocused:eh}=(0,x/* .useFocus */.i)(t,J,eo,es??(()=>false),C);const{labelDayButton:ef,labelGridcell:eg,labelGrid:e_,labelMonthDropdown:em,labelNav:eb,labelPrevious:ey,labelNext:ew,labelWeekday:ex,labelWeekNumber:eA,labelWeekNumberHeader:eY,labelYearDropdown:ek}=D;const eI=(0,i.useMemo)(()=>(0,f/* .getWeekdays */.c)(C,t.ISOWeek),[C,t.ISOWeek]);const eD=S!==undefined||K!==undefined;const eC=(0,i.useCallback)(()=>{if(!er)return;ea(er);L?.(er)},[er,ea,L]);const eE=(0,i.useCallback)(()=>{if(!ei)return;ea(ei);N?.(ei)},[ea,ei,N]);const eq=(0,i.useCallback)((e,t)=>n=>{n.preventDefault();n.stopPropagation();eh(e);el?.(e.date,t,n);K?.(e.date,t,n)},[el,K,eh]);const eT=(0,i.useCallback)((e,t)=>n=>{eh(e);O?.(e.date,t,n)},[O,eh]);const eS=(0,i.useCallback)((e,t)=>n=>{ec();z?.(e.date,t,n)},[ec,z]);const eM=(0,i.useCallback)((e,n)=>r=>{const i={ArrowLeft:[r.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[r.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[r.shiftKey?"year":"week","after"],ArrowUp:[r.shiftKey?"year":"week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(i[r.key]){r.preventDefault();r.stopPropagation();const[e,t]=i[r.key];ev(e,t)}F?.(e.date,n,r)},[ev,F,t.dir]);const eH=(0,i.useCallback)((e,t)=>n=>{P?.(e.date,t,n)},[P]);const ez=(0,i.useCallback)((e,t)=>n=>{W?.(e.date,t,n)},[W]);const eK=(0,i.useCallback)(e=>t=>{const n=Number(t.target.value);const r=C.setMonth(C.startOfMonth(e),n);ea(r)},[C,ea]);const eO=(0,i.useCallback)(e=>t=>{const n=Number(t.target.value);const r=C.setYear(C.startOfMonth(e),n);ea(r)},[C,ea]);const{className:eF,style:eP}=(0,i.useMemo)(()=>({className:[q[m.UI.Root],t.className].filter(Boolean).join(" "),style:{...R?.[m.UI.Root],...t.style}}),[q,t.className,t.style,R]);const eW=(0,c/* .getDataAttributes */.C)(t);const eN=(0,i.useRef)(null);(0,b/* .useAnimation */.s)(eN,Boolean(t.animate),{classNames:q,months:ee,focused:eu,dateLib:C});const eL={dayPickerProps:t,selected:ed,select:el,isSelected:es,months:ee,nextMonth:ei,previousMonth:er,goToMonth:ea,getModifiers:eo,components:n,classNames:q,styles:R,labels:D,formatters:I};return i.createElement(w/* .dayPickerContext.Provider */.S.Provider,{value:eL},i.createElement(n.Root,{rootRef:t.animate?eN:undefined,className:eF,style:eP,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...eW},i.createElement(n.Months,{className:q[m.UI.Months],style:R?.[m.UI.Months]},!t.hideNavigation&&!M&&i.createElement(n.Nav,{"data-animated-nav":t.animate?"true":undefined,className:q[m.UI.Nav],style:R?.[m.UI.Nav],"aria-label":eb(),onPreviousClick:eC,onNextClick:eE,previousMonth:er,nextMonth:ei}),ee.map((e,r)=>{return i.createElement(n.Month,{"data-animated-month":t.animate?"true":undefined,className:q[m.UI.Month],style:R?.[m.UI.Month],// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
key:r,displayIndex:r,calendarMonth:e},M==="around"&&!t.hideNavigation&&r===0&&i.createElement(n.PreviousMonthButton,{type:"button",className:q[m.UI.PreviousMonthButton],tabIndex:er?undefined:-1,"aria-disabled":er?undefined:true,"aria-label":ey(er),onClick:eC,"data-animated-button":t.animate?"true":undefined},i.createElement(n.Chevron,{disabled:er?undefined:true,className:q[m.UI.Chevron],orientation:t.dir==="rtl"?"right":"left"})),i.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":undefined,className:q[m.UI.MonthCaption],style:R?.[m.UI.MonthCaption],calendarMonth:e,displayIndex:r},T?.startsWith("dropdown")?i.createElement(n.DropdownNav,{className:q[m.UI.Dropdowns],style:R?.[m.UI.Dropdowns]},(()=>{const r=T==="dropdown"||T==="dropdown-months"?i.createElement(n.MonthsDropdown,{key:"month",className:q[m.UI.MonthsDropdown],"aria-label":em(),classNames:q,components:n,disabled:Boolean(t.disableNavigation),onChange:eK(e.date),options:(0,v/* .getMonthOptions */.L)(e.date,et,en,I,C),style:R?.[m.UI.Dropdown],value:C.getMonth(e.date)}):i.createElement("span",{key:"month"},V(e.date,C));const a=T==="dropdown"||T==="dropdown-years"?i.createElement(n.YearsDropdown,{key:"year",className:q[m.UI.YearsDropdown],"aria-label":ek(C.options),classNames:q,components:n,disabled:Boolean(t.disableNavigation),onChange:eO(e.date),options:(0,g/* .getYearOptions */.g)(et,en,I,C,Boolean(t.reverseYears)),style:R?.[m.UI.Dropdown],value:C.getYear(e.date)}):i.createElement("span",{key:"year"},Z(e.date,C));const o=C.getMonthYearOrder()==="year-first"?[a,r]:[r,a];return o})(),i.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},U(e.date,C.options,C))):// biome-ignore lint/a11y/useSemanticElements: breaking change
i.createElement(n.CaptionLabel,{className:q[m.UI.CaptionLabel],role:"status","aria-live":"polite"},U(e.date,C.options,C))),M==="around"&&!t.hideNavigation&&r===H-1&&i.createElement(n.NextMonthButton,{type:"button",className:q[m.UI.NextMonthButton],tabIndex:ei?undefined:-1,"aria-disabled":ei?undefined:true,"aria-label":ew(ei),onClick:eE,"data-animated-button":t.animate?"true":undefined},i.createElement(n.Chevron,{disabled:ei?undefined:true,className:q[m.UI.Chevron],orientation:t.dir==="rtl"?"left":"right"})),r===H-1&&M==="after"&&!t.hideNavigation&&i.createElement(n.Nav,{"data-animated-nav":t.animate?"true":undefined,className:q[m.UI.Nav],style:R?.[m.UI.Nav],"aria-label":eb(),onPreviousClick:eC,onNextClick:eE,previousMonth:er,nextMonth:ei}),i.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":S==="multiple"||S==="range","aria-label":e_(e.date,C.options,C)||undefined,className:q[m.UI.MonthGrid],style:R?.[m.UI.MonthGrid]},!t.hideWeekdays&&i.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":undefined,className:q[m.UI.Weekdays],style:R?.[m.UI.Weekdays]},B&&i.createElement(n.WeekNumberHeader,{"aria-label":eY(C.options),className:q[m.UI.WeekNumberHeader],style:R?.[m.UI.WeekNumberHeader],scope:"col"},G()),eI.map(e=>i.createElement(n.Weekday,{"aria-label":ex(e,C.options,C),className:q[m.UI.Weekday],key:String(e),style:R?.[m.UI.Weekday],scope:"col"},X(e,C.options,C)))),i.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":undefined,className:q[m.UI.Weeks],style:R?.[m.UI.Weeks]},e.weeks.map(e=>{return i.createElement(n.Week,{className:q[m.UI.Week],key:e.weekNumber,style:R?.[m.UI.Week],week:e},B&&// biome-ignore lint/a11y/useSemanticElements: react component
i.createElement(n.WeekNumber,{week:e,style:R?.[m.UI.WeekNumber],"aria-label":eA(e.weekNumber,{locale:E}),className:q[m.UI.WeekNumber],scope:"row",role:"rowheader"},Q(e.weekNumber,C)),e.days.map(e=>{const{date:r}=e;const a=eo(e);a[m/* .DayFlag.focused */.pL.focused]=!a.hidden&&Boolean(eu?.isEqualTo(e));a[m/* .SelectionState.selected */.wc.selected]=es?.(r)||a.selected;if((0,k/* .isDateRange */.oM)(ed)){// add range modifiers
const{from:e,to:t}=ed;a[m/* .SelectionState.range_start */.wc.range_start]=Boolean(e&&t&&C.isSameDay(r,e));a[m/* .SelectionState.range_end */.wc.range_end]=Boolean(e&&t&&C.isSameDay(r,t));a[m/* .SelectionState.range_middle */.wc.range_middle]=(0,Y/* .rangeIncludesDate */.R)(ed,r,true,C)}const o=(0,h/* .getStyleForModifiers */.J)(a,R,t.modifiersStyles);const s=(0,l/* .getClassNamesForModifiers */.k)(a,q,t.modifiersClassNames);const d=!eD&&!a.hidden?eg(r,a,C.options,C):undefined;return(// biome-ignore lint/a11y/useSemanticElements: react component
i.createElement(n.Day,{key:`${C.format(r,"yyyy-MM-dd")}_${C.format(e.displayMonth,"yyyy-MM")}`,day:e,modifiers:a,className:s.join(" "),style:o,role:"gridcell","aria-selected":a.selected||undefined,"aria-label":d,"data-day":C.format(r,"yyyy-MM-dd"),"data-month":e.outside?C.format(r,"yyyy-MM"):undefined,"data-selected":a.selected||undefined,"data-disabled":a.disabled||undefined,"data-hidden":a.hidden||undefined,"data-outside":e.outside||undefined,"data-focused":a.focused||undefined,"data-today":a.today||undefined},!a.hidden&&eD?i.createElement(n.DayButton,{className:q[m.UI.DayButton],style:R?.[m.UI.DayButton],type:"button",day:e,modifiers:a,disabled:a.disabled||undefined,tabIndex:ep(e)?0:-1,"aria-label":ef(r,a,C.options,C),onClick:eq(e,a),onBlur:eS(e,a),onFocus:eT(e,a),onKeyDown:eM(e,a),onMouseEnter:eH(e,a),onMouseLeave:ez(e,a)},j(r,C.options,C)):!a.hidden&&j(e.date,C.options,C)))}))}))))})),t.footer&&// biome-ignore lint/a11y/useSemanticElements: react component
i.createElement(n.Footer,{className:q[m.UI.Footer],style:R?.[m.UI.Footer],role:"status","aria-live":"polite"},t.footer)))}},97766:function(e,t,n){n.d(t,{UI:()=>r,X5:()=>o,pL:()=>i,wc:()=>a});/**
 * Enum representing the UI elements composing DayPicker. These elements are
 * mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
 *
 * Some elements are extended by flags and modifiers.
 */var r;(function(e){/** The root component displaying the months and the navigation bar. */e["Root"]="root";/** The Chevron SVG element used by navigation buttons and dropdowns. */e["Chevron"]="chevron";/**
     * The grid cell with the day's date. Extended by {@link DayFlag} and
     * {@link SelectionState}.
     */e["Day"]="day";/** The button containing the formatted day's date, inside the grid cell. */e["DayButton"]="day_button";/** The caption label of the month (when not showing the dropdown navigation). */e["CaptionLabel"]="caption_label";/** The container of the dropdown navigation (when enabled). */e["Dropdowns"]="dropdowns";/** The dropdown element to select for years and months. */e["Dropdown"]="dropdown";/** The container element of the dropdown. */e["DropdownRoot"]="dropdown_root";/** The root element of the footer. */e["Footer"]="footer";/** The month grid. */e["MonthGrid"]="month_grid";/** Contains the dropdown navigation or the caption label. */e["MonthCaption"]="month_caption";/** The dropdown with the months. */e["MonthsDropdown"]="months_dropdown";/** Wrapper of the month grid. */e["Month"]="month";/** The container of the displayed months. */e["Months"]="months";/** The navigation bar with the previous and next buttons. */e["Nav"]="nav";/**
     * The next month button in the navigation. *
     *
     * @since 9.1.0
     */e["NextMonthButton"]="button_next";/**
     * The previous month button in the navigation.
     *
     * @since 9.1.0
     */e["PreviousMonthButton"]="button_previous";/** The row containing the week. */e["Week"]="week";/** The group of row weeks in a month (`tbody`). */e["Weeks"]="weeks";/** The column header with the weekday. */e["Weekday"]="weekday";/** The row grouping the weekdays in the column headers. */e["Weekdays"]="weekdays";/** The cell containing the week number. */e["WeekNumber"]="week_number";/** The cell header of the week numbers column. */e["WeekNumberHeader"]="week_number_header";/** The dropdown with the years. */e["YearsDropdown"]="years_dropdown"})(r||(r={}));/** Enum representing flags for the {@link UI.Day} element. */var i;(function(e){/** The day is disabled. */e["disabled"]="disabled";/** The day is hidden. */e["hidden"]="hidden";/** The day is outside the current month. */e["outside"]="outside";/** The day is focused. */e["focused"]="focused";/** The day is today. */e["today"]="today"})(i||(i={}));/**
 * Enum representing selection states that can be applied to the {@link UI.Day}
 * element in selection mode.
 */var a;(function(e){/** The day is at the end of a selected range. */e["range_end"]="range_end";/** The day is at the middle of a selected range. */e["range_middle"]="range_middle";/** The day is at the start of a selected range. */e["range_start"]="range_start";/** The day is selected. */e["selected"]="selected"})(a||(a={}));/**
 * Enum representing different animation states for transitioning between
 * months.
 */var o;(function(e){/** The entering weeks when they appear before the exiting month. */e["weeks_before_enter"]="weeks_before_enter";/** The exiting weeks when they disappear before the entering month. */e["weeks_before_exit"]="weeks_before_exit";/** The entering weeks when they appear after the exiting month. */e["weeks_after_enter"]="weeks_after_enter";/** The exiting weeks when they disappear after the entering month. */e["weeks_after_exit"]="weeks_after_exit";/** The entering caption when it appears after the exiting month. */e["caption_after_enter"]="caption_after_enter";/** The exiting caption when it disappears after the entering month. */e["caption_after_exit"]="caption_after_exit";/** The entering caption when it appears before the exiting month. */e["caption_before_enter"]="caption_before_enter";/** The exiting caption when it disappears before the entering month. */e["caption_before_exit"]="caption_before_exit"})(o||(o={}))},61797:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(32850);/**
 * Represents a day displayed in the calendar.
 *
 * In DayPicker, a `CalendarDay` is a wrapper around a `Date` object that
 * provides additional information about the day, such as whether it belongs to
 * the displayed month.
 */class i{constructor(e,t,n=r/* .defaultDateLib */.VA){this.date=e;this.displayMonth=t;this.outside=Boolean(t&&!n.isSameMonth(e,t));this.dateLib=n}/**
     * Checks if this day is equal to another `CalendarDay`, considering both the
     * date and the displayed month.
     *
     * @param day The `CalendarDay` to compare with.
     * @returns `true` if the days are equal, otherwise `false`.
     */isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}},48665:function(e,t,n){n.d(t,{j:()=>r});/**
 * Represents a month in a calendar year.
 *
 * A `CalendarMonth` contains the weeks within the month and the date of the
 * month.
 */class r{constructor(e,t){this.date=e;this.weeks=t}}},46483:function(e,t,n){n.d(t,{j:()=>r});/**
 * Represents a week in a calendar month.
 *
 * A `CalendarWeek` contains the days within the week and the week number.
 */class r{constructor(e,t){this.days=t;this.weekNumber=e}}},32850:function(e,t,n){n.d(t,{VA:()=>W,i0:()=>P});/* import */var r=n(75583);/* import */var i=n(80517);/* import */var a=n(39669);/* import */var o=n(98637);/* import */var s=n(2510);/* import */var l=n(26496);/* import */var d=n(4556);/* import */var c=n(80436);/* import */var u=n(3929);/* import */var p=n(65636);/* import */var v=n(50527);/* import */var h=n(1741);/* import */var f=n(94528);/* import */var g=n(37902);/* import */var _=n(11456);/* import */var m=n(16331);/* import */var b=n(27372);/* import */var y=n(64585);/* import */var w=n(71271);/* import */var x=n(97822);/* import */var A=n(21721);/* import */var Y=n(13249);/* import */var k=n(21309);/* import */var I=n(29318);/* import */var D=n(78127);/* import */var C=n(35093);/* import */var E=n(49407);/* import */var q=n(90208);/* import */var T=n(8008);/* import */var S=n(99719);/* import */var M=n(74880);/* import */var H=n(73524);/* import */var z=n(40525);/* import */var K=n(56066);/* import */var O=n(99905);/* import */var F=n(73958);/**
 * A wrapper class around [date-fns](http://date-fns.org) that provides utility
 * methods for date manipulation and formatting.
 *
 * @since 9.2.0
 * @example
 *   const dateLib = new DateLib({ locale: es });
 *   const newDate = dateLib.addDays(new Date(), 5);
 */class P{/**
     * Creates an instance of `DateLib`.
     *
     * @param options Configuration options for the date library.
     * @param overrides Custom overrides for the date library functions.
     */constructor(e,t){/**
         * Reference to the built-in Date constructor.
         *
         * @deprecated Use `newDate()` or `today()`.
         */this.Date=Date;/**
         * Creates a new `Date` object representing today's date.
         *
         * @since 9.5.0
         * @returns A `Date` object for today's date.
         */this.today=()=>{if(this.overrides?.today){return this.overrides.today()}if(this.options.timeZone){return r/* .TZDate.tz */.BB.tz(this.options.timeZone)}return new this.Date};/**
         * Creates a new `Date` object with the specified year, month, and day.
         *
         * @since 9.5.0
         * @param year The year.
         * @param monthIndex The month (0-11).
         * @param date The day of the month.
         * @returns A new `Date` object.
         */this.newDate=(e,t,n)=>{if(this.overrides?.newDate){return this.overrides.newDate(e,t,n)}if(this.options.timeZone){return new r/* .TZDate */.BB(e,t,n,this.options.timeZone)}return new Date(e,t,n)};/**
         * Adds the specified number of days to the given date.
         *
         * @param date The date to add days to.
         * @param amount The number of days to add.
         * @returns The new date with the days added.
         */this.addDays=(e,t)=>{return this.overrides?.addDays?this.overrides.addDays(e,t):(0,i/* .addDays */.f)(e,t)};/**
         * Adds the specified number of months to the given date.
         *
         * @param date The date to add months to.
         * @param amount The number of months to add.
         * @returns The new date with the months added.
         */this.addMonths=(e,t)=>{return this.overrides?.addMonths?this.overrides.addMonths(e,t):(0,a/* .addMonths */.P)(e,t)};/**
         * Adds the specified number of weeks to the given date.
         *
         * @param date The date to add weeks to.
         * @param amount The number of weeks to add.
         * @returns The new date with the weeks added.
         */this.addWeeks=(e,t)=>{return this.overrides?.addWeeks?this.overrides.addWeeks(e,t):(0,o/* .addWeeks */.J)(e,t)};/**
         * Adds the specified number of years to the given date.
         *
         * @param date The date to add years to.
         * @param amount The number of years to add.
         * @returns The new date with the years added.
         */this.addYears=(e,t)=>{return this.overrides?.addYears?this.overrides.addYears(e,t):(0,s/* .addYears */.e)(e,t)};/**
         * Returns the number of calendar days between the given dates.
         *
         * @param dateLeft The later date.
         * @param dateRight The earlier date.
         * @returns The number of calendar days between the dates.
         */this.differenceInCalendarDays=(e,t)=>{return this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):(0,l/* .differenceInCalendarDays */.m)(e,t)};/**
         * Returns the number of calendar months between the given dates.
         *
         * @param dateLeft The later date.
         * @param dateRight The earlier date.
         * @returns The number of calendar months between the dates.
         */this.differenceInCalendarMonths=(e,t)=>{return this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):(0,d/* .differenceInCalendarMonths */.U)(e,t)};/**
         * Returns the months between the given dates.
         *
         * @param interval The interval to get the months for.
         */this.eachMonthOfInterval=e=>{return this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):(0,c/* .eachMonthOfInterval */.i)(e)};/**
         * Returns the years between the given dates.
         *
         * @since 9.11.1
         * @param interval The interval to get the years for.
         * @returns The array of years in the interval.
         */this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):(0,u/* .eachYearOfInterval */.z)(e);// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
// See https://github.com/date-fns/tz/issues/72
const n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length){// No duplicates, return as is
return t}// Rebuild the array to ensure one date per year
const r=[];n.forEach(e=>{r.push(new Date(e,0,1))});return r};/**
         * Returns the end of the broadcast week for the given date.
         *
         * @param date The original date.
         * @returns The end of the broadcast week.
         */this.endOfBroadcastWeek=e=>{return this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):(0,O/* .endOfBroadcastWeek */.O)(e,this)};/**
         * Returns the end of the ISO week for the given date.
         *
         * @param date The original date.
         * @returns The end of the ISO week.
         */this.endOfISOWeek=e=>{return this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):(0,p/* .endOfISOWeek */.g)(e)};/**
         * Returns the end of the month for the given date.
         *
         * @param date The original date.
         * @returns The end of the month.
         */this.endOfMonth=e=>{return this.overrides?.endOfMonth?this.overrides.endOfMonth(e):(0,v/* .endOfMonth */.p)(e)};/**
         * Returns the end of the week for the given date.
         *
         * @param date The original date.
         * @returns The end of the week.
         */this.endOfWeek=(e,t)=>{return this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):(0,h/* .endOfWeek */.$)(e,this.options)};/**
         * Returns the end of the year for the given date.
         *
         * @param date The original date.
         * @returns The end of the year.
         */this.endOfYear=e=>{return this.overrides?.endOfYear?this.overrides.endOfYear(e):(0,f/* .endOfYear */.Q)(e)};/**
         * Formats the given date using the specified format string.
         *
         * @param date The date to format.
         * @param formatStr The format string.
         * @returns The formatted date string.
         */this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):(0,g/* .format */.GP)(e,t,this.options);if(this.options.numerals&&this.options.numerals!=="latn"){return this.replaceDigits(r)}return r};/**
         * Returns the ISO week number for the given date.
         *
         * @param date The date to get the ISO week number for.
         * @returns The ISO week number.
         */this.getISOWeek=e=>{return this.overrides?.getISOWeek?this.overrides.getISOWeek(e):(0,_/* .getISOWeek */.s)(e)};/**
         * Returns the month of the given date.
         *
         * @param date The date to get the month for.
         * @returns The month.
         */this.getMonth=(e,t)=>{return this.overrides?.getMonth?this.overrides.getMonth(e,this.options):(0,m/* .getMonth */.t)(e,this.options)};/**
         * Returns the year of the given date.
         *
         * @param date The date to get the year for.
         * @returns The year.
         */this.getYear=(e,t)=>{return this.overrides?.getYear?this.overrides.getYear(e,this.options):(0,b/* .getYear */.C)(e,this.options)};/**
         * Returns the local week number for the given date.
         *
         * @param date The date to get the week number for.
         * @returns The week number.
         */this.getWeek=(e,t)=>{return this.overrides?.getWeek?this.overrides.getWeek(e,this.options):(0,y/* .getWeek */.N)(e,this.options)};/**
         * Checks if the first date is after the second date.
         *
         * @param date The date to compare.
         * @param dateToCompare The date to compare with.
         * @returns True if the first date is after the second date.
         */this.isAfter=(e,t)=>{return this.overrides?.isAfter?this.overrides.isAfter(e,t):(0,w/* .isAfter */.d)(e,t)};/**
         * Checks if the first date is before the second date.
         *
         * @param date The date to compare.
         * @param dateToCompare The date to compare with.
         * @returns True if the first date is before the second date.
         */this.isBefore=(e,t)=>{return this.overrides?.isBefore?this.overrides.isBefore(e,t):(0,x/* .isBefore */.Y)(e,t)};/**
         * Checks if the given value is a Date object.
         *
         * @param value The value to check.
         * @returns True if the value is a Date object.
         */this.isDate=e=>{return this.overrides?.isDate?this.overrides.isDate(e):(0,A/* .isDate */.$)(e)};/**
         * Checks if the given dates are on the same day.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are on the same day.
         */this.isSameDay=(e,t)=>{return this.overrides?.isSameDay?this.overrides.isSameDay(e,t):(0,Y/* .isSameDay */.r)(e,t)};/**
         * Checks if the given dates are in the same month.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are in the same month.
         */this.isSameMonth=(e,t)=>{return this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):(0,k/* .isSameMonth */.t)(e,t)};/**
         * Checks if the given dates are in the same year.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are in the same year.
         */this.isSameYear=(e,t)=>{return this.overrides?.isSameYear?this.overrides.isSameYear(e,t):(0,I/* .isSameYear */.s)(e,t)};/**
         * Returns the latest date in the given array of dates.
         *
         * @param dates The array of dates to compare.
         * @returns The latest date.
         */this.max=e=>{return this.overrides?.max?this.overrides.max(e):(0,D/* .max */.T)(e)};/**
         * Returns the earliest date in the given array of dates.
         *
         * @param dates The array of dates to compare.
         * @returns The earliest date.
         */this.min=e=>{return this.overrides?.min?this.overrides.min(e):(0,C/* .min */.j)(e)};/**
         * Sets the month of the given date.
         *
         * @param date The date to set the month on.
         * @param month The month to set (0-11).
         * @returns The new date with the month set.
         */this.setMonth=(e,t)=>{return this.overrides?.setMonth?this.overrides.setMonth(e,t):(0,E/* .setMonth */.Z)(e,t)};/**
         * Sets the year of the given date.
         *
         * @param date The date to set the year on.
         * @param year The year to set.
         * @returns The new date with the year set.
         */this.setYear=(e,t)=>{return this.overrides?.setYear?this.overrides.setYear(e,t):(0,q/* .setYear */.i)(e,t)};/**
         * Returns the start of the broadcast week for the given date.
         *
         * @param date The original date.
         * @returns The start of the broadcast week.
         */this.startOfBroadcastWeek=(e,t)=>{return this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):(0,F/* .startOfBroadcastWeek */.l)(e,this)};/**
         * Returns the start of the day for the given date.
         *
         * @param date The original date.
         * @returns The start of the day.
         */this.startOfDay=e=>{return this.overrides?.startOfDay?this.overrides.startOfDay(e):(0,T/* .startOfDay */.o)(e)};/**
         * Returns the start of the ISO week for the given date.
         *
         * @param date The original date.
         * @returns The start of the ISO week.
         */this.startOfISOWeek=e=>{return this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):(0,S/* .startOfISOWeek */.b)(e)};/**
         * Returns the start of the month for the given date.
         *
         * @param date The original date.
         * @returns The start of the month.
         */this.startOfMonth=e=>{return this.overrides?.startOfMonth?this.overrides.startOfMonth(e):(0,M/* .startOfMonth */.w)(e)};/**
         * Returns the start of the week for the given date.
         *
         * @param date The original date.
         * @returns The start of the week.
         */this.startOfWeek=(e,t)=>{return this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):(0,H/* .startOfWeek */.k)(e,this.options)};/**
         * Returns the start of the year for the given date.
         *
         * @param date The original date.
         * @returns The start of the year.
         */this.startOfYear=e=>{return this.overrides?.startOfYear?this.overrides.startOfYear(e):(0,z/* .startOfYear */.D)(e)};this.options={locale:K/* .enUS */.c,...e};this.overrides=t}/**
     * Generates a mapping of Arabic digits (0-9) to the target numbering system
     * digits.
     *
     * @since 9.5.0
     * @returns A record mapping Arabic digits to the target numerals.
     */getDigitMap(){const{numerals:e="latn"}=this.options;// Use Intl.NumberFormat to create a formatter with the specified numbering system
const t=new Intl.NumberFormat("en-US",{numberingSystem:e});// Map Arabic digits (0-9) to the target numerals
const n={};for(let e=0;e<10;e++){n[e.toString()]=t.format(e)}return n}/**
     * Replaces Arabic digits in a string with the target numbering system digits.
     *
     * @since 9.5.0
     * @param input The string containing Arabic digits.
     * @returns The string with digits replaced.
     */replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}/**
     * Formats a number using the configured numbering system.
     *
     * @since 9.5.0
     * @param value The number to format.
     * @returns The formatted number as a string.
     */formatNumber(e){return this.replaceDigits(e.toString())}/**
     * Returns the preferred ordering for month and year labels for the current
     * locale.
     */getMonthYearOrder(){const e=this.options.locale?.code;if(!e){return"month-first"}return P.yearFirstLocales.has(e)?"year-first":"month-first"}/**
     * Formats the month/year pair respecting locale conventions.
     *
     * @since 9.11.0
     */formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options;const i=t?.code;if(i&&P.yearFirstLocales.has(i)){try{const t=new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:r});const a=t.format(e);return a}catch{// Fallback to date-fns formatting below.
}}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}P.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);/** The default locale (English). *//**
 * The default date library with English locale.
 *
 * @since 9.2.0
 */const W=new P;/**
 * @ignore
 * @deprecated Use `defaultDateLib`.
 */const N=/* unused pure expression or super */null&&W},91327:function(e,t,n){n.d(t,{$:()=>i});/* import */var r=n(41594);/**
 * Render the button elements in the calendar.
 *
 * @private
 * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
 */function i(e){return r.createElement("button",{...e})}},77307:function(e,t,n){n.d(t,{$:()=>i});/* import */var r=n(41594);/**
 * Render the label in the month caption.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("span",{...e})}},83180:function(e,t,n){n.d(t,{c:()=>i});/* import */var r=n(41594);/**
 * Render the chevron icon used in the navigation buttons and dropdowns.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{size:t=24,orientation:n="left",className:i}=e;return(// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
r.createElement("svg",{className:i,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&r.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&r.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&r.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&r.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"})))}},721:function(e,t,n){n.d(t,{L:()=>i});/* import */var r=n(41594);/**
 * Render a grid cell for a specific day in the calendar.
 *
 * Handles interaction and focus for the day. If you only need to change the
 * content of the day cell, consider swapping the `DayButton` component
 * instead.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{day:t,modifiers:n,...i}=e;return r.createElement("td",{...i})}},80985:function(e,t,n){n.d(t,{x:()=>i});/* import */var r=n(41594);/**
 * Render a button for a specific day in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{day:t,modifiers:n,...i}=e;const a=r.useRef(null);r.useEffect(()=>{if(n.focused)a.current?.focus()},[n.focused]);return r.createElement("button",{ref:a,...i})}},69618:function(e,t,n){n.d(t,{m:()=>a});/* import */var r=n(41594);/* import */var i=n(97766);/**
 * Render a dropdown component for navigation in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{options:t,className:n,components:a,classNames:o,...s}=e;const l=[o[i.UI.Dropdown],n].join(" ");const d=t?.find(({value:e})=>e===s.value);return r.createElement("span",{"data-disabled":s.disabled,className:o[i.UI.DropdownRoot]},r.createElement(a.Select,{className:l,...s},t?.map(({value:e,label:t,disabled:n})=>r.createElement(a.Option,{key:e,value:e,disabled:n},t))),r.createElement("span",{className:o[i.UI.CaptionLabel],"aria-hidden":true},d?.label,r.createElement(a.Chevron,{orientation:"down",size:18,className:o[i.UI.Chevron]})))}},92833:function(e,t,n){n.d(t,{z:()=>i});/* import */var r=n(41594);/**
 * Render the navigation dropdowns for the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},57836:function(e,t,n){n.d(t,{w:()=>i});/* import */var r=n(41594);/**
 * Render the footer of the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},57933:function(e,t,n){n.d(t,{f:()=>i});/* import */var r=n(41594);/**
 * Render the grid with the weekday header row and the weeks for a specific
 * month.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{calendarMonth:t,displayIndex:n,...i}=e;return r.createElement("div",{...i},e.children)}},22507:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(41594);/**
 * Render the caption for a month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{calendarMonth:t,displayIndex:n,...i}=e;return r.createElement("div",{...i})}},71941:function(e,t,n){n.d(t,{D:()=>i});/* import */var r=n(41594);/**
 * Render the grid of days for a specific month.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("table",{...e})}},94632:function(e,t,n){n.d(t,{i:()=>i});/* import */var r=n(41594);/**
 * Render a container wrapping the month grids.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},78181:function(e,t,n){n.d(t,{l:()=>a});/* import */var r=n(41594);/* import */var i=n(51409);/**
 * Render a dropdown to navigate between months in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Dropdown,{...e})}},56362:function(e,t,n){n.d(t,{s:()=>o});/* import */var r=n(41594);/* import */var i=n(97766);/* import */var a=n(51409);/**
 * Render the navigation toolbar with buttons to navigate between months.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{onPreviousClick:t,onNextClick:n,previousMonth:o,nextMonth:s,...l}=e;const{components:d,classNames:c,labels:{labelPrevious:u,labelNext:p}}=(0,a/* .useDayPicker */.w)();const v=(0,r.useCallback)(e=>{if(s){n?.(e)}},[s,n]);const h=(0,r.useCallback)(e=>{if(o){t?.(e)}},[o,t]);return r.createElement("nav",{...l},r.createElement(d.PreviousMonthButton,{type:"button",className:c[i.UI.PreviousMonthButton],tabIndex:o?undefined:-1,"aria-disabled":o?undefined:true,"aria-label":u(o),onClick:h},r.createElement(d.Chevron,{disabled:o?undefined:true,className:c[i.UI.Chevron],orientation:"left"})),r.createElement(d.NextMonthButton,{type:"button",className:c[i.UI.NextMonthButton],tabIndex:s?undefined:-1,"aria-disabled":s?undefined:true,"aria-label":p(s),onClick:v},r.createElement(d.Chevron,{disabled:s?undefined:true,orientation:"right",className:c[i.UI.Chevron]})))}},19330:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(41594);/* import */var i=n(51409);/**
 * Render the button to navigate to the next month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Button,{...e})}},4726:function(e,t,n){n.d(t,{c:()=>i});/* import */var r=n(41594);/**
 * Render an `option` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("option",{...e})}},87006:function(e,t,n){n.d(t,{u:()=>a});/* import */var r=n(41594);/* import */var i=n(51409);/**
 * Render the button to navigate to the previous month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Button,{...e})}},58219:function(e,t,n){n.d(t,{b:()=>i});/* import */var r=n(41594);/**
 * Render the root element of the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{rootRef:t,...n}=e;return r.createElement("div",{...n,ref:t})}},27787:function(e,t,n){n.d(t,{l:()=>i});/* import */var r=n(41594);/**
 * Render a `select` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("select",{...e})}},80007:function(e,t,n){n.d(t,{j:()=>i});/* import */var r=n(41594);/**
 * Render a table row representing a week in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{week:t,...n}=e;return r.createElement("tr",{...n})}},72818:function(e,t,n){n.d(t,{u:()=>i});/* import */var r=n(41594);/**
 * Render a table cell displaying the number of the week.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{week:t,...n}=e;return r.createElement("th",{...n})}},73531:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(41594);/**
 * Render the header cell for the week numbers column.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("th",{...e})}},66213:function(e,t,n){n.d(t,{B:()=>i});/* import */var r=n(41594);/**
 * Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("th",{...e})}},97328:function(e,t,n){n.d(t,{S:()=>i});/* import */var r=n(41594);/**
 * Render the table row containing the weekday names.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("thead",{"aria-hidden":true},r.createElement("tr",{...e}))}},29106:function(e,t,n){n.d(t,{m:()=>i});/* import */var r=n(41594);/**
 * Render the container for the weeks in the month grid.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("tbody",{...e})}},49600:function(e,t,n){n.d(t,{w:()=>a});/* import */var r=n(41594);/* import */var i=n(51409);/**
 * Render a dropdown to navigate between years in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Dropdown,{...e})}},32917:function(e,t,n){n.r(t);n.d(t,{Button:()=>/* reexport safe */r.$,CaptionLabel:()=>/* reexport safe */i.$,Chevron:()=>/* reexport safe */a.c,Day:()=>/* reexport safe */o.L,DayButton:()=>/* reexport safe */s.x,Dropdown:()=>/* reexport safe */l.m,DropdownNav:()=>/* reexport safe */d.z,Footer:()=>/* reexport safe */c.w,Month:()=>/* reexport safe */u.f,MonthCaption:()=>/* reexport safe */p.P,MonthGrid:()=>/* reexport safe */v.D,Months:()=>/* reexport safe */h.i,MonthsDropdown:()=>/* reexport safe */f.l,Nav:()=>/* reexport safe */g.s,NextMonthButton:()=>/* reexport safe */_.i,Option:()=>/* reexport safe */m.c,PreviousMonthButton:()=>/* reexport safe */b.u,Root:()=>/* reexport safe */y.b,Select:()=>/* reexport safe */w.l,Week:()=>/* reexport safe */x.j,WeekNumber:()=>/* reexport safe */k.u,WeekNumberHeader:()=>/* reexport safe */I.t,Weekday:()=>/* reexport safe */A.B,Weekdays:()=>/* reexport safe */Y.S,Weeks:()=>/* reexport safe */D.m,YearsDropdown:()=>/* reexport safe */C.w});/* import */var r=n(91327);/* import */var i=n(77307);/* import */var a=n(83180);/* import */var o=n(721);/* import */var s=n(80985);/* import */var l=n(69618);/* import */var d=n(92833);/* import */var c=n(57836);/* import */var u=n(57933);/* import */var p=n(22507);/* import */var v=n(71941);/* import */var h=n(94632);/* import */var f=n(78181);/* import */var g=n(56362);/* import */var _=n(19330);/* import */var m=n(4726);/* import */var b=n(87006);/* import */var y=n(58219);/* import */var w=n(27787);/* import */var x=n(80007);/* import */var A=n(66213);/* import */var Y=n(97328);/* import */var k=n(72818);/* import */var I=n(73531);/* import */var D=n(29106);/* import */var C=n(49600)},13907:function(e,t,n){n.d(t,{G:()=>a,w:()=>i});/* import */var r=n(32850);/**
 * Formats the caption of the month.
 *
 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
 * @param month The date representing the month.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted caption as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){const i=n??new r/* .DateLib */.i0(t);return i.formatMonthYear(e)}/**
 * @private
 * @deprecated Use {@link formatCaption} instead.
 * @group Formatters
 */const a=i},13663:function(e,t,n){n.d(t,{i:()=>i});/* import */var r=n(32850);/**
 * Formats the day date shown in the day cell.
 *
 * @defaultValue `d` (e.g., "1").
 * @param date The date to format.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted day as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"d")}},36306:function(e,t,n){n.d(t,{Z:()=>i});/* import */var r=n(32850);/**
 * Formats the month for the dropdown option label.
 *
 * @defaultValue The localized full month name.
 * @param month The date representing the month.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted month name as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){return t.format(e,"LLLL")}},82104:function(e,t,n){n.d(t,{n:()=>i});/* import */var r=n(32850);/**
 * Formats the week number.
 *
 * @defaultValue The week number as a string, with a leading zero for single-digit numbers.
 * @param weekNumber The week number to format.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted week number as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){if(e<10){return t.formatNumber(`0${e.toLocaleString()}`)}return t.formatNumber(`${e.toLocaleString()}`)}},61757:function(e,t,n){n.d(t,{U:()=>r});/**
 * Formats the header for the week number column.
 *
 * @defaultValue An empty string `""`.
 * @returns The formatted week number header as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function r(){return``}},52756:function(e,t,n){n.d(t,{Z:()=>i});/* import */var r=n(32850);/**
 * Formats the name of a weekday to be displayed in the weekdays header.
 *
 * @defaultValue `cccccc` (e.g., "Mo" for Monday).
 * @param weekday The date representing the weekday.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted weekday name as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"cccccc")}},72881:function(e,t,n){n.d(t,{D:()=>a,e:()=>i});/* import */var r=n(32850);/**
 * Formats the year for the dropdown option label.
 *
 * @param year The year to format.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted year as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){return t.format(e,"yyyy")}/**
 * @private
 * @deprecated Use `formatYearDropdown` instead.
 * @group Formatters
 */const a=i},84608:function(e,t,n){n.r(t);n.d(t,{formatCaption:()=>/* reexport safe */r.w,formatDay:()=>/* reexport safe */i.i,formatMonthCaption:()=>/* reexport safe */r.G,formatMonthDropdown:()=>/* reexport safe */a.Z,formatWeekNumber:()=>/* reexport safe */s.n,formatWeekNumberHeader:()=>/* reexport safe */l.U,formatWeekdayName:()=>/* reexport safe */o.Z,formatYearCaption:()=>/* reexport safe */d.D,formatYearDropdown:()=>/* reexport safe */d.e});/* import */var r=n(13907);/* import */var i=n(13663);/* import */var a=n(36306);/* import */var o=n(52756);/* import */var s=n(82104);/* import */var l=n(61757);/* import */var d=n(72881)},38547:function(e,t,n){n.d(t,{A:()=>o});/* import */var r=n(97766);var i;(function(e){e[e["Today"]=0]="Today";e[e["Selected"]=1]="Selected";e[e["LastFocused"]=2]="LastFocused";e[e["FocusedModifier"]=3]="FocusedModifier"})(i||(i={}));/**
 * Determines if a day is focusable based on its modifiers.
 *
 * A day is considered focusable if it is not disabled, hidden, or outside the
 * displayed month.
 *
 * @param modifiers The modifiers applied to the day.
 * @returns `true` if the day is focusable, otherwise `false`.
 */function a(e){return!e[r/* .DayFlag.disabled */.pL.disabled]&&!e[r/* .DayFlag.hidden */.pL.hidden]&&!e[r/* .DayFlag.outside */.pL.outside]}/**
 * Calculates the focus target day based on priority.
 *
 * This function determines the day that should receive focus in the calendar,
 * prioritizing days with specific modifiers (e.g., "focused", "today") or
 * selection states.
 *
 * @param days The array of `CalendarDay` objects to evaluate.
 * @param getModifiers A function to retrieve the modifiers for a given day.
 * @param isSelected A function to determine if a day is selected.
 * @param lastFocused The last focused day, if any.
 * @returns The `CalendarDay` that should receive focus, or `undefined` if no
 *   focusable day is found.
 */function o(e,t,n,o){let s;let l=-1;for(const d of e){const e=t(d);if(a(e)){if(e[r/* .DayFlag.focused */.pL.focused]&&l<i.FocusedModifier){s=d;l=i.FocusedModifier}else if(o?.isEqualTo(d)&&l<i.LastFocused){s=d;l=i.LastFocused}else if(n(d.date)&&l<i.Selected){s=d;l=i.Selected}else if(e[r/* .DayFlag.today */.pL.today]&&l<i.Today){s=d;l=i.Today}}}if(!s){// Return the first day that is focusable
s=e.find(e=>a(t(e)))}return s}},37836:function(e,t,n){n.d(t,{x:()=>a});/* import */var r=n(97766);/* import */var i=n(87331);/**
 * Creates a function to retrieve the modifiers for a given day.
 *
 * This function calculates both internal and custom modifiers for each day
 * based on the provided calendar days and DayPicker props.
 *
 * @private
 * @param days The array of `CalendarDay` objects to process.
 * @param props The DayPicker props, including modifiers and configuration
 *   options.
 * @param dateLib The date library to use for date manipulation.
 * @returns A function that retrieves the modifiers for a given `CalendarDay`.
 */function a(e,t,n,a,o){const{disabled:s,hidden:l,modifiers:d,showOutsideDays:c,broadcastCalendar:u,today:p}=t;const{isSameDay:v,isSameMonth:h,startOfMonth:f,isBefore:g,endOfMonth:_,isAfter:m}=o;const b=n&&f(n);const y=a&&_(a);const w={[r/* .DayFlag.focused */.pL.focused]:[],[r/* .DayFlag.outside */.pL.outside]:[],[r/* .DayFlag.disabled */.pL.disabled]:[],[r/* .DayFlag.hidden */.pL.hidden]:[],[r/* .DayFlag.today */.pL.today]:[]};const x={};for(const t of e){const{date:e,displayMonth:n}=t;const r=Boolean(n&&!h(e,n));const a=Boolean(b&&g(e,b));const f=Boolean(y&&m(e,y));const _=Boolean(s&&(0,i/* .dateMatchModifiers */.k)(e,s,o));const A=Boolean(l&&(0,i/* .dateMatchModifiers */.k)(e,l,o))||a||f||// Broadcast calendar will show outside days as default
!u&&!c&&r||u&&c===false&&r;const Y=v(e,p??o.today());if(r)w.outside.push(t);if(_)w.disabled.push(t);if(A)w.hidden.push(t);if(Y)w.today.push(t);// Add custom modifiers
if(d){Object.keys(d).forEach(n=>{const r=d?.[n];const a=r?(0,i/* .dateMatchModifiers */.k)(e,r,o):false;if(!a)return;if(x[n]){x[n].push(t)}else{x[n]=[t]}})}}return e=>{// Initialize all the modifiers to false
const t={[r/* .DayFlag.focused */.pL.focused]:false,[r/* .DayFlag.disabled */.pL.disabled]:false,[r/* .DayFlag.hidden */.pL.hidden]:false,[r/* .DayFlag.outside */.pL.outside]:false,[r/* .DayFlag.today */.pL.today]:false};const n={};// Find the modifiers for the given day
for(const n in w){const r=w[n];t[n]=r.some(t=>t===e)}for(const t in x){n[t]=x[t].some(t=>t===e)}return{...t,// custom modifiers should override all the previous ones
...n}}}},99905:function(e,t,n){n.d(t,{O:()=>a});/* import */var r=n(21337);/* import */var i=n(73958);/**
 * Returns the end date of the week in the broadcast calendar.
 *
 * The broadcast week ends on the last day of the last broadcast week for the
 * given date.
 *
 * @since 9.4.0
 * @param date The date for which to calculate the end of the broadcast week.
 * @param dateLib The date library to use for date manipulation.
 * @returns The end date of the broadcast week.
 */function a(e,t){const n=(0,i/* .startOfBroadcastWeek */.l)(e,t);const a=(0,r/* .getBroadcastWeeksInMonth */.I)(e,t);const o=t.addDays(n,a*7-1);return o}},21337:function(e,t,n){n.d(t,{I:()=>a});const r=5;const i=4;/**
 * Returns the number of weeks to display in the broadcast calendar for a given
 * month.
 *
 * The broadcast calendar may have either 4 or 5 weeks in a month, depending on
 * the start and end dates of the broadcast weeks.
 *
 * @since 9.4.0
 * @param month The month for which to calculate the number of weeks.
 * @param dateLib The date library to use for date manipulation.
 * @returns The number of weeks in the broadcast calendar (4 or 5).
 */function a(e,t){// Get the first day of the month
const n=t.startOfMonth(e);// Get the day of the week for the first day of the month (1-7, where 1 is Monday)
const a=n.getDay()>0?n.getDay():7;const o=t.addDays(e,-a+1);const s=t.addDays(o,r*7-1);const l=t.getMonth(e)===t.getMonth(s)?r:i;return l}},19287:function(e,t,n){n.d(t,{k:()=>i});/* import */var r=n(97766);/**
 * Returns the class names for a day based on its modifiers.
 *
 * This function combines the base class name for the day with any class names
 * associated with active modifiers.
 *
 * @param modifiers The modifiers applied to the day.
 * @param classNames The base class names for the calendar elements.
 * @param modifiersClassNames The class names associated with specific
 *   modifiers.
 * @returns An array of class names for the day.
 */function i(e,t,n={}){const a=Object.entries(e).filter(([,e])=>e===true).reduce((e,[i])=>{if(n[i]){e.push(n[i])}else if(t[r/* .DayFlag */.pL[i]]){e.push(t[r/* .DayFlag */.pL[i]])}else if(t[r/* .SelectionState */.wc[i]]){e.push(t[r/* .SelectionState */.wc[i]])}return e},[t[r.UI.Day]]);return a}},87096:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(32917);/**
 * Merges custom components from the props with the default components.
 *
 * This function ensures that any custom components provided in the props
 * override the default components.
 *
 * @param customComponents The custom components provided in the DayPicker
 *   props.
 * @returns An object containing the merged components.
 */function i(e){return{...r,...e}}},78933:function(e,t,n){n.d(t,{C:()=>r});/**
 * Extracts `data-` attributes from the DayPicker props.
 *
 * This function collects all `data-` attributes from the props and adds
 * additional attributes based on the DayPicker configuration.
 *
 * @param props The DayPicker props.
 * @returns An object containing the `data-` attributes.
 */function r(e){const t={"data-mode":e.mode??undefined,"data-required":"required"in e?e.required:undefined,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||undefined,"data-week-numbers":e.showWeekNumber||undefined,"data-broadcast-calendar":e.broadcastCalendar||undefined,"data-nav-layout":e.navLayout||undefined};Object.entries(e).forEach(([e,n])=>{if(e.startsWith("data-")){t[e]=n}});return t}},18711:function(e,t,n){n.d(t,{Y:()=>r});/**
 * Returns all the dates to display in the calendar.
 *
 * This function calculates the range of dates to display based on the provided
 * display months, constraints, and calendar configuration.
 *
 * @param displayMonths The months to display in the calendar.
 * @param maxDate The maximum date to include in the range.
 * @param props The DayPicker props, including calendar configuration options.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dates to display in the calendar.
 */function r(e,t,n,r){const i=e[0];const a=e[e.length-1];const{ISOWeek:o,fixedWeeks:s,broadcastCalendar:l}=n??{};const{addDays:d,differenceInCalendarDays:c,differenceInCalendarMonths:u,endOfBroadcastWeek:p,endOfISOWeek:v,endOfMonth:h,endOfWeek:f,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:m,startOfWeek:b}=r;const y=l?_(i,r):o?m(i):b(i);const w=l?p(a):o?v(h(a)):f(h(a));const x=c(w,y);const A=u(a,i)+1;const Y=[];for(let e=0;e<=x;e++){const n=d(y,e);if(t&&g(n,t)){break}Y.push(n)}// If fixed weeks is enabled, add the extra dates to the array
const k=l?35:42;const I=k*A;if(s&&Y.length<I){const e=I-Y.length;for(let t=0;t<e;t++){const e=d(Y[Y.length-1],1);Y.push(e)}}return Y}},9727:function(e,t,n){n.d(t,{_:()=>r});/**
 * Returns all the days belonging to the calendar by merging the days in the
 * weeks for each month.
 *
 * @param calendarMonths The array of calendar months.
 * @returns An array of `CalendarDay` objects representing all the days in the
 *   calendar.
 */function r(e){const t=[];return e.reduce((e,n)=>{const r=n.weeks.reduce((e,t)=>{return e.concat(t.days.slice())},t.slice());return e.concat(r.slice())},t.slice())}},1207:function(e,t,n){n.d(t,{a:()=>i});/* import */var r=n(97766);/**
 * Returns the default class names for the UI elements.
 *
 * This function generates a mapping of default class names for various UI
 * elements, day flags, selection states, and animations.
 *
 * @returns An object containing the default class names.
 * @group Utilities
 */function i(){const e={};for(const t in r.UI){e[r.UI[t]]=`rdp-${r.UI[t]}`}for(const t in r/* .DayFlag */.pL){e[r/* .DayFlag */.pL[t]]=`rdp-${r/* .DayFlag */.pL[t]}`}for(const t in r/* .SelectionState */.wc){e[r/* .SelectionState */.wc[t]]=`rdp-${r/* .SelectionState */.wc[t]}`}for(const t in r/* .Animation */.X5){e[r/* .Animation */.X5[t]]=`rdp-${r/* .Animation */.X5[t]}`}return e}},14151:function(e,t,n){n.d(t,{o:()=>r});/**
 * Returns the months to display in the calendar.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param props The DayPicker props, including `numberOfMonths`.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dates representing the months to display.
 */function r(e,t,n,r){const{numberOfMonths:i=1}=n;const a=[];for(let n=0;n<i;n++){const i=r.addMonths(e,n);if(t&&i>t){break}a.push(i)}return a}},69030:function(e,t,n){n.d(t,{l:()=>r});/**
 * Calculates the next date that should be focused in the calendar.
 *
 * This function determines the next focusable date based on the movement
 * direction, constraints, and calendar configuration.
 *
 * @param moveBy The unit of movement (e.g., "day", "week").
 * @param moveDir The direction of movement ("before" or "after").
 * @param refDate The reference date from which to calculate the next focusable
 *   date.
 * @param navStart The earliest date the user can navigate to.
 * @param navEnd The latest date the user can navigate to.
 * @param props The DayPicker props, including calendar configuration options.
 * @param dateLib The date library to use for date manipulation.
 * @returns The next focusable date.
 */function r(e,t,n,r,i,a,o){const{ISOWeek:s,broadcastCalendar:l}=a;const{addDays:d,addMonths:c,addWeeks:u,addYears:p,endOfBroadcastWeek:v,endOfISOWeek:h,endOfWeek:f,max:g,min:_,startOfBroadcastWeek:m,startOfISOWeek:b,startOfWeek:y}=o;const w={day:d,week:u,month:c,year:p,startOfWeek:e=>l?m(e,o):s?b(e):y(e),endOfWeek:e=>l?v(e):s?h(e):f(e)};let x=w[e](n,t==="after"?1:-1);if(t==="before"&&r){x=g([r,x])}else if(t==="after"&&i){x=_([i,x])}return x}},39903:function(e,t,n){n.d(t,{G:()=>i});/* import */var r=n(84608);/**
 * Merges custom formatters from the props with the default formatters.
 *
 * @param customFormatters The custom formatters provided in the DayPicker
 *   props.
 * @returns The merged formatters object.
 */function i(e){if(e?.formatMonthCaption&&!e.formatCaption){e.formatCaption=e.formatMonthCaption}if(e?.formatYearCaption&&!e.formatYearDropdown){e.formatYearDropdown=e.formatYearCaption}return{...r,...e}}},31094:function(e,t,n){n.d(t,{Z:()=>r});/**
 * Determines the initial month to display in the calendar based on the provided
 * props.
 *
 * This function calculates the starting month, considering constraints such as
 * `startMonth`, `endMonth`, and the number of months to display.
 *
 * @param props The DayPicker props, including navigation and date constraints.
 * @param dateLib The date library to use for date manipulation.
 * @returns The initial month to display.
 */function r(e,t,n,r){const{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e;let l=i||a||o;const{differenceInCalendarMonths:d,addMonths:c,startOfMonth:u}=r;if(n&&d(n,l)<s-1){const e=-1*(s-1);l=c(n,e)}if(t&&d(l,t)<0){l=t}return u(l)}},63612:function(e,t,n){n.d(t,{L:()=>r});/**
 * Returns the months to show in the dropdown.
 *
 * This function generates a list of months for the current year, formatted
 * using the provided formatter, and determines whether each month should be
 * disabled based on the navigation range.
 *
 * @param displayMonth The currently displayed month.
 * @param navStart The start date for navigation.
 * @param navEnd The end date for navigation.
 * @param formatters The formatters to use for formatting the month labels.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dropdown options representing the months, or `undefined`
 *   if no months are available.
 */function r(e,t,n,r,i){const{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:l,getMonth:d}=i;const c=l({start:o(e),end:s(e)});const u=c.map(e=>{const o=r.formatMonthDropdown(e,i);const s=d(e);const l=t&&e<a(t)||n&&e>a(n)||false;return{value:s,label:o,disabled:l}});return u}},72631:function(e,t,n){n.d(t,{S:()=>o});/* import */var r=n(61797);/* import */var i=n(46483);/* import */var a=n(48665);/**
 * Returns the months to display in the calendar.
 *
 * This function generates `CalendarMonth` objects for each month to be
 * displayed, including their weeks and days, based on the provided display
 * months and dates.
 *
 * @param displayMonths The months (as dates) to display in the calendar.
 * @param dates The dates to display in the calendar.
 * @param props Options from the DayPicker props context.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of `CalendarMonth` objects representing the months to
 *   display.
 */function o(e,t,n,o){const{addDays:s,endOfBroadcastWeek:l,endOfISOWeek:d,endOfMonth:c,endOfWeek:u,getISOWeek:p,getWeek:v,startOfBroadcastWeek:h,startOfISOWeek:f,startOfWeek:g}=o;const _=e.reduce((e,_)=>{const m=n.broadcastCalendar?h(_,o):n.ISOWeek?f(_):g(_);const b=n.broadcastCalendar?l(_):n.ISOWeek?d(c(_)):u(c(_));/** The dates to display in the month. */const y=t.filter(e=>{return e>=m&&e<=b});const w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&y.length<w){const e=t.filter(e=>{const t=w-y.length;return e>b&&e<=s(b,t)});y.push(...e)}const x=y.reduce((e,t)=>{const a=n.ISOWeek?p(t):v(t);const s=e.find(e=>e.weekNumber===a);const l=new r/* .CalendarDay */.P(t,_,o);if(!s){e.push(new i/* .CalendarWeek */.j(a,[l]))}else{s.days.push(l)}return e},[]);const A=new a/* .CalendarMonth */.j(_,x);e.push(A);return e},[]);if(!n.reverseMonths){return _}else{return _.reverse()}}},21289:function(e,t,n){n.d(t,{J:()=>r});/**
 * Returns the start and end months for calendar navigation.
 *
 * @param props The DayPicker props, including navigation and layout options.
 * @param dateLib The date library to use for date manipulation.
 * @returns A tuple containing the start and end months for navigation.
 */function r(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:l,endOfYear:d,newDate:c,today:u}=t;// Handle deprecated code
const{fromYear:p,toYear:v,fromMonth:h,toMonth:f}=e;if(!n&&h){n=h}if(!n&&p){n=t.newDate(p,0,1)}if(!r&&f){r=f}if(!r&&v){r=c(v,11,31)}const g=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";if(n){n=o(n)}else if(p){n=c(p,0,1)}else if(!n&&g){n=i(l(e.today??u(),-100))}if(r){r=s(r)}else if(v){r=c(v,11,31)}else if(!r&&g){r=d(e.today??u())}return[n?a(n):n,r?a(r):r]}},91725:function(e,t,n){n.d(t,{O:()=>o});/* import */var r=n(61797);/* import */var i=n(87331);/* import */var a=n(69030);/**
 * Determines the next focusable day in the calendar.
 *
 * This function recursively calculates the next focusable day based on the
 * movement direction and modifiers applied to the days.
 *
 * @param moveBy The unit of movement (e.g., "day", "week").
 * @param moveDir The direction of movement ("before" or "after").
 * @param refDay The currently focused day.
 * @param calendarStartMonth The earliest month the user can navigate to.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param props The DayPicker props, including modifiers and configuration
 *   options.
 * @param dateLib The date library to use for date manipulation.
 * @param attempt The current recursion attempt (used to limit recursion depth).
 * @returns The next focusable day, or `undefined` if no focusable day is found.
 */function o(e,t,n,s,l,d,c,u=0){if(u>365){// Limit the recursion to 365 attempts
return undefined}const p=(0,a/* .getFocusableDate */.l)(e,t,n.date,s,l,d,c);const v=Boolean(d.disabled&&(0,i/* .dateMatchModifiers */.k)(p,d.disabled,c));const h=Boolean(d.hidden&&(0,i/* .dateMatchModifiers */.k)(p,d.hidden,c));const f=p;const g=new r/* .CalendarDay */.P(p,f,c);if(!v&&!h){return g}// Recursively attempt to find the next focusable date
return o(e,t,g,s,l,d,c,u+1)}},80807:function(e,t,n){n.d(t,{Q:()=>r});/**
 * Returns the next month the user can navigate to, based on the given options.
 *
 * The next month is not always the next calendar month:
 *
 * - If it is after the `calendarEndMonth`, it returns `undefined`.
 * - If paged navigation is enabled, it skips forward by the number of displayed
 *   months.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param options Navigation options, including `numberOfMonths` and
 *   `pagedNavigation`.
 * @param dateLib The date library to use for date manipulation.
 * @returns The next month, or `undefined` if navigation is not possible.
 */function r(e,t,n,r){if(n.disableNavigation){return undefined}const{pagedNavigation:i,numberOfMonths:a=1}=n;const{startOfMonth:o,addMonths:s,differenceInCalendarMonths:l}=r;const d=i?a:1;const c=o(e);if(!t){return s(c,d)}const u=l(t,e);if(u<a){return undefined}return s(c,d)}},93987:function(e,t,n){n.d(t,{E:()=>r});/**
 * Returns the previous month the user can navigate to, based on the given
 * options.
 *
 * The previous month is not always the previous calendar month:
 *
 * - If it is before the `calendarStartMonth`, it returns `undefined`.
 * - If paged navigation is enabled, it skips back by the number of displayed
 *   months.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarStartMonth The earliest month the user can navigate to.
 * @param options Navigation options, including `numberOfMonths` and
 *   `pagedNavigation`.
 * @param dateLib The date library to use for date manipulation.
 * @returns The previous month, or `undefined` if navigation is not possible.
 */function r(e,t,n,r){if(n.disableNavigation){return undefined}const{pagedNavigation:i,numberOfMonths:a}=n;const{startOfMonth:o,addMonths:s,differenceInCalendarMonths:l}=r;const d=i?a??1:1;const c=o(e);if(!t){return s(c,-d)}const u=l(c,t);if(u<=0){return undefined}return s(c,-d)}},66564:function(e,t,n){n.d(t,{J:()=>i});/* import */var r=n(97766);/**
 * Returns the computed style for a day based on its modifiers.
 *
 * This function merges the base styles for the day with any styles associated
 * with active modifiers.
 *
 * @param dayModifiers The modifiers applied to the day.
 * @param styles The base styles for the calendar elements.
 * @param modifiersStyles The styles associated with specific modifiers.
 * @returns The computed style for the day.
 */function i(e,t={},n={}){let a={...t?.[r.UI.Day]};Object.entries(e).filter(([,e])=>e===true).forEach(([e])=>{a={...a,...n?.[e]}});return a}},86607:function(e,t,n){n.d(t,{c:()=>r});/**
 * Generates a series of 7 days, starting from the beginning of the week, to use
 * for formatting weekday names (e.g., Monday, Tuesday, etc.).
 *
 * @param dateLib The date library to use for date manipulation.
 * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
 * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
 *   on Monday, but may include adjustments for broadcast-specific rules).
 * @returns An array of 7 dates representing the weekdays.
 */function r(e,t,n){const r=e.today();const i=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r);const a=[];for(let t=0;t<7;t++){const n=e.addDays(i,t);a.push(n)}return a}},24595:function(e,t,n){n.d(t,{C:()=>r});/**
 * Returns an array of calendar weeks from an array of calendar months.
 *
 * @param months The array of calendar months.
 * @returns An array of calendar weeks.
 */function r(e){const t=[];return e.reduce((e,t)=>{return e.concat(t.weeks.slice())},t.slice())}},57899:function(e,t,n){n.d(t,{g:()=>r});/**
 * Returns the years to display in the dropdown.
 *
 * This function generates a list of years between the navigation start and end
 * dates, formatted using the provided formatter.
 *
 * @param navStart The start date for navigation.
 * @param navEnd The end date for navigation.
 * @param formatters The formatters to use for formatting the year labels.
 * @param dateLib The date library to use for date manipulation.
 * @param reverse If true, reverses the order of the years (descending).
 * @returns An array of dropdown options representing the years, or `undefined`
 *   if `navStart` or `navEnd` is not provided.
 */function r(e,t,n,i,a=false){if(!e)return undefined;if(!t)return undefined;const{startOfYear:o,endOfYear:s,eachYearOfInterval:l,getYear:d}=i;const c=o(e);const u=s(t);const p=l({start:c,end:u});if(a)p.reverse();return p.map(e=>{const t=n.formatYearDropdown(e,i);return{value:d(e),label:t,disabled:false}})}},73958:function(e,t,n){n.d(t,{l:()=>r});/**
 * Returns the start date of the week in the broadcast calendar.
 *
 * The broadcast week starts on Monday. If the first day of the month is not a
 * Monday, this function calculates the previous Monday as the start of the
 * broadcast week.
 *
 * @since 9.4.0
 * @param date The date for which to calculate the start of the broadcast week.
 * @param dateLib The date library to use for date manipulation.
 * @returns The start date of the broadcast week.
 */function r(e,t){const n=t.startOfMonth(e);const r=n.getDay();if(r===1){return n}else if(r===0){return t.addDays(n,-1*6)}else{return t.addDays(n,-1*(r-1))}}},74612:function(e,t,n){n.d(t,{j:()=>i});/* import */var r=n(41594);/**
 * A custom hook for managing both controlled and uncontrolled component states.
 *
 * This hook allows a component to support both controlled and uncontrolled
 * states by determining whether the `controlledValue` is provided. If it is
 * undefined, the hook falls back to using the internal state.
 *
 * @example
 *   // Uncontrolled usage
 *   const [value, setValue] = useControlledValue(0, undefined);
 *
 *   // Controlled usage
 *   const [value, setValue] = useControlledValue(0, props.value);
 *
 * @template T - The type of the value.
 * @param defaultValue The initial value for the uncontrolled state.
 * @param controlledValue The value for the controlled state. If undefined, the
 *   component will use the uncontrolled state.
 * @returns A tuple where the first element is the current value (either
 *   controlled or uncontrolled) and the second element is a setter function to
 *   update the value.
 */function i(e,t){const[n,i]=(0,r.useState)(e);const a=t===undefined?n:t;return[a,i]}},93116:function(e,t,n){n.r(t);n.d(t,{labelCaption:()=>/* reexport safe */i.t,labelDay:()=>/* reexport safe */r.Z,labelDayButton:()=>/* reexport safe */r.n,labelGrid:()=>/* reexport safe */i.b,labelGridcell:()=>/* reexport safe */a.P,labelMonthDropdown:()=>/* reexport safe */o.a,labelNav:()=>/* reexport safe */s.y,labelNext:()=>/* reexport safe */l.s,labelPrevious:()=>/* reexport safe */d.o,labelWeekNumber:()=>/* reexport safe */u.k,labelWeekNumberHeader:()=>/* reexport safe */p.N,labelWeekday:()=>/* reexport safe */c.n,labelYearDropdown:()=>/* reexport safe */v.n});/* import */var r=n(59830);/* import */var i=n(67918);/* import */var a=n(23462);/* import */var o=n(35227);/* import */var s=n(69545);/* import */var l=n(35179);/* import */var d=n(80651);/* import */var c=n(14618);/* import */var u=n(94923);/* import */var p=n(56690);/* import */var v=n(6998)},59830:function(e,t,n){n.d(t,{Z:()=>a,n:()=>i});/* import */var r=n(32850);/**
 * Generates the ARIA label for a day button.
 *
 * Use the `modifiers` argument to provide additional context for the label,
 * such as indicating if the day is "today" or "selected."
 *
 * @defaultValue The formatted date.
 * @param date - The date to format.
 * @param modifiers - The modifiers providing context for the day.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the day button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n,i){let a=(i??new r/* .DateLib */.i0(n)).format(e,"PPPP");if(t.today)a=`Today, ${a}`;if(t.selected)a=`${a}, selected`;return a}/**
 * @ignore
 * @deprecated Use `labelDayButton` instead.
 */const a=i},67918:function(e,t,n){n.d(t,{b:()=>i,t:()=>a});/* import */var r=n(32850);/**
 * Generates the ARIA label for the month grid, which is announced when entering
 * the grid.
 *
 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
 * @param date - The date representing the month.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the month grid.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n){const i=n??new r/* .DateLib */.i0(t);return i.formatMonthYear(e)}/**
 * @ignore
 * @deprecated Use {@link labelGrid} instead.
 */const a=i},23462:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(32850);/**
 * Generates the label for a day grid cell when the calendar is not interactive.
 *
 * @param date - The date to format.
 * @param modifiers - Optional modifiers providing context for the day.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The label for the day grid cell.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n,i){let a=(i??new r/* .DateLib */.i0(n)).format(e,"PPPP");if(t?.today){a=`Today, ${a}`}return a}},35227:function(e,t,n){n.d(t,{a:()=>r});/**
 * Generates the ARIA label for the months dropdown.
 *
 * @defaultValue `"Choose the Month"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the months dropdown.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Choose the Month"}},69545:function(e,t,n){n.d(t,{y:()=>r});/**
 * Generates the ARIA label for the navigation toolbar.
 *
 * @defaultValue `""`
 * @returns The ARIA label for the navigation toolbar.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(){return""}},35179:function(e,t,n){n.d(t,{s:()=>r});/**
 * Generates the ARIA label for the "next month" button.
 *
 * @defaultValue `"Go to the Next Month"`
 * @param month - The date representing the next month, or `undefined` if there
 *   is no next month.
 * @returns The ARIA label for the "next month" button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Go to the Next Month"}},80651:function(e,t,n){n.d(t,{o:()=>r});/**
 * Generates the ARIA label for the "previous month" button.
 *
 * @defaultValue `"Go to the Previous Month"`
 * @param month - The date representing the previous month, or `undefined` if
 *   there is no previous month.
 * @returns The ARIA label for the "previous month" button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Go to the Previous Month"}},94923:function(e,t,n){n.d(t,{k:()=>r});/**
 * Generates the ARIA label for the week number cell (the first cell in a row).
 *
 * @defaultValue `Week ${weekNumber}`
 * @param weekNumber - The number of the week.
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the week number cell.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e,t){return`Week ${e}`}},56690:function(e,t,n){n.d(t,{N:()=>r});/**
 * Generates the ARIA label for the week number header element.
 *
 * @defaultValue `"Week Number"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the week number header.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Week Number"}},14618:function(e,t,n){n.d(t,{n:()=>i});/* import */var r=n(32850);/**
 * Generates the ARIA label for a weekday column header.
 *
 * @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
 * @param date - The date representing the weekday.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the weekday column header.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"cccc")}},6998:function(e,t,n){n.d(t,{n:()=>r});/**
 * Generates the ARIA label for the years dropdown.
 *
 * @defaultValue `"Choose the Year"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the years dropdown.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Choose the Year"}},16687:function(e,t,n){n.d(t,{N:()=>i});/* import */var r=n(74612);/**
 * Hook to manage multiple-date selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected dates, a function to select dates,
 *   and a function to check if a date is selected.
 */function i(e,t){const{selected:n,required:i,onSelect:a}=e;const[o,s]=(0,r/* .useControlledValue */.j)(n,a?n:undefined);const l=!a?o:n;const{isSameDay:d}=t;const c=e=>{return l?.some(t=>d(t,e))??false};const{min:u,max:p}=e;const v=(e,t,n)=>{let r=[...l??[]];if(c(e)){if(l?.length===u){// Min value reached, do nothing
return}if(i&&l?.length===1){// Required value already selected do nothing
return}r=l?.filter(t=>!d(t,e))}else{if(l?.length===p){// Max value reached, reset the selection to date
r=[e]}else{// Add the date to the selection
r=[...r,e]}}if(!a){s(r)}a?.(r,e,t,n);return r};return{selected:l,select:v,isSelected:c}}},55115:function(e,t,n){n.d(t,{f:()=>s});/* import */var r=n(74612);/* import */var i=n(80653);/* import */var a=n(16660);/* import */var o=n(52044);/**
 * Hook to manage range selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected range, a function to select a
 *   range, and a function to check if a date is within the range.
 */function s(e,t){const{disabled:n,excludeDisabled:s,selected:l,required:d,onSelect:c}=e;const[u,p]=(0,r/* .useControlledValue */.j)(l,c?l:undefined);const v=!c?u:l;const h=e=>v&&(0,o/* .rangeIncludesDate */.R)(v,e,false,t);const f=(r,o,l)=>{const{min:u,max:h}=e;const f=r?(0,i/* .addToRange */.M)(r,v,u,h,d,t):undefined;if(s&&n&&f?.from&&f.to){if((0,a/* .rangeContainsModifiers */.P)({from:f.from,to:f.to},n,t)){// if a disabled days is found, the range is reset
f.from=r;f.to=undefined}}if(!c){p(f)}c?.(f,r,o,l);return f};return{selected:v,select:f,isSelected:h}}},47012:function(e,t,n){n.d(t,{G:()=>i});/* import */var r=n(74612);/**
 * Hook to manage single-date selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected date, a function to select a date,
 *   and a function to check if a date is selected.
 */function i(e,t){const{selected:n,required:i,onSelect:a}=e;const[o,s]=(0,r/* .useControlledValue */.j)(n,a?n:undefined);const l=!a?o:n;const{isSameDay:d}=t;const c=e=>{return l?d(l,e):false};const u=(e,t,n)=>{let r=e;if(!i&&l&&l&&d(e,l)){// If the date is the same, clear the selection.
r=undefined}if(!a){s(r)}if(i){a?.(r,e,t,n)}else{a?.(r,e,t,n)}return r};return{selected:l,select:u,isSelected:c}}},68587:function(e,t,n){n.d(t,{s:()=>p});/* import */var r=n(41594);/* import */var i=n(97766);const a=e=>{if(e instanceof HTMLElement)return e;return null};const o=e=>[...e.querySelectorAll("[data-animated-month]")??[]];const s=e=>a(e.querySelector("[data-animated-month]"));const l=e=>a(e.querySelector("[data-animated-caption]"));const d=e=>a(e.querySelector("[data-animated-weeks]"));const c=e=>a(e.querySelector("[data-animated-nav]"));const u=e=>a(e.querySelector("[data-animated-weekdays]"));/**
 * Handles animations for transitioning between months in the DayPicker
 * component.
 *
 * @private
 * @param rootElRef - A reference to the root element of the DayPicker
 *   component.
 * @param enabled - Whether animations are enabled.
 * @param options - Configuration options for the animation, including class
 *   names, months, focused day, and the date utility library.
 */function p(e,t,{classNames:n,months:a,focused:p,dateLib:v}){const h=(0,r.useRef)(null);const f=(0,r.useRef)(a);const g=(0,r.useRef)(false);(0,r.useLayoutEffect)(()=>{// get previous months before updating the previous months ref
const r=f.current;// update previous months ref for next effect trigger
f.current=a;if(!t||!e.current||// safety check because the ref can be set to anything by consumers
!(e.current instanceof HTMLElement)||// validation required for the animation to work as expected
a.length===0||r.length===0||a.length!==r.length){return}const _=v.isSameMonth(a[0].date,r[0].date);const m=v.isAfter(a[0].date,r[0].date);const b=m?n[i/* .Animation.caption_after_enter */.X5.caption_after_enter]:n[i/* .Animation.caption_before_enter */.X5.caption_before_enter];const y=m?n[i/* .Animation.weeks_after_enter */.X5.weeks_after_enter]:n[i/* .Animation.weeks_before_enter */.X5.weeks_before_enter];// get previous root element snapshot before updating the snapshot ref
const w=h.current;// update snapshot for next effect trigger
const x=e.current.cloneNode(true);if(x instanceof HTMLElement){// if this effect is triggered while animating, we need to clean up the new root snapshot
// to put it in the same state as when not animating, to correctly animate the next month change
const e=o(x);e.forEach(e=>{if(!(e instanceof HTMLElement))return;// remove the old month snapshots from the new root snapshot
const t=s(e);if(t&&e.contains(t)){e.removeChild(t)}// remove animation classes from the new month snapshots
const n=l(e);if(n){n.classList.remove(b)}const r=d(e);if(r){r.classList.remove(y)}});h.current=x}else{h.current=null}if(g.current||_||// skip animation if a day is focused because it can cause issues to the animation and is better for a11y
p){return}const A=w instanceof HTMLElement?o(w):[];const Y=o(e.current);if(Y?.every(e=>e instanceof HTMLElement)&&A&&A.every(e=>e instanceof HTMLElement)){g.current=true;const t=[];// set isolation to isolate to isolate the stacking context during animation
e.current.style.isolation="isolate";// set z-index to 1 to ensure the nav is clickable over the other elements being animated
const r=c(e.current);if(r){r.style.zIndex="1"}Y.forEach((a,o)=>{const s=A[o];if(!s){return}// animate new displayed month
a.style.position="relative";a.style.overflow="hidden";const c=l(a);if(c){c.classList.add(b)}const p=d(a);if(p){p.classList.add(y)}// animate new displayed month end
const v=()=>{g.current=false;if(e.current){e.current.style.isolation=""}if(r){r.style.zIndex=""}if(c){c.classList.remove(b)}if(p){p.classList.remove(y)}a.style.position="";a.style.overflow="";if(a.contains(s)){a.removeChild(s)}};t.push(v);// animate old displayed month
s.style.pointerEvents="none";s.style.position="absolute";s.style.overflow="hidden";s.setAttribute("aria-hidden","true");// hide the weekdays container of the old month and only the new one
const h=u(s);if(h){h.style.opacity="0"}const f=l(s);if(f){f.classList.add(m?n[i/* .Animation.caption_before_exit */.X5.caption_before_exit]:n[i/* .Animation.caption_after_exit */.X5.caption_after_exit]);f.addEventListener("animationend",v)}const _=d(s);if(_){_.classList.add(m?n[i/* .Animation.weeks_before_exit */.X5.weeks_before_exit]:n[i/* .Animation.weeks_after_exit */.X5.weeks_after_exit])}a.insertBefore(s,a.firstChild)})}})}},58071:function(e,t,n){n.d(t,{_:()=>h});/* import */var r=n(41594);/* import */var i=n(18711);/* import */var a=n(9727);/* import */var o=n(14151);/* import */var s=n(31094);/* import */var l=n(72631);/* import */var d=n(21289);/* import */var c=n(80807);/* import */var u=n(93987);/* import */var p=n(24595);/* import */var v=n(74612);/**
 * Provides the calendar object to work with the calendar in custom components.
 *
 * @private
 * @param props - The DayPicker props related to calendar configuration.
 * @param dateLib - The date utility library instance.
 * @returns The calendar object containing displayed days, weeks, months, and
 *   navigation methods.
 */function h(e,t){const[n,h]=(0,d/* .getNavMonths */.J)(e,t);const{startOfMonth:f,endOfMonth:g}=t;const _=(0,s/* .getInitialMonth */.Z)(e,n,h,t);const[m,b]=(0,v/* .useControlledValue */.j)(_,// initialMonth is always computed from props.month if provided
e.month?_:undefined);// biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
(0,r.useEffect)(()=>{const r=(0,s/* .getInitialMonth */.Z)(e,n,h,t);b(r)},[e.timeZone]);/** The months displayed in the calendar. */const y=(0,o/* .getDisplayMonths */.o)(m,h,e,t);/** The dates displayed in the calendar. */const w=(0,i/* .getDates */.Y)(y,e.endMonth?g(e.endMonth):undefined,e,t);/** The Months displayed in the calendar. */const x=(0,l/* .getMonths */.S)(y,w,e,t);/** The Weeks displayed in the calendar. */const A=(0,p/* .getWeeks */.C)(x);/** The Days displayed in the calendar. */const Y=(0,a/* .getDays */._)(x);const k=(0,u/* .getPreviousMonth */.E)(m,n,e,t);const I=(0,c/* .getNextMonth */.Q)(m,h,e,t);const{disableNavigation:D,onMonthChange:C}=e;const E=e=>A.some(t=>t.days.some(t=>t.isEqualTo(e)));const q=e=>{if(D){return}let t=f(e);// if month is before start, use the first month instead
if(n&&t<f(n)){t=f(n)}// if month is after endMonth, use the last month instead
if(h&&t>f(h)){t=f(h)}b(t);C?.(t)};const T=e=>{// is this check necessary?
if(E(e)){return}q(e.date)};const S={months:x,weeks:A,days:Y,navStart:n,navEnd:h,previousMonth:k,nextMonth:I,goToMonth:q,goToDay:T};return S}},51409:function(e,t,n){n.d(t,{S:()=>i,w:()=>a});/* import */var r=n(41594);/** @ignore */const i=(0,r.createContext)(undefined);/**
 * Provides access to the DayPicker context, which includes properties and
 * methods to interact with the DayPicker component. This hook must be used
 * within a custom component.
 *
 * @template T - Use this type to refine the returned context type with a
 *   specific selection mode.
 * @returns The context to work with DayPicker.
 * @throws {Error} If the hook is used outside of a DayPicker provider.
 * @group Hooks
 * @see https://daypicker.dev/guides/custom-components
 */function a(){const e=(0,r.useContext)(i);if(e===undefined){throw new Error("useDayPicker() must be used within a custom component.")}return e}},53581:function(e,t,n){n.d(t,{i:()=>o});/* import */var r=n(41594);/* import */var i=n(38547);/* import */var a=n(91725);/**
 * Manages focus behavior for the DayPicker component, including setting,
 * moving, and blurring focus on calendar days.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param calendar - The calendar object containing the displayed days and
 *   months.
 * @param getModifiers - A function to retrieve modifiers for a given day.
 * @param isSelected - A function to check if a date is selected.
 * @param dateLib - The date utility library instance.
 * @returns An object containing focus-related methods and the currently focused
 *   day.
 */function o(e,t,n,o,s){const{autoFocus:l}=e;const[d,c]=(0,r.useState)();const u=(0,i/* .calculateFocusTarget */.A)(t.days,n,o||(()=>false),d);const[p,v]=(0,r.useState)(l?u:undefined);const h=()=>{c(p);v(undefined)};const f=(n,r)=>{if(!p)return;const i=(0,a/* .getNextFocus */.O)(n,r,p,t.navStart,t.navEnd,e,s);if(!i)return;if(e.disableNavigation){const e=t.days.some(e=>e.isEqualTo(i));if(!e){return}}t.goToDay(i);v(i)};const g=e=>{return Boolean(u?.isEqualTo(e))};const _={isFocusTarget:g,setFocused:v,focused:p,blur:h,moveFocus:f};return _}},33127:function(e,t,n){n.d(t,{C:()=>o});/* import */var r=n(16687);/* import */var i=n(55115);/* import */var a=n(47012);/**
 * Determines the appropriate selection hook to use based on the selection mode
 * and returns the corresponding selection object.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns The selection object for the specified mode, or `undefined` if no
 *   mode is set.
 */function o(e,t){const n=(0,a/* .useSingle */.G)(e,t);const o=(0,r/* .useMulti */.N)(e,t);const s=(0,i/* .useRange */.f)(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return s;default:return undefined}}},80653:function(e,t,n){n.d(t,{M:()=>i});/* import */var r=n(32850);/**
 * Adds a date to an existing range, considering constraints like minimum and
 * maximum range size.
 *
 * @param date - The date to add to the range.
 * @param initialRange - The initial range to which the date will be added.
 * @param min - The minimum number of days in the range.
 * @param max - The maximum number of days in the range.
 * @param required - Whether the range must always include at least one date.
 * @param dateLib - The date utility library instance.
 * @returns The updated date range, or `undefined` if the range is cleared.
 * @group Utilities
 */function i(e,t,n=0,a=0,o=false,s=r/* .defaultDateLib */.VA){const{from:l,to:d}=t||{};const{isSameDay:c,isAfter:u,isBefore:p}=s;let v;if(!l&&!d){// the range is empty, add the date
v={from:e,to:n>0?undefined:e}}else if(l&&!d){// adding date to an incomplete range
if(c(l,e)){// adding a date equal to the start of the range
if(n===0){v={from:l,to:e}}else if(o){v={from:l,to:undefined}}else{v=undefined}}else if(p(e,l)){// adding a date before the start of the range
v={from:e,to:l}}else{// adding a date after the start of the range
v={from:l,to:e}}}else if(l&&d){// adding date to a complete range
if(c(l,e)&&c(d,e)){// adding a date that is equal to both start and end of the range
if(o){v={from:l,to:d}}else{v=undefined}}else if(c(l,e)){// adding a date equal to the the start of the range
v={from:l,to:n>0?undefined:e}}else if(c(d,e)){// adding a dare equal to the end of the range
v={from:e,to:n>0?undefined:e}}else if(p(e,l)){// adding a date before the start of the range
v={from:e,to:d}}else if(u(e,l)){// adding a date after the start of the range
v={from:l,to:e}}else if(u(e,d)){// adding a date after the end of the range
v={from:l,to:e}}else{throw new Error("Invalid range")}}// check for min / max
if(v?.from&&v?.to){const t=s.differenceInCalendarDays(v.to,v.from);if(a>0&&t>a){v={from:e,to:undefined}}else if(n>1&&t<n){v={from:e,to:undefined}}}return v}},87331:function(e,t,n){n.d(t,{k:()=>o});/* import */var r=n(32850);/* import */var i=n(52044);/* import */var a=n(70684);/**
 * Checks if a given date matches at least one of the specified {@link Matcher}.
 *
 * @param date - The date to check.
 * @param matchers - The matchers to check against.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the date matches any of the matchers, otherwise `false`.
 * @group Utilities
 */function o(e,t,n=r/* .defaultDateLib */.VA){const s=!Array.isArray(t)?[t]:t;const{isSameDay:l,differenceInCalendarDays:d,isAfter:c}=n;return s.some(t=>{if(typeof t==="boolean"){return t}if(n.isDate(t)){return l(e,t)}if((0,a/* .isDatesArray */.Hg)(t,n)){return t.includes(e)}if((0,a/* .isDateRange */.oM)(t)){return(0,i/* .rangeIncludesDate */.R)(t,e,false,n)}if((0,a/* .isDayOfWeekType */.OE)(t)){if(!Array.isArray(t.dayOfWeek)){return t.dayOfWeek===e.getDay()}return t.dayOfWeek.includes(e.getDay())}if((0,a/* .isDateInterval */.m4)(t)){const n=d(t.before,e);const r=d(t.after,e);const i=n>0;const a=r<0;const o=c(t.before,t.after);if(o){return a&&i}else{return i||a}}if((0,a/* .isDateAfterType */.RE)(t)){return d(e,t.after)>0}if((0,a/* .isDateBeforeType */.Ue)(t)){return d(t.before,e)>0}if(typeof t==="function"){return t(e)}return false})}/**
 * @private
 * @deprecated Use {@link dateMatchModifiers} instead.
 */const s=/* unused pure expression or super */null&&o},93397:function(e,t,n){n.d(t,{g:()=>i});/* import */var r=n(32850);/**
 * Checks if a date range contains one or more specified days of the week.
 *
 * @since 9.2.2
 * @param range - The date range to check.
 * @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is
 *   Sunday).
 * @param dateLib - The date utility library instance.
 * @returns `true` if the range contains the specified day(s) of the week,
 *   otherwise `false`.
 * @group Utilities
 */function i(e,t,n=r/* .defaultDateLib */.VA){const a=!Array.isArray(t)?[t]:t;let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from);// iterate at maximum one week or the total days if the range is shorter than one week
const l=Math.min(s,6);for(let e=0;e<=l;e++){if(a.includes(o.getDay())){return true}o=n.addDays(o,1)}return false}},16660:function(e,t,n){n.d(t,{P:()=>d});/* import */var r=n(32850);/* import */var i=n(87331);/* import */var a=n(93397);/* import */var o=n(52044);/* import */var s=n(45157);/* import */var l=n(70684);/**
 * Checks if a date range contains dates that match the given modifiers.
 *
 * @since 9.2.2
 * @param range - The date range to check.
 * @param modifiers - The modifiers to match against.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the range contains matching dates, otherwise `false`.
 * @group Utilities
 */function d(e,t,n=r/* .defaultDateLib */.VA){const c=Array.isArray(t)?t:[t];// Defer function matchers evaluation as they are the least performant.
const u=c.filter(e=>typeof e!=="function");const p=u.some(t=>{if(typeof t==="boolean")return t;if(n.isDate(t)){return(0,o/* .rangeIncludesDate */.R)(e,t,false,n)}if((0,l/* .isDatesArray */.Hg)(t,n)){return t.some(t=>(0,o/* .rangeIncludesDate */.R)(e,t,false,n))}if((0,l/* .isDateRange */.oM)(t)){if(t.from&&t.to){return(0,s/* .rangeOverlaps */.G)(e,{from:t.from,to:t.to},n)}return false}if((0,l/* .isDayOfWeekType */.OE)(t)){return(0,a/* .rangeContainsDayOfWeek */.g)(e,t.dayOfWeek,n)}if((0,l/* .isDateInterval */.m4)(t)){const r=n.isAfter(t.before,t.after);if(r){return(0,s/* .rangeOverlaps */.G)(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n)}return(0,i/* .dateMatchModifiers */.k)(e.from,t,n)||(0,i/* .dateMatchModifiers */.k)(e.to,t,n)}if((0,l/* .isDateAfterType */.RE)(t)||(0,l/* .isDateBeforeType */.Ue)(t)){return(0,i/* .dateMatchModifiers */.k)(e.from,t,n)||(0,i/* .dateMatchModifiers */.k)(e.to,t,n)}return false});if(p){return true}const v=c.filter(e=>typeof e==="function");if(v.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(v.some(e=>e(t))){return true}t=n.addDays(t,1)}}return false}},52044:function(e,t,n){n.d(t,{R:()=>i});/* import */var r=n(32850);/**
 * Checks if a given date is within a specified date range.
 *
 * @since 9.0.0
 * @param range - The date range to check against.
 * @param date - The date to check.
 * @param excludeEnds - If `true`, the range's start and end dates are excluded.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the date is within the range, otherwise `false`.
 * @group Utilities
 */function i(e,t,n=false,a=r/* .defaultDateLib */.VA){let{from:o,to:s}=e;const{differenceInCalendarDays:l,isSameDay:d}=a;if(o&&s){const e=l(s,o)<0;if(e){[o,s]=[s,o]}const r=l(t,o)>=(n?1:0)&&l(s,t)>=(n?1:0);return r}if(!n&&s){return d(s,t)}if(!n&&o){return d(o,t)}return false}/**
 * @private
 * @deprecated Use {@link rangeIncludesDate} instead.
 */const a=(e,t)=>i(e,t,false,defaultDateLib)},45157:function(e,t,n){n.d(t,{G:()=>a});/* import */var r=n(32850);/* import */var i=n(52044);/**
 * Determines if two date ranges overlap.
 *
 * @since 9.2.2
 * @param rangeLeft - The first date range.
 * @param rangeRight - The second date range.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the ranges overlap, otherwise `false`.
 * @group Utilities
 */function a(e,t,n=r/* .defaultDateLib */.VA){return(0,i/* .rangeIncludesDate */.R)(e,t.from,false,n)||(0,i/* .rangeIncludesDate */.R)(e,t.to,false,n)||(0,i/* .rangeIncludesDate */.R)(t,e.from,false,n)||(0,i/* .rangeIncludesDate */.R)(t,e.to,false,n)}},70684:function(e,t,n){n.d(t,{Hg:()=>l,OE:()=>s,RE:()=>a,Ue:()=>o,m4:()=>r,oM:()=>i});/**
 * Checks if the given value is of type {@link DateInterval}.
 *
 * @param matcher - The value to check.
 * @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
 * @group Utilities
 */function r(e){return Boolean(e&&typeof e==="object"&&"before"in e&&"after"in e)}/**
 * Checks if the given value is of type {@link DateRange}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateRange}, otherwise `false`.
 * @group Utilities
 */function i(e){return Boolean(e&&typeof e==="object"&&"from"in e)}/**
 * Checks if the given value is of type {@link DateAfter}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
 * @group Utilities
 */function a(e){return Boolean(e&&typeof e==="object"&&"after"in e)}/**
 * Checks if the given value is of type {@link DateBefore}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
 * @group Utilities
 */function o(e){return Boolean(e&&typeof e==="object"&&"before"in e)}/**
 * Checks if the given value is of type {@link DayOfWeek}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
 * @group Utilities
 */function s(e){return Boolean(e&&typeof e==="object"&&"dayOfWeek"in e)}/**
 * Checks if the given value is an array of valid dates.
 *
 * @private
 * @param value - The value to check.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the value is an array of valid dates, otherwise `false`.
 */function l(e,t){return Array.isArray(e)&&e.every(t.isDate)}},66504:function(e,t,n){n.d(t,{F:()=>r});function r(e,t){const n=e<0?"-":"";const r=Math.abs(e).toString().padStart(t,"0");return n+r}},89441:function(e,t,n){n.d(t,{q:()=>i});let r={};function i(){return r}function a(e){r=e}},89269:function(e,t,n){n.d(t,{_:()=>u});/* import */var r=n(20207);/* import */var i=n(11456);/* import */var a=n(85377);/* import */var o=n(64585);/* import */var s=n(91408);/* import */var l=n(66504);/* import */var d=n(71951);const c={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};/*
 * |     | Unit                           |     | Unit                           |
 * |-----|--------------------------------|-----|--------------------------------|
 * |  a  | AM, PM                         |  A* | Milliseconds in day            |
 * |  b  | AM, PM, noon, midnight         |  B  | Flexible day period            |
 * |  c  | Stand-alone local day of week  |  C* | Localized hour w/ day period   |
 * |  d  | Day of month                   |  D  | Day of year                    |
 * |  e  | Local day of week              |  E  | Day of week                    |
 * |  f  |                                |  F* | Day of week in month           |
 * |  g* | Modified Julian day            |  G  | Era                            |
 * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
 * |  i! | ISO day of week                |  I! | ISO week of year               |
 * |  j* | Localized hour w/ day period   |  J* | Localized hour w/o day period  |
 * |  k  | Hour [1-24]                    |  K  | Hour [0-11]                    |
 * |  l* | (deprecated)                   |  L  | Stand-alone month              |
 * |  m  | Minute                         |  M  | Month                          |
 * |  n  |                                |  N  |                                |
 * |  o! | Ordinal number modifier        |  O  | Timezone (GMT)                 |
 * |  p! | Long localized time            |  P! | Long localized date            |
 * |  q  | Stand-alone quarter            |  Q  | Quarter                        |
 * |  r* | Related Gregorian year         |  R! | ISO week-numbering year        |
 * |  s  | Second                         |  S  | Fraction of second             |
 * |  t! | Seconds timestamp              |  T! | Milliseconds timestamp         |
 * |  u  | Extended year                  |  U* | Cyclic year                    |
 * |  v* | Timezone (generic non-locat.)  |  V* | Timezone (location)            |
 * |  w  | Local week of year             |  W* | Week of month                  |
 * |  x  | Timezone (ISO-8601 w/o Z)      |  X  | Timezone (ISO-8601)            |
 * |  y  | Year (abs)                     |  Y  | Local week-numbering year      |
 * |  z  | Timezone (specific non-locat.) |  Z* | Timezone (aliases)             |
 *
 * Letters marked by * are not implemented but reserved by Unicode standard.
 *
 * Letters marked by ! are non-standard, but implemented by date-fns:
 * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
 * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
 *   i.e. 7 for Sunday, 1 for Monday, etc.
 * - `I` is ISO week of year, as opposed to `w` which is local week of year.
 * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
 *   `R` is supposed to be used in conjunction with `I` and `i`
 *   for universal ISO week-numbering date, whereas
 *   `Y` is supposed to be used in conjunction with `w` and `e`
 *   for week-numbering date specific to the locale.
 * - `P` is long localized date format
 * - `p` is long localized time format
 */const u={// Era
G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){// AD, BC
case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});// A, B
case"GGGGG":return n.era(r,{width:"narrow"});// Anno Domini, Before Christ
case"GGGG":default:return n.era(r,{width:"wide"})}},// Year
y:function(e,t,n){// Ordinal number
if(t==="yo"){const t=e.getFullYear();// Returns 1 for 1 BC (which is year 0 in JavaScript)
const r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return d/* .lightFormatters.y */.C.y(e,t)},// Local week-numbering year
Y:function(e,t,n,r){const i=(0,s/* .getWeekYear */.h)(e,r);// Returns 1 for 1 BC (which is year 0 in JavaScript)
const a=i>0?i:1-i;// Two digit year
if(t==="YY"){const e=a%100;return(0,l/* .addLeadingZeros */.F)(e,2)}// Ordinal number
if(t==="Yo"){return n.ordinalNumber(a,{unit:"year"})}// Padding
return(0,l/* .addLeadingZeros */.F)(a,t.length)},// ISO week-numbering year
R:function(e,t){const n=(0,a/* .getISOWeekYear */.p)(e);// Padding
return(0,l/* .addLeadingZeros */.F)(n,t.length)},// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 |   1 |   1 |
// | BC 1 |   1 |   0 |
// | BC 2 |   2 |  -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u:function(e,t){const n=e.getFullYear();return(0,l/* .addLeadingZeros */.F)(n,t.length)},// Quarter
Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){// 1, 2, 3, 4
case"Q":return String(r);// 01, 02, 03, 04
case"QQ":return(0,l/* .addLeadingZeros */.F)(r,2);// 1st, 2nd, 3rd, 4th
case"Qo":return n.ordinalNumber(r,{unit:"quarter"});// Q1, Q2, Q3, Q4
case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});// 1st quarter, 2nd quarter, ...
case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},// Stand-alone quarter
q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){// 1, 2, 3, 4
case"q":return String(r);// 01, 02, 03, 04
case"qq":return(0,l/* .addLeadingZeros */.F)(r,2);// 1st, 2nd, 3rd, 4th
case"qo":return n.ordinalNumber(r,{unit:"quarter"});// Q1, Q2, Q3, Q4
case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});// 1st quarter, 2nd quarter, ...
case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},// Month
M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return d/* .lightFormatters.M */.C.M(e,t);// 1st, 2nd, ..., 12th
case"Mo":return n.ordinalNumber(r+1,{unit:"month"});// Jan, Feb, ..., Dec
case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});// J, F, ..., D
case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});// January, February, ..., December
case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},// Stand-alone month
L:function(e,t,n){const r=e.getMonth();switch(t){// 1, 2, ..., 12
case"L":return String(r+1);// 01, 02, ..., 12
case"LL":return(0,l/* .addLeadingZeros */.F)(r+1,2);// 1st, 2nd, ..., 12th
case"Lo":return n.ordinalNumber(r+1,{unit:"month"});// Jan, Feb, ..., Dec
case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});// J, F, ..., D
case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});// January, February, ..., December
case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},// Local week of year
w:function(e,t,n,r){const i=(0,o/* .getWeek */.N)(e,r);if(t==="wo"){return n.ordinalNumber(i,{unit:"week"})}return(0,l/* .addLeadingZeros */.F)(i,t.length)},// ISO week of year
I:function(e,t,n){const r=(0,i/* .getISOWeek */.s)(e);if(t==="Io"){return n.ordinalNumber(r,{unit:"week"})}return(0,l/* .addLeadingZeros */.F)(r,t.length)},// Day of the month
d:function(e,t,n){if(t==="do"){return n.ordinalNumber(e.getDate(),{unit:"date"})}return d/* .lightFormatters.d */.C.d(e,t)},// Day of year
D:function(e,t,n){const i=(0,r/* .getDayOfYear */.F)(e);if(t==="Do"){return n.ordinalNumber(i,{unit:"dayOfYear"})}return(0,l/* .addLeadingZeros */.F)(i,t.length)},// Day of week
E:function(e,t,n){const r=e.getDay();switch(t){// Tue
case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});// T
case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});// Tu
case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});// Tuesday
case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},// Local day of week
e:function(e,t,n,r){const i=e.getDay();const a=(i-r.weekStartsOn+8)%7||7;switch(t){// Numerical value (Nth day of week with current locale or weekStartsOn)
case"e":return String(a);// Padded numerical value
case"ee":return(0,l/* .addLeadingZeros */.F)(a,2);// 1st, 2nd, ..., 7th
case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});// T
case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});// Tu
case"eeeeee":return n.day(i,{width:"short",context:"formatting"});// Tuesday
case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},// Stand-alone local day of week
c:function(e,t,n,r){const i=e.getDay();const a=(i-r.weekStartsOn+8)%7||7;switch(t){// Numerical value (same as in `e`)
case"c":return String(a);// Padded numerical value
case"cc":return(0,l/* .addLeadingZeros */.F)(a,t.length);// 1st, 2nd, ..., 7th
case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});// T
case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});// Tu
case"cccccc":return n.day(i,{width:"short",context:"standalone"});// Tuesday
case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},// ISO day of week
i:function(e,t,n){const r=e.getDay();const i=r===0?7:r;switch(t){// 2
case"i":return String(i);// 02
case"ii":return(0,l/* .addLeadingZeros */.F)(i,t.length);// 2nd
case"io":return n.ordinalNumber(i,{unit:"day"});// Tue
case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});// T
case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});// Tu
case"iiiiii":return n.day(r,{width:"short",context:"formatting"});// Tuesday
case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},// AM or PM
a:function(e,t,n){const r=e.getHours();const i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},// AM, PM, midnight, noon
b:function(e,t,n){const r=e.getHours();let i;if(r===12){i=c.noon}else if(r===0){i=c.midnight}else{i=r/12>=1?"pm":"am"}switch(t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},// in the morning, in the afternoon, in the evening, at night
B:function(e,t,n){const r=e.getHours();let i;if(r>=17){i=c.evening}else if(r>=12){i=c.afternoon}else if(r>=4){i=c.morning}else{i=c.night}switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},// Hour [1-12]
h:function(e,t,n){if(t==="ho"){let t=e.getHours()%12;if(t===0)t=12;return n.ordinalNumber(t,{unit:"hour"})}return d/* .lightFormatters.h */.C.h(e,t)},// Hour [0-23]
H:function(e,t,n){if(t==="Ho"){return n.ordinalNumber(e.getHours(),{unit:"hour"})}return d/* .lightFormatters.H */.C.H(e,t)},// Hour [0-11]
K:function(e,t,n){const r=e.getHours()%12;if(t==="Ko"){return n.ordinalNumber(r,{unit:"hour"})}return(0,l/* .addLeadingZeros */.F)(r,t.length)},// Hour [1-24]
k:function(e,t,n){let r=e.getHours();if(r===0)r=24;if(t==="ko"){return n.ordinalNumber(r,{unit:"hour"})}return(0,l/* .addLeadingZeros */.F)(r,t.length)},// Minute
m:function(e,t,n){if(t==="mo"){return n.ordinalNumber(e.getMinutes(),{unit:"minute"})}return d/* .lightFormatters.m */.C.m(e,t)},// Second
s:function(e,t,n){if(t==="so"){return n.ordinalNumber(e.getSeconds(),{unit:"second"})}return d/* .lightFormatters.s */.C.s(e,t)},// Fraction of second
S:function(e,t){return d/* .lightFormatters.S */.C.S(e,t)},// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0){return"Z"}switch(t){// Hours and optional minutes
case"X":return v(r);// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case"XXXX":case"XX":return h(r);// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case"XXXXX":case"XXX":default:return h(r,":")}},// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){// Hours and optional minutes
case"x":return v(r);// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case"xxxx":case"xx":return h(r);// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case"xxxxx":case"xxx":default:return h(r,":")}},// Timezone (GMT)
O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){// Short
case"O":case"OO":case"OOO":return"GMT"+p(r,":");// Long
case"OOOO":default:return"GMT"+h(r,":")}},// Timezone (specific non-location)
z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){// Short
case"z":case"zz":case"zzz":return"GMT"+p(r,":");// Long
case"zzzz":default:return"GMT"+h(r,":")}},// Seconds timestamp
t:function(e,t,n){const r=Math.trunc(+e/1e3);return(0,l/* .addLeadingZeros */.F)(r,t.length)},// Milliseconds timestamp
T:function(e,t,n){return(0,l/* .addLeadingZeros */.F)(+e,t.length)}};function p(e,t=""){const n=e>0?"-":"+";const r=Math.abs(e);const i=Math.trunc(r/60);const a=r%60;if(a===0){return n+String(i)}return n+String(i)+t+(0,l/* .addLeadingZeros */.F)(a,2)}function v(e,t){if(e%60===0){const t=e>0?"-":"+";return t+(0,l/* .addLeadingZeros */.F)(Math.abs(e)/60,2)}return h(e,t)}function h(e,t=""){const n=e>0?"-":"+";const r=Math.abs(e);const i=(0,l/* .addLeadingZeros */.F)(Math.trunc(r/60),2);const a=(0,l/* .addLeadingZeros */.F)(r%60,2);return n+i+t+a}},71951:function(e,t,n){n.d(t,{C:()=>i});/* import */var r=n(66504);/*
 * |     | Unit                           |     | Unit                           |
 * |-----|--------------------------------|-----|--------------------------------|
 * |  a  | AM, PM                         |  A* |                                |
 * |  d  | Day of month                   |  D  |                                |
 * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
 * |  m  | Minute                         |  M  | Month                          |
 * |  s  | Second                         |  S  | Fraction of second             |
 * |  y  | Year (abs)                     |  Y  |                                |
 *
 * Letters marked by * are not implemented but reserved by Unicode standard.
 */const i={// Year
y(e,t){// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year     |     y | yy |   yyy |  yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1     |     1 | 01 |   001 |  0001 | 00001 |
// | AD 12    |    12 | 12 |   012 |  0012 | 00012 |
// | AD 123   |   123 | 23 |   123 |  0123 | 00123 |
// | AD 1234  |  1234 | 34 |  1234 |  1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const n=e.getFullYear();// Returns 1 for 1 BC (which is year 0 in JavaScript)
const i=n>0?n:1-n;return(0,r/* .addLeadingZeros */.F)(t==="yy"?i%100:i,t.length)},// Month
M(e,t){const n=e.getMonth();return t==="M"?String(n+1):(0,r/* .addLeadingZeros */.F)(n+1,2)},// Day of the month
d(e,t){return(0,r/* .addLeadingZeros */.F)(e.getDate(),t.length)},// AM or PM
a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},// Hour [1-12]
h(e,t){return(0,r/* .addLeadingZeros */.F)(e.getHours()%12||12,t.length)},// Hour [0-23]
H(e,t){return(0,r/* .addLeadingZeros */.F)(e.getHours(),t.length)},// Minute
m(e,t){return(0,r/* .addLeadingZeros */.F)(e.getMinutes(),t.length)},// Second
s(e,t){return(0,r/* .addLeadingZeros */.F)(e.getSeconds(),t.length)},// Fraction of second
S(e,t){const n=t.length;const i=e.getMilliseconds();const a=Math.trunc(i*Math.pow(10,n-3));return(0,r/* .addLeadingZeros */.F)(a,t.length)}}},67403:function(e,t,n){n.d(t,{m:()=>o});const r=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}};const i=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}};const a=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[];const a=n[1];const o=n[2];if(!o){return r(e,t)}let s;switch(a){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",r(a,t)).replace("{{time}}",i(o,t))};const o={p:i,P:a}},13747:function(e,t,n){n.d(t,{G:()=>i});/* import */var r=n(49164);/**
 * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
 * They usually appear for dates that denote time before the timezones were introduced
 * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
 * and GMT+01:00:00 after that date)
 *
 * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
 * which would lead to incorrect calculations.
 *
 * This function returns the timezone offset in milliseconds that takes seconds in account.
 */function i(e){const t=(0,r/* .toDate */.a)(e);const n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));n.setUTCFullYear(t.getFullYear());return+e-+n}},74084:function(e,t,n){n.d(t,{x:()=>i});/* import */var r=n(27256);function i(e,...t){const n=r/* .constructFrom.bind */.w.bind(null,e||t.find(e=>typeof e==="object"));return t.map(n)}},22596:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(74084);function i(e,t){const[n,i]=(0,r/* .normalizeDates */.x)(e,t.start,t.end);return{start:n,end:i}}},87982:function(e,t,n){n.d(t,{Ss:()=>l,ef:()=>o,xM:()=>s});const r=/^D+$/;const i=/^Y+$/;const a=["D","DD","YY","YYYY"];function o(e){return r.test(e)}function s(e){return i.test(e)}function l(e,t,n){const r=d(e,t,n);console.warn(r);if(a.includes(e))throw new RangeError(r)}function d(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}},80517:function(e,t,n){n.d(t,{f:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link addDays} function options.
 *//**
 * @name addDays
 * @category Day Helpers
 * @summary Add the specified number of days to the given date.
 *
 * @description
 * Add the specified number of days to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of days to be added.
 * @param options - An object with options
 *
 * @returns The new date with the days added
 *
 * @example
 * // Add 10 days to 1 September 2014:
 * const result = addDays(new Date(2014, 8, 1), 10)
 * //=> Thu Sep 11 2014 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);// If 0 days, no-op to avoid changing times in the hour before end of DST
if(!t)return a;a.setDate(a.getDate()+t);return a}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},39669:function(e,t,n){n.d(t,{P:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link addMonths} function options.
 *//**
 * @name addMonths
 * @category Month Helpers
 * @summary Add the specified number of months to the given date.
 *
 * @description
 * Add the specified number of months to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of months to be added.
 * @param options - The options object
 *
 * @returns The new date with the months added
 *
 * @example
 * // Add 5 months to 1 September 2014:
 * const result = addMonths(new Date(2014, 8, 1), 5)
 * //=> Sun Feb 01 2015 00:00:00
 *
 * // Add one month to 30 January 2023:
 * const result = addMonths(new Date(2023, 0, 30), 1)
 * //=> Tue Feb 28 2023 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);if(!t){// If 0 months, no-op to avoid changing times in the hour before end of DST
return a}const o=a.getDate();// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021.  This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
// month and using a date of 0 to back up one day to the end of the desired
// month.
const s=(0,r/* .constructFrom */.w)(n?.in||e,a.getTime());s.setMonth(a.getMonth()+t+1,0);const l=s.getDate();if(o>=l){// If we're already at the end of the month, then this is the correct date
// and we're done.
return s}else{// Otherwise, we now know that setting the original day-of-month value won't
// cause an overflow, so set the desired day-of-month. Note that we can't
// just set the date of `endOfDesiredMonth` because that object may have had
// its time changed in the unusual case where where a DST transition was on
// the last day of the month and its local time was in the hour skipped or
// repeated next to a DST transition.  So we use `date` instead which is
// guaranteed to still have the original time.
a.setFullYear(s.getFullYear(),s.getMonth(),o);return a}}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},98637:function(e,t,n){n.d(t,{J:()=>i});/* import */var r=n(80517);/**
 * The {@link addWeeks} function options.
 *//**
 * @name addWeeks
 * @category Week Helpers
 * @summary Add the specified number of weeks to the given date.
 *
 * @description
 * Add the specified number of weeks to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of weeks to be added.
 * @param options - An object with options
 *
 * @returns The new date with the weeks added
 *
 * @example
 * // Add 4 weeks to 1 September 2014:
 * const result = addWeeks(new Date(2014, 8, 1), 4)
 * //=> Mon Sep 29 2014 00:00:00
 */function i(e,t,n){return(0,r/* .addDays */.f)(e,t*7,n)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},2510:function(e,t,n){n.d(t,{e:()=>i});/* import */var r=n(39669);/**
 * The {@link addYears} function options.
 *//**
 * @name addYears
 * @category Year Helpers
 * @summary Add the specified number of years to the given date.
 *
 * @description
 * Add the specified number of years to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type.
 *
 * @param date - The date to be changed
 * @param amount - The amount of years to be added.
 * @param options - The options
 *
 * @returns The new date with the years added
 *
 * @example
 * // Add 5 years to 1 September 2014:
 * const result = addYears(new Date(2014, 8, 1), 5)
 * //=> Sun Sep 01 2019 00:00:00
 */function i(e,t,n){return(0,r/* .addMonths */.P)(e,t*12,n)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},31308:function(e,t,n){n.d(t,{_P:()=>I,my:()=>s,w4:()=>l});/**
 * @module constants
 * @summary Useful constants
 * @description
 * Collection of useful date constants.
 *
 * The constants could be imported from `date-fns/constants`:
 *
 * ```ts
 * import { maxTime, minTime } from "./constants/date-fns/constants";
 *
 * function isAllowedTime(time) {
 *   return time <= maxTime && time >= minTime;
 * }
 * ```
 *//**
 * @constant
 * @name daysInWeek
 * @summary Days in 1 week.
 */const r=7;/**
 * @constant
 * @name daysInYear
 * @summary Days in 1 year.
 *
 * @description
 * How many days in a year.
 *
 * One years equals 365.2425 days according to the formula:
 *
 * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
 * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
 */const i=365.2425;/**
 * @constant
 * @name maxTime
 * @summary Maximum allowed time.
 *
 * @example
 * import { maxTime } from "./constants/date-fns/constants";
 *
 * const isValid = 8640000000000001 <= maxTime;
 * //=> false
 *
 * new Date(8640000000000001);
 * //=> Invalid Date
 */const a=Math.pow(10,8)*24*60*60*1e3;/**
 * @constant
 * @name minTime
 * @summary Minimum allowed time.
 *
 * @example
 * import { minTime } from "./constants/date-fns/constants";
 *
 * const isValid = -8640000000000001 >= minTime;
 * //=> false
 *
 * new Date(-8640000000000001)
 * //=> Invalid Date
 */const o=/* unused pure expression or super */null&&-a;/**
 * @constant
 * @name millisecondsInWeek
 * @summary Milliseconds in 1 week.
 */const s=6048e5;/**
 * @constant
 * @name millisecondsInDay
 * @summary Milliseconds in 1 day.
 */const l=864e5;/**
 * @constant
 * @name millisecondsInMinute
 * @summary Milliseconds in 1 minute
 */const d=6e4;/**
 * @constant
 * @name millisecondsInHour
 * @summary Milliseconds in 1 hour
 */const c=36e5;/**
 * @constant
 * @name millisecondsInSecond
 * @summary Milliseconds in 1 second
 */const u=1e3;/**
 * @constant
 * @name minutesInYear
 * @summary Minutes in 1 year.
 */const p=525600;/**
 * @constant
 * @name minutesInMonth
 * @summary Minutes in 1 month.
 */const v=43200;/**
 * @constant
 * @name minutesInDay
 * @summary Minutes in 1 day.
 */const h=1440;/**
 * @constant
 * @name minutesInHour
 * @summary Minutes in 1 hour.
 */const f=60;/**
 * @constant
 * @name monthsInQuarter
 * @summary Months in 1 quarter.
 */const g=3;/**
 * @constant
 * @name monthsInYear
 * @summary Months in 1 year.
 */const _=12;/**
 * @constant
 * @name quartersInYear
 * @summary Quarters in 1 year
 */const m=4;/**
 * @constant
 * @name secondsInHour
 * @summary Seconds in 1 hour.
 */const b=3600;/**
 * @constant
 * @name secondsInMinute
 * @summary Seconds in 1 minute.
 */const y=60;/**
 * @constant
 * @name secondsInDay
 * @summary Seconds in 1 day.
 */const w=/* unused pure expression or super */null&&b*24;/**
 * @constant
 * @name secondsInWeek
 * @summary Seconds in 1 week.
 */const x=/* unused pure expression or super */null&&w*7;/**
 * @constant
 * @name secondsInYear
 * @summary Seconds in 1 year.
 */const A=/* unused pure expression or super */null&&w*i;/**
 * @constant
 * @name secondsInMonth
 * @summary Seconds in 1 month
 */const Y=/* unused pure expression or super */null&&A/12;/**
 * @constant
 * @name secondsInQuarter
 * @summary Seconds in 1 quarter.
 */const k=/* unused pure expression or super */null&&Y*3;/**
 * @constant
 * @name constructFromSymbol
 * @summary Symbol enabling Date extensions to inherit properties from the reference date.
 *
 * The symbol is used to enable the `constructFrom` function to construct a date
 * using a reference date and a value. It allows to transfer extra properties
 * from the reference date to the new date. It's useful for extensions like
 * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
 * a constructor argument.
 */const I=Symbol.for("constructDateFrom")},27256:function(e,t,n){n.d(t,{w:()=>i});/* import */var r=n(31308);/**
 * @name constructFrom
 * @category Generic Helpers
 * @summary Constructs a date using the reference date and the value
 *
 * @description
 * The function constructs a new date using the constructor from the reference
 * date and the given value. It helps to build generic functions that accept
 * date extensions.
 *
 * It defaults to `Date` if the passed reference date is a number or a string.
 *
 * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
 * enabling to transfer extra properties from the reference date to the new date.
 * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
 * that accept a time zone as a constructor argument.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 *
 * @param date - The reference date to take constructor from
 * @param value - The value to create the date
 *
 * @returns Date initialized using the given date and value
 *
 * @example
 * import { constructFrom } from "./constructFrom/date-fns";
 *
 * // A function that clones a date preserving the original type
 * function cloneDate<DateType extends Date>(date: DateType): DateType {
 *   return constructFrom(
 *     date, // Use constructor from the given date
 *     date.getTime() // Use the date value to create a new date
 *   );
 * }
 */function i(e,t){if(typeof e==="function")return e(t);if(e&&typeof e==="object"&&r/* .constructFromSymbol */._P in e)return e[r/* .constructFromSymbol */._P](t);if(e instanceof Date)return new e.constructor(t);return new Date(t)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},26496:function(e,t,n){n.d(t,{m:()=>s});/* import */var r=n(13747);/* import */var i=n(74084);/* import */var a=n(31308);/* import */var o=n(8008);/**
 * The {@link differenceInCalendarDays} function options.
 *//**
 * @name differenceInCalendarDays
 * @category Day Helpers
 * @summary Get the number of calendar days between the given dates.
 *
 * @description
 * Get the number of calendar days between the given dates. This means that the times are removed
 * from the dates and then the difference in days is calculated.
 *
 * @param laterDate - The later date
 * @param earlierDate - The earlier date
 * @param options - The options object
 *
 * @returns The number of calendar days
 *
 * @example
 * // How many calendar days are between
 * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
 * const result = differenceInCalendarDays(
 *   new Date(2012, 6, 2, 0, 0),
 *   new Date(2011, 6, 2, 23, 0)
 * )
 * //=> 366
 * // How many calendar days are between
 * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
 * const result = differenceInCalendarDays(
 *   new Date(2011, 6, 3, 0, 1),
 *   new Date(2011, 6, 2, 23, 59)
 * )
 * //=> 1
 */function s(e,t,n){const[s,l]=(0,i/* .normalizeDates */.x)(n?.in,e,t);const d=(0,o/* .startOfDay */.o)(s);const c=(0,o/* .startOfDay */.o)(l);const u=+d-(0,r/* .getTimezoneOffsetInMilliseconds */.G)(d);const p=+c-(0,r/* .getTimezoneOffsetInMilliseconds */.G)(c);// Round the number of days to the nearest integer because the number of
// milliseconds in a day is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((u-p)/a/* .millisecondsInDay */.w4)}// Fallback for modularized imports:
/* unused export default */var l=/* unused pure expression or super */null&&s},4556:function(e,t,n){n.d(t,{U:()=>i});/* import */var r=n(74084);/**
 * The {@link differenceInCalendarMonths} function options.
 *//**
 * @name differenceInCalendarMonths
 * @category Month Helpers
 * @summary Get the number of calendar months between the given dates.
 *
 * @description
 * Get the number of calendar months between the given dates.
 *
 * @param laterDate - The later date
 * @param earlierDate - The earlier date
 * @param options - An object with options
 *
 * @returns The number of calendar months
 *
 * @example
 * // How many calendar months are between 31 January 2014 and 1 September 2014?
 * const result = differenceInCalendarMonths(
 *   new Date(2014, 8, 1),
 *   new Date(2014, 0, 31)
 * )
 * //=> 8
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);const o=i.getFullYear()-a.getFullYear();const s=i.getMonth()-a.getMonth();return o*12+s}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},80436:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(22596);/* import */var i=n(27256);/**
 * The {@link eachMonthOfInterval} function options.
 *//**
 * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.
 *//**
 * @name eachMonthOfInterval
 * @category Interval Helpers
 * @summary Return the array of months within the specified time interval.
 *
 * @description
 * Return the array of months within the specified time interval.
 *
 * @typeParam IntervalType - Interval type.
 * @typeParam Options - Options type.
 *
 * @param interval - The interval.
 * @param options - An object with options.
 *
 * @returns The array with starts of months from the month of the interval start to the month of the interval end
 *
 * @example
 * // Each month between 6 February 2014 and 10 August 2014:
 * const result = eachMonthOfInterval({
 *   start: new Date(2014, 1, 6),
 *   end: new Date(2014, 7, 10)
 * })
 * //=> [
 * //   Sat Feb 01 2014 00:00:00,
 * //   Sat Mar 01 2014 00:00:00,
 * //   Tue Apr 01 2014 00:00:00,
 * //   Thu May 01 2014 00:00:00,
 * //   Sun Jun 01 2014 00:00:00,
 * //   Tue Jul 01 2014 00:00:00,
 * //   Fri Aug 01 2014 00:00:00
 * // ]
 */function a(e,t){const{start:n,end:a}=(0,r/* .normalizeInterval */.P)(t?.in,e);let o=+n>+a;const s=o?+n:+a;const l=o?a:n;l.setHours(0,0,0,0);l.setDate(1);let d=t?.step??1;if(!d)return[];if(d<0){d=-d;o=!o}const c=[];while(+l<=s){c.push((0,i/* .constructFrom */.w)(n,l));l.setMonth(l.getMonth()+d)}return o?c.reverse():c}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},3929:function(e,t,n){n.d(t,{z:()=>a});/* import */var r=n(22596);/* import */var i=n(27256);/**
 * The {@link eachYearOfInterval} function options.
 *//**
 * The {@link eachYearOfInterval} function result type. It resolves the proper data type.
 * It uses the first argument date object type, starting from the date argument,
 * then the start interval date, and finally the end interval date. If
 * a context function is passed, it uses the context function return type.
 *//**
 * @name eachYearOfInterval
 * @category Interval Helpers
 * @summary Return the array of yearly timestamps within the specified time interval.
 *
 * @description
 * Return the array of yearly timestamps within the specified time interval.
 *
 * @typeParam IntervalType - Interval type.
 * @typeParam Options - Options type.
 *
 * @param interval - The interval.
 * @param options - An object with options.
 *
 * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
 *
 * @example
 * // Each year between 6 February 2014 and 10 August 2017:
 * const result = eachYearOfInterval({
 *   start: new Date(2014, 1, 6),
 *   end: new Date(2017, 7, 10)
 * })
 * //=> [
 * //   Wed Jan 01 2014 00:00:00,
 * //   Thu Jan 01 2015 00:00:00,
 * //   Fri Jan 01 2016 00:00:00,
 * //   Sun Jan 01 2017 00:00:00
 * // ]
 */function a(e,t){const{start:n,end:a}=(0,r/* .normalizeInterval */.P)(t?.in,e);let o=+n>+a;const s=o?+n:+a;const l=o?a:n;l.setHours(0,0,0,0);l.setMonth(0,1);let d=t?.step??1;if(!d)return[];if(d<0){d=-d;o=!o}const c=[];while(+l<=s){c.push((0,i/* .constructFrom */.w)(n,l));l.setFullYear(l.getFullYear()+d)}return o?c.reverse():c}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},65636:function(e,t,n){n.d(t,{g:()=>i});/* import */var r=n(1741);/**
 * The {@link endOfISOWeek} function options.
 *//**
 * @name endOfISOWeek
 * @category ISO Week Helpers
 * @summary Return the end of an ISO week for the given date.
 *
 * @description
 * Return the end of an ISO week for the given date.
 * The result will be in the local timezone.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of an ISO week
 *
 * @example
 * // The end of an ISO week for 2 September 2014 11:55:00:
 * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Sun Sep 07 2014 23:59:59.999
 */function i(e,t){return(0,r/* .endOfWeek */.$)(e,{...t,weekStartsOn:1})}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},50527:function(e,t,n){n.d(t,{p:()=>i});/* import */var r=n(49164);/**
 * The {@link endOfMonth} function options.
 *//**
 * @name endOfMonth
 * @category Month Helpers
 * @summary Return the end of a month for the given date.
 *
 * @description
 * Return the end of a month for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of a month
 *
 * @example
 * // The end of a month for 2 September 2014 11:55:00:
 * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Tue Sep 30 2014 23:59:59.999
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);const i=n.getMonth();n.setFullYear(n.getFullYear(),i+1,0);n.setHours(23,59,59,999);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},1741:function(e,t,n){n.d(t,{$:()=>a});/* import */var r=n(89441);/* import */var i=n(49164);/**
 * The {@link endOfWeek} function options.
 *//**
 * @name endOfWeek
 * @category Week Helpers
 * @summary Return the end of a week for the given date.
 *
 * @description
 * Return the end of a week for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of a week
 *
 * @example
 * // The end of a week for 2 September 2014 11:55:00:
 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Sat Sep 06 2014 23:59:59.999
 *
 * @example
 * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
 * //=> Sun Sep 07 2014 23:59:59.999
 */function a(e,t){const n=(0,r/* .getDefaultOptions */.q)();const a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const o=(0,i/* .toDate */.a)(e,t?.in);const s=o.getDay();const l=(s<a?-7:0)+6-(s-a);o.setDate(o.getDate()+l);o.setHours(23,59,59,999);return o}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},94528:function(e,t,n){n.d(t,{Q:()=>i});/* import */var r=n(49164);/**
 * The {@link endOfYear} function options.
 *//**
 * @name endOfYear
 * @category Year Helpers
 * @summary Return the end of a year for the given date.
 *
 * @description
 * Return the end of a year for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - The options
 *
 * @returns The end of a year
 *
 * @example
 * // The end of a year for 2 September 2014 11:55:00:
 * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Wed Dec 31 2014 23:59:59.999
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);const i=n.getFullYear();n.setFullYear(i+1,0,0);n.setHours(23,59,59,999);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},37902:function(e,t,n){n.d(t,{GP:()=>f});/* import */var r=n(56066);/* import */var i=n(89441);/* import */var a=n(89269);/* import */var o=n(67403);/* import */var s=n(87982);/* import */var l=n(93035);/* import */var d=n(49164);// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
//   (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
//   except a single quote symbol, which ends the sequence.
//   Two quote characters do not end the sequence.
//   If there is no matching single quote
//   then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const c=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
const u=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;const p=/^'([^]*?)'?$/;const v=/''/g;const h=/[a-zA-Z]/;/**
 * The {@link format} function options.
 *//**
 * @name format
 * @alias formatDate
 * @category Common Helpers
 * @summary Format the date.
 *
 * @description
 * Return the formatted date string in the given format. The result may vary by locale.
 *
 * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
 * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * The characters wrapped between two single quotes characters (') are escaped.
 * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
 * (see the last example)
 *
 * Format of the string is based on Unicode Technical Standard #35:
 * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
 * with a few additions (see note 7 below the table).
 *
 * Accepted patterns:
 * | Unit                            | Pattern | Result examples                   | Notes |
 * |---------------------------------|---------|-----------------------------------|-------|
 * | Era                             | G..GGG  | AD, BC                            |       |
 * |                                 | GGGG    | Anno Domini, Before Christ        | 2     |
 * |                                 | GGGGG   | A, B                              |       |
 * | Calendar year                   | y       | 44, 1, 1900, 2017                 | 5     |
 * |                                 | yo      | 44th, 1st, 0th, 17th              | 5,7   |
 * |                                 | yy      | 44, 01, 00, 17                    | 5     |
 * |                                 | yyy     | 044, 001, 1900, 2017              | 5     |
 * |                                 | yyyy    | 0044, 0001, 1900, 2017            | 5     |
 * |                                 | yyyyy   | ...                               | 3,5   |
 * | Local week-numbering year       | Y       | 44, 1, 1900, 2017                 | 5     |
 * |                                 | Yo      | 44th, 1st, 1900th, 2017th         | 5,7   |
 * |                                 | YY      | 44, 01, 00, 17                    | 5,8   |
 * |                                 | YYY     | 044, 001, 1900, 2017              | 5     |
 * |                                 | YYYY    | 0044, 0001, 1900, 2017            | 5,8   |
 * |                                 | YYYYY   | ...                               | 3,5   |
 * | ISO week-numbering year         | R       | -43, 0, 1, 1900, 2017             | 5,7   |
 * |                                 | RR      | -43, 00, 01, 1900, 2017           | 5,7   |
 * |                                 | RRR     | -043, 000, 001, 1900, 2017        | 5,7   |
 * |                                 | RRRR    | -0043, 0000, 0001, 1900, 2017     | 5,7   |
 * |                                 | RRRRR   | ...                               | 3,5,7 |
 * | Extended year                   | u       | -43, 0, 1, 1900, 2017             | 5     |
 * |                                 | uu      | -43, 01, 1900, 2017               | 5     |
 * |                                 | uuu     | -043, 001, 1900, 2017             | 5     |
 * |                                 | uuuu    | -0043, 0001, 1900, 2017           | 5     |
 * |                                 | uuuuu   | ...                               | 3,5   |
 * | Quarter (formatting)            | Q       | 1, 2, 3, 4                        |       |
 * |                                 | Qo      | 1st, 2nd, 3rd, 4th                | 7     |
 * |                                 | QQ      | 01, 02, 03, 04                    |       |
 * |                                 | QQQ     | Q1, Q2, Q3, Q4                    |       |
 * |                                 | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |
 * |                                 | QQQQQ   | 1, 2, 3, 4                        | 4     |
 * | Quarter (stand-alone)           | q       | 1, 2, 3, 4                        |       |
 * |                                 | qo      | 1st, 2nd, 3rd, 4th                | 7     |
 * |                                 | qq      | 01, 02, 03, 04                    |       |
 * |                                 | qqq     | Q1, Q2, Q3, Q4                    |       |
 * |                                 | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |
 * |                                 | qqqqq   | 1, 2, 3, 4                        | 4     |
 * | Month (formatting)              | M       | 1, 2, ..., 12                     |       |
 * |                                 | Mo      | 1st, 2nd, ..., 12th               | 7     |
 * |                                 | MM      | 01, 02, ..., 12                   |       |
 * |                                 | MMM     | Jan, Feb, ..., Dec                |       |
 * |                                 | MMMM    | January, February, ..., December  | 2     |
 * |                                 | MMMMM   | J, F, ..., D                      |       |
 * | Month (stand-alone)             | L       | 1, 2, ..., 12                     |       |
 * |                                 | Lo      | 1st, 2nd, ..., 12th               | 7     |
 * |                                 | LL      | 01, 02, ..., 12                   |       |
 * |                                 | LLL     | Jan, Feb, ..., Dec                |       |
 * |                                 | LLLL    | January, February, ..., December  | 2     |
 * |                                 | LLLLL   | J, F, ..., D                      |       |
 * | Local week of year              | w       | 1, 2, ..., 53                     |       |
 * |                                 | wo      | 1st, 2nd, ..., 53th               | 7     |
 * |                                 | ww      | 01, 02, ..., 53                   |       |
 * | ISO week of year                | I       | 1, 2, ..., 53                     | 7     |
 * |                                 | Io      | 1st, 2nd, ..., 53th               | 7     |
 * |                                 | II      | 01, 02, ..., 53                   | 7     |
 * | Day of month                    | d       | 1, 2, ..., 31                     |       |
 * |                                 | do      | 1st, 2nd, ..., 31st               | 7     |
 * |                                 | dd      | 01, 02, ..., 31                   |       |
 * | Day of year                     | D       | 1, 2, ..., 365, 366               | 9     |
 * |                                 | Do      | 1st, 2nd, ..., 365th, 366th       | 7     |
 * |                                 | DD      | 01, 02, ..., 365, 366             | 9     |
 * |                                 | DDD     | 001, 002, ..., 365, 366           |       |
 * |                                 | DDDD    | ...                               | 3     |
 * | Day of week (formatting)        | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | EEEEE   | M, T, W, T, F, S, S               |       |
 * |                                 | EEEEEE  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | ISO day of week (formatting)    | i       | 1, 2, 3, ..., 7                   | 7     |
 * |                                 | io      | 1st, 2nd, ..., 7th                | 7     |
 * |                                 | ii      | 01, 02, ..., 07                   | 7     |
 * |                                 | iii     | Mon, Tue, Wed, ..., Sun           | 7     |
 * |                                 | iiii    | Monday, Tuesday, ..., Sunday      | 2,7   |
 * |                                 | iiiii   | M, T, W, T, F, S, S               | 7     |
 * |                                 | iiiiii  | Mo, Tu, We, Th, Fr, Sa, Su        | 7     |
 * | Local day of week (formatting)  | e       | 2, 3, 4, ..., 1                   |       |
 * |                                 | eo      | 2nd, 3rd, ..., 1st                | 7     |
 * |                                 | ee      | 02, 03, ..., 01                   |       |
 * |                                 | eee     | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | eeee    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | eeeee   | M, T, W, T, F, S, S               |       |
 * |                                 | eeeeee  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | Local day of week (stand-alone) | c       | 2, 3, 4, ..., 1                   |       |
 * |                                 | co      | 2nd, 3rd, ..., 1st                | 7     |
 * |                                 | cc      | 02, 03, ..., 01                   |       |
 * |                                 | ccc     | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | cccc    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | ccccc   | M, T, W, T, F, S, S               |       |
 * |                                 | cccccc  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | AM, PM                          | a..aa   | AM, PM                            |       |
 * |                                 | aaa     | am, pm                            |       |
 * |                                 | aaaa    | a.m., p.m.                        | 2     |
 * |                                 | aaaaa   | a, p                              |       |
 * | AM, PM, noon, midnight          | b..bb   | AM, PM, noon, midnight            |       |
 * |                                 | bbb     | am, pm, noon, midnight            |       |
 * |                                 | bbbb    | a.m., p.m., noon, midnight        | 2     |
 * |                                 | bbbbb   | a, p, n, mi                       |       |
 * | Flexible day period             | B..BBB  | at night, in the morning, ...     |       |
 * |                                 | BBBB    | at night, in the morning, ...     | 2     |
 * |                                 | BBBBB   | at night, in the morning, ...     |       |
 * | Hour [1-12]                     | h       | 1, 2, ..., 11, 12                 |       |
 * |                                 | ho      | 1st, 2nd, ..., 11th, 12th         | 7     |
 * |                                 | hh      | 01, 02, ..., 11, 12               |       |
 * | Hour [0-23]                     | H       | 0, 1, 2, ..., 23                  |       |
 * |                                 | Ho      | 0th, 1st, 2nd, ..., 23rd          | 7     |
 * |                                 | HH      | 00, 01, 02, ..., 23               |       |
 * | Hour [0-11]                     | K       | 1, 2, ..., 11, 0                  |       |
 * |                                 | Ko      | 1st, 2nd, ..., 11th, 0th          | 7     |
 * |                                 | KK      | 01, 02, ..., 11, 00               |       |
 * | Hour [1-24]                     | k       | 24, 1, 2, ..., 23                 |       |
 * |                                 | ko      | 24th, 1st, 2nd, ..., 23rd         | 7     |
 * |                                 | kk      | 24, 01, 02, ..., 23               |       |
 * | Minute                          | m       | 0, 1, ..., 59                     |       |
 * |                                 | mo      | 0th, 1st, ..., 59th               | 7     |
 * |                                 | mm      | 00, 01, ..., 59                   |       |
 * | Second                          | s       | 0, 1, ..., 59                     |       |
 * |                                 | so      | 0th, 1st, ..., 59th               | 7     |
 * |                                 | ss      | 00, 01, ..., 59                   |       |
 * | Fraction of second              | S       | 0, 1, ..., 9                      |       |
 * |                                 | SS      | 00, 01, ..., 99                   |       |
 * |                                 | SSS     | 000, 001, ..., 999                |       |
 * |                                 | SSSS    | ...                               | 3     |
 * | Timezone (ISO-8601 w/ Z)        | X       | -08, +0530, Z                     |       |
 * |                                 | XX      | -0800, +0530, Z                   |       |
 * |                                 | XXX     | -08:00, +05:30, Z                 |       |
 * |                                 | XXXX    | -0800, +0530, Z, +123456          | 2     |
 * |                                 | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |
 * | Timezone (ISO-8601 w/o Z)       | x       | -08, +0530, +00                   |       |
 * |                                 | xx      | -0800, +0530, +0000               |       |
 * |                                 | xxx     | -08:00, +05:30, +00:00            | 2     |
 * |                                 | xxxx    | -0800, +0530, +0000, +123456      |       |
 * |                                 | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |
 * | Timezone (GMT)                  | O...OOO | GMT-8, GMT+5:30, GMT+0            |       |
 * |                                 | OOOO    | GMT-08:00, GMT+05:30, GMT+00:00   | 2     |
 * | Timezone (specific non-locat.)  | z...zzz | GMT-8, GMT+5:30, GMT+0            | 6     |
 * |                                 | zzzz    | GMT-08:00, GMT+05:30, GMT+00:00   | 2,6   |
 * | Seconds timestamp               | t       | 512969520                         | 7     |
 * |                                 | tt      | ...                               | 3,7   |
 * | Milliseconds timestamp          | T       | 512969520900                      | 7     |
 * |                                 | TT      | ...                               | 3,7   |
 * | Long localized date             | P       | 04/29/1453                        | 7     |
 * |                                 | PP      | Apr 29, 1453                      | 7     |
 * |                                 | PPP     | April 29th, 1453                  | 7     |
 * |                                 | PPPP    | Friday, April 29th, 1453          | 2,7   |
 * | Long localized time             | p       | 12:00 AM                          | 7     |
 * |                                 | pp      | 12:00:00 AM                       | 7     |
 * |                                 | ppp     | 12:00:00 AM GMT+2                 | 7     |
 * |                                 | pppp    | 12:00:00 AM GMT+02:00             | 2,7   |
 * | Combination of date and time    | Pp      | 04/29/1453, 12:00 AM              | 7     |
 * |                                 | PPpp    | Apr 29, 1453, 12:00:00 AM         | 7     |
 * |                                 | PPPppp  | April 29th, 1453 at ...           | 7     |
 * |                                 | PPPPpppp| Friday, April 29th, 1453 at ...   | 2,7   |
 * Notes:
 * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
 *    are the same as "stand-alone" units, but are different in some languages.
 *    "Formatting" units are declined according to the rules of the language
 *    in the context of a date. "Stand-alone" units are always nominative singular:
 *
 *    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
 *
 *    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
 *
 * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
 *    the single quote characters (see below).
 *    If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
 *    the output will be the same as default pattern for this unit, usually
 *    the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
 *    are marked with "2" in the last column of the table.
 *
 *    `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
 *
 * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
 *    The output will be padded with zeros to match the length of the pattern.
 *
 *    `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
 *
 * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
 *    These tokens represent the shortest form of the quarter.
 *
 * 5. The main difference between `y` and `u` patterns are B.C. years:
 *
 *    | Year | `y` | `u` |
 *    |------|-----|-----|
 *    | AC 1 |   1 |   1 |
 *    | BC 1 |   1 |   0 |
 *    | BC 2 |   2 |  -1 |
 *
 *    Also `yy` always returns the last two digits of a year,
 *    while `uu` pads single digit years to 2 characters and returns other years unchanged:
 *
 *    | Year | `yy` | `uu` |
 *    |------|------|------|
 *    | 1    |   01 |   01 |
 *    | 14   |   14 |   14 |
 *    | 376  |   76 |  376 |
 *    | 1453 |   53 | 1453 |
 *
 *    The same difference is true for local and ISO week-numbering years (`Y` and `R`),
 *    except local week-numbering years are dependent on `options.weekStartsOn`
 *    and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
 *    and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
 *
 * 6. Specific non-location timezones are currently unavailable in `date-fns`,
 *    so right now these tokens fall back to GMT timezones.
 *
 * 7. These patterns are not in the Unicode Technical Standard #35:
 *    - `i`: ISO day of week
 *    - `I`: ISO week of year
 *    - `R`: ISO week-numbering year
 *    - `t`: seconds timestamp
 *    - `T`: milliseconds timestamp
 *    - `o`: ordinal number modifier
 *    - `P`: long localized date
 *    - `p`: long localized time
 *
 * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
 *    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
 *    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * @param date - The original date
 * @param format - The string of tokens
 * @param options - An object with options
 *
 * @returns The formatted date string
 *
 * @throws `date` must not be Invalid Date
 * @throws `options.locale` must contain `localize` property
 * @throws `options.locale` must contain `formatLong` property
 * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws format string contains an unescaped latin alphabet character
 *
 * @example
 * // Represent 11 February 2014 in middle-endian format:
 * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
 * //=> '02/11/2014'
 *
 * @example
 * // Represent 2 July 2014 in Esperanto:
 * import { eoLocale } from 'date-fns/locale/eo'
 * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
 *   locale: eoLocale
 * })
 * //=> '2-a de julio 2014'
 *
 * @example
 * // Escape string by single quote characters:
 * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
 * //=> "3 o'clock"
 */function f(e,t,n){const p=(0,i/* .getDefaultOptions */.q)();const v=n?.locale??p.locale??r/* .enUS */.c;const f=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??p.firstWeekContainsDate??p.locale?.options?.firstWeekContainsDate??1;const _=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??p.weekStartsOn??p.locale?.options?.weekStartsOn??0;const m=(0,d/* .toDate */.a)(e,n?.in);if(!(0,l/* .isValid */.f)(m)){throw new RangeError("Invalid time value")}let b=t.match(u).map(e=>{const t=e[0];if(t==="p"||t==="P"){const n=o/* .longFormatters */.m[t];return n(e,v.formatLong)}return e}).join("").match(c).map(e=>{// Replace two single quote characters with one single quote character
if(e==="''"){return{isToken:false,value:"'"}}const t=e[0];if(t==="'"){return{isToken:false,value:g(e)}}if(a/* .formatters */._[t]){return{isToken:true,value:e}}if(t.match(h)){throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`")}return{isToken:false,value:e}});// invoke localize preprocessor (only for french locales at the moment)
if(v.localize.preprocessor){b=v.localize.preprocessor(m,b)}const y={firstWeekContainsDate:f,weekStartsOn:_,locale:v};return b.map(r=>{if(!r.isToken)return r.value;const i=r.value;if(!n?.useAdditionalWeekYearTokens&&(0,s/* .isProtectedWeekYearToken */.xM)(i)||!n?.useAdditionalDayOfYearTokens&&(0,s/* .isProtectedDayOfYearToken */.ef)(i)){(0,s/* .warnOrThrowProtectedError */.Ss)(i,t,String(e))}const o=a/* .formatters */._[i[0]];return o(m,i,v.localize,y)}).join("")}function g(e){const t=e.match(p);if(!t){return e}return t[1].replace(v,"'")}// Fallback for modularized imports:
/* unused export default */var _=/* unused pure expression or super */null&&f},20207:function(e,t,n){n.d(t,{F:()=>o});/* import */var r=n(26496);/* import */var i=n(40525);/* import */var a=n(49164);/**
 * The {@link getDayOfYear} function options.
 *//**
 * @name getDayOfYear
 * @category Day Helpers
 * @summary Get the day of the year of the given date.
 *
 * @description
 * Get the day of the year of the given date.
 *
 * @param date - The given date
 * @param options - The options
 *
 * @returns The day of year
 *
 * @example
 * // Which day of the year is 2 July 2014?
 * const result = getDayOfYear(new Date(2014, 6, 2))
 * //=> 183
 */function o(e,t){const n=(0,a/* .toDate */.a)(e,t?.in);const o=(0,r/* .differenceInCalendarDays */.m)(n,(0,i/* .startOfYear */.D)(n));const s=o+1;return s}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},21843:function(e,t,n){n.d(t,{P:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link getDaysInMonth} function options.
 *//**
 * @name getDaysInMonth
 * @category Month Helpers
 * @summary Get the number of days in a month of the given date.
 *
 * @description
 * Get the number of days in a month of the given date, considering the context if provided.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The number of days in a month
 *
 * @example
 * // How many days are in February 2000?
 * const result = getDaysInMonth(new Date(2000, 1))
 * //=> 29
 */function a(e,t){const n=(0,i/* .toDate */.a)(e,t?.in);const a=n.getFullYear();const o=n.getMonth();const s=(0,r/* .constructFrom */.w)(n,0);s.setFullYear(a,o+1,0);s.setHours(0,0,0,0);return s.getDate()}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},11456:function(e,t,n){n.d(t,{s:()=>s});/* import */var r=n(31308);/* import */var i=n(99719);/* import */var a=n(90642);/* import */var o=n(49164);/**
 * The {@link getISOWeek} function options.
 *//**
 * @name getISOWeek
 * @category ISO Week Helpers
 * @summary Get the ISO week of the given date.
 *
 * @description
 * Get the ISO week of the given date.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @param date - The given date
 * @param options - The options
 *
 * @returns The ISO week
 *
 * @example
 * // Which week of the ISO-week numbering year is 2 January 2005?
 * const result = getISOWeek(new Date(2005, 0, 2))
 * //=> 53
 */function s(e,t){const n=(0,o/* .toDate */.a)(e,t?.in);const s=+(0,i/* .startOfISOWeek */.b)(n)-+(0,a/* .startOfISOWeekYear */.w)(n);// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(s/r/* .millisecondsInWeek */.my)+1}// Fallback for modularized imports:
/* unused export default */var l=/* unused pure expression or super */null&&s},85377:function(e,t,n){n.d(t,{p:()=>o});/* import */var r=n(27256);/* import */var i=n(99719);/* import */var a=n(49164);/**
 * The {@link getISOWeekYear} function options.
 *//**
 * @name getISOWeekYear
 * @category ISO Week-Numbering Year Helpers
 * @summary Get the ISO week-numbering year of the given date.
 *
 * @description
 * Get the ISO week-numbering year of the given date,
 * which always starts 3 days before the year's first Thursday.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @param date - The given date
 *
 * @returns The ISO week-numbering year
 *
 * @example
 * // Which ISO-week numbering year is 2 January 2005?
 * const result = getISOWeekYear(new Date(2005, 0, 2))
 * //=> 2004
 */function o(e,t){const n=(0,a/* .toDate */.a)(e,t?.in);const o=n.getFullYear();const s=(0,r/* .constructFrom */.w)(n,0);s.setFullYear(o+1,0,4);s.setHours(0,0,0,0);const l=(0,i/* .startOfISOWeek */.b)(s);const d=(0,r/* .constructFrom */.w)(n,0);d.setFullYear(o,0,4);d.setHours(0,0,0,0);const c=(0,i/* .startOfISOWeek */.b)(d);if(n.getTime()>=l.getTime()){return o+1}else if(n.getTime()>=c.getTime()){return o}else{return o-1}}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},16331:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(49164);/**
 * The {@link getMonth} function options.
 *//**
 * @name getMonth
 * @category Month Helpers
 * @summary Get the month of the given date.
 *
 * @description
 * Get the month of the given date.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The month index (0-11)
 *
 * @example
 * // Which month is 29 February 2012?
 * const result = getMonth(new Date(2012, 1, 29))
 * //=> 1
 */function i(e,t){return(0,r/* .toDate */.a)(e,t?.in).getMonth()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},64585:function(e,t,n){n.d(t,{N:()=>s});/* import */var r=n(31308);/* import */var i=n(73524);/* import */var a=n(7629);/* import */var o=n(49164);/**
 * The {@link getWeek} function options.
 *//**
 * @name getWeek
 * @category Week Helpers
 * @summary Get the local week index of the given date.
 *
 * @description
 * Get the local week index of the given date.
 * The exact calculation depends on the values of
 * `options.weekStartsOn` (which is the index of the first day of the week)
 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
 * the first week of the week-numbering year)
 *
 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The week
 *
 * @example
 * // Which week of the local week numbering year is 2 January 2005 with default options?
 * const result = getWeek(new Date(2005, 0, 2))
 * //=> 2
 *
 * @example
 * // Which week of the local week numbering year is 2 January 2005,
 * // if Monday is the first day of the week,
 * // and the first week of the year always contains 4 January?
 * const result = getWeek(new Date(2005, 0, 2), {
 *   weekStartsOn: 1,
 *   firstWeekContainsDate: 4
 * })
 * //=> 53
 */function s(e,t){const n=(0,o/* .toDate */.a)(e,t?.in);const s=+(0,i/* .startOfWeek */.k)(n,t)-+(0,a/* .startOfWeekYear */.b)(n,t);// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(s/r/* .millisecondsInWeek */.my)+1}// Fallback for modularized imports:
/* unused export default */var l=/* unused pure expression or super */null&&s},91408:function(e,t,n){n.d(t,{h:()=>s});/* import */var r=n(89441);/* import */var i=n(27256);/* import */var a=n(73524);/* import */var o=n(49164);/**
 * The {@link getWeekYear} function options.
 *//**
 * @name getWeekYear
 * @category Week-Numbering Year Helpers
 * @summary Get the local week-numbering year of the given date.
 *
 * @description
 * Get the local week-numbering year of the given date.
 * The exact calculation depends on the values of
 * `options.weekStartsOn` (which is the index of the first day of the week)
 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
 * the first week of the week-numbering year)
 *
 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
 *
 * @param date - The given date
 * @param options - An object with options.
 *
 * @returns The local week-numbering year
 *
 * @example
 * // Which week numbering year is 26 December 2004 with the default settings?
 * const result = getWeekYear(new Date(2004, 11, 26))
 * //=> 2005
 *
 * @example
 * // Which week numbering year is 26 December 2004 if week starts on Saturday?
 * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
 * //=> 2004
 *
 * @example
 * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
 * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
 * //=> 2004
 */function s(e,t){const n=(0,o/* .toDate */.a)(e,t?.in);const s=n.getFullYear();const l=(0,r/* .getDefaultOptions */.q)();const d=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1;const c=(0,i/* .constructFrom */.w)(t?.in||e,0);c.setFullYear(s+1,0,d);c.setHours(0,0,0,0);const u=(0,a/* .startOfWeek */.k)(c,t);const p=(0,i/* .constructFrom */.w)(t?.in||e,0);p.setFullYear(s,0,d);p.setHours(0,0,0,0);const v=(0,a/* .startOfWeek */.k)(p,t);if(+n>=+u){return s+1}else if(+n>=+v){return s}else{return s-1}}// Fallback for modularized imports:
/* unused export default */var l=/* unused pure expression or super */null&&s},27372:function(e,t,n){n.d(t,{C:()=>i});/* import */var r=n(49164);/**
 * The {@link getYear} function options.
 *//**
 * @name getYear
 * @category Year Helpers
 * @summary Get the year of the given date.
 *
 * @description
 * Get the year of the given date.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The year
 *
 * @example
 * // Which year is 2 July 2014?
 * const result = getYear(new Date(2014, 6, 2))
 * //=> 2014
 */function i(e,t){return(0,r/* .toDate */.a)(e,t?.in).getFullYear()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},71271:function(e,t,n){n.d(t,{d:()=>i});/* import */var r=n(49164);/**
 * @name isAfter
 * @category Common Helpers
 * @summary Is the first date after the second one?
 *
 * @description
 * Is the first date after the second one?
 *
 * @param date - The date that should be after the other one to return true
 * @param dateToCompare - The date to compare with
 *
 * @returns The first date is after the second date
 *
 * @example
 * // Is 10 July 1989 after 11 February 1987?
 * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
 * //=> true
 */function i(e,t){return+(0,r/* .toDate */.a)(e)>+(0,r/* .toDate */.a)(t)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},97822:function(e,t,n){n.d(t,{Y:()=>i});/* import */var r=n(49164);/**
 * @name isBefore
 * @category Common Helpers
 * @summary Is the first date before the second one?
 *
 * @description
 * Is the first date before the second one?
 *
 * @param date - The date that should be before the other one to return true
 * @param dateToCompare - The date to compare with
 *
 * @returns The first date is before the second date
 *
 * @example
 * // Is 10 July 1989 before 11 February 1987?
 * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
 * //=> false
 */function i(e,t){return+(0,r/* .toDate */.a)(e)<+(0,r/* .toDate */.a)(t)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},21721:function(e,t,n){n.d(t,{$:()=>r});/**
 * @name isDate
 * @category Common Helpers
 * @summary Is the given value a date?
 *
 * @description
 * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
 *
 * @param value - The value to check
 *
 * @returns True if the given value is a date
 *
 * @example
 * // For a valid date:
 * const result = isDate(new Date())
 * //=> true
 *
 * @example
 * // For an invalid date:
 * const result = isDate(new Date(NaN))
 * //=> true
 *
 * @example
 * // For some value:
 * const result = isDate('2014-02-31')
 * //=> false
 *
 * @example
 * // For an object:
 * const result = isDate({})
 * //=> false
 */function r(e){return e instanceof Date||typeof e==="object"&&Object.prototype.toString.call(e)==="[object Date]"}// Fallback for modularized imports:
/* unused export default */var i=/* unused pure expression or super */null&&r},13249:function(e,t,n){n.d(t,{r:()=>a});/* import */var r=n(74084);/* import */var i=n(8008);/**
 * The {@link isSameDay} function options.
 *//**
 * @name isSameDay
 * @category Day Helpers
 * @summary Are the given dates in the same day (and year and month)?
 *
 * @description
 * Are the given dates in the same day (and year and month)?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same day (and year and month)
 *
 * @example
 * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
 * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
 * //=> true
 *
 * @example
 * // Are 4 September and 4 October in the same day?
 * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
 * //=> false
 *
 * @example
 * // Are 4 September, 2014 and 4 September, 2015 in the same day?
 * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
 * //=> false
 */function a(e,t,n){const[a,o]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return+(0,i/* .startOfDay */.o)(a)===+(0,i/* .startOfDay */.o)(o)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},21309:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(74084);/**
 * The {@link isSameMonth} function options.
 *//**
 * @name isSameMonth
 * @category Month Helpers
 * @summary Are the given dates in the same month (and year)?
 *
 * @description
 * Are the given dates in the same month (and year)?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same month (and year)
 *
 * @example
 * // Are 2 September 2014 and 25 September 2014 in the same month?
 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
 * //=> true
 *
 * @example
 * // Are 2 September 2014 and 25 September 2015 in the same month?
 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
 * //=> false
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},29318:function(e,t,n){n.d(t,{s:()=>i});/* import */var r=n(74084);/**
 * The {@link isSameYear} function options.
 *//**
 * @name isSameYear
 * @category Year Helpers
 * @summary Are the given dates in the same year?
 *
 * @description
 * Are the given dates in the same year?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same year
 *
 * @example
 * // Are 2 September 2014 and 25 September 2014 in the same year?
 * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
 * //=> true
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return i.getFullYear()===a.getFullYear()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},93035:function(e,t,n){n.d(t,{f:()=>a});/* import */var r=n(21721);/* import */var i=n(49164);/**
 * @name isValid
 * @category Common Helpers
 * @summary Is the given date valid?
 *
 * @description
 * Returns false if argument is Invalid Date and true otherwise.
 * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
 * Invalid Date is a Date, whose time value is NaN.
 *
 * Time value of Date: http://es5.github.io/#x15.9.1.1
 *
 * @param date - The date to check
 *
 * @returns The date is valid
 *
 * @example
 * // For the valid date:
 * const result = isValid(new Date(2014, 1, 31))
 * //=> true
 *
 * @example
 * // For the value, convertible into a date:
 * const result = isValid(1393804800000)
 * //=> true
 *
 * @example
 * // For the invalid date:
 * const result = isValid(new Date(''))
 * //=> false
 */function a(e){return!(!(0,r/* .isDate */.$)(e)&&typeof e!=="number"||isNaN(+(0,i/* .toDate */.a)(e)))}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},31240:function(e,t,n){n.d(t,{k:()=>r});function r(e){return (t={})=>{// TODO: Remove String()
const n=t.width?String(t.width):e.defaultWidth;const r=e.formats[n]||e.formats[e.defaultWidth];return r}}},77846:function(e,t,n){n.d(t,{o:()=>r});/**
 * The localize function argument callback which allows to convert raw value to
 * the actual type.
 *
 * @param value - The value to convert
 *
 * @returns The converted value
 *//**
 * The map of localized values for each width.
 *//**
 * The index type of the locale unit value. It types conversion of units of
 * values that don't start at 0 (i.e. quarters).
 *//**
 * Converts the unit value to the tuple of values.
 *//**
 * The tuple of localized era values. The first element represents BC,
 * the second element represents AD.
 *//**
 * The tuple of localized quarter values. The first element represents Q1.
 *//**
 * The tuple of localized day values. The first element represents Sunday.
 *//**
 * The tuple of localized month values. The first element represents January.
 */function r(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth;const r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth;const r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}const a=e.argumentCallback?e.argumentCallback(t):t;// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return i[a]}}},76260:function(e,t,n){n.d(t,{A:()=>r});function r(e){return(t,n={})=>{const r=n.width;const o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth];const s=t.match(o);if(!s){return null}const l=s[0];const d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth];const c=Array.isArray(d)?a(d,e=>e.test(l)):i(d,e=>e.test(l));let u;u=e.valueCallback?e.valueCallback(c):c;u=n.valueCallback?n.valueCallback(u):u;const p=t.slice(l.length);return{value:u,rest:p}}}function i(e,t){for(const n in e){if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n])){return n}}return undefined}function a(e,t){for(let n=0;n<e.length;n++){if(t(e[n])){return n}}return undefined}},69564:function(e,t,n){n.d(t,{K:()=>r});function r(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0];const a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];// [TODO] I challenge you to fix the type
o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}},56066:function(e,t,n){n.d(t,{c:()=>l});/* import */var r=n(40052);/* import */var i=n(82909);/* import */var a=n(95387);/* import */var o=n(81107);/* import */var s=n(9683);/**
 * @category Locales
 * @summary English locale (United States).
 * @language English
 * @iso-639-2 eng
 * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
 * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
 */const l={code:"en-US",formatDistance:r/* .formatDistance */.B,formatLong:i/* .formatLong */.s,formatRelative:a/* .formatRelative */.o,localize:o/* .localize */.k,match:s/* .match */.Y,options:{weekStartsOn:0/* Sunday */,firstWeekContainsDate:1}};// Fallback for modularized imports:
/* unused export default */var d=/* unused pure expression or super */null&&l},40052:function(e,t,n){n.d(t,{B:()=>i});const r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const i=(e,t,n)=>{let i;const a=r[e];if(typeof a==="string"){i=a}else if(t===1){i=a.one}else{i=a.other.replace("{{count}}",t.toString())}if(n?.addSuffix){if(n.comparison&&n.comparison>0){return"in "+i}else{return i+" ago"}}return i}},82909:function(e,t,n){n.d(t,{s:()=>s});/* import */var r=n(31240);const i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"};const a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"};const o={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};const s={date:(0,r/* .buildFormatLongFn */.k)({formats:i,defaultWidth:"full"}),time:(0,r/* .buildFormatLongFn */.k)({formats:a,defaultWidth:"full"}),dateTime:(0,r/* .buildFormatLongFn */.k)({formats:o,defaultWidth:"full"})}},95387:function(e,t,n){n.d(t,{o:()=>i});const r={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};const i=(e,t,n,i)=>r[e]},81107:function(e,t,n){n.d(t,{k:()=>u});/* import */var r=n(77846);const i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]};const a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]};// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const o={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]};const s={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};const l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}};const d={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};const c=(e,t)=>{const n=Number(e);// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const r=n%100;if(r>20||r<10){switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}}return n+"th"};const u={ordinalNumber:c,era:(0,r/* .buildLocalizeFn */.o)({values:i,defaultWidth:"wide"}),quarter:(0,r/* .buildLocalizeFn */.o)({values:a,defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,r/* .buildLocalizeFn */.o)({values:o,defaultWidth:"wide"}),day:(0,r/* .buildLocalizeFn */.o)({values:s,defaultWidth:"wide"}),dayPeriod:(0,r/* .buildLocalizeFn */.o)({values:l,defaultWidth:"wide",formattingValues:d,defaultFormattingWidth:"wide"})}},9683:function(e,t,n){n.d(t,{Y:()=>_});/* import */var r=n(76260);/* import */var i=n(69564);const a=/^(\d+)(th|st|nd|rd)?/i;const o=/\d+/i;const s={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i};const l={any:[/^b/i,/^(a|c)/i]};const d={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i};const c={any:[/1/i,/2/i,/3/i,/4/i]};const u={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i};const p={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]};const v={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i};const h={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]};const f={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i};const g={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}};const _={ordinalNumber:(0,i/* .buildMatchPatternFn */.K)({matchPattern:a,parsePattern:o,valueCallback:e=>parseInt(e,10)}),era:(0,r/* .buildMatchFn */.A)({matchPatterns:s,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r/* .buildMatchFn */.A)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:c,defaultParseWidth:"any",valueCallback:e=>e+1}),month:(0,r/* .buildMatchFn */.A)({matchPatterns:u,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),day:(0,r/* .buildMatchFn */.A)({matchPatterns:v,defaultMatchWidth:"wide",parsePatterns:h,defaultParseWidth:"any"}),dayPeriod:(0,r/* .buildMatchFn */.A)({matchPatterns:f,defaultMatchWidth:"any",parsePatterns:g,defaultParseWidth:"any"})}},78127:function(e,t,n){n.d(t,{T:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link max} function options.
 *//**
 * @name max
 * @category Common Helpers
 * @summary Return the latest of the given dates.
 *
 * @description
 * Return the latest of the given dates.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param dates - The dates to compare
 *
 * @returns The latest of the dates
 *
 * @example
 * // Which of these dates is the latest?
 * const result = max([
 *   new Date(1989, 6, 10),
 *   new Date(1987, 1, 11),
 *   new Date(1995, 6, 2),
 *   new Date(1990, 0, 1)
 * ])
 * //=> Sun Jul 02 1995 00:00:00
 */function a(e,t){let n;let a=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!a&&typeof e==="object")a=r/* .constructFrom.bind */.w.bind(null,e);const t=(0,i/* .toDate */.a)(e,a);if(!n||n<t||isNaN(+t))n=t});return(0,r/* .constructFrom */.w)(a,n||NaN)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},35093:function(e,t,n){n.d(t,{j:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link min} function options.
 *//**
 * @name min
 * @category Common Helpers
 * @summary Returns the earliest of the given dates.
 *
 * @description
 * Returns the earliest of the given dates.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param dates - The dates to compare
 *
 * @returns The earliest of the dates
 *
 * @example
 * // Which of these dates is the earliest?
 * const result = min([
 *   new Date(1989, 6, 10),
 *   new Date(1987, 1, 11),
 *   new Date(1995, 6, 2),
 *   new Date(1990, 0, 1)
 * ])
 * //=> Wed Feb 11 1987 00:00:00
 */function a(e,t){let n;let a=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!a&&typeof e==="object")a=r/* .constructFrom.bind */.w.bind(null,e);const t=(0,i/* .toDate */.a)(e,a);if(!n||n>t||isNaN(+t))n=t});return(0,r/* .constructFrom */.w)(a,n||NaN)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},49407:function(e,t,n){n.d(t,{Z:()=>o});/* import */var r=n(27256);/* import */var i=n(21843);/* import */var a=n(49164);/**
 * The {@link setMonth} function options.
 *//**
 * @name setMonth
 * @category Month Helpers
 * @summary Set the month to the given date.
 *
 * @description
 * Set the month to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param month - The month index to set (0-11)
 * @param options - The options
 *
 * @returns The new date with the month set
 *
 * @example
 * // Set February to 1 September 2014:
 * const result = setMonth(new Date(2014, 8, 1), 1)
 * //=> Sat Feb 01 2014 00:00:00
 */function o(e,t,n){const o=(0,a/* .toDate */.a)(e,n?.in);const s=o.getFullYear();const l=o.getDate();const d=(0,r/* .constructFrom */.w)(n?.in||e,0);d.setFullYear(s,t,15);d.setHours(0,0,0,0);const c=(0,i/* .getDaysInMonth */.P)(d);// Set the earlier date, allows to wrap Jan 31 to Feb 28
o.setMonth(t,Math.min(l,c));return o}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},90208:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(27256);/* import */var i=n(49164);/**
 * The {@link setYear} function options.
 *//**
 * @name setYear
 * @category Year Helpers
 * @summary Set the year to the given date.
 *
 * @description
 * Set the year to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param year - The year of the new date
 * @param options - An object with options.
 *
 * @returns The new date with the year set
 *
 * @example
 * // Set year 2013 to 1 September 2014:
 * const result = setYear(new Date(2014, 8, 1), 2013)
 * //=> Sun Sep 01 2013 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if(isNaN(+a))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);a.setFullYear(t);return a}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},8008:function(e,t,n){n.d(t,{o:()=>i});/* import */var r=n(49164);/**
 * The {@link startOfDay} function options.
 *//**
 * @name startOfDay
 * @category Day Helpers
 * @summary Return the start of a day for the given date.
 *
 * @description
 * Return the start of a day for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - The options
 *
 * @returns The start of a day
 *
 * @example
 * // The start of a day for 2 September 2014 11:55:00:
 * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Tue Sep 02 2014 00:00:00
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},99719:function(e,t,n){n.d(t,{b:()=>i});/* import */var r=n(73524);/**
 * The {@link startOfISOWeek} function options.
 *//**
 * @name startOfISOWeek
 * @category ISO Week Helpers
 * @summary Return the start of an ISO week for the given date.
 *
 * @description
 * Return the start of an ISO week for the given date.
 * The result will be in the local timezone.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of an ISO week
 *
 * @example
 * // The start of an ISO week for 2 September 2014 11:55:00:
 * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Mon Sep 01 2014 00:00:00
 */function i(e,t){return(0,r/* .startOfWeek */.k)(e,{...t,weekStartsOn:1})}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},90642:function(e,t,n){n.d(t,{w:()=>o});/* import */var r=n(27256);/* import */var i=n(85377);/* import */var a=n(99719);/**
 * The {@link startOfISOWeekYear} function options.
 *//**
 * @name startOfISOWeekYear
 * @category ISO Week-Numbering Year Helpers
 * @summary Return the start of an ISO week-numbering year for the given date.
 *
 * @description
 * Return the start of an ISO week-numbering year,
 * which always starts 3 days before the year's first Thursday.
 * The result will be in the local timezone.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of an ISO week-numbering year
 *
 * @example
 * // The start of an ISO week-numbering year for 2 July 2005:
 * const result = startOfISOWeekYear(new Date(2005, 6, 2))
 * //=> Mon Jan 03 2005 00:00:00
 */function o(e,t){const n=(0,i/* .getISOWeekYear */.p)(e,t);const o=(0,r/* .constructFrom */.w)(t?.in||e,0);o.setFullYear(n,0,4);o.setHours(0,0,0,0);return(0,a/* .startOfISOWeek */.b)(o)}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},74880:function(e,t,n){n.d(t,{w:()=>i});/* import */var r=n(49164);/**
 * The {@link startOfMonth} function options.
 *//**
 * @name startOfMonth
 * @category Month Helpers
 * @summary Return the start of a month for the given date.
 *
 * @description
 * Return the start of a month for the given date. The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
 * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
 * or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of a month
 *
 * @example
 * // The start of a month for 2 September 2014 11:55:00:
 * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Mon Sep 01 2014 00:00:00
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);n.setDate(1);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},73524:function(e,t,n){n.d(t,{k:()=>a});/* import */var r=n(89441);/* import */var i=n(49164);/**
 * The {@link startOfWeek} function options.
 *//**
 * @name startOfWeek
 * @category Week Helpers
 * @summary Return the start of a week for the given date.
 *
 * @description
 * Return the start of a week for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of a week
 *
 * @example
 * // The start of a week for 2 September 2014 11:55:00:
 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Sun Aug 31 2014 00:00:00
 *
 * @example
 * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
 * //=> Mon Sep 01 2014 00:00:00
 */function a(e,t){const n=(0,r/* .getDefaultOptions */.q)();const a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const o=(0,i/* .toDate */.a)(e,t?.in);const s=o.getDay();const l=(s<a?7:0)+s-a;o.setDate(o.getDate()-l);o.setHours(0,0,0,0);return o}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},7629:function(e,t,n){n.d(t,{b:()=>s});/* import */var r=n(89441);/* import */var i=n(27256);/* import */var a=n(91408);/* import */var o=n(73524);/**
 * The {@link startOfWeekYear} function options.
 *//**
 * @name startOfWeekYear
 * @category Week-Numbering Year Helpers
 * @summary Return the start of a local week-numbering year for the given date.
 *
 * @description
 * Return the start of a local week-numbering year.
 * The exact calculation depends on the values of
 * `options.weekStartsOn` (which is the index of the first day of the week)
 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
 * the first week of the week-numbering year)
 *
 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of a week-numbering year
 *
 * @example
 * // The start of an a week-numbering year for 2 July 2005 with default settings:
 * const result = startOfWeekYear(new Date(2005, 6, 2))
 * //=> Sun Dec 26 2004 00:00:00
 *
 * @example
 * // The start of a week-numbering year for 2 July 2005
 * // if Monday is the first day of week
 * // and 4 January is always in the first week of the year:
 * const result = startOfWeekYear(new Date(2005, 6, 2), {
 *   weekStartsOn: 1,
 *   firstWeekContainsDate: 4
 * })
 * //=> Mon Jan 03 2005 00:00:00
 */function s(e,t){const n=(0,r/* .getDefaultOptions */.q)();const s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1;const l=(0,a/* .getWeekYear */.h)(e,t);const d=(0,i/* .constructFrom */.w)(t?.in||e,0);d.setFullYear(l,0,s);d.setHours(0,0,0,0);const c=(0,o/* .startOfWeek */.k)(d,t);return c}// Fallback for modularized imports:
/* unused export default */var l=/* unused pure expression or super */null&&s},40525:function(e,t,n){n.d(t,{D:()=>i});/* import */var r=n(49164);/**
 * The {@link startOfYear} function options.
 *//**
 * @name startOfYear
 * @category Year Helpers
 * @summary Return the start of a year for the given date.
 *
 * @description
 * Return the start of a year for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - The options
 *
 * @returns The start of a year
 *
 * @example
 * // The start of a year for 2 September 2014 11:55:00:
 * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
 * //=> Wed Jan 01 2014 00:00:00
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);n.setFullYear(n.getFullYear(),0,1);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},49164:function(e,t,n){n.d(t,{a:()=>i});/* import */var r=n(27256);/**
 * @name toDate
 * @category Common Helpers
 * @summary Convert the given argument to an instance of Date.
 *
 * @description
 * Convert the given argument to an instance of Date.
 *
 * If the argument is an instance of Date, the function returns its clone.
 *
 * If the argument is a number, it is treated as a timestamp.
 *
 * If the argument is none of the above, the function returns Invalid Date.
 *
 * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
 * enabling to transfer extra properties from the reference date to the new date.
 * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
 * that accept a time zone as a constructor argument.
 *
 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param argument - The value to convert
 *
 * @returns The parsed date in the local time zone
 *
 * @example
 * // Clone the date:
 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
 * //=> Tue Feb 11 2014 11:30:30
 *
 * @example
 * // Convert the timestamp to date:
 * const result = toDate(1392098430000)
 * //=> Tue Feb 11 2014 11:30:30
 */function i(e,t){// [TODO] Get rid of `toDate` or `constructFrom`?
return(0,r/* .constructFrom */.w)(t||e,e)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i}}]);