"use strict";(self["webpackChunktutor"]=self["webpackChunktutor"]||[]).push([["501"],{42617:function(e,t,n){n.d(t,{LE:()=>s,Mv:()=>a,qg:()=>l});/* ESM import */var r=n(87363);/* ESM import */var i=/*#__PURE__*/n.n(r);const o={display:"none"};function a(e){let{id:t,value:n}=e;return i().createElement("div",{id:t,style:o},n)}function s(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;// Hide element visually but keep it readable by screen readers
const o={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:o,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
},94697:function(e,t,n){n.d(t,{Cj:()=>tf,Dy:()=>m,LB:()=>tc,Lg:()=>em,O1:()=>th,VK:()=>J,VT:()=>_,Zj:()=>tm,_8:()=>C,ey:()=>D,g4:()=>ef,hI:()=>F,pE:()=>W,uN:()=>eP,we:()=>ex,y9:()=>tM});/* ESM import */var r=n(87363);/* ESM import */var i=/*#__PURE__*/n.n(r);/* ESM import */var o=n(61533);/* ESM import */var a=/*#__PURE__*/n.n(o);/* ESM import */var s=n(24285);/* ESM import */var l=n(42617);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 v={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 p={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=p,container:n,hiddenTextDescribedById:a,screenReaderInstructions:d=v}=e;const{announce:u,announcement:h}=(0,l/* .useAnnouncement */.qg)();const f=(0,s/* .useUniqueId */.Ld)("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 */.Mv,{id:a,value:d.draggable}),i().createElement(l/* .LiveRegion */.LE,{id:f,announcement:h}));return n?(0,o.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 */.DC)(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 Z(e,t){let{data:{value:n}}=e;let{data:{value:r}}=t;return n-r}/**
 * Sort collisions from greatest to smallest value
 */function x(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 k(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 C(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 E(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 W=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=E(t,t.left,t.top);const o=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=y(E(r),i);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(Z)};/**
 * Returns the closest rectangles from an array of rectangles to the corners of
 * another rectangle.
 */const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=k(t);const o=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=k(r);const a=i.reduce((e,t,r)=>{return e+y(n[r],t)},0);const s=Number((a/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:s}})}}return o.sort(Z)};/**
 * Returns the intersecting rectangle area between two rectangles
 */function T(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 o=Math.min(t.top+t.height,e.top+e.height);const a=i-r;const s=o-n;if(r<i&&n<o){const n=t.width*t.height;const r=e.width*e.height;const i=a*s;const o=i/(n+r-i);return Number(o.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 o=n.get(r);if(o){const n=T(o,t);if(n>0){i.push({id:r,data:{droppableContainer:e,value:n}})}}}return i.sort(x)};/**
 * Check if a given point is contained within a bounding rectangle
 */function S(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}/**
 * Returns the rectangles that the pointer is hovering over
 */const M=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r){return[]}const i=[];for(const e of t){const{id:t}=e;const o=n.get(t);if(o&&S(r,o)){/* 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=k(o);const a=n.reduce((e,t)=>{return e+y(r,t)},0);const s=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(Z)};function B(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function I(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 P=/*#__PURE__*/z(1);function A(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 O(e,t,n){const r=A(t);if(!r){return e}const{scaleX:i,scaleY:o,x:a,y:s}=r;const l=e.left-a-(1-i)*parseFloat(n);const d=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1));const c=i?e.width/i:e.width;const u=o?e.height/o:e.height;return{width:c,height:u,top:d,right:l+c,bottom:d+u,left:l}}const N={ignoreTransform:false};/**
 * Returns the bounding client rect of an element relative to the viewport.
 */function J(e,t){if(t===void 0){t=N}let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,s/* .getWindow */.Jj)(e).getComputedStyle(e);if(t){n=O(n,t,r)}}const{top:r,left:i,width:o,height:a,bottom:l,right:d}=n;return{top:r,left:i,width:o,height:a,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 L(e){return J(e,{ignoreTransform:true})}function U(e){const t=e.innerWidth;const n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function R(e,t){if(t===void 0){t=(0,s/* .getWindow */.Jj)(e).getComputedStyle(e)}return t.position==="fixed"}function X(e,t){if(t===void 0){t=(0,s/* .getWindow */.Jj)(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 F(e,t){const n=[];function r(i){if(t!=null&&n.length>=t){return n}if(!i){return n}if((0,s/* .isDocument */.qk)(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement)){n.push(i.scrollingElement);return n}if(!(0,s/* .isHTMLElement */.Re)(i)||(0,s/* .isSVGElement */.vZ)(i)){return n}if(n.includes(i)){return n}const o=(0,s/* .getWindow */.Jj)(e).getComputedStyle(i);if(i!==e){if(X(i,o)){n.push(i)}}if(R(i,o)){return n}return r(i.parentNode)}if(!e){return n}return r(e)}function j(e){const[t]=F(e,1);return t!=null?t:null}function Q(e){if(!s/* .canUseDOM */.Nq||!e){return null}if((0,s/* .isWindow */.FJ)(e)){return e}if(!(0,s/* .isNode */.UG)(e)){return null}if((0,s/* .isDocument */.qk)(e)||e===(0,s/* .getOwnerDocument */.r3)(e).scrollingElement){return window}if((0,s/* .isHTMLElement */.Re)(e)){return e}return null}function H(e){if((0,s/* .isWindow */.FJ)(e)){return e.scrollX}return e.scrollLeft}function Y(e){if((0,s/* .isWindow */.FJ)(e)){return e.scrollY}return e.scrollTop}function V(e){return{x:H(e),y:Y(e)}}var K;(function(e){e[e["Forward"]=1]="Forward";e[e["Backward"]=-1]="Backward"})(K||(K={}));function G(e){if(!s/* .canUseDOM */.Nq||!e){return false}return e===document.scrollingElement}function $(e){const t={x:0,y:0};const n=G(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 o=e.scrollLeft<=t.x;const a=e.scrollTop>=r.y;const s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const ee={x:.2,y:.2};function et(e,t,n,r,i){let{top:o,left:a,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:v}=$(e);const p={x:0,y:0};const h={x:0,y:0};const f={height:t.height*i.y,width:t.width*i.x};if(!d&&o<=t.top+f.height){// Scroll Up
p.y=K.Backward;h.y=r*Math.abs((t.top+f.height-o)/f.height)}else if(!c&&l>=t.bottom-f.height){// Scroll Down
p.y=K.Forward;h.y=r*Math.abs((t.bottom-f.height-l)/f.height)}if(!v&&s>=t.right-f.width){// Scroll Right
p.x=K.Forward;h.x=r*Math.abs((t.right-f.width-s)/f.width)}else if(!u&&a<=t.left+f.width){// Scroll Left
p.x=K.Backward;h.x=r*Math.abs((t.left+f.width-a)/f.width)}return{direction:p,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 */.IH)(e,V(t))},b)}function ei(e){return e.reduce((e,t)=>{return e+H(t)},0)}function eo(e){return e.reduce((e,t)=>{return e+Y(t)},0)}function ea(e,t){if(t===void 0){t=J}if(!e){return}const{top:n,left:r,bottom:i,right:o}=t(e);const a=j(e);if(!a){return}if(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth){e.scrollIntoView({block:"center",inline:"center"})}}const es=[["x",["left","right"],ei],["y",["top","bottom"],eo]];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=F(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 o of t){Object.defineProperty(this,o,{get:()=>{const t=i(n);const a=r[e]-t;return this.rect[o]+a},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 */.Jj)(e);return e instanceof t?e:(0,s/* .getOwnerDocument */.r3)(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 ev;(function(e){e["Click"]="click";e["DragStart"]="dragstart";e["Keydown"]="keydown";e["ContextMenu"]="contextmenu";e["Resize"]="resize";e["SelectionChange"]="selectionchange";e["VisibilityChange"]="visibilitychange"})(ev||(ev={}));function ep(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 */.r3)(t));this.windowListeners=new ed((0,s/* .getWindow */.Jj)(t));this.handleKeyDown=this.handleKeyDown.bind(this);this.handleCancel=this.handleCancel.bind(this);this.attach()}attach(){this.handleStart();this.windowListeners.add(ev.Resize,this.handleCancel);this.windowListeners.add(ev.VisibilityChange,this.handleCancel);setTimeout(()=>this.listeners.add(ev.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;const n=e.node.current;if(n){ea(n)}t(b)}handleKeyDown(e){if((0,s/* .isKeyboardEvent */.vd)(e)){const{active:t,context:n,options:r}=this.props;const{keyboardCodes:i=eg,coordinateGetter:o=e_,scrollBehavior:a="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=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=(0,s/* .subtract */.$X)(u,c);const r={x:0,y:0};const{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code;const{isTop:o,isRight:s,isLeft:l,isBottom:d,maxScroll:c,minScroll:v}=$(n);const p=en(n);const h={x:Math.min(i===ef.Right?p.right-p.width/2:p.right,Math.max(i===ef.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===ef.Down?p.bottom-p.height/2:p.bottom,Math.max(i===ef.Down?p.top:p.top+p.height/2,u.y))};const f=i===ef.Right&&!s||i===ef.Left&&!l;const g=i===ef.Down&&!d||i===ef.Up&&!o;if(f&&h.x!==u.x){const e=n.scrollLeft+t.x;const o=i===ef.Right&&e<=c.x||i===ef.Left&&e>=v.x;if(o&&!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:a});return}if(o){r.x=n.scrollLeft-e}else{r.x=i===ef.Right?n.scrollLeft-c.x:n.scrollLeft-v.x}if(r.x){n.scrollBy({left:-r.x,behavior:a})}break}else if(g&&h.y!==u.y){const e=n.scrollTop+t.y;const o=i===ef.Down&&e<=c.y||i===ef.Up&&e>=v.y;if(o&&!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:a});return}if(o){r.y=n.scrollTop-e}else{r.y=i===ef.Down?n.scrollTop-c.y:n.scrollTop-v.y}if(r.y){n.scrollBy({top:-r.y,behavior:a})}break}}this.handleMove(e,(0,s/* .add */.IH)((0,s/* .subtract */.$X)(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:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=o.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:o}=i;this.props=e;this.events=t;this.document=(0,s/* .getOwnerDocument */.r3)(o);this.documentListeners=new ed(this.document);this.listeners=new ed(n);this.windowListeners=new ed((0,s/* .getWindow */.Jj)(o));this.initialCoordinates=(r=(0,s/* .getEventCoordinates */.DC)(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(ev.Resize,this.handleCancel);this.windowListeners.add(ev.DragStart,ep);this.windowListeners.add(ev.VisibilityChange,this.handleCancel);this.windowListeners.add(ev.ContextMenu,ep);this.documentListeners.add(ev.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(ev.Click,eh,{capture:true});// Remove any text selection from the document
this.removeTextSelection();// Prevent further text selection while dragging
this.documentListeners.add(ev.SelectionChange,this.removeTextSelection);t(e)}}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this;const{onMove:o,options:{activationConstraint:a}}=i;if(!r){return}const l=(t=(0,s/* .getEventCoordinates */.DC)(e))!=null?t:b;const d=(0,s/* .subtract */.$X)(r,l);// Constraint validation
if(!n&&a){if(eb(a)){if(a.tolerance!=null&&eu(d,a.tolerance)){return this.handleCancel()}if(eu(d,a.distance)){return this.handleStart()}}if(ey(a)){if(eu(d,a.tolerance)){return this.handleCancel()}}this.handlePending(a,d);return}if(e.cancelable){e.preventDefault()}o(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 eZ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ex 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 */.r3)(t.target);super(e,eZ,n)}}ex.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 ek={move:{name:"mousemove"},end:{name:"mouseup"}};var eC;(function(e){e[e["RightClick"]=2]="RightClick"})(eC||(eC={}));class eE extends ew{constructor(e){super(e,ek,(0,s/* .getOwnerDocument */.r3)(e.event.target))}}eE.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;if(n.button===eC.RightClick){return false}r==null?void 0:r({event:n});return true}}];const eW={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class eD extends ew{constructor(e){super(e,eW)}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(eW.move.name,e,{capture:false,passive:false});return function t(){window.removeEventListener(eW.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(){}}}eD.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 eT;(function(e){e[e["Pointer"]=0]="Pointer";e[e["DraggableRect"]=1]="DraggableRect"})(eT||(eT={}));var eq;(function(e){e[e["TreeOrder"]=0]="TreeOrder";e[e["ReversedTreeOrder"]=1]="ReversedTreeOrder"})(eq||(eq={}));function eS(e){let{acceleration:t,activator:n=eT.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:l=5,order:d=eq.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:v,delta:p,threshold:h}=e;const f=eB({delta:p,disabled:!a});const[g,_]=(0,s/* .useInterval */.Yz)();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 eT.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case eT.DraggableRect:return o}},[n,o,c]);const w=(0,r.useRef)(null);const Z=(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 x=(0,r.useMemo)(()=>d===eq.TreeOrder?[...u].reverse():u,[d,u]);(0,r.useEffect)(()=>{if(!a||!u.length||!y){_();return}for(const e of x){if((i==null?void 0:i(e))===false){continue}const n=u.indexOf(e);const r=v[n];if(!r){continue}const{direction:o,speed:a}=et(e,r,y,t,h);for(const e of["x","y"]){if(!f[e][o[e]]){a[e]=0;o[e]=0}}if(a.x>0||a.y>0){_();w.current=e;g(Z,l);m.current=a;b.current=o;return}}m.current={x:0,y:0};b.current={x:0,y:0};_()},[t,Z,i,_,a,l,JSON.stringify(y),JSON.stringify(f),g,u,x,v,JSON.stringify(h)])}const eM={x:{[K.Backward]:false,[K.Forward]:false},y:{[K.Backward]:false,[K.Forward]:false}};function eB(e){let{delta:t,disabled:n}=e;const r=(0,s/* .usePrevious */.D9)(t);return(0,s/* .useLazyMemo */.Gj)(e=>{if(n||!r||!e){// Reset scroll intent tracking when auto-scrolling is disabled
return eM}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:{[K.Backward]:e.x[K.Backward]||i.x===-1,[K.Forward]:e.x[K.Forward]||i.x===1},y:{[K.Backward]:e.y[K.Backward]||i.y===-1,[K.Forward]:e.y[K.Forward]||i.y===1}}},[n,t,r])}function eI(e,t){const n=t!=null?e.get(t):undefined;const r=n?n.node.current:null;return(0,s/* .useLazyMemo */.Gj)(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 eP;(function(e){e[e["Always"]=0]="Always";e[e["BeforeDragging"]=1]="BeforeDragging";e[e["WhileDragging"]=2]="WhileDragging"})(eP||(eP={}));var eA;(function(e){e["Optimized"]="optimized"})(eA||(eA={}));const eO=/*#__PURE__*/new Map;function eN(e,t){let{dragging:n,dependencies:i,config:o}=t;const[a,l]=(0,r.useState)(null);const{frequency:d,measure:c,strategy:u}=o;const v=(0,r.useRef)(e);const p=m();const h=(0,s/* .useLatestValue */.Ey)(p);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 */.Gj)(t=>{if(p&&!n){return eO}if(!t||t===eO||v.current!==e||a!=null){const t=new Map;for(let n of e){if(!n){continue}if(a&&a.length>0&&!a.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,a,n,p,c]);(0,r.useEffect)(()=>{v.current=e},[e]);(0,r.useEffect)(()=>{if(p){return}f()},[n,p]);(0,r.useEffect)(()=>{if(a&&a.length>0){l(null)}},[JSON.stringify(a)]);(0,r.useEffect)(()=>{if(p||typeof d!=="number"||g.current!==null){return}g.current=setTimeout(()=>{f();g.current=null},d)},[d,p,f,...i]);return{droppableRects:_,measureDroppableContainers:f,measuringScheduled:a!=null};function m(){switch(u){case eP.Always:return false;case eP.BeforeDragging:return n;default:return!n}}}function eJ(e,t){return(0,s/* .useLazyMemo */.Gj)(n=>{if(!e){return null}if(n){return n}return typeof t==="function"?t(e):e},[t,e])}function eL(e,t){return eJ(e,t)}/**
 * Returns a new MutationObserver instance.
 * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
 */function eU(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */.zX)(t);const o=(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()=>o==null?void 0:o.disconnect()},[o]);return o}/**
 * Returns a new ResizeObserver instance bound to the `onResize` callback.
 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`.
 */function eR(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */.zX)(t);const o=(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()=>o==null?void 0:o.disconnect()},[o]);return o}function eX(e){return new el(J(e),e)}function eF(e,t,n){if(t===void 0){t=eX}const[i,o]=(0,r.useState)(null);function a(){o(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 o=t(e);if(JSON.stringify(r)===JSON.stringify(o)){return r}return o})}const l=eU({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)){a();break}}}});const d=eR({callback:a});(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{a();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=eJ(e);return I(e,t)}const eQ=[];function eH(e){const t=(0,r.useRef)(e);const n=(0,s/* .useLazyMemo */.Gj)(n=>{if(!e){return eQ}if(n&&n!==eQ&&e&&t.current&&e.parentNode===t.current.parentNode){return n}return F(e)},[e]);(0,r.useEffect)(()=>{t.current=e},[e]);return n}function eY(e){const[t,n]=(0,r.useState)(null);const i=(0,r.useRef)(e);// To-do: Throttle the handleScroll callback
const o=(0,r.useCallback)(e=>{const t=Q(e.target);if(!t){return}n(e=>{if(!e){return null}e.set(t,V(t));return new Map(e)})},[]);(0,r.useEffect)(()=>{const t=i.current;if(e!==t){r(t);const a=e.map(e=>{const t=Q(e);if(t){t.addEventListener("scroll",o,{passive:true});return[t,V(t)]}return null}).filter(e=>e!=null);n(a.length?new Map(a):null);i.current=e}return()=>{r(e);r(t)};function r(e){e.forEach(e=>{const t=Q(e);t==null?void 0:t.removeEventListener("scroll",o)})}},[o,e]);return(0,r.useMemo)(()=>{if(e.length){return t?Array.from(t.values()).reduce((e,t)=>(0,s/* .add */.IH)(e,t),b):er(e)}return b},[e,t])}function eV(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 */.$X)(e,n.current):b}function eK(e){(0,r.useEffect)(()=>{if(!s/* .canUseDOM */.Nq){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 eG(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?U(e):null,[e])}const e0=[];function e1(e,t){if(t===void 0){t=J}const[n]=e;const i=e$(n?(0,s/* .getWindow */.Jj)(n):null);const[o,a]=(0,r.useState)(e0);function l(){a(()=>{if(!e.length){return e0}return e.map(e=>G(e)?i:new el(t(e),e))})}const d=eR({callback:l});(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{d==null?void 0:d.disconnect();l();e.forEach(e=>d==null?void 0:d.observe(e))},[e]);return o}function e2(e){if(!e){return null}if(e.children.length>1){return e}const t=e.children[0];return(0,s/* .isHTMLElement */.Re)(t)?t:e}function e4(e){let{measure:t}=e;const[n,i]=(0,r.useState)(null);const o=(0,r.useCallback)(e=>{for(const{target:n}of e){if((0,s/* .isHTMLElement */.Re)(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}}},[t]);const a=eR({callback:o});const l=(0,r.useCallback)(e=>{const n=e2(e);a==null?void 0:a.disconnect();if(n){a==null?void 0:a.observe(n)}i(n?t(n):null)},[t,a]);const[d,c]=(0,s/* .useNodeRef */.wm)(l);return(0,r.useMemo)(()=>({nodeRef:d,rect:n,setRef:c}),[n,d,c])}const e8=[{sensor:ex,options:{}},{sensor:em,options:{}}];const e3={current:{}};const e5={draggable:{measure:L},droppable:{measure:L,strategy:eP.WhileDragging,frequency:eA.Optimized},dragOverlay:{measure:J}};class e6 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 e9={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new e6,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:g},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:e5,measureDroppableContainers:g,windowRect:null,measuringScheduled:false};const e7={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)(e7);const tt=/*#__PURE__*/(0,r.createContext)(e9);function tn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e6}}}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 e6(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 o=e.droppable.containers.get(n);if(!o||r!==o.key){return e}const a=new e6(e.droppable.containers);a.set(n,{...o,disabled:i});return{...e,droppable:{...e.droppable,containers:a}}}case f.UnregisterDroppable:{const{id:n,key:r}=t;const i=e.droppable.containers.get(n);if(!i||r!==i.key){return e}const o=new e6(e.droppable.containers);o.delete(n);return{...e,droppable:{...e.droppable,containers:o}}}default:{return e}}}function ti(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:o}=(0,r.useContext)(te);const a=(0,s/* .usePrevious */.D9)(i);const l=(0,s/* .usePrevious */.D9)(n==null?void 0:n.id);// Restore keyboard focus on the activator node
(0,r.useEffect)(()=>{if(t){return}if(!i&&a&&l!=null){if(!(0,s/* .isKeyboardEvent */.vd)(a)){return}if(document.activeElement===a.target){// No need to restore focus
return}const e=o.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 */.so)(e);if(t){t.focus();break}}})}},[i,t,o,l,a]);return null}function to(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>{return t({transform:e,...r})},n):n}function ta(e){return(0,r.useMemo)(()=>({draggable:{...e5.draggable,...e==null?void 0:e.draggable},droppable:{...e5.droppable,...e==null?void 0:e.droppable},dragOverlay:{...e5.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:o=true}=e;const a=(0,r.useRef)(false);const{x:l,y:d}=typeof o==="boolean"?{x:o,y:o}:o;(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{const e=!l&&!d;if(e||!t){a.current=false;return}if(a.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 o=n(r);const s=I(o,i);if(!l){s.x=0}if(!d){s.y=0}// Only perform layout shift scroll compensation once
a.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,a,l;let{id:c,accessibility:v,autoScroll:p=true,children:g,sensors:_=e8,collisionDetection:m=q,measuring:b,modifiers:y,...w}=e;const Z=(0,r.useReducer)(tr,undefined,tn);const[x,k]=Z;const[E,W]=u();const[D,T]=(0,r.useState)(td.Uninitialized);const S=D===td.Initialized;const{draggable:{active:M,nodes:I,translate:z},droppable:{containers:A}}=x;const O=M!=null?I.get(M):null;const N=(0,r.useRef)({initial:null,translated:null});const J=(0,r.useMemo)(()=>{var e;return M!=null?{id:M,// It's possible for the active node to unmount while dragging
data:(e=O==null?void 0:O.data)!=null?e:e3,rect:N}:null},[M,O]);const L=(0,r.useRef)(null);const[U,R]=(0,r.useState)(null);const[X,F]=(0,r.useState)(null);const j=(0,s/* .useLatestValue */.Ey)(w,Object.values(w));const Q=(0,s/* .useUniqueId */.Ld)("DndDescribedBy",c);const H=(0,r.useMemo)(()=>A.getEnabled(),[A]);const Y=ta(b);const{droppableRects:V,measureDroppableContainers:K,measuringScheduled:G}=eN(H,{dragging:S,dependencies:[z.x,z.y],config:Y.droppable});const $=eI(I,M);const ee=(0,r.useMemo)(()=>X?(0,s/* .getEventCoordinates */.DC)(X):null,[X]);const et=eA();const en=eL($,Y.draggable.measure);ts({activeNode:M!=null?I.get(M):null,config:et.layoutShiftCompensation,initialRect:en,measure:Y.draggable.measure});const er=eF($,Y.draggable.measure,en);const ei=eF($?$.parentElement:null);const eo=(0,r.useRef)({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null});const ea=A.getNodeFor((t=eo.current.over)==null?void 0:t.id);const es=e4({measure:Y.dragOverlay.measure});// Use the rect of the drag overlay if it is mounted
const el=(n=es.nodeRef.current)!=null?n:$;const ed=S?(a=es.rect)!=null?a: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 ev=e$(el?(0,s/* .getWindow */.Jj)(el):null);// Get scrollable ancestors of the dragging node
const ep=eH(S?ea!=null?ea:$:null);const eh=e1(ep);// Apply modifiers
const ef=to(y,{transform:{x:z.x-eu.x,y:z.y-eu.y,scaleX:1,scaleY:1},activatorEvent:X,active:J,activeNodeRect:er,containerNodeRect:ei,draggingNodeRect:ed,over:eo.current.over,overlayNodeRect:es.rect,scrollableAncestors:ep,scrollableAncestorRects:eh,windowRect:ev});const eg=ee?(0,s/* .add */.IH)(ee,z):null;const e_=eY(ep);// Represents the scroll delta since dragging was initiated
const em=eV(e_);// Represents the scroll delta since the last time the active node rect was measured
const eb=eV(e_,[er]);const ey=(0,s/* .add */.IH)(ef,em);const ew=ed?P(ed,ef):null;const eZ=J&&ew?m({active:J,collisionRect:ew,droppableRects:V,droppableContainers:H,pointerCoordinates:eg}):null;const ex=C(eZ,"id");const[ek,eC]=(0,r.useState)(null);// When there is no drag overlay used, we need to account for the
// window scroll delta
const eE=ec?ef:(0,s/* .add */.IH)(ef,eb);const eW=B(eE,(l=ek==null?void 0:ek.rect)!=null?l:null,er);const eD=(0,r.useRef)(null);const eT=(0,r.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(L.current==null){return}const i=I.get(L.current);if(!i){return}const a=e.nativeEvent;const s=new n({active:L.current,activeNode:i,event:a,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:eo,onAbort(e){const t=I.get(e);if(!t){return}const{onDragAbort:n}=j.current;const r={id:e};n==null?void 0:n(r);E({type:"onDragAbort",event:r})},onPending(e,t,n,r){const i=I.get(e);if(!i){return}const{onDragPending:o}=j.current;const a={id:e,constraint:t,initialCoordinates:n,offset:r};o==null?void 0:o(a);E({type:"onDragPending",event:a})},onStart(e){const t=L.current;if(t==null){return}const n=I.get(t);if(!n){return}const{onDragStart:r}=j.current;const i={activatorEvent:a,active:{id:t,data:n.data,rect:N}};(0,o.unstable_batchedUpdates)(()=>{r==null?void 0:r(i);T(td.Initializing);k({type:f.DragStart,initialCoordinates:e,active:t});E({type:"onDragStart",event:i});R(eD.current);F(a)})},onMove(e){k({type:f.DragMove,coordinates:e})},onEnd:l(f.DragEnd),onCancel:l(f.DragCancel)});eD.current=s;function l(e){return async function t(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=eo.current;let s=null;if(t&&i){const{cancelDrop:o}=j.current;s={activatorEvent:a,active:t,collisions:n,delta:i,over:r};if(e===f.DragEnd&&typeof o==="function"){const t=await Promise.resolve(o(s));if(t){e=f.DragCancel}}}L.current=null;(0,o.unstable_batchedUpdates)(()=>{k({type:e});T(td.Uninitialized);eC(null);R(null);F(null);eD.current=null;const t=e===f.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=j.current[t];e==null?void 0:e(s);E({type:t,event:s})}})}}},[I]);const eq=(0,r.useCallback)((e,t)=>{return(n,r)=>{const i=n.nativeEvent;const o=I.get(r);if(L.current!==null||// No active draggable
!o||// Event has already been captured
i.dndKit||i.defaultPrevented){return}const a={active:o};const s=e(n,t.options,a);if(s===true){i.dndKit={capturedBy:t.sensor};L.current=r;eT(n,t)}}},[I,eT]);const eM=ez(_,eq);eK(_);(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{if(er&&D===td.Initializing){T(td.Initialized)}},[er,D]);(0,r.useEffect)(()=>{const{onDragMove:e}=j.current;const{active:t,activatorEvent:n,collisions:r,over:i}=eo.current;if(!t||!n){return}const a={active:t,activatorEvent:n,collisions:r,delta:{x:ey.x,y:ey.y},over:i};(0,o.unstable_batchedUpdates)(()=>{e==null?void 0:e(a);E({type:"onDragMove",event:a})})},[ey.x,ey.y]);(0,r.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=eo.current;if(!e||L.current==null||!t||!i){return}const{onDragOver:a}=j.current;const s=r.get(ex);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,o.unstable_batchedUpdates)(()=>{eC(l);a==null?void 0:a(d);E({type:"onDragOver",event:d})})},[ex]);(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{eo.current={activatorEvent:X,active:J,activeNode:$,collisionRect:ew,collisions:eZ,droppableRects:V,draggableNodes:I,draggingNode:el,draggingNodeRect:ed,droppableContainers:A,over:ek,scrollableAncestors:ep,scrollAdjustedTranslate:ey};N.current={initial:ed,translated:ew}},[J,$,eZ,ew,I,el,ed,V,A,ek,ep,ey]);eS({...et,delta:z,draggingRect:ew,pointerCoordinates:eg,scrollableAncestors:ep,scrollableAncestorRects:eh});const eB=(0,r.useMemo)(()=>{const e={active:J,activeNode:$,activeNodeRect:er,activatorEvent:X,collisions:eZ,containerNodeRect:ei,dragOverlay:es,draggableNodes:I,droppableContainers:A,droppableRects:V,over:ek,measureDroppableContainers:K,scrollableAncestors:ep,scrollableAncestorRects:eh,measuringConfiguration:Y,measuringScheduled:G,windowRect:ev};return e},[J,$,er,X,eZ,ei,es,I,A,V,ek,K,ep,eh,Y,G,ev]);const eP=(0,r.useMemo)(()=>{const e={activatorEvent:X,activators:eM,active:J,activeNodeRect:er,ariaDescribedById:{draggable:Q},dispatch:k,draggableNodes:I,over:ek,measureDroppableContainers:K};return e},[X,eM,J,er,k,Q,I,ek,K]);return i().createElement(d.Provider,{value:W},i().createElement(te.Provider,{value:eP},i().createElement(tt.Provider,{value:eB},i().createElement(tl.Provider,{value:eW},g)),i().createElement(ti,{disabled:(v==null?void 0:v.restoreFocus)===false})),i().createElement(h,{...v,hiddenTextDescribedById:Q}));function eA(){const e=(U==null?void 0:U.autoScrollEnabled)===false;const t=typeof p==="object"?p.enabled===false:p===false;const n=S&&!e&&!t;if(typeof p==="object"){return{...p,enabled:n}}return{enabled:n}}});const tu=/*#__PURE__*/(0,r.createContext)(null);const tv="button";const tp="Draggable";function th(e){let{id:t,data:n,disabled:i=false,attributes:o}=e;const a=(0,s/* .useUniqueId */.Ld)(tp);const{activators:l,activatorEvent:d,active:c,activeNodeRect:u,ariaDescribedById:v,draggableNodes:p,over:h}=(0,r.useContext)(te);const{role:f=tv,roleDescription:g="draggable",tabIndex:_=0}=o!=null?o:{};const m=(c==null?void 0:c.id)===t;const b=(0,r.useContext)(m?tl:tu);const[y,w]=(0,s/* .useNodeRef */.wm)();const[Z,x]=(0,s/* .useNodeRef */.wm)();const k=eG(l,t);const C=(0,s/* .useLatestValue */.Ey)(n);(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{p.set(t,{id:t,key:a,node:y,activatorNode:Z,data:C});return()=>{const e=p.get(t);if(e&&e.key===a){p.delete(t)}}},[p,t]);const E=(0,r.useMemo)(()=>({role:f,tabIndex:_,"aria-disabled":i,"aria-pressed":m&&f===tv?true:undefined,"aria-roledescription":g,"aria-describedby":v.draggable}),[i,f,_,m,g,v.draggable]);return{active:c,activatorEvent:d,activeNodeRect:u,attributes:E,isDragging:m,listeners:i?undefined:k,node:y,over:h,setNodeRef:w,setActivatorNodeRef:x,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:o}=e;const a=(0,s/* .useUniqueId */.Ld)(tg);const{active:l,dispatch:d,over:c,measureDroppableContainers:u}=(0,r.useContext)(te);const v=(0,r.useRef)({disabled:n});const p=(0,r.useRef)(false);const h=(0,r.useRef)(null);const g=(0,r.useRef)(null);const{disabled:_,updateMeasurementsFor:m,timeout:b}={...t_,...o};const y=(0,s/* .useLatestValue */.Ey)(m!=null?m:i);const w=(0,r.useCallback)(()=>{if(!p.current){// ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
// assuming the element is rendered and displayed.
p.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 Z=eR({callback:w,disabled:_||!l});const x=(0,r.useCallback)((e,t)=>{if(!Z){return}if(t){Z.unobserve(t);p.current=false}if(e){Z.observe(e)}},[Z]);const[k,C]=(0,s/* .useNodeRef */.wm)(x);const E=(0,s/* .useLatestValue */.Ey)(t);(0,r.useEffect)(()=>{if(!Z||!k.current){return}Z.disconnect();p.current=false;Z.observe(k.current)},[k,Z]);(0,r.useEffect)(()=>{d({type:f.RegisterDroppable,element:{id:i,key:a,disabled:n,node:k,rect:h,data:E}});return()=>d({type:f.UnregisterDroppable,key:a,id:i})},[i]);(0,r.useEffect)(()=>{if(n!==v.current.disabled){d({type:f.SetDroppableDisabled,id:i,key:a,disabled:n});v.current.disabled=n}},[i,a,n,d]);return{active:l,rect:h,isOver:(c==null?void 0:c.id)===i,node:k,over:c,setNodeRef:C}}function tb(e){let{animation:t,children:n}=e;const[o,a]=(0,r.useState)(null);const[l,d]=(0,r.useState)(null);const c=(0,s/* .usePrevious */.D9)(n);if(!n&&!o&&c){a(c)}(0,s/* .useIsomorphicLayoutEffect */.LI)(()=>{if(!l){return}const e=o==null?void 0:o.key;const n=o==null?void 0:o.props.id;if(e==null||n==null){a(null);return}Promise.resolve(t(n,l)).then(()=>{a(null)})},[t,o,l]);return i().createElement(i().Fragment,null,n,o?(0,r.cloneElement)(o,{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:e7},i().createElement(tl.Provider,{value:ty},t))}const tZ={position:"fixed",touchAction:"none"};const tx=e=>{const t=(0,s/* .isKeyboardEvent */.vd)(e);return t?"transform 250ms ease":undefined};const tk=/*#__PURE__*/(0,r.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:a,className:l,rect:d,style:c,transform:u,transition:v=tx}=e;if(!d){return null}const p=o?u:{...u,scaleX:1,scaleY:1};const h={...tZ,width:d.width,height:d.height,top:d.top,left:d.left,transform:s/* .CSS.Transform.toString */.ux.Transform.toString(p),transformOrigin:o&&r?w(r,d):undefined,transition:typeof v==="function"?v(r):v,...c};return i().createElement(n,{className:l,style:h,ref:t},a)});const tC=e=>t=>{let{active:n,dragOverlay:r}=t;const i={};const{styles:o,className:a}=e;if(o!=null&&o.active){for(const[e,t]of Object.entries(o.active)){if(t===undefined){continue}i[e]=n.node.style.getPropertyValue(e);n.node.style.setProperty(e,t)}}if(o!=null&&o.dragOverlay){for(const[e,t]of Object.entries(o.dragOverlay)){if(t===undefined){continue}r.node.style.setProperty(e,t)}}if(a!=null&&a.active){n.node.classList.add(a.active)}if(a!=null&&a.dragOverlay){r.node.classList.add(a.dragOverlay)}return function e(){for(const[e,t]of Object.entries(i)){n.node.style.setProperty(e,t)}if(a!=null&&a.active){n.node.classList.remove(a.active)}}};const tE=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:s/* .CSS.Transform.toString */.ux.Transform.toString(t)},{transform:s/* .CSS.Transform.toString */.ux.Transform.toString(n)}]};const tW={duration:250,easing:"ease",keyframes:tE,sideEffects:/*#__PURE__*/tC({styles:{active:{opacity:"0"}}})};function tD(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return(0,s/* .useEvent */.zX)((e,o)=>{if(t===null){return}const a=n.get(e);if(!a){return}const l=a.node.current;if(!l){return}const d=e2(o);if(!d){return}const{transform:c}=(0,s/* .getWindow */.Jj)(o).getComputedStyle(o);const u=A(c);if(!u){return}const v=typeof t==="function"?t:tT(t);ea(l,i.draggable.measure);return v({active:{id:e,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function tT(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...tW,...e};return e=>{let{active:o,dragOverlay:a,transform:s,...l}=e;if(!t){// Do not animate if animation duration is zero.
return}const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top};const c={scaleX:s.scaleX!==1?o.rect.width*s.scaleX/a.rect.width:1,scaleY:s.scaleY!==1?o.rect.height*s.scaleY/a.rect.height:1};const u={x:s.x-d.x,y:s.y-d.y,...c};const v=i({...l,active:o,dragOverlay:a,transform:{initial:s,final:u}});const[p]=v;const h=v[v.length-1];if(JSON.stringify(p)===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:o,dragOverlay:a,...l});const g=a.node.animate(v,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{f==null?void 0:f();e()}})}}let tq=0;function tS(e){return(0,r.useMemo)(()=>{if(e==null){return}tq++;return tq},[e])}const tM=/*#__PURE__*/i().memo(e=>{let{adjustScale:t=false,children:n,dropAnimation:o,style:a,transition:s,modifiers:l,wrapperElement:d="div",className:c,zIndex:u=999}=e;const{activatorEvent:v,active:p,activeNodeRect:h,containerNodeRect:f,draggableNodes:g,droppableContainers:_,dragOverlay:m,over:b,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:Z,windowRect:x}=tf();const k=(0,r.useContext)(tl);const C=tS(p==null?void 0:p.id);const E=to(l,{activatorEvent:v,active:p,activeNodeRect:h,containerNodeRect:f,draggingNodeRect:m.rect,over:b,overlayNodeRect:m.rect,scrollableAncestors:w,scrollableAncestorRects:Z,transform:k,windowRect:x});const W=eJ(h);const D=tD({config:o,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 T=W?m.setRef:undefined;return i().createElement(tw,null,i().createElement(tb,{animation:D},p&&C?i().createElement(tk,{key:C,id:p.id,ref:T,as:d,activatorEvent:v,adjustScale:t,className:c,transition:s,rect:W,style:{zIndex:u,...a},transform:E},n):null))});//# sourceMappingURL=core.esm.js.map
},32339:function(e,t,n){n.d(t,{hg:()=>c});/* ESM import */var r=n(24285);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 o=e=>{let{transform:t}=e;return{...t,y:0}};function a(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 a(r,n,t)};const l=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const i=r[0];if(!t||!i){return n}return a(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 a(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 o=e.y-n.top;return{...r,x:r.x+i-n.width/2,y:r.y+o-n.height/2}}return r};//# sourceMappingURL=modifiers.esm.js.map
},45587:function(e,t,n){n.d(t,{Fo:()=>x,cP:()=>C,is:()=>z,nB:()=>S,qw:()=>b});/* ESM import */var r=n(87363);/* ESM import */var i=/*#__PURE__*/n.n(r);/* ESM import */var o=n(94697);/* ESM import */var a=n(24285);/**
 * 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 v(e){if(typeof e==="boolean"){return{draggable:e,droppable:e}}return e}// To-do: We should be calculating scale transformation
const p=/* unused pure expression or super */null&&{scaleX:1,scaleY:1};const h=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:o,index:a}=e;const s=(t=n[i])!=null?t:r;if(!s){return null}const l=f(n,a,i);if(a===i){const e=n[o];if(!e){return null}return{x:i<o?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...p}}if(a>i&&a<=o){return{x:-s.width-l,y:0,...p}}if(a<i&&a>=o){return{x:s.width+l,y:0,...p}}return{x:0,y:0,...p}};function f(e,t,n){const r=e[t];const i=e[t-1];const o=e[t+1];if(!r||!i&&!o){return 0}if(n<t){return i?r.left-(i.left+i.width):o.left-(r.left+r.width)}return o?o.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 o=s(t,r,n);const a=t[i];const l=o[i];if(!l||!a){return null}return{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}};const _=e=>{let{activeIndex:t,index:n,rects:r,overIndex:i}=e;let o;let a;if(n===t){o=r[n];a=r[i]}if(n===i){o=r[n];a=r[t]}if(!a||!o){return null}return{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.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:o,overIndex:a}=e;const s=(t=o[n])!=null?t:r;if(!s){return null}if(i===n){const e=o[a];if(!e){return null}return{x:0,y:n<a?e.top+e.height-(s.top+s.height):e.top-s.top,...m}}const l=y(o,i,n);if(i>n&&i<=a){return{x:0,y:-s.height-l,...m}}if(i<n&&i>=a){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 o=e[t+1];if(!r){return 0}if(n<t){return i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0}return o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0}const w="Sortable";const Z=/*#__PURE__*/i().createContext({activeIndex:-1,containerId:w,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:g,disabled:{draggable:false,droppable:false}});function x(e){let{children:t,id:n,items:s,strategy:l=g,disabled:c=false}=e;const{active:p,dragOverlay:h,droppableRects:f,over:_,measureDroppableContainers:m}=(0,o/* .useDndContext */.Cj)();const b=(0,a/* .useUniqueId */.Ld)(w,n);const y=Boolean(h.rect!==null);const x=(0,r.useMemo)(()=>s.map(e=>typeof e==="object"&&"id"in e?e.id:e),[s]);const k=p!=null;const C=p?x.indexOf(p.id):-1;const E=_?x.indexOf(_.id):-1;const W=(0,r.useRef)(x);const D=!u(x,W.current);const T=E!==-1&&C===-1||D;const q=v(c);(0,a/* .useIsomorphicLayoutEffect */.LI)(()=>{if(D&&k){m(x)}},[D,x,k,m]);(0,r.useEffect)(()=>{W.current=x},[x]);const S=(0,r.useMemo)(()=>({activeIndex:C,containerId:b,disabled:q,disableTransforms:T,items:x,overIndex:E,useDragOverlay:y,sortedRects:d(x,f),strategy:l}),[C,b,q.draggable,q.droppable,T,x,E,f,y,l]);return i().createElement(Z.Provider,{value:S},t)}const k=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return s(n,r,i).indexOf(t)};const C=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:l,transition:d}=e;if(!d||!r){return false}if(s!==o&&i===a){return false}if(n){return true}return a!==i&&t===l};const E={duration:200,easing:"ease"};const W="transform";const D=/*#__PURE__*/a/* .CSS.Transition.toString */.ux.Transition.toString({property:W,duration:0,easing:"linear"});const T={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,a/* .useIsomorphicLayoutEffect */.LI)(()=>{if(!t&&n!==c.current&&i.current){const e=s.current;if(e){const t=(0,o/* .getClientRect */.VK)(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 S(e){let{animateLayoutChanges:t=C,attributes:n,disabled:i,data:s,getNewIndex:l=k,id:d,strategy:u,resizeObserverConfig:v,transition:p=E}=e;const{items:h,containerId:f,activeIndex:g,disabled:_,disableTransforms:m,sortedRects:b,overIndex:y,useDragOverlay:w,strategy:x}=(0,r.useContext)(Z);const S=M(i,_);const B=h.indexOf(d);const I=(0,r.useMemo)(()=>({sortable:{containerId:f,index:B,items:h},...s}),[f,s,B,h]);const z=(0,r.useMemo)(()=>h.slice(h.indexOf(d)),[h,d]);const{rect:P,node:A,isOver:O,setNodeRef:N}=(0,o/* .useDroppable */.Zj)({id:d,data:I,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:z,...v}});const{active:J,activatorEvent:L,activeNodeRect:U,attributes:R,setNodeRef:X,listeners:F,isDragging:j,over:Q,setActivatorNodeRef:H,transform:Y}=(0,o/* .useDraggable */.O1)({id:d,data:I,attributes:{...T,...n},disabled:S.draggable});const V=(0,a/* .useCombinedRefs */.HB)(N,X);const K=Boolean(J);const G=K&&!m&&c(g)&&c(y);const $=!w&&j;const ee=$&&G?Y:null;const et=u!=null?u:x;const en=G?ee!=null?ee:et({rects:b,activeNodeRect:U,activeIndex:g,overIndex:y,index:B}):null;const er=c(g)&&c(y)?l({id:d,items:h,activeIndex:g,overIndex:y}):B;const ei=J==null?void 0:J.id;const eo=(0,r.useRef)({activeId:ei,items:h,newIndex:er,containerId:f});const ea=h!==eo.current.items;const es=t({active:J,containerId:f,isDragging:j,isSorting:K,id:d,index:B,items:h,newIndex:eo.current.newIndex,previousItems:eo.current.items,previousContainerId:eo.current.containerId,transition:p,wasDragging:eo.current.activeId!=null});const el=q({disabled:!es,index:B,node:A,rect:P});(0,r.useEffect)(()=>{if(K&&eo.current.newIndex!==er){eo.current.newIndex=er}if(f!==eo.current.containerId){eo.current.containerId=f}if(h!==eo.current.items){eo.current.items=h}},[K,er,f,h]);(0,r.useEffect)(()=>{if(ei===eo.current.activeId){return}if(ei!=null&&eo.current.activeId==null){eo.current.activeId=ei;return}const e=setTimeout(()=>{eo.current.activeId=ei},50);return()=>clearTimeout(e)},[ei]);return{active:J,activeIndex:g,attributes:R,data:I,rect:P,index:B,newIndex:er,items:h,isOver:O,isSorting:K,isDragging:j,listeners:F,node:A,overIndex:y,over:Q,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:N,setDraggableNodeRef:X,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
ea&&eo.current.newIndex===B){return D}if($&&!(0,a/* .isKeyboardEvent */.vd)(L)||!p){return undefined}if(K||es){return a/* .CSS.Transition.toString */.ux.Transition.toString({...p,property:W})}return undefined}}function M(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 B(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 I=[o/* .KeyboardCode.Down */.g4.Down,o/* .KeyboardCode.Right */.g4.Right,o/* .KeyboardCode.Up */.g4.Up,o/* .KeyboardCode.Left */.g4.Left];const z=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:l,scrollableAncestors:d}}=t;if(I.includes(e.code)){e.preventDefault();if(!n||!r){return}const t=[];s.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled){return}const a=i.get(n.id);if(!a){return}switch(e.code){case o/* .KeyboardCode.Down */.g4.Down:if(r.top<a.top){t.push(n)}break;case o/* .KeyboardCode.Up */.g4.Up:if(r.top>a.top){t.push(n)}break;case o/* .KeyboardCode.Left */.g4.Left:if(r.left>a.left){t.push(n)}break;case o/* .KeyboardCode.Right */.g4.Right:if(r.left<a.left){t.push(n)}break}});const c=(0,o/* .closestCorners */.ey)({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null});let u=(0,o/* .getFirstCollision */._8)(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,o/* .getScrollableAncestors */.hI)(c);const i=n.some((e,t)=>d[t]!==e);const s=P(e,t);const u=A(e,t);const v=i||!s?{x:0,y:0}:{x:u?r.width-l.width:0,y:u?r.height-l.height:0};const p={x:l.left,y:l.top};const h=v.x&&v.y?p:(0,a/* .subtract */.$X)(p,v);return h}}}return undefined};function P(e,t){if(!B(e)||!B(t)){return false}return e.data.current.sortable.containerId===t.data.current.sortable.containerId}function A(e,t){if(!B(e)||!B(t)){return false}if(!P(e,t)){return false}return e.data.current.sortable.index<t.data.current.sortable.index}//# sourceMappingURL=sortable.esm.js.map
},24285:function(e,t,n){n.d(t,{$X:()=>C,D9:()=>y,DC:()=>T,Ey:()=>_,FJ:()=>s,Gj:()=>m,HB:()=>o,IH:()=>k,Jj:()=>d,LI:()=>h,Ld:()=>Z,Nq:()=>a,Re:()=>u,UG:()=>l,Yz:()=>g,qk:()=>c,r3:()=>p,so:()=>M,ux:()=>q,vZ:()=>v,vd:()=>W,wm:()=>b,zX:()=>f});/* ESM import */var r=n(87363);/* ESM import */var i=/*#__PURE__*/n.n(r);function o(){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 a=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 v(e){return e instanceof d(e).SVGElement}function p(e){if(!e){return document}if(s(e)){return e.document}if(!l(e)){return document}if(c(e)){return e}if(u(e)||v(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=a?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 Z(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 x(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 k=/*#__PURE__*/x(1);const C=/*#__PURE__*/x(-1);function E(e){return"clientX"in e&&"clientY"in e}function W(e){if(!e){return false}const{KeyboardEvent:t}=d(e.target);return t&&e instanceof t}function D(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 T(e){if(D(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(E(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 S="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function M(e){if(e.matches(S)){return e}return e.querySelector(S)}//# sourceMappingURL=utilities.esm.js.map
},58574:function(e,t,n){n.d(t,{Z:()=>l});/* ESM import */var r=n(8081);/* ESM import */var i=/*#__PURE__*/n.n(r);/* ESM import */var o=n(23645);/* ESM import */var a=/*#__PURE__*/n.n(o);// Imports
var s=a()(i());// Module
s.push([e.id,`/* Variables declaration */
/* prettier-ignore */
.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;
  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-color: transparent;
  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
/* ESM default export */const l=s},23645: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,o){if(typeof e==="string"){e=[[null,e,undefined]]}var a={};if(r){for(var s=0;s<this.length;s++){var l=this[s][0];if(l!=null){a[l]=true}}}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);if(r&&a[c[0]]){continue}if(typeof o!=="undefined"){if(typeof c[5]==="undefined"){c[5]=o}else{c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}");c[5]=o}}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}},8081:function(e){e.exports=function(e){return e[1]}},47041:function(e,t,n){n.d(t,{Z:()=>s});/* ESM import */var r=n(58545);/* ESM import */var i=n(19013);/* ESM import */var o=n(18717);/* ESM import */var a=n(13882);/**
 * @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,a/* ["default"] */.Z)(1,arguments);var s=(0,o/* ["default"] */.Z)((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 v=s;var p=Number((n=t===null||t===void 0?void 0:t.step)!==null&&n!==void 0?n:1);if(p<1||isNaN(p))throw new RangeError("`options.step` must be a number equal to or greater than 1");while(v.getTime()<=c){u.push((0,i["default"])(v));v=(0,r["default"])(v,p)}return u}},37042:function(e,t,n){n.r(t);n.d(t,{"default":()=>a});/* ESM import */var r=n(83946);/* ESM import */var i=n(19013);/* ESM import */var o=n(13882);/**
 * @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 a(e,t){(0,o/* ["default"] */.Z)(2,arguments);var n=(0,i["default"])(e);var a=(0,r/* ["default"] */.Z)(t);n.setHours(a);return n}},4543:function(e,t,n){n.r(t);n.d(t,{"default":()=>a});/* ESM import */var r=n(83946);/* ESM import */var i=n(19013);/* ESM import */var o=n(13882);/**
 * @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 a(e,t){(0,o/* ["default"] */.Z)(2,arguments);var n=(0,i["default"])(e);var a=(0,r/* ["default"] */.Z)(t);n.setMinutes(a);return n}},18717:function(e,t,n){n.d(t,{Z:()=>o});/* ESM import */var r=n(19013);/* ESM import */var i=n(13882);/**
 * @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 o(e){(0,i/* ["default"] */.Z)(1,arguments);var t=(0,r["default"])(e);t.setSeconds(0,0);return t}},70165:function(e,t,n){/* ESM import */var r=n(93379);/* ESM import */var i=/*#__PURE__*/n.n(r);/* ESM import */var o=n(7795);/* ESM import */var a=/*#__PURE__*/n.n(o);/* ESM import */var s=n(90569);/* ESM import */var l=/*#__PURE__*/n.n(s);/* ESM import */var d=n(3565);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(19216);/* ESM import */var v=/*#__PURE__*/n.n(u);/* ESM import */var p=n(44589);/* ESM import */var h=/*#__PURE__*/n.n(p);/* ESM import */var f=n(58574);var g={};g.styleTagTransform=h();g.setAttributes=c();g.insert=l().bind(null,"head");g.domAPI=a();g.insertStyleElement=v();var _=i()(f/* ["default"] */.Z,g);/* unused ESM default export */var m=f/* ["default"] */.Z&&f/* ["default"].locals */.Z.locals?f/* ["default"].locals */.Z.locals:undefined},93379: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 o={};var a=[];for(var s=0;s<e.length;s++){var l=e[s];var d=r.base?l[0]+r.base:l[0];var c=o[d]||0;var u="".concat(d," ").concat(c);o[d]=c+1;var v=n(u);var p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(v!==-1){t[v].references++;t[v].updater(p)}else{var h=i(p,r);r.byIndex=s;t.splice(s,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}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 o=r(e,i);return function e(e){e=e||[];for(var a=0;a<o.length;a++){var s=o[a];var l=n(s);t[l].references--}var d=r(e,i);for(var c=0;c<o.length;c++){var u=o[c];var v=n(u);if(t[v].references===0){t[v].updater();t.splice(v,1)}}o=d}}},90569: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},19216: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},3565: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},7795: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 o=n.sourceMap;if(o&&typeof btoa!=="undefined"){r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")}// 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},44589: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},56096:function(e,t,n){e.exports=n.p+"js/images/3d-d74232c4.png"},67149:function(e,t,n){e.exports=n.p+"js/images/black-and-white-a1d197c0.png"},41834:function(e,t,n){e.exports=n.p+"js/images/concept-ad427b25.png"},42336:function(e,t,n){e.exports=n.p+"js/images/dreamy-72eab497.png"},79608:function(e,t,n){e.exports=n.p+"js/images/filmic-91db8802.png"},4359:function(e,t,n){e.exports=n.p+"js/images/illustration-19074f05.png"},88013:function(e,t,n){e.exports=n.p+"js/images/neon-bfde2ac7.png"},53192:function(e,t,n){e.exports=n.p+"js/images/none-2088b52b.jpg"},48366:function(e,t,n){e.exports=n.p+"js/images/painting-db63dd8a.png"},39071:function(e,t,n){e.exports=n.p+"js/images/photo-7d69e05e.png"},43666:function(e,t,n){e.exports=n.p+"js/images/retro-bcc8eda3.png"},46572:function(e,t,n){e.exports=n.p+"js/images/sketch-319bbedf.png"},62756:function(e,t,n){e.exports=n.p+"js/images/not-found-2x-5f9812df.webp"},78535:function(e,t,n){e.exports=n.p+"js/images/not-found-4fa6c9c0.webp"},86056:function(e,t,n){e.exports=n.p+"js/images/generate-image-2x-7d387dcf.webp"},95781:function(e,t,n){e.exports=n.p+"js/images/generate-image-3e5f50a6.webp"},19646:function(e,t,n){// EXPORTS
n.d(t,{Z:()=>/* binding */q});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var r=n(7409);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(99282);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var o=n(35944);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var a=n(75537);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_define_property.js
var s=n(27412);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Alert.tsx
var l=n(87056);// EXTERNAL MODULE: external "React"
var d=n(87363);// 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,o/* .jsxs */.BX)(l/* ["default"] */.Z,{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"});/* ESM default export */const u=c;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/ContentRenderer.tsx
var v=e=>{var{component:t}=e;return/*#__PURE__*/(0,o/* .jsx */.tZ)(u,{componentName:"content",children:t})};/* ESM default export */const p=v;// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormCheckbox.tsx
var h=n(60274);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormDateInput.tsx
var f=n(42456);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFileUploader.tsx
var g=n(86774);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormImageInput.tsx
var _=n(44226);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInput.tsx
var m=n(78150);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormRadioGroup.tsx
var b=n(90097);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var y=n(82325);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSwitch.tsx
var w=n(92386);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var Z=n(3473);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTimeInput.tsx
var x=n(47778);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var k=n(69789);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormWPEditor.tsx
var C=n(3960);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var E=n(52293);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/FieldRenderer.tsx
var W=e=>{var{name:t,label:n,buttonText:a,helpText:s,infoText:d,placeholder:c,type:v,options:p,defaultValue:W,rules:D,form:T}=e;// eslint-disable-next-line @typescript-eslint/no-explicit-any
var q=e=>{var E=(()=>{switch(v){case"text":return/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"number":return/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:n,placeholder:c,helpText:s}));case"password":return/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"password",label:n,placeholder:c,helpText:s}));case"textarea":return/*#__PURE__*/(0,o/* .jsx */.tZ)(Z/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"select":return/*#__PURE__*/(0,o/* .jsx */.tZ)(y/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,options:p||[],placeholder:c,helpText:s}));case"radio":return/*#__PURE__*/(0,o/* .jsx */.tZ)(b/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,options:p||[]}));case"checkbox":return/*#__PURE__*/(0,o/* .jsx */.tZ)(h/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n}));case"switch":return/*#__PURE__*/(0,o/* .jsx */.tZ)(w/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,helpText:s}));case"date":return/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"time":return/*#__PURE__*/(0,o/* .jsx */.tZ)(x/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));case"image":return/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,buttonText:a,helpText:s,infoText:d}));case"video":return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,buttonText:a,helpText:s,infoText:d}));case"uploader":return/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,buttonText:a,helpText:s}));case"WPEditor":return/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:n,placeholder:c,helpText:s}));default:return/*#__PURE__*/(0,o/* .jsxs */.BX)(l/* ["default"] */.Z,{type:"danger",children:["Unsupported field type: ",v]})}})();return/*#__PURE__*/(0,o/* .jsx */.tZ)(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:E})};return/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* .Controller */.Qr,{name:t,control:T.control,defaultValue:W!==null&&W!==void 0?W:"",rules:D,render:e=>q(e)})};/* ESM default export */const D=W;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/CourseBuilderSlot.tsx
var T=e=>{var{section:t,namePrefix:n,form:s}=e;var{fields:l,contents:d}=(0,a/* .useCourseBuilderSlot */.l)();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,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[c().map(e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(D,(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,o/* .jsx */.tZ)(p,{component:n},t)})]})};/* ESM default export */const q=T},29422:function(e,t,n){n.d(t,{Z:()=>N});/* ESM import */var r=n(76150);/* ESM import */var i=n(7409);/* ESM import */var o=n(99282);/* ESM import */var a=n(58865);/* ESM import */var s=n(35944);/* ESM import */var l=n(70917);/* ESM import */var d=n(38003);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(32449);/* ESM import */var v=n(87363);/* ESM import */var p=/*#__PURE__*/n.n(v);/* ESM import */var h=n(52293);/* ESM import */var f=n(19398);/* ESM import */var g=n(2613);/* ESM import */var _=n(60274);/* ESM import */var m=n(42456);/* ESM import */var b=n(78150);/* ESM import */var y=n(82325);/* ESM import */var w=n(3473);/* ESM import */var Z=n(47778);/* ESM import */var x=n(34039);/* ESM import */var k=n(74053);/* ESM import */var C=n(60860);/* ESM import */var E=n(76487);/* ESM import */var W=n(37861);/* ESM import */var D=n(41819);/* ESM import */var T=n(90406);/* ESM import */var q=n(11908);/* ESM import */var S=n(14784);/* ESM import */var M=n(17106);/* ESM import */var B=n(29535);/* ESM import */var I=n(22456);/* ESM import */var z=n(25481);function P(){var e=(0,a._)(["\n      box-shadow: ",";\n    "]);P=function t(){return e};return e}var A=(0,S/* .getCourseId */.z)();var O=e=>{var{onCancel:t,data:n,topicId:a,meetingId:l}=e;var{ref:c,isScrolling:p}=(0,D/* .useIsScrolling */.a)({defaultValue:true});var C=(0,q/* .useGoogleMeetDetailsQuery */.i0)(l?l:"",a?a:"");var E=n!==null&&n!==void 0?n:C.data;var S,B,P;var O=(0,W/* .useFormWithGlobalError */.O)({defaultValues:{meeting_name:(S=E===null||E===void 0?void 0:E.post_title)!==null&&S!==void 0?S:"",meeting_summary:(B=E===null||E===void 0?void 0:E.post_content)!==null&&B!==void 0?B:"",meeting_start_date:(E===null||E===void 0?void 0:E.meeting_data.start_datetime)?(0,u["default"])(new Date(E.meeting_data.start_datetime),k/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_start_time:(E===null||E===void 0?void 0:E.meeting_data.start_datetime)?(0,u["default"])(new Date(E.meeting_data.start_datetime),k/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_end_date:(E===null||E===void 0?void 0:E.meeting_data.end_datetime)?(0,u["default"])(new Date(E.meeting_data.end_datetime),k/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_end_time:(E===null||E===void 0?void 0:E.meeting_data.end_datetime)?(0,u["default"])(new Date(E.meeting_data.end_datetime),k/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_timezone:(P=E===null||E===void 0?void 0:E.meeting_data.timezone)!==null&&P!==void 0?P:"",meeting_enrolledAsAttendee:(E===null||E===void 0?void 0:E.meeting_data.attendees)==="Yes"},shouldFocusError:true,mode:"onChange"});var N=(0,T/* .useSaveGoogleMeetMutation */.pH)();var L=x/* .tutorConfig.timezones */.y.timezones;var U=Object.keys(L).map(e=>({label:L[e],value:e}));var R=e=>(0,r._)(function*(){if(!A){return}var n=yield N.mutateAsync((0,o._)((0,i._)({},E&&{"post-id":Number(E.ID),"event-id":E.meeting_data.id},a&&{topic_id:a}),{course_id:A,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();O.reset()}})();(0,v.useEffect)(()=>{if((0,I/* .isDefined */.$K)(E)){O.reset({meeting_name:E.post_title,meeting_summary:E.post_content,meeting_start_date:E.meeting_data.start_datetime?(0,u["default"])(new Date(E.meeting_data.start_datetime),k/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_start_time:E.meeting_data.start_datetime?(0,u["default"])(new Date(E.meeting_data.start_datetime),k/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_end_date:E.meeting_data.end_datetime?(0,u["default"])(new Date(E.meeting_data.end_datetime),k/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_end_time:E.meeting_data.end_datetime?(0,u["default"])(new Date(E.meeting_data.end_datetime),k/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_timezone:E.meeting_data.timezone,meeting_enrolledAsAttendee:E.meeting_data.attendees==="Yes"})}var e=setTimeout(()=>{O.setFocus("meeting_name")},250);return()=>{clearTimeout(e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[E]);return/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.container,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:J.formWrapper,ref:c,children:/*#__PURE__*/(0,s/* .jsxs */.BX)(M/* ["default"] */.Z,{when:!C.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_name",control:O.control,rules:{required:(0,d.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(b/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Name","tutor"),placeholder:(0,d.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_summary",control:O.control,rules:{required:(0,d.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Summary","tutor"),placeholder:(0,d.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:J.dateLabel,children:(0,d.__)("Meeting Start Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_start_date",control:O.control,rules:{required:(0,d.__)("Start date is required","tutor"),validate:z/* .invalidDateRule */.Ek},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(m/* ["default"] */.Z,(0,o._)((0,i._)({},e),{placeholder:(0,d.__)("Start date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_start_time",control:O.control,rules:{required:(0,d.__)("Start time is required","tutor"),validate:z/* .invalidTimeRule */.xB},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(Z/* ["default"] */.Z,(0,o._)((0,i._)({},e),{placeholder:(0,d.__)("Start time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:J.dateLabel,children:(0,d.__)("Meeting End Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_end_date",control:O.control,rules:{required:(0,d.__)("End date is required","tutor"),validate:{invalidDate:z/* .invalidDateRule */.Ek,checkEndDate:e=>{var t=O.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 */.tZ)(m/* ["default"] */.Z,(0,o._)((0,i._)({},e),{placeholder:(0,d.__)("End date","tutor"),disabledBefore:O.watch("meeting_start_date")||new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_end_time",control:O.control,rules:{required:(0,d.__)("End time is required","tutor"),validate:{invalidTime:z/* .invalidTimeRule */.xB,checkEndTime:e=>{var t=O.watch("meeting_start_date");var n=O.watch("meeting_start_time");var r=O.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 */.tZ)(Z/* ["default"] */.Z,(0,o._)((0,i._)({},e),{placeholder:(0,d.__)("End time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_timezone",control:O.control,rules:{required:(0,d.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(y/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Timezone","tutor"),placeholder:(0,d.__)("Select timezone","tutor"),options:U,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_enrolledAsAttendee",control:O.control,render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(_/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Add enrolled students as attendees","tutor")}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:J.buttonWrapper({isScrolling:p}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:t,children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-google-meeting",loading:N.isPending,variant:"primary",size:"small",onClick:O.handleSubmit(R),children:E||l?(0,d.__)("Update Meeting","tutor"):(0,d.__)("Create Meeting","tutor")})]})]})};/* ESM default export */const N=O;var J={container:/*#__PURE__*/(0,l/* .css */.iv)(B/* .styleUtils.display.flex */.i.display.flex("column"),"    background:",C/* .colorTokens.background.white */.Jv.background.white,";padding-block:",C/* .spacing["12"] */.W0["12"],";border-radius:",C/* .borderRadius.card */.E0.card,";box-shadow:",C/* .shadow.popover */.AF.popover,";",E/* .typography.caption */.c.caption("regular"),";* > label{font-size:",C/* .fontSize["15"] */.JB["15"],";color:",C/* .colorTokens.text.title */.Jv.text.title,";}"),formWrapper:/*#__PURE__*/(0,l/* .css */.iv)(B/* .styleUtils.display.flex */.i.display.flex("column"),";",B/* .styleUtils.overflowYAuto */.i.overflowYAuto,";padding-inline:",C/* .spacing["12"] */.W0["12"],";padding-bottom:",C/* .spacing["8"] */.W0["8"],";gap:",C/* .spacing["12"] */.W0["12"],";height:400px;"),dateLabel:/*#__PURE__*/(0,l/* .css */.iv)(E/* .typography.caption */.c.caption("medium"),"    color:",C/* .colorTokens.text.title */.Jv.text.title,";"),meetingDateTimeWrapper:/*#__PURE__*/(0,l/* .css */.iv)(B/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",C/* .spacing["6"] */.W0["6"],";"),meetingDateTime:/*#__PURE__*/(0,l/* .css */.iv)(B/* .styleUtils.display.flex */.i.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",C/* .spacing["6"] */.W0["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,l/* .css */.iv)(B/* .styleUtils.display.flex */.i.display.flex(),"    padding-top:",C/* .spacing["8"] */.W0["8"],";padding-inline:",C/* .spacing["12"] */.W0["12"],";justify-content:flex-end;gap:",C/* .spacing["8"] */.W0["8"],";z-index:",C/* .zIndex.positive */.W5.positive,";",t&&(0,l/* .css */.iv)(P(),C/* .shadow.scrollable */.AF.scrollable))}}},81632:function(e,t,n){n.d(t,{Z:()=>O});/* ESM import */var r=n(76150);/* ESM import */var i=n(7409);/* ESM import */var o=n(99282);/* ESM import */var a=n(58865);/* ESM import */var s=n(35944);/* ESM import */var l=n(70917);/* ESM import */var d=n(38003);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(32449);/* ESM import */var v=n(87363);/* ESM import */var p=/*#__PURE__*/n.n(v);/* ESM import */var h=n(52293);/* ESM import */var f=n(19398);/* ESM import */var g=n(2613);/* ESM import */var _=n(42456);/* ESM import */var m=n(78150);/* ESM import */var b=n(3473);/* ESM import */var y=n(47778);/* ESM import */var w=n(60860);/* ESM import */var Z=n(76487);/* ESM import */var x=n(37861);/* ESM import */var k=n(90406);/* ESM import */var C=n(11908);/* ESM import */var E=n(14784);/* ESM import */var W=n(82325);/* ESM import */var D=n(34039);/* ESM import */var T=n(74053);/* ESM import */var q=n(17106);/* ESM import */var S=n(41819);/* ESM import */var M=n(29535);/* ESM import */var B=n(22456);/* ESM import */var I=n(25481);function z(){var e=(0,a._)(["\n      box-shadow: ",";\n    "]);z=function t(){return e};return e}var P=(0,E/* .getCourseId */.z)();var A=e=>{var{onCancel:t,data:n,meetingHost:a,topicId:l,meetingId:c}=e;var p;var{ref:w,isScrolling:Z}=(0,S/* .useIsScrolling */.a)({defaultValue:true});var E=(0,C/* .useZoomMeetingDetailsQuery */.qY)(c?c:"",l?l:"");var M=n!==null&&n!==void 0?n:E.data;var z,A;var O=(A=(z=M===null||M===void 0?void 0:M.meeting_starts_at)!==null&&z!==void 0?z:M===null||M===void 0?void 0:M.meeting_data.start_time)!==null&&A!==void 0?A:"";var J,L,U,R,X,F;var j=(0,x/* .useFormWithGlobalError */.O)({defaultValues:{meeting_name:(J=M===null||M===void 0?void 0:M.post_title)!==null&&J!==void 0?J:"",meeting_summary:(L=M===null||M===void 0?void 0:M.post_content)!==null&&L!==void 0?L:"",meeting_date:O?(0,u["default"])(new Date(O),T/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_time:O?(0,u["default"])(new Date(O),T/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_duration:(M===null||M===void 0?void 0:M.meeting_data.duration)?String(M===null||M===void 0?void 0:M.meeting_data.duration):"40",meeting_duration_unit:(U=M===null||M===void 0?void 0:M.meeting_data.duration_unit)!==null&&U!==void 0?U:"min",meeting_timezone:(R=M===null||M===void 0?void 0:M.meeting_data.timezone)!==null&&R!==void 0?R:"",auto_recording:(X=M===null||M===void 0?void 0:(p=M.meeting_data.settings)===null||p===void 0?void 0:p.auto_recording)!==null&&X!==void 0?X:"none",meeting_password:(F=M===null||M===void 0?void 0:M.meeting_data.password)!==null&&F!==void 0?F:"",meeting_host:Object.keys(a).length===1?Object.keys(a)[0]:""},shouldFocusError:true,mode:"onChange"});var Q=(0,k/* .useSaveZoomMeetingMutation */.Z4)();var H=D/* .tutorConfig.timezones */.y.timezones;var Y=Object.keys(H).map(e=>({label:H[e],value:e}));var V=Object.keys(a).map(e=>({label:a[e],value:e}));var K=e=>(0,r._)(function*(){if(!P){return}var n=yield Q.mutateAsync((0,o._)((0,i._)({},M&&{meeting_id:Number(M.ID)},l&&{topic_id:Number(l)}),{course_id:P,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,v.useEffect)(()=>{if((0,B/* .isDefined */.$K)(M)){var e;var t;j.reset({meeting_name:M.post_title,meeting_summary:M.post_content,meeting_date:O?(0,u["default"])(new Date(O),T/* .DateFormats.yearMonthDay */.E_.yearMonthDay):"",meeting_time:O?(0,u["default"])(new Date(O),T/* .DateFormats.hoursMinutes */.E_.hoursMinutes):"",meeting_duration:String(M.meeting_data.duration),meeting_duration_unit:M.meeting_data.duration_unit,meeting_timezone:M.meeting_data.timezone,auto_recording:(t=(e=M.meeting_data.settings)===null||e===void 0?void 0:e.auto_recording)!==null&&t!==void 0?t:"none",meeting_password:M.meeting_data.password,meeting_host:M.meeting_data.host_id})}var n=setTimeout(()=>{j.setFocus("meeting_name")},250);return()=>{clearTimeout(n)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[M]);return/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:N.container,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:N.formWrapper,ref:w,children:/*#__PURE__*/(0,s/* .jsxs */.BX)(q/* ["default"] */.Z,{when:!E.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_name",control:j.control,rules:{required:(0,d.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(m/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Name","tutor"),placeholder:(0,d.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_summary",control:j.control,rules:{required:(0,d.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(b/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Summary","tutor"),placeholder:(0,d.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:N.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_date",control:j.control,rules:{required:(0,d.__)("Date is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(_/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Date","tutor"),placeholder:(0,d.__)("Enter meeting date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_time",control:j.control,rules:{required:(0,d.__)("Time is required","tutor"),validate:I/* .invalidTimeRule */.xB},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(y/* ["default"] */.Z,(0,o._)((0,i._)({},e),{placeholder:(0,d.__)("Start time","tutor")}))}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:N.meetingTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_duration",control:j.control,rules:{required:(0,d.__)("Duration is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(m/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Duration","tutor"),placeholder:(0,d.__)("Duration","tutor"),type:"number",selectOnFocus:true}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_duration_unit",control:j.control,rules:{required:(0,d.__)("Duration unit is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(W/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:/*#__PURE__*/(0,s/* .jsx */.tZ)("span",{children:" "}),options:[{label:(0,d.__)("Minutes","tutor"),value:"min"},{label:(0,d.__)("Hours","tutor"),value:"hr"}]}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_timezone",control:j.control,rules:{required:(0,d.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(W/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Timezone","tutor"),placeholder:(0,d.__)("Select timezone","tutor"),options:Y,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"auto_recording",control:j.control,rules:{required:(0,d.__)("Auto recording is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(W/* ["default"] */.Z,(0,o._)((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 */.tZ)(h/* .Controller */.Qr,{name:"meeting_password",control:j.control,rules:{required:(0,d.__)("Password is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(m/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Password","tutor"),placeholder:(0,d.__)("Enter meeting password","tutor"),type:"password",isPassword:true}))}),/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .Controller */.Qr,{name:"meeting_host",control:j.control,rules:{required:(0,d.__)("Meeting host is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.tZ)(W/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,d.__)("Meeting Host","tutor"),placeholder:(0,d.__)("Enter meeting host","tutor"),options:V,disabled:(0,B/* .isDefined */.$K)(M),selectOnFocus:true,isSearchable:true}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:N.buttonWrapper({isScrolling:Z}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:t,children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-zoom-meeting",loading:Q.isPending,variant:"primary",size:"small",onClick:j.handleSubmit(K),children:M||c?(0,d.__)("Update Meeting","tutor"):(0,d.__)("Create Meeting","tutor")})]})]})};/* ESM default export */const O=A;var N={container:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),"    background:",w/* .colorTokens.background.white */.Jv.background.white,";padding-block:",w/* .spacing["12"] */.W0["12"],";border-radius:",w/* .borderRadius.card */.E0.card,";box-shadow:",w/* .shadow.popover */.AF.popover,";",Z/* .typography.caption */.c.caption("regular"),";* > label{font-size:",w/* .fontSize["15"] */.JB["15"],";color:",w/* .colorTokens.text.title */.Jv.text.title,";}"),formWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),";",M/* .styleUtils.overflowYAuto */.i.overflowYAuto,";padding-inline:",w/* .spacing["12"] */.W0["12"],";padding-bottom:",w/* .spacing["8"] */.W0["8"],";gap:",w/* .spacing["12"] */.W0["12"],";height:400px;"),meetingDateTimeWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",w/* .spacing["6"] */.W0["6"],";"),meetingTimeWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",w/* .spacing["6"] */.W0["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),"    padding-top:",w/* .spacing["8"] */.W0["8"],";padding-inline:",w/* .spacing["12"] */.W0["12"],";justify-content:flex-end;gap:",w/* .spacing["8"] */.W0["8"],";z-index:",w/* .zIndex.positive */.W5.positive,";",t&&(0,l/* .css */.iv)(z(),w/* .shadow.scrollable */.AF.scrollable))}}},5558:function(e,t,n){n.d(t,{Z:()=>_});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(38003);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(89250);/* ESM import */var d=n(19398);/* ESM import */var c=n(26815);/* ESM import */var u=n(74053);/* ESM import */var v=n(60860);/* ESM import */var p=n(76487);/* ESM import */var h=n(17106);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:o}=e;var s=(0,l/* .useNavigate */.s0)();var v=()=>{if(n){if(o){window.location.href=n;return}s(n)}else{s(-1)}};return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:m.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:m.left,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{isIconOnly:true,size:"small",variant:"text","aria-label":(0,a.__)("Back","tutor"),buttonCss:m.button({isRTL:u/* .isRTL */.dZ}),onClick:v,icon:/*#__PURE__*/(0,i/* .jsx */.tZ)(c/* ["default"] */.Z,{name:"back",width:32,height:32})})}),/*#__PURE__*/(0,i/* .jsx */.tZ)("h6",{css:m.title,children:t})]}),r]})};/* ESM default export */const _=g;var m={wrapper:/*#__PURE__*/(0,o/* .css */.iv)("display:flex;align-items:center;justify-content:space-between;"),left:/*#__PURE__*/(0,o/* .css */.iv)("display:flex;align-items:center;gap:",v/* .spacing["16"] */.W0["16"],";"),button:e=>{var{isRTL:t}=e;return/*#__PURE__*/(0,o/* .css */.iv)("padding:0;border-radius:",v/* .borderRadius["2"] */.E0["2"],";",t&&(0,o/* .css */.iv)(f()))},title:/*#__PURE__*/(0,o/* .css */.iv)(p/* .typography.heading6 */.c.heading6("medium"),";")}},88311:function(e,t,n){n.d(t,{Z:()=>y});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(35944);/* ESM import */var a=n(20203);/* ESM import */var s=n(89459);/* ESM import */var l=n(19398);/* ESM import */var d=n(26815);/* ESM import */var c=n(74053);/* ESM import */var u=n(60860);/* ESM import */var v=n(17106);/* ESM import */var p=n(93283);/* ESM import */var h=n(70917);/* ESM import */var f=n(38003);/* ESM import */var g=/*#__PURE__*/n.n(f);/* ESM import */var _=n(52293);/* ESM import */var m=n(89250);var b=e=>{var{styleModifier:t}=e;var{steps:n,setSteps:g}=(0,s/* .useCourseNavigator */.O)();var b=(0,m/* .useNavigate */.s0)();var y=(0,p/* .useCurrentPath */.J)(a/* ["default"] */.Z);var Z=(0,_/* .useFormContext */.Gc)();var x=n.findIndex(e=>e.path===y);var k=Math.max(-1,x-1);var C=Math.min(n.length,x+1);var E=n[k];var W=n[C];var D=Z.watch("post_title");var T=()=>{g(e=>{return e.map((e,t)=>{if(t===x){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===k){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(E.path)};var q=()=>{g(e=>{return e.map((e,t)=>{if(t===x){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===C){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(W.path)};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:[w.wrapper,t],children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(v/* ["default"] */.Z,{when:x>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* ["default"] */.Z,{variant:"tertiary",iconPosition:"right",size:"small",onClick:T,buttonCss:/*#__PURE__*/(0,h/* .css */.iv)("padding:",u/* .spacing["4"] */.W0["4"],";svg{color:",u/* .colorTokens.icon["default"] */.Jv.icon["default"],";}"),disabled:k<0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(d/* ["default"] */.Z,{name:!c/* .isRTL */.dZ?"chevronLeft":"chevronRight",height:24,width:24})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(v/* ["default"] */.Z,{when:x<n.length-1&&D,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* ["default"] */.Z,{variant:"tertiary",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(d/* ["default"] */.Z,{name:!c/* .isRTL */.dZ?"chevronRight":"chevronLeft",height:24,width:24}),iconPosition:"right",size:"small",onClick:q,buttonCss:/*#__PURE__*/(0,h/* .css */.iv)("padding:",u/* .spacing["4"] */.W0["4"]," ",u/* .spacing["4"] */.W0["4"]," ",u/* .spacing["4"] */.W0["4"]," ",u/* .spacing["12"] */.W0["12"],";svg{color:",u/* .colorTokens.icon["default"] */.Jv.icon["default"],";}"),disabled:!D||C>=n.length,children:(0,f.__)("Next","tutor")})})]})};/* ESM default export */const y=b;var w={wrapper:/*#__PURE__*/(0,h/* .css */.iv)("width:100%;display:flex;justify-content:end;height:32px;align-items:center;gap:",u/* .spacing["16"] */.W0["16"],";")}},89577:function(e,t,n){// ESM COMPAT FLAG
n.r(t);// EXPORTS
n.d(t,{"default":()=>/* binding */or});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var r=n(7409);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(99282);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var o=n(35944);// EXTERNAL MODULE: ./node_modules/@dnd-kit/core/dist/core.esm.js
var a=n(94697);// EXTERNAL MODULE: ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js
var s=n(32339);// EXTERNAL MODULE: ./node_modules/@dnd-kit/sortable/dist/sortable.esm.js
var l=n(45587);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var d=n(70917);// EXTERNAL MODULE: external "wp.i18n"
var c=n(38003);// EXTERNAL MODULE: external "React"
var u=n(87363);var v=/*#__PURE__*/n.n(u);// EXTERNAL MODULE: external "ReactDOM"
var p=n(61533);// EXTERNAL MODULE: ./node_modules/react-router/dist/index.js
var h=n(89250);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Button.tsx
var f=n(19398);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/LoadingSpinner.tsx
var g=n(2613);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/SVGIcon.tsx
var _=n(26815);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/EmptyState.tsx
var m=n(75857);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
var b=n(58865);// EXTERNAL MODULE: ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js
var y=n(24285);// EXTERNAL MODULE: ./node_modules/@react-spring/web/dist/react-spring_web.modern.mjs
var w=n(6154);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
var Z=n(76150);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
var x=n(99469);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var k=n(52293);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ProBadge.tsx
var C=n(86766);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Tooltip.tsx
var E=n(58982);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/ConfirmationPopover.tsx
var W=n(65361);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Popover.tsx
var D=n(97669);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/additional/meeting/ZoomMeetingForm.tsx
var T=n(81632);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormDateInput.tsx
var q=n(42456);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFileUploader.tsx
var S=n(86774);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInput.tsx
var M=n(78150);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormInputWithContent.tsx
var B=n(35159);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var I=n(82325);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_without_properties.js + 1 modules
var z=n(98848);// EXTERNAL MODULE: ./assets/react/v3/shared/config/styles.ts
var P=n(60860);// EXTERNAL MODULE: ./assets/react/v3/shared/config/typography.ts
var A=n(76487);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/For.tsx
var O=n(36352);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/Show.tsx
var N=n(17106);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useAnimation.tsx
var J=n(54354);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useDebounce.ts
var L=n(4867);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/style-utils.ts
var U=n(29535);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/util.ts + 4 modules
var R=n(34403);// EXTERNAL MODULE: ./assets/react/v3/public/images/not-found-2x.webp
var X=n(62756);// EXTERNAL MODULE: ./assets/react/v3/public/images/not-found.webp
var F=n(78535);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFieldWrapper.tsx
var j=n(84978);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/FormTopicPrerequisites.tsx
function Q(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);Q=function t(){return e};return e}function H(){var e=(0,b._)(["\n        background-color: ",";\n        border-color: ",";\n\n        [data-visually-hidden] {\n          opacity: 1;\n        }\n      "]);H=function t(){return e};return e}function Y(){var e=(0,b._)(["\n      padding-left: ",";\n    "]);Y=function t(){return e};return e}var V={lesson:{name:"lesson",color:P/* .colorTokens.icon["default"] */.Jv.icon["default"]},tutor_quiz:{name:"quiz",color:P/* .colorTokens.design.warning */.Jv.design.warning},tutor_assignments:{name:"assignment",color:P/* .colorTokens.icon.processing */.Jv.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"quiz",color:P/* .colorTokens.icon.warning */.Jv.icon.warning}};var K=e=>{var{field:t,fieldState:n,options:a,onChange:s=R/* .noop */.ZT,handleSearchOnChange:l,label:v,placeholder:p="",disabled:h,readOnly:f,loading:b,isSearchable:y=false,helpText:w}=e;var Z=t.value||[];var x=Z.map(e=>String(e));var k=a.reduce((e,t)=>{return t.contents.reduce((e,t)=>{if(x.includes(String(t.ID))){e.push(t)}return e},e)},[]);var C=(0,u.useRef)(null);var[E,W]=(0,u.useState)(false);var[T,q]=(0,u.useState)("");var S=(0,L/* .useDebounce */.N)(T);var M=a.reduce((e,t)=>{var n=t.contents.filter(e=>e.post_type!=="tutor-google-meet"&&e.post_type!=="tutor_zoom_meeting"&&!x.includes(String(e.ID)));if(n.length===0){return e}if(t.title.toLowerCase().includes(S.toLowerCase())){e.push((0,i._)((0,r._)({},t),{contents:n}))}else{var o=t.contents.filter(e=>e.post_title.toLowerCase().includes(S.toLowerCase()));if(o.length===0){return e}e.push((0,i._)((0,r._)({},t),{contents:o}))}return e},[]);(0,u.useEffect)(()=>{if(l){l(S)}else{// Handle local filter
}},[S,l]);var B=e=>{if(Array.isArray(Z)){var n=Z.filter(t=>String(t)!==String(e));t.onChange(n);s(n)}};return/*#__PURE__*/(0,o/* .jsx */.tZ)(j/* ["default"] */.Z,{fieldState:n,field:t,label:v,disabled:h,readOnly:f,helpText:w,children:e=>{var{css:n}=e,a=(0,z._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:$.mainWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{ref:C,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:$.inputWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:$.leftIcon,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"search",width:24,height:24})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("input",(0,i._)((0,r._)({},a),{onClick:e=>{e.stopPropagation();W(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();W(e=>!e)}if(e.key==="Tab"){W(false)}},className:"tutor-input-field",css:[n,$.input],autoComplete:"off",readOnly:f||!y,placeholder:p,value:T,onChange:e=>{q(e.target.value)}}))]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:Z.length>0,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!b,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingSection */.g4,{}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,{size:"small",emptyStateImage:F,emptyStateImage2x:X,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,o/* .jsx */.tZ)("div",{css:$.courseList,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:k,children:e=>{var t;return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:$.groupItems({onPopover:false}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:$.iconAndTitle({onPopover:false}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:((t=V[e.post_type])===null||t===void 0?void 0:t.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.iv)("color:",V[e.post_type].color,";")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:$.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{"data-question-count":true,css:A/* .typography.tiny */.c.tiny(),children:/* translators: %d is the number of questions */(0,c.sprintf)((0,c.__)("(%d questions)","tutor"),e.total_question)})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:$.removeButton,"data-visually-hidden":true,onClick:()=>B(e.ID),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"times",width:14,height:14})})]},e.ID)}})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{triggerRef:C,isOpen:E,dependencies:[M.length],animationType:J/* .AnimationType.slideDown */.ru.slideDown,closePopover:()=>{W(false);q("")},children:/*#__PURE__*/(0,o/* .jsx */.tZ)("ul",{css:[$.options],children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:M.length>0,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("li",{css:$.emptyOption,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{children:(0,c.__)("No topics content found","tutor")})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:M,children:e=>/*#__PURE__*/(0,o/* .jsxs */.BX)("li",{css:$.group,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:$.groupTitle,title:e.title,children:e.title}),/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:e.contents,children:e=>{var n;return/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:$.groupItems({onPopover:true}),onClick:()=>{var n=[...Z,e.ID];t.onChange(n);s(n);W(false);q("")},children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:$.iconAndTitle({onPopover:true}),"data-content-icon":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:((n=V[e.post_type])===null||n===void 0?void 0:n.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.iv)("color:",V[e.post_type].color,";")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:$.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{"data-question-count":true,css:A/* .typography.tiny */.c.tiny(),children:/* translators: %d is the number of questions */(0,c.sprintf)((0,c.__)("(%d questions)","tutor"),e.total_question)})})]})},e.ID)}})]},e.id)})})})})]})}})};/* ESM default export */const G=K;var $={mainWrapper:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;"),inputWrapper:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:flex;justify-content:space-between;align-items:center;position:relative;"),leftIcon:/*#__PURE__*/(0,d/* .css */.iv)("position:absolute;left:",P/* .spacing["8"] */.W0["8"],";top:",P/* .spacing["8"] */.W0["8"],";color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";display:flex;"),input:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";width:100%;padding-right:",P/* .spacing["32"] */.W0["32"],";padding-left:",P/* .spacing["36"] */.W0["36"],";",U/* .styleUtils.textEllipsis */.i.textEllipsis,";border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";&.tutor-input-field{padding-right:",P/* .spacing["32"] */.W0["32"],";padding-left:",P/* .spacing["36"] */.W0["36"],";}"),courseList:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["8"] */.W0["8"],";max-height:256px;height:100%;margin-top:",P/* .spacing["8"] */.W0["8"],";",U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";padding:1px;"),options:/*#__PURE__*/(0,d/* .css */.iv)("z-index:",P/* .zIndex.dropdown */.W5.dropdown,";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";list-style-type:none;box-shadow:",P/* .shadow.popover */.AF.popover,";padding:",P/* .spacing["4"] */.W0["4"]," 0;margin:0;max-height:400px;border-radius:",P/* .borderRadius["6"] */.E0["6"],";",U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";"),removeButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";position:absolute;top:50%;right:",P/* .spacing["8"] */.W0["8"],";transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",P/* .borderRadius.circle */.E0.circle,";background:",P/* .colorTokens.background.white */.Jv.background.white,";&:focus,&:active,&:hover{background:",P/* .colorTokens.background.white */.Jv.background.white,";}svg{color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",P/* .colorTokens.icon.hover */.Jv.icon.hover,";}}:focus{box-shadow:",P/* .shadow.focus */.AF.focus,";}"),emptyOption:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption("medium"),";padding:",P/* .spacing["8"] */.W0["8"],";text-align:center;"),group:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["10"] */.W0["10"]," 0;:not(:last-child){border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";}"),groupTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small("semiBold"),";",U/* .styleUtils.text.ellipsis */.i.text.ellipsis(1),";padding-inline:",P/* .spacing["10"] */.W0["10"],";margin-bottom:",P/* .spacing["8"] */.W0["8"],";"),groupItems:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;width:100%;padding:",P/* .spacing["10"] */.W0["10"]," ",P/* .spacing["8"] */.W0["8"],";border-radius:",P/* .borderRadius["6"] */.E0["6"],";border:1px solid transparent;display:flex;justify-content:space-between;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";cursor:",t?"pointer":"default",";[data-content-icon]{display:flex;height:",t?"20px":"24px",";}[data-visually-hidden]{opacity:0;}",!t&&(0,d/* .css */.iv)(Q(),P/* .shadow.card */.AF.card),"    &:hover,&:focus,&:active{background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";",!t&&(0,d/* .css */.iv)(H(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.stroke["default"] */.Jv.stroke["default"]),"}",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},title:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.title */.Jv.text.title,";display:flex;align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";"),iconAndTitle:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.text.ellipsis */.i.text.ellipsis(1),";display:flex;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";",t&&(0,d/* .css */.iv)(Y(),P/* .spacing["16"] */.W0["16"]),"    svg{flex-shrink:0;}span{text-align:left;",U/* .styleUtils.text.ellipsis */.i.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(3960);// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/ModalWrapper.tsx
var et=n(36951);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/CourseBuilderSlot.tsx + 3 modules
var en=n(19646);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var er=n(75537);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/services/curriculum.ts
var ei=n(11908);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/utils/utils.ts
var eo=n(14784);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSwitch.tsx
var ea=n(92386);// EXTERNAL MODULE: ./assets/react/v3/shared/config/config.ts
var es=n(34039);// EXTERNAL MODULE: ./assets/react/v3/shared/config/constants.ts
var el=n(74053);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useFormWithGlobalError.ts
var ed=n(37861);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/validation.ts
var ec=n(25481);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/AssignmentModal.tsx
var eu=(0,eo/* .getCourseId */.z)();var ev=[{label:(0,c.__)("Weeks","tutor"),value:"weeks"},{label:(0,c.__)("Days","tutor"),value:"days"},{label:(0,c.__)("Hours","tutor"),value:"hours"}];var ep=e=>{var{assignmentId:t="",topicId:n,closeModal:a,icon:s,title:l,subtitle:d,contentDripType:v}=e;var p;var{fields:h}=(0,er/* .useCourseBuilderSlot */.l)();var m=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var b=((p=es/* .tutorConfig.settings */.y.settings)===null||p===void 0?void 0:p.chatgpt_enable)==="on";var y=(0,ei/* .useAssignmentDetailsQuery */.T3)(t,n);var w=(0,ei/* .useSaveAssignmentMutation */.CR)(eu);var C=(0,x/* .useQueryClient */.NL)();var{data:E}=y;var W=C.getQueryData(["Topic",eu]);var D=(0,ed/* .useFormWithGlobalError */.O)({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 T=D.formState.dirtyFields&&Object.keys(D.formState.dirtyFields).length>0;var z=D.watch("is_retry_allowed");(0,u.useEffect)(()=>{if(E){var e,t,n;D.reset((0,r._)({title:E.post_title||"",summary:(0,R/* .normalizeLineEndings */.qH)(E.post_content)||"",attachments:E.attachments||[],time_duration:{value:E.assignment_option.time_duration.value||"0",time:E.assignment_option.time_duration.time||"weeks"},deadline_from_start:E.assignment_option.deadline_from_start==="1"?true:false,total_mark:E.assignment_option.total_mark||10,pass_mark:E.assignment_option.pass_mark||5,upload_files_limit:E.assignment_option.upload_files_limit||1,upload_file_size_limit:E.assignment_option.upload_file_size_limit||2,is_retry_allowed:E.assignment_option.is_retry_allowed==="1"?true:false,attempts_allowed:E.assignment_option.attempts_allowed||10,content_drip_settings:{unlock_date:(E===null||E===void 0?void 0:(e=E.content_drip_settings)===null||e===void 0?void 0:e.unlock_date)||"",after_xdays_of_enroll:(E===null||E===void 0?void 0:(t=E.content_drip_settings)===null||t===void 0?void 0:t.after_xdays_of_enroll)||"",prerequisites:(E===null||E===void 0?void 0:(n=E.content_drip_settings)===null||n===void 0?void 0:n.prerequisites)||[]}},Object.fromEntries((0,R/* .findSlotFields */.hk)({fields:h.Curriculum.Lesson}).map(e=>[e,E[e]]))),{keepDirty:false})}var i=setTimeout(()=>{D.setFocus("title")},0);return()=>{clearTimeout(i)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[E]);var P=e=>(0,Z._)(function*(){var r=(0,ei/* .convertAssignmentDataToPayload */.iL)(e,t,n,v,(0,R/* .findSlotFields */.hk)({fields:h.Curriculum.Assignment}));var i=yield w.mutateAsync(r);if(i.status_code===200||i.status_code===201){a({action:"CONFIRM"})}})();return/*#__PURE__*/(0,o/* .jsx */.tZ)(et/* ["default"] */.Z,{onClose:()=>a({action:"CLOSE"}),icon:T?/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"warning",width:24,height:24}):s,title:T?el/* .CURRENT_VIEWPORT.isAboveDesktop */.iM.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":l,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.iM.isAboveSmallMobile?d:"",maxWidth:1070,actions:T&&/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{if(t){D.reset()}else{a({action:"CLOSE"})}},children:t?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-assignment",loading:w.isPending,variant:"primary",size:"small",onClick:D.handleSubmit(P),children:t?(0,c.__)("Update","tutor"):(0,c.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:ef.wrapper,children:/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!y.isLoading,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.assignmentInfo,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"title",control:D.control,rules:(0,r._)({required:(0,c.__)("Assignment title is required","tutor")},(0,ec/* .maxLimitRule */.T9)(255)),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Title","tutor"),placeholder:(0,c.__)("Enter Assignment Title","tutor"),generateWithAi:!m||b,isClearable:true}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"summary",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ee/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Content","tutor"),placeholder:(0,c.__)("Enter Assignment Content","tutor"),generateWithAi:!m||b}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Assignment.after_description",form:D})]})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.rightPanel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"attachments",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(S/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Attachments","tutor"),buttonText:(0,c.__)("Upload Attachment","tutor"),selectMultiple:true}))}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="specific_days",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.after_xdays_of_enroll",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="unlock_by_date",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.unlock_date",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(q/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="after_finishing_prerequisites",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.prerequisites",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(G,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:W.reduce((e,o)=>{if(String(o.id)===String(n)){e.push((0,i._)((0,r._)({},o),{contents:o.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(o)}return e},[])||[],isSearchable:true,helpText:(0,c.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ef.timeLimit,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"time_duration.value",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Time Limit","tutor"),placeholder:"0",dataAttribute:"data-time-limit",selectOnFocus:true}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"time_duration.time",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(I/* ["default"] */.Z,(0,i._)((0,r._)({},e),{options:ev,removeOptionsMinWidth:true,dataAttribute:"data-time-limit-unit"}))})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"deadline_from_start",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"total_mark",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Total Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"pass_mark",control:D.control,rules:{validate:e=>{if(Number(e)>Number(D.getValues("total_mark"))){return(0,c.__)("Pass mark cannot be greater than total mark","tutor")}return true}},render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Minimum Pass Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"upload_files_limit",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"upload_file_size_limit",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"is_retry_allowed",control:D.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Allow Assignment Resubmission","tutor")}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:z,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"attempts_allowed",control:D.control,rules:(0,i._)((0,r._)({},(0,ec/* .requiredRule */.n0)()),{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,o/* .jsx */.tZ)(M/* ["default"] */.Z,(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,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Assignment.bottom_of_sidebar",form:D})]})]})})})};/* ESM default export */const eh=ep;var ef={wrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:0 auto;display:grid;grid-template-columns:1fr 338px;width:100%;height:100%;padding-inline:",P/* .spacing["32"] */.W0["32"],";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{grid-template-columns:1fr;padding-inline:",P/* .spacing["24"] */.W0["24"],";}",P/* .Breakpoint.mobile */.Uo.mobile,"{padding-inline:",P/* .spacing["16"] */.W0["16"],";}"),assignmentInfo:/*#__PURE__*/(0,d/* .css */.iv)("padding-block:",P/* .spacing["24"] */.W0["24"],";padding-right:",P/* .spacing["32"] */.W0["32"],";display:flex;flex-direction:column;gap:",P/* .spacing["24"] */.W0["24"],";position:sticky;top:0;z-index:",P/* .zIndex.positive */.W5.positive,";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{position:unset;padding-right:0;}"),rightPanel:/*#__PURE__*/(0,d/* .css */.iv)("border-left:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";display:flex;flex-direction:column;gap:",P/* .spacing["16"] */.W0["16"],";padding-block:",P/* .spacing["24"] */.W0["24"],";padding-left:",P/* .spacing["32"] */.W0["32"],";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{border-left:none;padding-left:0;}"),timeLimit:/*#__PURE__*/(0,d/* .css */.iv)("display:grid;align-items:end;grid-template-columns:1fr 100px;& input{border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";&[data-time-limit]{border-radius:",P/* .borderRadius["6"] */.E0["6"]," 0 0 ",P/* .borderRadius["6"] */.E0["6"],";border-right:none;&:focus{border-right:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";z-index:",P/* .zIndex.positive */.W5.positive,";}}&[data-time-limit-unit]{border-radius:0 ",P/* .borderRadius["6"] */.E0["6"]," ",P/* .borderRadius["6"] */.E0["6"]," 0;}}"),uploadAttachment:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["8"] */.W0["8"],";"),uploadLabel:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),"    color:",P/* .colorTokens.text.title */.Jv.text.title,";"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;svg{margin-right:",P/* .spacing["4"] */.W0["4"],";color:",P/* .colorTokens.icon.success */.Jv.icon.success,";}")};// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormImageInput.tsx
var eg=n(44226);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var e_=n(69789);// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/Modal.tsx
var em=n(63260);// EXTERNAL MODULE: ./node_modules/date-fns/esm/format/index.js
var eb=n(32449);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Skeleton.tsx
var ey=n(97503);// 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 eZ(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);eZ=function t(){return e};return e}function ex(){var e=(0,b._)(["\n      &:nth-of-type(even) {\n        background-color: ",";\n      }\n    "]);ex=function t(){return e};return e}function ek(){var e=(0,b._)(["\n        background-color: ",";\n      "]);ek=function t(){return e};return e}function eC(){var e=(0,b._)(["\n        background-color: ",";\n      "]);eC=function t(){return e};return e}function eE(){var e=(0,b._)(["\n        :last-of-type {\n          border-bottom: none;\n        }\n      "]);eE=function t(){return e};return e}var eW={bodyRowSelected:P/* .colorTokens.background.active */.Jv.background.active,bodyRowHover:P/* .colorTokens.background.hover */.Jv.background.hover};var eD=e=>{var{columns:t,data:n,entireHeader:r=null,headerHeight:i=60,noHeader:a=false,isStriped:s=false,isRounded:l=false,stripedBySelectedIndex:c=[],colors:u={},isBordered:v=true,loading:p=false,itemsPerPage:h=1,querySortProperties:f,querySortDirections:g={},onSortClick:m,renderInLastRow:b,rowStyle:y,sortIcons:w={asc:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"sortASC",height:16,width:16}),desc:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"sortDESC",height:16,width:16})}}=e;var Z=(e,n)=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("tr",{css:[eq.tableRow({isBordered:v,isStriped:s}),eq.bodyTr({colors:u,isSelected:c.includes(e),isRounded:l}),y],children:t.map((e,t)=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("td",{css:[eq.td,{width:e.width}],children:n(e)},t)})},e)};var x=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,o/* .jsxs */.BX)("button",{type:"button",css:eq.headerWithIcon,onClick:()=>m===null||m===void 0?void 0:m(n),children:[e.Header,t&&t]})};var k=()=>{if(r){return/*#__PURE__*/(0,o/* .jsx */.tZ)("th",{css:eq.th,colSpan:t.length,children:r})}return t.map((e,t)=>{if(e.Header!==null){return/*#__PURE__*/(0,o/* .jsx */.tZ)("th",{css:[eq.th,e.css,{width:e.width}],colSpan:e.headerColSpan,children:x(e)},t)}})};var C=()=>{if(p){return(0,R/* .range */.w6)(h).map(e=>Z(e,()=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ey/* ["default"] */.Z,{animation:true,height:20,width:"".concat((0,R/* .getRandom */.sZ)(40,80),"%")})))}if(!n.length){return/*#__PURE__*/(0,o/* .jsx */.tZ)("tr",{css:eq.tableRow({isBordered:false,isStriped:false}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("td",{colSpan:t.length,css:[eq.td,/*#__PURE__*/(0,d/* .css */.iv)("text-align:center;")],children:"No Data!"})})}var e=n.map((e,t)=>{return Z(t,n=>{return"Cell"in n?n.Cell(e,t):n.accessor(e,t)})});if(b){b=/*#__PURE__*/(0,o/* .jsx */.tZ)("tr",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)("td",{css:eq.td,children:b})},e.length);e.push(b)}return e};return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eq.tableContainer({isRounded:l}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("table",{css:eq.table,children:[!a&&/*#__PURE__*/(0,o/* .jsx */.tZ)("thead",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)("tr",{css:[eq.tableRow({isBordered:v,isStriped:s}),{height:i}],children:k()})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("tbody",{children:C()})]})})};/* ESM default export */const eT=eD;var eq={tableContainer:e=>{var{isRounded:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:block;width:100%;overflow-x:auto;",t&&(0,d/* .css */.iv)(ew(),P/* .colorTokens.stroke.divider */.Jv.stroke.divider,P/* .borderRadius["6"] */.E0["6"]))},headerWithIcon:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";",A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";display:flex;gap:",P/* .spacing["8"] */.W0["8"],";align-items:center;svg{color:",P/* .colorTokens.text.primary */.Jv.text.primary,";}"),table:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;border-collapse:collapse;border:none;"),tableRow:e=>{var{isBordered:t,isStriped:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)(t&&(0,d/* .css */.iv)(eZ(),P/* .colorTokens.stroke.divider */.Jv.stroke.divider)," ",n&&(0,d/* .css */.iv)(ex(),P/* .colorTokens.background.active */.Jv.background.active))},th:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";padding:0 ",P/* .spacing["16"] */.W0["16"],";border:none;"),bodyTr:e=>{var{colors:t,isSelected:n,isRounded:r}=e;var{bodyRowDefault:i,bodyRowSelectedHover:o,bodyRowHover:a=eW.bodyRowHover,bodyRowSelected:s=eW.bodyRowSelected}=t;return/*#__PURE__*/(0,d/* .css */.iv)(i&&(0,d/* .css */.iv)(ek(),i),"      &:hover{background-color:",n&&o?o:a,";}",n&&(0,d/* .css */.iv)(eC(),s)," ",r&&(0,d/* .css */.iv)(eE()))},td:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";padding:",P/* .spacing["16"] */.W0["16"],";border:none;")};// EXTERNAL MODULE: ./assets/react/v3/shared/components/modals/BasicModalWrapper.tsx
var eS=n(22128);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/CheckBox.tsx
var eM=n(69602);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useQuery.js
var eB=n(24333);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/api.ts
var eI=n(82340);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/endpoints.ts
var ez=n(84225);// CONCATENATED MODULE: ./assets/react/v3/shared/services/h5p.ts
var eP=e=>{return eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].GET_H5P_LESSON_CONTENT */.Z.GET_H5P_LESSON_CONTENT,{search_filter:e})};var eA=(e,t)=>{return(0,eB/* .useQuery */.a)({queryKey:["H5PLessonContents",e],queryFn:()=>eP(e).then(e=>e.data),enabled:t==="lesson"})};var eO=e=>{return eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].GET_H5P_QUIZ_CONTENT */.Z.GET_H5P_QUIZ_CONTENT,{search_filter:e})};var eN=(e,t)=>{return(0,eB/* .useQuery */.a)({queryKey:["H5PQuizContents",e],queryFn:()=>eO(e).then(e=>e.data),enabled:t==="tutor_h5p_quiz"})};// CONCATENATED MODULE: ./assets/react/v3/shared/components/modals/H5PContentListModal.tsx
var eJ=e=>{var{title:t,closeModal:n,onAddContent:a,contentType:s,addedContentIds:l=[]}=e;var d=(0,ed/* .useFormWithGlobalError */.O)({defaultValues:{search:""}});var v=(0,L/* .useDebounce */.N)(d.watch("search"),300);var p=eN(v,s);var h=eA(v,s);var[g,m]=(0,u.useState)([]);var b=s==="tutor_h5p_quiz"?p.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,o/* .jsx */.tZ)("div",{"data-index":true,css:eU.tableLabel,children:(y===null||y===void 0?void 0:y.length)?/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{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,o/* .jsx */.tZ)("div",{css:A/* .typography.caption */.c.caption(),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{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,o/* .jsx */.tZ)("div",{css:eU.tableLabel,children:(0,c.__)("Title","tutor")}),Cell:e=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eU.title,children:e.title})}},{Header:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eU.tableLabel,children:(0,c.__)("Content Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:A/* .typography.caption */.c.caption(),children:e.content_type})}},{Header:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eU.tableLabel,children:(0,c.__)("Created At","tutor")}),Cell:e=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:A/* .typography.caption */.c.caption(),children:(0,eb["default"])(new Date(e.updated_at),el/* .DateFormats.yearMonthDayHourMinuteSecond */.E_.yearMonthDayHourMinuteSecond)})}}];return/*#__PURE__*/(0,o/* .jsxs */.BX)(eS/* ["default"] */.Z,{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,o/* .jsx */.tZ)("div",{css:eU.searchWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:d.control,name:"search",render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Search by title","tutor"),showVerticalBar:false,content:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"search",width:24,height:24})}))})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eU.tableWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(eT,{columns:w,data:y||[],loading:p.isLoading||h.isLoading})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y===null||y===void 0?void 0:y.length,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eU.footer,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{size:"small",variant:"text",onClick:()=>n({action:"CLOSE"}),children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{type:"submit",size:"small",variant:"primary",onClick:()=>{a(g);n({action:"CONFIRM"})},disabled:!g.length,children:(0,c.__)("Add","tutor")})]})})]})};/* ESM default export */const eL=eJ;var eU={searchWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;padding:",P/* .spacing["20"] */.W0["20"],";"),tableWrapper:/*#__PURE__*/(0,d/* .css */.iv)("max-height:calc(100vh - 350px);overflow:auto;tr{td:first-of-type{padding-left:",P/* .spacing["20"] */.W0["20"],";}td:last-of-type{padding-right:",P/* .spacing["20"] */.W0["20"],";}}"),tableLabel:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body("medium"),";text-align:left;color:",P/* .colorTokens.text.primary */.Jv.text.primary,";&[data-index]{padding-left:",P/* .spacing["4"] */.W0["4"],";}"),title:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.text.ellipsis */.i.text.ellipsis(2),"    width:100%;text-align:left;",A/* .typography.caption */.c.caption(),";min-width:340px;max-width:400px;"),footer:/*#__PURE__*/(0,d/* .css */.iv)("box-shadow:",P/* .shadow.dividerTop */.AF.dividerTop,";height:56px;display:flex;align-items:center;justify-content:end;gap:",P/* .spacing["16"] */.W0["16"],";padding-inline:",P/* .spacing["16"] */.W0["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useVisibilityControl.tsx
var eR=n(72501);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx
var eX=(0,eo/* .getCourseId */.z)();var eF=e=>{var{lessonId:t="",topicId:n,closeModal:a,icon:s,title:l,subtitle:d,contentDripType:v}=e;var p,h,m,b;var y=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var w=((p=es/* .tutorConfig.settings */.y.settings)===null||p===void 0?void 0:p.chatgpt_enable)==="on";var W=es/* .tutorConfig.enable_lesson_classic_editor */.y.enable_lesson_classic_editor==="1";var D=((h=es/* .tutorConfig.settings */.y.settings)===null||h===void 0?void 0:h.hide_admin_bar_for_users)==="off";var T=(m=es/* .tutorConfig.current_user.roles */.y.current_user.roles)===null||m===void 0?void 0:m.includes(el/* .TutorRoles.ADMINISTRATOR */.er.ADMINISTRATOR);var I=(b=es/* .tutorConfig.current_user.roles */.y.current_user.roles)===null||b===void 0?void 0:b.includes(el/* .TutorRoles.TUTOR_INSTRUCTOR */.er.TUTOR_INSTRUCTOR);var z=W&&(T||I&&D);var P=(0,ei/* .useLessonDetailsQuery */.yO)(t,n);var A=(0,ei/* .useSaveLessonMutation */.G4)(eX);var O=(0,x/* .useQueryClient */.NL)();var{showModal:J}=(0,em/* .useModal */.d)();var{data:L,isLoading:U}=P;var X=O.getQueryData(["Topic",eX]);var{fields:F}=(0,er/* .useCourseBuilderSlot */.l)();var j=(0,eR/* ["default"] */.Z)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME);var Q=(0,eR/* ["default"] */.Z)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW */.j9.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW);var H=(0,eR/* ["default"] */.Z)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.j9.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE);var Y=(0,eR/* ["default"] */.Z)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO);var V=(0,eR/* ["default"] */.Z)(el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES */.j9.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES);var K=(0,ed/* .useFormWithGlobalError */.O)({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 $=K.formState.dirtyFields&&Object.keys(K.formState.dirtyFields).length>0;var eo=Boolean(v!==""||j||H||Y||V||(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_COURSE_PREVIEW */.AO.TUTOR_COURSE_PREVIEW)&&Q);(0,u.useEffect)(()=>{if(L&&!U){var e,t,n,i,o,a;K.reset((0,r._)({title:L.post_title||"",description:(0,R/* .normalizeLineEndings */.qH)(L.post_content)||"",thumbnail:{id:L.thumbnail_id?Number(L.thumbnail_id):0,title:"",url:L.thumbnail||""},tutor_attachments:L.attachments||[],lesson_preview:L.is_preview||false,video:L.video||null,duration:{hour:((e=L.video.runtime)===null||e===void 0?void 0:e.hours)||0,minute:((t=L.video.runtime)===null||t===void 0?void 0:t.minutes)||0,second:((n=L.video.runtime)===null||n===void 0?void 0:n.seconds)||0},content_drip_settings:{unlock_date:(L===null||L===void 0?void 0:(i=L.content_drip_settings)===null||i===void 0?void 0:i.unlock_date)||"",after_xdays_of_enroll:(L===null||L===void 0?void 0:(o=L.content_drip_settings)===null||o===void 0?void 0:o.after_xdays_of_enroll)||"",prerequisites:(L===null||L===void 0?void 0:(a=L.content_drip_settings)===null||a===void 0?void 0:a.prerequisites)||[]}},Object.fromEntries((0,R/* .findSlotFields */.hk)({fields:F.Curriculum.Lesson}).map(e=>[e,L[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(()=>{K.setFocus("title")},0);return()=>{clearTimeout(d)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[L,U]);var eu=e=>(0,Z._)(function*(){var r=(0,ei/* .convertLessonDataToPayload */.SF)(e,t,n,v,(0,R/* .findSlotFields */.hk)({fields:F.Curriculum.Lesson}));var i=yield A.mutateAsync(r);if(i.data){a({action:"CONFIRM"})}})();var ev=()=>{var e=K.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);K.setValue("description","".concat(e,"\n").concat(r.join("\n")),{shouldDirty:true})};J({component:eL,props:{title:(0,c.__)("Select H5P Content","tutor"),onAddContent:r,contentType:"lesson",addedContentIds:n}})};return/*#__PURE__*/(0,o/* .jsx */.tZ)(et/* ["default"] */.Z,{onClose:()=>a({action:"CLOSE"}),icon:$?/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"warning",width:24,height:24}):s,title:$?el/* .CURRENT_VIEWPORT.isAboveDesktop */.iM.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":l,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.iM.isAboveSmallMobile?d:"",maxWidth:1070,actions:$&&/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{if(t){K.reset()}else{a({action:"CLOSE"})}},children:t?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-lesson",loading:A.isPending,variant:"primary",size:"small",onClick:K.handleSubmit(eu),children:t?(0,c.__)("Update","tutor"):(0,c.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eQ.wrapper({hasRightSidebar:eo}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!P.isLoading,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.lessonInfo({hasRightSidebar:eo}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"title",control:K.control,rules:(0,r._)({required:(0,c.__)("Lesson title is required.","tutor")},(0,ec/* .maxLimitRule */.T9)(255)),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Name","tutor"),placeholder:(0,c.__)("Enter Lesson Name","tutor"),generateWithAi:!y||w,isClearable:true}))}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.description,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"description",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ee/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.descriptionLabel,children:[(0,c.__)("Content","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:z,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Save the lesson first to use the WP Editor.","tutor"),delay:200,disabled:!!t,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{window.open("".concat(es/* .tutorConfig.site_url */.y.site_url,"/wp-admin/post.php?post=").concat(t,"&action=edit"),"_blank","noopener")},icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24}),buttonCss:eQ.wpEditorButton,disabled:!t,children:(0,c.__)("WP Editor","tutor")})})})]}),placeholder:(0,c.__)("Enter Lesson Description","tutor"),generateWithAi:!y||w}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y&&(0,R/* .isAddonEnabled */.ro)(el/* .Addons.H5P_INTEGRATION */.AO.H5P_INTEGRATION),fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!y,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{css:eQ.addH5PContentButton({isPro:false}),type:"reset",className:"add-h5p-content-button",disabled:true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-button-text":true,children:(0,c.__)("Add H5P Content","tutor")})})})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{className:"add-h5p-content-button",css:eQ.addH5PContentButton,type:"button",onClick:ev,children:(0,c.__)("Add H5P Content","tutor")})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Lesson.after_description",form:K})]})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.rightPanel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"thumbnail",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(eg/* ["default"] */.Z,(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,R/* .formatBytes */.td)(Number((es/* .tutorConfig */.y===null||es/* .tutorConfig */.y===void 0?void 0:es/* .tutorConfig.max_upload_size */.y.max_upload_size)||0))),visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.j9.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"video",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(e_/* ["default"] */.Z,(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,R/* .formatBytes */.td)(Number((es/* .tutorConfig */.y===null||es/* .tutorConfig */.y===void 0?void 0:es/* .tutorConfig.max_upload_size */.y.max_upload_size)||0))),onGetDuration:e=>{K.setValue("duration.hour",e.hours);K.setValue("duration.minute",e.minutes);K.setValue("duration.second",e.seconds)},visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:j,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.durationWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:eQ.additionLabel,children:(0,c.__)("Video Playback Time","tutor")}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.duration,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"duration.hour",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:eQ.durationContent,children:(0,c.__)("hour","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"duration.minute",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:eQ.durationContent,children:(0,c.__)("min","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"duration.second",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:eQ.durationContent,children:(0,c.__)("sec","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:el/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.j9.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))})]})]})}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="specific_days",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.after_xdays_of_enroll",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="unlock_by_date",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.unlock_date",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(q/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v==="after_finishing_prerequisites",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"content_drip_settings.prerequisites",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(G,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:X.reduce((e,o)=>{if(String(o.id)===String(n)){e.push((0,i._)((0,r._)({},o),{contents:o.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(o)}return e},[])||[],isSearchable:true,helpText:(0,c.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"tutor_attachments",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(S/* ["default"] */.Z,(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 */.j9.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!y||Q&&(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_COURSE_PREVIEW */.AO.TUTOR_COURSE_PREVIEW),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.lessonPreview,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"lesson_preview",control:K.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},e),{disabled:!y,label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:eQ.previewLabel,children:[(0,c.__)("Lesson Preview","tutor"),!y&&/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{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 */.j9.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:K.watch("lesson_preview"),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:eQ.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,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Lesson.bottom_of_sidebar",form:K})]})]})})})};/* ESM default export */const ej=eF;var eQ={wrapper:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,d/* .css */.iv)("margin:0 auto;display:grid;grid-template-columns:",t?"1fr 338px":"1fr",";height:100%;width:100%;padding-inline:",P/* .spacing["32"] */.W0["32"],";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{grid-template-columns:1fr;padding-inline:",P/* .spacing["24"] */.W0["24"],";}",P/* .Breakpoint.mobile */.Uo.mobile,"{padding-inline:",P/* .spacing["16"] */.W0["16"],";}")},lessonInfo:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,d/* .css */.iv)("padding-block:",P/* .spacing["20"] */.W0["20"],";padding-right:",t&&P/* .spacing["32"] */.W0["32"],";display:flex;flex-direction:column;gap:",P/* .spacing["24"] */.W0["24"],";position:sticky;top:0;z-index:",P/* .zIndex.positive */.W5.positive,";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{position:unset;padding-right:0;}")},description:/*#__PURE__*/(0,d/* .css */.iv)("position:relative;"),descriptionLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;justify-content:space-between;height:32px;"),addH5PContentButton:e=>{var{isPro:t=true}=e;return/*#__PURE__*/(0,d/* .css */.iv)("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]{",U/* .styleUtils.flexCenter */.i.flexCenter(),";padding:0 10px;}:hover:not(:disabled){background:",P/* .colorTokens.background.white */.Jv.background.white,";color:#3e64de;}:disabled{cursor:not-allowed;position:relative;top:auto;left:auto;opacity:0.5;}")},rightPanel:/*#__PURE__*/(0,d/* .css */.iv)("border-left:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";display:flex;flex-direction:column;gap:",P/* .spacing["16"] */.W0["16"],";padding-block:",P/* .spacing["20"] */.W0["20"],";padding-left:",P/* .spacing["32"] */.W0["32"],";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{border-left:none;padding-left:0;}"),durationWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["8"] */.W0["8"],";"),duration:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";"),durationContent:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";"),additionLabel:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),"    color:",P/* .colorTokens.text.title */.Jv.text.title,";"),lessonPreview:/*#__PURE__*/(0,d/* .css */.iv)("background-color:",P/* .colorTokens.background.white */.Jv.background.white,";padding:",P/* .spacing["12"] */.W0["12"],";border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",P/* .borderRadius["8"] */.E0["8"],";"),previewLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;svg{margin-right:",P/* .spacing["4"] */.W0["4"],";color:",P/* .colorTokens.icon.success */.Jv.icon.success,";}"),previewInfo:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(),";text-align:center;color:",P/* .colorTokens.text.title */.Jv.text.title,";padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["24"] */.W0["24"],";background:",P/* .colorTokens.background.status.success */.Jv.background.status.success,";border-radius:",P/* .borderRadius["4"] */.E0["4"],";margin-top:",P/* .spacing["12"] */.W0["12"],";"),wpEditorButton:/*#__PURE__*/(0,d/* .css */.iv)("margin-left:",P/* .spacing["4"] */.W0["4"],";color:",P/* .colorTokens.text.brand */.Jv.text.brand,";svg{color:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}&:hover:not(:disabled){text-decoration:underline;}")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Toast.tsx
var eH=n(13985);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var eY=n(3473);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Tabs.tsx
var eV=n(63189);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/contexts/QuizModalContext.tsx
var eK=/*#__PURE__*/(0,u.createContext)(null);var eG=()=>{var e=(0,u.useContext)(eK);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[a,s]=(0,u.useState)("");var l=(0,k/* .useFormContext */.Gc)();var d=l.watch("questions")||[];var c=(0,u.useRef)(d);var[v,p]=(0,u.useState)(i||null);var h=d.findIndex(e=>e.question_id===a);(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&&a){s("")}},[h,a]);return/*#__PURE__*/(0,o/* .jsx */.tZ)(eK.Provider,{value:{activeQuestionIndex:h,activeQuestionId:a,setActiveQuestionId:s,quizId:n,validationError:v,setValidationError:p,contentType:r},children:typeof t==="function"?t({activeQuestionIndex:h,activeQuestionId:a,setActiveQuestionId:s,setValidationError:p}):t})};// EXTERNAL MODULE: ./assets/react/v3/shared/utils/types.ts
var e0=n(22456);// CONCATENATED MODULE: ./assets/react/v3/shared/utils/quiz.ts
var e1=(e,t)=>{if(t===e){return null}if(e===e0/* .QuizDataStatus.NEW */.dP.NEW){return e0/* .QuizDataStatus.NEW */.dP.NEW}if((e===e0/* .QuizDataStatus.UPDATE */.dP.UPDATE||e===e0/* .QuizDataStatus.NO_CHANGE */.dP.NO_CHANGE)&&t===e0/* .QuizDataStatus.UPDATE */.dP.UPDATE){return e0/* .QuizDataStatus.UPDATE */.dP.UPDATE}return e0/* .QuizDataStatus.NO_CHANGE */.dP.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 o=e.question_settings.is_image_matching;var a=n.every(e=>e.answer_title);if(!a){return{message:(0,c.__)("Please add titles to all options.","tutor"),type:"save_option"}}if(o){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 */.dP.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.dP.UPDATE}return e.answer_view_format==="text"?e0/* .QuizDataStatus.NO_CHANGE */.dP.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.dP.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,R/* .normalizeLineEndings */.qH)(e.question_description)||"";e.answer_explanation=e.answer_explanation==='<p><br data-mce-bogus="1"></p>'?"":(0,R/* .normalizeLineEndings */.qH)(e.answer_explanation)||"";switch(e.question_type){case"single_choice":{return(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.dP.UPDATE,question_type:"multiple_choice",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.dP.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 */.dP.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.dP.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 */.dP.NO_CHANGE:e0/* .QuizDataStatus.UPDATE */.dP.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 */.dP.UPDATE,question_type:"matching",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.UPDATE */.dP.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 */.dP.NO_CHANGE})}};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionConditions.tsx
var e8={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 e3=["multiple_choice","matching","image_answering"];var e5=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,setValidationError:a}=eG();var s=(0,k/* .useFormContext */.Gc)();var l=s.watch("questions.".concat(e,".question_type"));var u=s.watch("questions.".concat(e,"._data_status"));if(!t){return/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{css:e9.emptyQuestions,children:(0,c.__)("Create/Select a question to view details","tutor")})}return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:e9.questionTypeWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:A/* .typography.caption */.c.caption("medium"),children:(0,c.__)("Question Type","tutor")}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:e9.questionType,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:l?e8[l].icon:"quizTrueFalse",width:32,height:32}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:l?e8[l].label:""})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:e9.conditions,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{children:(0,c.__)("Conditions:","tutor")}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:e9.conditionControls,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:l==="multiple_choice",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.has_multiple_correct_answer"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Multiple Correct Answer","tutor"),onChange:t=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:l==="matching",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.is_image_matching"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Image Matching","tutor"),onChange:t=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}if((n===null||n===void 0?void 0:n.type)==="question"&&!t){a(null)}}}))})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.answer_required"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Answer Required","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:e3.includes(l),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.randomize_question"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Randomize Choice","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.question_mark"),rules:{min:0},render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Point For This Question","tutor"),type:"number",isInlineLabel:true,placeholder:"0",style:/*#__PURE__*/(0,d/* .css */.iv)("max-width:80px;"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:s.control,name:"questions.".concat(e,".question_settings.show_question_mark"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},t),{label:(0,c.__)("Display Points","tutor"),onChange:()=>{if(e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){s.setValue("questions.".concat(e,"._data_status"),e1(u,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Quiz.bottom_of_question_sidebar",namePrefix:"questions.".concat(e,"."),form:s})]})]})]},"".concat(t,"-").concat(e))};/* ESM default export */const e6=e5;var e9={emptyQuestions:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["24"] */.W0["24"]," ",P/* .spacing["24"] */.W0["24"],";",A/* .typography.caption */.c.caption("medium"),";"),questionTypeWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["24"] */.W0["24"]," ",P/* .spacing["24"] */.W0["24"],";gap:",P/* .spacing["10"] */.W0["10"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),questionType:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["10"] */.W0["10"],";"),conditions:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["24"] */.W0["24"]," ",P/* .spacing["24"] */.W0["24"],";p{",A/* .typography.body */.c.body("medium"),";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";}"),conditionControls:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["16"] */.W0["16"],";margin-top:",P/* .spacing["16"] */.W0["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Alert.tsx
var e7=n(87056);// 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 to(){var e=(0,b._)(["\n      opacity: 1;\n    "]);to=function t(){return e};return e}var ta=e=>{var{label:t,field:n,fieldState:r,disabled:i,loading:a,placeholder:s,helpText:l,onChange:d}=e;var v;var p=(v=n.value)!==null&&v!==void 0?v:"";var[h,g]=(0,u.useState)(false);var[_,m]=(0,u.useState)(p);return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tl.wrapper({hasValue:!!p&&!h}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:h||p,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("label",{css:tl.answerLabel,children:t})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tl.editorWrapper({isEdit:h}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tl.container({isEdit:h||!!p}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!p&&!h,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(ee/* ["default"] */.Z,{field:n,fieldState:r,disabled:i,helpText:l,loading:a,readOnly:!h,onChange:d,placeholder:s,autoFocus:true,isMinimal:true}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tl.placeholder,children:s})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:h,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{"data-action-buttons":true,css:tl.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{n.onChange(_);g(false)},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!h,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("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"})})]})})]})};/* ESM default export */const ts=ta;var tl={wrapper:e=>{var{hasValue:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["10"] */.W0["10"],";border-radius:",P/* .borderRadius.card */.E0.card,";",t&&(0,d/* .css */.iv)(te(),P/* .colorTokens.color.success["30"] */.Jv.color.success["30"],P/* .spacing["12"] */.W0["12"],P/* .spacing["24"] */.W0["24"],P/* .colorTokens.color.success["40"] */.Jv.color.success["40"]))},editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;max-height:400px;overflow-y:scroll;",t&&(0,d/* .css */.iv)(tt()))},container:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;display:flex;flex-direction:column;gap:",P/* .spacing["16"] */.W0["16"],";min-height:48px;height:100%;width:100%;inset:0;border-radius:",P/* .borderRadius["6"] */.E0["6"],";transition:background 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;:focus-visible{outline:2px solid ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:-2px;border-radius:",P/* .borderRadius.card */.E0.card,";}}& label{",A/* .typography.caption */.c.caption(),"      margin-bottom:",P/* .spacing["6"] */.W0["6"],";color:",P/* .colorTokens.text.title */.Jv.text.title,";}",t&&(0,d/* .css */.iv)(tn()),"    &:hover{background-color:",P/* .colorTokens.background.white */.Jv.background.white,";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";cursor:text;[data-action-buttons]{opacity:1;}",t&&(0,d/* .css */.iv)(tr()),"}")},inputContainer:e=>/*#__PURE__*/(0,d/* .css */.iv)("position:relative;display:flex;& textarea{",A/* .typography.caption */.c.caption(),"      color:",P/* .colorTokens.text.title */.Jv.text.title,";height:auto;padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["12"] */.W0["12"],";resize:none;",e&&(0,d/* .css */.iv)(ti()),"}"),clearButton:/*#__PURE__*/(0,d/* .css */.iv)("position:absolute;right:",P/* .spacing["2"] */.W0["2"],";top:",P/* .spacing["2"] */.W0["2"],";width:36px;height:36px;border-radius:",P/* .borderRadius["2"] */.E0["2"],";background:transparent;button{padding:",P/* .spacing["10"] */.W0["10"],";}"),placeholder:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["24"] */.W0["24"],";",A/* .typography.caption */.c.caption(),"    color:",P/* .colorTokens.text.hints */.Jv.text.hints,";display:flex;align-items:center;height:100%;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.iv)(to()))},answer:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["24"] */.W0["24"],";border-radius:",P/* .borderRadius.card */.E0.card,";display:flex;flex-direction:column;gap:",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.success.fill30 */.Jv.background.success.fill30,";color:",P/* .colorTokens.text.title */.Jv.text.title,";transition:background 0.15s ease-in-out;&:hover{background-color:",P/* .colorTokens.background.success.fill40 */.Jv.background.success.fill40,";}"),answerLabel:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),"    color:",P/* .colorTokens.text.title */.Jv.text.title,";"),answerParagraph:/*#__PURE__*/(0,d/* .css */.iv)("pre{",U/* .styleUtils.overflowXAuto */.i.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 tv(){var e=(0,b._)(["\n      opacity: 1;\n    "]);tv=function t(){return e};return e}var tp=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var th=e=>{var{label:t,field:n,fieldState:r,disabled:i=false,loading:a,placeholder:s,helpText:l,onChange:d}=e;var v;var p=(v=n.value)!==null&&v!==void 0?v:"";var[h,g]=(0,u.useState)(false);var[_,m]=(0,u.useState)(p);var b=()=>{n.onChange(_);g(false)};var y=()=>{g(false);m(n.value||"")};var w=()=>{if(!h&&!i){g(true)}};var Z=e=>{if((e.key==="Enter"||e.key===" ")&&!h){e.preventDefault();g(true)}};return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tg.editorWrapper({isEdit:h}),tabIndex:-1,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tg.container({isEdit:h,isDisabled:i}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!h&&(!tp||!p),fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tg.editorContainer,"aria-hidden":!h,// @ts-ignore
inert:!h?"":undefined,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:tp,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(eY/* ["default"] */.Z,{field:n,fieldState:r,label:t,disabled:i,helpText:l,loading:a,readOnly:!h,onChange:d,placeholder:s,autoResize:true,maxHeight:400}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(ee/* ["default"] */.Z,{field:n,fieldState:r,label:t,disabled:i,helpText:l,loading:a,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(tp?" 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,o/* .jsx */.tZ)("div",{css:tg.placeholder,dangerouslySetInnerHTML:{__html:p||s||""},tabIndex:-1,"aria-hidden":"true"})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:h,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{"data-action-buttons":true,css:tg.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:b,children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:y,disabled:p===_,children:(0,c.__)("Ok","tutor")})]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!h,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{onClick:w,onKeyDown:Z,"data-overlay":true,tabIndex:0,role:"button","aria-label":p?(0,c.__)("Edit description","tutor"):(0,c.__)("Add description","tutor")})})]})})};/* ESM default export */const tf=th;var tg={editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;max-height:400px;overflow-y:auto;border-radius:",P/* .borderRadius["6"] */.E0["6"],";",t&&(0,d/* .css */.iv)(td()))},container:e=>{var{isEdit:t,isDisabled:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;display:flex;flex-direction:column;gap:",P/* .spacing["16"] */.W0["16"],";min-height:64px;height:100%;width:100%;inset:0;padding-inline:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"],";border-radius:",P/* .borderRadius["6"] */.E0["6"],";transition:background-color 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;cursor:pointer;&:focus-visible{outline:2px solid ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:-2px;border-radius:",P/* .borderRadius.card */.E0.card,";}}& label{",A/* .typography.caption */.c.caption(),";margin-bottom:",P/* .spacing["6"] */.W0["6"],";color:",P/* .colorTokens.text.title */.Jv.text.title,";}",!n&&(0,d/* .css */.iv)(tc(),!t&&P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.text.subdued */.Jv.text.subdued)," ",t&&(0,d/* .css */.iv)(tu()))},editorContainer:/*#__PURE__*/(0,d/* .css */.iv)("position:relative;width:100%;"),placeholder:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),"    color:",P/* .colorTokens.text.hints */.Jv.text.hints,";height:100%;inset:0;padding-block:",P/* .spacing["8"] */.W0["8"],";overflow-x:hidden;pointer-events:none;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.iv)(tv()))}};// 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 tZ(){var e=(0,b._)(["\n      opacity: 1;\n    "]);tZ=function t(){return e};return e}var tx=e=>{var{maxLimit:t,maxHeight:n,field:a,fieldState:s,disabled:l,readOnly:d,loading:v,placeholder:p,helpText:h,onChange:g,onKeyDown:m,isHidden:b,isSecondary:y=false,removeBorder:w,dataAttribute:Z,isInlineLabel:x=false,style:k,wrapperCss:C,selectOnFocus:E=false,size:W="regular",isEdit:D,onToggleEdit:T}=e;var q;var S=(q=a.value)!==null&&q!==void 0?q:"";var M=(0,u.useRef)(null);var B=(0,e0/* .isDefined */.$K)(D);var[I,z]=(0,u.useState)(!S?true:false);var P=B?D:I;var[A,O]=(0,u.useState)(S);var J=undefined;if(t){J={maxLimit:t,inputCharacter:S.toString().length}}var L=(0,r._)({},(0,e0/* .isDefined */.$K)(Z)&&{[Z]:true});(0,u.useEffect)(()=>{if(P&&M.current){M.current.focus();O(S)}F();// eslint-disable-next-line react-hooks/exhaustive-deps
},[P]);var U=e=>{if(!B){z(e)}T===null||T===void 0?void 0:T(e)};var R=()=>{U(false)};var X=()=>{a.onChange(A);U(false)};var F=()=>{if(M.current){var e=M.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,o/* .jsx */.tZ)(j/* ["default"] */.Z,{field:a,fieldState:s,disabled:l,readOnly:d,loading:v,helpText:h,isHidden:b,characterCount:J,isSecondary:y,removeBorder:w,isInlineLabel:x,inputStyle:k,children:e=>{return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{role:"button",css:[tC.container({isEdit:P,isDisabled:l||false,size:W}),C],"aria-label":(0,c.__)("Question title field","tutor"),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!P,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-placeholder":true,css:tC.placeholder({size:W}),onClick:()=>!l&&U(true),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){U(true)}},children:a.value||p})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:P,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tC.inputContainer({hasValueChanged:!!A&&a.value!==A,size:W}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("textarea",(0,i._)((0,r._)({},a,e,L),{className:"tutor-input-field",rows:2,ref:e=>{a.ref(e);// @ts-ignore
M.current=e;// this is not ideal but it is the only way to set ref to the input element
},value:S,placeholder:p,onChange:e=>{var{value:t}=e.target;a.onChange(t);if(g){g(t)}},onKeyDown:e=>{if(e.key==="Enter"&&(e.ctrlKey||e.metaKey)){e.preventDefault();R()}else if(e.key==="Escape"){e.preventDefault();X()}m===null||m===void 0?void 0:m(e.key)},onInput:F,onPaste:F,onFocus:e=>{if(E){e.target.select()}},autoComplete:"off"}))})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-action-buttons":true,css:tC.actionButtonWrapper({isEdit:P}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:P,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{buttonCss:tC.actionButton,variant:"text",size:"small",onClick:()=>U(true),"aria-label":(0,c.__)("Edit question title","tutor"),"data-question-title-edit-button":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",height:24,width:24})}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a.value!==A&&a.value,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{buttonCss:tC.actionButton,variant:"text",size:"small",onClick:R,disabled:a.value===A,"aria-label":(0,c.__)("Save question title","tutor"),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"checkMark",height:24,width:24})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!!S&&A,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{buttonCss:tC.actionButton,variant:"text",size:"small",onClick:X,"aria-label":(0,c.__)("Cancel question title","tutor"),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"lineCross",height:24,width:24})})})]})})})]})}})};/* ESM default export */const tk=tx;var tC={container:e=>{var{isEdit:t,isDisabled:n,size:r}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:grid;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";grid-template-columns:1fr auto;min-height:50px;padding-inline:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"],";padding-block:",P/* .spacing["8"] */.W0["8"],";border-radius:",P/* .borderRadius["6"] */.E0["6"],";",r==="small"&&(0,d/* .css */.iv)(t_(),P/* .spacing["4"] */.W0["4"],P/* .spacing["8"] */.W0["8"],P/* .borderRadius["4"] */.E0["4"])," ",!n&&(0,d/* .css */.iv)(tm(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.text.subdued */.Jv.text.subdued,!n?1:0)," ",t&&(0,d/* .css */.iv)(tb(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.text.subdued */.Jv.text.subdued)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-action-buttons]{opacity:1;}}")},inputContainer:e=>{var{hasValueChanged:t,size:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:relative;display:flex;transition:background 0.15s ease-in-out;& textarea{",A/* .typography.heading6 */.c.heading6(),"      color:",P/* .colorTokens.text.primary */.Jv.text.primary,";border:none;background:none;padding:0;width:100%;padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";&.tutor-input-field{padding-right:",t?P/* .spacing["64"] */.W0["64"]:P/* .spacing["32"] */.W0["32"],";}",n==="small"&&(0,d/* .css */.iv)(ty(),A/* .typography.caption */.c.caption()),"}")},placeholder:e=>{var{size:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.heading6 */.c.heading6(),"    color:",P/* .colorTokens.text.hints */.Jv.text.hints,";border-radius:",P/* .borderRadius["6"] */.E0["6"],";",t==="small"&&(0,d/* .css */.iv)(tw(),A/* .typography.caption */.c.caption(),P/* .spacing["4"] */.W0["4"],P/* .spacing["8"] */.W0["8"],P/* .borderRadius["4"] */.E0["4"]))},actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("position:",t?"absolute":"static",";height:100%;right:",P/* .spacing["4"] */.W0["4"],";top:0;display:flex;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,d/* .css */.iv)(tZ()))},actionButton:/*#__PURE__*/(0,d/* .css */.iv)("padding:0;color:",P/* .colorTokens.icon.subdued */.Jv.icon.subdued,";")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx
function tE(){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    "]);tE=function t(){return e};return e}function tW(){var e=(0,b._)(["\n      color: ",";\n    "]);tW=function t(){return e};return e}function tD(){var e=(0,b._)(["\n      color: ",";\n\n      span {\n        color: ",";\n      }\n    "]);tD=function t(){return e};return e}var tT=e=>{var{field:t,questionId:n,validationError:a,setValidationError:s}=e;var l,d,v,p;var h;var g=(h=t.value)!==null&&h!==void 0?h:{_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:false,answer_id:(0,R/* .nanoid */.x0)(),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[x,k]=(0,u.useState)(g);var C=((v=g.answer_title)===null||v===void 0?void 0:(d=v.match(/{dash}/g))===null||d===void 0?void 0:d.length)||0;var W=((p=g.answer_two_gap_match)===null||p===void 0?void 0:p.split("|").length)||0;var D=!!(g.answer_title&&g.answer_two_gap_match&&C!==W);(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(m.current)&&y){m.current.focus()}},[y]);return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.option,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.optionLabel({isEditing:y}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.optionHeader,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.optionTitle,children:(0,c.__)("Fill in the blanks","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:g.is_saved&&!y,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.optionActions,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();w(true)},"data-visually-hidden":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})})})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.optionBody,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!g.is_saved||y,fallback:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.placeholderWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.optionPlaceholder({isTitle:!!g.answer_title}),children:g.answer_title?g.answer_title.replace(/{dash}/g,"_____"):(0,c.__)("Question title...","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tS.optionPlaceholder({isCorrectAnswer:b===null||b===void 0?void 0:b.length}),children:b&&b.length>0?/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:b,children:(e,t)=>/*#__PURE__*/(0,o/* .jsxs */.BX)(u.Fragment,{children:[e,/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t<(b?b.length-1:0),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:"|"})})]},t)}):(0,c.__)("Correct Answer(s)...","tutor")})]}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.optionInputWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.inputWithHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("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 */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,Z._)(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 */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}));w(false)}})()})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.inputHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"info",height:20,width:20}),/*#__PURE__*/(0,o/* .jsx */.tZ)("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,o/* .jsxs */.BX)("div",{css:tS.inputWithHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("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 */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>(0,Z._)(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 */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE),is_saved:true}));if((a===null||a===void 0?void 0:a.type)==="save_option"){s===null||s===void 0?void 0:s(null)}w(false)}})()})),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:D,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.errorMessage,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"info",height:20,width:20}),/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{children:(0,c.__)("Match the number of answers to the number of blanks {dash} in your question.","tutor")})]})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tS.inputHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"info",height:20,width:20}),/*#__PURE__*/(0,o/* .jsx */.tZ)("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,o/* .jsxs */.BX)("div",{css:tS.optionInputButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:g.is_saved,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();w(false);t.onChange(x)},children:(0,c.__)("Cancel","tutor")})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:e=>(0,Z._)(function*(){e.stopPropagation();if(D){return}t.onChange((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE),is_saved:true}));k((0,r._)({},g,e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(g._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE),is_saved:true}));if((a===null||a===void 0?void 0:a.type)==="save_option"){s===null||s===void 0?void 0:s(null)}w(false)})(),disabled:!g.answer_title||!g.answer_two_gap_match||D,children:(0,c.__)("Ok","tutor")})]})]})})})]})})};/* ESM default export */const tq=tT;var tS={option:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["12"] */.W0["12"],";width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";transition:box-shadow 0.15s ease-in-out;background-color:",P/* .colorTokens.background.white */.Jv.background.white,";[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(tE(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.stroke.brand */.Jv.stroke.brand,P/* .colorTokens.stroke.brand */.Jv.stroke.brand))},optionHeader:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:space-between;align-items:center;"),optionTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption("medium"),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";"),optionActions:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;gap:",P/* .spacing["8"] */.W0["8"],";align-items:center;"),actionButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";display:flex;cursor:pointer;"),optionBody:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;"),optionInputWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.optionInputWrapper */.i.optionInputWrapper,";gap:",P/* .spacing["16"] */.W0["16"],";"),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;"),optionPlaceholder:e=>{var{isTitle:t,isCorrectAnswer:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding-block:",P/* .spacing["4"] */.W0["4"],";display:flex;align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";",t&&(0,d/* .css */.iv)(tW(),P/* .colorTokens.text.hints */.Jv.text.hints)," ",n&&(0,d/* .css */.iv)(tD(),P/* .colorTokens.text.success */.Jv.text.success,P/* .colorTokens.stroke.border */.Jv.stroke.border))},inputWithHints:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["8"] */.W0["8"],";"),inputHints:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;gap:",P/* .spacing["4"] */.W0["4"],";",A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),errorMessage:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;gap:",P/* .spacing["4"] */.W0["4"],";",A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.error */.Jv.text.error,";align-items:flex-start;color:",P/* .colorTokens.text.error */.Jv.text.error,";svg{flex-shrink:0;color:",P/* .colorTokens.icon.error */.Jv.icon.error,";}"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/FillinTheBlanks.tsx
var tM=()=>{var e=(0,k/* .useFormContext */.Gc)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:a,setValidationError:s}=eG();var{fields:l}=(0,k/* .useFieldArray */.Dq)({control:e.control,name:"questions.".concat(n,".question_answers")});return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tI.optionWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(tq,(0,i._)((0,r._)({},e),{questionId:t,validationError:a,setValidationError:s}))},l.length?JSON.stringify(l[0]):"")})};/* ESM default export */const tB=tM;var tI={optionWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";padding-left:",P/* .spacing["40"] */.W0["40"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ImageInput.tsx
var tz=n(30647);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useWpMedia.ts
var tP=n(43372);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/dndkit.ts
var tA=n(28089);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx
function tO(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);tO=function t(){return e};return e}function tN(){var e=(0,b._)(["\n      background-color: ",";\n    "]);tN=function t(){return e};return e}function tJ(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);tJ=function t(){return e};return e}var tL=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var tU=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:a,field:s,isOverlay:d=false,questionId:v,validationError:p,setValidationError:h}=e;var g;var m=(g=s.value)!==null&&g!==void 0?g:{answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:v,belongs_question_type:"image_answering"};var b=(0,u.useRef)(null);var[w,x]=(0,u.useState)(!m.answer_title&&!m.image_id&&!m.image_url);var[k,W]=(0,u.useState)(m);var{attributes:D,listeners:T,setNodeRef:q,transform:S,transition:M,isDragging:B}=(0,l/* .useSortable */.nB)({id:s.value.answer_id||0,animateLayoutChanges:tA/* .animateLayoutChanges */.h});var{openMediaLibrary:I,resetFiles:z}=(0,tP/* ["default"] */.Z)({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 */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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 A={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(S),transition:M,opacity:B?.3:undefined};var O=()=>{s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{image_id:"",image_url:""}));z()};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(b.current)&&w){b.current.focus()}},[w]);return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",(0,i._)((0,r._)({},D),{css:tX.option,ref:q,style:A,tabIndex:-1,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.optionLabel({isEditing:w,isOverlay:d,isDragging:B}),onClick:()=>{x(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){x(true)}},children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.optionHeader,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:U/* .styleUtils.optionCounter */.i.optionCounter({isEditing:w}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!w&&m.is_saved,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({},T),{type:"button",css:U/* .styleUtils.optionDragButton */.i.optionDragButton({isOverlay:d}),"data-visually-hidden":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();x(true)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!tL,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();n(m)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{disabled:true,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tX.optionBody,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w,fallback:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.placeholderWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:m.image_url,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tX.imagePlaceholder,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tX.imagePlaceholder,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("img",{src:m.image_url,alt:m.image_url})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:tX.optionPlaceholder,children:m.answer_title||(0,c.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:U/* .styleUtils.optionInputWrapper */.i.optionInputWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(tz/* ["default"] */.Z,{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:I,clearHandler:O,emptyImageCss:tX.emptyImageInput,previewImageCss:tX.previewImageInput}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.inputWithHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("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 */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,Z._)(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 */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE),is_saved:true}));if((p===null||p===void 0?void 0:p.type)==="save_option"){h===null||h===void 0?void 0:h(null)}x(false)}})()})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.inputHints,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"info",height:20,width:20}),/*#__PURE__*/(0,o/* .jsxs */.BX)("p",{children:[(0,c.__)("Students need to type their answers exactly as you write them here. Use ","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:{fontWeight:P/* .fontWeight.semiBold */.Ue.semiBold},children:(0,c.__)("small caps","tutor")}),(0,c.__)(" when writing the answer.","tutor")]})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tX.optionInputButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();x(false);s.onChange(k);if(!m.is_saved){a();if((p===null||p===void 0?void 0:p.type)==="save_option"){h===null||h===void 0?void 0:h(null)}}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:e=>(0,Z._)(function*(){e.stopPropagation();s.onChange((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_saved:true}));W((0,i._)((0,r._)({},m,e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(m._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_saved:true}));if((p===null||p===void 0?void 0:p.type)==="save_option"){h===null||h===void 0?void 0:h(null)}x(false)})(),disabled:!m.answer_title||!m.image_id,children:(0,c.__)("Ok","tutor")})]})]})})})]})}))};/* ESM default export */const tR=tU;var tX={option:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isOverlay:n,isDragging:r}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["20"] */.W0["20"],";width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(tO(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.stroke.brand */.Jv.stroke.brand,P/* .colorTokens.stroke.brand */.Jv.stroke.brand)," ",r&&(0,d/* .css */.iv)(tN(),P/* .colorTokens.stroke.hover */.Jv.stroke.hover)," ",n&&(0,d/* .css */.iv)(tJ(),P/* .shadow.drag */.AF.drag)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["8"] */.W0["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex()),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["12"] */.W0["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.flexCenter */.i.flexCenter(),";height:210px;width:100%;background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";border-radius:",P/* .borderRadius.card */.E0.card,";overflow:hidden;svg{color:",P/* .colorTokens.icon.hints */.Jv.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.iv)("background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.iv)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding-block:",P/* .spacing["4"] */.W0["4"],";"),inputWithHints:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["8"] */.W0["8"],";"),inputHints:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["4"] */.W0["4"],";",A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/ImageAnswering.tsx
var tF=()=>{var[e,t]=(0,u.useState)(null);var n=(0,k/* .useFormContext */.Gc)();var{activeQuestionIndex:d,activeQuestionId:v,validationError:h,setValidationError:g}=eG();var{fields:m,append:b,insert:y,remove:w,move:Z}=(0,k/* .useFieldArray */.Dq)({control:n.control,name:"questions.".concat(d,".question_answers")});var x=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));var C=(0,u.useMemo)(()=>{if(!e){return null}return m.find(t=>t.answer_id===e)},[e,m]);var E=()=>{b({_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:false,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:v,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 W=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:true,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var o=e+1;y(o,n)};var D=(e,t)=>{w(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.dP.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:tQ.optionWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:x,collisionDetection:a/* .closestCenter */.pE,modifiers:[s/* .restrictToWindowEdges */.hg],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 o=m.findIndex(e=>e.answer_id===r.id);Z(i,o)}t(null)},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:m.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:m,children:(e,t)=>/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,o/* .jsx */.tZ)(tR,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>W(t,e),onRemoveOption:()=>D(t,e),index:t,questionId:v,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:C,children:t=>{var a=m.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(a),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(tR,(0,i._)((0,r._)({},e),{onDuplicateOption:R/* .noop */.ZT,onRemoveOption:R/* .noop */.ZT,index:a,isOverlay:true,questionId:v}))},e)}})}),document.body)]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",onClick:E,buttonContentCss:tQ.addOptionButton,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* ESM default export */const tj=tF;var tQ={optionWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["12"] */.W0["12"],";padding-left:",P/* .spacing["40"] */.W0["40"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",P/* .spacing["8"] */.W0["8"],";}"),addOptionButton:/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.text.brand */.Jv.text.brand,";svg{color:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx
function tH(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);tH=function t(){return e};return e}function tY(){var e=(0,b._)(["\n      background-color: ",";\n    "]);tY=function t(){return e};return e}function tV(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);tV=function t(){return e};return e}function tK(){var e=(0,b._)(["\n      gap: ",";\n    "]);tK=function t(){return e};return e}var tG=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var t$=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:a,field:s,isOverlay:d=false,isImageMatching:v,questionId:p,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:p,belongs_question_type:"matching"};var x=(0,u.useRef)(null);var[k,W]=(0,u.useState)(!w.answer_title||v?!w.image_url:!w.answer_two_gap_match);var[D,T]=(0,u.useState)(w);var{attributes:q,listeners:S,setNodeRef:M,transform:B,transition:I,isDragging:z}=(0,l/* .useSortable */.nB)({id:s.value.answer_id||0,animateLayoutChanges:tA/* .animateLayoutChanges */.h});var{openMediaLibrary:P,resetFiles:A}=(0,tP/* ["default"] */.Z)({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 */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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 O={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(B),transition:I,opacity:z?.3:undefined};var J=()=>{s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{image_id:"",image_url:""}));A()};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(x.current)&&k){x.current.focus()}},[k]);return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",(0,i._)((0,r._)({},q),{css:t1.option,ref:M,tabIndex:-1,style:O,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t1.optionLabel({isEditing:k,isDragging:z,isOverlay:d}),onClick:()=>{W(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){W(true)}},children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t1.optionHeader,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:U/* .styleUtils.optionCounter */.i.optionCounter({isEditing:k}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!k&&w.is_saved,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({},S),{type:"button",css:U/* .styleUtils.optionDragButton */.i.optionDragButton({isOverlay:d}),"data-visually-hidden":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t1.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();W(true)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!tG,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();n(w)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{disabled:true,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,"data-visually-hidden":true,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:t1.optionBody,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:k,fallback:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t1.placeholderWrapper({isImageMatching:v}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:t1.optionPlaceholder,children:w.answer_title||(0,c.__)("Answer title...","tutor")}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w.image_url,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:t1.imagePlaceholder,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:t1.imagePlaceholder,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("img",{src:w.image_url,alt:w.image_url})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:t1.optionPlaceholder,children:!v?w.answer_two_gap_match:w.answer_title})]}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:U/* .styleUtils.optionInputWrapper */.i.optionInputWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:v,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(tz/* ["default"] */.Z,{value:{id:Number(w.image_id),url:w.image_url||"",title:w.image_url||""},infoText:(0,c.__)("Standard Size: 700x430 pixels","tutor"),uploadHandler:P,clearHandler:J,emptyImageCss:t1.emptyImageInput,previewImageCss:t1.previewImageInput})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("input",(0,i._)((0,r._)({},s),{type:"text",ref:x,placeholder:!v?(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 */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,Z._)(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 */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}));W(false)}})()})),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!v,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("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 */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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 */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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)}W(false)}}}))}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t1.optionInputButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();W(false);s.onChange(D);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)}a()}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:e=>{e.stopPropagation();s.onChange((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_saved:true}));T((0,i._)((0,r._)({},w,e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(w._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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)}W(false)},disabled:!w.answer_title||(v?!w.image_id:!w.answer_two_gap_match),children:(0,c.__)("Ok","tutor")})]})]})})})]})}))};/* ESM default export */const t0=t$;var t1={option:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["12"] */.W0["12"],";width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(tH(),P/* .colorTokens.background.white */.Jv.background.white,P/* .colorTokens.stroke.brand */.Jv.stroke.brand,P/* .colorTokens.stroke.brand */.Jv.stroke.brand)," ",n&&(0,d/* .css */.iv)(tY(),P/* .colorTokens.stroke.hover */.Jv.stroke.hover)," ",r&&(0,d/* .css */.iv)(tV(),P/* .shadow.drag */.AF.drag)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["8"] */.W0["8"],";place-self:center end;"),actionButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";",U/* .styleUtils.display.flex */.i.display.flex(),"    color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";cursor:pointer;&:disabled{cursor:not-allowed;color:",P/* .colorTokens.icon.disable.background */.Jv.icon.disable.background,";}"),optionBody:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex()),placeholderWrapper:e=>{var{isImageMatching:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    width:100%;",t&&(0,d/* .css */.iv)(tK(),P/* .spacing["12"] */.W0["12"]))},imagePlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.flexCenter */.i.flexCenter(),";height:210px;width:100%;background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";border-radius:",P/* .borderRadius.card */.E0.card,";overflow:hidden;svg{color:",P/* .colorTokens.icon.hints */.Jv.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.iv)("background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.iv)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding-block:",P/* .spacing["4"] */.W0["4"],";"),optionInputWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    width:100%;gap:",P/* .spacing["12"] */.W0["12"],";"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["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,k/* .useFormContext */.Gc)();var{activeQuestionIndex:d,activeQuestionId:v,validationError:h,setValidationError:g}=eG();var{fields:m,append:b,insert:y,remove:w,move:Z}=(0,k/* .useFieldArray */.Dq)({control:n.control,name:"questions.".concat(d,".question_answers")});var x=(0,k/* .useWatch */.qo)({control:n.control,name:"questions.".concat(d,".question_settings.is_image_matching"),defaultValue:false});var C=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));var E=(0,u.useMemo)(()=>{if(!e){return null}return m.find(t=>t.answer_id===e)},[e,m]);var W=()=>{b({_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:false,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:v,belongs_question_type:x?"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 D=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:true,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var o=e+1;y(o,n)};var T=(e,t)=>{w(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.dP.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:t8.optionWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:C,collisionDetection:a/* .closestCenter */.pE,modifiers:[s/* .restrictToWindowEdges */.hg],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 o=m.findIndex(e=>e.answer_id===r.id);Z(i,o)}t(null)},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:m.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:m,children:(e,t)=>/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,o/* .jsx */.tZ)(t0,(0,i._)((0,r._)({},n),{index:t,onDuplicateOption:e=>D(t,e),onRemoveOption:()=>T(t,e),isImageMatching:x,questionId:v,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:E,children:t=>{var a=m.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(a),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(t0,(0,i._)((0,r._)({},e),{index:a,onDuplicateOption:R/* .noop */.ZT,onRemoveOption:R/* .noop */.ZT,isOverlay:true,isImageMatching:x,questionId:v}))},e)}})}),document.body)]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",onClick:W,buttonContentCss:t8.addOptionButton,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* ESM default export */const t4=t2;var t8={optionWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["12"] */.W0["12"],";padding-left:",P/* .spacing["40"] */.W0["40"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",P/* .spacing["8"] */.W0["8"],";}"),addOptionButton:/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.text.brand */.Jv.text.brand,";svg{color:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx
function t3(){var e=(0,b._)(["\n        fill: none;\n      "]);t3=function t(){return e};return e}function t5(){var e=(0,b._)(["\n          fill: ",";\n        "]);t5=function t(){return e};return e}function t6(){var e=(0,b._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n        ","\n      }\n    "]);t6=function t(){return e};return e}function t9(){var e=(0,b._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);t9=function t(){return e};return e}function t7(){var e=(0,b._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);t7=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 */.y.tutor_pro_url;var nr=e=>{var{field:t,onDuplicateOption:n,onRemoveOption:a,onCheckCorrectAnswer:s,index:d,isOverlay:v=false,questionId:p,hasMultipleCorrectAnswer:h=false,questionType:g="multiple_choice",validationError:m,setValidationError:b}=e;var w,x;var k;var W=(k=t.value)!==null&&k!==void 0?k:{answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:p,belongs_question_type:"multiple_choice"};var D=(0,u.useRef)(null);var[T,q]=(0,u.useState)(!W.is_saved||!W.answer_title&&!W.image_url);var[S,M]=(0,u.useState)((0,e0/* .isDefined */.$K)(W.image_id)&&(0,e0/* .isDefined */.$K)(W.image_url));var[B,I]=(0,u.useState)(W);var{attributes:z,listeners:P,setNodeRef:A,transform:O,transition:J,isDragging:L}=(0,l/* .useSortable */.nB)({id:((w=t.value)===null||w===void 0?void 0:w.answer_id)||0,animateLayoutChanges:tA/* .animateLayoutChanges */.h});var{openMediaLibrary:X,resetFiles:F}=(0,tP/* ["default"] */.Z)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:n,url:o}=e;t.onChange((0,i._)((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{image_id:n,image_url:o,answer_view_format:"text_image"}));M(true)}},initialFiles:((x=t.value)===null||x===void 0?void 0:x.image_id)?{id:Number(t.value.image_id),url:t.value.image_url||"",title:""}:null});var j={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(O),transition:J,opacity:L?.3:undefined};var Q=()=>{F();t.onChange((0,i._)((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{image_id:"",image_url:"",answer_view_format:"text"}));M(false)};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(D.current)&&T){D.current.focus()}},[T]);return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",(0,i._)((0,r._)({},z),{css:no.option({isSelected:!!Number(W.is_correct),isMultipleChoice:h}),tabIndex:-1,ref:A,style:j,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:g==="multiple_choice",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{css:U/* .styleUtils.optionCheckButton */.i.optionCheckButton,"data-check-button":true,type:"button",onClick:s,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:h,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:Number(W.is_correct)?"checkFilled":"check",height:32,width:32}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:Number(W.is_correct)?"checkSquareFilled":"checkSquare",height:32,width:32})})},W.is_correct)}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:no.optionLabel({isSelected:!!Number(W.is_correct),isEditing:T,isDragging:L,isOverlay:v}),onClick:()=>{q(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){q(true)}},children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:no.optionHeader({isEditing:T}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:no.optionCounterAndButton,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:U/* .styleUtils.optionCounter */.i.optionCounter({isSelected:!!Number(W.is_correct),isEditing:T}),children:String.fromCharCode(65+d)}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:T,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!S,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"removeImage",width:24,height:24}),onClick:e=>{e.stopPropagation();Q()},children:(0,c.__)("Remove Image","tutor")}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"addImage",width:24,height:24}),onClick:e=>{e.stopPropagation();X()},children:(0,c.__)("Add Image","tutor")})})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!T&&W.is_saved,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({},P),{type:"button",css:U/* .styleUtils.optionDragButton */.i.optionDragButton({isOverlay:v}),"data-visually-hidden":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:no.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();q(true)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!nn,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();n(W)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{disabled:true,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:no.optionBody,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:T,fallback:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:no.placeholderWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:W.image_url,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:no.imagePlaceholder,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("img",{src:W.image_url,alt:W.image_url})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:no.optionPlaceholder,children:W.answer_title||(0,c.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:U/* .styleUtils.optionInputWrapper */.i.optionInputWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:S,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(tz/* ["default"] */.Z,{value:{id:Number(W.image_id),url:W.image_url||"",title:(0,c.__)("Image","tutor")},buttonText:(0,c.__)("Upload Image","tutor"),infoText:(0,c.__)("Size: 700x430 pixels","tutor"),uploadHandler:X,clearHandler:Q,emptyImageCss:no.emptyImageInput,previewImageCss:no.previewImageInput})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("textarea",(0,i._)((0,r._)({},t),{ref:D,placeholder:(0,c.__)("Write option...","tutor"),value:W.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{var{value:n}=e.target;t.onChange((0,i._)((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{answer_title:n}))},onKeyDown:e=>(0,Z._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&W.answer_title){t.onChange((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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,o/* .jsxs */.BX)("div",{css:no.optionInputButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();q(false);t.onChange(B);if(!W.is_saved){if((m===null||m===void 0?void 0:m.type)==="save_option"){b===null||b===void 0?void 0:b(null)}a()}},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:e=>(0,Z._)(function*(){e.stopPropagation();t.onChange((0,i._)((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_saved:true}));I((0,i._)((0,r._)({},W,e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(W._data_status,e0/* .QuizDataStatus.UPDATE */.dP.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:!W.answer_title&&!W.image_url,children:(0,c.__)("Ok","tutor")})]})]})})})]})]}))};/* ESM default export */const ni=nr;var no={option:e=>{var{isSelected:t,isMultipleChoice:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["10"],";align-items:center;[data-check-button]{color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";",!n&&(0,d/* .css */.iv)(t3()),"      &:focus-visible{opacity:1;}}&:hover{[data-check-button]{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}",t&&(0,d/* .css */.iv)(t6(),P/* .colorTokens.bg.success */.Jv.bg.success,!n&&(0,d/* .css */.iv)(t5(),P/* .colorTokens.bg.success */.Jv.bg.success))," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-check-button]{opacity:1;}}")},optionLabel:e=>{var{isSelected:t,isEditing:n,isDragging:r,isOverlay:i}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["12"] */.W0["12"],";width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(t9(),P/* .colorTokens.background.success.fill40 */.Jv.background.success.fill40,P/* .colorTokens.text.primary */.Jv.text.primary,P/* .colorTokens.stroke.success.fill70 */.Jv.stroke.success.fill70)," ",n&&(0,d/* .css */.iv)(t7(),P/* .colorTokens.background.white */.Jv.background.white,t?P/* .colorTokens.stroke.success.fill70 */.Jv.stroke.success.fill70:P/* .colorTokens.stroke.brand */.Jv.stroke.brand,t?P/* .colorTokens.stroke.success.fill70 */.Jv.stroke.success.fill70:P/* .colorTokens.stroke.brand */.Jv.stroke.brand)," ",r&&(0,d/* .css */.iv)(ne(),P/* .colorTokens.stroke.hover */.Jv.stroke.hover)," ",i&&(0,d/* .css */.iv)(nt(),P/* .shadow.drag */.AF.drag)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:e=>{var{isEditing:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("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 */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["8"] */.W0["8"],";place-self:center start;button{padding:0;min-height:24px;}"),optionActions:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["8"] */.W0["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex()),placeholderWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["12"] */.W0["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.flexCenter */.i.flexCenter(),";height:210px;width:100%;background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";border-radius:",P/* .borderRadius.card */.E0.card,";overflow:hidden;svg{color:",P/* .colorTokens.icon.hints */.Jv.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,d/* .css */.iv)("background-color:",P/* .colorTokens.background["default"] */.Jv.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,d/* .css */.iv)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding-block:",P/* .spacing["4"] */.W0["4"],";"),optionInputButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    justify-content:flex-end;gap:",P/* .spacing["8"] */.W0["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/MultipleChoiceAndOrdering.tsx
function na(){var e=(0,b._)(["\n      padding-left: ",";\n    "]);na=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,k/* .useFormContext */.Gc)();var{activeQuestionIndex:d,activeQuestionId:v,validationError:h,setValidationError:g}=eG();var m=(0,k/* .useWatch */.qo)({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:Z,remove:x,update:C,replace:E,move:W}=(0,k/* .useFieldArray */.Dq)({control:n.control,name:"questions.".concat(d,".question_answers")});var D=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));var T=(0,k/* .useWatch */.qo)({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 S=e=>{var t=T[e];if(m){C(e,(0,i._)((0,r._)({},t,e1(t._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(t._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_correct:t.is_correct==="1"?"0":"1"}))}else{var n=T.map(e=>(0,i._)((0,r._)({},e,e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));E(n)}if((h===null||h===void 0?void 0:h.type)==="correct_option"){g(null)}};var M=()=>{w({_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:false,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:v,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 B=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,is_saved:true,answer_id:(0,R/* .nanoid */.x0)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var o=e+1;Z(o,n)};var I=(e,t)=>{x(e);if(t._data_status!==e0/* .QuizDataStatus.NEW */.dP.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nc.optionWrapper({isOrdering:b==="ordering"}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:D,collisionDetection:a/* .closestCenter */.pE,modifiers:[s/* .restrictToWindowEdges */.hg],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 o=y.findIndex(e=>e.answer_id===r.id);W(i,o)}t(null)},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:y.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:y,children:(e,t)=>/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ni,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>B(t,e),onRemoveOption:()=>I(t,e),onCheckCorrectAnswer:()=>S(t),index:t,hasMultipleCorrectAnswer:m,questionType:b,questionId:v,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:q,children:t=>{var a=T.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(d,".question_answers.").concat(a),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ni,(0,i._)((0,r._)({},e),{onDuplicateOption:R/* .noop */.ZT,onRemoveOption:R/* .noop */.ZT,onCheckCorrectAnswer:R/* .noop */.ZT,index:a,isOverlay:true,hasMultipleCorrectAnswer:m,questionType:b,questionId:v}))},e)}})}),document.body)]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:nc.addOptionButtonWrapper({isOrdering:b==="ordering"}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",onClick:M,buttonContentCss:nc.addOptionButton,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",height:24,width:24}),children:(0,c.__)("Add Option","tutor")})})]})};/* ESM default export */const nd=nl;var nc={optionWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["12"] */.W0["12"],";",t&&(0,d/* .css */.iv)(na(),P/* .spacing["40"] */.W0["40"]))},addOptionButtonWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("margin-left:",P/* .spacing["48"] */.W0["48"],";",t&&(0,d/* .css */.iv)(ns(),P/* .spacing["8"] */.W0["8"]))},addOptionButton:/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.text.brand */.Jv.text.brand,";svg{color:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/question-types/OpenEndedAndShortAnswer.tsx
var nu=()=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:np.optionWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(e7/* ["default"] */.Z,{icon:"bulb",children:(0,c.__)("No options are necessary for this question type","tutor")})})};/* ESM default export */const nv=nu;var np={optionWrapper:/*#__PURE__*/(0,d/* .css */.iv)("padding-left:",P/* .spacing["40"] */.W0["40"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",P/* .spacing["8"] */.W0["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:a=false,questionId:s}=e;var d;var c=(d=t.value)!==null&&d!==void 0?d:{answer_id:(0,R/* .nanoid */.x0)(),answer_title:"",is_correct:"0",belongs_question_id:s,belongs_question_type:"true_false"};var{attributes:u,listeners:v,setNodeRef:p,transform:h,transition:f,isDragging:g}=(0,l/* .useSortable */.nB)({id:c.answer_id||0,animateLayoutChanges:tA/* .animateLayoutChanges */.h});var m={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(h),transition:f,opacity:g?.3:undefined};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",(0,i._)((0,r._)({},u),{css:ny.option({isSelected:!!Number(c.is_correct),isOverlay:a}),tabIndex:-1,ref:p,style:m,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-check-button":true,type:"button",css:U/* .styleUtils.optionCheckButton */.i.optionCheckButton,onClick:n,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:Number(c.is_correct)?"checkFilled":"check",height:32,width:32})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ny.optionLabel({isSelected:!!Number(c.is_correct),isDragging:g,isOverlay:a}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:c.answer_title}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({},v),{type:"button",css:U/* .styleUtils.optionDragButton */.i.optionDragButton({isOverlay:a}),"data-visually-hidden":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",height:24,width:24})}))]})]}))};/* ESM default export */const nb=nm;var ny={option:e=>{var{isSelected:t,isOverlay:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["10"],";height:48px;align-items:center;[data-check-button]{color:",P/* .colorTokens.icon["default"] */.Jv.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 */.iv)(nh(),P/* .colorTokens.bg.success */.Jv.bg.success))},optionLabel:e=>{var{isSelected:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";text-transform:capitalize;[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}&:focus-within{[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(nf(),P/* .colorTokens.background.success.fill40 */.Jv.background.success.fill40,P/* .colorTokens.text.primary */.Jv.text.primary,P/* .colorTokens.stroke.success.fill70 */.Jv.stroke.success.fill70)," ",n&&(0,d/* .css */.iv)(ng(),P/* .colorTokens.stroke.hover */.Jv.stroke.hover)," ",r&&(0,d/* .css */.iv)(n_(),P/* .shadow.drag */.AF.drag)," ",P/* .Breakpoint.smallTablet */.Uo.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 nZ(){var e=(0,b._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);nZ=function t(){return e};return e}var nx=()=>{var[e,t]=(0,u.useState)(null);var n=(0,k/* .useFormContext */.Gc)();var{activeQuestionId:d,activeQuestionIndex:c}=eG();var{fields:v,move:h,replace:f}=(0,k/* .useFieldArray */.Dq)({control:n.control,name:"questions.".concat(c,".question_answers")});var g=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));var _=(0,k/* .useWatch */.qo)({control:n.control,name:"questions.".concat(c,".question_answers"),defaultValue:[]});var m=(0,u.useMemo)(()=>{if(!e){return null}return v.find(t=>t.answer_id===e)},[e,v]);var b=e=>{var t=v[e];var n=_.map(e=>(0,i._)((0,r._)({},e,e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(e._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));f(n)};(0,u.useEffect)(()=>{var e=_.filter(e=>{var t=v.findIndex(t=>t.answer_id===e.answer_id);var n=v[t]||{};return e.is_correct!==n.is_correct});if(e.length===0){return}var t=v.findIndex(t=>t.answer_id===e[0].answer_id);var o=[..._];o[t]=Object.assign({},o[t],{is_correct:"1"});for(var[a,s]of o.entries()){if(a!==t){o[a]=(0,i._)((0,r._)({},s,e1(s._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)&&{_data_status:e1(s._data_status,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)}),{is_correct:"0"})}}n.setValue("questions.".concat(c,".question_answers"),o);// eslint-disable-next-line react-hooks/exhaustive-deps
},[_]);return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:nC.optionWrapper,children:/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:g,collisionDetection:a/* .closestCenter */.pE,modifiers:[s/* .restrictToWindowEdges */.hg],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=v.findIndex(e=>e.answer_id===n.id);var o=v.findIndex(e=>e.answer_id===r.id);h(i,o)}t(null)},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:v.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:v,children:(e,t)=>/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(c,".question_answers.").concat(t),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(nb,(0,i._)((0,r._)({},e),{index:t,onCheckCorrectAnswer:()=>b(t),questionId:d}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:m,children:t=>{var a=v.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"questions.".concat(c,".question_answers.").concat(a),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(nb,(0,i._)((0,r._)({},e),{index:a,onCheckCorrectAnswer:R/* .noop */.ZT,isOverlay:true,questionId:d}))},e)}})}),document.body)]})})};/* ESM default export */const nk=nx;var nC={optionWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["12"] */.W0["12"],";"),option:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";",A/* .typography.caption */.c.caption("medium"),";align-items:center;color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";gap:",P/* .spacing["10"] */.W0["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 */.iv)(nw(),P/* .colorTokens.bg.success */.Jv.bg.success))},optionLabel:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";cursor:pointer;[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",P/* .colorTokens.stroke.hover */.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,d/* .css */.iv)(nZ(),P/* .colorTokens.background.success.fill40 */.Jv.background.success.fill40,P/* .colorTokens.text.primary */.Jv.text.primary,P/* .colorTokens.stroke.success.fill70 */.Jv.stroke.success.fill70))},optionDragButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton," ",U/* .styleUtils.flexCenter */.i.flexCenter(),"    transform:rotate(90deg);color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";cursor:grab;place-self:center center;&:focus,&:active,&:hover{background:none;color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/usePrevious.tsx
var nE=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 nW=n.p+"js/images/quiz-empty-state-2x-0a35e435.webp";// CONCATENATED MODULE: ./assets/react/v3/public/images/quiz-empty-state.webp
const nD=n.p+"js/images/quiz-empty-state-c7e2a8d9.webp";// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionForm.tsx
var nT=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var nq=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,contentType:a}=eG();var s=nE(t);var l=(0,k/* .useFormContext */.Gc)();var d=(0,u.useRef)(null);var v=l.watch("questions.".concat(e,".question_type"));var p=l.watch("questions")||[];var h=l.watch("questions.".concat(e,"._data_status"));var f={true_false:/*#__PURE__*/(0,o/* .jsx */.tZ)(nk,{},t),multiple_choice:/*#__PURE__*/(0,o/* .jsx */.tZ)(nd,{},t),open_ended:/*#__PURE__*/(0,o/* .jsx */.tZ)(nv,{},t),fill_in_the_blank:/*#__PURE__*/(0,o/* .jsx */.tZ)(tB,{},t),short_answer:/*#__PURE__*/(0,o/* .jsx */.tZ)(nv,{},t),matching:/*#__PURE__*/(0,o/* .jsx */.tZ)(t4,{},t),image_answering:/*#__PURE__*/(0,o/* .jsx */.tZ)(tj,{},t),ordering:/*#__PURE__*/(0,o/* .jsx */.tZ)(nd,{},t)};(0,u.useEffect)(()=>{if(n&&d.current){d.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[n]);if(!t&&!l.formState.isLoading&&p.length===0){return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nM.emptyState,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("img",{css:nM.emptyStateImage,src:nD,srcSet:"".concat(nD," 1x, ").concat(nW," 2x"),alt:""}),/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{css:nM.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,o/* .jsxs */.BX)("div",{css:nM.questionForm(t===s),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nM.questionWithIndex,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nM.questionIndex,children:[e+1,"."]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nM.questionTitleAndDesc,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{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,o/* .jsx */.tZ)(tk,(0,i._)((0,r._)({},t),{placeholder:(0,c.__)("Write your question here..","tutor"),disabled:a==="tutor_h5p_quiz",onChange:()=>{if(e1(h,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}},selectOnFocus:((n=p[e])===null||n===void 0?void 0:n._data_status)===e0/* .QuizDataStatus.NEW */.dP.NEW}))}}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:nM.h5pShortCode,children:'[h5p id: "'.concat(l.watch("questions.".concat(e,".question_description")),'"]')})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:l.control,name:"questions.".concat(e,".question_description"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(tf,(0,i._)((0,r._)({},t),{placeholder:(0,c.__)("Description (optional)","tutor"),disabled:a==="tutor_h5p_quiz",onChange:()=>{if(e1(h,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Quiz.after_question_description",namePrefix:"questions.".concat(e,"."),form:l})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:n,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{ref:d,css:nM.alertWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(e7/* ["default"] */.Z,{type:"danger",icon:"warning",children:n===null||n===void 0?void 0:n.message})},Math.random())}),f[v],/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:nT&&v!=="h5p",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:nM.questionAnswer,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:l.control,name:"questions.".concat(e,".answer_explanation"),render:t=>/*#__PURE__*/(0,o/* .jsx */.tZ)(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 */.dP.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),e1(h,e0/* .QuizDataStatus.UPDATE */.dP.UPDATE))}}}))})})})]},e)};/* ESM default export */const nS=nq;var nM={questionForm:e=>/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";padding-right:",P/* .spacing["48"] */.W0["48"],";gap:",P/* .spacing["16"] */.W0["16"],";animation:",e?undefined:"fadeIn 0.25s ease-in-out",";@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-right:",P/* .spacing["8"] */.W0["8"],";}"),questionWithIndex:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";align-items:flex-start;padding-left:",P/* .spacing["40"] */.W0["40"],";gap:",P/* .spacing["4"] */.W0["4"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",P/* .spacing["8"] */.W0["8"],";}"),questionIndex:/*#__PURE__*/(0,d/* .css */.iv)("margin-top:",P/* .spacing["10"] */.W0["10"],";",A/* .typography.heading6 */.c.heading6(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";"),questionTitleAndDesc:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["8"] */.W0["8"],";width:100%;"),h5pShortCode:/*#__PURE__*/(0,d/* .css */.iv)("margin-left:",P/* .spacing["8"] */.W0["8"],";padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["8"] */.W0["8"],";",A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.white */.Jv.text.white,";background-color:#2575be;border-radius:",P/* .borderRadius.card */.E0.card,";width:fit-content;font-family:'Fire Code',monospace;"),questionAnswer:/*#__PURE__*/(0,d/* .css */.iv)("padding-left:",P/* .spacing["40"] */.W0["40"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",P/* .spacing["8"] */.W0["8"],";}"),emptyState:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.flexCenter */.i.flexCenter("column"),";padding-left:",P/* .spacing["40"] */.W0["40"],";padding-right:",P/* .spacing["48"] */.W0["48"],";gap:",P/* .spacing["16"] */.W0["16"],";"),emptyStateImage:/*#__PURE__*/(0,d/* .css */.iv)("width:220px;height:auto;"),emptyStateText:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";text-align:center;max-width:330px;"),alertWrapper:/*#__PURE__*/(0,d/* .css */.iv)("padding-left:",P/* .spacing["40"] */.W0["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 nB=n(52130);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/Question.tsx
function nI(){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    "]);nI=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 nP(){var e=(0,b._)(["\n      box-shadow: ",";\n      background-color: ",";\n      border-radius: ",";\n\n      :hover {\n        background-color: ",";\n      }\n    "]);nP=function t(){return e};return e}var nA={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 nO=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var nN=e=>{var{question:t,index:n,onDuplicateQuestion:a,onRemoveQuestion:s,isOverlay:v=false}=e;var{activeQuestionIndex:p,activeQuestionId:h,validationError:f,setActiveQuestionId:g,setValidationError:m,contentType:b}=eG();var w=(0,k/* .useFormContext */.Gc)();var[Z,x]=(0,u.useState)(false);var E=(0,u.useRef)(null);var W=w.getValues("questions.".concat(p));var{attributes:D,listeners:T,setNodeRef:q,transform:S,transition:M,isDragging:B}=(0,l/* .useSortable */.nB)({id:t.question_id,animateLayoutChanges:tA/* .animateLayoutChanges */.h});var I={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(S),transition:M,opacity:B?.3:undefined,background:B?P/* .colorTokens.stroke.hover */.Jv.stroke.hover:undefined};(0,u.useEffect)(()=>{if(h===t.question_id){var e;(e=E.current)===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[h,t.question_id]);return/*#__PURE__*/(0,d/* .createElement */.az)("div",(0,i._)((0,r._)({},D),{key:t.question_id,css:nL.questionItem({isActive:String(h)===String(t.question_id),isDragging:v,isThreeDotsOpen:Z}),ref:e=>{q(e);// @ts-expect-error
E.current=e},style:I,onClick:()=>{if(h===t.question_id){return}var e=e2(W);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(W);if(n!==true){m(n);return}m(null);g(t.question_id)}},children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nL.iconAndSerial({isDragging:v}),"data-icon-serial":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{"data-serial":true,children:n+1}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({"data-drag-icon":true},T),{type:"button",css:nL.dragButton,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{"data-drag-icon":true,name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:nA[t.question_type],width:24,height:24,"data-question-icon":true})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:nL.questionTitle({isActive:String(h)===String(t.question_id)}),children:t.question_title}),/*#__PURE__*/(0,o/* .jsxs */.BX)(nB/* ["default"] */.Z,{isOpen:Z,onClick:e=>{e.stopPropagation();var t=e2(W);x(true);if(t!==true){m(t)}},animationType:J/* .AnimationType.slideDown */.ru.slideDown,closePopover:()=>x(false),dotsOrientation:"vertical",maxWidth:nO?"150px":"160px",isInverse:true,size:"small","data-three-dots":true,children:[!f&&b!=="tutor_h5p_quiz"&&/*#__PURE__*/(0,o/* .jsx */.tZ)(nB/* ["default"].Option */.Z.Option,{text:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nL.duplicate,children:[(0,c.__)("Duplicate","tutor"),!nO&&/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",content:(0,c.__)("Pro","tutor")})]}),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"duplicate",width:24,height:24}),disabled:!nO,onClick:e=>{e.stopPropagation();a(t);x(false)}}),/*#__PURE__*/(0,o/* .jsx */.tZ)(nB/* ["default"].Option */.Z.Option,{isTrash:true,text:(0,c.__)("Delete","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24}),onClick:e=>{e.stopPropagation();s();x(false)}})]})]}))};/* ESM default export */const nJ=nN;var nL={questionItem:e=>{var{isActive:t=false,isDragging:n=false,isThreeDotsOpen:r=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["10"] */.W0["10"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["10"] */.W0["10"]," ",P/* .spacing["28"] */.W0["28"],";display:flex;align-items:center;justify-content:space-between;gap:",P/* .spacing["12"] */.W0["12"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.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:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";}:focus-visible{opacity:1;}}",t&&(0,d/* .css */.iv)(nI(),P/* .colorTokens.text.brand */.Jv.text.brand,P/* .colorTokens.background.white */.Jv.background.white)," ",r&&(0,d/* .css */.iv)(nz()),":hover{background-color:",P/* .colorTokens.background.hover */.Jv.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 ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:-2px;border-radius:",P/* .borderRadius.card */.E0.card,";[data-three-dots]{opacity:1;}}",n&&(0,d/* .css */.iv)(nP(),P/* .shadow.drag */.AF.drag,P/* .colorTokens.background.white */.Jv.background.white,P/* .borderRadius.card */.E0.card,P/* .colorTokens.background.white */.Jv.background.white)," ",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["8"] */.W0["8"],";[data-three-dots]{opacity:1;}}")},iconAndSerial:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:1fr 1fr;align-items:center;border-radius:3px 0 0 3px;width:64px;padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["4"] */.W0["4"],";flex-shrink:0;column-gap:",P/* .spacing["12"] */.W0["12"],";place-items:center center;[data-drag-icon]{display:none;color:",P/* .colorTokens.icon.hints */.Jv.icon.hints,";cursor:",t?"grabbing":"grab",";}[data-question-icon]{flex-shrink:0;}svg{flex-shrink:0;}[data-serial]{width:24px;display:block;",A/* .typography.caption */.c.caption("medium"),"      text-align:center;flex-grow:1;}")},questionTitle:e=>{var{isActive:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(t?"medium":"regular"),";color:",t?P/* .colorTokens.text.brand */.Jv.text.brand:P/* .colorTokens.text.subdued */.Jv.text.subdued,";flex-grow:1;")},duplicate:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";"),dragButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";&:focus,&:active,&:hover{background:none;}")};// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/Paginator.tsx
var nU=e=>{var{currentPage:t,onPageChange:n,totalItems:r,itemsPerPage:i}=e;var a=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>a){return}n(e)};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nX.wrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nX.pageStatus,children:[(0,c.__)("Page","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)("input",{type:"text",css:nX.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<=a){l(r);n(i)}else if(!r){l(r)}},autoComplete:"off"})}),(0,c.__)("of","tutor")," ",/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:a})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:nX.pageController,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:nX.paginationButton,onClick:()=>d(t-1),disabled:t===1,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:!el/* .isRTL */.dZ?"chevronLeft":"chevronRight",width:32,height:32})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:nX.paginationButton,onClick:()=>d(t+1),disabled:t===a,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:!el/* .isRTL */.dZ?"chevronRight":"chevronLeft",width:32,height:32})})]})]})};/* ESM default export */const nR=nU;var nX={wrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",P/* .spacing["8"] */.W0["8"],";height:36px;"),pageStatus:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),"    color:",P/* .colorTokens.text.title */.Jv.text.title,";min-width:100px;"),paginationInput:/*#__PURE__*/(0,d/* .css */.iv)("outline:0;border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",P/* .borderRadius["6"] */.E0["6"],";margin:0 ",P/* .spacing["8"] */.W0["8"],";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding:8px 12px;width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",P/* .spacing["0"] */.W0["0"],";}&[type='number']{-moz-appearance:textfield;}"),pageController:/*#__PURE__*/(0,d/* .css */.iv)("gap:",P/* .spacing["8"] */.W0["8"],";display:flex;justify-content:center;align-items:center;height:100%;"),paginationButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";background:",P/* .colorTokens.background.white */.Jv.background.white,";color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";border-radius:",P/* .borderRadius["6"] */.E0["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:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";}&:hover{background:",P/* .colorTokens.background["default"] */.Jv.background["default"],";& > svg{color:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}}&:disabled{background:",P/* .colorTokens.background.white */.Jv.background.white,";& > svg{color:",P/* .colorTokens.icon.disable["default"] */.Jv.icon.disable["default"],";}}")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/SearchField.tsx
var nF=e=>{var{onFilterItems:t}=e;var n=(0,ed/* .useFormWithGlobalError */.O)({defaultValues:{search:""}});var a=(0,L/* .useDebounce */.N)(n.watch("search"));(0,u.useEffect)(()=>{t((0,r._)({},a.length>0&&{search:a}))},[t,a]);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:n.control,name:"search",render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(0,i._)((0,r._)({},e),{content:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"search",width:24,height:24}),contentCss:nQ.contentCss,placeholder:(0,c.__)("Search...","tutor"),showVerticalBar:false}))})};/* ESM default export */const nj=nF;var nQ={contentCss:/*#__PURE__*/(0,d/* .css */.iv)("svg{color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";}")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/usePaginatedTable.ts
var nH=function(){var{limit:e=el/* .ITEMS_PER_PAGE */.gK}=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 o=e*Math.max(0,i.page-1);var a=(0,u.useCallback)(e=>{n(t=>(0,r._)({},t,e))},[n]);var s=e=>a({page:e});var l=(0,u.useCallback)(e=>a({page:1,filter:e}),[a]);var d=e=>{var t={};if(e!==i.sortProperty){t={sortDirection:"asc",sortProperty:e}}else{t={sortDirection:i.sortDirection==="asc"?"desc":"asc",sortProperty:e}}a(t)};return{pageInfo:i,onPageChange:s,onColumnSort:d,offset:o,itemsPerPage:e,onFilterItems:l}};// CONCATENATED MODULE: ./assets/react/v3/shared/services/content-bank.ts
var nY=e=>{return eI/* .wpAjaxInstance.get */.R.get(ez/* ["default"].GET_CONTENT_BANK_COLLECTIONS */.Z.GET_CONTENT_BANK_COLLECTIONS,{params:e}).then(e=>e.data)};var nV=e=>{return(0,eB/* .useQuery */.a)({queryKey:["ContentBankCollections",e],queryFn:()=>nY((0,r._)({},e)),placeholderData:e=>e,enabled:!!e.page&&!!e.per_page})};var nK=e=>{return useInfiniteQuery({queryKey:["ContentBankCollectionsInfinity",e],queryFn:t=>{var{pageParam:n=1}=t;return nY(_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 nG=e=>{return eI/* .wpAjaxInstance.get */.R.get(ez/* ["default"].GET_CONTENT_BANK_CONTENTS */.Z.GET_CONTENT_BANK_CONTENTS,{params:e}).then(e=>e.data)};var n$=e=>{return(0,eB/* .useQuery */.a)({queryFn:()=>nG(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 n8(){var e=(0,b._)(["\n      background-color: #e8f4fd;\n      color: ",";\n    "]);n8=function t(){return e};return e}function n3(){var e=(0,b._)(["\n      background-color: #e6f8f1;\n      color: ",";\n    "]);n3=function t(){return e};return e}function n5(){var e=(0,b._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);n5=function t(){return e};return e}var n6=e=>{var{type:t}=e;var n,a;var{pageInfo:s,onPageChange:l,itemsPerPage:d,onFilterItems:v}=nH();var p=(0,k/* .useFormContext */.Gc)();var h=nV((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=(a=h.data)===null||a===void 0?void 0:a.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 a=t==="lesson_assignment"?n+r:i;return/*#__PURE__*/(0,o/* .jsxs */.BX)("button",{css:n7.collectionItemWrapper,onClick:()=>p.setValue("selectedCollection",e),onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();p.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:a===0,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:n7.title,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-collection-title":true,"aria-disabled":a===0,children:e.post_title}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(a!==null&&a!==void 0?a:0)>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",a,"tutor"),a)})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a>0,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:n7.title,"aria-disabled":a===0,children:(0,c.__)("No Items","tutor")}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:n7.contentsWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:t==="lesson_assignment",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:n>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:n7.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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:r>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:n7.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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:i>0&&t==="question",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:n7.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)})})]})})]})}}],[p,t]);if(h.isLoading){return/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingSection */.g4,{"aria-label":(0,c.__)("Loading","tutor")})}if(!h.data){return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:n7.errorMessage,role:"alert","aria-live":"assertive",children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:n7.tableActions,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nj,{onFilterItems:v})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:n7.tableWrapper({isLoading:h.isFetching||h.isRefetching,hasPagination:y>1,hasData:f.length>0}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(eT,{noHeader:true,columns:w,data:f,itemsPerPage:d,loading:h.isFetching||h.isRefetching,colors:{bodyRowHover:P/* .colorTokens.background.white */.Jv.background.white}})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y>1,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:n7.paginatorWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nR,{currentPage:s.page,onPageChange:l,totalItems:m,itemsPerPage:d})})})]})};/* ESM default export */const n9=/*#__PURE__*/v().memo(n6);var n7={tableActions:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["20"] */.W0["20"],";"),tableWrapper:e=>{var{isLoading:t=false,hasPagination:n=false,hasData:r=true}=e;return/*#__PURE__*/(0,d/* .css */.iv)("max-height:calc(100vh - 350px);overflow:auto;border-top:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";",!n&&(0,d/* .css */.iv)(n1(),P/* .spacing["12"] */.W0["12"])," ",!t&&(0,d/* .css */.iv)(n2(),P/* .colorTokens.text.disable */.Jv.text.disable,P/* .colorTokens.text.brand */.Jv.text.brand)," ",!r&&(0,d/* .css */.iv)(n4(),P/* .spacing["20"] */.W0["20"]))},paginatorWrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:",P/* .spacing["20"] */.W0["20"]," ",P/* .spacing["16"] */.W0["16"],";"),collectionItemWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";min-height:60px;width:100%;height:100%;padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["24"] */.W0["24"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["20"] */.W0["20"],";",U/* .styleUtils.display.flex */.i.display.flex("row"),";justify-content:space-between;align-items:center;gap:",P/* .spacing["16"] */.W0["16"],";&:hover{background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";}&:disabled{cursor:not-allowed;pointer-events:none;background-color:",P/* .colorTokens.background.disable */.Jv.background.disable,";}"),contentsWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";flex-shrink:0;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.tiny */.c.tiny("medium"),";padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["8"] */.W0["8"],";border-radius:",P/* .borderRadius["4"] */.E0["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,d/* .css */.iv)(n8(),P/* .colorTokens.icon.brand */.Jv.icon.brand)," ",t==="cb-assignment"&&(0,d/* .css */.iv)(n3(),P/* .colorTokens.icon.processing */.Jv.icon.processing)," ",t==="cb-question"&&(0,d/* .css */.iv)(n5()))},title:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";",U/* .styleUtils.text.ellipsis */.i.text.ellipsis(2),";text-wrap:pretty;div:is(:last-of-type):not(:only-of-type){",A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";}"),errorMessage:/*#__PURE__*/(0,d/* .css */.iv)("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:a}=e;var s=(0,ed/* .useFormWithGlobalError */.O)({defaultValues:n||{contentTypes:[],order:"asc",questionTypes:[]}});var[l,d]=(0,u.useState)(false);var v=(0,u.useRef)(null);var p=s.watch("order")||"asc";var h=s.watch("contentTypes")||[];var g=s.watch("questionTypes")||[];var m=a==="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,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{"data-filter":true,css:rr.wrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!m&&h.length>0||m&&g.length>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:m,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsxs */.BX)(f/* ["default"] */.Z,{ref:v,variant:"tertiary",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"mageFilter",height:16,width:16}),buttonCss:rr.filterButton({hasFilters:g.length>0}),onClick:()=>d(e=>!e),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:(0,c.__)("Filters","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:m&&g.length>0,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rr.filterCount,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rr.divider}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:g.length})]})})]})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isIconOnly:true,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:p==="asc"?"sortASC":"sortDESC",width:18,height:18}),onClick:()=>{var e=p==="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,o/* .jsx */.tZ)(D/* ["default"] */.Z,{isOpen:l,closeOnEscape:true,animationType:J/* .AnimationType.slideDown */.ru.slideDown,closePopover:()=>{s.reset();d(false)},triggerRef:v,maxWidth:!m?"200px":"240px",children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rr.filterFieldsWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("h6",{children:(0,c.__)("Filter by","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rr.filterFields,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:m,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:b,children:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rr.questionType,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:e.icon,height:24,width:24}),/*#__PURE__*/(0,o/* .jsx */.tZ)("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,o/* .jsx */.tZ)("div",{css:rr.filterActions,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{size:"small",variant:"primary",onClick:()=>{t(s.getValues());d(false)},children:(0,c.__)("Apply Filters","tutor")})})]})})]})};/* ESM default export */const rn=rt;var rr={wrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";gap:",P/* .spacing["12"] */.W0["12"],";"),filterButton:e=>{var{hasFilters:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("height:40px;padding-inline:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";",t&&(0,d/* .css */.iv)(re(),P/* .spacing["6"] */.W0["6"]))},clearButton:/*#__PURE__*/(0,d/* .css */.iv)("flex-shrink:0;"),questionType:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["12"] */.W0["12"],";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";"),divider:/*#__PURE__*/(0,d/* .css */.iv)("width:1px;height:24px;background-color:",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),filterCount:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";margin-left:",P/* .spacing["8"] */.W0["8"],";span{height:26px;width:26px;",U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;justify-content:center;border-radius:",P/* .borderRadius["4"] */.E0["4"],";background-color:",P/* .colorTokens.primary["50"] */.Jv.primary["50"],";color:",P/* .colorTokens.text.brand */.Jv.text.brand,";}"),filterFieldsWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";h6{padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["6"] */.W0["6"]," ",P/* .spacing["12"] */.W0["12"],";",A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";}"),filterFields:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["6"] */.W0["6"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["6"] */.W0["6"]," ",P/* .spacing["16"] */.W0["16"],";",U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["16"] */.W0["16"],";background-color:",P/* .colorTokens.surface.tutor */.Jv.surface.tutor,";border-radius:",P/* .borderRadius["8"] */.E0["8"],";"),filterActions:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["6"] */.W0["6"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["12"] */.W0["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 o=(0,u.useRef)(null);var[a,s]=(0,u.useState)();var l=(a===null||a===void 0?void 0:a.isIntersecting)&&r;var d=e=>{var[t]=e;s(t)};(0,u.useEffect)(()=>{var r=o.current;var i=(0,e0/* .isDefined */.$K)(window.IntersectionObserver);if(!i||l||!r){if(!r){s(undefined)}return}var a={threshold:e,root:t,rootMargin:n};var c=new IntersectionObserver(d,a);c.observe(r);return()=>c.disconnect();// eslint-disable-next-line react-hooks/exhaustive-deps
},[o.current,e,t,n,l,...i]);return{intersectionEntry:a,intersectionElementRef:o}};/* ESM default export */const ro=ri;// CONCATENATED MODULE: ./assets/react/v3/shared/atoms/Select.tsx
function ra(){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    "]);ra=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 rv(){var e=(0,b._)(["\n      > button {\n        ",";\n      }\n    "]);rv=function t(){return e};return e}function rp(){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    "]);rp=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=R/* .noop */.ZT,clearOption:r=R/* .noop */.ZT,label:i,placeholder:a="",readOnly:s,isSearchable:l=false,isClearable:d=true,isInlineLabel:v=false,isFontWeight:p=false,value:h,caretSize:m=20,infiniteScroll:b=false,wrapperStyle:y,inputCss:w,disabled:Z,size:x="regular",optionsStyleVariant:k="regular"}=e;var C=(0,R/* .nanoid */.x0)();var[E,W]=(0,u.useState)("");var[T,q]=(0,u.useState)("");var[S,M]=(0,u.useState)(false);var[B,I]=(0,u.useState)([]);var z=(0,u.useRef)(null);var P=(0,L/* .useDebounce */.N)(T);(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:"";W(r)},[t,h]);var A=(0,u.useMemo)(()=>{I([]);if(l){return t.filter(e=>{var{label:t}=e;return t.toLowerCase().startsWith(P.toLowerCase())})}return t},[P,l,t]);var{intersectionEntry:O,intersectionElementRef:N}=ro();var U=A.length>B.length;(0,u.useEffect)(()=>{if(!b){I(A);return}if(!(O===null||O===void 0?void 0:O.isIntersecting)||!U){return}var e=B.length;var t=e+rg;I(n=>[...n,...A.slice(e,t)]);// eslint-disable-next-line react-hooks/exhaustive-deps
},[A,O===null||O===void 0?void 0:O.isIntersecting]);return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:[rb.mainWrapper,y],children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rb.inputLabelWrapper(v),ref:z,children:[!!i&&/*#__PURE__*/(0,o/* .jsx */.tZ)("label",{htmlFor:C,css:rb.label(v),children:i}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:[rb.inputWrapper,w],children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("input",{id:C,onClick:()=>M(e=>!e),css:rb.input({isSearchable:l,size:x}),autoComplete:"off",readOnly:s||!l,placeholder:a,value:E,onChange:e=>{W(e.target.value);q(e.target.value)},disabled:Z,"data-select":true}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:rb.caretButton,onClick:()=>{M(e=>!e)},disabled:Z||s||t.length===0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"chevronDown",width:m,height:m,style:rb.toggleIcon({isOpen:S})})})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)(D/* ["default"] */.Z,{triggerRef:z,isOpen:S,closePopover:()=>M(false),animationType:J/* .AnimationType.slideDown */.ru.slideDown,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("ul",{css:rb.options,children:[B.map(e=>/*#__PURE__*/(0,o/* .jsx */.tZ)("li",{css:rb.optionItem({isSelected:e.value===(h===null||h===void 0?void 0:h.value),optionsStyleVariant:k,isDisabled:!!e.disabled}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",buttonCss:rb.optionButton({fontWeight:p?e.value:"inherit"}),onClick:()=>{W(e.label);q("");n(e);M(false)},children:e.label})},String(e.value))),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{ref:N,css:rb.spinnerWrapper({isVisible:U}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.ZP,{})})]}),d&&/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rb.clearButton({isDisabled:E===""}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",disabled:E==="",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete"}),onClick:()=>{r();W("");q("");M(false)},children:(0,c.__)("Clear","tutor")})})]})]})};/* ESM default export */const rm=r_;var rb={mainWrapper:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;"),inputLabelWrapper:e=>/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:flex;flex-direction:column;gap:",P/* .spacing["4"] */.W0["4"],";",e&&(0,d/* .css */.iv)(ra())),label:e=>/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption()," ",e&&(0,d/* .css */.iv)(rs())),inputWrapper:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;position:relative;"),input:e=>{var{isSearchable:t,size:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)("&[data-select]{",A/* .typography.body */.c.body(),";width:100%;height:40px;background-color:",P/* .colorTokens.background.white */.Jv.background.white,";border-radius:",P/* .borderRadius["6"] */.E0["6"],";border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";box-shadow:",P/* .shadow.input */.AF.input,";padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"],";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";appearance:textfield;transition:all 0.15s ease-in-out;",!t&&(0,d/* .css */.iv)(rl()),":focus{",U/* .styleUtils.inputFocus */.i.inputFocus,";}:disabled{color:",P/* .colorTokens.text.disable */.Jv.text.disable,";cursor:not-allowed;}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";}",n==="small"&&(0,d/* .css */.iv)(rd()),"}")},clearButton:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["8"] */.W0["8"],";border-top:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";display:flex;justify-content:center;min-height:40px;& > button{padding:0;width:100%;font-size:",P/* .fontSize["12"] */.JB["12"],";> span{justify-content:center;}",!t&&(0,d/* .css */.iv)(rc(),P/* .colorTokens.text.title */.Jv.text.title),"}")},options:/*#__PURE__*/(0,d/* .css */.iv)("list-style-type:none;max-height:500px;padding:",P/* .spacing["4"] */.W0["4"]," 0;margin:0;",U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";"),optionItem:e=>{var{isSelected:t=false,isDisabled:n=false,optionsStyleVariant:r="regular"}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.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 */.iv)(ru(),P/* .colorTokens.text.disable */.Jv.text.disable),"    &:hover{background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";}",r==="small"&&(0,d/* .css */.iv)(rv(),A/* .typography.caption */.c.caption())," ",t&&(0,d/* .css */.iv)(rp(),P/* .colorTokens.background.active */.Jv.background.active,P/* .colorTokens.brand.blue */.Jv.brand.blue,P/* .borderRadius["6"] */.E0["6"],P/* .borderRadius["6"] */.E0["6"]))},optionButton:e=>{var{fontWeight:t="inherit"}=e;return/*#__PURE__*/(0,d/* .css */.iv)("width:100%;justify-content:start;padding:",P/* .spacing["6"] */.W0["6"]," ",P/* .spacing["12"] */.W0["12"],";font-weight:",t,";color:",P/* .colorTokens.text.title */.Jv.text.title,";:hover{text-decoration:none;}:focus{box-shadow:none;}")},toggleIcon:e=>{var{isOpen:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";transition:transform 0.3s ease-in-out;",t&&(0,d/* .css */.iv)(rh()))},optionsContainer:/*#__PURE__*/(0,d/* .css */.iv)("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 */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";position:absolute;top:0;bottom:0;right:",P/* .spacing["8"] */.W0["8"],";margin:auto 0;display:flex;align-items:center;"),spinnerWrapper:e=>{var{isVisible:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:flex;justify-content:center;align-items:center;",!t&&(0,d/* .css */.iv)(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 rZ(){var e=(0,b._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);rZ=function t(){return e};return e}var rx=()=>{var e,t;var{pageInfo:n,onPageChange:a,itemsPerPage:s,onFilterItems:l}=nH();var d=(0,k/* .useFormContext */.Gc)();var v=d.watch("selectedCollection");var p=d.watch("existingContentIds");var[h,f]=(0,u.useState)("");var[m,b]=(0,u.useState)("asc");var[y,w]=(0,u.useState)("asc");var Z;var x=n$((0,i._)((0,r._)({page:String(n.page),collection_id:(Z=v===null||v===void 0?void 0:v.ID)!==null&&Z!==void 0?Z:null,content_types:h?[h]:["lesson","assignment"]},y?{order:y.toUpperCase()}:{},n.filter.search?{search:String(n.filter.search)}:{}),{exclude:p.map(e=>(0,eo/* .getIdWithoutPrefix */.W)("content-",e))}));var C=((e=x.data)===null||e===void 0?void 0:e.total_record)||0;var E=Number(((t=x.data)===null||t===void 0?void 0:t.total_page)||0);var W;var D=(W=v===null||v===void 0?void 0:v.post_title)!==null&&W!==void 0?W:(0,c.__)("All Contents","tutor");var T=d.watch("contents")||[];var q=T.map(e=>String(e.ID));var S=(0,u.useMemo)(()=>{var e;var t;return(t=(e=x.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[x.data]);var M=()=>{d.setValue("selectedCollection",null);a(1);l({search:""})};var B=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=S.filter(e=>!q.includes(String(e.ID)));d.setValue("contents",[...T,...t]);return}var n=T.filter(e=>!S.map(e=>String(e.ID)).includes(String(e.ID)));d.setValue("contents",n)};var I=()=>{return S.length>0&&S.every(e=>q.includes(String(e.ID)))};var z=()=>{b(e=>e==="asc"?"desc":"asc");return S.sort((e,t)=>{return m==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var P=(0,u.useMemo)(()=>{return[{value:"",label:(0,c.__)("All","tutor")},{value:"lesson",label:(0,c.__)("Lessons","tutor")},...(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_ASSIGNMENTS */.AO.TUTOR_ASSIGNMENTS)?[{value:"assignment",label:(0,c.__)("Assignments","tutor")}]:[]]},[]);var A=[{Header:C?/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{onChange:B,checked:x.isLoading||x.isRefetching?false:I(),label:(0,c.__)("Title","tutor"),labelCss:rC.tableTitle,isIndeterminate:S.length>0&&!I()&&T.length>0,"aria-label":(0,c.__)("Select all contents","tutor")}):(0,c.__)("# Title","tutor"),sortProperty:"title",Cell:e=>{return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.checkboxWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{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:x.isLoading||x.isRefetching?false:q.includes(String(e.ID))}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rC.checkboxLabel,children:e.post_title})]})}},{Header:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-type":true,css:rC.tableTitle,children:(0,c.__)("Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rC.type,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:rC.contentBadge({type:e.post_type}),children:n0[e.post_type]})})}}];if(x.isLoading){return/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingSection */.g4,{})}if(!x.data){return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rC.errorMessage,children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,o/* .jsx */.tZ)(o/* .Fragment */.HY,{children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.wrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.headerWithAction,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{css:U/* .styleUtils.backButton */.i.backButton,onClick:M,"aria-label":(0,c.__)("Go back to collection list","tutor"),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.headerTitle,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{children:[D," "]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:C,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{children:["(",/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",C,"tutor"),C),")"]})})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.tableActions,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(nj,{onFilterItems:l}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rC.tableFilters,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(rm,{"aria-label":(0,c.__)("Select content type","tutor"),options:P,value:h?P.find(e=>e.value===h)||P[0]:P[0],onChange:e=>{f(e.value)},isClearable:false,wrapperStyle:rC.selectInput}),/*#__PURE__*/(0,o/* .jsx */.tZ)(rn,{type:"lesson_assignment",onFilterChange:e=>{w(e.order||"asc")}})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rC.tableWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(eT,{headerHeight:48,isBordered:true,isRounded:true,columns:A,data:S,itemsPerPage:s,loading:x.isFetching||x.isRefetching,rowStyle:rC.tableRow,querySortProperties:["title"],querySortDirections:{title:y},onSortClick:e=>{if(e==="title"){var t=z();return t}}})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:E>1,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rC.paginatorWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nR,{currentPage:n.page,onPageChange:a,totalItems:C,itemsPerPage:s})})})]})})};/* ESM default export */const rk=rx;var rC={tableActions:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",P/* .spacing["16"] */.W0["16"],";padding:",P/* .spacing["16"] */.W0["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:0 ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";padding-inline:",P/* .spacing["20"] */.W0["20"],";}[data-type]{text-align:right;}td{padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["20"] */.W0["20"],";}"),tableRow:/*#__PURE__*/(0,d/* .css */.iv)("border-bottom:1px solid ",P/* .colorTokens.border.tertiary */.Jv.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:",P/* .spacing["20"] */.W0["20"]," ",P/* .spacing["16"] */.W0["16"],";"),headerWithAction:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";padding:0 ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body("medium"),";span{&:first-of-type{color:",P/* .colorTokens.text.title */.Jv.text.title,";}}span:last-of-type:not(:only-of-type){",A/* .typography.tiny */.c.tiny("medium"),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";}"),wrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small("medium"),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";"),checkboxLabel:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption("medium"),";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";"),checkboxWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";align-items:center;gap:",P/* .spacing["12"] */.W0["12"],";"),type:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";gap:",P/* .spacing["4"] */.W0["4"],";justify-content:end;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.tiny */.c.tiny("medium"),";padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["8"] */.W0["8"],";border-radius:",P/* .borderRadius["4"] */.E0["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,d/* .css */.iv)(ry(),P/* .colorTokens.icon.brand */.Jv.icon.brand)," ",t==="cb-assignment"&&(0,d/* .css */.iv)(rw(),P/* .colorTokens.icon.processing */.Jv.icon.processing),"  \n      ",t==="cb-question"&&(0,d/* .css */.iv)(rZ()))},errorMessage:/*#__PURE__*/(0,d/* .css */.iv)("height:100px;",U/* .styleUtils.display.flex */.i.display.flex("row"),";align-items:center;justify-content:center;"),tableFilters:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";justify-content:end;align-items:center;gap:",P/* .spacing["12"] */.W0["12"],";"),selectInput:/*#__PURE__*/(0,d/* .css */.iv)("max-width:150px;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/QuestionListTable.tsx
var rE=()=>{var e,t;var{pageInfo:n,onPageChange:i,itemsPerPage:a,onFilterItems:s}=nH();var l=(0,k/* .useFormContext */.Gc)();var d=l.watch("selectedCollection");var[v,p]=(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()}:{},v.length?{question_types:v}:{},n.filter.search?{search:String(n.filter.search)}:{}));var Z=((e=w.data)===null||e===void 0?void 0:e.total_record)||0;var x=Number(((t=w.data)===null||t===void 0?void 0:t.total_page)||0);var C;var E=(C=d===null||d===void 0?void 0:d.post_title)!==null&&C!==void 0?C:(0,c.__)("All Contents","tutor");var W=l.watch("contents")||[];var D=W.map(e=>String(e.ID));var T=(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 S=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=T.filter(e=>!D.includes(String(e.ID)));l.setValue("contents",[...W,...t]);return}var n=W.filter(e=>!T.map(e=>String(e.ID)).includes(String(e.ID)));l.setValue("contents",n)};var M=()=>{return T.length>0&&T.every(e=>D.includes(String(e.ID)))};var B=()=>{f(e=>e==="asc"?"desc":"asc");return T.sort((e,t)=>{return h==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var I=[{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:Z?/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{onChange:S,checked:w.isLoading||w.isRefetching?false:M(),label:(0,c.__)("Title","tutor"),labelCss:rD.tableTitle,isIndeterminate:T.length>0&&!M()&&W.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,o/* .jsxs */.BX)("div",{css:rD.checkboxWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(eM/* ["default"] */.Z,{onChange:r,checked:w.isLoading||w.isRefetching?false:D.includes(String(e.ID))}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rD.checkboxLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(t=I.find(t=>t.value===e.question_type))===null||t===void 0?void 0:t.icon,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:(n=I.find(t=>t.value===e.question_type))===null||n===void 0?void 0:n.icon,height:24,width:24})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:e.post_title})]})]})}}];if(w.isLoading){return/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingSection */.g4,{})}if(!w.data){return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rD.errorMessage,children:(0,c.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,o/* .jsx */.tZ)(o/* .Fragment */.HY,{children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rD.wrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rD.headerWithAction,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{css:U/* .styleUtils.backButton */.i.backButton,onClick:q,"aria-label":(0,c.__)("Go back to collection list","tutor"),tabIndex:0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rD.headerTitle,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{children:[E," "]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:Z,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{children:["(",/* translators: %d is the total number of contents */(0,c.sprintf)((0,c._n)("%d Item","%d Items",Z,"tutor"),Z),")"]})})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rD.tableActions,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(nj,{onFilterItems:s}),/*#__PURE__*/(0,o/* .jsx */.tZ)(rn,{type:"question",onFilterChange:e=>{b(e.order);p(e.questionTypes||[])}})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rD.tableWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(eT,{headerHeight:56,isBordered:true,isRounded:true,columns:z,data:T,itemsPerPage:a,loading:w.isFetching||w.isRefetching,querySortProperties:["title"],querySortDirections:{title:h},onSortClick:e=>{if(e==="title"){var t=B();return t}},rowStyle:rD.tableRow})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:x>1,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rD.paginatorWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nR,{currentPage:n.page,onPageChange:i,totalItems:Z,itemsPerPage:a})})})]})})};/* ESM default export */const rW=rE;var rD={tableActions:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",P/* .spacing["16"] */.W0["16"],";padding:",P/* .spacing["16"] */.W0["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:0 ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";}[data-type]{text-align:right;}"),tableRow:/*#__PURE__*/(0,d/* .css */.iv)("border-bottom:1px solid ",P/* .colorTokens.border.tertiary */.Jv.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,d/* .css */.iv)("margin:",P/* .spacing["20"] */.W0["20"]," ",P/* .spacing["16"] */.W0["16"],";"),headerWithAction:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("row"),";align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";padding:0 ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body("medium"),";span{&:first-of-type{color:",P/* .colorTokens.text.title */.Jv.text.title,";}}span:last-of-type:not(:only-of-type){",A/* .typography.tiny */.c.tiny("medium"),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";}"),wrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small("regular"),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";"),checkboxLabel:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["12"] */.W0["12"],";",A/* .typography.caption */.c.caption("medium"),";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";svg{flex-shrink:0;}span{width:100%;",U/* .styleUtils.text.ellipsis */.i.text.ellipsis(1),";}"),checkboxWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["12"] */.W0["12"],";"),type:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;gap:",P/* .spacing["4"] */.W0["4"],";justify-content:end;"),errorMessage:/*#__PURE__*/(0,d/* .css */.iv)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/index.tsx
var rT=(0,eo/* .getCourseId */.z)();var rq=e=>{var{closeModal:t,actions:n,onAddContent:a,type:s,topicId:l,contents:d,nextContentOrder:u}=e;var v;var p=(0,ed/* .useFormWithGlobalError */.O)({defaultValues:{selectedCollection:null,contents:[],existingContentIds:(v=d===null||d===void 0?void 0:d.map(e=>e.ID))!==null&&v!==void 0?v:[]}});var h=(0,ei/* .useAddContentBankContentToCourseMutation */.Bd)();var g=e=>(0,Z._)(function*(){a===null||a===void 0?void 0:a(e.contents);if(s==="lesson_assignment"){var n=yield h.mutateAsync({course_id:rT,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=p.watch("selectedCollection");return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .FormProvider */.RV,(0,i._)((0,r._)({},p),{children:/*#__PURE__*/(0,o/* .jsxs */.BX)(eS/* ["default"] */.Z,{onClose:()=>t({action:"CLOSE"}),title:(0,c.__)("Content Bank","tutor"),entireHeader:m&&/*#__PURE__*/(0,o/* .jsx */.tZ)(o/* .Fragment */.HY,{children:" "}),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentBank",height:24,width:24}),actions:n,maxWidth:720,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!m,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:s==="lesson_assignment",fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(rW,{}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(rk,{})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(n9,{type:s})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:p.watch("selectedCollection"),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rM.footer,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{size:"small",variant:"text",onClick:()=>t({action:"CLOSE"}),children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{size:"small",variant:"primary",onClick:p.handleSubmit(g),disabled:p.watch("contents").length===0,loading:s==="lesson_assignment"&&h.isPending,"data-cy":"add-content-button",children:(0,c.__)("Add","tutor")})]})})]})}))};/* ESM default export */const rS=rq;var rM={footer:/*#__PURE__*/(0,d/* .css */.iv)("box-shadow:0px 1px 0px 0px #e4e5e7 inset;height:56px;display:flex;align-items:center;justify-content:end;gap:",P/* .spacing["16"] */.W0["16"],";padding-inline:",P/* .spacing["16"] */.W0["16"],";")};// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/usePortalPopover.tsx
var rB=n(98567);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuestionList.tsx
var rI=[{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 */.y.tutor_pro_url;var rP=e=>{var{isEditing:t}=e;var[n,d]=(0,u.useState)(null);var[v,h]=(0,u.useState)(false);var g=(0,u.useRef)(null);var m=(0,u.useRef)(null);var b=(0,k/* .useFormContext */.Gc)();var{contentType:y,activeQuestionIndex:w,validationError:Z,setActiveQuestionId:x,setValidationError:E}=eG();var{remove:W,append:T,insert:q,move:S,fields:M}=(0,k/* .useFieldArray */.Dq)({control:b.control,name:"questions"});var{showModal:B}=(0,em/* .useModal */.d)();var I=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));var z=(0,u.useMemo)(()=>{if(!n){return null}return M.find(e=>e.question_id===n)},[n,M]);var P=b.watch("questions")||[];var A=b.getValues("questions.".concat(w));var L=(e,t)=>{var n=e2(A);if(n!==true){E(n);h(false);return}var r=(0,R/* .nanoid */.x0)();T({_data_status:e0/* .QuizDataStatus.NEW */.dP.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"),M.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,R/* .nanoid */.x0)(),_data_status:e0/* .QuizDataStatus.NEW */.dP.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,R/* .nanoid */.x0)(),is_saved:true,_data_status:e0/* .QuizDataStatus.NEW */.dP.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 */.dP.NEW,is_saved:false,answer_id:(0,R/* .nanoid */.x0)(),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:M.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}});E(null);x(r);h(false)};var U=e=>{var t=e2(A);if(t!==true){E(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 */.dP.NEW,is_cb_question:true,// this is to ensure unique question_id for each question
question_id:"".concat(t.question_id,"-").concat((0,R/* .nanoid */.x0)()),question_answers:t.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW}))})});T(n)};var X=e=>{for(var t of e){L("h5p",t)}};var F=(e,t)=>{var n=b.watch("questions.".concat(t));if(!n||Z){return}var o=(0,i._)((0,r._)({},e),{question_id:(0,R/* .nanoid */.x0)(),_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW,question_title:"".concat(n.question_title," (copy)"),question_answers:n.question_answers.map(e=>(0,i._)((0,r._)({},e),{answer_id:(0,R/* .nanoid */.x0)(),_data_status:e0/* .QuizDataStatus.NEW */.dP.NEW}))});var a=t+1;q(a,o)};var j=(e,t)=>{W(e);if(w===e){x("");E(null)}if(t._data_status!==e0/* .QuizDataStatus.NEW */.dP.NEW){b.setValue("deleted_question_ids",[...b.getValues("deleted_question_ids"),t.question_id])}};var Q=e=>{var{active:t,over:n}=e;if(!n||t.id===n.id){return}var r=M.findIndex(e=>e.question_id===t.id);var i=M.findIndex(e=>e.question_id===n.id);S(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,o/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rO.questionsLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:(0,c.__)("Questions","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"add-question",ref:m,type:"button",onClick:()=>{if(y==="tutor_h5p_quiz"){B({component:eL,props:{title:(0,c.__)("Select H5P Content","tutor"),onAddContent:e=>{X(e)},contentType:"tutor_h5p_quiz",addedContentIds:P.map(e=>e.question_description)}})}else{h(true)}},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plusSquareBrand",width:32,height:32})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{ref:g,css:rO.questionList,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:P.length>0,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rO.emptyQuestionText,children:(0,c.__)("No questions added yet.","tutor")}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:I,collisionDetection:a/* .closestCenter */.pE,modifiers:[s/* .restrictToWindowEdges */.hg],onDragStart:e=>{d(e.active.id)},onDragEnd:e=>Q(e),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:P.map(e=>(0,i._)((0,r._)({},e),{id:e.question_id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:P,children:(e,t)=>/*#__PURE__*/(0,o/* .jsx */.tZ)(nJ,{question:e,index:t,onDuplicateQuestion:e=>{F(e,t)},onRemoveQuestion:()=>j(t,e)},e.question_id)})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:z,children:e=>{var t=M.findIndex(t=>t.question_id===e.question_id);return/*#__PURE__*/(0,o/* .jsx */.tZ)(nJ,{question:e,index:t,onDuplicateQuestion:R/* .noop */.ZT,onRemoveQuestion:R/* .noop */.ZT,isOverlay:true},e.question_id)}})}),document.body)]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{gap:4,maxWidth:"240px",placement:el/* .CURRENT_VIEWPORT.isAboveTablet */.iM.isAboveTablet?rB/* .POPOVER_PLACEMENTS.BOTTOM */.h_.BOTTOM:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?rB/* .POPOVER_PLACEMENTS.LEFT */.h_.LEFT:rB/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.h_.ABSOLUTE_CENTER,triggerRef:m,isOpen:v,closePopover:()=>h(false),animationType:J/* .AnimationType.slideUp */.ru.slideUp,arrow:true,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rO.questionOptionsWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{css:rO.questionTypeOptionsTitle,children:(0,c.__)("Select Question Type","tutor")}),rI.map(e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:e.isPro&&!rz,fallback:/*#__PURE__*/(0,o/* .jsxs */.BX)("button",{type:"button",css:rO.questionTypeOption,onClick:()=>{L(e.value)},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:e.icon,width:24,height:24}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:e.label})]},e.value),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("button",{type:"button",css:rO.questionTypeOption,disabled:true,onClick:R/* .noop */.ZT,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:e.label}),/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",content:(0,c.__)("Pro","tutor")})]})]},e.value)},e.value)),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!rz,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_BANK */.AO.CONTENT_BANK),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rO.addFormContentBankButton,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"secondary",size:"small",onClick:()=>{B({component:rS,props:{title:(0,c.__)("Content Bank","tutor"),type:"question",onAddContent:e=>{U(e)}}});h(false)},icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentBank",width:24,height:24}),"data-cy":"add-from-content-bank",children:(0,c.__)("Add from Content Bank","tutor")})})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rO.addFormContentBankButton,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{disabled:true,variant:"secondary",size:"small",onClick:R/* .noop */.ZT,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentBank",width:24,height:24}),children:(0,c.__)("Add from Content Bank","tutor")})})})})]})})]})]})};/* ESM default export */const rA=rP;var rO={questionsLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;gap:",P/* .spacing["4"] */.W0["4"],";align-items:center;justify-content:space-between;border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";padding:",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["28"] */.W0["28"],";",A/* .typography.caption */.c.caption("medium"),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";button{",U/* .styleUtils.resetButton */.i.resetButton,";width:32px;height:32px;border-radius:",P/* .borderRadius["6"] */.E0["6"],";&:focus,&:active,&:hover{background:none;}svg{color:",P/* .colorTokens.action.primary["default"] */.Jv.action.primary["default"],";width:100%;height:100%;}:focus-visible{outline:2px solid ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";}}",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding:",P/* .spacing["16"] */.W0["16"],";}"),questionList:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";scrollbar-gutter:auto;padding:",P/* .spacing["8"] */.W0["8"]," 0 ",P/* .spacing["8"] */.W0["8"]," 0;"),questionTypeOptionsTitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption("medium"),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["20"] */.W0["20"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),addFormContentBankButton:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"],";border-top:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";button{width:100%;}"),questionOptionsWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;padding-block:",P/* .spacing["6"] */.W0["6"],";"),questionTypeOption:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";color:",P/* .colorTokens.text.title */.Jv.text.title,";width:100%;padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["20"] */.W0["20"],";transition:background-color 0.3s ease-in-out;display:flex;align-items:center;gap:",P/* .spacing["10"] */.W0["10"],";border:2px solid transparent;div{",U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";}&:focus,&:active,&:hover{background:none;color:",P/* .colorTokens.text.title */.Jv.text.title,";}:disabled{cursor:not-allowed;color:",P/* .colorTokens.text.primary */.Jv.text.primary,";[data-question-icon]{filter:grayscale(100%);}}:hover:enabled{background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";color:",P/* .colorTokens.text.title */.Jv.text.title,";}:focus:enabled,:active:enabled{border-color:",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";}"),emptyQuestionText:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.small */.c.small(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding:",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["8"] */.W0["8"]," ",P/* .spacing["28"] */.W0["28"],";")};// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/Card.tsx
function rN(){var e=(0,b._)(["\n      box-shadow: none;\n      border: 1px solid ",";\n    "]);rN=function t(){return e};return e}function rJ(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);rJ=function t(){return e};return e}function rL(){var e=(0,b._)(["\n      padding: "," "," "," ",";\n    "]);rL=function t(){return e};return e}function rU(){var e=(0,b._)(["\n      transform: rotate(180deg);\n    "]);rU=function t(){return e};return e}var rR=e=>{var{children:t,hasBorder:n=false,title:i,subtitle:a,actionTray:s,collapsed:l=false,noSeparator:d=false,hideArrow:c=false,isAlternative:v=false,collapsedAnimationDependencies:p}=e;var h;var[f,g]=(0,u.useState)(l);var m=(0,u.useRef)(null);var[b,y]=(0,w/* .useSpring */.q_)({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,...p||[]]);(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(m.current)){y.start({height:!f?m.current.scrollHeight:0,opacity:!f?1:0})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[f,...p||[]]);return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rF.wrapper(n),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:rF.headerWrapper(f||d,v),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rF.headerAndAction,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rF.header,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("h5",{css:rF.title,children:i}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("p",{css:rF.subtitle,children:a})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rF.actions,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:s,children:s}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!c,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:rF.collapseButton({isCollapsed:f}),onClick:()=>g(!f),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"chevronDown",width:24,height:24,style:rF.arrowUpDown})})})]})]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(w/* .animated.div */.q.div,{style:(0,r._)({},b),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{ref:m,css:rF.cardBody,children:t})})]})};/* ESM default export */const rX=rR;var rF={wrapper:e=>/*#__PURE__*/(0,d/* .css */.iv)("width:100%;border-radius:",P/* .borderRadius.card */.E0.card,";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";box-shadow:",P/* .shadow.card */.AF.card,";",e&&(0,d/* .css */.iv)(rN(),P/* .colorTokens.stroke.divider */.Jv.stroke.divider)),headerWrapper:(e,t)=>/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["8"] */.W0["8"],";display:flex;flex-direction:column;justify-content:center;gap:",P/* .spacing["4"] */.W0["4"],";",!e&&(0,d/* .css */.iv)(rJ(),P/* .colorTokens.stroke.divider */.Jv.stroke.divider)," ",t&&(0,d/* .css */.iv)(rL(),P/* .spacing["12"] */.W0["12"],P/* .spacing["16"] */.W0["16"],P/* .spacing["12"] */.W0["12"],P/* .spacing["24"] */.W0["24"])),headerAndAction:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:space-between;align-items:center;"),header:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;padding:",P/* .spacing["4"] */.W0["4"]," ",P/* .spacing["16"] */.W0["16"],";"),subtitle:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";"),title:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body("medium"),";color:",P/* .colorTokens.text.primary */.Jv.text.primary,";display:flex;align-items:center;"),collapseButton:e=>{var{isCollapsed:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";display:flex;align-items:center;transition:transform 0.3s ease-in-out;",t&&(0,d/* .css */.iv)(rU()),"    &:focus,&:active,&:hover{background:none;color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";}")},arrowUpDown:/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.icon["default"] */.Jv.icon["default"],";display:flex;justify-content:center;align-items:center;"),cardBody:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["24"] */.W0["24"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["24"] */.W0["24"],";"),actions:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/QuizSettings.tsx
var rj=(0,eo/* .getCourseId */.z)();var rQ=e=>{var{contentDripType:t}=e;var{quizId:n,contentType:a}=eG();var s=(0,k/* .useFormContext */.Gc)();var l=s.watch("quiz_option.feedback_mode");var d=(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&t==="unlock_sequentially"&&l==="retry";var u=s.watch("quiz_option.content_drip_settings.prerequisites");var v=(0,x/* .useQueryClient */.NL)();var p=v.getQueryData(["Topic",rj]);var h=Object.keys(s.formState.errors).length;return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.settings,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(rX,{title:(0,c.__)("Basic Settings","tutor"),collapsedAnimationDependencies:[l,u===null||u===void 0?void 0:u.length,h],children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.formWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.timeWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.time_limit.time_value",control:s.control,rules:(0,ec/* .requiredRule */.n0)(),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.time_limit.time_type",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(I/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsx */.tZ)(o/* .Fragment */.HY,{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,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.hide_quiz_time_display",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Hide Quiz Time","tutor")}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.feedback_mode",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(I/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Feedback Mode","tutor"),leftIcon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:l==="retry",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.attempts_allowed",control:s.control,rules:(0,i._)((0,r._)({},(0,ec/* .requiredRule */.n0)()),{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,o/* .jsx */.tZ)(M/* ["default"] */.Z,(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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:d&&a!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.pass_is_required",control:s.control,rules:(0,ec/* .requiredRule */.n0)(),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.passing_grade",control:s.control,rules:(0,ec/* .requiredRule */.n0)(),render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(B/* ["default"] */.Z,(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:U/* .styleUtils.inputCurrencyStyle */.i.inputCurrencyStyle}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.max_questions_for_answer",rules:(0,ec/* .requiredRule */.n0)(),control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(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,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&a!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t==="specific_days",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.content_drip_settings.after_xdays_of_enroll",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t==="unlock_by_date",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.content_drip_settings.unlock_date",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(q/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t==="after_finishing_prerequisites",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.content_drip_settings.prerequisites",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(G,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.contentDripLabel,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentDrip",height:24,width:24}),(0,c.__)("Prerequisites","tutor")]}),placeholder:(0,c.__)("Select Prerequisite","tutor"),options:p.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,o/* .jsx */.tZ)(rX,{title:(0,c.__)("Advanced Settings","tutor"),collapsedAnimationDependencies:[h],children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:rY.formWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.quiz_auto_start",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(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,o/* .jsxs */.BX)("div",{css:rY.questionLayoutAndOrder,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.question_layout_view",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(I/* ["default"] */.Z,(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,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.questions_order",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(I/* ["default"] */.Z,(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,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:a!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.hide_question_number_overview",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(ea/* ["default"] */.Z,(0,i._)((0,r._)({},e),{label:(0,c.__)("Hide Question Number","tutor")}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.short_answer_characters_limit",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Set Character Limit for Short Answers","tutor"),selectOnFocus:true}))}),/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{name:"quiz_option.open_ended_answer_characters_limit",control:s.control,render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{type:"number",label:(0,c.__)("Set Character Limit for Open-Ended/Essay Answers","tutor"),selectOnFocus:true}))})]})]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(en/* ["default"] */.Z,{section:"Curriculum.Quiz.bottom_of_settings",form:s})]})};/* ESM default export */const rH=rQ;var rY={settings:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["24"] */.W0["24"],";"),formWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),"    gap:",P/* .spacing["20"] */.W0["20"],";"),timeWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    align-items:flex-start;gap:",P/* .spacing["8"] */.W0["8"],";"),questionLayoutAndOrder:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),"    gap:",P/* .spacing["20"] */.W0["20"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{flex-direction:column;}"),contentDripLabel:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;svg{margin-right:",P/* .spacing["4"] */.W0["4"],";color:",P/* .colorTokens.icon.success */.Jv.icon.success,";}")};// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useMutation.js
var rV=n(65228);// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/services/quiz.ts
var rK=(e,t)=>{var n,i,o,a,s,l,d,c,u,v,p;return(0,r._)({ID:e.ID,_data_status:e0/* .QuizDataStatus.NO_CHANGE */.dP.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:(o=e.quiz_option.time_limit.time_value)!==null&&o!==void 0?o:0,time_type:(a=e.quiz_option.time_limit.time_type)!==null&&a!==void 0?a:"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:(v=e.quiz_option.short_answer_characters_limit)!==null&&v!==void 0?v:200,open_ended_answer_characters_limit:(p=e.quiz_option.open_ended_answer_characters_limit)!==null&&p!==void 0?p: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 rG=(e,t,n,o,a,s)=>{var l,d;return(0,r._)({course_id:o,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,R/* .isAddonEnabled */.ro)(el/* .Addons.H5P_INTEGRATION */.AO.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,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&n==="unlock_sequentially"&&e.quiz_option.feedback_mode==="retry"&&{pass_is_required:e.quiz_option.pass_is_required?"1":"0"},(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.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,R/* .isAddonEnabled */.ro)(el/* .Addons.H5P_INTEGRATION */.AO.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 */.y.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(a.map(t=>[t,e[t]])))})},deleted_question_ids:e.deleted_question_ids,deleted_answer_ids:e.deleted_answer_ids},(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&n==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.quiz_option.content_drip_settings.unlock_date},(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&n==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.quiz_option.content_drip_settings.after_xdays_of_enroll},(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_DRIP */.AO.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 eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].QUIZ_IMPORT_DATA */.Z.QUIZ_IMPORT_DATA,e)};var r1=()=>{var e=(0,x/* .useQueryClient */.NL)();var{showToast:t}=(0,eH/* .useToast */.p)();return(0,rV/* .useMutation */.D)({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,R/* .convertToErrorMessage */.Mo)(e),type:"danger"})}})};var r2=e=>{return eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].QUIZ_EXPORT_DATA */.Z.QUIZ_EXPORT_DATA,{quiz_id:e})};var r4=()=>{var{showToast:e}=(0,eH/* .useToast */.p)();return(0,rV/* .useMutation */.D)({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 o=new Blob([n],{type:"text/csv"});var a=window.webkitURL.createObjectURL(o);var s=document.createElement("a");s.setAttribute("href",a);s.setAttribute("download","tutor-quiz-".concat(t.data.title,".csv"));document.body.appendChild(s);s.click()},onError:t=>{e({message:(0,R/* .convertToErrorMessage */.Mo)(t),type:"danger"})}})};var r8=e=>{return eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].SAVE_QUIZ */.Z.SAVE_QUIZ,e)};var r3=()=>{var e=(0,x/* .useQueryClient */.NL)();var{showToast:t}=(0,eH/* .useToast */.p)();return(0,rV/* .useMutation */.D)({mutationFn:r8,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,R/* .convertToErrorMessage */.Mo)(e),type:"danger"})}})};var r5=e=>{return eI/* .wpAjaxInstance.get */.R.get(ez/* ["default"].GET_QUIZ_DETAILS */.Z.GET_QUIZ_DETAILS,{params:{quiz_id:e}})};var r6=e=>{return(0,eB/* .useQuery */.a)({queryKey:["Quiz",e],queryFn:()=>r5(e).then(e=>e.data),enabled:!!e})};var r9=e=>{return wpAjaxInstance.post(endpoints.GET_H5P_QUIZ_CONTENT_BY_ID,{content_id:e}).then(e=>e.data)};var r7=(e,t)=>{return useQuery({queryKey:["H5PQuizContent",e],queryFn:()=>r9(e),enabled:!!e&&t==="tutor_h5p_quiz"})};var ie=e=>{return eI/* .wpAjaxInstance.post */.R.post(ez/* ["default"].DELETE_QUIZ */.Z.DELETE_QUIZ,{quiz_id:e})};var it=()=>{var e=(0,x/* .useQueryClient */.NL)();var{showToast:t}=(0,eH/* .useToast */.p)();return(0,rV/* .useMutation */.D)({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,R/* .convertToErrorMessage */.Mo)(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,eo/* .getCourseId */.z)();var io=e=>{var{closeModal:t,icon:n,title:a,subtitle:s,quizId:l,topicId:d,contentDripType:v,contentType:p}=e;var{fields:h}=(0,er/* .useCourseBuilderSlot */.l)();var[m,b]=(0,u.useState)(false);var[y,w]=(0,u.useState)("details");var[x,C]=(0,u.useState)(!(0,e0/* .isDefined */.$K)(l));var E=(0,u.useRef)(null);var D=r3();var T=r6(l||"");var{showToast:q}=(0,eH/* .useToast */.p)();var S=(0,ed/* .useFormWithGlobalError */.O)({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:p==="tutor_h5p_quiz"?0:10,quiz_auto_start:false,question_layout_view:p==="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 M=S.formState.dirtyFields&&Object.keys(S.formState.dirtyFields).length>0;(0,u.useEffect)(()=>{var e=e=>{if(M){e.preventDefault();return}S.reset()};window.addEventListener("beforeunload",e);return()=>{window.removeEventListener("beforeunload",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[M]);(0,u.useEffect)(()=>{if(!T.data){return}var e=rK(T.data,(0,R/* .findSlotFields */.hk)({fields:h.Curriculum.Quiz}));S.reset(e);// eslint-disable-next-line react-hooks/exhaustive-deps
},[T.data]);var B=(e,n,r)=>(0,Z._)(function*(){if(!e.quiz_title){w("details");Promise.resolve().then(()=>{S.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 o=e2(i);if(o!==true){r(o);w("details");return}C(false);var a=rG(e,d,v,ii,(0,R/* .findSlotFields */.hk)({fields:h.Curriculum.Quiz,slotKey:"after_question_description"},{fields:h.Curriculum.Quiz,slotKey:"bottom_of_question_sidebar"}),(0,R/* .findSlotFields */.hk)({fields:h.Curriculum.Quiz,slotKey:"bottom_of_settings"}));var s=yield D.mutateAsync(a);if(s.data){C(false);t({action:"CONFIRM"});S.reset()}})();(0,u.useEffect)(()=>{if(x){S.setFocus("quiz_title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[x]);return/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .FormProvider */.RV,(0,i._)((0,r._)({},S),{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(e$,{quizId:l||"",contentType:p||"tutor_quiz",children:e=>{var{activeQuestionIndex:d,activeQuestionId:u,setActiveQuestionId:h,setValidationError:Z}=e;return/*#__PURE__*/(0,o/* .jsxs */.BX)(et/* ["default"] */.Z,{onClose:()=>t({action:"CLOSE"}),icon:M?/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"warning",width:24,height:24}):n,title:M?el/* .CURRENT_VIEWPORT.isAboveDesktop */.iM.isAboveDesktop?(0,c.__)("Unsaved Changes","tutor"):"":a,subtitle:el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.iM.isAboveSmallMobile?s:"",maxWidth:1218,headerChildren:/*#__PURE__*/(0,o/* .jsx */.tZ)(eV/* ["default"] */.Z,{wrapperCss:is.tabsWrapper,activeTab:y,tabList:[{label:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?(0,c.__)("Question Details","tutor"):"",value:"details",icon:!el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"text",width:24,height:24}):null},{label:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?(0,c.__)("Settings","tutor"):"",value:"settings",icon:!el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"settings",width:24,height:24}):null}],onChange:e=>w(e)}),actions:M&&/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{if(M){b(true);return}t()},ref:E,children:l?el/* .CURRENT_VIEWPORT.isAboveSmallMobile */.iM.isAboveSmallMobile?(0,c.__)("Discard Changes","tutor"):(0,c.__)("Discard","tutor"):(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y==="settings"||l,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"quiz-next",variant:"primary",size:"small",onClick:()=>w("settings"),children:(0,c.__)("Next","tutor")}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-quiz",loading:D.isPending,variant:"primary",size:"small",onClick:S.handleSubmit(e=>B(e,d,Z)),children:(0,c.__)("Save","tutor")})})]}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:is.wrapper({activeTab:y,isH5pQuiz:p==="tutor_h5p_quiz"}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!T.isLoading,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y==="details",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:is.left,children:/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:y==="details",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:is.quizTitleWrapper,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:is.quizForm,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:S.control,name:"quiz_title",rules:{required:(0,c.__)("Quiz title is required","tutor")},render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(tk,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add quiz title","tutor"),size:"small",isEdit:x,onToggleEdit:e=>{C(e)},wrapperCss:is.quizTitle}))}),/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:x,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:S.control,name:"quiz_description",render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(eY/* ["default"] */.Z,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a summary","tutor"),enableResize:false,rows:2}))}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:is.quizFormButtonWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",type:"button",onClick:()=>{if(!S.watch("quiz_title")){t()}C(false)},size:"small",children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-quiz-title",loading:D.isPending,variant:"secondary",type:"submit",size:"small",onClick:()=>{if(!S.getValues("quiz_title")){S.trigger("quiz_title");return}C(false)},children:(0,c.__)("Ok","tutor")})]})]})]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(rA,{isEditing:x})]})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:is.content({activeTab:y}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y==="settings",fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(nS,{}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(rH,{contentDripType:v})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:y==="details"&&p!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:is.right,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(e6,{})})})]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(W/* ["default"] */.Z,{isOpen:m,triggerRef:E,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:J/* .AnimationType.slideUp */.ru.slideUp,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?rB/* .POPOVER_PLACEMENTS.BOTTOM */.h_.BOTTOM:rB/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.h_.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;S.reset();Z(null);if(!((e=T.data)===null||e===void 0?void 0:e.questions.find(e=>e.question_id===u))){h("")}if(!l){t()}}})]})}})}))};/* ESM default export */const ia=io;var is={wrapper:e=>{var{activeTab:t,isH5pQuiz:n}=e;return/*#__PURE__*/(0,d/* .css */.iv)("width:100%;display:grid;grid-template-columns:",t==="details"?n?"513px 1fr":"352px 1fr 280px":"1fr",";height:100%;",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{width:100%;grid-template-columns:1fr;height:max-content;}")},tabsWrapper:/*#__PURE__*/(0,d/* .css */.iv)("height:",el/* .modal.HEADER_HEIGHT */.oC.HEADER_HEIGHT,"px;",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{button{min-width:auto;}}"),left:/*#__PURE__*/(0,d/* .css */.iv)("border-right:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),content:e=>{var{activeTab:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";padding:",P/* .spacing["32"] */.W0["32"]," 0 ",P/* .spacing["48"] */.W0["48"]," ",P/* .spacing["6"] */.W0["6"],";",t==="settings"&&(0,d/* .css */.iv)(ir(),P/* .spacing["24"] */.W0["24"],P/* .Breakpoint.smallTablet */.Uo.smallTablet,P/* .spacing["16"] */.W0["16"],P/* .spacing["8"] */.W0["8"],P/* .spacing["24"] */.W0["24"],P/* .spacing["8"] */.W0["8"],P/* .Breakpoint.smallMobile */.Uo.smallMobile,P/* .spacing["8"] */.W0["8"]))},right:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.overflowYAuto */.i.overflowYAuto,";",U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["16"] */.W0["16"],";border-left:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";"),quizTitleWrapper:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";padding:",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["32"] */.W0["32"]," ",P/* .spacing["16"] */.W0["16"]," ",P/* .spacing["28"] */.W0["28"],";border-bottom:1px solid ",P/* .colorTokens.stroke.divider */.Jv.stroke.divider,";",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{padding:",P/* .spacing["8"] */.W0["8"],";}"),quizNameWithButton:/*#__PURE__*/(0,d/* .css */.iv)("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 ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";border-radius:",P/* .borderRadius["6"] */.E0["6"],";button{display:block;}}",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{button{display:block;}}"),quizTitle:/*#__PURE__*/(0,d/* .css */.iv)("padding:0;[data-placeholder]{padding:0;}[data-question-title-edit-button]{background-color:",P/* .colorTokens.background.white */.Jv.background.white,";}&:hover{background-color:transparent;}"),quizForm:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;flex-direction:column;gap:",P/* .spacing["12"] */.W0["12"],";"),quizFormButtonWrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;justify-content:end;margin-top:",P/* .spacing["4"] */.W0["4"],";gap:",P/* .spacing["8"] */.W0["8"],";")};// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/additional/meeting/GoogleMeetForm.tsx
var il=n(29422);// 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 iv={lesson:{name:"lesson",color:P/* .colorTokens.icon["default"] */.Jv.icon["default"]},tutor_quiz:{name:"quiz",color:P/* .colorTokens.design.warning */.Jv.design.warning},tutor_assignments:{name:"assignment",color:P/* .colorTokens.icon.processing */.Jv.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:P/* .colorTokens.icon["default"] */.Jv.icon["default"]},"cb-assignment":{name:"assignment",color:P/* .colorTokens.icon.processing */.Jv.icon.processing}};var ip={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:ia,tutor_assignments:eh,tutor_h5p_quiz:ia};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 */.y.tutor_pro_url;var iy=(0,eo/* .getCourseId */.z)();var iw=e=>{var{type:t,topic:n,content:a,listeners:s,isDragging:l=false,onCopy:v,onDelete:p}=e;var h=(0,eo/* .getIdWithoutPrefix */.W)("topic-",n.id);var f=(0,eo/* .getIdWithoutPrefix */.W)("content-",a.id);var m=(0,x/* .useQueryClient */.NL)();var b=m.getQueryData(["CourseDetails",Number(iy)]);var y=(0,k/* .useFormContext */.Gc)();var[w,q]=(0,u.useState)(null);var[S,M]=(0,u.useState)(false);var B=(0,u.useRef)(null);var I=(0,u.useRef)(null);var z=iv[t]||{name:"lesson",color:P/* .colorTokens.icon["default"] */.Jv.icon["default"]};var{showModal:A}=(0,em/* .useModal */.d)();var O=(0,ei/* .useDuplicateContentMutation */.P_)();var L=(0,ei/* .useDeleteContentMutation */.PI)();var X=it();var F=(0,ei/* .useDeleteContentMutation */.PI)();var j=(0,ei/* .useDeleteContentMutation */.PI)();var Q=r4();var H=(0,ei/* .useDeleteContentBankContentMutation */.RE)();var Y=()=>{var e=t;if(ih[e]){A({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,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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 V=()=>(0,Z._)(function*(){if(["lesson","tutor_assignments"].includes(t)){yield L.mutateAsync(f)}else if(["tutor_quiz","tutor_h5p_quiz"].includes(t)){yield X.mutateAsync(f)}else if(t==="tutor-google-meet"){yield F.mutateAsync(f)}else if(t==="tutor_zoom_meeting"){yield j.mutateAsync(f)}else if(["cb-lesson","cb-assignment"].includes(t)){yield H.mutateAsync({topicId:h,contentId:f})}M(false);p===null||p===void 0?void 0:p()})();var K=()=>{var e={lesson:"lesson",tutor_assignments:"assignment",tutor_quiz:"quiz",tutor_h5p_quiz:"quiz"};O.mutateAsync({course_id:iy,content_id:f,content_type:e[t]});v===null||v===void 0?void 0:v()};return/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ix.wrapper({isDragging:l,isActive:w===t||S||O.isPending}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",(0,i._)((0,r._)({css:ix.iconAndTitle({isDragging:l})},s),{children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-content-icon":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:z.name,width:24,height:24,style:/*#__PURE__*/(0,d/* .css */.iv)("color:",z.color,";")})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{"data-bar-icon":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"bars",width:24,height:24})}),/*#__PURE__*/(0,o/* .jsxs */.BX)("p",{css:ix.title,onClick:Y,onKeyDown:R/* .noop */.ZT,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{dangerouslySetInnerHTML:{__html:a.title}}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(t==="tutor_quiz"||t==="tutor_h5p_quiz")&&!!a.total_question,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{"data-question-count":true,children:["(",/* translators: %s is the total number of questions */(0,c.sprintf)((0,c.__)("%s Questions","tutor"),a.total_question),")"]})})]})]})),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:ix.actions,"data-actions":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t==="tutor_quiz",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Export Quiz","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!ib,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.QUIZ_EXPORT_IMPORT */.AO.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:()=>{Q.mutate(f)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"export",width:24,height:24})})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:true,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"export",width:24,height:24})})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:im.includes(t),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"edit-".concat(t),ref:B,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:Y,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!["tutor_zoom_meeting","tutor_zoom_meeting"].includes(t),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!O.isPending,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.ZP,{size:24}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!ib,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"duplicate-".concat(t),type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:K,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{disabled:true,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"delete-".concat(t),ref:I,type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,onClick:()=>{M(true)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24})})})]})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)(D/* ["default"] */.Z,{triggerRef:B,isOpen:w!==null,closePopover:R/* .noop */.ZT,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?rB/* .POPOVER_PLACEMENTS.BOTTOM */.h_.BOTTOM:rB/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.h_.ABSOLUTE_CENTER,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w==="tutor_zoom_meeting",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(T/* ["default"] */.Z,{data:null,topicId:h,meetingHost:(b===null||b===void 0?void 0:b.zoom_users)||{},onCancel:()=>q(null),meetingId:f})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w==="tutor-google-meet",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(il/* ["default"] */.Z,{data:null,topicId:h,onCancel:()=>q(null),meetingId:f})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(W/* ["default"] */.Z,{isOpen:S,isLoading:L.isPending||X.isPending||F.isPending||j.isPending||H.isPending,triggerRef:I,closePopover:R/* .noop */.ZT,maxWidth:"258px",title:(0,c.sprintf)((0,c.__)('Delete "%s"',"tutor"),a.title),message:ip[t]||(0,c.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:J/* .AnimationType.slideUp */.ru.slideUp,confirmButton:{text:(0,c.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,c.__)("Cancel","tutor"),variant:"text"},onConfirmation:V,onCancel:()=>M(false)})]})};/* ESM default export */const iZ=/*#__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 ix={wrapper:e=>{var{isDragging:t=false,isActive:n=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("width:100%;padding:",P/* .spacing["10"] */.W0["10"]," ",P/* .spacing["8"] */.W0["8"],";border:1px solid transparent;border-radius:",P/* .borderRadius["6"] */.E0["6"],";display:flex;justify-content:space-between;align-items:center;opacity:1;",t&&(0,d/* .css */.iv)(id(),P/* .colorTokens.stroke.hover */.Jv.stroke.hover),"    [data-content-icon],[data-bar-icon]{display:flex;height:24px;}:hover,:focus-within{border-color:",P/* .colorTokens.stroke.border */.Jv.stroke.border,";background-color:",P/* .colorTokens.background.white */.Jv.background.white,";[data-content-icon]{display:none;}[data-bar-icon]{display:block;}[data-actions]{opacity:",t?0:1,";}}",n&&(0,d/* .css */.iv)(ic(),P/* .colorTokens.stroke.border */.Jv.stroke.border,P/* .colorTokens.background.white */.Jv.background.white)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-actions]{opacity:1;}}")},title:/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.title */.Jv.text.title,";display:flex;align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";cursor:pointer;span{&:first-of-type{",U/* .styleUtils.text.ellipsis */.i.text.ellipsis(2),"}}[data-question-count]{color:",P/* .colorTokens.text.hints */.Jv.text.hints,";}"),iconAndTitle:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";cursor:grab;flex-grow:1;[data-bar-icon]{display:none;}",t&&(0,d/* .css */.iv)(iu()))},actions:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;opacity:0;align-items:start;gap:",P/* .spacing["8"] */.W0["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicContentWrapper.tsx
var ik=e=>(0,l/* .defaultAnimateLayoutChanges */.cP)((0,i._)((0,r._)({},e),{wasDragging:true}));var iC=e=>{var{topic:t,content:n}=e;var{attributes:a,listeners:s,setNodeRef:d,transform:c,transition:u,isDragging:v}=(0,l/* .useSortable */.nB)({id:n.ID,data:{type:"content"},animateLayoutChanges:ik});var p={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(c),transition:u};return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",(0,i._)((0,r._)({},a),{ref:d,style:p,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(iZ,{type:n.post_type,topic:t,listeners:s,isDragging:v,content:{id:n.ID,title:n.post_title,total_question:n.total_question||0}})}))};/* ESM default export */const iE=iC;// CONCATENATED MODULE: ./assets/react/v3/shared/molecules/FileUploader.tsx
var iW=e=>{var{acceptedTypes:t,onUpload:n,onError:r,maxFileSize:i=Number((es/* .tutorConfig */.y===null||es/* .tutorConfig */.y===void 0?void 0:es/* .tutorConfig.max_upload_size */.y.max_upload_size)||"")||el/* .MAX_FILE_SIZE */.Tb}=e;var o=(0,u.useRef)(null);var a=e=>{var{files:o}=e.target;if(!o||o.length===0){r([(0,c.__)("No files selected","tutor")]);return}var a=[];var s=[];for(var l of[...o]){if(!t.includes((0,R/* .getFileExtensionFromName */.vj)(l.name))){a.push((0,c.__)("Invalid file type","tutor"))}else if(l.size>i){a.push((0,c.__)("Maximum upload size exceeded","tutor"))}else{s.push(l)}}if(s.length){n(s)}if(a.length){r(a)}e.target.value=""};return{fileInputRef:o,handleChange:a}};var iD=e=>{var{onUpload:t,onError:n,acceptedTypes:r,label:i,multiple:o=false,disabled:a=false,maxFileSize:s=formatReadAbleBytesToBytes((tutorConfig===null||tutorConfig===void 0?void 0:tutorConfig.max_upload_size)||"")||MAX_FILE_SIZE}=e;var{fileInputRef:l,handleChange:d}=iW({acceptedTypes:r,onUpload:t,onError:n,maxFileSize:s});return /*#__PURE__*/_jsxs("button",{type:"button",css:iT.uploadButton,onClick:()=>{var e;return(e=l.current)===null||e===void 0?void 0:e.click()},disabled:a,children:[/*#__PURE__*/_jsx("input",{ref:l,type:"file",css:iT.fileInput,accept:r.join(","),onChange:d,multiple:o,disabled:a}),/*#__PURE__*/_jsx(SVGIcon,{name:"storeImage",width:26,height:20}),/*#__PURE__*/_jsx("span",{css:iT.text,children:i})]})};var iT={uploadButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,"    background:",P/* .colorTokens.background["default"] */.Jv.background["default"],";border:1px dashed ",P/* .colorTokens.stroke.border */.Jv.stroke.border,";border-radius:",P/* .borderRadius["8"] */.E0["8"],";display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1;gap:",P/* .spacing["12"] */.W0["12"],";"),fileInput:/*#__PURE__*/(0,d/* .css */.iv)("display:none;"),text:/*#__PURE__*/(0,d/* .css */.iv)("color:",P/* .colorTokens.text.subdued */.Jv.text.subdued,";",A/* .typography.body */.c.body())};var iq=e=>{var{onUpload:t,onError:n,acceptedTypes:r,multiple:i=false,disabled:o=false,children:a,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}=iW({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:o,children:[/*#__PURE__*/_jsx("input",{ref:d,type:"file",css:iT.fileInput,accept:r.join(","),onChange:c,multiple:i,disabled:o}),a]}))};/* ESM default export */const iS=/* unused pure expression or super */null&&iD;// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicFooter.tsx
var iM=(0,eo/* .getCourseId */.z)();var iB=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var iI=(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.AO.TUTOR_GOOGLE_MEET_INTEGRATION)||(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_ZOOM_INTEGRATION */.AO.TUTOR_ZOOM_INTEGRATION);var iz=e=>{var{topic:t,nextContentOrder:n}=e;var r=(0,eo/* .getIdWithoutPrefix */.W)("topic-",t.id);var{showToast:i}=(0,eH/* .useToast */.p)();var{showModal:a}=(0,em/* .useModal */.d)();var s=(0,k/* .useFormContext */.Gc)();var[l,d]=(0,u.useState)(null);var[v,p]=(0,u.useState)(false);var h=(0,u.useRef)(null);var g=(0,u.useRef)(null);var m=r1();var b=(0,x/* .useQueryClient */.NL)();var y=b.getQueryData(["CourseDetails",Number(iM)]);var{fileInputRef:w,handleChange:E}=iW({acceptedTypes:[".csv"],onUpload:e=>(0,Z._)(function*(){yield m.mutateAsync({topic_id:r,csv_file:e[0]});p(false)})(),onError:e=>{for(var t of e){i({message:t,type:"danger"})}p(false)}});return/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iA.contentButtons,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iA.leftButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-lesson",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.contentButton,onClick:()=>{a({component:ej,props:{contentDripType:s.watch("contentDripType"),topicId:r,title:(0,c.__)("Lesson","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.contentButton,onClick:()=>{a({component:ia,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Quiz","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.H5P_INTEGRATION */.AO.H5P_INTEGRATION),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-interactive-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.contentButton,onClick:()=>{a({component:ia,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Interactive Quiz","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(C/* ["default"] */.Z,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:true,onClick:R/* .noop */.ZT,children:(0,c.__)("Interactive Quiz","tutor")})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_ASSIGNMENTS */.AO.TUTOR_ASSIGNMENTS),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-assignment",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.contentButton,onClick:()=>{a({component:eh,props:{topicId:r,contentDripType:s.watch("contentDripType"),title:(0,c.__)("Assignment","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{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,o/* .jsx */.tZ)(C/* ["default"] */.Z,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plus",width:24,height:24}),disabled:true,onClick:R/* .noop */.ZT,children:(0,c.__)("Assignment","tutor")})})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iA.rightButtons,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.CONTENT_BANK */.AO.CONTENT_BANK),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentBank",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.contentButton,"data-cy":"add-from-content-bank",onClick:()=>{a({id:"content-bank-collection-list",component:rS,props:{type:"lesson_assignment",topicId:r,nextContentOrder:n}})},children:(0,c.__)("Content Bank","tutor")})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"contentBank",width:24,height:24}),disabled:true,onClick:R/* .noop */.ZT,children:(0,c.__)("Content Bank","tutor")})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB||iI,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:iB,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"import",width:24,height:24}),disabled:true,onClick:R/* .noop */.ZT,children:(0,c.__)("Import Quiz","tutor")})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:(0,R/* .isAddonEnabled */.ro)(el/* .Addons.QUIZ_EXPORT_IMPORT */.AO.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"import",width:24,height:24}),disabled:!t.isSaved,buttonCss:iA.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,o/* .jsxs */.BX)(nB/* ["default"] */.Z,{isOpen:v,onClick:()=>p(true),closePopover:()=>p(false),disabled:!t.isSaved,dotsOrientation:"vertical",maxWidth:iB?"220px":"250px",isInverse:true,closeOnEscape:false,size:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?"medium":"small",children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB||(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.AO.TUTOR_GOOGLE_MEET_INTEGRATION),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nB/* ["default"].Option */.Z.Option,{text:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{ref:h,css:iA.threeDotButton,children:[(0,c.__)("Meet live lesson","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iB,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{width:24,height:24,name:"googleMeetColorize",isColorIcon:true}),onClick:()=>d("tutor-google-meet")})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB||(0,R/* .isAddonEnabled */.ro)(el/* .Addons.TUTOR_ZOOM_INTEGRATION */.AO.TUTOR_ZOOM_INTEGRATION),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nB/* ["default"].Option */.Z.Option,{text:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{ref:g,css:iA.threeDotButton,children:[(0,c.__)("Zoom live lesson","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iB,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{width:24,height:24,name:"zoomColorize",isColorIcon:true}),onClick:()=>d("tutor_zoom_meeting")})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB||(0,R/* .isAddonEnabled */.ro)(el/* .Addons.QUIZ_EXPORT_IMPORT */.AO.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(nB/* ["default"].Option */.Z.Option,{text:/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{css:iA.threeDotButton,children:[(0,c.__)("Import Quiz","tutor"),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iB,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"small",content:(0,c.__)("Pro","tutor")})})]}),disabled:!iB,onClick:()=>{var e;w===null||w===void 0?void 0:(e=w.current)===null||e===void 0?void 0:e.click()},icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"importColorized",width:24,height:24,isColorIcon:true})})})]})})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)("input",{css:iA.input,type:"file",ref:w,onChange:E,multiple:false,accept:".csv"}),/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{triggerRef:h,isOpen:l==="tutor-google-meet",closePopover:R/* .noop */.ZT,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?rB/* .POPOVER_PLACEMENTS.BOTTOM */.h_.BOTTOM:rB/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.h_.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(il/* ["default"] */.Z,{topicId:r,data:null,onCancel:()=>{d(null);p(false)}})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{triggerRef:g,isOpen:l==="tutor_zoom_meeting",closePopover:R/* .noop */.ZT,maxWidth:"306px",closeOnEscape:false,placement:el/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile?rB/* .POPOVER_PLACEMENTS.BOTTOM */.h_.BOTTOM:rB/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.h_.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(T/* ["default"] */.Z,{topicId:r,meetingHost:(y===null||y===void 0?void 0:y.zoom_users)||{},data:null,onCancel:()=>{d(null);p(false)}})})]})};/* ESM default export */const iP=/*#__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 iA={contentButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";justify-content:space-between;"),leftButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";gap:",P/* .spacing["12"] */.W0["12"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{flex-wrap:wrap;}"),rightButtons:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";"),threeDotButton:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["4"] */.W0["4"],";"),contentButton:/*#__PURE__*/(0,d/* .css */.iv)(":hover:not(:disabled){background-color:",P/* .colorTokens.background.white */.Jv.background.white,";color:",P/* .colorTokens.text.brand */.Jv.text.brand,";outline:1px solid ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";}"),input:/*#__PURE__*/(0,d/* .css */.iv)("display:none !important;")};// CONCATENATED MODULE: ./assets/react/v3/shared/hooks/useCollapseExpandAnimation.tsx
var iO=e=>{var{ref:t,isOpen:n,heightCalculator:r="scroll"}=e;var i,o;var[a,s]=(0,u.useState)(r==="scroll"?(i=t.current)===null||i===void 0?void 0:i.scrollHeight:(o=t.current)===null||o===void 0?void 0:o.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 */.q_)({height:n?a: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 iN(){var e=(0,b._)(["\n        transform: rotate(180deg);\n      "]);iN=function t(){return e};return e}function iJ(){var e=(0,b._)(["\n      border-bottom: 1px solid ",";\n    "]);iJ=function t(){return e};return e}function iL(){var e=(0,b._)(["\n      padding-bottom: 0;\n    "]);iL=function t(){return e};return e}function iU(){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    "]);iU=function t(){return e};return e}function iR(){var e=(0,b._)(["\n      ",";\n    "]);iR=function t(){return e};return e}function iX(){var e=(0,b._)(["\n      ",";\n    "]);iX=function t(){return e};return e}function iF(){var e=(0,b._)(["\n      padding-right: 0;\n    "]);iF=function t(){return e};return e}var ij=(0,eo/* .getCourseId */.z)();var iQ=!!es/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var iH=e=>{var{topic:t,isEdit:n,listeners:a,isDragging:s,onCollapse:l,onEdit:d,onCopy:v,onDelete:p,setIsEdit:h}=e;var m=(0,eo/* .getIdWithoutPrefix */.W)("topic-",t.id);var b=(0,ed/* .useFormWithGlobalError */.O)({defaultValues:{title:t.title,summary:t.summary},shouldFocusError:true});var[y,x]=(0,u.useState)(false);var D=(0,u.useRef)(null);var T=(0,u.useRef)(null);var q=(0,ei/* .useSaveTopicMutation */.FV)();var S=(0,ei/* .useDuplicateContentMutation */.P_)();var B=(0,ei/* .useDeleteTopicMutation */.Wn)(ij);var I=iO({ref:D,isOpen:!t.isCollapsed,heightCalculator:"client"});var z=e=>(0,Z._)(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 P=()=>(0,Z._)(function*(){var e=yield S.mutateAsync({course_id:ij,content_id:m,content_type:"topic"});if(e.data){v===null||v===void 0?void 0:v("topic-".concat(e.data))}})();(0,u.useEffect)(()=>{if(n){b.setFocus("title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[n]);return/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iV.header({isCollapsed:t.isCollapsed,isEdit:n,isDeletePopoverOpen:y,isDragging:s}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iV.headerContent({isSaved:t.isSaved}),children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iV.grabberInput,onClick:()=>l(t.id),onKeyDown:e=>{if(e.key==="Enter"){l(t.id)}},children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("button",(0,i._)((0,r._)({},t.isSaved?a:{}),{css:iV.grabButton({isDragging:s}),type:"button",disabled:!t.isSaved,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:n,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:iV.title({isEdit:n}),onDoubleClick:()=>h(true),children:b.watch("title")}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:iV.title({isEdit:n}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:b.control,name:"title",rules:{required:(0,c.__)("Title is required","tutor")},render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a title","tutor"),isSecondary:true}))})})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iV.actions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!n,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"edit-topic",type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:!t.isSaved,onClick:()=>{h(true);if(t.isCollapsed){l===null||l===void 0?void 0:l(t.id)}},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t.isSaved,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!S.isPending,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.ZP,{size:24}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!iQ,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"duplicate-topic",type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:!t.isSaved,onClick:P,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(C/* ["default"] */.Z,{size:"tiny",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:true,onClick:R/* .noop */.ZT,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t.isSaved,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(E/* ["default"] */.Z,{content:(0,c.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{"data-cy":"delete-topic",type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:!t.isSaved,"data-visually-hidden":true,ref:T,onClick:()=>{x(true)},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"delete",width:24,height:24})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t.isSaved,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:U/* .styleUtils.actionButton */.i.actionButton,disabled:!t.isSaved,onClick:()=>{l===null||l===void 0?void 0:l(t.id)},"data-toggle-collapse":true,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"chevronDown",width:24,height:24})})})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:n,fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t.summary.length>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(w/* .animated.div */.q.div,{style:(0,r._)({},I),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:iV.description({isEdit:n}),ref:D,onDoubleClick:()=>h(true),children:b.watch("summary")})})}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:iV.description({isEdit:n}),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(k/* .Controller */.Qr,{control:b.control,name:"summary",render:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(eY/* ["default"] */.Z,(0,i._)((0,r._)({},e),{placeholder:(0,c.__)("Add a summary","tutor"),isSecondary:true,rows:2,enableResize:true}))})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:n,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:iV.footer,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{if(!b.formState.isValid&&!t.isSaved){p===null||p===void 0?void 0:p()}b.reset();h(false)},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"save-topic",loading:q.isPending,variant:"secondary",size:"small",onClick:b.handleSubmit(z),children:(0,c.__)("Ok","tutor")})]})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(W/* ["default"] */.Z,{isOpen:y,triggerRef:T,isLoading:B.isPending,closePopover:R/* .noop */.ZT,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:J/* .AnimationType.slideUp */.ru.slideUp,confirmButton:{text:(0,c.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,c.__)("Cancel","tutor"),variant:"text"},onConfirmation:()=>(0,Z._)(function*(){yield B.mutateAsync(m);x(false);p===null||p===void 0?void 0:p()})(),onCancel:()=>x(false)})]})};/* ESM default export */const iY=/*#__PURE__*/(0,u.memo)(iH,(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 iV={header:e=>{var{isCollapsed:t,isEdit:n,isDeletePopoverOpen:r,isDragging:i}=e;return/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";",U/* .styleUtils.display.flex */.i.display.flex("column"),";[data-toggle-collapse]{transition:transform 0.3s ease-in-out;",!t&&(0,d/* .css */.iv)(iN()),"}",!t&&(0,d/* .css */.iv)(iJ(),P/* .colorTokens.stroke.divider */.Jv.stroke.divider)," ",!n&&(0,d/* .css */.iv)(iL())," ",!n&&!r&&(0,d/* .css */.iv)(iU(),!i?"opacity 0.3s ease-in-out":"none",i?0:1)," ",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},headerContent:e=>{var{isSaved:t=true}=e;return/*#__PURE__*/(0,d/* .css */.iv)("display:grid;grid-template-columns:",t?"1fr auto":"1fr",";gap:",P/* .spacing["12"] */.W0["12"],";width:100%;padding-bottom:",P/* .spacing["12"] */.W0["12"],";")},grabberInput:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";svg{color:",P/* .colorTokens.color.black["40"] */.Jv.color.black["40"],";flex-shrink:0;}"),grabButton:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.resetButton */.i.resetButton,";",U/* .styleUtils.flexCenter */.i.flexCenter(),";cursor:",t?"grabbing":"grab",";:disabled{cursor:not-allowed;}&:focus,&:active,&:hover{background:none;}&:focus-visible{outline:2px solid ",P/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;border-radius:",P/* .borderRadius["2"] */.E0["2"],";}")},title:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";width:100%;",!t&&(0,d/* .css */.iv)(iR(),U/* .styleUtils.text.ellipsis */.i.text.ellipsis(1)))},description:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,d/* .css */.iv)(A/* .typography.caption */.c.caption(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";padding-inline:",P/* .spacing["8"] */.W0["8"],";margin-left:",P/* .spacing["24"] */.W0["24"],";padding-bottom:",P/* .spacing["12"] */.W0["12"],";",!t&&(0,d/* .css */.iv)(iX(),U/* .styleUtils.text.ellipsis */.i.text.ellipsis(2))," ",t&&(0,d/* .css */.iv)(iF()))},footer:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;text-align:right;",U/* .styleUtils.display.flex */.i.display.flex(),";gap:",P/* .spacing["8"] */.W0["8"],";justify-content:end;"),actions:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex(),";align-items:start;gap:",P/* .spacing["8"] */.W0["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/Topic.tsx
function iK(){var e=(0,b._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);iK=function t(){return e};return e}function iG(){var e=(0,b._)(["\n      box-shadow: ",";\n    "]);iG=function t(){return e};return e}var i$=e=>(0,l/* .defaultAnimateLayoutChanges */.cP)((0,i._)((0,r._)({},e),{wasDragging:true}));var i0=e=>{var{topic:t,onDelete:n,onCopy:a,onCollapse:s,onEdit:d,isOverlay:c=false}=e;var v,p;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[Z,x]=(0,w/* .useSpring */.q_)({height:!t.isCollapsed?(v=m.current)===null||v===void 0?void 0:v.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 */.$K)(b.current)&&!b.current.contains(e.target)){f(false)}};document.addEventListener("click",e);return()=>document.removeEventListener("click",e)},[g]);var{attributes:k,listeners:C,setNodeRef:E,transform:W,transition:D,isDragging:T}=(0,l/* .useSortable */.nB)({id:t.id,data:{type:"topic"},animateLayoutChanges:i$});var q=(0,u.useCallback)(e=>{if(e){E(e);// eslint-disable-next-line @typescript-eslint/no-explicit-any
b.current=e}},[E]);var S={transform:y/* .CSS.Transform.toString */.ux.Transform.toString(W),transition:D,opacity:T?.3:undefined,background:T?P/* .colorTokens.stroke.hover */.Jv.stroke.hover:undefined};(0,u.useEffect)(()=>{if((0,e0/* .isDefined */.$K)(m.current)){x.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,o/* .jsxs */.BX)("div",(0,i._)((0,r._)({},t.isSaved?k:{}),{css:i2.wrapper({isActive:h||g,isOverlay:c}),onClick:()=>f(true),onKeyDown:R/* .noop */.ZT,tabIndex:-1,ref:q,style:S,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(iY,{isActive:h,isDragging:T,isEdit:g,listeners:C,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=>{a===null||a===void 0?void 0:a(e)},topic:t,setIsEdit:_}),/*#__PURE__*/(0,o/* .jsx */.tZ)(w/* .animated.div */.q.div,{style:(0,r._)({},Z),children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:i2.content,ref:m,children:/*#__PURE__*/(0,o/* .jsxs */.BX)(N/* ["default"] */.Z,{when:!t.isCollapsed,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:t.contents.length>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:t.contents.map(e=>(0,i._)((0,r._)({},e),{id:e.ID})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:t.contents,children:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(iE,{topic:t,content:e},e.ID)})})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(iP,{topic:t,nextContentOrder:(t===null||t===void 0?void 0:(p=t.contents)===null||p===void 0?void 0:p.length)+1||1})]})})})]}))};/* ESM default export */const i1=i0;var i2={wrapper:e=>{var{isActive:t=false,isOverlay:n=false}=e;return/*#__PURE__*/(0,d/* .css */.iv)("border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",P/* .borderRadius["8"] */.E0["8"],";transition:background-color 0.3s ease-in-out,border-color 0.3s ease-in-out;background-color:",P/* .colorTokens.bg.white */.Jv.bg.white,";width:100%;",t&&(0,d/* .css */.iv)(iK(),P/* .colorTokens.stroke.brand */.Jv.stroke.brand,P/* .colorTokens.background.hover */.Jv.background.hover),":hover{background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";}",n&&(0,d/* .css */.iv)(iG(),P/* .shadow.drag */.AF.drag))},content:/*#__PURE__*/(0,d/* .css */.iv)("padding:",P/* .spacing["16"] */.W0["16"],";",U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["12"] */.W0["12"],";")};// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/components/curriculum/TopicDragOverlay.tsx
var i4=e=>{var{title:t}=e;return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:i3.wrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"dragVertical",width:24,height:24}),/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:t})]})};/* ESM default export */const i8=i4;var i3={wrapper:/*#__PURE__*/(0,d/* .css */.iv)("display:flex;align-items:center;gap:",P/* .spacing["8"] */.W0["8"],";border:1px solid ",P/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",P/* .borderRadius["8"] */.E0["8"],";background-color:",P/* .colorTokens.background.hover */.Jv.background.hover,";padding:",P/* .spacing["12"] */.W0["12"]," ",P/* .spacing["16"] */.W0["16"],";box-shadow:",P/* .shadow.drag */.AF.drag,";",A/* .typography.body */.c.body(),";color:",P/* .colorTokens.text.hints */.Jv.text.hints,";cursor:grabbing;svg{color:",P/* .colorTokens.color.black["40"] */.Jv.color.black["40"],";flex-shrink:0;}")};// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/layouts/CanvasHead.tsx
var i5=n(5558);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/components/layouts/Navigator.tsx
var i6=n(88311);// EXTERNAL MODULE: ./assets/react/v3/entries/course-builder/config/route-configs.ts + 1 modules
var i9=n(38032);// CONCATENATED MODULE: ./assets/react/v3/public/images/curriculum-empty-state-2x.webp
const i7=n.p+"js/images/curriculum-empty-state-2x-a99700d1.webp";// CONCATENATED MODULE: ./assets/react/v3/public/images/curriculum-empty-state.webp
const oe=n.p+"js/images/curriculum-empty-state-2ba0e1ef.webp";// CONCATENATED MODULE: ./assets/react/v3/entries/course-builder/pages/Curriculum.tsx
var ot=(0,eo/* .getCourseId */.z)();var on=()=>{var e=(0,h/* .useNavigate */.s0)();(0,u.useEffect)(()=>{if(!ot){e(i9/* .CourseBuilderRouteConfigs.Home.buildLink */.L.Home.buildLink(),{replace:true})}},[e]);var[t,n]=(0,u.useState)(true);var[d,v]=(0,u.useState)(false);var[b,y]=(0,u.useState)(null);var[w,Z]=(0,u.useState)([]);var x=(0,u.useRef)([]);var k=(0,ei/* .useCourseTopicQuery */.rM)(ot);var C=(0,ei/* .useUpdateCourseContentOrderMutation */.AI)();(0,u.useEffect)(()=>{if(w.length===0){return}v(true);var e=2;var n=0;var o=[];var a=()=>{Z(a=>{var s=[...a];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){o.push(d.id)}}}return s});if(n<w.length){setTimeout(a,0)}else{x.current=t?[]:o;v(false)}};a();// eslint-disable-next-line react-hooks/exhaustive-deps
},[t]);(0,u.useEffect)(()=>{var e;if(!((e=k.data)===null||e===void 0?void 0:e.length)){return}var t=e=>{return k.data.map((t,n)=>{var o="topic-".concat(t.id);var a=n===0;var s=x.current.includes(o);var l=e.length?!s:!a;if(a&&!e.length){x.current=[o]}return(0,i._)((0,r._)({},t),{id:o,isCollapsed:l,isSaved:true,contents:t.contents.map(e=>{return(0,i._)((0,r._)({},e),{ID:"content-".concat(e.ID)})})})})};Z(t)},[k.data]);var E=(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 W=(0,a/* .useSensors */.Dy)((0,a/* .useSensor */.VT)(a/* .PointerSensor */.we,{activationConstraint:{distance:10}}),(0,a/* .useSensor */.VT)(a/* .KeyboardSensor */.Lg,{coordinateGetter:l/* .sortableKeyboardCoordinates */.is}));if(!ot){return null}if(k.isLoading){return/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* .LoadingOverlay */.fz,{})}var D=(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 T=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=D(t.id,"content");var i=D(n.id,"content");if(!r||!i)return;var o=w.findIndex(e=>e.id===r.id);var a=w.findIndex(e=>e.id===i.id);if(i.isCollapsed||o===a){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[o].contents.splice(s,1);d[a].contents.splice(l,0,c);Z(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=D(t.id,"content");var v=D(n.id,"topic");if(!u||!v||v.contents.length>0||v.isCollapsed){return}var p=w.findIndex(e=>e.id===u.id);var h=w.findIndex(e=>e.id===v.id);if(p===h){return}var f=u.contents.findIndex(e=>e.ID===t.id);var g=[...w];var[_]=g[p].contents.splice(f,1);g[h].contents.push(_);Z(g)}};var q=e=>{var t,n;var{active:i,over:o}=e;if(!o){y(null);return}var a=[...w];if(i.id.toString().includes("topic")&&(o===null||o===void 0?void 0:o.id.toString().includes("topic"))&&i&&i.id!==o.id){var s=w.findIndex(e=>e.id===i.id);var l=w.findIndex(e=>e.id===o.id);a=(0,R/* .moveTo */.Ao)(a,s,l);Z(a)}if(i.id.toString().includes("content")&&(o===null||o===void 0?void 0:o.id.toString().includes("content"))&&i&&i.id!==o.id){var d=D(i.id,"content");var c=D(o.id,"content");if(!d||!c||c.isCollapsed){return}var u=w.findIndex(e=>e.id===d.id);var v=w.findIndex(e=>e.id===c.id);var p=d.contents.findIndex(e=>e.ID===i.id);var h=c.contents.findIndex(e=>e.ID===o.id);if(u===v){a[u].contents=(0,R/* .moveTo */.Ao)(a[u].contents,p,h);Z(a)}else{var[f]=a[u].contents.splice(p,1);a[v].contents.splice(h,0,f);Z(a)}}if(i.id.toString().includes("content")&&o.id.toString().includes("topic")&&i&&i.id!==o.id){var g=D(i.id,"content");var _=D(o.id,"topic");if(!g||!_||_.isCollapsed){return}var m=w.findIndex(e=>e.id===g.id);var b=w.findIndex(e=>e.id===_.id);var x=g.contents.findIndex(e=>e.ID===i.id);var[E]=a[m].contents.splice(x,1);a[b].contents.push(E);Z(a)}var W=a.reduce((e,t,n)=>{var r=0;e[n]={topic_id:(0,eo/* .getIdWithoutPrefix */.W)("topic-",t.id),lesson_ids:t.contents.reduce((e,t)=>{e[r]=(0,eo/* .getIdWithoutPrefix */.W)("content-",t.ID);r++;return e},{})};return e},{});C.mutate((0,r._)({tutor_topics_lessons_sorting:W},i.id.toString().includes("content")&&{"content_parent[parent_topic_id]":(n=k.data)===null||n===void 0?void 0:(t=n.find(e=>e.contents.find(e=>String(e.ID)===(0,eo/* .getIdWithoutPrefix */.W)("content-",o.id))))===null||t===void 0?void 0:t.id,"content_parent[content_id]":(0,eo/* .getIdWithoutPrefix */.W)("content-",i.id)}));y(null)};var S=(e,t)=>{Z(t=>t.filter((t,n)=>n!==e));x.current=x.current.filter(e=>e!==t)};var M=e=>{Z(t=>t.map(t=>{if(t.id===e){return(0,i._)((0,r._)({},t),{isCollapsed:!t.isCollapsed})}return t}));if(!x.current.includes(e)){x.current=[...x.current,e]}else{x.current=x.current.filter(t=>t!==e)}};return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:oi.container,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:oi.wrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(i5/* ["default"] */.Z,{title:(0,c.__)("Curriculum","tutor"),backUrl:"/basics",rightButton:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w.some(e=>e.isSaved),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>n(e=>!e),disabled:d,children:t?(0,c.__)("Expand All","tutor"):(0,c.__)("Collapse All","tutor")})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:oi.content,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:!k.isLoading&&k.data&&(k.data.length>0||w.length>0),fallback:/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,{emptyStateImage:oe,emptyStateImage2x:i7,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,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plusSquareBrand",width:24,height:25}),onClick:()=>{Z(()=>{return[{id:(0,R/* .nanoid */.x0)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]})},children:(0,c.__)("Add Topic","tutor")})}),children:/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:oi.topicWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)(a/* .DndContext */.LB,{sensors:W,collisionDetection:a/* .closestCorners */.ey,measuring:tA/* .droppableMeasuringStrategy */.O,modifiers:[s/* .restrictToWindowEdges */.hg],onDragStart:e=>{y(e.active.id)},onDragOver:e=>T(e),onDragEnd:e=>q(e),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(l/* .SortableContext */.Fo,{items:w.map(e=>(0,i._)((0,r._)({},e),{id:e.id})),strategy:l/* .verticalListSortingStrategy */.qw,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:w,children:(e,t)=>{return e.isSaved&&/*#__PURE__*/(0,o/* .jsx */.tZ)(i1,{topic:(0,i._)((0,r._)({},e),{isCollapsed:(b===null||b===void 0?void 0:b.toString().includes("topic"))?true:e.isCollapsed}),onDelete:()=>S(t,e.id),onCollapse:e=>M(e),onCopy:e=>{x.current=[e]},onEdit:e=>{x.current=[e]}},e.id)}})}),/*#__PURE__*/(0,p.createPortal)(/*#__PURE__*/(0,o/* .jsx */.tZ)(a/* .DragOverlay */.y9,{children:/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:E,children:e=>{return/*#__PURE__*/(0,o/* .jsx */.tZ)(i8,{title:(b===null||b===void 0?void 0:b.toString().includes("topic"))?e.title:e.post_title})}})}),document.body)]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(O/* ["default"] */.Z,{each:w,children:(e,t)=>{return!e.isSaved&&/*#__PURE__*/(0,o/* .jsx */.tZ)(i1,{topic:(0,i._)((0,r._)({},e),{isCollapsed:false}),onDelete:()=>S(t,e.id),onCollapse:e=>M(e),onCopy:e=>{x.current=[e]},onEdit:e=>{x.current=[e]}},e.id)}})]})})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(N/* ["default"] */.Z,{when:w.length>0,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:oi.addButtonWrapper,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.Z,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{name:"plusSquareBrand",width:24,height:24}),onClick:()=>{Z(e=>{return[...e.map(e=>(0,i._)((0,r._)({},e),{isCollapsed:true})),{id:(0,R/* .nanoid */.x0)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]});x.current=[]},children:(0,c.__)("Add Topic","tutor")})})})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(i6/* ["default"] */.Z,{styleModifier:oi.navigator})]})};/* ESM default export */const or=on;var oi={container:/*#__PURE__*/(0,d/* .css */.iv)("margin-top:",P/* .spacing["32"] */.W0["32"],";width:100%;",P/* .Breakpoint.smallTablet */.Uo.smallTablet,"{margin-top:",P/* .spacing["16"] */.W0["16"],";}"),wrapper:/*#__PURE__*/(0,d/* .css */.iv)("width:100%;",U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["16"] */.W0["16"],";margin:0 auto;"),content:/*#__PURE__*/(0,d/* .css */.iv)("margin-top:",P/* .spacing["16"] */.W0["16"],";",P/* .Breakpoint.smallMobile */.Uo.smallMobile,"{margin-top:0;}"),topicWrapper:/*#__PURE__*/(0,d/* .css */.iv)(U/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",P/* .spacing["16"] */.W0["16"],";align-items:center;"),addButtonWrapper:/*#__PURE__*/(0,d/* .css */.iv)("path{stroke:",P/* .colorTokens.icon.brand */.Jv.icon.brand,";}"),navigator:/*#__PURE__*/(0,d/* .css */.iv)("margin:",P/* .spacing["40"] */.W0["40"]," auto;")}},11908:function(e,t,n){n.d(t,{AI:()=>q,Bd:()=>U,CR:()=>I,FV:()=>y,G4:()=>E,PI:()=>D,P_:()=>P,RE:()=>X,SF:()=>f,T3:()=>M,Wn:()=>Z,i0:()=>J,iL:()=>g,qY:()=>O,rM:()=>m,yO:()=>k});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(24333);/* ESM import */var a=n(99469);/* ESM import */var s=n(65228);/* ESM import */var l=n(38003);/* ESM import */var d=/*#__PURE__*/n.n(l);/* ESM import */var c=n(13985);/* ESM import */var u=n(74053);/* ESM import */var v=n(82340);/* ESM import */var p=n(84225);/* ESM import */var h=n(34403);var f=(e,t,n,o,a)=>{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 */.ro)(u/* .Addons.TUTOR_COURSE_PREVIEW */.AO.TUTOR_COURSE_PREVIEW)&&{_is_preview:e.lesson_preview?1:0}),{tutor_attachments:(e.tutor_attachments||[]).map(e=>e.id)}),(0,h/* .isAddonEnabled */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,h/* .isAddonEnabled */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,h/* .isAddonEnabled */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="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(a.map(t=>{return[t,e[t]||""]})))};var g=(e,t,n,o,a)=>{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 */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,h/* .isAddonEnabled */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,h/* .isAddonEnabled */.ro)(u/* .Addons.CONTENT_DRIP */.AO.CONTENT_DRIP)&&o==="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(a.map(t=>{return[t,e[t]||""]})))};var _=e=>{return v/* .wpAjaxInstance.get */.R.get(p/* ["default"].GET_COURSE_CONTENTS */.Z.GET_COURSE_CONTENTS,{params:{course_id:e}})};var m=e=>{return(0,o/* .useQuery */.a)({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 v/* .wpAjaxInstance.post */.R.post(p/* ["default"].SAVE_TOPIC */.Z.SAVE_TOPIC,e)};var y=()=>{var e=(0,a/* .useQueryClient */.NL)();var{showToast:t}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({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 */.Mo)(e)})}})};var w=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].DELETE_TOPIC */.Z.DELETE_TOPIC,{topic_id:e})};var Z=e=>{var t=(0,a/* .useQueryClient */.NL)();var{showToast:n}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({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 */.Mo)(e)});t.invalidateQueries({queryKey:["Topic"]})}})};var x=(e,t)=>{return v/* .wpAjaxInstance.get */.R.get(p/* ["default"].GET_LESSON_DETAILS */.Z.GET_LESSON_DETAILS,{params:{topic_id:t,lesson_id:e}})};var k=(e,t)=>{return(0,o/* .useQuery */.a)({queryKey:["Lesson",e,t],queryFn:()=>x(e,t).then(e=>e.data),enabled:!!e&&!!t})};var C=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].SAVE_LESSON */.Z.SAVE_LESSON,e)};var E=e=>{var t=(0,a/* .useQueryClient */.NL)();var{showToast:n}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:e=>C(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 */.Mo)(e)})}})};var W=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].DELETE_TOPIC_CONTENT */.Z.DELETE_TOPIC_CONTENT,{lesson_id:e})};var D=()=>{var e=(0,a/* .useQueryClient */.NL)();var{showToast:t}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:W,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 */.Mo)(e)})}})};var T=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].UPDATE_COURSE_CONTENT_ORDER */.Z.UPDATE_COURSE_CONTENT_ORDER,e)};var q=()=>{var{showToast:e}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:T,onError:t=>{e({type:"danger",message:(0,h/* .convertToErrorMessage */.Mo)(t)})}})};var S=(e,t)=>{return v/* .wpAjaxInstance.get */.R.get(p/* ["default"].GET_ASSIGNMENT_DETAILS */.Z.GET_ASSIGNMENT_DETAILS,{params:{topic_id:t,assignment_id:e}})};var M=(e,t)=>{return(0,o/* .useQuery */.a)({queryKey:["Assignment",e,t],queryFn:()=>S(e,t).then(e=>e.data),enabled:!!e&&!!t})};var B=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].SAVE_ASSIGNMENT */.Z.SAVE_ASSIGNMENT,e)};var I=e=>{var t=(0,a/* .useQueryClient */.NL)();var{showToast:n}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:e=>B(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 */.Mo)(e)})}})};var z=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].DUPLICATE_CONTENT */.Z.DUPLICATE_CONTENT,e)};/**
 *
 * @param quizId pass when duplicating 'answer'
 * @returns useMutation
 */var P=e=>{var t=(0,a/* .useQueryClient */.NL)();var{showToast:n}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({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 */.Mo)(r),type:"danger"});if(["answer"].includes(i.content_type)){t.invalidateQueries({queryKey:["Quiz",e]})}}})};var A=(e,t)=>{return v/* .wpAjaxInstance.get */.R.get(p/* ["default"].GET_ZOOM_MEETING_DETAILS */.Z.GET_ZOOM_MEETING_DETAILS,{params:{meeting_id:e,topic_id:t}})};var O=(e,t)=>{return(0,o/* .useQuery */.a)({queryKey:["ZoomMeeting",e],queryFn:()=>A(e,t).then(e=>e.data),enabled:!!e&&!!t})};var N=(e,t)=>{return v/* .wpAjaxInstance.get */.R.get(p/* ["default"].GET_GOOGLE_MEET_DETAILS */.Z.GET_GOOGLE_MEET_DETAILS,{params:{meeting_id:e,topic_id:t}})};var J=(e,t)=>{return(0,o/* .useQuery */.a)({queryKey:["GoogleMeet",e],queryFn:()=>N(e,t).then(e=>e.data),enabled:!!e&&!!t})};var L=e=>{return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].ADD_CONTENT_BANK_CONTENT_TO_COURSE */.Z.ADD_CONTENT_BANK_CONTENT_TO_COURSE,e)};var U=()=>{var e=(0,a/* .useQueryClient */.NL)();var{showToast:t}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:L,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 */.Mo)(e)})}})};var R=e=>{var{topicId:t,contentId:n}=e;return v/* .wpAjaxInstance.post */.R.post(p/* ["default"].DELETE_CONTENT_BANK_CONTENT_FROM_COURSE */.Z.DELETE_CONTENT_BANK_CONTENT_FROM_COURSE,{topic_id:t,content_id:n})};var X=()=>{var e=(0,a/* .useQueryClient */.NL)();var{showToast:t}=(0,c/* .useToast */.p)();return(0,s/* .useMutation */.D)({mutationFn:R,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 */.Mo)(e)})}})}},69602:function(e,t,n){n.d(t,{Z:()=>w});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(58865);/* ESM import */var a=n(35944);/* ESM import */var s=n(60860);/* ESM import */var l=n(76487);/* ESM import */var d=n(34403);/* ESM import */var c=n(70917);/* ESM import */var u=n(87363);/* ESM import */var v=/*#__PURE__*/n.n(u);function p(){var e=(0,o._)(["\n      cursor: not-allowed;\n    "]);p=function t(){return e};return e}function h(){var e=(0,o._)(["\n      color: ",";\n    "]);h=function t(){return e};return e}function f(){var e=(0,o._)(["\n        margin-right: ",";\n      "]);f=function t(){return e};return e}function g(){var e=(0,o._)(["\n        background-color: ",";\n      "]);g=function t(){return e};return e}function _(){var e=(0,o._)(["\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,o._)(["\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__*/v().forwardRef((e,t)=>{var{id:n=(0,d/* .nanoid */.x0)(),name:o,labelCss:s,inputCss:l,label:c="",checked:u,value:p,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__*/v().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,a/* .jsxs */.BX)("label",{htmlFor:n,css:[y.container({disabled:h}),s],children:[/*#__PURE__*/(0,a/* .jsx */.tZ)("input",(0,i._)((0,r._)({},e),{ref:t,id:n,name:o,type:"checkbox",value:p,checked:!!u,disabled:h,"aria-invalid":e["aria-invalid"],onChange:m,onBlur:g,css:[l,y.checkbox({label:!!c,isIndeterminate:_,disabled:h})]})),/*#__PURE__*/(0,a/* .jsx */.tZ)("span",{}),/*#__PURE__*/(0,a/* .jsx */.tZ)("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 */.iv)("position:relative;display:flex;align-items:center;cursor:pointer;user-select:none;color:",s/* .colorTokens.text.title */.Jv.text.title,";",t&&(0,c/* .css */.iv)(p()))},label:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,c/* .css */.iv)(l/* .typography.caption */.c.caption(),";color:",s/* .colorTokens.text.title */.Jv.text.title,";",t&&(0,c/* .css */.iv)(h(),s/* .colorTokens.text.disable */.Jv.text.disable))},checkbox:e=>{var{label:t,isIndeterminate:n,disabled:r}=e;return/*#__PURE__*/(0,c/* .css */.iv)("position:absolute;opacity:0 !important;height:0;width:0;& + span{position:relative;cursor:pointer;display:inline-flex;align-items:center;",t&&(0,c/* .css */.iv)(f(),s/* .spacing["10"] */.W0["10"]),"}& + span::before{content:'';background-color:",s/* .colorTokens.background.white */.Jv.background.white,";border:1px solid ",s/* .colorTokens.stroke["default"] */.Jv.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 */.Jv.icon.brand,";border-radius:",s/* .borderRadius["4"] */.E0["4"],";",r&&(0,c/* .css */.iv)(g(),s/* .colorTokens.icon.disable["default"] */.Jv.icon.disable["default"]),"}",n&&(0,c/* .css */.iv)(_(),s/* .colorTokens.brand.blue */.Jv.brand.blue,s/* .colorTokens.stroke.white */.Jv.stroke.white)," ",r&&(0,c/* .css */.iv)(m(),s/* .colorTokens.stroke.disable */.Jv.stroke.disable),"    &:focus-visible{& + span{border-radius:",s/* .borderRadius["2"] */.E0["2"],";outline:2px solid ",s/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}}")}};/* ESM default export */const w=b},30647:function(e,t,n){n.d(t,{Z:()=>y});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(38003);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(86138);/* ESM import */var d=/*#__PURE__*/n.n(l);/* ESM import */var c=n(19398);/* ESM import */var u=n(26815);/* ESM import */var v=n(60860);/* ESM import */var p=n(76487);/* ESM import */var h=n(17106);/* ESM import */var f=n(2613);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,a.__)("Upload Media","tutor"),infoText:n,size:r="regular",value:s,uploadHandler:l,clearHandler:d,emptyImageCss:p,previewImageCss:g,overlayCss:_,replaceButtonText:b,loading:y,disabled:Z=false,isClearAble:x=true}=e;return/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:!y,fallback:/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:w.emptyMedia({size:r,isDisabled:Z}),children:/*#__PURE__*/(0,i/* .jsx */.tZ)(f/* .LoadingOverlay */.fz,{})}),children:/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:s===null||s===void 0?void 0:s.url,fallback:/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{"aria-disabled":Z,css:[w.emptyMedia({size:r,isDisabled:Z}),p],onClick:e=>{e.stopPropagation();if(Z){return}l()},onKeyDown:e=>{if(!Z&&e.key==="Enter"){e.preventDefault();l()}},children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(u/* ["default"] */.Z,{name:"addImage",width:32,height:32}),/*#__PURE__*/(0,i/* .jsx */.tZ)(c/* ["default"] */.Z,{disabled:Z,size:m[r],variant:"secondary",buttonContentCss:w.buttonText,"data-cy":"upload-media",children:t}),/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.tZ)("p",{css:w.infoTexts,children:n})})]}),children:e=>{return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:[w.previewWrapper({size:r,isDisabled:Z}),g],"data-cy":"media-preview",children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("img",{src:e,alt:s===null||s===void 0?void 0:s.title,css:w.imagePreview}),/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:[w.hoverPreview,_],"data-hover-buttons-wrapper":true,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(c/* ["default"] */.Z,{disabled:Z,variant:"secondary",size:m[r],buttonCss:/*#__PURE__*/(0,o/* .css */.iv)("margin-top:",x&&v/* .spacing["16"] */.W0["16"],";"),onClick:e=>{e.stopPropagation();l()},"data-cy":"replace-media",children:b||(0,a.__)("Replace Image","tutor")}),/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:x,children:/*#__PURE__*/(0,i/* .jsx */.tZ)(c/* ["default"] */.Z,{disabled:Z,variant:"text",size:m[r],onClick:e=>{e.stopPropagation();d()},"data-cy":"clear-media",children:(0,a.__)("Remove","tutor")})})]})]})}})})};/* ESM default export */const y=b;var w={emptyMedia:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,o/* .css */.iv)("width:100%;height:168px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",v/* .spacing["8"] */.W0["8"],";border:1px dashed ",v/* .colorTokens.stroke.border */.Jv.stroke.border,";border-radius:",v/* .borderRadius["8"] */.E0["8"],";background-color:",v/* .colorTokens.bg.white */.Jv.bg.white,";overflow:hidden;cursor:",n?"not-allowed":"pointer",";",t==="small"&&(0,o/* .css */.iv)(g()),"    svg{color:",v/* .colorTokens.icon["default"] */.Jv.icon["default"],";}&:hover svg{color:",!n&&v/* .colorTokens.brand.blue */.Jv.brand.blue,";}")},buttonText:/*#__PURE__*/(0,o/* .css */.iv)("color:",v/* .colorTokens.text.brand */.Jv.text.brand,";"),infoTexts:/*#__PURE__*/(0,o/* .css */.iv)(p/* .typography.tiny */.c.tiny(),";color:",v/* .colorTokens.text.subdued */.Jv.text.subdued,";text-align:center;"),previewWrapper:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,o/* .css */.iv)("width:100%;height:168px;border:1px solid ",v/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",v/* .borderRadius["8"] */.E0["8"],";overflow:hidden;position:relative;background-color:",v/* .colorTokens.bg.white */.Jv.bg.white,";",t==="small"&&(0,o/* .css */.iv)(_()),"    &:hover{[data-hover-buttons-wrapper]{display:",n?"none":"flex",";opacity:",n?0:1,";}}")},imagePreview:/*#__PURE__*/(0,o/* .css */.iv)("height:100%;width:100%;object-fit:contain;"),hoverPreview:/*#__PURE__*/(0,o/* .css */.iv)("display:flex;flex-direction:column;justify-content:center;align-items:center;gap:",v/* .spacing["8"] */.W0["8"],";opacity:0;position:absolute;inset:0;background-color:",d()(v/* .colorTokens.color.black.main */.Jv.color.black.main,.6),";button:first-of-type{box-shadow:",v/* .shadow.button */.AF.button,";}button:last-of-type:not(:only-of-type){color:",v/* .colorTokens.text.white */.Jv.text.white,";box-shadow:none;}")}},86766:function(e,t,n){n.d(t,{Z:()=>h});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(60860);/* ESM import */var s=n(17106);/* ESM import */var l=n(22456);/* ESM import */var d=n(26815);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 v(){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    "]);v=function t(){return e};return e}var p=e=>{var{children:t,content:n,size:r="regular",textOnly:o}=e;return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:g.wrapper({hasChildren:(0,l/* .isDefined */.$K)(t),size:r}),children:[t,/*#__PURE__*/(0,i/* .jsx */.tZ)(s/* ["default"] */.Z,{when:!(0,l/* .isDefined */.$K)(t)&&!o,children:/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:f[r].iconSize,height:f[r].iconSize})}),/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:g.content({hasChildren:(0,l/* .isDefined */.$K)(t),size:r,textOnly:o}),children:(0,l/* .isDefined */.$K)(t)?/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:r==="tiny"?f[r].iconSize:16}):n})]})};/* ESM default export */const h=p;var f={tiny:{borderRadius:a/* .spacing["10"] */.W0["10"],height:a/* .spacing["10"] */.W0["10"],gap:a/* .spacing["2"] */.W0["2"],iconSize:10,fontSize:"0.5rem",lineHeight:"0.625rem"},small:{borderRadius:a/* .spacing["16"] */.W0["16"],height:a/* .spacing["16"] */.W0["16"],gap:a/* .spacing["4"] */.W0["4"],iconSize:16,fontSize:a/* .fontSize["10"] */.JB["10"],lineHeight:a/* .lineHeight["16"] */.Nv["16"]},regular:{borderRadius:"22px",height:"22px",gap:"5px",iconSize:22,fontSize:a/* .fontSize["14"] */.JB["14"],lineHeight:a/* .lineHeight["18"] */.Nv["18"]},large:{borderRadius:"26px",height:"26px",gap:a/* .spacing["6"] */.W0["6"],iconSize:26,fontSize:a/* .fontSize["16"] */.JB["16"],lineHeight:a/* .lineHeight["26"] */.Nv["26"]}};var g={wrapper:e=>{var{hasChildren:t,size:n="regular"}=e;return/*#__PURE__*/(0,o/* .css */.iv)("position:relative;svg{flex-shrink:0;}",!t&&(0,o/* .css */.iv)(c(),f[n].height,f[n].borderRadius,f[n].gap))},content:e=>{var{hasChildren:t,size:n="regular",textOnly:r}=e;return/*#__PURE__*/(0,o/* .css */.iv)("position:absolute;top:0;right:0;display:flex;flex-shrink:0;transform:translateX(50%) translateY(-50%);",!t&&(0,o/* .css */.iv)(v(),a/* .spacing["2"] */.W0["2"],a/* .colorTokens.icon.white */.Jv.icon.white,f[n].gap,f[n].fontSize,f[n].lineHeight,r&&(0,o/* .css */.iv)(u(),a/* .spacing["6"] */.W0["6"])))}}},63772:function(e,t,n){n.d(t,{Z:()=>g});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(87363);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(60860);/* ESM import */var d=n(76487);/* ESM import */var c=n(29535);/* ESM import */var u=n(34403);function v(){var e=(0,r._)(["\n      color: ",";\n    "]);v=function t(){return e};return e}function p(){var e=(0,r._)(["\n        margin-right: ",";\n      "]);p=function t(){return e};return e}var h=/*#__PURE__*/s().forwardRef((e,t)=>{var{name:n,checked:r,readOnly:o,disabled:a=false,labelCss:s,label:l,icon:d,value:c,onChange:v,onBlur:p,description:h}=e;var g=(0,u/* .nanoid */.x0)();return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:f.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("label",{htmlFor:g,css:[f.container(a),s],children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("input",{ref:t,id:g,name:n,type:"radio",checked:r,readOnly:o,value:c,disabled:a,onChange:v,onBlur:p,css:[f.radio(l)]}),/*#__PURE__*/(0,i/* .jsx */.tZ)("span",{}),d,l]}),h&&/*#__PURE__*/(0,i/* .jsx */.tZ)("p",{css:f.description,children:h})]})});var f={wrapper:/*#__PURE__*/(0,o/* .css */.iv)(c/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",l/* .spacing["8"] */.W0["8"],";"),container:e=>/*#__PURE__*/(0,o/* .css */.iv)(d/* .typography.caption */.c.caption(),";display:flex;align-items:center;cursor:pointer;user-select:none;",e&&(0,o/* .css */.iv)(v(),l/* .colorTokens.text.disable */.Jv.text.disable)),radio:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/*#__PURE__*/(0,o/* .css */.iv)("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 */.Jv.background.white,";border:2px solid ",l/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:100%;",e&&(0,o/* .css */.iv)(p(),l/* .spacing["10"] */.W0["10"]),"}& + span::before{content:'';position:absolute;left:3px;top:3px;background-color:",l/* .colorTokens.background.white */.Jv.background.white,";width:8px;height:8px;border-radius:100%;}&:checked + span{border-color:",l/* .colorTokens.action.primary["default"] */.Jv.action.primary["default"],";}&:checked + span::before{background-color:",l/* .colorTokens.action.primary["default"] */.Jv.action.primary["default"],";}&:focus-visible{& + span{outline:2px solid ",l/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}}")},description:/*#__PURE__*/(0,o/* .css */.iv)(d/* .typography.small */.c.small(),";color:",l/* .colorTokens.text.hints */.Jv.text.hints,";padding-left:30px;")};/* ESM default export */const g=h},98978:function(e,t,n){n.d(t,{Z:()=>d});/* ESM import */var r=n(35944);/* ESM import */var i=n(60860);/* ESM import */var o=n(78151);/* ESM import */var a=n(70917);/* ESM import */var s=n(87363);/* ESM 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 */.tZ)("div",{className:n,ref:t,css:u({variant:i})})});d.displayName="Separator";var c={horizontal:/*#__PURE__*/(0,a/* .css */.iv)("height:1px;width:100%;"),vertical:/*#__PURE__*/(0,a/* .css */.iv)("height:100%;width:1px;"),base:/*#__PURE__*/(0,a/* .css */.iv)("flex-shrink:0;background-color:",i/* .colorTokens.stroke.divider */.Jv.stroke.divider,";")};var u=(0,o/* .createVariation */.Y)({variants:{variant:{horizontal:c.horizontal,vertical:c.vertical}},defaultVariants:{variant:"horizontal"}},c.base)},85746:function(e,t,n){n.d(t,{Z:()=>Z});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(38003);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(87363);/* ESM import */var d=/*#__PURE__*/n.n(l);/* ESM import */var c=n(34039);/* ESM import */var u=n(74053);/* ESM import */var v=n(60860);/* ESM import */var p=n(29535);/* ESM import */var h=n(34403);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 */.y.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,o,s,l,d,u,v,p,h){var f=p!==null&&p!==void 0?p: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=v?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 */.y.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 */.y.site_url,"/wp-includes/css/dashicons.min.css,").concat(c/* .tutorConfig.site_url */.y.site_url,"/wp-includes/js/tinymce/skins/wordpress/wp-content.css,").concat(c/* .tutorConfig.site_url */.y.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,a.__)("Tutor ShortCode","tutor"),icon:false,type:"menubutton",menu:[{text:(0,a.__)("Student Registration Form","tutor"),onclick:()=>{i.insertContent("[tutor_student_registration_form]")}},{text:(0,a.__)("Instructor Registration Form","tutor"),onclick:()=>{i.insertContent("[tutor_instructor_registration_form]")}},{text:(0,a.__)("Courses","tutor"),onclick:()=>{i.windowManager.open({title:(0,a.__)("Courses Shortcode","tutor"),body:[{type:"textbox",name:"id",label:(0,a.__)("Course id, separate by (,) comma","tutor"),value:""},{type:"textbox",name:"exclude_ids",label:(0,a.__)("Exclude Course IDS","tutor"),value:""},{type:"textbox",name:"category",label:(0,a.__)("Category IDS","tutor"),value:""},{type:"listbox",name:"orderby",label:(0,a.__)("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,a.__)("Order","tutor"),onselect:()=>{},values:[{text:"DESC",value:"DESC"},{text:"ASC",value:"ASC"}]},{type:"textbox",name:"count",label:(0,a.__)("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:o||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:o,hideQuickTags:a,autoFocus:s=false,onFullScreenChange:d,readonly:c=false,min_height:v,max_height:p,toolbar1:f,toolbar2:g}=e;var _=(0,l.useRef)(null);var{current:m}=(0,l.useRef)((0,h/* .nanoid */.x0)());var[b,w]=(0,l.useState)(s);var Z=e=>{var t=e.target;n(t.value)};var k=(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)(()=>{k(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,o,a,d,c,v,p,u/* .CURRENT_VIEWPORT.isAboveMobile */.iM.isAboveMobile,f,g));var e=_.current;e===null||e===void 0?void 0:e.addEventListener("change",Z);e===null||e===void 0?void 0:e.addEventListener("input",Z);return()=>{window.wp.editor.remove(m);e===null||e===void 0?void 0:e.removeEventListener("change",Z);e===null||e===void 0?void 0:e.removeEventListener("input",Z)}}// eslint-disable-next-line react-hooks/exhaustive-deps
},[c]);return/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:x.wrapper({hideQuickTags:a,isMinimal:r,isFocused:b,isReadOnly:c}),children:/*#__PURE__*/(0,i/* .jsx */.tZ)("textarea",{"data-cy":"tutor-tinymce",ref:_,id:m,defaultValue:t})})};/* ESM default export */const Z=w;var x={wrapper:e=>{var{hideQuickTags:t,isMinimal:n,isFocused:r,isReadOnly:i}=e;return/*#__PURE__*/(0,o/* .css */.iv)("flex:1;.wp-editor-tools{z-index:auto;}.wp-editor-container{border-top-left-radius:",v/* .borderRadius["6"] */.E0["6"],";border-bottom-left-radius:",v/* .borderRadius["6"] */.E0["6"],";border-bottom-right-radius:",v/* .borderRadius["6"] */.E0["6"],";",r&&!i&&(0,o/* .css */.iv)(f(),p/* .styleUtils.inputFocus */.i.inputFocus),":focus-within{",!i&&p/* .styleUtils.inputFocus */.i.inputFocus,"}}.wp-switch-editor{height:auto;border:1px solid #dcdcde;border-radius:0px;border-top-left-radius:",v/* .borderRadius["4"] */.E0["4"],";border-top-right-radius:",v/* .borderRadius["4"] */.E0["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:",v/* .borderRadius["6"] */.E0["6"],";",(t||n)&&(0,o/* .css */.iv)(g(),v/* .borderRadius["6"] */.E0["6"]),"}.mce-top-part::before{display:none;}.mce-statusbar{border-bottom-left-radius:",v/* .borderRadius["6"] */.E0["6"],";border-bottom-right-radius:",v/* .borderRadius["6"] */.E0["6"],";}.mce-tinymce{box-shadow:none;background-color:transparent;}.mce-edit-area{background-color:unset;}",(t||n)&&(0,o/* .css */.iv)(m(),!i?"1px solid ".concat(v/* .colorTokens.stroke["default"] */.Jv.stroke["default"]):"none",v/* .borderRadius["6"] */.E0["6"],r&&!i&&(0,o/* .css */.iv)(_(),p/* .styleUtils.inputFocus */.i.inputFocus)),"    textarea{visibility:visible !important;width:100%;resize:none;border:none;outline:none;padding:",v/* .spacing["10"] */.W0["10"],";}")}}},60274:function(e,t,n){n.d(t,{Z:()=>f});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(35944);/* ESM import */var s=n(69602);/* ESM import */var l=n(60860);/* ESM import */var d=n(76487);/* ESM import */var c=n(70917);/* ESM import */var u=n(26815);/* ESM import */var v=n(58982);/* ESM import */var p=n(84978);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,a/* .jsx */.tZ)(p/* ["default"] */.Z,{field:t,fieldState:n,isHidden:m,children:e=>{var{css:n}=e,p=(0,o._)(e,["css"]);return/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:g.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,(0,i._)((0,r._)({},t,p),{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,a/* .jsx */.tZ)(v/* ["default"] */.Z,{content:_,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,a/* .jsx */.tZ)(u/* ["default"] */.Z,{name:"info",width:20,height:20})})]}),f&&/*#__PURE__*/(0,a/* .jsx */.tZ)("p",{css:g.description,children:f})]})}})};/* ESM default export */const f=h;var g={wrapper:/*#__PURE__*/(0,c/* .css */.iv)("display:flex;align-items:center;gap:",l/* .spacing["6"] */.W0["6"],";& > div{display:flex;color:",l/* .colorTokens.icon["default"] */.Jv.icon["default"],";}"),description:/*#__PURE__*/(0,c/* .css */.iv)(d/* .typography.small */.c.small(),"    color:",l/* .colorTokens.text.hints */.Jv.text.hints,";padding-left:30px;margin-top:",l/* .spacing["6"] */.W0["6"],";")}},42456:function(e,t,n){n.d(t,{Z:()=>W});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(35944);/* ESM import */var s=n(70917);/* ESM import */var l=n(38003);/* ESM import */var d=/*#__PURE__*/n.n(l);/* ESM import */var c=n(12274);/* ESM import */var u=n(32449);/* ESM import */var v=n(87363);/* ESM import */var p=/*#__PURE__*/n.n(v);/* ESM import */var h=n(57684);/* ESM import */var f=n(19398);/* ESM import */var g=n(26815);/* ESM import */var _=n(74053);/* ESM import */var m=n(60860);/* ESM import */var b=n(76487);/* ESM import */var y=n(98567);/* ESM import */var w=n(29535);/* ESM import */var Z=n(84978);/* ESM import */var x=n(70165);// Create DayPicker formatters based on WordPress locale
var k=()=>{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 C=e=>{if(!e)return undefined;return(0,c["default"])(new Date(e))?new Date(e.length===10?e+"T00:00:00":e):undefined};var E=e=>{var{label:t,field:n,fieldState:s,disabled:d,disabledBefore:c,disabledAfter:p,loading:m,placeholder:b,helpText:x,isClearable:E=true,onChange:W,dateFormat:T=_/* .DateFormats.monthDayYear */.E_.monthDayYear}=e;var q=(0,v.useRef)(null);var[S,M]=(0,v.useState)(false);var B=C(n.value);var I=typeof window!=="undefined"&&window.wp&&window.wp.date;var z=B?I?window.wp.date.format("F j, Y",B):(0,u["default"])(B,T):"";var{triggerRef:P,position:A,popoverRef:O}=(0,y/* .usePortalPopover */.lM)({isOpen:S,placement:y/* .POPOVER_PLACEMENTS.BOTTOM_LEFT */.h_.BOTTOM_LEFT});var N=()=>{var e;M(false);(e=q.current)===null||e===void 0?void 0:e.focus()};var J=C(c);var L=C(p);return/*#__PURE__*/(0,a/* .jsx */.tZ)(Z/* ["default"] */.Z,{label:t,field:n,fieldState:s,disabled:d,loading:m,placeholder:b,helpText:x,children:e=>{var{css:t}=e,s=(0,o._)(e,["css"]);return/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:D.wrapper,ref:P,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)("input",(0,i._)((0,r._)({},s),{css:[t,D.input],title:z,ref:e=>{n.ref(e);// @ts-ignore
q.current=e},type:"text",value:z,onClick:e=>{e.stopPropagation();M(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();M(e=>!e)}},autoComplete:"off","data-input":true})),/*#__PURE__*/(0,a/* .jsx */.tZ)(g/* ["default"] */.Z,{name:"calendarLine",width:30,height:32,style:D.icon}),E&&n.value&&/*#__PURE__*/(0,a/* .jsx */.tZ)(f/* ["default"] */.Z,{isIconOnly:true,"aria-label":(0,l.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:w/* .styleUtils.inputClearButton */.i.inputClearButton,onClick:()=>{n.onChange("")},icon:/*#__PURE__*/(0,a/* .jsx */.tZ)(g/* ["default"] */.Z,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)(y/* .Portal */.Uv,{isOpen:S,onClickOutside:N,onEscape:N,children:/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:D.pickerWrapper,style:{left:A.left,top:A.top},ref:O,children:/*#__PURE__*/(0,a/* .jsx */.tZ)(h/* .DayPicker */._,{dir:_/* .isRTL */.dZ?"rtl":"ltr",animate:true,mode:"single",formatters:k(),disabled:[!!J&&{before:J},!!L&&{after:L}],selected:B,onSelect:e=>{if(e){var t=(0,u["default"])(e,_/* .DateFormats.yearMonthDay */.E_.yearMonthDay);n.onChange(t);N();if(W){W(t)}}},showOutsideDays:true,captionLayout:"dropdown",autoFocus:true,defaultMonth:B||new Date,startMonth:J||new Date(new Date().getFullYear()-10,0),endMonth:L||new Date(new Date().getFullYear()+10,11),weekStartsOn:I?window.wp.date.getSettings().l10n.startOfWeek:0})})})]})}})};/* ESM default export */const W=E;var D={wrapper:/*#__PURE__*/(0,s/* .css */.iv)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,s/* .css */.iv)("&[data-input]{padding-left:",m/* .spacing["40"] */.W0["40"],";}"),icon:/*#__PURE__*/(0,s/* .css */.iv)("position:absolute;top:50%;left:",m/* .spacing["8"] */.W0["8"],";transform:translateY(-50%);color:",m/* .colorTokens.icon["default"] */.Jv.icon["default"],";"),pickerWrapper:/*#__PURE__*/(0,s/* .css */.iv)(b/* .typography.body */.c.body("regular"),";position:absolute;background-color:",m/* .colorTokens.background.white */.Jv.background.white,";box-shadow:",m/* .shadow.popover */.AF.popover,";border-radius:",m/* .borderRadius["6"] */.E0["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 */.Jv.text.title,";--rdp-caption-font-size:",m/* .fontSize["18"] */.JB["18"],";--rdp-accent-color:",m/* .colorTokens.action.primary["default"] */.Jv.action.primary["default"],";--rdp-background-color:",m/* .colorTokens.background.hover */.Jv.background.hover,";--rdp-accent-color-dark:",m/* .colorTokens.action.primary.active */.Jv.action.primary.active,";--rdp-background-color-dark:",m/* .colorTokens.action.primary.hover */.Jv.action.primary.hover,";--rdp-selected-color:",m/* .colorTokens.text.white */.Jv.text.white,";--rdp-day_button-border-radius:",m/* .borderRadius.circle */.E0.circle,";--rdp-outside-opacity:0.5;--rdp-disabled-opacity:0.25;}.rdp-months{margin:",m/* .spacing["16"] */.W0["16"],";}.rdp-month_grid{margin:0px;}.rdp-day{padding:0px;}.rdp-nav{--rdp-accent-color:",m/* .colorTokens.text.primary */.Jv.text.primary,";button{border-radius:",m/* .borderRadius.circle */.E0.circle,";&:hover,&:focus,&:active{background-color:",m/* .colorTokens.background.hover */.Jv.background.hover,";color:",m/* .colorTokens.text.primary */.Jv.text.primary,";}&:focus-visible:not(:disabled){--rdp-accent-color:",m/* .colorTokens.text.white */.Jv.text.white,";background-color:",m/* .colorTokens.background.brand */.Jv.background.brand,";}}}.rdp-dropdown_root{.rdp-caption_label{padding:",m/* .spacing["8"] */.W0["8"],";}}.rdp-today{.rdp-day_button{font-weight:",m/* .fontWeight.bold */.Ue.bold,";}}.rdp-selected{color:var(--rdp-selected-color);background-color:var(--rdp-accent-color);border-radius:",m/* .borderRadius.circle */.E0.circle,";font-weight:",m/* .fontWeight.regular */.Ue.regular,";.rdp-day_button{&:hover,&:focus,&:active{background-color:var(--rdp-accent-color);color:",m/* .colorTokens.text.primary */.Jv.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 */.Jv.text.primary,";}&:focus-visible:not([disabled]){color:var(--rdp-selected-color);opacity:1;background-color:var(--rdp-accent-color);}}")}},86774:function(e,t,n){n.d(t,{Z:()=>x});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(38003);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(19398);/* ESM import */var d=n(26815);/* ESM import */var c=n(84978);/* ESM import */var u=n(60860);/* ESM import */var v=n(76487);/* ESM import */var p=n(36352);/* ESM import */var h=n(17106);/* ESM import */var f=n(52357);/* ESM import */var g=n(43372);/* ESM import */var _=n(29535);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 Z=e=>{var{field:t,fieldState:n,label:r,helpText:o,buttonText:s=(0,a.__)("Upload Media","tutor"),selectMultiple:u=false,onChange:v,maxFileSize:f,maxFiles:m}=e;var b=t.value;var{openMediaLibrary:y,resetFiles:Z}=(0,g/* ["default"] */.Z)({options:{multiple:u,maxFiles:m,maxFileSize:f},onChange:e=>{t.onChange(e);if(v){v(e)}},initialFiles:b?Array.isArray(b)?b:[b]:[]});var x=()=>{y()};var C=e=>{Z();if(u){var n=(Array.isArray(b)?b:b?[b]:[]).filter(t=>t.id!==e);t.onChange(n.length>0?n:null);if(v){v(n.length>0?n:null)}}else{t.onChange(null);if(v){v(null)}}};return/*#__PURE__*/(0,i/* .jsx */.tZ)(c/* ["default"] */.Z,{label:r,field:t,fieldState:n,helpText:o,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.tZ)(h/* ["default"] */.Z,{when:b,fallback:/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{buttonCss:k.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{name:"attach",height:24,width:24}),variant:"secondary",onClick:x,children:s}),children:e=>/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:k.wrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:k.attachmentsWrapper,children:/*#__PURE__*/(0,i/* .jsx */.tZ)(p/* ["default"] */.Z,{each:Array.isArray(e)?e:[e],children:e=>/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:k.attachmentCardWrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:k.attachmentCard,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{style:k.fileIcon,name:w(e.ext||"file"),height:40,width:40}),/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:k.attachmentCardBody,children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:k.attachmentCardTitle,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{title:e.title,css:_/* .styleUtils.text.ellipsis */.i.text.ellipsis(1),children:e.title}),/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:k.fileExtension,children:".".concat(e.ext)})]}),/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:k.attachmentCardSubtitle,children:/*#__PURE__*/(0,i/* .jsx */.tZ)("span",{children:"".concat((0,a.__)("Size","tutor"),": ").concat(e.size)})})]})]}),/*#__PURE__*/(0,i/* .jsx */.tZ)("button",{type:"button",css:k.removeButton,onClick:()=>{C(e.id)},children:/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{name:"cross",height:24,width:24})})]},e.id)})}),/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:k.uploadButtonWrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{buttonCss:k.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{name:"attach",height:24,width:24}),variant:"secondary",onClick:x,"data-cy":"upload-media",children:s})})]})})}})};/* ESM default export */const x=(0,f/* .withVisibilityControl */.v)(Z);var k={wrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,o/* .css */.iv)("display:flex;flex-direction:column;position:relative;",t&&(0,o/* .css */.iv)(m(),u/* .colorTokens.background.white */.Jv.background.white,u/* .spacing["16"] */.W0["16"],u/* .spacing["16"] */.W0["16"],u/* .spacing["16"] */.W0["16"],u/* .colorTokens.stroke["default"] */.Jv.stroke["default"],u/* .borderRadius.card */.E0.card,u/* .spacing["8"] */.W0["8"]))},attachmentsWrapper:/*#__PURE__*/(0,o/* .css */.iv)("max-height:260px;padding-right:",u/* .spacing["16"] */.W0["16"],";",_/* .styleUtils.overflowYAuto */.i.overflowYAuto,";"),attachmentCardWrapper:/*#__PURE__*/(0,o/* .css */.iv)(_/* .styleUtils.display.flex */.i.display.flex(),";justify-content:space-between;align-items:center;gap:",u/* .spacing["20"] */.W0["20"],";padding:",u/* .spacing["4"] */.W0["4"]," ",u/* .spacing["12"] */.W0["12"]," ",u/* .spacing["4"] */.W0["4"]," 0;border-radius:",u/* .borderRadius["6"] */.E0["6"],";button{opacity:0;}&:hover,&:focus-within{background:",u/* .colorTokens.background.hover */.Jv.background.hover,";button{opacity:1;}}",u/* .Breakpoint.smallTablet */.Uo.smallTablet,"{button{opacity:1;}}"),attachmentCard:/*#__PURE__*/(0,o/* .css */.iv)(_/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",u/* .spacing["8"] */.W0["8"],";overflow:hidden;"),attachmentCardBody:/*#__PURE__*/(0,o/* .css */.iv)(_/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",u/* .spacing["4"] */.W0["4"],";"),attachmentCardTitle:/*#__PURE__*/(0,o/* .css */.iv)(_/* .styleUtils.display.flex */.i.display.flex(),";",v/* .typography.caption */.c.caption("medium"),"    word-break:break-all;"),fileExtension:/*#__PURE__*/(0,o/* .css */.iv)("flex-shrink:0;"),attachmentCardSubtitle:/*#__PURE__*/(0,o/* .css */.iv)(v/* .typography.tiny */.c.tiny("regular")," ",_/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",u/* .spacing["8"] */.W0["8"],";color:",u/* .colorTokens.text.hints */.Jv.text.hints,";svg{color:",u/* .colorTokens.icon["default"] */.Jv.icon["default"],";}"),uploadButtonWrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,o/* .css */.iv)(t&&(0,o/* .css */.iv)(b(),u/* .spacing["16"] */.W0["16"]))},uploadButton:/*#__PURE__*/(0,o/* .css */.iv)("width:100%;"),fileIcon:/*#__PURE__*/(0,o/* .css */.iv)("flex-shrink:0;color:",u/* .colorTokens.icon["default"] */.Jv.icon["default"],";"),removeButton:/*#__PURE__*/(0,o/* .css */.iv)(_/* .styleUtils.crossButton */.i.crossButton,";background:none;transition:none;flex-shrink:0;")}},44226:function(e,t,n){n.d(t,{Z:()=>Z});/* ESM import */var r=n(35944);/* ESM import */var i=n(38003);/* ESM import */var o=/*#__PURE__*/n.n(i);/* ESM import */var a=n(30647);/* ESM import */var s=n(26815);/* ESM import */var l=n(36853);/* ESM import */var d=n(63260);/* ESM import */var c=n(31342);/* ESM import */var u=n(99678);/* ESM import */var v=n(34039);/* ESM import */var p=n(52357);/* ESM import */var h=n(43372);/* ESM import */var f=n(86056);/* ESM import */var g=n(95781);/* ESM import */var _=n(84978);var m;var b=!!v/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var y=(m=v/* .tutorConfig.settings */.y.settings)===null||m===void 0?void 0:m.chatgpt_key_exist;var w=e=>{var{field:t,fieldState:n,label:o,size:v,helpText:p,buttonText:m=(0,i.__)("Upload Media","tutor"),infoText:w,onChange:Z,generateWithAi:x=false,previewImageCss:k,loading:C,onClickAiButton:E}=e;var{showModal:W}=(0,d/* .useModal */.d)();var{openMediaLibrary:D,resetFiles:T}=(0,h/* ["default"] */.Z)({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(Z){Z({id:n,url:r,title:i})}}},initialFiles:t.value});var q=t.value;var S=()=>{D()};var M=()=>{T();t.onChange(null);if(Z){Z(null)}};var B=()=>{if(!b){W({component:c/* ["default"] */.Z,props:{image:g,image2x:f}})}else if(!y){W({component:u/* ["default"] */.Z,props:{image:g,image2x:f}})}else{W({component:l/* ["default"] */.Z,isMagicAi:true,props:{title:(0,i.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,r/* .jsx */.tZ)(s/* ["default"] */.Z,{name:"magicAiColorize",width:24,height:24}),field:t,fieldState:n}});E===null||E===void 0?void 0:E()}};return/*#__PURE__*/(0,r/* .jsx */.tZ)(_/* ["default"] */.Z,{label:o,field:t,fieldState:n,helpText:p,onClickAiButton:B,generateWithAi:x,children:()=>{return/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{children:/*#__PURE__*/(0,r/* .jsx */.tZ)(a/* ["default"] */.Z,{size:v,value:q,uploadHandler:S,clearHandler:M,buttonText:m,infoText:w,previewImageCss:k,loading:C})})}})};/* ESM default export */const Z=(0,p/* .withVisibilityControl */.v)(w)},99308:function(e,t,n){n.d(t,{Z:()=>p});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(60860);/* ESM import */var a=n(70917);/* ESM import */var s=n(76487);/* ESM import */var l=n(29535);/* ESM import */var d=n(84978);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 v=e=>{var{field:t,fieldState:n,label:r,options:o=[],disabled:a}=e;return/*#__PURE__*/(0,i/* .jsx */.tZ)(d/* ["default"] */.Z,{field:t,fieldState:n,label:r,disabled:a,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:h.wrapper,children:o.map((e,n)=>/*#__PURE__*/(0,i/* .jsxs */.BX)("button",{type:"button",css:h.item(t.value===e.value),onClick:()=>{t.onChange(e.value)},disabled:a,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("img",{src:e.image,alt:e.label,width:64,height:64}),/*#__PURE__*/(0,i/* .jsx */.tZ)("p",{children:e.label})]},n))})}})};/* ESM default export */const p=v;var h={wrapper:/*#__PURE__*/(0,a/* .css */.iv)("display:grid;grid-template-columns:repeat(4,minmax(64px,1fr));gap:",o/* .spacing["12"] */.W0["12"],";margin-top:",o/* .spacing["4"] */.W0["4"],";"),item:e=>/*#__PURE__*/(0,a/* .css */.iv)(l/* .styleUtils.resetButton */.i.resetButton,";display:flex;flex-direction:column;gap:",o/* .spacing["4"] */.W0["4"],";align-items:center;width:100%;cursor:pointer;input{appearance:none;}p{",s/* .typography.small */.c.small(),";width:100%;",l/* .styleUtils.textEllipsis */.i.textEllipsis,";color:",o/* .colorTokens.text.subdued */.Jv.text.subdued,";text-align:center;}&:hover,&:focus-visible{",!e&&(0,a/* .css */.iv)(c(),o/* .colorTokens.stroke.hover */.Jv.stroke.hover),"}img{border-radius:",o/* .borderRadius["6"] */.E0["6"],";border:2px solid ",o/* .colorTokens.stroke.border */.Jv.stroke.border,";outline:2px solid transparent;outline-offset:2px;transition:border-color 0.3s ease;",e&&(0,a/* .css */.iv)(u(),o/* .colorTokens.stroke.magicAi */.Jv.stroke.magicAi),"}")}},35159:function(e,t,n){n.d(t,{Z:()=>W});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(58865);/* ESM import */var s=n(35944);/* ESM import */var l=n(70917);/* ESM import */var d=n(87363);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(60860);/* ESM import */var v=n(76487);/* ESM import */var p=n(52357);/* ESM import */var h=n(29535);/* ESM import */var f=n(84978);function g(){var e=(0,a._)(["\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,a._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);_=function t(){return e};return e}function m(){var e=(0,a._)(["\n        border-color: ",";\n      "]);m=function t(){return e};return e}function b(){var e=(0,a._)(["\n          padding-",": ",";\n        "]);b=function t(){return e};return e}function y(){var e=(0,a._)(["\n            padding-",": ",";\n          "]);y=function t(){return e};return e}function w(){var e=(0,a._)(["\n          font-size: ",";\n          font-weight: ",";\n          height: 34px;\n          ",";\n        "]);w=function t(){return e};return e}function Z(){var e=(0,a._)(["\n      ","\n    "]);Z=function t(){return e};return e}function x(){var e=(0,a._)(["\n      border-right: 1px solid ",";\n    "]);x=function t(){return e};return e}function k(){var e=(0,a._)(["\n      ","\n    "]);k=function t(){return e};return e}function C(){var e=(0,a._)(["\n      border-left: 1px solid ",";\n    "]);C=function t(){return e};return e}var E=e=>{var{label:t,content:n,contentPosition:a="left",showVerticalBar:l=true,size:c="regular",type:u="text",field:v,fieldState:p,disabled:h,readOnly:g,loading:_,placeholder:m,helpText:b,onChange:y,onKeyDown:w,isHidden:Z,wrapperCss:x,contentCss:k,removeBorder:C=false,selectOnFocus:E=false}=e;var W=(0,d.useRef)(null);return/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{label:t,field:v,fieldState:p,disabled:h,readOnly:g,loading:_,placeholder:m,helpText:b,isHidden:Z,removeBorder:C,children:e=>{var{css:t}=e,d=(0,o._)(e,["css"]);var h;return/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:[D.inputWrapper(!!p.error,C),x],children:[a==="left"&&/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:[D.inputLeftContent(l,c),k],children:n}),/*#__PURE__*/(0,s/* .jsx */.tZ)("input",(0,i._)((0,r._)({},v,d),{type:"text",value:(h=v.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;v.onChange(t);if(y){y(t)}},onKeyDown:e=>w===null||w===void 0?void 0:w(e.key),css:[t,D.input(a,l,c)],autoComplete:"off",ref:e=>{v.ref(e);// @ts-ignore
W.current=e;// this is not ideal but it is the only way to set ref to the input element
},onFocus:()=>{if(!E||!W.current){return}W.current.select()},"data-input":true})),a==="right"&&/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:[D.inputRightContent(l,c),k],children:n})]})}})};/* ESM default export */const W=(0,p/* .withVisibilityControl */.v)(E);var D={inputWrapper:(e,t)=>/*#__PURE__*/(0,l/* .css */.iv)("display:flex;align-items:center;",!t&&(0,l/* .css */.iv)(g(),u/* .colorTokens.stroke["default"] */.Jv.stroke["default"],u/* .borderRadius["6"] */.E0["6"],u/* .shadow.input */.AF.input,u/* .colorTokens.background.white */.Jv.background.white)," ",e&&(0,l/* .css */.iv)(_(),u/* .colorTokens.stroke.danger */.Jv.stroke.danger,u/* .colorTokens.background.status.errorFail */.Jv.background.status.errorFail),";&:focus-within{",h/* .styleUtils.inputFocus */.i.inputFocus,";",e&&(0,l/* .css */.iv)(m(),u/* .colorTokens.stroke.danger */.Jv.stroke.danger),"}"),input:(e,t,n)=>/*#__PURE__*/(0,l/* .css */.iv)("&[data-input]{",v/* .typography.body */.c.body(),";border:none;box-shadow:none;background-color:transparent;padding-",e,":0;",t&&(0,l/* .css */.iv)(b(),e,u/* .spacing["10"] */.W0["10"]),";",n==="large"&&(0,l/* .css */.iv)(w(),u/* .fontSize["24"] */.JB["24"],u/* .fontWeight.medium */.Ue.medium,t&&(0,l/* .css */.iv)(y(),e,u/* .spacing["12"] */.W0["12"])),"  \n      &:focus{box-shadow:none;outline:none;}}"),inputLeftContent:(e,t)=>/*#__PURE__*/(0,l/* .css */.iv)(v/* .typography.small */.c.small()," ",h/* .styleUtils.flexCenter */.i.flexCenter(),"    height:40px;min-width:48px;color:",u/* .colorTokens.icon.subdued */.Jv.icon.subdued,";padding-inline:",u/* .spacing["12"] */.W0["12"],";",t==="large"&&(0,l/* .css */.iv)(Z(),v/* .typography.body */.c.body())," ",e&&(0,l/* .css */.iv)(x(),u/* .colorTokens.stroke["default"] */.Jv.stroke["default"])),inputRightContent:(e,t)=>/*#__PURE__*/(0,l/* .css */.iv)(v/* .typography.small */.c.small()," ",h/* .styleUtils.flexCenter */.i.flexCenter(),"    height:40px;min-width:48px;color:",u/* .colorTokens.icon.subdued */.Jv.icon.subdued,";padding-inline:",u/* .spacing["12"] */.W0["12"],";",t==="large"&&(0,l/* .css */.iv)(k(),v/* .typography.body */.c.body())," ",e&&(0,l/* .css */.iv)(C(),u/* .colorTokens.stroke["default"] */.Jv.stroke["default"]))}},90097:function(e,t,n){n.d(t,{Z:()=>p});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(35944);/* ESM import */var s=n(63772);/* ESM import */var l=n(60860);/* ESM import */var d=n(76487);/* ESM import */var c=n(70917);/* ESM import */var u=n(84978);var v=e=>{var{field:t,fieldState:n,label:l,options:d=[],disabled:c,wrapperCss:v,onSelect:p,onSelectRender:f}=e;return/*#__PURE__*/(0,a/* .jsx */.tZ)(u/* ["default"] */.Z,{field:t,fieldState:n,label:l,disabled:c,children:e=>{var{css:n}=e,l=(0,o._)(e,["css"]);return/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:v,children:d.map((e,o)=>/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,(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(p){p(e)}}})),f&&t.value===e.value&&f(e),e.legend&&/*#__PURE__*/(0,a/* .jsx */.tZ)("span",{css:h.radioLegend,children:e.legend})]},o))})}})};/* ESM default export */const p=v;var h={radioLegend:/*#__PURE__*/(0,c/* .css */.iv)("margin-left:",l/* .spacing["28"] */.W0["28"],";",d/* .typography.body */.c.body(),";color:",l/* .colorTokens.text.subdued */.Jv.text.subdued,";")}},60309:function(e,t,n){n.d(t,{Z:()=>m});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(60860);/* ESM import */var a=n(76487);/* ESM import */var s=n(4867);/* ESM import */var l=n(29535);/* ESM import */var d=n(34403);/* ESM import */var c=n(70917);/* ESM import */var u=n(87363);/* ESM import */var v=/*#__PURE__*/n.n(u);/* ESM import */var p=n(84978);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 o=i.width;var a=e-i.left;var s=Math.max(0,Math.min(a,o));var l=s/o*100;var d=Math.floor(n+l/100*(r-n));return d}var _=e=>{var{field:t,fieldState:n,label:r,min:o=0,max:a=100,isMagicAi:l=false,hasBorder:c=false}=e;var v=(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 */.N)(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,_,o,a))};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)}},[o,a]);var w=(0,u.useMemo)(()=>{return Math.floor((h-o)/(a-o)*100)},[h,o,a]);return/*#__PURE__*/(0,i/* .jsx */.tZ)(p/* ["default"] */.Z,{field:t,fieldState:n,label:r,isMagicAi:l,children:()=>/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:b.wrapper(c),children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:b.track,ref:_,onKeyDown:d/* .noop */.ZT,onClick:e=>{f(g(e.clientX,_,o,a))},children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:b.fill,style:{width:"".concat(w,"%")}}),/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:b.thumb(l),style:{left:"".concat(w,"%")},ref:m})]}),/*#__PURE__*/(0,i/* .jsx */.tZ)("input",{type:"text",css:b.input,value:String(h),onChange:e=>{f(Number(e.target.value))},ref:v,onFocus:()=>{var e;(e=v.current)===null||e===void 0?void 0:e.select()}})]})})};/* ESM default export */const m=_;var b={wrapper:e=>/*#__PURE__*/(0,c/* .css */.iv)("display:grid;grid-template-columns:1fr 45px;gap:",o/* .spacing["20"] */.W0["20"],";align-items:center;",e&&(0,c/* .css */.iv)(h(),o/* .colorTokens.stroke.disable */.Jv.stroke.disable,o/* .borderRadius["6"] */.E0["6"],o/* .spacing["12"] */.W0["12"],o/* .spacing["10"] */.W0["10"],o/* .spacing["12"] */.W0["12"],o/* .spacing["16"] */.W0["16"])),track:/*#__PURE__*/(0,c/* .css */.iv)("position:relative;height:4px;background-color:",o/* .colorTokens.bg.gray20 */.Jv.bg.gray20,";border-radius:",o/* .borderRadius["50"] */.E0["50"],";width:100%;flex-shrink:0;cursor:pointer;"),fill:/*#__PURE__*/(0,c/* .css */.iv)("position:absolute;left:0;top:0;height:100%;background:",o/* .colorTokens.ai.gradient_1 */.Jv.ai.gradient_1,";width:50%;border-radius:",o/* .borderRadius["50"] */.E0["50"],";"),thumb:e=>/*#__PURE__*/(0,c/* .css */.iv)("position:absolute;top:50%;transform:translate(-50%,-50%);width:20px;height:20px;border-radius:",o/* .borderRadius.circle */.E0.circle,";&::before{content:'';position:absolute;top:50%;left:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:",o/* .borderRadius.circle */.E0.circle,";background-color:",o/* .colorTokens.background.white */.Jv.background.white,";cursor:pointer;}",e&&(0,c/* .css */.iv)(f(),o/* .colorTokens.ai.gradient_1 */.Jv.ai.gradient_1)),input:/*#__PURE__*/(0,c/* .css */.iv)(a/* .typography.caption */.c.caption("medium"),";height:32px;border:1px solid ",o/* .colorTokens.stroke.border */.Jv.stroke.border,";border-radius:",o/* .borderRadius["6"] */.E0["6"],";text-align:center;color:",o/* .colorTokens.text.primary */.Jv.text.primary,";&:focus-visible{",l/* .styleUtils.inputFocus */.i.inputFocus,";}")}},47778:function(e,t,n){n.d(t,{Z:()=>W});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(35944);/* ESM import */var s=n(70917);/* ESM import */var l=n(4543);/* ESM import */var d=n(37042);/* ESM import */var c=n(47041);/* ESM import */var u=n(32449);/* ESM import */var v=n(87363);/* ESM import */var p=/*#__PURE__*/n.n(v);/* ESM import */var h=n(19398);/* ESM import */var f=n(26815);/* ESM import */var g=n(97669);/* ESM import */var _=n(74053);/* ESM import */var m=n(60860);/* ESM import */var b=n(76487);/* ESM import */var y=n(29535);/* ESM import */var w=n(54354);/* ESM import */var Z=n(30633);/* ESM import */var x=n(38003);/* ESM import */var k=/*#__PURE__*/n.n(x);/* ESM import */var C=n(84978);var E=e=>{var{label:t,field:n,fieldState:s,interval:p=30,disabled:m,loading:b,placeholder:k,helpText:E,isClearable:W=true}=e;var[T,q]=(0,v.useState)(false);var S=(0,v.useRef)(null);var M=(0,v.useRef)(null);var B=(0,v.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"] */.Z)({start:e,end:t},{step:p});return n.map(e=>(0,u["default"])(e,_/* .DateFormats.hoursMinutes */.E_.hoursMinutes))},[p]);var{activeIndex:I,setActiveIndex:z}=(0,Z/* .useSelectKeyboardNavigation */.U)({options:B.map(e=>({label:e,value:e})),isOpen:T,selectedValue:n.value,onSelect:e=>{n.onChange(e.value);q(false)},onClose:()=>q(false)});(0,v.useEffect)(()=>{if(T&&I>=0&&M.current){M.current.scrollIntoView({block:"nearest",behavior:"smooth"})}},[T,I]);return/*#__PURE__*/(0,a/* .jsx */.tZ)(C/* ["default"] */.Z,{label:t,field:n,fieldState:s,disabled:m,loading:b,placeholder:k,helpText:E,children:e=>{var{css:t}=e,s=(0,o._)(e,["css"]);var l;return/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:D.wrapper,ref:S,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)("input",(0,i._)((0,r._)({},s),{ref:n.ref,css:[t,D.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,a/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"clock",width:32,height:32,style:D.icon}),W&&n.value&&/*#__PURE__*/(0,a/* .jsx */.tZ)(h/* ["default"] */.Z,{isIconOnly:true,"aria-label":(0,x.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:y/* .styleUtils.inputClearButton */.i.inputClearButton,onClick:()=>n.onChange(""),icon:/*#__PURE__*/(0,a/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)(g/* ["default"] */.Z,{triggerRef:S,isOpen:T,closePopover:()=>q(false),animationType:w/* .AnimationType.slideDown */.ru.slideDown,children:/*#__PURE__*/(0,a/* .jsx */.tZ)("ul",{css:D.list,children:B.map((e,t)=>{return/*#__PURE__*/(0,a/* .jsx */.tZ)("li",{css:D.listItem,ref:I===t?M:null,"data-active":I===t,children:/*#__PURE__*/(0,a/* .jsx */.tZ)("button",{type:"button",css:D.itemButton,onClick:()=>{n.onChange(e);q(false)},onMouseOver:()=>z(t),onMouseLeave:()=>t!==I&&z(-1),onFocus:()=>z(t),children:e})},t)})})})]})}})};/* ESM default export */const W=E;var D={wrapper:/*#__PURE__*/(0,s/* .css */.iv)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,s/* .css */.iv)("&[data-input]{padding-left:",m/* .spacing["40"] */.W0["40"],";}"),icon:/*#__PURE__*/(0,s/* .css */.iv)("position:absolute;top:50%;left:",m/* .spacing["8"] */.W0["8"],";transform:translateY(-50%);color:",m/* .colorTokens.icon["default"] */.Jv.icon["default"],";"),list:/*#__PURE__*/(0,s/* .css */.iv)("height:380px;list-style:none;padding:0;margin:0;",y/* .styleUtils.overflowYAuto */.i.overflowYAuto,";"),listItem:/*#__PURE__*/(0,s/* .css */.iv)("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 */.Jv.background.hover,";}:hover{background-color:",m/* .colorTokens.background.hover */.Jv.background.hover,";}"),itemButton:/*#__PURE__*/(0,s/* .css */.iv)(y/* .styleUtils.resetButton */.i.resetButton,";",b/* .typography.body */.c.body(),";margin:",m/* .spacing["4"] */.W0["4"]," ",m/* .spacing["12"] */.W0["12"],";width:100%;height:100%;&:focus,&:active,&:hover{background:none;color:",m/* .colorTokens.text.primary */.Jv.text.primary,";}")}},69789:function(e,t,n){// EXPORTS
n.d(t,{Z:()=>/* binding */ee});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
var r=n(76150);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
var i=n(7409);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var o=n(99282);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
var a=n(58865);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var s=n(35944);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var l=n(70917);// EXTERNAL MODULE: external "wp.i18n"
var d=n(38003);// EXTERNAL MODULE: external "React"
var c=n(87363);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var u=n(52293);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/Button.tsx
var v=n(19398);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/ImageInput.tsx
var p=n(30647);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/LoadingSpinner.tsx
var h=n(2613);// EXTERNAL MODULE: ./assets/react/v3/shared/atoms/SVGIcon.tsx
var f=n(26815);// EXTERNAL MODULE: ./assets/react/v3/shared/molecules/Popover.tsx
var g=n(97669);// EXTERNAL MODULE: ./assets/react/v3/shared/config/config.ts
var _=n(34039);// EXTERNAL MODULE: ./assets/react/v3/shared/config/constants.ts
var m=n(74053);// EXTERNAL MODULE: ./assets/react/v3/shared/config/styles.ts
var b=n(60860);// EXTERNAL MODULE: ./assets/react/v3/shared/config/typography.ts
var y=n(76487);// EXTERNAL MODULE: ./assets/react/v3/shared/controls/Show.tsx
var w=n(17106);// EXTERNAL MODULE: ./assets/react/v3/shared/hoc/withVisibilityControl.tsx
var Z=n(52357);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useAnimation.tsx
var x=n(54354);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useFormWithGlobalError.ts
var k=n(37861);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/usePortalPopover.tsx
var C=n(98567);// EXTERNAL MODULE: ./assets/react/v3/shared/hooks/useWpMedia.ts
var E=n(43372);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useMutation.js
var W=n(65228);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/api.ts
var D=n(82340);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/endpoints.ts
var T=n(84225);// CONCATENATED MODULE: ./assets/react/v3/shared/services/video.ts
var q=e=>{return D/* .wpAjaxInstance.post */.R.post(T/* ["default"].TUTOR_YOUTUBE_VIDEO_DURATION */.Z.TUTOR_YOUTUBE_VIDEO_DURATION,{video_id:e})};var S=()=>{return(0,W/* .useMutation */.D)({mutationFn:q})};// EXTERNAL MODULE: ./assets/react/v3/shared/utils/style-utils.ts
var M=n(29535);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/util.ts + 4 modules
var B=n(34403);// EXTERNAL MODULE: ./assets/react/v3/shared/utils/validation.ts
var I=n(25481);// 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 o=yield fetch(i);if(!o.ok){throw new Error((0,d.__)("Failed to fetch the video data","tutor"))}var a=yield o.text();var s=new DOMParser;var l=s.parseFromString(a,"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 P=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 A=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 O=(e,t)=>(0,r._)(function*(){if(e==="youtube"){var n=t.match(m/* .VideoRegex.YOUTUBE */.t8.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 o=yield fetch("https://vimeo.com/api/v2/video/".concat(i,".json"));var a=yield o.json();return a[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 o=false;var a=false;var s=false;var l=false;var c=()=>{r.src="";r.remove();i.remove();clearTimeout(v)};var u=()=>{if(o&&a&&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 v=e instanceof Error?e.message:(0,d.__)("Unknown error occurred","tutor");n(new Error("Thumbnail generation failed: ".concat(v)))}}};// Setup event listeners
    r.addEventListener("loadedmetadata",()=>{o=true;if(!r.currentTime||r.currentTime<2){r.currentTime=2;// Take snapshot at 2 seconds
    }});r.addEventListener("loadeddata",()=>{a=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 v=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 p=e instanceof Error?e.message:"Unknown error occurred";n(new Error("Thumbnail generation failed: ".concat(p)))}})}throw new Error((0,d.__)("Unsupported video source","tutor"))})();// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormFieldWrapper.tsx
var N=n(84978);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormSelectInput.tsx
var J=n(82325);// EXTERNAL MODULE: ./assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var L=n(3473);// CONCATENATED MODULE: ./assets/react/v3/shared/components/fields/FormVideoInput.tsx
function U(){var e=(0,a._)(["\n      background-color: ",";\n    "]);U=function t(){return e};return e}function R(){var e=(0,a._)(["\n      ",";\n    "]);R=function t(){return e};return e}var X=_/* .tutorConfig.supported_video_sources */.y.supported_video_sources||[];var F=X.filter(e=>e.value!=="html5");var j=X.map(e=>e.value);var Q=["vimeo","youtube","html5"];var H={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 Y={youtube:"youtube",vimeo:"vimeo",shortcode:"shortcode",embedded:"coding"};var V=(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 K={youtube:e=>{var t=e.match(m/* .VideoRegex.YOUTUBE */.t8.YOUTUBE);return t&&t[7].length===11?t[7]:null},vimeo:e=>{var t=e.match(m/* .VideoRegex.VIMEO */.t8.VIMEO);return(t===null||t===void 0?void 0:t[5])||null},shortcode:e=>{return e.match(m/* .VideoRegex.SHORTCODE */.t8.SHORTCODE)?e:null},url:e=>{return e.match(m/* .VideoRegex.EXTERNAL_URL */.t8.EXTERNAL_URL)?e:null}};var G=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 o;e=(o=yield P(n))!==null&&o!==void 0?o:0;break;case"youtube":{var a=K.youtube(n);if(a){var s=yield i.mutateAsync(a);e=A(s.data.duration)}break}}if(e){var l=(0,B/* .covertSecondsToHMS */.lL)(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:a,helpText:m,buttonText:b=(0,d.__)("Upload Media","tutor"),infoText:y,onChange:Z,supportedFormats:W,loading:D,onGetDuration:T}=e;var q,U,R;var $=(0,k/* .useFormWithGlobalError */.O)({defaultValues:{videoSource:((q=F[0])===null||q===void 0?void 0:q.value)||"",videoUrl:""}});var ee=S();var[en,er]=(0,c.useState)(false);var[ei,eo]=(0,c.useState)({hours:0,minutes:0,seconds:0});var[ea,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(V(t.value,r));Z===null||Z===void 0?void 0:Z(V(t.value,r));try{er(true);ef();var i=yield O("external_url",n.url);var o=yield P(n.url);if(!o){return}eo((0,B/* .covertSecondsToHMS */.lL)(Math.floor(o)));if(T){T((0,B/* .covertSecondsToHMS */.lL)(Math.floor(o)))}if(i){es(i)}}finally{er(false)}})();var{openMediaLibrary:ev,resetFiles:ep}=(0,E/* ["default"] */.Z)({options:{type:(W===null||W===void 0?void 0:W.length)?W.map(e=>"video/".concat(e)).join(","):"video"},onChange:eu});var{openMediaLibrary:eh,resetFiles:ef}=(0,E/* ["default"] */.Z)({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(V(t.value,r));Z===null||Z===void 0?void 0:Z(V(t.value,r))},initialFiles:((U=t.value)===null||U===void 0?void 0:U.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=F[0])===null||n===void 0?void 0:n.value);$.setValue("videoUrl",e_["source_".concat((r=F[0])===null||r===void 0?void 0:r.value)]||"");return}var i=j.includes(e_.source);if(!i){t.onChange(V(e_,{source:""}));return}$.setValue("videoSource",e_.source);$.setValue("videoUrl",e_["source_".concat(e_.source)]||"");if(!e_.poster_url&&Q.includes(e_.source)){var o=e_.source;er(true);O(o,e_["source_".concat(o)]||"").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}eo((0,B/* .covertSecondsToHMS */.lL)(Math.floor(e)));if(T){T((0,B/* .covertSecondsToHMS */.lL)(Math.floor(e)))}})}if(["external_url","html5"].includes(e_.source)){P(e_["source_".concat(e_.source)]||"").then(e=>{if(!e){return}eo((0,B/* .covertSecondsToHMS */.lL)(Math.floor(e)));if(T){T((0,B/* .covertSecondsToHMS */.lL)(Math.floor(e)))}})}if(e_.source==="youtube"&&((e=_/* .tutorConfig.settings */.y.settings)===null||e===void 0?void 0:e.youtube_api_key_exist)){var a;var s=(a=K.youtube(e_["source_youtube"]||""))!==null&&a!==void 0?a:"";ee.mutateAsync(s).then(e=>{var t=e.data.duration;if(!t){return}var n=A(t);eo((0,B/* .covertSecondsToHMS */.lL)(Math.floor(n)));if(T){T((0,B/* .covertSecondsToHMS */.lL)(Math.floor(n)))}})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[e_]);if(!j.length){return/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.emptyMediaWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:a,children:/*#__PURE__*/(0,s/* .jsx */.tZ)("label",{children:a})}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.emptyMedia({hasVideoSource:false}),children:[/*#__PURE__*/(0,s/* .jsxs */.BX)("p",{css:et.warningText,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"info",height:20,width:20}),(0,d.__)("No video source selected","tutor")]}),/*#__PURE__*/(0,s/* .jsx */.tZ)(v/* ["default"] */.Z,{buttonCss:et.selectFromSettingsButton,variant:"secondary",size:"small",icon:/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"linkExternal",height:24,width:24}),onClick:()=>{window.open(_/* ["default"].VIDEO_SOURCES_SETTINGS_URL */.Z.VIDEO_SOURCES_SETTINGS_URL,"_blank","noopener")},children:(0,d.__)("Select from settings","tutor")})]})]})}var em=e=>{if(e==="video"){ev();return}eh()};var eb=e=>{var n=e==="video"?{source:"",source_video_id:"",poster:"",poster_url:""}:{poster:"",poster_url:""};var r=V(e_,n);if(e==="video"){ep()}else{ef()}t.onChange(r);es("");eo({hours:0,minutes:0,seconds:0});if(Z){Z(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(V(e_,i));Z===null||Z===void 0?void 0:Z(V(e_,i));ed(false);var[o,a]=yield Promise.all([G({source:n,url:r,getYouTubeVideoDurationMutation:ee}),Q.includes(n)?O(n,r):null]);if(o){eo(o);T===null||T===void 0?void 0:T(o)}if(a){es(a)}}finally{er(false)}})();var eZ=e=>{var t=e.trim();if(eg==="embedded")return true;if(eg==="shortcode"){return K.shortcode(t)?true:(0,d.__)("Invalid Shortcode","tutor")}if(!K.url(t)){return(0,d.__)("Invalid URL","tutor")}if(eg==="youtube"&&!K.youtube(t)){return(0,d.__)("Invalid YouTube URL","tutor")}if(eg==="vimeo"&&!K.vimeo(t)){return(0,d.__)("Invalid Vimeo URL","tutor")}return true};return/*#__PURE__*/(0,s/* .jsxs */.BX)(s/* .Fragment */.HY,{children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(N/* ["default"] */.Z,{label:a,field:t,fieldState:n,helpText:m,children:()=>{return/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{ref:ec,children:/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:!D,fallback:/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:et.emptyMedia({hasVideoSource:true}),children:/*#__PURE__*/(0,s/* .jsx */.tZ)(h/* .LoadingOverlay */.fz,{})}),children:/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:ey(),fallback:/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.emptyMedia({hasVideoSource:true}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:j.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.tZ)(v/* ["default"] */.Z,{"data-cy":"upload-media",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"monitorPlay",height:24,width:24}),onClick:()=>{em("video")},children:b})}),/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:j.filter(e=>e!=="html5").length>0,children:/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:!j.includes("html5"),fallback:/*#__PURE__*/(0,s/* .jsx */.tZ)("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 */.tZ)(v/* ["default"] */.Z,{"data-cy":"add-from-url",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"plusSquareBrand",height:24,width:24}),onClick:()=>{ed(e=>!e)},children:(0,d.__)("Add from URL","tutor")})})}),/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:j.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.tZ)("p",{css:et.infoTexts,children:y})})]}),children:()=>{var e;return/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.previewWrapper,"data-cy":"media-preview",children:[/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.videoInfoWrapper,children:[/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.videoInfoCard,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:Y[e_===null||e_===void 0?void 0:e_.source]||"video",height:36,width:36}),/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:et.videoInfo,children:/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:et.videoInfoTitle,children:/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:M/* .styleUtils.text.ellipsis */.i.text.ellipsis(1),children:Q.includes((e_===null||e_===void 0?void 0:e_.source)||"")?e_===null||e_===void 0?void 0:e_["source_".concat(e_.source)]:(e=X.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 */.BX)("div",{css:et.actionButtons,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(w/* ["default"] */.Z,{when:eg!=="html5",children:/*#__PURE__*/(0,s/* .jsx */.tZ)("button",{type:"button",css:M/* .styleUtils.actionButton */.i.actionButton,onClick:()=>{ed(true)},children:/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"edit",height:24,width:24})})}),/*#__PURE__*/(0,s/* .jsx */.tZ)("button",{"data-cy":"remove-video",type:"button",css:M/* .styleUtils.actionButton */.i.actionButton,onClick:()=>{eb("video")},children:/*#__PURE__*/(0,s/* .jsx */.tZ)(f/* ["default"] */.Z,{name:"cross",height:24,width:24})})]})]}),/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:et.imagePreview({hasImageInput:Q.includes((e_===null||e_===void 0?void 0:e_.source)||"")}),children:/*#__PURE__*/(0,s/* .jsxs */.BX)(w/* ["default"] */.Z,{when:Q.includes((e_===null||e_===void 0?void 0:e_.source)||""),fallback:/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:et.urlData,children:$.watch("videoUrl")}),children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(p/* ["default"] */.Z,{value:e_?{id:Number(e_.poster)||0,url:e_.poster_url||ea,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 */.tZ)(w/* ["default"] */.Z,{when:ei.hours>0||ei.minutes>0||ei.seconds>0,children:/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.duration,children:[ei.hours>0&&"".concat(ei.hours,"h")," ",ei.minutes,"m ",ei.seconds,"s"]})})]})})]})}})})})}}),/*#__PURE__*/(0,s/* .jsx */.tZ)(g/* ["default"] */.Z,{triggerRef:ec,isOpen:el,placement:C/* .POPOVER_PLACEMENTS.MIDDLE */.h_.MIDDLE,animationType:x/* .AnimationType.fadeIn */.ru.fadeIn,closePopover:()=>ed(false),positionModifier:{top:17,left:0},maxWidth:"".concat(((R=ec.current)===null||R===void 0?void 0:R.offsetWidth)||300,"px"),children:/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.popoverContent,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(u/* .Controller */.Qr,{control:$.control,name:"videoSource",rules:(0,i._)({},(0,I/* .requiredRule */.n0)()),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.tZ)(J/* ["default"] */.Z,(0,o._)((0,i._)({},e),{options:F,disabled:X.length<=1,placeholder:(0,d.__)("Select source","tutor"),hideCaret:X.length<=1}))}}),/*#__PURE__*/(0,s/* .jsx */.tZ)(u/* .Controller */.Qr,{control:$.control,name:"videoUrl",rules:(0,o._)((0,i._)({},(0,I/* .requiredRule */.n0)()),{validate:eZ}),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.tZ)(L/* ["default"] */.Z,(0,o._)((0,i._)({},e),{inputCss:/*#__PURE__*/(0,l/* .css */.iv)("border-style:dashed;"),rows:2,placeholder:H[eg]||(0,d.__)("Paste Here","tutor")}))}}),/*#__PURE__*/(0,s/* .jsxs */.BX)("div",{css:et.popoverButtonWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.tZ)(v/* ["default"] */.Z,{variant:"text",size:"small",onClick:()=>{ed(false)},children:(0,d.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.tZ)(v/* ["default"] */.Z,{"data-cy":"submit-url",variant:"secondary",size:"small",onClick:$.handleSubmit(ew),children:(0,d.__)("Ok","tutor")})]})]})})]})};/* ESM default export */const ee=(0,Z/* .withVisibilityControl */.v)($);var et={emptyMediaWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",b/* .spacing["4"] */.W0["4"],";label{",y/* .typography.caption */.c.caption(),";color:",b/* .colorTokens.text.title */.Jv.text.title,";}"),emptyMedia:e=>{var{hasVideoSource:t=false}=e;return/*#__PURE__*/(0,l/* .css */.iv)("width:100%;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",b/* .spacing["8"] */.W0["8"],";border:1px dashed ",b/* .colorTokens.stroke.border */.Jv.stroke.border,";border-radius:",b/* .borderRadius["8"] */.E0["8"],";background-color:",b/* .colorTokens.background.status.warning */.Jv.background.status.warning,";",t&&(0,l/* .css */.iv)(U(),b/* .colorTokens.bg.white */.Jv.bg.white))},infoTexts:/*#__PURE__*/(0,l/* .css */.iv)(y/* .typography.tiny */.c.tiny(),";color:",b/* .colorTokens.text.subdued */.Jv.text.subdued,";"),warningText:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",b/* .spacing["4"] */.W0["4"],";",y/* .typography.caption */.c.caption(),";color:",b/* .colorTokens.text.warning */.Jv.text.warning,";"),selectFromSettingsButton:/*#__PURE__*/(0,l/* .css */.iv)("background:",b/* .colorTokens.bg.white */.Jv.bg.white,";"),urlData:/*#__PURE__*/(0,l/* .css */.iv)(y/* .typography.caption */.c.caption(),";",M/* .styleUtils.display.flex */.i.display.flex("column"),";padding:",b/* .spacing["8"] */.W0["8"]," ",b/* .spacing["12"] */.W0["12"],";gap:",b/* .spacing["8"] */.W0["8"],";word-break:break-all;"),previewWrapper:/*#__PURE__*/(0,l/* .css */.iv)("width:100%;height:100%;border:1px solid ",b/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";border-radius:",b/* .borderRadius["8"] */.E0["8"],";overflow:hidden;background-color:",b/* .colorTokens.bg.white */.Jv.bg.white,";"),videoInfoWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";justify-content:space-between;align-items:center;gap:",b/* .spacing["20"] */.W0["20"],";padding:",b/* .spacing["8"] */.W0["8"]," ",b/* .spacing["12"] */.W0["12"],";"),videoInfoCard:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";align-items:center;gap:",b/* .spacing["8"] */.W0["8"],";svg{flex-shrink:0;color:",b/* .colorTokens.icon.hover */.Jv.icon.hover,";}"),videoInfo:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",b/* .spacing["4"] */.W0["4"],";"),videoInfoTitle:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";",y/* .typography.caption */.c.caption("medium"),"    word-break:break-all;"),imagePreview:e=>{var{hasImageInput:t}=e;return/*#__PURE__*/(0,l/* .css */.iv)("width:100%;max-height:168px;position:relative;overflow:hidden;background-color:",b/* .colorTokens.background["default"] */.Jv.background["default"],";",!t&&(0,l/* .css */.iv)(R(),M/* .styleUtils.overflowYAuto */.i.overflowYAuto),";scrollbar-gutter:auto;&:hover{[data-hover-buttons-wrapper]{opacity:1;}}")},duration:/*#__PURE__*/(0,l/* .css */.iv)(y/* .typography.tiny */.c.tiny(),";position:absolute;bottom:",b/* .spacing["12"] */.W0["12"],";right:",b/* .spacing["12"] */.W0["12"],";background-color:rgba(0,0,0,0.5);color:",b/* .colorTokens.text.white */.Jv.text.white,";padding:",b/* .spacing["4"] */.W0["4"]," ",b/* .spacing["8"] */.W0["8"],";border-radius:",b/* .borderRadius["6"] */.E0["6"],";pointer-events:none;"),thumbImage:/*#__PURE__*/(0,l/* .css */.iv)("border-radius:0;border:none;"),urlButton:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.resetButton */.i.resetButton,";",y/* .typography.small */.c.small("medium"),";color:",b/* .colorTokens.text.brand */.Jv.text.brand,";border-radius:",b/* .borderRadius["2"] */.E0["2"],";padding:0 ",b/* .spacing["4"] */.W0["4"],";margin-bottom:",b/* .spacing["8"] */.W0["8"],";&:focus,&:active,&:hover{background:none;color:",b/* .colorTokens.text.brand */.Jv.text.brand,";}&:focus-visible{outline:2px solid ",b/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}"),actionButtons:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";gap:",b/* .spacing["4"] */.W0["4"],";"),popover:/*#__PURE__*/(0,l/* .css */.iv)("position:absolute;width:100%;z-index:",b/* .zIndex.dropdown */.W5.dropdown,";background-color:",b/* .colorTokens.bg.white */.Jv.bg.white,";border-radius:",b/* .borderRadius.card */.E0.card,";box-shadow:",b/* .shadow.popover */.AF.popover,";"),popoverContent:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",b/* .spacing["12"] */.W0["12"],";padding:",b/* .spacing["16"] */.W0["16"],";"),popoverButtonWrapper:/*#__PURE__*/(0,l/* .css */.iv)(M/* .styleUtils.display.flex */.i.display.flex(),";gap:",b/* .spacing["8"] */.W0["8"],";justify-content:flex-end;")}},3960:function(e,t,n){n.d(t,{Z:()=>J});/* ESM import */var r=n(76150);/* ESM import */var i=n(58865);/* ESM import */var o=n(35944);/* ESM import */var a=n(70917);/* ESM import */var s=n(38003);/* ESM import */var l=/*#__PURE__*/n.n(s);/* ESM import */var d=n(86138);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(87363);/* ESM import */var v=/*#__PURE__*/n.n(u);/* ESM import */var p=n(87056);/* ESM import */var h=n(19398);/* ESM import */var f=n(2613);/* ESM import */var g=n(26815);/* ESM import */var _=n(58982);/* ESM import */var m=n(85746);/* ESM import */var b=n(54273);/* ESM import */var y=n(6293);/* ESM import */var w=n(63260);/* ESM import */var Z=n(31342);/* ESM import */var x=n(99678);/* ESM import */var k=n(34039);/* ESM import */var C=n(74053);/* ESM import */var E=n(60860);/* ESM import */var W=n(36352);/* ESM import */var D=n(17106);/* ESM import */var T=n(29535);/* ESM import */var q=n(14578);/* ESM import */var S=n(43567);/* ESM import */var M=n(84978);function B(){var e=(0,i._)(["\n      overflow: hidden;\n      border-radius: ",";\n    "]);B=function t(){return e};return e}var I;var z={droip:"droipColorized",elementor:"elementorColorized",gutenberg:"gutenbergColorized",divi:"diviColorized"};var P=!!k/* .tutorConfig.tutor_pro_url */.y.tutor_pro_url;var A=(I=k/* .tutorConfig.settings */.y.settings)===null||I===void 0?void 0:I.chatgpt_key_exist;var O=e=>{var{editorUsed:t,onBackToWPEditorClick:n,onCustomEditorButtonClick:i}=e;var{showModal:a}=(0,w/* .useModal */.d)();var[l,d]=(0,u.useState)("");return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:L.editorOverlay,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{when:t.name!=="gutenberg",children:/*#__PURE__*/(0,o/* .jsx */.tZ)(h/* ["default"] */.Z,{variant:"tertiary",size:"small",buttonCss:L.editWithButton,icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{name:"arrowLeft",height:24,width:24}),loading:l==="back_to",onClick:()=>(0,r._)(function*(){var{action:e}=yield a({component:y/* ["default"] */.Z,props:{title:(0,s.__)("Back to WordPress Editor","tutor"),description:/*#__PURE__*/(0,o/* .jsx */.tZ)(p/* ["default"] */.Z,{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:E/* .zIndex.highest */.W5.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,o/* .jsx */.tZ)(h/* ["default"] */.Z,{variant:"tertiary",size:"small",buttonCss:L.editWithButton,loading:l==="edit_with",icon:z[t.name]&&/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{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 N=e=>{var{label:t,field:n,fieldState:i,disabled:a,readOnly:l,loading:d,placeholder:c,helpText:v,onChange:p,generateWithAi:h=false,onClickAiButton:y,hasCustomEditorSupport:B=false,isMinimal:I=false,hideMediaButtons:N=false,hideQuickTags:J=false,editors:U=[],editorUsed:R={name:"classic",label:"Classic Editor",link:""},isMagicAi:X=false,autoFocus:F=false,onCustomEditorButtonClick:j,onBackToWPEditorClick:Q,onFullScreenChange:H,min_height:Y,max_height:V,toolbar1:K,toolbar2:G}=e;var $,ee,et,en,er;var{showModal:ei}=(0,w/* .useModal */.d)();var eo=(($=k/* .tutorConfig.settings */.y.settings)===null||$===void 0?void 0:$.hide_admin_bar_for_users)==="off";var ea=(et=k/* .tutorConfig.current_user */.y.current_user)===null||et===void 0?void 0:(ee=et.roles)===null||ee===void 0?void 0:ee.includes(C/* .TutorRoles.ADMINISTRATOR */.er.ADMINISTRATOR);var es=(er=k/* .tutorConfig.current_user */.y.current_user)===null||er===void 0?void 0:(en=er.roles)===null||en===void 0?void 0:en.includes(C/* .TutorRoles.TUTOR_INSTRUCTOR */.er.TUTOR_INSTRUCTOR);var[el,ed]=(0,u.useState)(null);var ec=U.filter(e=>ea||es&&eo||e.name==="droip");var eu=B&&ec.length>0;var ev=eu&&R.name!=="classic";var ep=()=>{if(!P){ei({component:Z/* ["default"] */.Z,props:{image:S,image2x:q}})}else if(!A){ei({component:x/* ["default"] */.Z,props:{image:S,image2x:q}})}else{ei({component:b/* ["default"] */.Z,isMagicAi:true,props:{title:(0,s.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{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,o/* .jsxs */.BX)("div",{css:L.editorLabel,children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("span",{css:L.labelWithAi,children:[t,/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{when:h,children:/*#__PURE__*/(0,o/* .jsx */.tZ)("button",{type:"button",css:L.aiButton,onClick:ep,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{name:"magicAiColorize",width:32,height:32})})})]}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:L.editorsButtonWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("span",{children:(0,s.__)("Edit with","tutor")}),/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:L.customEditorButtons,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(W/* ["default"] */.Z,{each:ec,children:e=>/*#__PURE__*/(0,o/* .jsx */.tZ)(_/* ["default"] */.Z,{content:e.label,delay:200,children:/*#__PURE__*/(0,o/* .jsxs */.BX)("button",{type:"button",css:L.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,o/* .jsx */.tZ)(D/* ["default"] */.Z,{when:el===e.name,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* .LoadingOverlay */.fz,{})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{name:z[e.name],height:24,width:24})]})},e.name)})})]})]});return/*#__PURE__*/(0,o/* .jsx */.tZ)(M/* ["default"] */.Z,{label:eu?eh:t,field:n,fieldState:i,disabled:a,readOnly:l,placeholder:c,helpText:v,isMagicAi:X,generateWithAi:!eu&&h,onClickAiButton:ep,replaceEntireLabel:eu,children:()=>{if(d){return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:T/* .styleUtils.flexCenter */.i.flexCenter(),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(f/* ["default"] */.ZP,{size:20,color:E/* .colorTokens.icon["default"] */.Jv.icon["default"]})})}var e;return/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:L.wrapper({isOverlayVisible:ev}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(D/* ["default"] */.Z,{when:ev,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(O,{editorUsed:R,onBackToWPEditorClick:Q,onCustomEditorButtonClick:j})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(m/* ["default"] */.Z,{value:(e=n.value)!==null&&e!==void 0?e:"",onChange:e=>{n.onChange(e);if(p){p(e)}},isMinimal:I,hideMediaButtons:N,hideQuickTags:J,autoFocus:F,onFullScreenChange:H,readonly:l,min_height:Y,max_height:V,toolbar1:K,toolbar2:G})]})}})};/* ESM default export */const J=N;var L={wrapper:e=>{var{isOverlayVisible:t=false}=e;return/*#__PURE__*/(0,a/* .css */.iv)("position:relative;",t&&(0,a/* .css */.iv)(B(),E/* .borderRadius["6"] */.E0["6"]))},editorLabel:/*#__PURE__*/(0,a/* .css */.iv)("display:flex;width:100%;align-items:center;justify-content:space-between;"),aiButton:/*#__PURE__*/(0,a/* .css */.iv)(T/* .styleUtils.resetButton */.i.resetButton,";",T/* .styleUtils.flexCenter */.i.flexCenter(),";width:32px;height:32px;border-radius:",E/* .borderRadius["4"] */.E0["4"],";:disabled{cursor:not-allowed;}&:focus-visible{outline:2px solid ",E/* .colorTokens.stroke.brand */.Jv.stroke.brand,";}"),labelWithAi:/*#__PURE__*/(0,a/* .css */.iv)("display:flex;align-items:center;gap:",E/* .spacing["4"] */.W0["4"],";"),editorsButtonWrapper:/*#__PURE__*/(0,a/* .css */.iv)("display:flex;align-items:center;gap:",E/* .spacing["8"] */.W0["8"],";color:",E/* .colorTokens.text.hints */.Jv.text.hints,";"),customEditorButtons:/*#__PURE__*/(0,a/* .css */.iv)("display:flex;align-items:center;gap:",E/* .spacing["4"] */.W0["4"],";"),customEditorButton:/*#__PURE__*/(0,a/* .css */.iv)(T/* .styleUtils.resetButton */.i.resetButton,"    display:flex;align-items:center;justify-content:center;position:relative;border-radius:",E/* .borderRadius.circle */.E0.circle,";&:focus-visible{outline:2px solid ",E/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}"),editorOverlay:/*#__PURE__*/(0,a/* .css */.iv)("position:absolute;height:100%;width:100%;",T/* .styleUtils.flexCenter */.i.flexCenter(),";gap:",E/* .spacing["8"] */.W0["8"],";background-color:",c()(E/* .colorTokens.background.modal */.Jv.background.modal,.6),";border-radius:",E/* .borderRadius["6"] */.E0["6"],";z-index:",E/* .zIndex.positive */.W5.positive,";backdrop-filter:blur(8px);"),editWithButton:/*#__PURE__*/(0,a/* .css */.iv)("background:",E/* .colorTokens.action.secondary["default"] */.Jv.action.secondary["default"],";color:",E/* .colorTokens.text.primary */.Jv.text.primary,";box-shadow:inset 0 -1px 0 0 ",c()("#1112133D",.24),",0 1px 0 0 ",c()("#1112133D",.8),";")}},33267:function(e,t,n){n.d(t,{R:()=>d});/* ESM import */var r=n(35944);/* ESM import */var i=n(60860);/* ESM import */var o=n(75361);/* ESM import */var a=n(70917);/* ESM import */var s=n(87363);/* ESM import */var l=/*#__PURE__*/n.n(s);var d=/*#__PURE__*/l().forwardRef((e,t)=>{var{src:n,width:i,height:a,brushSize:l,trackStack:d,pointer:u,setTrackStack:v,setPointer:p}=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,o/* .getCanvas */.o_)(t);if(!n||!r){return}var i=n.getBoundingClientRect();var a=(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(a,s);f(true);_({x:a,y:s})};var y=e=>{var{canvas:n,context:r}=(0,o/* .getCanvas */.o_)(t);if(!n||!r||!m.current){return}var i=n.getBoundingClientRect();var a={x:(e.clientX-i.left)*(n.width/i.width),y:(e.clientY-i.top)*(n.height/i.height)};if(h){(0,o/* .drawPath */.MC)(r,a)}m.current.style.left="".concat(a.x,"px");m.current.style.top="".concat(a.y,"px")};var w=e=>{var{canvas:n,context:r}=(0,o/* .getCanvas */.o_)(t);if(!r||!n){return}f(false);r.closePath();var i=n.getBoundingClientRect();var a={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,o/* .calculateCartesianDistance */.jo)(g,a)===0){(0,o/* .drawPath */.MC)(r,{x:a.x+1,y:a.y+1})}v(e=>{var t=e.slice(0,u);return[...t,r.getImageData(0,0,1024,1024)]});p(e=>e+1)};var Z=()=>{var{canvas:e,context:r}=(0,o/* .getCanvas */.o_)(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 o;var a;if(n>t){a=e.height;o=e.height*t}else{o=e.width;a=e.width/t}var s=(e.width-o)/2;var l=(e.height-a)/2;r.drawImage(i,s,l,o,a);if(d.length===0){v([r.getImageData(0,0,e.width,e.height)])}};r.lineJoin="round";r.lineCap="round"};var x=()=>{if(!m.current){return}document.body.style.cursor="none";m.current.style.display="block"};var k=()=>{if(!m.current){return}document.body.style.cursor="auto";m.current.style.display="none"};(0,s.useEffect)(()=>{Z();// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,r/* .jsxs */.BX)("div",{css:c.wrapper,children:[/*#__PURE__*/(0,r/* .jsx */.tZ)("canvas",{ref:t,width:i,height:a,onMouseDown:b,onMouseMove:y,onMouseUp:w,onMouseEnter:x,onMouseLeave:k}),/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{ref:m,css:c.customCursor(l)})]})});var c={wrapper:/*#__PURE__*/(0,a/* .css */.iv)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,a/* .css */.iv)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",i/* .borderRadius.circle */.E0.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 */.Jv.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",i/* .zIndex.highest */.W5.highest,";display:none;")}},68439:function(e,t,n){n.d(t,{$h:()=>v,DK:()=>h,_$:()=>f});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(35944);/* ESM import */var a=n(37861);/* ESM import */var s=n(38003);/* ESM import */var l=/*#__PURE__*/n.n(s);/* ESM import */var d=n(87363);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(52293);var v=[(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 p=/*#__PURE__*/c().createContext(null);var h=()=>{var e=(0,d.useContext)(p);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,a/* .useFormWithGlobalError */.O)({defaultValues:{prompt:"",style:"none"}});var[v,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,o/* .jsx */.tZ)(p.Provider,{value:{state:v,onDropdownMenuChange:b,images:_,setImages:m,currentImage:f,setCurrentImage:g,field:n,fieldState:s,onCloseModal:l},children:/*#__PURE__*/(0,o/* .jsx */.tZ)(u/* .FormProvider */.RV,(0,i._)((0,r._)({},c),{children:t}))})}},59355:function(e,t,n){n.d(t,{E:()=>L});/* ESM import */var r=n(76150);/* ESM import */var i=n(7409);/* ESM import */var o=n(99282);/* ESM import */var a=n(35944);/* ESM import */var s=n(53052);/* ESM import */var l=n(26815);/* ESM import */var d=n(99308);/* ESM import */var c=n(3473);/* ESM import */var u=n(60860);/* ESM import */var v=n(76487);/* ESM import */var p=n(36352);/* ESM import */var h=n(17106);/* ESM import */var f=n(15287);/* ESM import */var g=n(56096);/* ESM import */var _=n(67149);/* ESM import */var m=n(41834);/* ESM import */var b=n(42336);/* ESM import */var y=n(79608);/* ESM import */var w=n(4359);/* ESM import */var Z=n(88013);/* ESM import */var x=n(53192);/* ESM import */var k=n(48366);/* ESM import */var C=n(39071);/* ESM import */var E=n(43666);/* ESM import */var W=n(46572);/* ESM import */var D=n(13985);/* ESM import */var T=n(29535);/* ESM import */var q=n(22456);/* ESM import */var S=n(70917);/* ESM import */var M=n(38003);/* ESM import */var B=/*#__PURE__*/n.n(M);/* ESM import */var I=n(87363);/* ESM import */var z=/*#__PURE__*/n.n(I);/* ESM import */var P=n(52293);/* ESM import */var A=n(68439);/* ESM import */var O=n(45019);/* ESM import */var N=n(95754);var J=[{label:(0,M.__)("None","tutor"),value:"none",image:x},{label:(0,M.__)("Photo","tutor"),value:"photo",image:C},{label:(0,M.__)("Neon","tutor"),value:"neon",image:Z},{label:(0,M.__)("3D","tutor"),value:"3d",image:g},{label:(0,M.__)("Painting","tutor"),value:"painting",image:k},{label:(0,M.__)("Sketch","tutor"),value:"sketch",image:W},{label:(0,M.__)("Concept","tutor"),value:"concept_art",image:m},{label:(0,M.__)("Illustration","tutor"),value:"illustration",image:w},{label:(0,M.__)("Dreamy","tutor"),value:"dreamy",image:b},{label:(0,M.__)("Filmic","tutor"),value:"filmic",image:y},{label:(0,M.__)("Retro","tutor"),value:"retrowave",image:E},{label:(0,M.__)("Black & White","tutor"),value:"black-and-white",image:_}];var L=()=>{var e=(0,P/* .useForm */.cI)({defaultValues:{style:"none",prompt:""}});var{images:t,setImages:n}=(0,A/* .useMagicImageGeneration */.DK)();var u=(0,f/* .useMagicImageGenerationMutation */.QL)();var{showToast:v}=(0,D/* .useToast */.p)();var[g,_]=(0,I.useState)(t.every(e=>e===null));var[m,b]=(0,I.useState)([false,false,false,false]);var y=e.watch("style");var w=e.watch("prompt");var Z=!y||!w;var x=t.some(q/* .isDefined */.$K);(0,I.useEffect)(()=>{if(u.isError){v({type:"danger",message:u.error.response.data.message})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[u.isError]);(0,I.useEffect)(()=>{e.setFocus("prompt");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,a/* .jsxs */.BX)("form",{css:N/* .magicAIStyles.wrapper */.a.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 o=[...t];var a;o[r]=(a=(i=e.data.data)===null||i===void 0?void 0:(n=i[0])===null||n===void 0?void 0:n.b64_json)!==null&&a!==void 0?a:null;return o});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,a/* .jsx */.tZ)("div",{css:N/* .magicAIStyles.left */.a.left,children:/*#__PURE__*/(0,a/* .jsx */.tZ)(h/* ["default"] */.Z,{when:!g,fallback:/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"magicAiPlaceholder",width:72,height:72}),children:/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:U.images,children:/*#__PURE__*/(0,a/* .jsx */.tZ)(p/* ["default"] */.Z,{each:t,children:(e,t)=>{return/*#__PURE__*/(0,a/* .jsx */.tZ)(O/* .AiImageItem */.J,{src:e,loading:m[t],index:t},t)}})})})}),/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:N/* .magicAIStyles.right */.a.right,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:U.fields,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:U.promptWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(P/* .Controller */.Qr,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,a/* .jsx */.tZ)(c/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,M.__)("Visualize Your Course","tutor"),placeholder:(0,M.__)("Describe the image you want for your course thumbnail","tutor"),rows:4,isMagicAi:true,disabled:u.isPending,enableResize:false}))}),/*#__PURE__*/(0,a/* .jsxs */.BX)("button",{type:"button",css:U.inspireButton,onClick:()=>{var t=A/* .inspirationPrompts.length */.$h.length;var n=Math.floor(Math.random()*t);e.reset((0,o._)((0,i._)({},e.getValues()),{prompt:A/* .inspirationPrompts */.$h[n]}))},disabled:u.isPending,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"bulbLine"}),(0,M.__)("Inspire Me","tutor")]})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)(P/* .Controller */.Qr,{control:e.control,name:"style",render:e=>/*#__PURE__*/(0,a/* .jsx */.tZ)(d/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,M.__)("Styles","tutor"),options:J,disabled:u.isPending}))})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:N/* .magicAIStyles.rightFooter */.a.rightFooter,children:/*#__PURE__*/(0,a/* .jsxs */.BX)(s/* ["default"] */.Z,{type:"submit",disabled:u.isPending||Z,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:x?"reload":"magicAi",width:24,height:24}),x?(0,M.__)("Generate Again","tutor"):(0,M.__)("Generate Now","tutor")]})})]})]})};var U={images:/*#__PURE__*/(0,S/* .css */.iv)("display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));grid-template-rows:repeat(2,minmax(150px,1fr));gap:",u/* .spacing["12"] */.W0["12"],";align-self:start;padding:",u/* .spacing["24"] */.W0["24"],";width:100%;height:100%;> div{aspect-ratio:1 / 1;}"),fields:/*#__PURE__*/(0,S/* .css */.iv)("display:flex;flex-direction:column;gap:",u/* .spacing["12"] */.W0["12"],";"),promptWrapper:/*#__PURE__*/(0,S/* .css */.iv)("position:relative;textarea{padding-bottom:",u/* .spacing["40"] */.W0["40"]," !important;}"),inspireButton:/*#__PURE__*/(0,S/* .css */.iv)(T/* .styleUtils.resetButton */.i.resetButton,";",v/* .typography.small */.c.small(),";position:absolute;height:28px;bottom:",u/* .spacing["12"] */.W0["12"],";left:",u/* .spacing["12"] */.W0["12"],";border:1px solid ",u/* .colorTokens.stroke.brand */.Jv.stroke.brand,";border-radius:",u/* .borderRadius["4"] */.E0["4"],";display:flex;align-items:center;gap:",u/* .spacing["4"] */.W0["4"],";color:",u/* .colorTokens.text.brand */.Jv.text.brand,";padding-inline:",u/* .spacing["12"] */.W0["12"],";background-color:",u/* .colorTokens.background.white */.Jv.background.white,";&:hover{background-color:",u/* .colorTokens.background.brand */.Jv.background.brand,";color:",u/* .colorTokens.text.white */.Jv.text.white,";}&:focus-visible{outline:2px solid ",u/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}&:disabled{background-color:",u/* .colorTokens.background.disable */.Jv.background.disable,";color:",u/* .colorTokens.text.disable */.Jv.text.disable,";}")}},45019:function(e,t,n){n.d(t,{J:()=>T});/* ESM import */var r=n(76150);/* ESM import */var i=n(58865);/* ESM import */var o=n(35944);/* ESM import */var a=n(70917);/* ESM import */var s=n(38003);/* ESM import */var l=/*#__PURE__*/n.n(s);/* ESM import */var d=n(87363);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(53052);/* ESM import */var v=n(26815);/* ESM import */var p=n(97669);/* ESM import */var h=n(60860);/* ESM import */var f=n(76487);/* ESM import */var g=n(36352);/* ESM import */var _=n(54354);/* ESM import */var m=n(15287);/* ESM import */var b=n(75361);/* ESM import */var y=n(29535);/* ESM import */var w=n(34403);/* ESM import */var Z=n(68439);function x(){var e=(0,i._)(["\n      background-position: top left;\n    "]);x=function t(){return e};return e}function k(){var e=(0,i._)(["\n      background-position: top right;\n      animation-delay: 0.5s;\n    "]);k=function t(){return e};return e}function C(){var e=(0,i._)(["\n      background-position: bottom left;\n      animation-delay: 1.5s;\n    "]);C=function t(){return e};return e}function E(){var e=(0,i._)(["\n      background-position: bottom right;\n      animation-delay: 1s;\n    "]);E=function t(){return e};return e}function W(){var e=(0,i._)(["\n      outline-color: ",";\n\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);W=function t(){return e};return e}var D=[{label:(0,s.__)("Magic Fill","tutor"),value:"magic-fill",icon:/*#__PURE__*/(0,o/* .jsx */.tZ)(v/* ["default"] */.Z,{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,o/* .jsx */.tZ)(v/* ["default"] */.Z,{name:"download",width:24,height:24})}];var T=e=>{var{src:t,loading:n,index:i}=e;var a=(0,d.useRef)(null);var[l,c]=(0,d.useState)(false);var{onDropdownMenuChange:h,setCurrentImage:f,onCloseModal:y,field:x}=(0,Z/* .useMagicImageGeneration */.DK)();var k=(0,m/* .useStoreAIGeneratedImageMutation */.H9)();if(n||!t){return/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:S.loader(i+1)})}return/*#__PURE__*/(0,o/* .jsxs */.BX)(o/* .Fragment */.HY,{children:[/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{css:S.image({isActive:k.isPending}),children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("img",{src:t,alt:(0,s.__)("Generated Image","tutor")}),/*#__PURE__*/(0,o/* .jsxs */.BX)("div",{"data-actions":true,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:S.useButton,children:/*#__PURE__*/(0,o/* .jsxs */.BX)(u/* ["default"] */.Z,{variant:"primary",disabled:k.isPending,onClick:()=>(0,r._)(function*(){if(!t){return}var e=yield k.mutateAsync({image:t});if(e.data){x.onChange(e.data);y()}})(),loading:k.isPending,children:[/*#__PURE__*/(0,o/* .jsx */.tZ)(v/* ["default"] */.Z,{name:"download",width:24,height:24}),(0,s.__)("Use This","tutor")]})}),/*#__PURE__*/(0,o/* .jsx */.tZ)(u/* ["default"] */.Z,{variant:"primary",size:"icon",css:S.threeDots,ref:a,onClick:()=>c(true),children:/*#__PURE__*/(0,o/* .jsx */.tZ)(v/* ["default"] */.Z,{name:"threeDotsVertical",width:24,height:24})})]})]}),/*#__PURE__*/(0,o/* .jsx */.tZ)(p/* ["default"] */.Z,{triggerRef:a,isOpen:l,arrow:true,closePopover:()=>{c(false)},animationType:_/* .AnimationType.slideDown */.ru.slideDown,maxWidth:"160px",children:/*#__PURE__*/(0,o/* .jsx */.tZ)("div",{css:S.dropdownOptions,children:/*#__PURE__*/(0,o/* .jsx */.tZ)(g/* ["default"] */.Z,{each:D,children:(e,n)=>/*#__PURE__*/(0,o/* .jsxs */.BX)("button",{type:"button",css:S.dropdownItem,onClick:()=>{switch(e.value){case"magic-fill":{f(t);h(e.value);break}case"download":{var n="".concat((0,w/* .nanoid */.x0)(),".png");(0,b/* .downloadBase64Image */.Lp)(t,n);break}default:break}c(false)},children:[e.icon,e.label]},n)})})})]})};var q=/*#__PURE__*/(0,a/* .keyframes */.F4)("		0%{opacity:0.3;}25%{opacity:0.5;}50%{opacity:0.7;}75%{opacity:0.5;}100%{opacity:0.3;}");var S={loader:e=>/*#__PURE__*/(0,a/* .css */.iv)("border-radius:",h/* .borderRadius["12"] */.E0["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,a/* .css */.iv)(x())," ",e===2&&(0,a/* .css */.iv)(k()),"		",e===3&&(0,a/* .css */.iv)(C()),"		",e===4&&(0,a/* .css */.iv)(E())),image:e=>{var{isActive:t}=e;return/*#__PURE__*/(0,a/* .css */.iv)("width:100%;height:100%;overflow:hidden;border-radius:",h/* .borderRadius["12"] */.E0["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,a/* .css */.iv)(W(),h/* .colorTokens.stroke.brand */.Jv.stroke.brand),"    &:hover,&:focus-within{outline-color:",h/* .colorTokens.stroke.brand */.Jv.stroke.brand,";[data-actions]{opacity:1;}}")},threeDots:/*#__PURE__*/(0,a/* .css */.iv)("position:absolute;top:",h/* .spacing["8"] */.W0["8"],";right:",h/* .spacing["8"] */.W0["8"],";border-radius:",h/* .borderRadius["4"] */.E0["4"],";"),useButton:/*#__PURE__*/(0,a/* .css */.iv)("position:absolute;left:50%;bottom:",h/* .spacing["12"] */.W0["12"],";transform:translateX(-50%);button{display:inline-flex;align-items:center;gap:",h/* .spacing["4"] */.W0["4"],";}"),dropdownOptions:/*#__PURE__*/(0,a/* .css */.iv)("display:flex;flex-direction:column;padding-block:",h/* .spacing["8"] */.W0["8"],";"),dropdownItem:/*#__PURE__*/(0,a/* .css */.iv)(f/* .typography.small */.c.small(),";",y/* .styleUtils.resetButton */.i.resetButton,";height:40px;display:flex;gap:",h/* .spacing["10"] */.W0["10"],";align-items:center;transition:background-color 0.3s ease;color:",h/* .colorTokens.text.title */.Jv.text.title,";padding-inline:",h/* .spacing["8"] */.W0["8"],";cursor:pointer;svg{color:",h/* .colorTokens.icon["default"] */.Jv.icon["default"],";}&:hover{background-color:",h/* .colorTokens.background.hover */.Jv.background.hover,";}")}},81828:function(e,t,n){n.d(t,{Z:()=>B});/* ESM import */var r=n(76150);/* ESM import */var i=n(7409);/* ESM import */var o=n(99282);/* ESM import */var a=n(35944);/* ESM import */var s=n(53052);/* ESM import */var l=n(26815);/* ESM import */var d=n(98978);/* ESM import */var c=n(60309);/* ESM import */var u=n(3473);/* ESM import */var v=n(60860);/* ESM import */var p=n(76487);/* ESM import */var h=n(17106);/* ESM import */var f=n(4867);/* ESM import */var g=n(37861);/* ESM import */var _=n(15287);/* ESM import */var m=n(75361);/* ESM import */var b=n(29535);/* ESM import */var y=n(34403);/* ESM import */var w=n(70917);/* ESM import */var Z=n(38003);/* ESM import */var x=/*#__PURE__*/n.n(Z);/* ESM import */var k=n(87363);/* ESM import */var C=/*#__PURE__*/n.n(k);/* ESM import */var E=n(52293);/* ESM import */var W=n(33267);/* ESM import */var D=n(68439);/* ESM import */var T=n(95754);var q=620;var S=620;var M=()=>{var e=(0,g/* .useFormWithGlobalError */.O)({defaultValues:{brush_size:40,prompt:""}});var t=(0,_/* .useMagicFillImageMutation */.vN)();var n=(0,k.useRef)(null);var{onDropdownMenuChange:v,currentImage:p,field:b,onCloseModal:x}=(0,D/* .useMagicImageGeneration */.DK)();var C=(0,_/* .useStoreAIGeneratedImageMutation */.H9)();var M=(0,f/* .useDebounce */.N)(e.watch("brush_size",40));var[B,I]=(0,k.useState)([]);var[P,A]=(0,k.useState)(1);var O=(0,k.useCallback)((e,t)=>{var r;var i=(r=n.current)===null||r===void 0?void 0:r.getContext("2d");if(!i){return}for(var o of t.slice(0,e)){i.putImageData(o,0,0)}},[]);(0,k.useEffect)(()=>{var e;var t=(e=n.current)===null||e===void 0?void 0:e.getContext("2d");if(!t){return}t.lineWidth=M},[M]);(0,k.useEffect)(()=>{var e=e=>{if(e.metaKey){if(e.shiftKey&&e.key.toUpperCase()==="Z"){O(P+1,B);A(e=>Math.min(e+1,B.length));return}if(e.key.toUpperCase()==="Z"){O(P-1,B);A(e=>Math.max(e-1,1));return}}};window.addEventListener("keydown",e);return()=>{window.removeEventListener("keydown",e)}},[P,B,O]);if(!p){return null}return/*#__PURE__*/(0,a/* .jsxs */.BX)("form",{css:T/* .magicAIStyles.wrapper */.a.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 o={prompt:e.prompt,image:(0,m/* .getImageData */.n$)(r)};var a=yield t.mutateAsync(o);if(a){var s=new Image;s.onload=()=>{r.width=q;r.height=S;i.drawImage(s,0,0,r.width,r.height);i.lineWidth=M;i.lineJoin="round";i.lineCap="round"};s.src=a}})()),children:[/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:T/* .magicAIStyles.left */.a.left,children:/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.leftWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.actionBar,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.backButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)("button",{type:"button",css:z.backButton,onClick:()=>v("generation"),children:/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"arrowLeft"})}),(0,Z.__)("Magic Fill","tutor")]}),/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.actions,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,{variant:"ghost",disabled:B.length===0,onClick:()=>{O(1,B);I(B.slice(0,1));A(1)},children:(0,Z.__)("Revert to Original","tutor")}),/*#__PURE__*/(0,a/* .jsx */.tZ)(d/* .Separator */.Z,{variant:"vertical",css:/*#__PURE__*/(0,w/* .css */.iv)("min-height:16px;")}),/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.undoRedo,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,{variant:"ghost",size:"icon",disabled:P<=1,onClick:()=>{O(P-1,B);A(e=>Math.max(e-1,1))},children:/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"undo",width:20,height:20})}),/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,{variant:"ghost",size:"icon",disabled:P===B.length,onClick:()=>{O(P+1,B);A(e=>Math.min(e+1,B.length))},children:/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"redo",width:20,height:20})})]})]})]}),/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.canvasAndLoading,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(W/* .DrawingCanvas */.R,{ref:n,width:q,height:S,src:p,brushSize:M,trackStack:B,pointer:P,setTrackStack:I,setPointer:A}),/*#__PURE__*/(0,a/* .jsx */.tZ)(h/* ["default"] */.Z,{when:t.isPending,children:/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:z.loading})})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:z.footerActions,children:/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:z.footerActionsLeft,children:/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,{variant:"secondary",onClick:()=>{var e="".concat((0,y/* .nanoid */.x0)(),".png");var{canvas:t}=(0,m/* .getCanvas */.o_)(n);if(!t)return;(0,m/* .downloadBase64Image */.Lp)((0,m/* .getImageData */.n$)(t),e)},children:/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"download",width:24,height:24})})})})]})}),/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:T/* .magicAIStyles.right */.a.right,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.fields,children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(E/* .Controller */.Qr,{control:e.control,name:"brush_size",render:e=>/*#__PURE__*/(0,a/* .jsx */.tZ)(c/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:"Brush Size",min:1,max:100,isMagicAi:true,hasBorder:true}))}),/*#__PURE__*/(0,a/* .jsx */.tZ)(E/* .Controller */.Qr,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,a/* .jsx */.tZ)(u/* ["default"] */.Z,(0,o._)((0,i._)({},e),{label:(0,Z.__)("Describe the Fill","tutor"),placeholder:(0,Z.__)("Write 5 words to describe...","tutor"),rows:4,isMagicAi:true}))})]}),/*#__PURE__*/(0,a/* .jsx */.tZ)("div",{css:[T/* .magicAIStyles.rightFooter */.a.rightFooter,/*#__PURE__*/(0,w/* .css */.iv)("margin-top:auto;")],children:/*#__PURE__*/(0,a/* .jsxs */.BX)("div",{css:z.footerButtons,children:[/*#__PURE__*/(0,a/* .jsxs */.BX)(s/* ["default"] */.Z,{type:"submit",disabled:t.isPending||!e.watch("prompt"),children:[/*#__PURE__*/(0,a/* .jsx */.tZ)(l/* ["default"] */.Z,{name:"magicWand",width:24,height:24}),(0,Z.__)("Generative Erase","tutor")]}),/*#__PURE__*/(0,a/* .jsx */.tZ)(s/* ["default"] */.Z,{variant:"primary_outline",disabled:t.isPending,loading:C.isPending,onClick:()=>(0,r._)(function*(){var{canvas:e}=(0,m/* .getCanvas */.o_)(n);if(!e)return;var t=yield C.mutateAsync({image:(0,m/* .getImageData */.n$)(e)});if(t.data){b.onChange(t.data);x()}})(),children:(0,Z.__)("Use Image","tutor")})]})})]})]})};/* ESM default export */const B=M;var I={loading:/*#__PURE__*/(0,w/* .keyframes */.F4)("0%{opacity:0;}50%{opacity:0.6;}100%{opacity:0;}"),walker:/*#__PURE__*/(0,w/* .keyframes */.F4)("0%{left:0%;}100%{left:100%;}")};var z={canvasAndLoading:/*#__PURE__*/(0,w/* .css */.iv)("position:relative;z-index:",v/* .zIndex.positive */.W5.positive,";"),loading:/*#__PURE__*/(0,w/* .css */.iv)("position:absolute;top:0;left:0;width:100%;height:100%;background:",v/* .colorTokens.ai.gradient_1 */.Jv.ai.gradient_1,";opacity:0.6;transition:0.5s ease opacity;animation:",I.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:",I.walker," 1s linear infinite;}"),actionBar:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;align-items:center;justify-content:space-between;"),fields:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;flex-direction:column;gap:",v/* .spacing["12"] */.W0["12"],";"),leftWrapper:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;flex-direction:column;gap:",v/* .spacing["8"] */.W0["8"],";padding-block:",v/* .spacing["16"] */.W0["16"],";"),footerButtons:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;flex-direction:column;gap:",v/* .spacing["8"] */.W0["8"],";"),footerActions:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;justify-content:space-between;"),footerActionsLeft:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;align-items:center;gap:",v/* .spacing["12"] */.W0["12"],";"),actions:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;align-items:center;gap:",v/* .spacing["16"] */.W0["16"],";"),undoRedo:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;align-items:center;gap:",v/* .spacing["12"] */.W0["12"],";"),backButtonWrapper:/*#__PURE__*/(0,w/* .css */.iv)("display:flex;align-items:center;gap:",v/* .spacing["8"] */.W0["8"],";",p/* .typography.body */.c.body("medium"),";color:",v/* .colorTokens.text.title */.Jv.text.title,";"),backButton:/*#__PURE__*/(0,w/* .css */.iv)(b/* .styleUtils.resetButton */.i.resetButton,";width:24px;height:24px;border-radius:",v/* .borderRadius["4"] */.E0["4"],";border:1px solid ",v/* .colorTokens.stroke["default"] */.Jv.stroke["default"],";display:flex;align-items:center;justify-content:center;"),image:/*#__PURE__*/(0,w/* .css */.iv)("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 */.iv)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,w/* .css */.iv)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",v/* .borderRadius.circle */.E0.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 ",v/* .colorTokens.stroke.white */.Jv.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",v/* .zIndex.highest */.W5.highest,";display:none;")}},95754:function(e,t,n){n.d(t,{a:()=>o});/* ESM import */var r=n(60860);/* ESM import */var i=n(70917);var o={wrapper:/*#__PURE__*/(0,i/* .css */.iv)("min-width:1000px;display:grid;grid-template-columns:1fr 330px;",r/* .Breakpoint.tablet */.Uo.tablet,"{min-width:auto;grid-template-columns:1fr;width:100%;}"),left:/*#__PURE__*/(0,i/* .css */.iv)("display:flex;justify-content:center;align-items:center;background-color:#f7f7f7;z-index:",r/* .zIndex.level */.W5.level,";"),right:/*#__PURE__*/(0,i/* .css */.iv)("padding:",r/* .spacing["20"] */.W0["20"],";display:flex;flex-direction:column;align-items:space-between;z-index:",r/* .zIndex.positive */.W5.positive,";"),rightFooter:/*#__PURE__*/(0,i/* .css */.iv)("display:flex;flex-direction:column;gap:",r/* .spacing["8"] */.W0["8"],";margin-top:auto;padding-top:80px;")}},36853:function(e,t,n){n.d(t,{Z:()=>c});/* ESM import */var r=n(35944);/* ESM import */var i=n(68439);/* ESM import */var o=n(59355);/* ESM import */var a=n(81828);/* ESM import */var s=n(22128);function l(){var{state:e}=(0,i/* .useMagicImageGeneration */.DK)();switch(e){case"generation":return/*#__PURE__*/(0,r/* .jsx */.tZ)(o/* .ImageGeneration */.E,{});case"magic-fill":return/*#__PURE__*/(0,r/* .jsx */.tZ)(a/* ["default"] */.Z,{});default:return null}}var d=e=>{var{title:t,icon:n,closeModal:o,field:a,fieldState:d}=e;return/*#__PURE__*/(0,r/* .jsx */.tZ)(s/* ["default"] */.Z,{onClose:o,title:t,icon:n,maxWidth:1e3,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(i/* .MagicImageGenerationProvider */._$,{field:a,fieldState:d,onCloseModal:o,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(l,{})})})};/* ESM default export */const c=d},36951:function(e,t,n){n.d(t,{Z:()=>f});/* ESM import */var r=n(35944);/* ESM import */var i=n(70917);/* ESM import */var o=n(26815);/* ESM import */var a=n(68214);/* ESM import */var s=n(62067);/* ESM import */var l=n(74053);/* ESM import */var d=n(60860);/* ESM import */var c=n(76487);/* ESM import */var u=n(17106);/* ESM import */var v=n(68675);/* ESM import */var p=n(29535);var h=e=>{var{children:t,onClose:n,title:i,subtitle:l,icon:d,headerChildren:c,entireHeader:p,actions:h,maxWidth:f=1218,blurTriggerElement:_=true}=e;(0,v/* .useScrollLock */.Pr)();return/*#__PURE__*/(0,r/* .jsx */.tZ)(s/* ["default"] */.Z,{blurPrevious:_,children:/*#__PURE__*/(0,r/* .jsxs */.BX)("div",{css:g.container({maxWidth:f}),children:[/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{css:g.header({hasHeaderChildren:!!c}),children:/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:p,fallback:/*#__PURE__*/(0,r/* .jsxs */.BX)(r/* .Fragment */.HY,{children:[/*#__PURE__*/(0,r/* .jsxs */.BX)("div",{css:g.headerContent,children:[/*#__PURE__*/(0,r/* .jsxs */.BX)("div",{css:g.iconWithTitle,children:[/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:d,children:d}),/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:i,children:/*#__PURE__*/(0,r/* .jsx */.tZ)("h6",{css:g.title,title:typeof i==="string"?i:"",children:i})})]}),/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:l,children:/*#__PURE__*/(0,r/* .jsx */.tZ)("span",{css:g.subtitle,children:l})})]}),/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{css:g.headerChildren,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:c,children:c})}),/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{css:g.actionsWrapper,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(u/* ["default"] */.Z,{when:h,fallback:/*#__PURE__*/(0,r/* .jsx */.tZ)("button",{type:"button",css:g.closeButton,onClick:n,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(o/* ["default"] */.Z,{name:"times",width:14,height:14})}),children:h})})]}),children:p})}),/*#__PURE__*/(0,r/* .jsx */.tZ)("div",{css:g.content,children:/*#__PURE__*/(0,r/* .jsx */.tZ)(a/* ["default"] */.Z,{children:t})})]})})};/* ESM default export */const f=h;var g={container:e=>{var{maxWidth:t}=e;return/*#__PURE__*/(0,i/* .css */.iv)("position:relative;background:",d/* .colorTokens.background.white */.Jv.background.white,";margin:",l/* .modal.MARGIN_TOP */.oC.MARGIN_TOP,"px auto ",d/* .spacing["24"] */.W0["24"],";height:100%;max-width:",t,"px;box-shadow:",d/* .shadow.modal */.AF.modal,";border-radius:",d/* .borderRadius["10"] */.E0["10"],";overflow:hidden;bottom:0;z-index:",d/* .zIndex.modal */.W5.modal,";width:100%;",d/* .Breakpoint.smallTablet */.Uo.smallTablet,"{width:90%;}")},header:e=>{var{hasHeaderChildren:t}=e;return/*#__PURE__*/(0,i/* .css */.iv)("display:grid;grid-template-columns:",t?"1fr auto 1fr":"1fr auto auto",";gap:",d/* .spacing["8"] */.W0["8"],";align-items:center;width:100%;height:",l/* .modal.HEADER_HEIGHT */.oC.HEADER_HEIGHT,"px;background:",d/* .colorTokens.background.white */.Jv.background.white,";border-bottom:1px solid ",d/* .colorTokens.stroke.divider */.Jv.stroke.divider,";position:sticky;")},headerContent:/*#__PURE__*/(0,i/* .css */.iv)("place-self:center start;display:inline-flex;align-items:center;gap:",d/* .spacing["12"] */.W0["12"],";padding-left:",d/* .spacing["24"] */.W0["24"],";",d/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-left:",d/* .spacing["16"] */.W0["16"],";}"),headerChildren:/*#__PURE__*/(0,i/* .css */.iv)("place-self:center center;"),iconWithTitle:/*#__PURE__*/(0,i/* .css */.iv)("display:inline-flex;align-items:center;gap:",d/* .spacing["4"] */.W0["4"],";flex-shrink:0;color:",d/* .colorTokens.icon["default"] */.Jv.icon["default"],";"),title:/*#__PURE__*/(0,i/* .css */.iv)(c/* .typography.heading6 */.c.heading6("medium"),";color:",d/* .colorTokens.text.title */.Jv.text.title,";text-transform:none;letter-spacing:normal;"),subtitle:/*#__PURE__*/(0,i/* .css */.iv)(p/* .styleUtils.text.ellipsis */.i.text.ellipsis(1)," ",c/* .typography.caption */.c.caption(),";color:",d/* .colorTokens.text.hints */.Jv.text.hints,";padding-left:",d/* .spacing["12"] */.W0["12"],";border-left:1px solid ",d/* .colorTokens.icon.hints */.Jv.icon.hints,";"),actionsWrapper:/*#__PURE__*/(0,i/* .css */.iv)("place-self:center end;display:inline-flex;gap:",d/* .spacing["16"] */.W0["16"],";padding-right:",d/* .spacing["24"] */.W0["24"],";",d/* .Breakpoint.smallMobile */.Uo.smallMobile,"{padding-right:",d/* .spacing["16"] */.W0["16"],";}"),closeButton:/*#__PURE__*/(0,i/* .css */.iv)(p/* .styleUtils.resetButton */.i.resetButton,";display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",d/* .borderRadius.circle */.E0.circle,";background:",d/* .colorTokens.background.white */.Jv.background.white,";&:focus,&:active,&:hover{background:",d/* .colorTokens.background.white */.Jv.background.white,";}svg{color:",d/* .colorTokens.icon["default"] */.Jv.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",d/* .colorTokens.icon.hover */.Jv.icon.hover,";}}:focus{box-shadow:",d/* .shadow.focus */.AF.focus,";}"),content:/*#__PURE__*/(0,i/* .css */.iv)("height:calc(100% - ",l/* .modal.HEADER_HEIGHT */.oC.HEADER_HEIGHT+l/* .modal.MARGIN_TOP */.oC.MARGIN_TOP,"px);background-color:",d/* .colorTokens.surface.courseBuilder */.Jv.surface.courseBuilder,";overflow-x:hidden;",p/* .styleUtils.overflowYAuto */.i.overflowYAuto)}},4867:function(e,t,n){n.d(t,{N:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=/*#__PURE__*/n.n(r);var o=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}},41819:function(e,t,n){n.d(t,{a:()=>l});/* ESM import */var r=n(7409);/* ESM import */var i=n(22456);/* ESM import */var o=n(87363);/* ESM import */var a=/*#__PURE__*/n.n(o);var s={defaultValue:false};var l=e=>{var t=(0,o.useRef)(null);var n=(0,r._)({},s,e);var[a,l]=(0,o.useState)(n.defaultValue);(0,o.useEffect)(()=>{if(!(0,i/* .isDefined */.$K)(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:a}}},43372:function(e,t,n){n.d(t,{Z:()=>u});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(38003);/* ESM import */var a=/*#__PURE__*/n.n(o);/* ESM import */var s=n(87363);/* ESM import */var l=/*#__PURE__*/n.n(s);/* ESM import */var d=n(13985);var c=e=>{var{options:t={},onChange:n,initialFiles:a}=e;var{showToast:l}=(0,d/* .useToast */.p)();var c=(0,s.useMemo)(()=>a?Array.isArray(a)?a:[a]:[],[a]);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[v,p]=(0,s.useState)(c);(0,s.useEffect)(()=>{if(c&&!v.length){p(c)}},[v,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();v.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=v.filter(e=>r.has(e.id));var a=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,o.sprintf)((0,o.__)("%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,...a]:a.slice(0,1);if(u.maxFiles&&s.length>u.maxFiles){l({// translators: %d is the maximum number of files allowed
message:(0,o.sprintf)((0,o.__)("Cannot select more than %d files","tutor"),u.maxFiles),type:"warning"});return}p(s);n===null||n===void 0?void 0:n(u.multiple?s:s[0]||null);t.close()});t.open()},[u,n,v,l]);var f=(0,s.useCallback)(()=>{p([]);n===null||n===void 0?void 0:n(u.multiple?[]:null)},[u.multiple,n]);return{openMediaLibrary:h,existingFiles:v,resetFiles:f}};/* ESM default export */const u=c},65361:function(e,t,n){n.d(t,{Z:()=>g});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(38003);/* ESM import */var s=/*#__PURE__*/n.n(a);/* ESM import */var l=n(19398);/* ESM import */var d=n(60860);/* ESM import */var c=n(76487);/* ESM import */var u=n(54354);/* ESM import */var v=n(29535);/* ESM import */var p=n(97669);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:o,message:s,onConfirmation:d,onCancel:c,isLoading:v=false,gap:h,maxWidth:f,closePopover:g,animationType:m=u/* .AnimationType.slideLeft */.ru.slideLeft,arrow:b=false,confirmButton:y,cancelButton:w,positionModifier:Z}=e;var x,k,C,E,W;return/*#__PURE__*/(0,i/* .jsx */.tZ)(p/* ["default"] */.Z,{triggerRef:n,isOpen:r,arrow:b,placement:t,closePopover:g,animationType:m,maxWidth:f,positionModifier:Z,gap:h,children:/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:_.content,children:[/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:_.body,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:_.title,children:o}),/*#__PURE__*/(0,i/* .jsx */.tZ)("p",{css:_.description,children:s})]}),/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:_.footer({isDelete:(x=y===null||y===void 0?void 0:y.isDelete)!==null&&x!==void 0?x:false}),children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{variant:(k=w===null||w===void 0?void 0:w.variant)!==null&&k!==void 0?k:"text",size:"small",onClick:c!==null&&c!==void 0?c:g,children:(C=w===null||w===void 0?void 0:w.text)!==null&&C!==void 0?C:(0,a.__)("Cancel","tutor")}),/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{"data-cy":"confirm-button",variant:(E=y===null||y===void 0?void 0:y.variant)!==null&&E!==void 0?E:"text",onClick:()=>{d();g()},loading:v,size:"small",children:(W=y===null||y===void 0?void 0:y.text)!==null&&W!==void 0?W:(0,a.__)("Ok","tutor")})]})]})})};/* ESM default export */const g=f;var _={content:/*#__PURE__*/(0,o/* .css */.iv)("background-color:",d/* .colorTokens.surface.tutor */.Jv.surface.tutor,";box-shadow:",d/* .shadow.popover */.AF.popover,";border-radius:",d/* .borderRadius["6"] */.E0["6"],";::-webkit-scrollbar{background-color:",d/* .colorTokens.surface.tutor */.Jv.surface.tutor,";width:10px;}::-webkit-scrollbar-thumb{background-color:",d/* .colorTokens.action.secondary["default"] */.Jv.action.secondary["default"],";border-radius:",d/* .borderRadius["6"] */.E0["6"],";}"),title:/*#__PURE__*/(0,o/* .css */.iv)(c/* .typography.small */.c.small("medium"),";color:",d/* .colorTokens.text.primary */.Jv.text.primary,";"),description:/*#__PURE__*/(0,o/* .css */.iv)(c/* .typography.small */.c.small(),";color:",d/* .colorTokens.text.subdued */.Jv.text.subdued,";"),body:/*#__PURE__*/(0,o/* .css */.iv)("padding:",d/* .spacing["16"] */.W0["16"]," ",d/* .spacing["20"] */.W0["20"]," ",d/* .spacing["12"] */.W0["12"],";",v/* .styleUtils.display.flex */.i.display.flex("column"),";gap:",d/* .spacing["8"] */.W0["8"],";"),footer:e=>{var{isDelete:t=false}=e;return/*#__PURE__*/(0,o/* .css */.iv)(v/* .styleUtils.display.flex */.i.display.flex(),";padding:",d/* .spacing["4"] */.W0["4"]," ",d/* .spacing["16"] */.W0["16"]," ",d/* .spacing["8"] */.W0["8"],";justify-content:end;gap:",d/* .spacing["10"] */.W0["10"],";",t&&(0,o/* .css */.iv)(h(),d/* .colorTokens.text.error */.Jv.text.error))}}},75857:function(e,t,n){n.d(t,{Z:()=>m});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(70917);/* ESM import */var a=n(60860);/* ESM import */var s=n(76487);/* ESM import */var l=n(17106);/* ESM import */var d=n(22456);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 v(){var e=(0,r._)(["\n        max-width: 282px;\n      "]);v=function t(){return e};return e}function p(){var e=(0,r._)(["\n      gap: ",";\n    "]);p=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:o,size:a="medium",description:s,actions:c,removeBorder:u=true,wrapperCss:v}=e;return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:[b.bannerWrapper(a,u,!!(0,d/* .isDefined */.$K)(t)),v],children:[/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{when:t,children:/*#__PURE__*/(0,i/* .jsx */.tZ)("img",{src:t,alt:r,srcSet:n?"".concat(n," 2x"):""})}),/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:b.messageWrapper(a),children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("h5",{css:b.title(a),children:o}),/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{when:s,children:/*#__PURE__*/(0,i/* .jsx */.tZ)("p",{css:b.description(a),children:s})}),/*#__PURE__*/(0,i/* .jsx */.tZ)(l/* ["default"] */.Z,{when:c,children:/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{"data-actions":true,css:b.actionWrapper(a),children:c})})]})]})};/* ESM default export */const m=_;var b={bannerWrapper:(e,t,n)=>/*#__PURE__*/(0,o/* .css */.iv)("display:grid;place-items:center;justify-content:center;gap:",a/* .spacing["36"] */.W0["36"],";padding:",n?"".concat(a/* .spacing["16"] */.W0["16"]," ").concat(a/* .spacing["20"] */.W0["20"]):"".concat(a/* .spacing["20"] */.W0["20"]),";",!t&&(0,o/* .css */.iv)(c(),a/* .colorTokens.stroke.divider */.Jv.stroke.divider,a/* .borderRadius.card */.E0.card,a/* .colorTokens.background.white */.Jv.background.white)," ",e==="small"&&(0,o/* .css */.iv)(u(),a/* .spacing["12"] */.W0["12"],n?a/* .spacing["12"] */.W0["12"]:a/* .spacing["16"] */.W0["16"],n?a/* .spacing["24"] */.W0["24"]:undefined),"    & img{max-width:640px;width:100%;height:auto;border-radius:",e==="small"?a/* .borderRadius["6"] */.E0["6"]:a/* .borderRadius["10"] */.E0["10"],";overflow:hidden;object-position:center;object-fit:cover;",e==="small"&&(0,o/* .css */.iv)(v()),"}"),messageWrapper:e=>/*#__PURE__*/(0,o/* .css */.iv)("display:flex;flex-direction:column;max-width:566px;width:100%;gap:",a/* .spacing["12"] */.W0["12"],";text-align:center;",e==="small"&&(0,o/* .css */.iv)(p(),a/* .spacing["8"] */.W0["8"])),title:e=>/*#__PURE__*/(0,o/* .css */.iv)(s/* .typography.heading5 */.c.heading5(),";color:",a/* .colorTokens.text.primary */.Jv.text.primary,";",e==="small"&&(0,o/* .css */.iv)(h(),s/* .typography.caption */.c.caption("medium"),a/* .colorTokens.text.primary */.Jv.text.primary)),description:e=>/*#__PURE__*/(0,o/* .css */.iv)(s/* .typography.body */.c.body(),";color:",a/* .colorTokens.text.hints */.Jv.text.hints,";",e==="small"&&(0,o/* .css */.iv)(f(),s/* .typography.tiny */.c.tiny(),a/* .colorTokens.text.hints */.Jv.text.hints)),actionWrapper:e=>/*#__PURE__*/(0,o/* .css */.iv)("margin-top:",a/* .spacing["20"] */.W0["20"],";display:flex;justify-content:center;align-items:center;gap:",a/* .spacing["12"] */.W0["12"],";",e==="small"&&(0,o/* .css */.iv)(g(),a/* .spacing["8"] */.W0["8"],a/* .spacing["8"] */.W0["8"]))}},63189:function(e,t,n){n.d(t,{Z:()=>f});/* ESM import */var r=n(58865);/* ESM import */var i=n(35944);/* ESM import */var o=n(60860);/* ESM import */var a=n(29535);/* ESM import */var s=n(70917);/* ESM import */var l=n(87363);/* ESM 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 v(){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    "]);v=function t(){return e};return e}function p(){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    "]);p=function t(){return e};return e}var h=e=>{var{activeTab:t,onChange:n,tabList:r,orientation:o="horizontal",disabled:a=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,o,a;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:((o=s.current)===null||o===void 0?void 0:o.offsetLeft)||0,top:((a=s.current)===null||a===void 0?void 0:a.offsetTop)||0};e[t.value]=l;return e},{});u(e)},[r]);return/*#__PURE__*/(0,i/* .jsxs */.BX)("div",{css:g.container,children:[/*#__PURE__*/(0,i/* .jsx */.tZ)("div",{css:[g.wrapper(o),s],role:"tablist",children:r.map((e,r)=>{return/*#__PURE__*/(0,i/* .jsxs */.BX)("button",{onClick:()=>{n(e.value)},css:g.tabButton({isActive:t===e.value,orientation:o}),disabled:a||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 */.BX)("span",{children:[" (",e.count<10&&e.count>0?"0".concat(e.count):e.count,")"]}),e.activeBadge&&/*#__PURE__*/(0,i/* .jsx */.tZ)("span",{css:g.activeBadge})]},r)})}),/*#__PURE__*/(0,i/* .jsx */.tZ)("span",{css:g.indicator((c===null||c===void 0?void 0:c[t])||{width:0,height:0,left:0,top:0},o)})]})};/* ESM default export */const f=h;var g={container:/*#__PURE__*/(0,s/* .css */.iv)("position:relative;width:100%;"),wrapper:e=>/*#__PURE__*/(0,s/* .css */.iv)("width:100%;display:flex;justify-items:left;align-items:center;flex-wrap:wrap;box-shadow:",o/* .shadow.tabs */.AF.tabs,";",e==="vertical"&&(0,s/* .css */.iv)(c())),indicator:(e,t)=>/*#__PURE__*/(0,s/* .css */.iv)("width:",e.width,"px;height:3px;position:absolute;left:",e.left,"px;bottom:0;background:",o/* .colorTokens.brand.blue */.Jv.brand.blue,";border-radius:",o/* .borderRadius["4"] */.E0["4"]," ",o/* .borderRadius["4"] */.E0["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 */.iv)(u(),e.height,e.top,o/* .borderRadius["4"] */.E0["4"],o/* .borderRadius["4"] */.E0["4"])),tabButton:e=>{var{isActive:t,orientation:n}=e;return/*#__PURE__*/(0,s/* .css */.iv)(a/* .styleUtils.resetButton */.i.resetButton,";font-size:",o/* .fontSize["15"] */.JB["15"],";line-height:",o/* .lineHeight["20"] */.Nv["20"],";display:flex;justify-content:center;align-items:center;gap:",o/* .spacing["6"] */.W0["6"],";padding:",o/* .spacing["12"] */.W0["12"]," ",o/* .spacing["20"] */.W0["20"],";color:",o/* .colorTokens.text.subdued */.Jv.text.subdued,";min-width:130px;position:relative;transition:color 0.3s ease-in-out;border-radius:0px;&:hover,&:focus,&:active{background-color:transparent;color:",o/* .colorTokens.text.subdued */.Jv.text.subdued,";box-shadow:none;}& > svg{color:",o/* .colorTokens.icon["default"] */.Jv.icon["default"],";}",n==="vertical"&&(0,s/* .css */.iv)(v(),o/* .colorTokens.stroke.border */.Jv.stroke.border,o/* .colorTokens.stroke.border */.Jv.stroke.border)," ",t&&(0,s/* .css */.iv)(p(),o/* .colorTokens.background.white */.Jv.background.white,o/* .colorTokens.text.primary */.Jv.text.primary,o/* .colorTokens.text.subdued */.Jv.text.subdued,o/* .colorTokens.icon.brand */.Jv.icon.brand),"    &:disabled{color:",o/* .colorTokens.text.disable */.Jv.text.disable,";&::before{background:",o/* .colorTokens.text.disable */.Jv.text.disable,";}}&:focus-visible{outline:2px solid ",o/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:-2px;border-radius:",o/* .borderRadius["4"] */.E0["4"],";}")},activeBadge:/*#__PURE__*/(0,s/* .css */.iv)("display:inline-block;height:8px;width:8px;border-radius:",o/* .borderRadius.circle */.E0.circle,";background-color:",o/* .colorTokens.color.success["80"] */.Jv.color.success["80"],";")}},52130:function(e,t,n){n.d(t,{Z:()=>W});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(98848);/* ESM import */var a=n(58865);/* ESM import */var s=n(35944);/* ESM import */var l=n(70917);/* ESM import */var d=n(86138);/* ESM import */var c=/*#__PURE__*/n.n(d);/* ESM import */var u=n(87363);/* ESM import */var v=/*#__PURE__*/n.n(u);/* ESM import */var p=n(26815);/* ESM import */var h=n(60860);/* ESM import */var f=n(76487);/* ESM import */var g=n(54354);/* ESM import */var _=n(98567);/* ESM import */var m=n(29535);/* ESM import */var b=n(97669);function y(){var e=(0,a._)(["\n      padding-block: ",";\n    "]);y=function t(){return e};return e}function w(){var e=(0,a._)(["\n      padding: "," ",";\n      ",";\n    "]);w=function t(){return e};return e}function Z(){var e=(0,a._)(["\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    "]);Z=function t(){return e};return e}function x(){var e=(0,a._)(["\n      background-color: ",";\n      svg {\n        color: ",";\n      }\n    "]);x=function t(){return e};return e}function k(){var e=(0,a._)(["\n      background-color: ",";\n      :hover {\n        background-color: ",";\n        svg {\n          color: ",";\n        }\n      }\n    "]);k=function t(){return e};return e}var C=e=>{var{text:t,icon:n,onClick:a,onClosePopover:l,isTrash:d=false,size:c="medium",buttonCss:u,disabled:v}=e,p=(0,o._)(e,["text","icon","onClick","onClosePopover","isTrash","size","buttonCss","disabled"]);return/*#__PURE__*/(0,s/* .jsxs */.BX)("button",(0,i._)((0,r._)({type:"button",css:[D.option({isTrash:d,size:c}),u],onClick:e=>{if(a){a(e)}if(l){l()}},disabled:v},p),{children:[n&&n,/*#__PURE__*/(0,s/* .jsx */.tZ)("span",{children:t})]}))};var E=e=>{var{onClick:t,isOpen:n,disabled:a=false,closePopover:l,placement:d=_/* .POPOVER_PLACEMENTS.BOTTOM_RIGHT */.h_.BOTTOM_RIGHT,children:c,animationType:h=g/* .AnimationType.slideLeft */.ru.slideLeft,dotsOrientation:f="horizontal",maxWidth:m="148px",isInverse:y=false,arrow:w=false,size:Z="medium",closeOnEscape:x=true,wrapperCss:k}=e,C=(0,o._)(e,["onClick","isOpen","disabled","closePopover","placement","children","animationType","dotsOrientation","maxWidth","isInverse","arrow","size","closeOnEscape","wrapperCss"]);var E=(0,u.useRef)(null);return/*#__PURE__*/(0,s/* .jsxs */.BX)(s/* .Fragment */.HY,{children:[/*#__PURE__*/(0,s/* .jsx */.tZ)("button",(0,i._)((0,r._)({type:"button",ref:E,onClick:t,css:[D.button({isOpen:n,isInverse:y,isDisabled:a}),k],disabled:a},C),{children:/*#__PURE__*/(0,s/* .jsx */.tZ)(p/* ["default"] */.Z,{name:f==="horizontal"?"threeDots":"threeDotsVertical",width:32,height:32})})),/*#__PURE__*/(0,s/* .jsx */.tZ)(b/* ["default"] */.Z,{gap:13,maxWidth:m,placement:d,triggerRef:E,isOpen:n,closePopover:l,animationType:h,arrow:w,closeOnEscape:x,children:/*#__PURE__*/(0,s/* .jsx */.tZ)("div",{css:D.wrapper({size:Z}),children:v().Children.map(c,e=>{if(/*#__PURE__*/v().isValidElement(e)){var t={size:Z};return /*#__PURE__*/v().cloneElement(e,t)}return e})})})]})};E.Option=C;/* ESM default export */const W=E;var D={wrapper:e=>{var{size:t="medium"}=e;return/*#__PURE__*/(0,l/* .css */.iv)("padding-block:",h/* .spacing["8"] */.W0["8"],";position:relative;",t==="small"&&(0,l/* .css */.iv)(y(),h/* .spacing["4"] */.W0["4"]))},option:e=>{var{isTrash:t=false,size:n="medium"}=e;return/*#__PURE__*/(0,l/* .css */.iv)(m/* .styleUtils.resetButton */.i.resetButton,";",f/* .typography.body */.c.body(),";width:100%;padding:",h/* .spacing["10"] */.W0["10"]," ",h/* .spacing["20"] */.W0["20"],";transition:background-color 0.3s ease-in-out;cursor:pointer;display:flex;align-items:center;gap:",h/* .spacing["8"] */.W0["8"],";&:focus,&:active,&:hover{background:none;color:",h/* .colorTokens.text.primary */.Jv.text.primary,";}svg{flex-shrink:0;color:",h/* .colorTokens.icon["default"] */.Jv.icon["default"],";}",n==="small"&&(0,l/* .css */.iv)(w(),h/* .spacing["8"] */.W0["8"],h/* .spacing["16"] */.W0["16"],f/* .typography.small */.c.small("medium")),":hover:not(:disabled){background-color:",h/* .colorTokens.background.hover */.Jv.background.hover,";color:",h/* .colorTokens.text.title */.Jv.text.title,";svg{color:",h/* .colorTokens.icon.hover */.Jv.icon.hover,";filter:grayscale(0%);}}:disabled{cursor:not-allowed;color:",h/* .colorTokens.text.disable */.Jv.text.disable,";svg{color:",h/* .colorTokens.icon.disable.background */.Jv.icon.disable.background,";}}",t&&(0,l/* .css */.iv)(Z(),h/* .colorTokens.text.error */.Jv.text.error,h/* .colorTokens.icon.error */.Jv.icon.error,h/* .colorTokens.text.error */.Jv.text.error,c()(h/* .colorTokens.bg.error */.Jv.bg.error,.1),h/* .colorTokens.icon.error */.Jv.icon.error,h/* .colorTokens.text.error */.Jv.text.error,h/* .colorTokens.color.danger["40"] */.Jv.color.danger["40"],h/* .colorTokens.icon.error */.Jv.icon.error),":focus-visible{outline:2px solid ",h/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:-4px;border-radius:",h/* .borderRadius.input */.E0.input,";}")},button:e=>{var{isOpen:t=false,isInverse:n=false,isDisabled:r=false}=e;return/*#__PURE__*/(0,l/* .css */.iv)(m/* .styleUtils.resetButton */.i.resetButton,";width:32px;height:32px;border-radius:",h/* .borderRadius.circle */.E0.circle,";display:flex;justify-content:center;align-items:center;transition:background-color 0.3s ease-in-out;svg{color:",h/* .colorTokens.icon["default"] */.Jv.icon["default"],";flex-shrink:0;}:hover{background-color:",h/* .colorTokens.background.hover */.Jv.background.hover,";svg{color:",h/* .colorTokens.icon["default"] */.Jv.icon["default"],";}}&:focus,&:active{background:none;}&:focus-visible{outline:2px solid ",h/* .colorTokens.stroke.brand */.Jv.stroke.brand,";outline-offset:1px;}",t&&(0,l/* .css */.iv)(x(),h/* .colorTokens.background.hover */.Jv.background.hover,h/* .colorTokens.icon.brand */.Jv.icon.brand)," ",n&&(0,l/* .css */.iv)(k(),h/* .colorTokens.background.white */.Jv.background.white,h/* .colorTokens.background.white */.Jv.background.white,!r&&h/* .colorTokens.icon.brand */.Jv.icon.brand),":disabled{cursor:not-allowed;}")}}},28089:function(e,t,n){n.d(t,{O:()=>l,h:()=>s});/* ESM import */var r=n(7409);/* ESM import */var i=n(99282);/* ESM import */var o=n(94697);/* ESM import */var a=n(45587);var s=e=>(0,a/* .defaultAnimateLayoutChanges */.cP)((0,i._)((0,r._)({},e),{wasDragging:true}));var l={droppable:{strategy:o/* .MeasuringStrategy.Always */.uN.Always}}},75361:function(e,t,n){n.d(t,{Lp:()=>a,MC:()=>r,jo:()=>i,n$:()=>d,o_:()=>l});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 o(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 o=0;o<t.length;o++){i[o]=t.charCodeAt(o)}return new Blob([r],{type:n})}function a(e,t){var n=o(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")}},53754: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")},26402:function(e,t,n){n.d(t,{N:()=>o});/* ESM import */var r=n(1493);/* ESM import */var i=n(91336);class o extends i/* .TZDateMini */.Z{//#region static
static tz(e,...t){return t.length?new o(...t,e):new o(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 */.P)(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 o(+this,e)}//#region date-fns integration
[Symbol.for("constructDateFrom")](e){return new o(+new Date(e),this.timeZone)}}},91336:function(e,t,n){n.d(t,{Z:()=>i});/* ESM import */var r=n(4973);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 */.I)(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);a(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 */.I)(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);a(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 o=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!o.test(e))return;const t=e.replace(o,"$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);a(this);return+this}}});/**
 * Function syncs time to internal date, applying the time zone offset.
 *
 * @param {Date} date - Date to sync
 */function a(e){e.internal.setTime(+e);e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(0,r/* .tzOffset */.I)(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 */.I)(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 o=-new Date(+e).getTimezoneOffset();const a=-new Date(+i).getTimezoneOffset();const s=o-a;// 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=o-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=o>0?c.getSeconds():(c.getSeconds()-60)%60;// Calculate the seconds offset based on the timezone offset.
const v=Math.round(-((0,r/* .tzOffset */.I)(e.timeZone,e)*60))%60;if(v||u){e.internal.setUTCSeconds(e.internal.getUTCSeconds()+v);Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+v+u)}//#endregion
//#region Post-adjustment DST fix
const p=(0,r/* .tzOffset */.I)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const h=p>0?Math.floor(p):Math.ceil(p);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 */.I)(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
}},58184:function(e,t,n){n.d(t,{N9:()=>/* reexport safe */i.N});/* ESM import */var r=n(53754);/* ESM import */var i=n(26402);/* ESM import */var o=n(91336);/* ESM import */var a=n(20981)},20981:function(e,t,n){/* ESM import */var r=n(26402);/**
 * 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))},1493:function(e,t,n){n.d(t,{P:()=>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(" ")}},4973:function(e,t,n){n.d(t,{I:()=>o});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 o(e,t){try{const n=r[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format;const o=n(t).split("GMT")[1];if(o in i)return i[o];return s(o,o.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(a);if(t)return s(e,t.slice(1));return NaN}}const a=/([+-]\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 o=+(t[2]||0)/60;return i[e]=n*60+r>0?n*60+r+o:n*60-r-o}},57684:function(e,t,n){n.d(t,{_:()=>E});/* ESM import */var r=n(87363);/* ESM import */var i=n(58184);/* ESM import */var o=n(6156);/* ESM import */var a=n(79237);/* ESM import */var s=n(65469);/* ESM import */var l=n(48834);/* ESM import */var d=n(52395);/* ESM import */var c=n(18296);/* ESM import */var u=n(54054);/* ESM import */var v=n(45734);/* ESM import */var p=n(54908);/* ESM import */var h=n(71264);/* ESM import */var f=n(64347);/* ESM import */var g=n(77614);/* ESM import */var _=n(62464);/* ESM import */var m=n(58100);/* ESM import */var b=n(84332);/* ESM import */var y=n(30833);/* ESM import */var w=n(5293);/* ESM import */var Z=n(35625);/* ESM import */var x=n(70162);/* ESM import */var k=n(94232);/* ESM import */var C=n(20311);/**
 * 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 E(e){let t=e;if(t.timeZone){t={...e};if(t.today){t.today=new i/* .TZDate */.N9(t.today,t.timeZone)}if(t.month){t.month=new i/* .TZDate */.N9(t.month,t.timeZone)}if(t.defaultMonth){t.defaultMonth=new i/* .TZDate */.N9(t.defaultMonth,t.timeZone)}if(t.startMonth){t.startMonth=new i/* .TZDate */.N9(t.startMonth,t.timeZone)}if(t.endMonth){t.endMonth=new i/* .TZDate */.N9(t.endMonth,t.timeZone)}if(t.mode==="single"&&t.selected){t.selected=new i/* .TZDate */.N9(t.selected,t.timeZone)}else if(t.mode==="multiple"&&t.selected){t.selected=t.selected?.map(e=>new i/* .TZDate */.N9(e,t.timeZone))}else if(t.mode==="range"&&t.selected){t.selected={from:t.selected.from?new i/* .TZDate */.N9(t.selected.from,t.timeZone):undefined,to:t.selected.to?new i/* .TZDate */.N9(t.selected.to,t.timeZone):undefined}}}const{components:n,formatters:E,labels:W,dateLib:D,locale:T,classNames:q}=(0,r.useMemo)(()=>{const e={...a/* .enUS */._,...t.locale};const n=new s/* .DateLib */.Z1({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,c/* .getComponents */.O)(t.components),formatters:(0,p/* .getFormatters */._)(t.formatters),labels:{...m,...t.labels},locale:e,classNames:{...(0,v/* .getDefaultClassNames */.U)(),...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:S,mode:M,navLayout:B,numberOfMonths:I=1,onDayBlur:z,onDayClick:P,onDayFocus:A,onDayKeyDown:O,onDayMouseEnter:N,onDayMouseLeave:J,onNextClick:L,onPrevClick:U,showWeekNumber:R,styles:X}=t;const{formatCaption:F,formatDay:j,formatMonthDropdown:Q,formatWeekNumber:H,formatWeekNumberHeader:Y,formatWeekdayName:V,formatYearDropdown:K}=E;const G=(0,y/* .useCalendar */.G)(t,D);const{days:$,months:ee,navStart:et,navEnd:en,previousMonth:er,nextMonth:ei,goToMonth:eo}=G;const ea=(0,l/* .createGetModifiers */.H)($,t,et,en,D);const{isSelected:es,select:el,selected:ed}=(0,x/* .useSelection */.c)(t,D)??{};const{blur:ec,focused:eu,isFocusTarget:ev,moveFocus:ep,setFocused:eh}=(0,Z/* .useFocus */.K)(t,G,ea,es??(()=>false),D);const{labelDayButton:ef,labelGridcell:eg,labelGrid:e_,labelMonthDropdown:em,labelNav:eb,labelPrevious:ey,labelNext:ew,labelWeekday:eZ,labelWeekNumber:ex,labelWeekNumberHeader:ek,labelYearDropdown:eC}=W;const eE=(0,r.useMemo)(()=>(0,g/* .getWeekdays */.D)(D,t.ISOWeek),[D,t.ISOWeek]);const eW=M!==undefined||P!==undefined;const eD=(0,r.useCallback)(()=>{if(!er)return;eo(er);U?.(er)},[er,eo,U]);const eT=(0,r.useCallback)(()=>{if(!ei)return;eo(ei);L?.(ei)},[eo,ei,L]);const eq=(0,r.useCallback)((e,t)=>n=>{n.preventDefault();n.stopPropagation();eh(e);el?.(e.date,t,n);P?.(e.date,t,n)},[el,P,eh]);const eS=(0,r.useCallback)((e,t)=>n=>{eh(e);A?.(e.date,t,n)},[A,eh]);const eM=(0,r.useCallback)((e,t)=>n=>{ec();z?.(e.date,t,n)},[ec,z]);const eB=(0,r.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];ep(e,t)}O?.(e.date,n,r)},[ep,O,t.dir]);const eI=(0,r.useCallback)((e,t)=>n=>{N?.(e.date,t,n)},[N]);const ez=(0,r.useCallback)((e,t)=>n=>{J?.(e.date,t,n)},[J]);const eP=(0,r.useCallback)(e=>t=>{const n=Number(t.target.value);const r=D.setMonth(D.startOfMonth(e),n);eo(r)},[D,eo]);const eA=(0,r.useCallback)(e=>t=>{const n=Number(t.target.value);const r=D.setYear(D.startOfMonth(e),n);eo(r)},[D,eo]);const{className:eO,style:eN}=(0,r.useMemo)(()=>({className:[q[o.UI.Root],t.className].filter(Boolean).join(" "),style:{...X?.[o.UI.Root],...t.style}}),[q,t.className,t.style,X]);const eJ=(0,u/* .getDataAttributes */.P)(t);const eL=(0,r.useRef)(null);(0,b/* .useAnimation */._)(eL,Boolean(t.animate),{classNames:q,months:ee,focused:eu,dateLib:D});const eU={dayPickerProps:t,selected:ed,select:el,isSelected:es,months:ee,nextMonth:ei,previousMonth:er,goToMonth:eo,getModifiers:ea,components:n,classNames:q,styles:X,labels:W,formatters:E};return r.createElement(w/* .dayPickerContext.Provider */.Z.Provider,{value:eU},r.createElement(n.Root,{rootRef:t.animate?eL:undefined,className:eO,style:eN,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...eJ},r.createElement(n.Months,{className:q[o.UI.Months],style:X?.[o.UI.Months]},!t.hideNavigation&&!B&&r.createElement(n.Nav,{"data-animated-nav":t.animate?"true":undefined,className:q[o.UI.Nav],style:X?.[o.UI.Nav],"aria-label":eb(),onPreviousClick:eD,onNextClick:eT,previousMonth:er,nextMonth:ei}),ee.map((e,i)=>{const a=(0,h/* .getMonthOptions */.d)(e.date,et,en,E,D);const s=(0,_/* .getYearOptions */.h)(et,en,E,D);return r.createElement(n.Month,{"data-animated-month":t.animate?"true":undefined,className:q[o.UI.Month],style:X?.[o.UI.Month],key:i,displayIndex:i,calendarMonth:e},B==="around"&&!t.hideNavigation&&i===0&&r.createElement(n.PreviousMonthButton,{type:"button",className:q[o.UI.PreviousMonthButton],tabIndex:er?undefined:-1,"aria-disabled":er?undefined:true,"aria-label":ey(er),onClick:eD,"data-animated-button":t.animate?"true":undefined},r.createElement(n.Chevron,{disabled:er?undefined:true,className:q[o.UI.Chevron],orientation:t.dir==="rtl"?"right":"left"})),r.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":undefined,className:q[o.UI.MonthCaption],style:X?.[o.UI.MonthCaption],calendarMonth:e,displayIndex:i},S?.startsWith("dropdown")?r.createElement(n.DropdownNav,{className:q[o.UI.Dropdowns],style:X?.[o.UI.Dropdowns]},S==="dropdown"||S==="dropdown-months"?r.createElement(n.MonthsDropdown,{className:q[o.UI.MonthsDropdown],"aria-label":em(),classNames:q,components:n,disabled:Boolean(t.disableNavigation),onChange:eP(e.date),options:a,style:X?.[o.UI.Dropdown],value:D.getMonth(e.date)}):r.createElement("span",null,Q(e.date,D)),S==="dropdown"||S==="dropdown-years"?r.createElement(n.YearsDropdown,{className:q[o.UI.YearsDropdown],"aria-label":eC(D.options),classNames:q,components:n,disabled:Boolean(t.disableNavigation),onChange:eA(e.date),options:s,style:X?.[o.UI.Dropdown],value:D.getYear(e.date)}):r.createElement("span",null,K(e.date,D)),r.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"}},F(e.date,D.options,D))):r.createElement(n.CaptionLabel,{className:q[o.UI.CaptionLabel],role:"status","aria-live":"polite"},F(e.date,D.options,D))),B==="around"&&!t.hideNavigation&&i===I-1&&r.createElement(n.NextMonthButton,{type:"button",className:q[o.UI.NextMonthButton],tabIndex:ei?undefined:-1,"aria-disabled":ei?undefined:true,"aria-label":ew(ei),onClick:eT,"data-animated-button":t.animate?"true":undefined},r.createElement(n.Chevron,{disabled:ei?undefined:true,className:q[o.UI.Chevron],orientation:t.dir==="rtl"?"left":"right"})),i===I-1&&B==="after"&&!t.hideNavigation&&r.createElement(n.Nav,{"data-animated-nav":t.animate?"true":undefined,className:q[o.UI.Nav],style:X?.[o.UI.Nav],"aria-label":eb(),onPreviousClick:eD,onNextClick:eT,previousMonth:er,nextMonth:ei}),r.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":M==="multiple"||M==="range","aria-label":e_(e.date,D.options,D)||undefined,className:q[o.UI.MonthGrid],style:X?.[o.UI.MonthGrid]},!t.hideWeekdays&&r.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":undefined,className:q[o.UI.Weekdays],style:X?.[o.UI.Weekdays]},R&&r.createElement(n.WeekNumberHeader,{"aria-label":ek(D.options),className:q[o.UI.WeekNumberHeader],style:X?.[o.UI.WeekNumberHeader],scope:"col"},Y()),eE.map((e,t)=>r.createElement(n.Weekday,{"aria-label":eZ(e,D.options,D),className:q[o.UI.Weekday],key:t,style:X?.[o.UI.Weekday],scope:"col"},V(e,D.options,D)))),r.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":undefined,className:q[o.UI.Weeks],style:X?.[o.UI.Weeks]},e.weeks.map((e,i)=>{return r.createElement(n.Week,{className:q[o.UI.Week],key:e.weekNumber,style:X?.[o.UI.Week],week:e},R&&r.createElement(n.WeekNumber,{week:e,style:X?.[o.UI.WeekNumber],"aria-label":ex(e.weekNumber,{locale:T}),className:q[o.UI.WeekNumber],scope:"row",role:"rowheader"},H(e.weekNumber,D)),e.days.map(e=>{const{date:i}=e;const a=ea(e);a[o/* .DayFlag.focused */.BE.focused]=!a.hidden&&Boolean(eu?.isEqualTo(e));a[o/* .SelectionState.selected */.fP.selected]=es?.(i)||a.selected;if((0,C/* .isDateRange */.Ws)(ed)){// add range modifiers
const{from:e,to:t}=ed;a[o/* .SelectionState.range_start */.fP.range_start]=Boolean(e&&t&&D.isSameDay(i,e));a[o/* .SelectionState.range_end */.fP.range_end]=Boolean(e&&t&&D.isSameDay(i,t));a[o/* .SelectionState.range_middle */.fP.range_middle]=(0,k/* .rangeIncludesDate */.C)(ed,i,true,D)}const s=(0,f/* .getStyleForModifiers */.D)(a,X,t.modifiersStyles);const l=(0,d/* .getClassNamesForModifiers */.k)(a,q,t.modifiersClassNames);const c=!eW&&!a.hidden?eg(i,a,D.options,D):undefined;return r.createElement(n.Day,{key:`${D.format(i,"yyyy-MM-dd")}_${D.format(e.displayMonth,"yyyy-MM")}`,day:e,modifiers:a,className:l.join(" "),style:s,role:"gridcell","aria-selected":a.selected||undefined,"aria-label":c,"data-day":D.format(i,"yyyy-MM-dd"),"data-month":e.outside?D.format(i,"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&&eW?r.createElement(n.DayButton,{className:q[o.UI.DayButton],style:X?.[o.UI.DayButton],type:"button",day:e,modifiers:a,disabled:a.disabled||undefined,tabIndex:ev(e)?0:-1,"aria-label":ef(i,a,D.options,D),onClick:eq(e,a),onBlur:eM(e,a),onFocus:eS(e,a),onKeyDown:eB(e,a),onMouseEnter:eI(e,a),onMouseLeave:ez(e,a)},j(i,D.options,D)):!a.hidden&&j(e.date,D.options,D))}))}))))})),t.footer&&r.createElement(n.Footer,{className:q[o.UI.Footer],style:X?.[o.UI.Footer],role:"status","aria-live":"polite"},t.footer)))}//# sourceMappingURL=DayPicker.js.map
},6156:function(e,t,n){n.d(t,{BE:()=>i,UI:()=>r,fP:()=>o,fw:()=>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 o;(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"})(o||(o={}));/**
 * Enum representing different animation states for transitioning between
 * months.
 */var a;(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"})(a||(a={}));//# sourceMappingURL=UI.js.map
},77827:function(e,t,n){n.d(t,{X:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.zk){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)}}//# sourceMappingURL=CalendarDay.js.map
},50644:function(e,t,n){n.d(t,{C:()=>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}}//# sourceMappingURL=CalendarMonth.js.map
},26046:function(e,t,n){n.d(t,{u:()=>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}}//# sourceMappingURL=CalendarWeek.js.map
},65469:function(e,t,n){n.d(t,{Z1:()=>O,zk:()=>N});/* ESM import */var r=n(58184);/* ESM import */var i=n(55722);/* ESM import */var o=n(636);/* ESM import */var a=n(46263);/* ESM import */var s=n(90423);/* ESM import */var l=n(23279);/* ESM import */var d=n(36430);/* ESM import */var c=n(83475);/* ESM import */var u=n(13470);/* ESM import */var v=n(28353);/* ESM import */var p=n(41041);/* ESM import */var h=n(45827);/* ESM import */var f=n(17989);/* ESM import */var g=n(65719);/* ESM import */var _=n(11854);/* ESM import */var m=n(22431);/* ESM import */var b=n(12347);/* ESM import */var y=n(18474);/* ESM import */var w=n(32880);/* ESM import */var Z=n(46695);/* ESM import */var x=n(17522);/* ESM import */var k=n(40756);/* ESM import */var C=n(26098);/* ESM import */var E=n(5618);/* ESM import */var W=n(20831);/* ESM import */var D=n(19706);/* ESM import */var T=n(16614);/* ESM import */var q=n(51066);/* ESM import */var S=n(44459);/* ESM import */var M=n(12432);/* ESM import */var B=n(19397);/* ESM import */var I=n(35523);/* ESM import */var z=n(79237);/* ESM import */var P=n(11548);/* ESM import */var A=n(29726);/**
 * 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 O{/**
     * 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 */.N9.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 */.N9(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 */.E)(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,o/* .addMonths */.z)(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,a/* .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 */.B)(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 */.w)(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 */.T)(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 */.R)(e)};/**
         * 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,P/* .endOfBroadcastWeek */.r)(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,u/* .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 */.V)(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,p/* .endOfWeek */.v)(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,h/* .endOfYear */.w)(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,f/* .format */.WU)(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,g/* .getISOWeek */.l)(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,_/* .getMonth */.j)(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,m/* .getYear */.S)(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,b/* .getWeek */.Q)(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,y/* .isAfter */.A)(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,w/* .isBefore */.R)(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,Z/* .isDate */.J)(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,x/* .isSameDay */.K)(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 */.x)(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,C/* .isSameYear */.F)(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,E/* .max */.F)(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,W/* .min */.V)(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,D/* .setMonth */.q)(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,T/* .setYear */.M)(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,A/* .startOfBroadcastWeek */.i)(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,q/* .startOfDay */.b)(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 */.T)(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 */.N)(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,B/* .startOfWeek */.z)(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,I/* .startOfYear */.e)(e)};this.options={locale:z/* .enUS */._,...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())}}/** The default locale (English). *//**
 * The default date library with English locale.
 *
 * @since 9.2.0
 */const N=new O;/**
 * @ignore
 * @deprecated Use `defaultDateLib`.
 */const J=/* unused pure expression or super */null&&N;//# sourceMappingURL=DateLib.js.map
},77204:function(e,t,n){n.d(t,{z:()=>i});/* ESM import */var r=n(87363);/**
 * Render the button elements in the calendar.
 *
 * @private
 * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
 */function i(e){return r.createElement("button",{...e})}//# sourceMappingURL=Button.js.map
},91293:function(e,t,n){n.d(t,{i:()=>i});/* ESM import */var r=n(87363);/**
 * Render the label in the month caption.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("span",{...e})}//# sourceMappingURL=CaptionLabel.js.map
},1745:function(e,t,n){n.d(t,{T:()=>i});/* ESM import */var r=n(87363);/**
 * 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 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"}))}//# sourceMappingURL=Chevron.js.map
},60442:function(e,t,n){n.d(t,{J:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=Day.js.map
},17431:function(e,t,n){n.d(t,{b:()=>i});/* ESM import */var r=n(87363);/**
 * 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 o=r.useRef(null);r.useEffect(()=>{if(n.focused)o.current?.focus()},[n.focused]);return r.createElement("button",{ref:o,...i})}//# sourceMappingURL=DayButton.js.map
},26031:function(e,t,n){n.d(t,{L:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=n(6156);/**
 * Render a dropdown component for navigation in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{options:t,className:n,components:o,classNames:a,...s}=e;const l=[a[i.UI.Dropdown],n].join(" ");const d=t?.find(({value:e})=>e===s.value);return r.createElement("span",{"data-disabled":s.disabled,className:a[i.UI.DropdownRoot]},r.createElement(o.Select,{className:l,...s},t?.map(({value:e,label:t,disabled:n})=>r.createElement(o.Option,{key:e,value:e,disabled:n},t))),r.createElement("span",{className:a[i.UI.CaptionLabel],"aria-hidden":true},d?.label,r.createElement(o.Chevron,{orientation:"down",size:18,className:a[i.UI.Chevron]})))}//# sourceMappingURL=Dropdown.js.map
},58581:function(e,t,n){n.d(t,{Z:()=>i});/* ESM import */var r=n(87363);/**
 * Render the navigation dropdowns for the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}//# sourceMappingURL=DropdownNav.js.map
},50947:function(e,t,n){n.d(t,{$:()=>i});/* ESM import */var r=n(87363);/**
 * Render the footer of the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}//# sourceMappingURL=Footer.js.map
},18149:function(e,t,n){n.d(t,{m:()=>i});/* ESM import */var r=n(87363);/**
 * 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)}//# sourceMappingURL=Month.js.map
},78136:function(e,t,n){n.d(t,{h:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=MonthCaption.js.map
},51601:function(e,t,n){n.d(t,{A:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=MonthGrid.js.map
},28299:function(e,t,n){n.d(t,{z:()=>i});/* ESM import */var r=n(87363);/**
 * Render a container wrapping the month grids.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}//# sourceMappingURL=Months.js.map
},43498:function(e,t,n){n.d(t,{c:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=n(5293);/**
 * Render a dropdown to navigate between months in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{components:t}=(0,i/* .useDayPicker */.k)();return r.createElement(t.Dropdown,{...e})}//# sourceMappingURL=MonthsDropdown.js.map
},30841:function(e,t,n){n.d(t,{J:()=>a});/* ESM import */var r=n(87363);/* ESM import */var i=n(6156);/* ESM import */var o=n(5293);/**
 * Render the navigation toolbar with buttons to navigate between months.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{onPreviousClick:t,onNextClick:n,previousMonth:a,nextMonth:s,...l}=e;const{components:d,classNames:c,labels:{labelPrevious:u,labelNext:v}}=(0,o/* .useDayPicker */.k)();const p=(0,r.useCallback)(e=>{if(s){n?.(e)}},[s,n]);const h=(0,r.useCallback)(e=>{if(a){t?.(e)}},[a,t]);return r.createElement("nav",{...l},r.createElement(d.PreviousMonthButton,{type:"button",className:c[i.UI.PreviousMonthButton],tabIndex:a?undefined:-1,"aria-disabled":a?undefined:true,"aria-label":u(a),onClick:h},r.createElement(d.Chevron,{disabled:a?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":v(s),onClick:p},r.createElement(d.Chevron,{disabled:s?undefined:true,orientation:"right",className:c[i.UI.Chevron]})))}//# sourceMappingURL=Nav.js.map
},60296:function(e,t,n){n.d(t,{b:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=n(5293);/**
 * Render the button to navigate to the next month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{components:t}=(0,i/* .useDayPicker */.k)();return r.createElement(t.Button,{...e})}//# sourceMappingURL=NextMonthButton.js.map
},93073:function(e,t,n){n.d(t,{W:()=>i});/* ESM import */var r=n(87363);/**
 * Render an `option` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("option",{...e})}//# sourceMappingURL=Option.js.map
},92348:function(e,t,n){n.d(t,{U:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=n(5293);/**
 * Render the button to navigate to the previous month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{components:t}=(0,i/* .useDayPicker */.k)();return r.createElement(t.Button,{...e})}//# sourceMappingURL=PreviousMonthButton.js.map
},24618:function(e,t,n){n.d(t,{f:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=Root.js.map
},59145:function(e,t,n){n.d(t,{P:()=>i});/* ESM import */var r=n(87363);/**
 * Render a `select` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("select",{...e})}//# sourceMappingURL=Select.js.map
},60287:function(e,t,n){n.d(t,{H:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=Week.js.map
},63914:function(e,t,n){n.d(t,{M:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=WeekNumber.js.map
},78351:function(e,t,n){n.d(t,{o:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=WeekNumberHeader.js.map
},12620:function(e,t,n){n.d(t,{O:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=Weekday.js.map
},56053:function(e,t,n){n.d(t,{o:()=>i});/* ESM import */var r=n(87363);/**
 * 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}))}//# sourceMappingURL=Weekdays.js.map
},51615:function(e,t,n){n.d(t,{B:()=>i});/* ESM import */var r=n(87363);/**
 * 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})}//# sourceMappingURL=Weeks.js.map
},38678:function(e,t,n){n.d(t,{T:()=>o});/* ESM import */var r=n(87363);/* ESM import */var i=n(5293);/**
 * Render a dropdown to navigate between years in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{components:t}=(0,i/* .useDayPicker */.k)();return r.createElement(t.Dropdown,{...e})}//# sourceMappingURL=YearsDropdown.js.map
},73840:function(e,t,n){n.r(t);n.d(t,{Button:()=>/* reexport safe */r.z,CaptionLabel:()=>/* reexport safe */i.i,Chevron:()=>/* reexport safe */o.T,Day:()=>/* reexport safe */a.J,DayButton:()=>/* reexport safe */s.b,Dropdown:()=>/* reexport safe */l.L,DropdownNav:()=>/* reexport safe */d.Z,Footer:()=>/* reexport safe */c.$,Month:()=>/* reexport safe */u.m,MonthCaption:()=>/* reexport safe */v.h,MonthGrid:()=>/* reexport safe */p.A,Months:()=>/* reexport safe */h.z,MonthsDropdown:()=>/* reexport safe */f.c,Nav:()=>/* reexport safe */g.J,NextMonthButton:()=>/* reexport safe */_.b,Option:()=>/* reexport safe */m.W,PreviousMonthButton:()=>/* reexport safe */b.U,Root:()=>/* reexport safe */y.f,Select:()=>/* reexport safe */w.P,Week:()=>/* reexport safe */Z.H,WeekNumber:()=>/* reexport safe */C.M,WeekNumberHeader:()=>/* reexport safe */E.o,Weekday:()=>/* reexport safe */x.O,Weekdays:()=>/* reexport safe */k.o,Weeks:()=>/* reexport safe */W.B,YearsDropdown:()=>/* reexport safe */D.T});/* ESM import */var r=n(77204);/* ESM import */var i=n(91293);/* ESM import */var o=n(1745);/* ESM import */var a=n(60442);/* ESM import */var s=n(17431);/* ESM import */var l=n(26031);/* ESM import */var d=n(58581);/* ESM import */var c=n(50947);/* ESM import */var u=n(18149);/* ESM import */var v=n(78136);/* ESM import */var p=n(51601);/* ESM import */var h=n(28299);/* ESM import */var f=n(43498);/* ESM import */var g=n(30841);/* ESM import */var _=n(60296);/* ESM import */var m=n(93073);/* ESM import */var b=n(92348);/* ESM import */var y=n(24618);/* ESM import */var w=n(59145);/* ESM import */var Z=n(60287);/* ESM import */var x=n(12620);/* ESM import */var k=n(56053);/* ESM import */var C=n(63914);/* ESM import */var E=n(78351);/* ESM import */var W=n(51615);/* ESM import */var D=n(38678);//# sourceMappingURL=custom-components.js.map
},2957:function(e,t,n){n.d(t,{I:()=>o,O:()=>i});/* ESM import */var r=n(65469);/**
 * Formats the caption of the month.
 *
 * @defaultValue `LLLL y` (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){return(n??new r/* .DateLib */.Z1(t)).format(e,"LLLL y")}/**
 * @private
 * @deprecated Use {@link formatCaption} instead.
 * @group Formatters
 */const o=i;//# sourceMappingURL=formatCaption.js.map
},29187:function(e,t,n){n.d(t,{f:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.Z1(t)).format(e,"d")}//# sourceMappingURL=formatDay.js.map
},6906:function(e,t,n){n.d(t,{E:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.zk){return t.format(e,"LLLL")}//# sourceMappingURL=formatMonthDropdown.js.map
},67221:function(e,t,n){n.d(t,{z:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.zk){if(e<10){return t.formatNumber(`0${e.toLocaleString()}`)}return t.formatNumber(`${e.toLocaleString()}`)}//# sourceMappingURL=formatWeekNumber.js.map
},7655:function(e,t,n){n.d(t,{I:()=>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``}//# sourceMappingURL=formatWeekNumberHeader.js.map
},69583:function(e,t,n){n.d(t,{T:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.Z1(t)).format(e,"cccccc")}//# sourceMappingURL=formatWeekdayName.js.map
},41614:function(e,t,n){n.d(t,{N:()=>o,P:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.zk){return t.format(e,"yyyy")}/**
 * @private
 * @deprecated Use `formatYearDropdown` instead.
 * @group Formatters
 */const o=i;//# sourceMappingURL=formatYearDropdown.js.map
},27790:function(e,t,n){n.r(t);n.d(t,{formatCaption:()=>/* reexport safe */r.O,formatDay:()=>/* reexport safe */i.f,formatMonthCaption:()=>/* reexport safe */r.I,formatMonthDropdown:()=>/* reexport safe */o.E,formatWeekNumber:()=>/* reexport safe */a.z,formatWeekNumberHeader:()=>/* reexport safe */s.I,formatWeekdayName:()=>/* reexport safe */l.T,formatYearCaption:()=>/* reexport safe */d.N,formatYearDropdown:()=>/* reexport safe */d.P});/* ESM import */var r=n(2957);/* ESM import */var i=n(29187);/* ESM import */var o=n(6906);/* ESM import */var a=n(67221);/* ESM import */var s=n(7655);/* ESM import */var l=n(69583);/* ESM import */var d=n(41614);//# sourceMappingURL=index.js.map
},79173:function(e,t,n){n.d(t,{k:()=>a});/* ESM import */var r=n(6156);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 o(e){return!e[r/* .DayFlag.disabled */.BE.disabled]&&!e[r/* .DayFlag.hidden */.BE.hidden]&&!e[r/* .DayFlag.outside */.BE.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 a(e,t,n,a){let s;let l=-1;for(const d of e){const e=t(d);if(o(e)){if(e[r/* .DayFlag.focused */.BE.focused]&&l<i.FocusedModifier){s=d;l=i.FocusedModifier}else if(a?.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 */.BE.today]&&l<i.Today){s=d;l=i.Today}}}if(!s){// Return the first day that is focusable
s=e.find(e=>o(t(e)))}return s}//# sourceMappingURL=calculateFocusTarget.js.map
},48834:function(e,t,n){n.d(t,{H:()=>o});/* ESM import */var r=n(6156);/* ESM import */var i=n(52804);/**
 * 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 o(e,t,n,o,a){const{disabled:s,hidden:l,modifiers:d,showOutsideDays:c,broadcastCalendar:u,today:v}=t;const{isSameDay:p,isSameMonth:h,startOfMonth:f,isBefore:g,endOfMonth:_,isAfter:m}=a;const b=n&&f(n);const y=o&&_(o);const w={[r/* .DayFlag.focused */.BE.focused]:[],[r/* .DayFlag.outside */.BE.outside]:[],[r/* .DayFlag.disabled */.BE.disabled]:[],[r/* .DayFlag.hidden */.BE.hidden]:[],[r/* .DayFlag.today */.BE.today]:[]};const Z={};for(const t of e){const{date:e,displayMonth:n}=t;const r=Boolean(n&&!h(e,n));const o=Boolean(b&&g(e,b));const f=Boolean(y&&m(e,y));const _=Boolean(s&&(0,i/* .dateMatchModifiers */.W)(e,s,a));const x=Boolean(l&&(0,i/* .dateMatchModifiers */.W)(e,l,a))||o||f||// Broadcast calendar will show outside days as default
!u&&!c&&r||u&&c===false&&r;const k=p(e,v??a.today());if(r)w.outside.push(t);if(_)w.disabled.push(t);if(x)w.hidden.push(t);if(k)w.today.push(t);// Add custom modifiers
if(d){Object.keys(d).forEach(n=>{const r=d?.[n];const o=r?(0,i/* .dateMatchModifiers */.W)(e,r,a):false;if(!o)return;if(Z[n]){Z[n].push(t)}else{Z[n]=[t]}})}}return e=>{// Initialize all the modifiers to false
const t={[r/* .DayFlag.focused */.BE.focused]:false,[r/* .DayFlag.disabled */.BE.disabled]:false,[r/* .DayFlag.hidden */.BE.hidden]:false,[r/* .DayFlag.outside */.BE.outside]:false,[r/* .DayFlag.today */.BE.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 Z){n[t]=Z[t].some(t=>t===e)}return{...t,// custom modifiers should override all the previous ones
...n}}}//# sourceMappingURL=createGetModifiers.js.map
},11548:function(e,t,n){n.d(t,{r:()=>o});/* ESM import */var r=n(59582);/* ESM import */var i=n(29726);/**
 * 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 o(e,t){const n=(0,i/* .startOfBroadcastWeek */.i)(e,t);const o=(0,r/* .getBroadcastWeeksInMonth */.I)(e,t);const a=t.addDays(n,o*7-1);return a}//# sourceMappingURL=endOfBroadcastWeek.js.map
},59582:function(e,t,n){n.d(t,{I:()=>o});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 o(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 o=n.getDay()>0?n.getDay():7;const a=t.addDays(e,-o+1);const s=t.addDays(a,r*7-1);const l=t.getMonth(e)===t.getMonth(s)?r:i;return l}//# sourceMappingURL=getBroadcastWeeksInMonth.js.map
},52395:function(e,t,n){n.d(t,{k:()=>i});/* ESM import */var r=n(6156);/**
 * 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 o=Object.entries(e).filter(([,e])=>e===true).reduce((e,[i])=>{if(n[i]){e.push(n[i])}else if(t[r/* .DayFlag */.BE[i]]){e.push(t[r/* .DayFlag */.BE[i]])}else if(t[r/* .SelectionState */.fP[i]]){e.push(t[r/* .SelectionState */.fP[i]])}return e},[t[r.UI.Day]]);return o}//# sourceMappingURL=getClassNamesForModifiers.js.map
},18296:function(e,t,n){n.d(t,{O:()=>i});/* ESM import */var r=n(73840);/**
 * 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}}//# sourceMappingURL=getComponents.js.map
},54054:function(e,t,n){n.d(t,{P:()=>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}//# sourceMappingURL=getDataAttributes.js.map
},11732:function(e,t,n){n.d(t,{i:()=>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 o=e[e.length-1];const{ISOWeek:a,fixedWeeks:s,broadcastCalendar:l}=n??{};const{addDays:d,differenceInCalendarDays:c,differenceInCalendarMonths:u,endOfBroadcastWeek:v,endOfISOWeek:p,endOfMonth:h,endOfWeek:f,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:m,startOfWeek:b}=r;const y=l?_(i,r):a?m(i):b(i);const w=l?v(o):a?p(h(o)):f(h(o));const Z=c(w,y);const x=u(o,i)+1;const k=[];for(let e=0;e<=Z;e++){const n=d(y,e);if(t&&g(n,t)){break}k.push(n)}// If fixed weeks is enabled, add the extra dates to the array
const C=l?35:42;const E=C*x;if(s&&k.length<E){const e=E-k.length;for(let t=0;t<e;t++){const e=d(k[k.length-1],1);k.push(e)}}return k}//# sourceMappingURL=getDates.js.map
},84517:function(e,t,n){n.d(t,{g:()=>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,...t.days]},t);return[...e,...r]},t)}//# sourceMappingURL=getDays.js.map
},45734:function(e,t,n){n.d(t,{U:()=>i});/* ESM import */var r=n(6156);/**
 * 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 */.BE){e[r/* .DayFlag */.BE[t]]=`rdp-${r/* .DayFlag */.BE[t]}`}for(const t in r/* .SelectionState */.fP){e[r/* .SelectionState */.fP[t]]=`rdp-${r/* .SelectionState */.fP[t]}`}for(const t in r/* .Animation */.fw){e[r/* .Animation */.fw[t]]=`rdp-${r/* .Animation */.fw[t]}`}return e}//# sourceMappingURL=getDefaultClassNames.js.map
},6341:function(e,t,n){n.d(t,{b:()=>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 o=[];for(let n=0;n<i;n++){const i=r.addMonths(e,n);if(t&&i>t){break}o.push(i)}return o}//# sourceMappingURL=getDisplayMonths.js.map
},9025:function(e,t,n){n.d(t,{N:()=>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,o,a){const{ISOWeek:s,broadcastCalendar:l}=o;const{addDays:d,addMonths:c,addWeeks:u,addYears:v,endOfBroadcastWeek:p,endOfISOWeek:h,endOfWeek:f,max:g,min:_,startOfBroadcastWeek:m,startOfISOWeek:b,startOfWeek:y}=a;const w={day:d,week:u,month:c,year:v,startOfWeek:e=>l?m(e,a):s?b(e):y(e),endOfWeek:e=>l?p(e):s?h(e):f(e)};let Z=w[e](n,t==="after"?1:-1);if(t==="before"&&r){Z=g([r,Z])}else if(t==="after"&&i){Z=_([i,Z])}return Z}//# sourceMappingURL=getFocusableDate.js.map
},54908:function(e,t,n){n.d(t,{_:()=>i});/* ESM import */var r=n(27790);/**
 * 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}}//# sourceMappingURL=getFormatters.js.map
},82283: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:o,today:a=r.today(),numberOfMonths:s=1}=e;let l=i||o||a;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)}//# sourceMappingURL=getInitialMonth.js.map
},71264:function(e,t,n){n.d(t,{d:()=>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:o,startOfYear:a,endOfYear:s,eachMonthOfInterval:l,getMonth:d}=i;const c=l({start:a(e),end:s(e)});const u=c.map(e=>{const a=r.formatMonthDropdown(e,i);const s=d(e);const l=t&&e<o(t)||n&&e>o(n)||false;return{value:s,label:a,disabled:l}});return u}//# sourceMappingURL=getMonthOptions.js.map
},97018:function(e,t,n){n.d(t,{w:()=>a});/* ESM import */var r=n(77827);/* ESM import */var i=n(26046);/* ESM import */var o=n(50644);/**
 * 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 a(e,t,n,a){const{addDays:s,endOfBroadcastWeek:l,endOfISOWeek:d,endOfMonth:c,endOfWeek:u,getISOWeek:v,getWeek:p,startOfBroadcastWeek:h,startOfISOWeek:f,startOfWeek:g}=a;const _=e.reduce((e,_)=>{const m=n.broadcastCalendar?h(_,a):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 Z=y.reduce((e,t)=>{const o=n.ISOWeek?v(t):p(t);const s=e.find(e=>e.weekNumber===o);const l=new r/* .CalendarDay */.X(t,_,a);if(!s){e.push(new i/* .CalendarWeek */.u(o,[l]))}else{s.days.push(l)}return e},[]);const x=new o/* .CalendarMonth */.C(_,Z);e.push(x);return e},[]);if(!n.reverseMonths){return _}else{return _.reverse()}}//# sourceMappingURL=getMonths.js.map
},38540:function(e,t,n){n.d(t,{P:()=>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:o,startOfMonth:a,endOfMonth:s,addYears:l,endOfYear:d,newDate:c,today:u}=t;// Handle deprecated code
const{fromYear:v,toYear:p,fromMonth:h,toMonth:f}=e;if(!n&&h){n=h}if(!n&&v){n=t.newDate(v,0,1)}if(!r&&f){r=f}if(!r&&p){r=c(p,11,31)}const g=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";if(n){n=a(n)}else if(v){n=c(v,0,1)}else if(!n&&g){n=i(l(e.today??u(),-100))}if(r){r=s(r)}else if(p){r=c(p,11,31)}else if(!r&&g){r=d(e.today??u())}return[n?o(n):n,r?o(r):r]}//# sourceMappingURL=getNavMonth.js.map
},84110:function(e,t,n){n.d(t,{j:()=>a});/* ESM import */var r=n(77827);/* ESM import */var i=n(52804);/* ESM import */var o=n(9025);/**
 * 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 a(e,t,n,s,l,d,c,u=0){if(u>365){// Limit the recursion to 365 attempts
return undefined}const v=(0,o/* .getFocusableDate */.N)(e,t,n.date,s,l,d,c);const p=Boolean(d.disabled&&(0,i/* .dateMatchModifiers */.W)(v,d.disabled,c));const h=Boolean(d.hidden&&(0,i/* .dateMatchModifiers */.W)(v,d.hidden,c));const f=v;const g=new r/* .CalendarDay */.X(v,f,c);if(!p&&!h){return g}// Recursively attempt to find the next focusable date
return a(e,t,g,s,l,d,c,u+1)}//# sourceMappingURL=getNextFocus.js.map
},22663:function(e,t,n){n.d(t,{f:()=>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:o=1}=n;const{startOfMonth:a,addMonths:s,differenceInCalendarMonths:l}=r;const d=i?o:1;const c=a(e);if(!t){return s(c,d)}const u=l(t,e);if(u<o){return undefined}return s(c,d)}//# sourceMappingURL=getNextMonth.js.map
},88490:function(e,t,n){n.d(t,{S:()=>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:o}=n;const{startOfMonth:a,addMonths:s,differenceInCalendarMonths:l}=r;const d=i?o??1:1;const c=a(e);if(!t){return s(c,-d)}const u=l(c,t);if(u<=0){return undefined}return s(c,-d)}//# sourceMappingURL=getPreviousMonth.js.map
},64347:function(e,t,n){n.d(t,{D:()=>i});/* ESM import */var r=n(6156);/**
 * 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 o={...t?.[r.UI.Day]};Object.entries(e).filter(([,e])=>e===true).forEach(([e])=>{o={...o,...n?.[e]}});return o}//# sourceMappingURL=getStyleForModifiers.js.map
},77614:function(e,t,n){n.d(t,{D:()=>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 o=[];for(let t=0;t<7;t++){const n=e.addDays(i,t);o.push(n)}return o}//# sourceMappingURL=getWeekdays.js.map
},60049:function(e,t,n){n.d(t,{K:()=>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,...t.weeks]},t)}//# sourceMappingURL=getWeeks.js.map
},62464:function(e,t,n){n.d(t,{h:()=>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.
 * @returns An array of dropdown options representing the years, or `undefined`
 *   if `navStart` or `navEnd` is not provided.
 */function r(e,t,n,r){if(!e)return undefined;if(!t)return undefined;const{startOfYear:i,endOfYear:o,addYears:a,getYear:s,isBefore:l,isSameYear:d}=r;const c=i(e);const u=o(t);const v=[];let p=c;while(l(p,u)||d(p,u)){v.push(p);p=a(p,1)}return v.map(e=>{const t=n.formatYearDropdown(e,r);return{value:s(e),label:t,disabled:false}})}//# sourceMappingURL=getYearOptions.js.map
},29726:function(e,t,n){n.d(t,{i:()=>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))}}//# sourceMappingURL=startOfBroadcastWeek.js.map
},50717:function(e,t,n){n.d(t,{O:()=>i});/* ESM import */var r=n(87363);/**
 * 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 o=t===undefined?n:t;return[o,i]}//# sourceMappingURL=useControlledValue.js.map
},58100:function(e,t,n){n.r(t);n.d(t,{labelCaption:()=>/* reexport safe */r.D,labelDay:()=>/* reexport safe */o.Q,labelDayButton:()=>/* reexport safe */o.l,labelGrid:()=>/* reexport safe */r.v,labelGridcell:()=>/* reexport safe */i.R,labelMonthDropdown:()=>/* reexport safe */s.N,labelNav:()=>/* reexport safe */a.g,labelNext:()=>/* reexport safe */l.T,labelPrevious:()=>/* reexport safe */d.b,labelWeekNumber:()=>/* reexport safe */u.j,labelWeekNumberHeader:()=>/* reexport safe */v.E,labelWeekday:()=>/* reexport safe */c.O,labelYearDropdown:()=>/* reexport safe */p.I});/* ESM import */var r=n(80782);/* ESM import */var i=n(54428);/* ESM import */var o=n(95490);/* ESM import */var a=n(88234);/* ESM import */var s=n(60327);/* ESM import */var l=n(96368);/* ESM import */var d=n(55341);/* ESM import */var c=n(79231);/* ESM import */var u=n(58095);/* ESM import */var v=n(82779);/* ESM import */var p=n(58634);//# sourceMappingURL=index.js.map
},95490:function(e,t,n){n.d(t,{Q:()=>o,l:()=>i});/* ESM import */var r=n(65469);/**
 * 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 o=(i??new r/* .DateLib */.Z1(n)).format(e,"PPPP");if(t.today)o=`Today, ${o}`;if(t.selected)o=`${o}, selected`;return o}/**
 * @ignore
 * @deprecated Use `labelDayButton` instead.
 */const o=i;//# sourceMappingURL=labelDayButton.js.map
},80782:function(e,t,n){n.d(t,{D:()=>o,v:()=>i});/* ESM import */var r=n(65469);/**
 * Generates the ARIA label for the month grid, which is announced when entering
 * the grid.
 *
 * @defaultValue `LLLL y` (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){return(n??new r/* .DateLib */.Z1(t)).format(e,"LLLL y")}/**
 * @ignore
 * @deprecated Use {@link labelGrid} instead.
 */const o=i;//# sourceMappingURL=labelGrid.js.map
},54428:function(e,t,n){n.d(t,{R:()=>i});/* ESM import */var r=n(65469);/**
 * 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 o=(i??new r/* .DateLib */.Z1(n)).format(e,"PPPP");if(t?.today){o=`Today, ${o}`}return o}//# sourceMappingURL=labelGridcell.js.map
},60327:function(e,t,n){n.d(t,{N:()=>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"}//# sourceMappingURL=labelMonthDropdown.js.map
},88234:function(e,t,n){n.d(t,{g:()=>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""}//# sourceMappingURL=labelNav.js.map
},96368:function(e,t,n){n.d(t,{T:()=>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"}//# sourceMappingURL=labelNext.js.map
},55341:function(e,t,n){n.d(t,{b:()=>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"}//# sourceMappingURL=labelPrevious.js.map
},58095:function(e,t,n){n.d(t,{j:()=>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}`}//# sourceMappingURL=labelWeekNumber.js.map
},82779:function(e,t,n){n.d(t,{E:()=>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"}//# sourceMappingURL=labelWeekNumberHeader.js.map
},79231:function(e,t,n){n.d(t,{O:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.Z1(t)).format(e,"cccc")}//# sourceMappingURL=labelWeekday.js.map
},58634:function(e,t,n){n.d(t,{I:()=>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"}//# sourceMappingURL=labelYearDropdown.js.map
},13796:function(e,t,n){n.d(t,{R:()=>i});/* ESM import */var r=n(50717);/**
 * 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:o}=e;const[a,s]=(0,r/* .useControlledValue */.O)(n,o?n:undefined);const l=!o?a:n;const{isSameDay:d}=t;const c=e=>{return l?.some(t=>d(t,e))??false};const{min:u,max:v}=e;const p=(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===v){// Max value reached, reset the selection to date
r=[e]}else{// Add the date to the selection
r=[...r,e]}}if(!o){s(r)}o?.(r,e,t,n);return r};return{selected:l,select:p,isSelected:c}}//# sourceMappingURL=useMulti.js.map
},9998:function(e,t,n){n.d(t,{C:()=>s});/* ESM import */var r=n(50717);/* ESM import */var i=n(16257);/* ESM import */var o=n(99217);/* ESM import */var a=n(94232);/**
 * 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,v]=(0,r/* .useControlledValue */.O)(l,c?l:undefined);const p=!c?u:l;const h=e=>p&&(0,a/* .rangeIncludesDate */.C)(p,e,false,t);const f=(r,a,l)=>{const{min:u,max:h}=e;const f=r?(0,i/* .addToRange */.n)(r,p,u,h,d,t):undefined;if(s&&n&&f?.from&&f.to){if((0,o/* .rangeContainsModifiers */.C)({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){v(f)}c?.(f,r,a,l);return f};return{selected:p,select:f,isSelected:h}}//# sourceMappingURL=useRange.js.map
},67413:function(e,t,n){n.d(t,{G:()=>i});/* ESM import */var r=n(50717);/**
 * 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:o}=e;const[a,s]=(0,r/* .useControlledValue */.O)(n,o?n:undefined);const l=!o?a: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(!o){s(r)}if(i){o?.(r,e,t,n)}else{o?.(r,e,t,n)}return r};return{selected:l,select:u,isSelected:c}}//# sourceMappingURL=useSingle.js.map
},84332:function(e,t,n){n.d(t,{_:()=>v});/* ESM import */var r=n(87363);/* ESM import */var i=n(6156);const o=e=>{if(e instanceof HTMLElement)return e;return null};const a=e=>[...e.querySelectorAll("[data-animated-month]")??[]];const s=e=>o(e.querySelector("[data-animated-month]"));const l=e=>o(e.querySelector("[data-animated-caption]"));const d=e=>o(e.querySelector("[data-animated-weeks]"));const c=e=>o(e.querySelector("[data-animated-nav]"));const u=e=>o(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 v(e,t,{classNames:n,months:o,focused:v,dateLib:p}){const h=(0,r.useRef)(null);const f=(0,r.useRef)(o);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=o;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
o.length===0||r.length===0||o.length!==r.length){return}const _=p.isSameMonth(o[0].date,r[0].date);const m=p.isAfter(o[0].date,r[0].date);const b=m?n[i/* .Animation.caption_after_enter */.fw.caption_after_enter]:n[i/* .Animation.caption_before_enter */.fw.caption_before_enter];const y=m?n[i/* .Animation.weeks_after_enter */.fw.weeks_after_enter]:n[i/* .Animation.weeks_before_enter */.fw.weeks_before_enter];// get previous root element snapshot before updating the snapshot ref
const w=h.current;// update snapshot for next effect trigger
const Z=e.current.cloneNode(true);if(Z 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=a(Z);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=Z}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
v){return}const x=w instanceof HTMLElement?a(w):[];const k=a(e.current);if(k&&k.every(e=>e instanceof HTMLElement)&&x&&x.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"}k.forEach((o,a)=>{const s=x[a];if(!s){return}// animate new displayed month
o.style.position="relative";o.style.overflow="hidden";const c=l(o);if(c){c.classList.add(b)}const v=d(o);if(v){v.classList.add(y)}// animate new displayed month end
const p=()=>{g.current=false;if(e.current){e.current.style.isolation=""}if(r){r.style.zIndex=""}if(c){c.classList.remove(b)}if(v){v.classList.remove(y)}o.style.position="";o.style.overflow="";if(o.contains(s)){o.removeChild(s)}};t.push(p);// 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 */.fw.caption_before_exit]:n[i/* .Animation.caption_after_exit */.fw.caption_after_exit]);f.addEventListener("animationend",p)}const _=d(s);if(_){_.classList.add(m?n[i/* .Animation.weeks_before_exit */.fw.weeks_before_exit]:n[i/* .Animation.weeks_after_exit */.fw.weeks_after_exit])}o.insertBefore(s,o.firstChild)})}})}//# sourceMappingURL=useAnimation.js.map
},30833:function(e,t,n){n.d(t,{G:()=>h});/* ESM import */var r=n(87363);/* ESM import */var i=n(11732);/* ESM import */var o=n(84517);/* ESM import */var a=n(6341);/* ESM import */var s=n(82283);/* ESM import */var l=n(97018);/* ESM import */var d=n(38540);/* ESM import */var c=n(22663);/* ESM import */var u=n(88490);/* ESM import */var v=n(60049);/* ESM import */var p=n(50717);/**
 * 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 */.P)(e,t);const{startOfMonth:f,endOfMonth:g}=t;const _=(0,s/* .getInitialMonth */.Z)(e,n,h,t);const[m,b]=(0,p/* .useControlledValue */.O)(_,// initialMonth is always computed from props.month if provided
e.month?_:undefined);(0,r.useEffect)(()=>{const r=(0,s/* .getInitialMonth */.Z)(e,n,h,t);b(r);// eslint-disable-next-line react-hooks/exhaustive-deps
},[e.timeZone]);/** The months displayed in the calendar. */const y=(0,a/* .getDisplayMonths */.b)(m,h,e,t);/** The dates displayed in the calendar. */const w=(0,i/* .getDates */.i)(y,e.endMonth?g(e.endMonth):undefined,e,t);/** The Months displayed in the calendar. */const Z=(0,l/* .getMonths */.w)(y,w,e,t);/** The Weeks displayed in the calendar. */const x=(0,v/* .getWeeks */.K)(Z);/** The Days displayed in the calendar. */const k=(0,o/* .getDays */.g)(Z);const C=(0,u/* .getPreviousMonth */.S)(m,n,e,t);const E=(0,c/* .getNextMonth */.f)(m,h,e,t);const{disableNavigation:W,onMonthChange:D}=e;const T=e=>x.some(t=>t.days.some(t=>t.isEqualTo(e)));const q=e=>{if(W){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);D?.(t)};const S=e=>{// is this check necessary?
if(T(e)){return}q(e.date)};const M={months:Z,weeks:x,days:k,navStart:n,navEnd:h,previousMonth:C,nextMonth:E,goToMonth:q,goToDay:S};return M}//# sourceMappingURL=useCalendar.js.map
},5293:function(e,t,n){n.d(t,{Z:()=>i,k:()=>o});/* ESM import */var r=n(87363);/** @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 o(){const e=(0,r.useContext)(i);if(e===undefined){throw new Error("useDayPicker() must be used within a custom component.")}return e}//# sourceMappingURL=useDayPicker.js.map
},35625:function(e,t,n){n.d(t,{K:()=>a});/* ESM import */var r=n(87363);/* ESM import */var i=n(79173);/* ESM import */var o=n(84110);/**
 * 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 a(e,t,n,a,s){const{autoFocus:l}=e;const[d,c]=(0,r.useState)();const u=(0,i/* .calculateFocusTarget */.k)(t.days,n,a||(()=>false),d);const[v,p]=(0,r.useState)(l?u:undefined);const h=()=>{c(v);p(undefined)};const f=(n,r)=>{if(!v)return;const i=(0,o/* .getNextFocus */.j)(n,r,v,t.navStart,t.navEnd,e,s);if(!i)return;t.goToDay(i);p(i)};const g=e=>{return Boolean(u?.isEqualTo(e))};const _={isFocusTarget:g,setFocused:p,focused:v,blur:h,moveFocus:f};return _}//# sourceMappingURL=useFocus.js.map
},70162:function(e,t,n){n.d(t,{c:()=>a});/* ESM import */var r=n(13796);/* ESM import */var i=n(9998);/* ESM import */var o=n(67413);/**
 * 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 a(e,t){const n=(0,o/* .useSingle */.G)(e,t);const a=(0,r/* .useMulti */.R)(e,t);const s=(0,i/* .useRange */.C)(e,t);switch(e.mode){case"single":return n;case"multiple":return a;case"range":return s;default:return undefined}}//# sourceMappingURL=useSelection.js.map
},16257:function(e,t,n){n.d(t,{n:()=>i});/* ESM import */var r=n(65469);/**
 * 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,o=0,a=false,s=r/* .defaultDateLib */.zk){const{from:l,to:d}=t||{};const{isSameDay:c,isAfter:u,isBefore:v}=s;let p;if(!l&&!d){// the range is empty, add the date
p={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(a){p={from:l,to:undefined}}else{p=undefined}}else if(v(e,l)){// adding a date before the start of the range
p={from:e,to:l}}else{// adding a date after the start of the range
p={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(a){p={from:l,to:d}}else{p=undefined}}else if(c(l,e)){// adding a date equal to the the start of the range
p={from:l,to:n>0?undefined:e}}else if(c(d,e)){// adding a dare equal to the end of the range
p={from:e,to:n>0?undefined:e}}else if(v(e,l)){// adding a date before the start of the range
p={from:e,to:d}}else if(u(e,l)){// adding a date after the start of the range
p={from:l,to:e}}else if(u(e,d)){// adding a date after the end of the range
p={from:l,to:e}}else{throw new Error("Invalid range")}}// check for min / max
if(p?.from&&p?.to){const t=s.differenceInCalendarDays(p.to,p.from);if(o>0&&t>o){p={from:e,to:undefined}}else if(n>1&&t<n){p={from:e,to:undefined}}}return p}//# sourceMappingURL=addToRange.js.map
},52804:function(e,t,n){n.d(t,{W:()=>a});/* ESM import */var r=n(65469);/* ESM import */var i=n(94232);/* ESM import */var o=n(20311);/**
 * 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 a(e,t,n=r/* .defaultDateLib */.zk){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,o/* .isDatesArray */.jA)(t,n)){return t.includes(e)}if((0,o/* .isDateRange */.Ws)(t)){return(0,i/* .rangeIncludesDate */.C)(t,e,false,n)}if((0,o/* .isDayOfWeekType */.U4)(t)){if(!Array.isArray(t.dayOfWeek)){return t.dayOfWeek===e.getDay()}return t.dayOfWeek.includes(e.getDay())}if((0,o/* .isDateInterval */.Zl)(t)){const n=d(t.before,e);const r=d(t.after,e);const i=n>0;const o=r<0;const a=c(t.before,t.after);if(a){return o&&i}else{return i||o}}if((0,o/* .isDateAfterType */.FZ)(t)){return d(e,t.after)>0}if((0,o/* .isDateBeforeType */.Vp)(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&&a;//# sourceMappingURL=dateMatchModifiers.js.map
},7493:function(e,t,n){n.d(t,{L:()=>i});/* ESM import */var r=n(65469);/**
 * 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 */.zk){const o=!Array.isArray(t)?[t]:t;let a=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(o.includes(a.getDay())){return true}a=n.addDays(a,1)}return false}//# sourceMappingURL=rangeContainsDayOfWeek.js.map
},99217:function(e,t,n){n.d(t,{C:()=>d});/* ESM import */var r=n(65469);/* ESM import */var i=n(52804);/* ESM import */var o=n(7493);/* ESM import */var a=n(94232);/* ESM import */var s=n(1297);/* ESM import */var l=n(20311);/**
 * 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 */.zk){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 v=u.some(t=>{if(typeof t==="boolean")return t;if(n.isDate(t)){return(0,a/* .rangeIncludesDate */.C)(e,t,false,n)}if((0,l/* .isDatesArray */.jA)(t,n)){return t.some(t=>(0,a/* .rangeIncludesDate */.C)(e,t,false,n))}if((0,l/* .isDateRange */.Ws)(t)){if(t.from&&t.to){return(0,s/* .rangeOverlaps */.z)(e,{from:t.from,to:t.to},n)}return false}if((0,l/* .isDayOfWeekType */.U4)(t)){return(0,o/* .rangeContainsDayOfWeek */.L)(e,t.dayOfWeek,n)}if((0,l/* .isDateInterval */.Zl)(t)){const r=n.isAfter(t.before,t.after);if(r){return(0,s/* .rangeOverlaps */.z)(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n)}return(0,i/* .dateMatchModifiers */.W)(e.from,t,n)||(0,i/* .dateMatchModifiers */.W)(e.to,t,n)}if((0,l/* .isDateAfterType */.FZ)(t)||(0,l/* .isDateBeforeType */.Vp)(t)){return(0,i/* .dateMatchModifiers */.W)(e.from,t,n)||(0,i/* .dateMatchModifiers */.W)(e.to,t,n)}return false});if(v){return true}const p=c.filter(e=>typeof e==="function");if(p.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(p.some(e=>e(t))){return true}t=n.addDays(t,1)}}return false}//# sourceMappingURL=rangeContainsModifiers.js.map
},94232:function(e,t,n){n.d(t,{C:()=>i});/* ESM import */var r=n(65469);/**
 * 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,o=r/* .defaultDateLib */.zk){let{from:a,to:s}=e;const{differenceInCalendarDays:l,isSameDay:d}=o;if(a&&s){const e=l(s,a)<0;if(e){[a,s]=[s,a]}const r=l(t,a)>=(n?1:0)&&l(s,t)>=(n?1:0);return r}if(!n&&s){return d(s,t)}if(!n&&a){return d(a,t)}return false}/**
 * @private
 * @deprecated Use {@link rangeIncludesDate} instead.
 */const o=(e,t)=>i(e,t,false,defaultDateLib);//# sourceMappingURL=rangeIncludesDate.js.map
},1297:function(e,t,n){n.d(t,{z:()=>o});/* ESM import */var r=n(65469);/* ESM import */var i=n(94232);/**
 * 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 o(e,t,n=r/* .defaultDateLib */.zk){return(0,i/* .rangeIncludesDate */.C)(e,t.from,false,n)||(0,i/* .rangeIncludesDate */.C)(e,t.to,false,n)||(0,i/* .rangeIncludesDate */.C)(t,e.from,false,n)||(0,i/* .rangeIncludesDate */.C)(t,e.to,false,n)}//# sourceMappingURL=rangeOverlaps.js.map
},20311:function(e,t,n){n.d(t,{FZ:()=>o,U4:()=>s,Vp:()=>a,Ws:()=>i,Zl:()=>r,jA:()=>l});/**
 * 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 o(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 a(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)}//# sourceMappingURL=typeguards.js.map
},51805:function(e,t,n){n.d(t,{r:()=>r});function r(e,t){const n=e<0?"-":"";const r=Math.abs(e).toString().padStart(t,"0");return n+r}},92639:function(e,t,n){n.d(t,{j:()=>i});let r={};function i(){return r}function o(e){r=e}},46083:function(e,t,n){n.d(t,{$:()=>u});/* ESM import */var r=n(29750);/* ESM import */var i=n(65719);/* ESM import */var o=n(74155);/* ESM import */var a=n(12347);/* ESM import */var s=n(7898);/* ESM import */var l=n(51805);/* ESM import */var d=n(12471);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 */.o.y(e,t)},// Local week-numbering year
Y:function(e,t,n,r){const i=(0,s/* .getWeekYear */.c)(e,r);// Returns 1 for 1 BC (which is year 0 in JavaScript)
const o=i>0?i:1-i;// Two digit year
if(t==="YY"){const e=o%100;return(0,l/* .addLeadingZeros */.r)(e,2)}// Ordinal number
if(t==="Yo"){return n.ordinalNumber(o,{unit:"year"})}// Padding
return(0,l/* .addLeadingZeros */.r)(o,t.length)},// ISO week-numbering year
R:function(e,t){const n=(0,o/* .getISOWeekYear */.L)(e);// Padding
return(0,l/* .addLeadingZeros */.r)(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 */.r)(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 */.r)(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 */.r)(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 */.o.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 */.r)(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,a/* .getWeek */.Q)(e,r);if(t==="wo"){return n.ordinalNumber(i,{unit:"week"})}return(0,l/* .addLeadingZeros */.r)(i,t.length)},// ISO week of year
I:function(e,t,n){const r=(0,i/* .getISOWeek */.l)(e);if(t==="Io"){return n.ordinalNumber(r,{unit:"week"})}return(0,l/* .addLeadingZeros */.r)(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 */.o.d(e,t)},// Day of year
D:function(e,t,n){const i=(0,r/* .getDayOfYear */.B)(e);if(t==="Do"){return n.ordinalNumber(i,{unit:"dayOfYear"})}return(0,l/* .addLeadingZeros */.r)(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 o=(i-r.weekStartsOn+8)%7||7;switch(t){// Numerical value (Nth day of week with current locale or weekStartsOn)
case"e":return String(o);// Padded numerical value
case"ee":return(0,l/* .addLeadingZeros */.r)(o,2);// 1st, 2nd, ..., 7th
case"eo":return n.ordinalNumber(o,{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 o=(i-r.weekStartsOn+8)%7||7;switch(t){// Numerical value (same as in `e`)
case"c":return String(o);// Padded numerical value
case"cc":return(0,l/* .addLeadingZeros */.r)(o,t.length);// 1st, 2nd, ..., 7th
case"co":return n.ordinalNumber(o,{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 */.r)(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 */.o.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 */.o.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 */.r)(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 */.r)(r,t.length)},// Minute
m:function(e,t,n){if(t==="mo"){return n.ordinalNumber(e.getMinutes(),{unit:"minute"})}return d/* .lightFormatters.m */.o.m(e,t)},// Second
s:function(e,t,n){if(t==="so"){return n.ordinalNumber(e.getSeconds(),{unit:"second"})}return d/* .lightFormatters.s */.o.s(e,t)},// Fraction of second
S:function(e,t){return d/* .lightFormatters.S */.o.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 p(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 p(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"+v(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"+v(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 */.r)(r,t.length)},// Milliseconds timestamp
T:function(e,t,n){return(0,l/* .addLeadingZeros */.r)(+e,t.length)}};function v(e,t=""){const n=e>0?"-":"+";const r=Math.abs(e);const i=Math.trunc(r/60);const o=r%60;if(o===0){return n+String(i)}return n+String(i)+t+(0,l/* .addLeadingZeros */.r)(o,2)}function p(e,t){if(e%60===0){const t=e>0?"-":"+";return t+(0,l/* .addLeadingZeros */.r)(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 */.r)(Math.trunc(r/60),2);const o=(0,l/* .addLeadingZeros */.r)(r%60,2);return n+i+t+o}},12471:function(e,t,n){n.d(t,{o:()=>i});/* ESM import */var r=n(51805);/*
 * |     | 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 */.r)(t==="yy"?i%100:i,t.length)},// Month
M(e,t){const n=e.getMonth();return t==="M"?String(n+1):(0,r/* .addLeadingZeros */.r)(n+1,2)},// Day of the month
d(e,t){return(0,r/* .addLeadingZeros */.r)(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 */.r)(e.getHours()%12||12,t.length)},// Hour [0-23]
H(e,t){return(0,r/* .addLeadingZeros */.r)(e.getHours(),t.length)},// Minute
m(e,t){return(0,r/* .addLeadingZeros */.r)(e.getMinutes(),t.length)},// Second
s(e,t){return(0,r/* .addLeadingZeros */.r)(e.getSeconds(),t.length)},// Fraction of second
S(e,t){const n=t.length;const i=e.getMilliseconds();const o=Math.trunc(i*Math.pow(10,n-3));return(0,r/* .addLeadingZeros */.r)(o,t.length)}}},15475:function(e,t,n){n.d(t,{G:()=>a});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 o=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[];const o=n[1];const a=n[2];if(!a){return r(e,t)}let s;switch(o){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(o,t)).replace("{{time}}",i(a,t))};const a={p:i,P:o}},29486:function(e,t,n){n.d(t,{D:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(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}},90457:function(e,t,n){n.d(t,{d:()=>i});/* ESM import */var r=n(85941);function i(e,...t){const n=r/* .constructFrom.bind */.L.bind(null,e||t.find(e=>typeof e==="object"));return t.map(n)}},15176:function(e,t,n){n.d(t,{T:()=>i});/* ESM import */var r=n(90457);function i(e,t){const[n,i]=(0,r/* .normalizeDates */.d)(e,t.start,t.end);return{start:n,end:i}}},69814:function(e,t,n){n.d(t,{DD:()=>l,Do:()=>s,Iu:()=>a});const r=/^D+$/;const i=/^Y+$/;const o=["D","DD","YY","YYYY"];function a(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(o.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`}},55722:function(e,t,n){n.d(t,{E:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t,n){const o=(0,i/* .toDate */.Q)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.L)(n?.in||e,NaN);// If 0 days, no-op to avoid changing times in the hour before end of DST
if(!t)return o;o.setDate(o.getDate()+t);return o}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},636:function(e,t,n){n.d(t,{z:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t,n){const o=(0,i/* .toDate */.Q)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.L)(n?.in||e,NaN);if(!t){// If 0 months, no-op to avoid changing times in the hour before end of DST
return o}const a=o.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 */.L)(n?.in||e,o.getTime());s.setMonth(o.getMonth()+t+1,0);const l=s.getDate();if(a>=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.
o.setFullYear(s.getFullYear(),s.getMonth(),a);return o}}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},46263:function(e,t,n){n.d(t,{j:()=>i});/* ESM import */var r=n(55722);/**
 * 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 */.E)(e,t*7,n)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},90423:function(e,t,n){n.d(t,{B:()=>i});/* ESM import */var r=n(636);/**
 * 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 */.z)(e,t*12,n)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},22050:function(e,t,n){n.d(t,{I7:()=>E,dP:()=>l,jE:()=>s});/**
 * @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 o=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 a=/* unused pure expression or super */null&&-o;/**
 * @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 v=525600;/**
 * @constant
 * @name minutesInMonth
 * @summary Minutes in 1 month.
 */const p=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 Z=/* unused pure expression or super */null&&w*7;/**
 * @constant
 * @name secondsInYear
 * @summary Seconds in 1 year.
 */const x=/* unused pure expression or super */null&&w*i;/**
 * @constant
 * @name secondsInMonth
 * @summary Seconds in 1 month
 */const k=/* unused pure expression or super */null&&x/12;/**
 * @constant
 * @name secondsInQuarter
 * @summary Seconds in 1 quarter.
 */const C=/* unused pure expression or super */null&&k*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 E=Symbol.for("constructDateFrom")},85941:function(e,t,n){n.d(t,{L:()=>i});/* ESM import */var r=n(22050);/**
 * @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 */.I7 in e)return e[r/* .constructFromSymbol */.I7](t);if(e instanceof Date)return new e.constructor(t);return new Date(t)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},23279:function(e,t,n){n.d(t,{w:()=>s});/* ESM import */var r=n(29486);/* ESM import */var i=n(90457);/* ESM import */var o=n(22050);/* ESM import */var a=n(51066);/**
 * 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 */.d)(n?.in,e,t);const d=(0,a/* .startOfDay */.b)(s);const c=(0,a/* .startOfDay */.b)(l);const u=+d-(0,r/* .getTimezoneOffsetInMilliseconds */.D)(d);const v=+c-(0,r/* .getTimezoneOffsetInMilliseconds */.D)(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-v)/o/* .millisecondsInDay */.dP)}// Fallback for modularized imports:
/* unused ESM default export */var l=/* unused pure expression or super */null&&s},36430:function(e,t,n){n.d(t,{T:()=>i});/* ESM import */var r=n(90457);/**
 * 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,o]=(0,r/* .normalizeDates */.d)(n?.in,e,t);const a=i.getFullYear()-o.getFullYear();const s=i.getMonth()-o.getMonth();return a*12+s}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},83475:function(e,t,n){n.d(t,{R:()=>o});/* ESM import */var r=n(15176);/* ESM import */var i=n(85941);/**
 * 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 o(e,t){const{start:n,end:o}=(0,r/* .normalizeInterval */.T)(t?.in,e);let a=+n>+o;const s=a?+n:+o;const l=a?o:n;l.setHours(0,0,0,0);l.setDate(1);let d=t?.step??1;if(!d)return[];if(d<0){d=-d;a=!a}const c=[];while(+l<=s){c.push((0,i/* .constructFrom */.L)(n,l));l.setMonth(l.getMonth()+d)}return a?c.reverse():c}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},13470:function(e,t,n){n.d(t,{g:()=>i});/* ESM import */var r=n(41041);/**
 * 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 */.v)(e,{...t,weekStartsOn:1})}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},28353:function(e,t,n){n.d(t,{V:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(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 ESM default export */var o=/* unused pure expression or super */null&&i},41041:function(e,t,n){n.d(t,{v:()=>o});/* ESM import */var r=n(92639);/* ESM import */var i=n(28898);/**
 * 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 o(e,t){const n=(0,r/* .getDefaultOptions */.j)();const o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const a=(0,i/* .toDate */.Q)(e,t?.in);const s=a.getDay();const l=(s<o?-7:0)+6-(s-o);a.setDate(a.getDate()+l);a.setHours(23,59,59,999);return a}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},45827:function(e,t,n){n.d(t,{w:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(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 ESM default export */var o=/* unused pure expression or super */null&&i},17989:function(e,t,n){n.d(t,{WU:()=>f});/* ESM import */var r=n(79237);/* ESM import */var i=n(92639);/* ESM import */var o=n(46083);/* ESM import */var a=n(15475);/* ESM import */var s=n(69814);/* ESM import */var l=n(1173);/* ESM import */var d=n(28898);// 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 v=/^'([^]*?)'?$/;const p=/''/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 v=(0,i/* .getDefaultOptions */.j)();const p=n?.locale??v.locale??r/* .enUS */._;const f=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??v.firstWeekContainsDate??v.locale?.options?.firstWeekContainsDate??1;const _=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??v.weekStartsOn??v.locale?.options?.weekStartsOn??0;const m=(0,d/* .toDate */.Q)(e,n?.in);if(!(0,l/* .isValid */.J)(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=a/* .longFormatters */.G[t];return n(e,p.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(o/* .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(p.localize.preprocessor){b=p.localize.preprocessor(m,b)}const y={firstWeekContainsDate:f,weekStartsOn:_,locale:p};return b.map(r=>{if(!r.isToken)return r.value;const i=r.value;if(!n?.useAdditionalWeekYearTokens&&(0,s/* .isProtectedWeekYearToken */.Do)(i)||!n?.useAdditionalDayOfYearTokens&&(0,s/* .isProtectedDayOfYearToken */.Iu)(i)){(0,s/* .warnOrThrowProtectedError */.DD)(i,t,String(e))}const a=o/* .formatters */.$[i[0]];return a(m,i,p.localize,y)}).join("")}function g(e){const t=e.match(v);if(!t){return e}return t[1].replace(p,"'")}// Fallback for modularized imports:
/* unused ESM default export */var _=/* unused pure expression or super */null&&f},29750:function(e,t,n){n.d(t,{B:()=>a});/* ESM import */var r=n(23279);/* ESM import */var i=n(35523);/* ESM import */var o=n(28898);/**
 * 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 a(e,t){const n=(0,o/* .toDate */.Q)(e,t?.in);const a=(0,r/* .differenceInCalendarDays */.w)(n,(0,i/* .startOfYear */.e)(n));const s=a+1;return s}// Fallback for modularized imports:
/* unused ESM default export */var s=/* unused pure expression or super */null&&a},12309:function(e,t,n){n.d(t,{N:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t){const n=(0,i/* .toDate */.Q)(e,t?.in);const o=n.getFullYear();const a=n.getMonth();const s=(0,r/* .constructFrom */.L)(n,0);s.setFullYear(o,a+1,0);s.setHours(0,0,0,0);return s.getDate()}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},65719:function(e,t,n){n.d(t,{l:()=>s});/* ESM import */var r=n(22050);/* ESM import */var i=n(44459);/* ESM import */var o=n(47926);/* ESM import */var a=n(28898);/**
 * 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,a/* .toDate */.Q)(e,t?.in);const s=+(0,i/* .startOfISOWeek */.T)(n)-+(0,o/* .startOfISOWeekYear */.E)(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 */.jE)+1}// Fallback for modularized imports:
/* unused ESM default export */var l=/* unused pure expression or super */null&&s},74155:function(e,t,n){n.d(t,{L:()=>a});/* ESM import */var r=n(85941);/* ESM import */var i=n(44459);/* ESM import */var o=n(28898);/**
 * 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 a(e,t){const n=(0,o/* .toDate */.Q)(e,t?.in);const a=n.getFullYear();const s=(0,r/* .constructFrom */.L)(n,0);s.setFullYear(a+1,0,4);s.setHours(0,0,0,0);const l=(0,i/* .startOfISOWeek */.T)(s);const d=(0,r/* .constructFrom */.L)(n,0);d.setFullYear(a,0,4);d.setHours(0,0,0,0);const c=(0,i/* .startOfISOWeek */.T)(d);if(n.getTime()>=l.getTime()){return a+1}else if(n.getTime()>=c.getTime()){return a}else{return a-1}}// Fallback for modularized imports:
/* unused ESM default export */var s=/* unused pure expression or super */null&&a},11854:function(e,t,n){n.d(t,{j:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(e,t?.in).getMonth()}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},12347:function(e,t,n){n.d(t,{Q:()=>s});/* ESM import */var r=n(22050);/* ESM import */var i=n(19397);/* ESM import */var o=n(86009);/* ESM import */var a=n(28898);/**
 * 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,a/* .toDate */.Q)(e,t?.in);const s=+(0,i/* .startOfWeek */.z)(n,t)-+(0,o/* .startOfWeekYear */.v)(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 */.jE)+1}// Fallback for modularized imports:
/* unused ESM default export */var l=/* unused pure expression or super */null&&s},7898:function(e,t,n){n.d(t,{c:()=>s});/* ESM import */var r=n(92639);/* ESM import */var i=n(85941);/* ESM import */var o=n(19397);/* ESM import */var a=n(28898);/**
 * 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,a/* .toDate */.Q)(e,t?.in);const s=n.getFullYear();const l=(0,r/* .getDefaultOptions */.j)();const d=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1;const c=(0,i/* .constructFrom */.L)(t?.in||e,0);c.setFullYear(s+1,0,d);c.setHours(0,0,0,0);const u=(0,o/* .startOfWeek */.z)(c,t);const v=(0,i/* .constructFrom */.L)(t?.in||e,0);v.setFullYear(s,0,d);v.setHours(0,0,0,0);const p=(0,o/* .startOfWeek */.z)(v,t);if(+n>=+u){return s+1}else if(+n>=+p){return s}else{return s-1}}// Fallback for modularized imports:
/* unused ESM default export */var l=/* unused pure expression or super */null&&s},22431:function(e,t,n){n.d(t,{S:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(e,t?.in).getFullYear()}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},18474:function(e,t,n){n.d(t,{A:()=>i});/* ESM import */var r=n(28898);/**
 * @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 */.Q)(e)>+(0,r/* .toDate */.Q)(t)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},32880:function(e,t,n){n.d(t,{R:()=>i});/* ESM import */var r=n(28898);/**
 * @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 */.Q)(e)<+(0,r/* .toDate */.Q)(t)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},46695:function(e,t,n){n.d(t,{J:()=>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 ESM default export */var i=/* unused pure expression or super */null&&r},17522:function(e,t,n){n.d(t,{K:()=>o});/* ESM import */var r=n(90457);/* ESM import */var i=n(51066);/**
 * 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 o(e,t,n){const[o,a]=(0,r/* .normalizeDates */.d)(n?.in,e,t);return+(0,i/* .startOfDay */.b)(o)===+(0,i/* .startOfDay */.b)(a)}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},40756:function(e,t,n){n.d(t,{x:()=>i});/* ESM import */var r=n(90457);/**
 * 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,o]=(0,r/* .normalizeDates */.d)(n?.in,e,t);return i.getFullYear()===o.getFullYear()&&i.getMonth()===o.getMonth()}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},26098:function(e,t,n){n.d(t,{F:()=>i});/* ESM import */var r=n(90457);/**
 * 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,o]=(0,r/* .normalizeDates */.d)(n?.in,e,t);return i.getFullYear()===o.getFullYear()}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},1173:function(e,t,n){n.d(t,{J:()=>o});/* ESM import */var r=n(46695);/* ESM import */var i=n(28898);/**
 * @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 o(e){return!(!(0,r/* .isDate */.J)(e)&&typeof e!=="number"||isNaN(+(0,i/* .toDate */.Q)(e)))}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},96018:function(e,t,n){n.d(t,{l:()=>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}}},23495:function(e,t,n){n.d(t,{Y:()=>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 o=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[o]}}},46588:function(e,t,n){n.d(t,{t:()=>r});function r(e){return(t,n={})=>{const r=n.width;const a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth];const s=t.match(a);if(!s){return null}const l=s[0];const d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth];const c=Array.isArray(d)?o(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 v=t.slice(l.length);return{value:u,rest:v}}}function i(e,t){for(const n in e){if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n])){return n}}return undefined}function o(e,t){for(let n=0;n<e.length;n++){if(t(e[n])){return n}}return undefined}},12931:function(e,t,n){n.d(t,{y:()=>r});function r(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0];const o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];// [TODO] I challenge you to fix the type
a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(i.length);return{value:a,rest:s}}}},79237:function(e,t,n){n.d(t,{_:()=>l});/* ESM import */var r=n(71953);/* ESM import */var i=n(87049);/* ESM import */var o=n(20040);/* ESM import */var a=n(15318);/* ESM import */var s=n(57113);/**
 * @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 */.W,formatRelative:o/* .formatRelative */.l,localize:a/* .localize */.N,match:s/* .match */.E,options:{weekStartsOn:0/* Sunday */,firstWeekContainsDate:1}};// Fallback for modularized imports:
/* unused ESM default export */var d=/* unused pure expression or super */null&&l},71953: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 o=r[e];if(typeof o==="string"){i=o}else if(t===1){i=o.one}else{i=o.other.replace("{{count}}",t.toString())}if(n?.addSuffix){if(n.comparison&&n.comparison>0){return"in "+i}else{return i+" ago"}}return i}},87049:function(e,t,n){n.d(t,{W:()=>s});/* ESM import */var r=n(96018);const i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"};const o={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"};const a={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};const s={date:(0,r/* .buildFormatLongFn */.l)({formats:i,defaultWidth:"full"}),time:(0,r/* .buildFormatLongFn */.l)({formats:o,defaultWidth:"full"}),dateTime:(0,r/* .buildFormatLongFn */.l)({formats:a,defaultWidth:"full"})}},20040:function(e,t,n){n.d(t,{l:()=>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]},15318:function(e,t,n){n.d(t,{N:()=>u});/* ESM import */var r=n(23495);const i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]};const o={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 a={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 */.Y)({values:i,defaultWidth:"wide"}),quarter:(0,r/* .buildLocalizeFn */.Y)({values:o,defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,r/* .buildLocalizeFn */.Y)({values:a,defaultWidth:"wide"}),day:(0,r/* .buildLocalizeFn */.Y)({values:s,defaultWidth:"wide"}),dayPeriod:(0,r/* .buildLocalizeFn */.Y)({values:l,defaultWidth:"wide",formattingValues:d,defaultFormattingWidth:"wide"})}},57113:function(e,t,n){n.d(t,{E:()=>_});/* ESM import */var r=n(46588);/* ESM import */var i=n(12931);const o=/^(\d+)(th|st|nd|rd)?/i;const a=/\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 v={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 p={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 */.y)({matchPattern:o,parsePattern:a,valueCallback:e=>parseInt(e,10)}),era:(0,r/* .buildMatchFn */.t)({matchPatterns:s,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r/* .buildMatchFn */.t)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:c,defaultParseWidth:"any",valueCallback:e=>e+1}),month:(0,r/* .buildMatchFn */.t)({matchPatterns:u,defaultMatchWidth:"wide",parsePatterns:v,defaultParseWidth:"any"}),day:(0,r/* .buildMatchFn */.t)({matchPatterns:p,defaultMatchWidth:"wide",parsePatterns:h,defaultParseWidth:"any"}),dayPeriod:(0,r/* .buildMatchFn */.t)({matchPatterns:f,defaultMatchWidth:"any",parsePatterns:g,defaultParseWidth:"any"})}},5618:function(e,t,n){n.d(t,{F:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t){let n;let o=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!o&&typeof e==="object")o=r/* .constructFrom.bind */.L.bind(null,e);const t=(0,i/* .toDate */.Q)(e,o);if(!n||n<t||isNaN(+t))n=t});return(0,r/* .constructFrom */.L)(o,n||NaN)}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},20831:function(e,t,n){n.d(t,{V:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t){let n;let o=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!o&&typeof e==="object")o=r/* .constructFrom.bind */.L.bind(null,e);const t=(0,i/* .toDate */.Q)(e,o);if(!n||n>t||isNaN(+t))n=t});return(0,r/* .constructFrom */.L)(o,n||NaN)}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},19706:function(e,t,n){n.d(t,{q:()=>a});/* ESM import */var r=n(85941);/* ESM import */var i=n(12309);/* ESM import */var o=n(28898);/**
 * 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 a(e,t,n){const a=(0,o/* .toDate */.Q)(e,n?.in);const s=a.getFullYear();const l=a.getDate();const d=(0,r/* .constructFrom */.L)(n?.in||e,0);d.setFullYear(s,t,15);d.setHours(0,0,0,0);const c=(0,i/* .getDaysInMonth */.N)(d);// Set the earlier date, allows to wrap Jan 31 to Feb 28
a.setMonth(t,Math.min(l,c));return a}// Fallback for modularized imports:
/* unused ESM default export */var s=/* unused pure expression or super */null&&a},16614:function(e,t,n){n.d(t,{M:()=>o});/* ESM import */var r=n(85941);/* ESM import */var i=n(28898);/**
 * 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 o(e,t,n){const o=(0,i/* .toDate */.Q)(e,n?.in);// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if(isNaN(+o))return(0,r/* .constructFrom */.L)(n?.in||e,NaN);o.setFullYear(t);return o}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},51066:function(e,t,n){n.d(t,{b:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(e,t?.in);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},44459:function(e,t,n){n.d(t,{T:()=>i});/* ESM import */var r=n(19397);/**
 * 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 */.z)(e,{...t,weekStartsOn:1})}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},47926:function(e,t,n){n.d(t,{E:()=>a});/* ESM import */var r=n(85941);/* ESM import */var i=n(74155);/* ESM import */var o=n(44459);/**
 * 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 a(e,t){const n=(0,i/* .getISOWeekYear */.L)(e,t);const a=(0,r/* .constructFrom */.L)(t?.in||e,0);a.setFullYear(n,0,4);a.setHours(0,0,0,0);return(0,o/* .startOfISOWeek */.T)(a)}// Fallback for modularized imports:
/* unused ESM default export */var s=/* unused pure expression or super */null&&a},12432:function(e,t,n){n.d(t,{N:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(e,t?.in);n.setDate(1);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},19397:function(e,t,n){n.d(t,{z:()=>o});/* ESM import */var r=n(92639);/* ESM import */var i=n(28898);/**
 * 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 o(e,t){const n=(0,r/* .getDefaultOptions */.j)();const o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const a=(0,i/* .toDate */.Q)(e,t?.in);const s=a.getDay();const l=(s<o?7:0)+s-o;a.setDate(a.getDate()-l);a.setHours(0,0,0,0);return a}// Fallback for modularized imports:
/* unused ESM default export */var a=/* unused pure expression or super */null&&o},86009:function(e,t,n){n.d(t,{v:()=>s});/* ESM import */var r=n(92639);/* ESM import */var i=n(85941);/* ESM import */var o=n(7898);/* ESM import */var a=n(19397);/**
 * 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 */.j)();const s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1;const l=(0,o/* .getWeekYear */.c)(e,t);const d=(0,i/* .constructFrom */.L)(t?.in||e,0);d.setFullYear(l,0,s);d.setHours(0,0,0,0);const c=(0,a/* .startOfWeek */.z)(d,t);return c}// Fallback for modularized imports:
/* unused ESM default export */var l=/* unused pure expression or super */null&&s},35523:function(e,t,n){n.d(t,{e:()=>i});/* ESM import */var r=n(28898);/**
 * 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 */.Q)(e,t?.in);n.setFullYear(n.getFullYear(),0,1);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i},28898:function(e,t,n){n.d(t,{Q:()=>i});/* ESM import */var r=n(85941);/**
 * @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 */.L)(t||e,e)}// Fallback for modularized imports:
/* unused ESM default export */var o=/* unused pure expression or super */null&&i}}]);