scenri 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +15 -11
- package/dist/index.js +2 -0
- package/dist/serve.js +75 -52
- package/package.json +2 -2
- package/studio-dist/assets/0.22.0-people-places-DBgKia30.webp +0 -0
- package/studio-dist/assets/index-BH6xQdzN.js +108 -0
- package/studio-dist/index.html +1 -1
- package/studio-dist/assets/0.16.0-local-access-D7XQonLd.webp +0 -0
- package/studio-dist/assets/index-Ce9knTi7.js +0 -108
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var cx=e=>{throw TypeError(e)};var ux=(e,t,n)=>t.has(e)||cx("Cannot "+n);var os=(e,t,n)=>(ux(e,t,"read from private field"),n?n.call(e):t.get(e)),dx=(e,t,n)=>t.has(e)?cx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Yg=(e,t,n,r)=>(ux(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function sD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function oS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qg={exports:{}},p0={},Xg={exports:{}},bn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var fx;function aD(){if(fx)return bn;fx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function k(z,q,Z){this.props=z,this.context=q,this.refs=b,this.updater=Z||w}k.prototype.isReactComponent={},k.prototype.setState=function(z,q){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,q,"setState")},k.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=k.prototype;function E(z,q,Z){this.props=z,this.context=q,this.refs=b,this.updater=Z||w}var C=E.prototype=new S;C.constructor=E,y(C,k.prototype),C.isPureReactComponent=!0;var A=Array.isArray,L=Object.prototype.hasOwnProperty,T={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function j(z,q,Z){var ee,he={},ue=null,ge=null;if(q!=null)for(ee in q.ref!==void 0&&(ge=q.ref),q.key!==void 0&&(ue=""+q.key),q)L.call(q,ee)&&!M.hasOwnProperty(ee)&&(he[ee]=q[ee]);var te=arguments.length-2;if(te===1)he.children=Z;else if(1<te){for(var J=Array(te),Q=0;Q<te;Q++)J[Q]=arguments[Q+2];he.children=J}if(z&&z.defaultProps)for(ee in te=z.defaultProps,te)he[ee]===void 0&&(he[ee]=te[ee]);return{$$typeof:e,type:z,key:ue,ref:ge,props:he,_owner:T.current}}function P(z,q){return{$$typeof:e,type:z.type,key:q,ref:z.ref,props:z.props,_owner:z._owner}}function R(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function H(z){var q={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return q[Z]})}var D=/\/+/g;function U(z,q){return typeof z=="object"&&z!==null&&z.key!=null?H(""+z.key):q.toString(36)}function V(z,q,Z,ee,he){var ue=typeof z;(ue==="undefined"||ue==="boolean")&&(z=null);var ge=!1;if(z===null)ge=!0;else switch(ue){case"string":case"number":ge=!0;break;case"object":switch(z.$$typeof){case e:case t:ge=!0}}if(ge)return ge=z,he=he(ge),z=ee===""?"."+U(ge,0):ee,A(he)?(Z="",z!=null&&(Z=z.replace(D,"$&/")+"/"),V(he,q,Z,"",function(Q){return Q})):he!=null&&(R(he)&&(he=P(he,Z+(!he.key||ge&&ge.key===he.key?"":(""+he.key).replace(D,"$&/")+"/")+z)),q.push(he)),1;if(ge=0,ee=ee===""?".":ee+":",A(z))for(var te=0;te<z.length;te++){ue=z[te];var J=ee+U(ue,te);ge+=V(ue,q,Z,J,he)}else if(J=m(z),typeof J=="function")for(z=J.call(z),te=0;!(ue=z.next()).done;)ue=ue.value,J=ee+U(ue,te++),ge+=V(ue,q,Z,J,he);else if(ue==="object")throw q=String(z),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return ge}function B(z,q,Z){if(z==null)return z;var ee=[],he=0;return V(z,ee,"","",function(ue){return q.call(Z,ue,he++)}),ee}function G(z){if(z._status===-1){var q=z._result;q=q(),q.then(function(Z){(z._status===0||z._status===-1)&&(z._status=1,z._result=Z)},function(Z){(z._status===0||z._status===-1)&&(z._status=2,z._result=Z)}),z._status===-1&&(z._status=0,z._result=q)}if(z._status===1)return z._result.default;throw z._result}var _={current:null},O={transition:null},I={ReactCurrentDispatcher:_,ReactCurrentBatchConfig:O,ReactCurrentOwner:T};function K(){throw Error("act(...) is not supported in production builds of React.")}return bn.Children={map:B,forEach:function(z,q,Z){B(z,function(){q.apply(this,arguments)},Z)},count:function(z){var q=0;return B(z,function(){q++}),q},toArray:function(z){return B(z,function(q){return q})||[]},only:function(z){if(!R(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},bn.Component=k,bn.Fragment=n,bn.Profiler=a,bn.PureComponent=E,bn.StrictMode=r,bn.Suspense=f,bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,bn.act=K,bn.cloneElement=function(z,q,Z){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var ee=y({},z.props),he=z.key,ue=z.ref,ge=z._owner;if(q!=null){if(q.ref!==void 0&&(ue=q.ref,ge=T.current),q.key!==void 0&&(he=""+q.key),z.type&&z.type.defaultProps)var te=z.type.defaultProps;for(J in q)L.call(q,J)&&!M.hasOwnProperty(J)&&(ee[J]=q[J]===void 0&&te!==void 0?te[J]:q[J])}var J=arguments.length-2;if(J===1)ee.children=Z;else if(1<J){te=Array(J);for(var Q=0;Q<J;Q++)te[Q]=arguments[Q+2];ee.children=te}return{$$typeof:e,type:z.type,key:he,ref:ue,props:ee,_owner:ge}},bn.createContext=function(z){return z={$$typeof:l,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:i,_context:z},z.Consumer=z},bn.createElement=j,bn.createFactory=function(z){var q=j.bind(null,z);return q.type=z,q},bn.createRef=function(){return{current:null}},bn.forwardRef=function(z){return{$$typeof:u,render:z}},bn.isValidElement=R,bn.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:G}},bn.memo=function(z,q){return{$$typeof:h,type:z,compare:q===void 0?null:q}},bn.startTransition=function(z){var q=O.transition;O.transition={};try{z()}finally{O.transition=q}},bn.unstable_act=K,bn.useCallback=function(z,q){return _.current.useCallback(z,q)},bn.useContext=function(z){return _.current.useContext(z)},bn.useDebugValue=function(){},bn.useDeferredValue=function(z){return _.current.useDeferredValue(z)},bn.useEffect=function(z,q){return _.current.useEffect(z,q)},bn.useId=function(){return _.current.useId()},bn.useImperativeHandle=function(z,q,Z){return _.current.useImperativeHandle(z,q,Z)},bn.useInsertionEffect=function(z,q){return _.current.useInsertionEffect(z,q)},bn.useLayoutEffect=function(z,q){return _.current.useLayoutEffect(z,q)},bn.useMemo=function(z,q){return _.current.useMemo(z,q)},bn.useReducer=function(z,q,Z){return _.current.useReducer(z,q,Z)},bn.useRef=function(z){return _.current.useRef(z)},bn.useState=function(z){return _.current.useState(z)},bn.useSyncExternalStore=function(z,q,Z){return _.current.useSyncExternalStore(z,q,Z)},bn.useTransition=function(){return _.current.useTransition()},bn.version="18.3.1",bn}var hx;function vv(){return hx||(hx=1,Xg.exports=aD()),Xg.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var px;function oD(){if(px)return p0;px=1;var e=vv(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,h){var p,g={},m=null,w=null;h!==void 0&&(m=""+h),f.key!==void 0&&(m=""+f.key),f.ref!==void 0&&(w=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(g[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:t,type:u,key:m,ref:w,props:g,_owner:a.current}}return p0.Fragment=n,p0.jsx=l,p0.jsxs=l,p0}var mx;function iD(){return mx||(mx=1,qg.exports=oD()),qg.exports}var o=iD(),s=vv();const zn=oS(s),Fc=sD({__proto__:null,default:zn},[s]);var vh={},Qg={exports:{}},Os={},Jg={exports:{}},e8={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var gx;function lD(){return gx||(gx=1,(function(e){function t(O,I){var K=O.length;O.push(I);e:for(;0<K;){var z=K-1>>>1,q=O[z];if(0<a(q,I))O[z]=I,O[K]=q,K=z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var I=O[0],K=O.pop();if(K!==I){O[0]=K;e:for(var z=0,q=O.length,Z=q>>>1;z<Z;){var ee=2*(z+1)-1,he=O[ee],ue=ee+1,ge=O[ue];if(0>a(he,K))ue<q&&0>a(ge,he)?(O[z]=ge,O[ue]=K,z=ue):(O[z]=he,O[ee]=K,z=ee);else if(ue<q&&0>a(ge,K))O[z]=ge,O[ue]=K,z=ue;else break e}}return I}function a(O,I){var K=O.sortIndex-I.sortIndex;return K!==0?K:O.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,g=null,m=3,w=!1,y=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(O){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=O)r(h),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(h)}}function A(O){if(b=!1,C(O),!y)if(n(f)!==null)y=!0,G(L);else{var I=n(h);I!==null&&_(A,I.startTime-O)}}function L(O,I){y=!1,b&&(b=!1,S(j),j=-1),w=!0;var K=m;try{for(C(I),g=n(f);g!==null&&(!(g.expirationTime>I)||O&&!H());){var z=g.callback;if(typeof z=="function"){g.callback=null,m=g.priorityLevel;var q=z(g.expirationTime<=I);I=e.unstable_now(),typeof q=="function"?g.callback=q:g===n(f)&&r(f),C(I)}else r(f);g=n(f)}if(g!==null)var Z=!0;else{var ee=n(h);ee!==null&&_(A,ee.startTime-I),Z=!1}return Z}finally{g=null,m=K,w=!1}}var T=!1,M=null,j=-1,P=5,R=-1;function H(){return!(e.unstable_now()-R<P)}function D(){if(M!==null){var O=e.unstable_now();R=O;var I=!0;try{I=M(!0,O)}finally{I?U():(T=!1,M=null)}}else T=!1}var U;if(typeof E=="function")U=function(){E(D)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,B=V.port2;V.port1.onmessage=D,U=function(){B.postMessage(null)}}else U=function(){k(D,0)};function G(O){M=O,T||(T=!0,U())}function _(O,I){j=k(function(){O(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,G(L))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(O){switch(m){case 1:case 2:case 3:var I=3;break;default:I=m}var K=m;m=I;try{return O()}finally{m=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var K=m;m=O;try{return I()}finally{m=K}},e.unstable_scheduleCallback=function(O,I,K){var z=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?z+K:z):K=z,O){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=K+q,O={id:p++,callback:I,priorityLevel:O,startTime:K,expirationTime:q,sortIndex:-1},K>z?(O.sortIndex=K,t(h,O),n(f)===null&&O===n(h)&&(b?(S(j),j=-1):b=!0,_(A,K-z))):(O.sortIndex=q,t(f,O),y||w||(y=!0,G(L))),O},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(O){var I=m;return function(){var K=m;m=I;try{return O.apply(this,arguments)}finally{m=K}}}})(e8)),e8}var vx;function cD(){return vx||(vx=1,Jg.exports=lD()),Jg.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var wx;function uD(){if(wx)return Os;wx=1;var e=vv(),t=cD();function n(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)d+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(c,d){l(c,d),l(c+"Capture",d)}function l(c,d){for(a[c]=d,c=0;c<d.length;c++)r.add(d[c])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function m(c){return f.call(g,c)?!0:f.call(p,c)?!1:h.test(c)?g[c]=!0:(p[c]=!0,!1)}function w(c,d,v,x){if(v!==null&&v.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function y(c,d,v,x){if(d===null||typeof d>"u"||w(c,d,v,x))return!0;if(x)return!1;if(v!==null)switch(v.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function b(c,d,v,x,N,$,W){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=x,this.attributeNamespace=N,this.mustUseProperty=v,this.propertyName=c,this.type=d,this.sanitizeURL=$,this.removeEmptyString=W}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){k[c]=new b(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var d=c[0];k[d]=new b(d,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){k[c]=new b(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){k[c]=new b(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){k[c]=new b(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){k[c]=new b(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){k[c]=new b(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){k[c]=new b(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){k[c]=new b(c,5,!1,c.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new b(d,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new b(d,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var d=c.replace(S,E);k[d]=new b(d,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){k[c]=new b(c,1,!1,c.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){k[c]=new b(c,1,!1,c.toLowerCase(),null,!0,!0)});function C(c,d,v,x){var N=k.hasOwnProperty(d)?k[d]:null;(N!==null?N.type!==0:x||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,v,N,x)&&(v=null),x||N===null?m(d)&&(v===null?c.removeAttribute(d):c.setAttribute(d,""+v)):N.mustUseProperty?c[N.propertyName]=v===null?N.type===3?!1:"":v:(d=N.attributeName,x=N.attributeNamespace,v===null?c.removeAttribute(d):(N=N.type,v=N===3||N===4&&v===!0?"":""+v,x?c.setAttributeNS(x,d,v):c.setAttribute(d,v))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),T=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),O=Symbol.iterator;function I(c){return c===null||typeof c!="object"?null:(c=O&&c[O]||c["@@iterator"],typeof c=="function"?c:null)}var K=Object.assign,z;function q(c){if(z===void 0)try{throw Error()}catch(v){var d=v.stack.trim().match(/\n( *(at )?)/);z=d&&d[1]||""}return`
|
|
34
|
+
`+z+c}var Z=!1;function ee(c,d){if(!c||Z)return"";Z=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Ue){var x=Ue}Reflect.construct(c,[],d)}else{try{d.call()}catch(Ue){x=Ue}c.call(d.prototype)}else{try{throw Error()}catch(Ue){x=Ue}c()}}catch(Ue){if(Ue&&x&&typeof Ue.stack=="string"){for(var N=Ue.stack.split(`
|
|
35
|
+
`),$=x.stack.split(`
|
|
36
|
+
`),W=N.length-1,fe=$.length-1;1<=W&&0<=fe&&N[W]!==$[fe];)fe--;for(;1<=W&&0<=fe;W--,fe--)if(N[W]!==$[fe]){if(W!==1||fe!==1)do if(W--,fe--,0>fe||N[W]!==$[fe]){var ye=`
|
|
37
|
+
`+N[W].replace(" at new "," at ");return c.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",c.displayName)),ye}while(1<=W&&0<=fe);break}}}finally{Z=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?q(c):""}function he(c){switch(c.tag){case 5:return q(c.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return c=ee(c.type,!1),c;case 11:return c=ee(c.type.render,!1),c;case 1:return c=ee(c.type,!0),c;default:return""}}function ue(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case M:return"Fragment";case T:return"Portal";case P:return"Profiler";case j:return"StrictMode";case U:return"Suspense";case V:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case H:return(c.displayName||"Context")+".Consumer";case R:return(c._context.displayName||"Context")+".Provider";case D:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case B:return d=c.displayName||null,d!==null?d:ue(c.type)||"Memo";case G:d=c._payload,c=c._init;try{return ue(c(d))}catch{}}return null}function ge(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(d);case 8:return d===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function te(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function J(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Q(c){var d=J(c)?"checked":"value",v=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),x=""+c[d];if(!c.hasOwnProperty(d)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var N=v.get,$=v.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return N.call(this)},set:function(W){x=""+W,$.call(this,W)}}),Object.defineProperty(c,d,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(W){x=""+W},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function ae(c){c._valueTracker||(c._valueTracker=Q(c))}function $e(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var v=d.getValue(),x="";return c&&(x=J(c)?c.checked?"true":"false":c.value),c=x,c!==v?(d.setValue(c),!0):!1}function ie(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function ke(c,d){var v=d.checked;return K({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??c._wrapperState.initialChecked})}function ze(c,d){var v=d.defaultValue==null?"":d.defaultValue,x=d.checked!=null?d.checked:d.defaultChecked;v=te(d.value!=null?d.value:v),c._wrapperState={initialChecked:x,initialValue:v,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function wt(c,d){d=d.checked,d!=null&&C(c,"checked",d,!1)}function Ke(c,d){wt(c,d);var v=te(d.value),x=d.type;if(v!=null)x==="number"?(v===0&&c.value===""||c.value!=v)&&(c.value=""+v):c.value!==""+v&&(c.value=""+v);else if(x==="submit"||x==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?De(c,d.type,v):d.hasOwnProperty("defaultValue")&&De(c,d.type,te(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function tt(c,d,v){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var x=d.type;if(!(x!=="submit"&&x!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,v||d===c.value||(c.value=d),c.defaultValue=d}v=c.name,v!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,v!==""&&(c.name=v)}function De(c,d,v){(d!=="number"||ie(c.ownerDocument)!==c)&&(v==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+v&&(c.defaultValue=""+v))}var Se=Array.isArray;function X(c,d,v,x){if(c=c.options,d){d={};for(var N=0;N<v.length;N++)d["$"+v[N]]=!0;for(v=0;v<c.length;v++)N=d.hasOwnProperty("$"+c[v].value),c[v].selected!==N&&(c[v].selected=N),N&&x&&(c[v].defaultSelected=!0)}else{for(v=""+te(v),d=null,N=0;N<c.length;N++){if(c[N].value===v){c[N].selected=!0,x&&(c[N].defaultSelected=!0);return}d!==null||c[N].disabled||(d=c[N])}d!==null&&(d.selected=!0)}}function je(c,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return K({},d,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Re(c,d){var v=d.value;if(v==null){if(v=d.children,d=d.defaultValue,v!=null){if(d!=null)throw Error(n(92));if(Se(v)){if(1<v.length)throw Error(n(93));v=v[0]}d=v}d==null&&(d=""),v=d}c._wrapperState={initialValue:te(v)}}function re(c,d){var v=te(d.value),x=te(d.defaultValue);v!=null&&(v=""+v,v!==c.value&&(c.value=v),d.defaultValue==null&&c.defaultValue!==v&&(c.defaultValue=v)),x!=null&&(c.defaultValue=""+x)}function Y(c){var d=c.textContent;d===c._wrapperState.initialValue&&d!==""&&d!==null&&(c.value=d)}function se(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ne(c,d){return c==null||c==="http://www.w3.org/1999/xhtml"?se(d):c==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var Be,st=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,v,x,N){MSApp.execUnsafeLocalFunction(function(){return c(d,v,x,N)})}:c})(function(c,d){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=d;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Be.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;d.firstChild;)c.appendChild(d.firstChild)}});function Pe(c,d){if(d){var v=c.firstChild;if(v&&v===c.lastChild&&v.nodeType===3){v.nodeValue=d;return}}c.textContent=d}var Oe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ge=["Webkit","ms","Moz","O"];Object.keys(Oe).forEach(function(c){Ge.forEach(function(d){d=d+c.charAt(0).toUpperCase()+c.substring(1),Oe[d]=Oe[c]})});function ft(c,d,v){return d==null||typeof d=="boolean"||d===""?"":v||typeof d!="number"||d===0||Oe.hasOwnProperty(c)&&Oe[c]?(""+d).trim():d+"px"}function bt(c,d){c=c.style;for(var v in d)if(d.hasOwnProperty(v)){var x=v.indexOf("--")===0,N=ft(v,d[v],x);v==="float"&&(v="cssFloat"),x?c.setProperty(v,N):c[v]=N}}var at=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zt(c,d){if(d){if(at[c]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,c));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function jt(c,d){if(c.indexOf("-")===-1)return typeof d.is=="string";switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ft=null;function Pt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Tt=null,xe=null,Je=null;function Et(c){if(c=Jd(c)){if(typeof Tt!="function")throw Error(n(280));var d=c.stateNode;d&&(d=Lf(d),Tt(c.stateNode,c.type,d))}}function Xe(c){xe?Je?Je.push(c):Je=[c]:xe=c}function rt(){if(xe){var c=xe,d=Je;if(Je=xe=null,Et(c),d)for(c=0;c<d.length;c++)Et(d[c])}}function nt(c,d){return c(d)}function qt(){}var Yt=!1;function an(c,d,v){if(Yt)return c(d,v);Yt=!0;try{return nt(c,d,v)}finally{Yt=!1,(xe!==null||Je!==null)&&(qt(),rt())}}function Wt(c,d){var v=c.stateNode;if(v===null)return null;var x=Lf(v);if(x===null)return null;v=x[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(c=c.type,x=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!x;break e;default:c=!1}if(c)return null;if(v&&typeof v!="function")throw Error(n(231,d,typeof v));return v}var Rn=!1;if(u)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){Rn=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch{Rn=!1}function ne(c,d,v,x,N,$,W,fe,ye){var Ue=Array.prototype.slice.call(arguments,3);try{d.apply(v,Ue)}catch(dt){this.onError(dt)}}var le=!1,ce=null,Ve=!1,_e=null,xt={onError:function(c){le=!0,ce=c}};function yt(c,d,v,x,N,$,W,fe,ye){le=!1,ce=null,ne.apply(xt,arguments)}function kt(c,d,v,x,N,$,W,fe,ye){if(yt.apply(this,arguments),le){if(le){var Ue=ce;le=!1,ce=null}else throw Error(n(198));Ve||(Ve=!0,_e=Ue)}}function ot(c){var d=c,v=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(v=d.return),c=d.return;while(c)}return d.tag===3?v:null}function ht(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function Ae(c){if(ot(c)!==c)throw Error(n(188))}function me(c){var d=c.alternate;if(!d){if(d=ot(c),d===null)throw Error(n(188));return d!==c?null:c}for(var v=c,x=d;;){var N=v.return;if(N===null)break;var $=N.alternate;if($===null){if(x=N.return,x!==null){v=x;continue}break}if(N.child===$.child){for($=N.child;$;){if($===v)return Ae(N),c;if($===x)return Ae(N),d;$=$.sibling}throw Error(n(188))}if(v.return!==x.return)v=N,x=$;else{for(var W=!1,fe=N.child;fe;){if(fe===v){W=!0,v=N,x=$;break}if(fe===x){W=!0,x=N,v=$;break}fe=fe.sibling}if(!W){for(fe=$.child;fe;){if(fe===v){W=!0,v=$,x=N;break}if(fe===x){W=!0,x=$,v=N;break}fe=fe.sibling}if(!W)throw Error(n(189))}}if(v.alternate!==x)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?c:d}function et(c){return c=me(c),c!==null?Ct(c):null}function Ct(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=Ct(c);if(d!==null)return d;c=c.sibling}return null}var be=t.unstable_scheduleCallback,it=t.unstable_cancelCallback,vt=t.unstable_shouldYield,Te=t.unstable_requestPaint,qe=t.unstable_now,Lt=t.unstable_getCurrentPriorityLevel,Ut=t.unstable_ImmediatePriority,Nt=t.unstable_UserBlockingPriority,_t=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=null,F=null;function de(c){if(F&&typeof F.onCommitFiberRoot=="function")try{F.onCommitFiberRoot(Qe,c,void 0,(c.current.flags&128)===128)}catch{}}var we=Math.clz32?Math.clz32:ct,We=Math.log,Le=Math.LN2;function ct(c){return c>>>=0,c===0?32:31-(We(c)/Le|0)|0}var Ot=64,zt=4194304;function Rt(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function kn(c,d){var v=c.pendingLanes;if(v===0)return 0;var x=0,N=c.suspendedLanes,$=c.pingedLanes,W=v&268435455;if(W!==0){var fe=W&~N;fe!==0?x=Rt(fe):($&=W,$!==0&&(x=Rt($)))}else W=v&~N,W!==0?x=Rt(W):$!==0&&(x=Rt($));if(x===0)return 0;if(d!==0&&d!==x&&(d&N)===0&&(N=x&-x,$=d&-d,N>=$||N===16&&($&4194240)!==0))return d;if((x&4)!==0&&(x|=v&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=x;0<d;)v=31-we(d),N=1<<v,x|=c[v],d&=~N;return x}function Jt(c,d){switch(c){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sn(c,d){for(var v=c.suspendedLanes,x=c.pingedLanes,N=c.expirationTimes,$=c.pendingLanes;0<$;){var W=31-we($),fe=1<<W,ye=N[W];ye===-1?((fe&v)===0||(fe&x)!==0)&&(N[W]=Jt(fe,d)):ye<=d&&(c.expiredLanes|=fe),$&=~fe}}function Qn(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function un(){var c=Ot;return Ot<<=1,(Ot&4194240)===0&&(Ot=64),c}function gr(c){for(var d=[],v=0;31>v;v++)d.push(c);return d}function Kt(c,d,v){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-we(d),c[d]=v}function wr(c,d){var v=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var x=c.eventTimes;for(c=c.expirationTimes;0<v;){var N=31-we(v),$=1<<N;d[N]=0,x[N]=-1,c[N]=-1,v&=~$}}function Hr(c,d){var v=c.entangledLanes|=d;for(c=c.entanglements;v;){var x=31-we(v),N=1<<x;N&d|c[x]&d&&(c[x]|=d),v&=~N}}var wn=0;function _o(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var An,Ks,Ps,on,yn,Kn=!1,Ur=[],Jn=null,Fn=null,es=null,ca=new Map,Vo=new Map,ms=[],Gs="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zo(c,d){switch(c){case"focusin":case"focusout":Jn=null;break;case"dragenter":case"dragleave":Fn=null;break;case"mouseover":case"mouseout":es=null;break;case"pointerover":case"pointerout":ca.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(d.pointerId)}}function Ys(c,d,v,x,N,$){return c===null||c.nativeEvent!==$?(c={blockedOn:d,domEventName:v,eventSystemFlags:x,nativeEvent:$,targetContainers:[N]},d!==null&&(d=Jd(d),d!==null&&Ks(d)),c):(c.eventSystemFlags|=x,d=c.targetContainers,N!==null&&d.indexOf(N)===-1&&d.push(N),c)}function uo(c,d,v,x,N){switch(d){case"focusin":return Jn=Ys(Jn,c,d,v,x,N),!0;case"dragenter":return Fn=Ys(Fn,c,d,v,x,N),!0;case"mouseover":return es=Ys(es,c,d,v,x,N),!0;case"pointerover":var $=N.pointerId;return ca.set($,Ys(ca.get($)||null,c,d,v,x,N)),!0;case"gotpointercapture":return $=N.pointerId,Vo.set($,Ys(Vo.get($)||null,c,d,v,x,N)),!0}return!1}function oe(c){var d=Kl(c.target);if(d!==null){var v=ot(d);if(v!==null){if(d=v.tag,d===13){if(d=ht(v),d!==null){c.blockedOn=d,yn(c.priority,function(){Ps(v)});return}}else if(d===3&&v.stateNode.current.memoizedState.isDehydrated){c.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}c.blockedOn=null}function Ie(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var v=tu(c.domEventName,c.eventSystemFlags,d[0],c.nativeEvent);if(v===null){v=c.nativeEvent;var x=new v.constructor(v.type,v);Ft=x,v.target.dispatchEvent(x),Ft=null}else return d=Jd(v),d!==null&&Ks(d),c.blockedOn=v,!1;d.shift()}return!0}function lt(c,d,v){Ie(c)&&v.delete(d)}function en(){Kn=!1,Jn!==null&&Ie(Jn)&&(Jn=null),Fn!==null&&Ie(Fn)&&(Fn=null),es!==null&&Ie(es)&&(es=null),ca.forEach(lt),Vo.forEach(lt)}function nn(c,d){c.blockedOn===d&&(c.blockedOn=null,Kn||(Kn=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,en)))}function Zn(c){function d(N){return nn(N,c)}if(0<Ur.length){nn(Ur[0],c);for(var v=1;v<Ur.length;v++){var x=Ur[v];x.blockedOn===c&&(x.blockedOn=null)}}for(Jn!==null&&nn(Jn,c),Fn!==null&&nn(Fn,c),es!==null&&nn(es,c),ca.forEach(d),Vo.forEach(d),v=0;v<ms.length;v++)x=ms[v],x.blockedOn===c&&(x.blockedOn=null);for(;0<ms.length&&(v=ms[0],v.blockedOn===null);)oe(v),v.blockedOn===null&&ms.shift()}var Tn=A.ReactCurrentBatchConfig,Pn=!0;function dn(c,d,v,x){var N=wn,$=Tn.transition;Tn.transition=null;try{wn=1,ua(c,d,v,x)}finally{wn=N,Tn.transition=$}}function or(c,d,v,x){var N=wn,$=Tn.transition;Tn.transition=null;try{wn=4,ua(c,d,v,x)}finally{wn=N,Tn.transition=$}}function ua(c,d,v,x){if(Pn){var N=tu(c,d,v,x);if(N===null)F2(c,d,x,Or,v),Zo(c,x);else if(uo(N,c,d,v,x))x.stopPropagation();else if(Zo(c,x),d&4&&-1<Gs.indexOf(c)){for(;N!==null;){var $=Jd(N);if($!==null&&An($),$=tu(c,d,v,x),$===null&&F2(c,d,x,Or,v),$===N)break;N=$}N!==null&&x.stopPropagation()}else F2(c,d,x,null,v)}}var Or=null;function tu(c,d,v,x){if(Or=null,c=Pt(x),c=Kl(c),c!==null)if(d=ot(c),d===null)c=null;else if(v=d.tag,v===13){if(c=ht(d),c!==null)return c;c=null}else if(v===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null);return Or=c,null}function gs(c){switch(c){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Lt()){case Ut:return 1;case Nt:return 4;case _t:case Me:return 16;case Ze:return 536870912;default:return 16}default:return 16}}var fo=null,Bl=null,nu=null;function vf(){if(nu)return nu;var c,d=Bl,v=d.length,x,N="value"in fo?fo.value:fo.textContent,$=N.length;for(c=0;c<v&&d[c]===N[c];c++);var W=v-c;for(x=1;x<=W&&d[v-x]===N[$-x];x++);return nu=N.slice(c,1<x?1-x:void 0)}function Li(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function ru(){return!0}function wf(){return!1}function vs(c){function d(v,x,N,$,W){this._reactName=v,this._targetInst=N,this.type=x,this.nativeEvent=$,this.target=W,this.currentTarget=null;for(var fe in c)c.hasOwnProperty(fe)&&(v=c[fe],this[fe]=v?v($):$[fe]);return this.isDefaultPrevented=($.defaultPrevented!=null?$.defaultPrevented:$.returnValue===!1)?ru:wf,this.isPropagationStopped=wf,this}return K(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ru)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ru)},persist:function(){},isPersistent:ru}),d}var ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=vs(ho),Ti=K({},ho,{view:0,detail:0}),yf=vs(Ti),su,Ul,Di,Wl=K({},Ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Di&&(Di&&c.type==="mousemove"?(su=c.screenX-Di.screenX,Ul=c.screenY-Di.screenY):Ul=su=0,Di=c),su)},movementY:function(c){return"movementY"in c?c.movementY:Ul}}),Zd=vs(Wl),bf=K({},Wl,{dataTransfer:0}),ve=vs(bf),mt=K({},Ti,{relatedTarget:0}),tn=vs(mt),pn=K({},ho,{animationName:0,elapsedTime:0,pseudoElement:0}),rn=vs(pn),Nn=K({},ho,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Wr=vs(Nn),On=K({},ho,{data:0}),sr=vs(On),ir={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ia={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dn(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=xf[c])?!!d[c]:!1}function ts(){return Dn}var ws=K({},Ti,{key:function(c){if(c.key){var d=ir[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=Li(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Ia[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(c){return c.type==="keypress"?Li(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Li(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),N2=vs(ws),zd=K({},Wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),au=vs(zd),kf=K({},Ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Fa=vs(kf),Sf=K({},ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ef=vs(Sf),X$=K({},Wl,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),Q$=vs(X$),J$=[9,13,27,32],M2=u&&"CompositionEvent"in window,Bd=null;u&&"documentMode"in document&&(Bd=document.documentMode);var eT=u&&"TextEvent"in window&&!Bd,tb=u&&(!M2||Bd&&8<Bd&&11>=Bd),nb=" ",rb=!1;function sb(c,d){switch(c){case"keyup":return J$.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ab(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ou=!1;function tT(c,d){switch(c){case"compositionend":return ab(d);case"keypress":return d.which!==32?null:(rb=!0,nb);case"textInput":return c=d.data,c===nb&&rb?null:c;default:return null}}function nT(c,d){if(ou)return c==="compositionend"||!M2&&sb(c,d)?(c=vf(),nu=Bl=fo=null,ou=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return tb&&d.locale!=="ko"?null:d.data;default:return null}}var rT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ob(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!rT[c.type]:d==="textarea"}function ib(c,d,v,x){Xe(x),d=Mf(d,"onChange"),0<d.length&&(v=new $i("onChange","change",null,v,x),c.push({event:v,listeners:d}))}var Ud=null,Wd=null;function sT(c){Cb(c,0)}function Cf(c){var d=du(c);if($e(d))return c}function aT(c,d){if(c==="change")return d}var lb=!1;if(u){var R2;if(u){var P2="oninput"in document;if(!P2){var cb=document.createElement("div");cb.setAttribute("oninput","return;"),P2=typeof cb.oninput=="function"}R2=P2}else R2=!1;lb=R2&&(!document.documentMode||9<document.documentMode)}function ub(){Ud&&(Ud.detachEvent("onpropertychange",db),Wd=Ud=null)}function db(c){if(c.propertyName==="value"&&Cf(Wd)){var d=[];ib(d,Wd,c,Pt(c)),an(sT,d)}}function oT(c,d,v){c==="focusin"?(ub(),Ud=d,Wd=v,Ud.attachEvent("onpropertychange",db)):c==="focusout"&&ub()}function iT(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Cf(Wd)}function lT(c,d){if(c==="click")return Cf(d)}function cT(c,d){if(c==="input"||c==="change")return Cf(d)}function uT(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var _a=typeof Object.is=="function"?Object.is:uT;function Kd(c,d){if(_a(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var v=Object.keys(c),x=Object.keys(d);if(v.length!==x.length)return!1;for(x=0;x<v.length;x++){var N=v[x];if(!f.call(d,N)||!_a(c[N],d[N]))return!1}return!0}function fb(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function hb(c,d){var v=fb(c);c=0;for(var x;v;){if(v.nodeType===3){if(x=c+v.textContent.length,c<=d&&x>=d)return{node:v,offset:d-c};c=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=fb(v)}}function pb(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?pb(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function mb(){for(var c=window,d=ie();d instanceof c.HTMLIFrameElement;){try{var v=typeof d.contentWindow.location.href=="string"}catch{v=!1}if(v)c=d.contentWindow;else break;d=ie(c.document)}return d}function L2(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}function dT(c){var d=mb(),v=c.focusedElem,x=c.selectionRange;if(d!==v&&v&&v.ownerDocument&&pb(v.ownerDocument.documentElement,v)){if(x!==null&&L2(v)){if(d=x.start,c=x.end,c===void 0&&(c=d),"selectionStart"in v)v.selectionStart=d,v.selectionEnd=Math.min(c,v.value.length);else if(c=(d=v.ownerDocument||document)&&d.defaultView||window,c.getSelection){c=c.getSelection();var N=v.textContent.length,$=Math.min(x.start,N);x=x.end===void 0?$:Math.min(x.end,N),!c.extend&&$>x&&(N=x,x=$,$=N),N=hb(v,$);var W=hb(v,x);N&&W&&(c.rangeCount!==1||c.anchorNode!==N.node||c.anchorOffset!==N.offset||c.focusNode!==W.node||c.focusOffset!==W.offset)&&(d=d.createRange(),d.setStart(N.node,N.offset),c.removeAllRanges(),$>x?(c.addRange(d),c.extend(W.node,W.offset)):(d.setEnd(W.node,W.offset),c.addRange(d)))}}for(d=[],c=v;c=c.parentNode;)c.nodeType===1&&d.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<d.length;v++)c=d[v],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var fT=u&&"documentMode"in document&&11>=document.documentMode,iu=null,$2=null,Gd=null,T2=!1;function gb(c,d,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;T2||iu==null||iu!==ie(x)||(x=iu,"selectionStart"in x&&L2(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Gd&&Kd(Gd,x)||(Gd=x,x=Mf($2,"onSelect"),0<x.length&&(d=new $i("onSelect","select",null,d,v),c.push({event:d,listeners:x}),d.target=iu)))}function jf(c,d){var v={};return v[c.toLowerCase()]=d.toLowerCase(),v["Webkit"+c]="webkit"+d,v["Moz"+c]="moz"+d,v}var lu={animationend:jf("Animation","AnimationEnd"),animationiteration:jf("Animation","AnimationIteration"),animationstart:jf("Animation","AnimationStart"),transitionend:jf("Transition","TransitionEnd")},D2={},vb={};u&&(vb=document.createElement("div").style,"AnimationEvent"in window||(delete lu.animationend.animation,delete lu.animationiteration.animation,delete lu.animationstart.animation),"TransitionEvent"in window||delete lu.transitionend.transition);function Af(c){if(D2[c])return D2[c];if(!lu[c])return c;var d=lu[c],v;for(v in d)if(d.hasOwnProperty(v)&&v in vb)return D2[c]=d[v];return c}var wb=Af("animationend"),yb=Af("animationiteration"),bb=Af("animationstart"),xb=Af("transitionend"),kb=new Map,Sb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Hi(c,d){kb.set(c,d),i(d,[c])}for(var H2=0;H2<Sb.length;H2++){var O2=Sb[H2],hT=O2.toLowerCase(),pT=O2[0].toUpperCase()+O2.slice(1);Hi(hT,"on"+pT)}Hi(wb,"onAnimationEnd"),Hi(yb,"onAnimationIteration"),Hi(bb,"onAnimationStart"),Hi("dblclick","onDoubleClick"),Hi("focusin","onFocus"),Hi("focusout","onBlur"),Hi(xb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yd));function Eb(c,d,v){var x=c.type||"unknown-event";c.currentTarget=v,kt(x,d,void 0,c),c.currentTarget=null}function Cb(c,d){d=(d&4)!==0;for(var v=0;v<c.length;v++){var x=c[v],N=x.event;x=x.listeners;e:{var $=void 0;if(d)for(var W=x.length-1;0<=W;W--){var fe=x[W],ye=fe.instance,Ue=fe.currentTarget;if(fe=fe.listener,ye!==$&&N.isPropagationStopped())break e;Eb(N,fe,Ue),$=ye}else for(W=0;W<x.length;W++){if(fe=x[W],ye=fe.instance,Ue=fe.currentTarget,fe=fe.listener,ye!==$&&N.isPropagationStopped())break e;Eb(N,fe,Ue),$=ye}}}if(Ve)throw c=_e,Ve=!1,_e=null,c}function er(c,d){var v=d[U2];v===void 0&&(v=d[U2]=new Set);var x=c+"__bubble";v.has(x)||(jb(d,c,2,!1),v.add(x))}function I2(c,d,v){var x=0;d&&(x|=4),jb(v,c,x,d)}var Nf="_reactListening"+Math.random().toString(36).slice(2);function qd(c){if(!c[Nf]){c[Nf]=!0,r.forEach(function(v){v!=="selectionchange"&&(mT.has(v)||I2(v,!1,c),I2(v,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[Nf]||(d[Nf]=!0,I2("selectionchange",!1,d))}}function jb(c,d,v,x){switch(gs(d)){case 1:var N=dn;break;case 4:N=or;break;default:N=ua}v=N.bind(null,d,v,c),N=void 0,!Rn||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(N=!0),x?N!==void 0?c.addEventListener(d,v,{capture:!0,passive:N}):c.addEventListener(d,v,!0):N!==void 0?c.addEventListener(d,v,{passive:N}):c.addEventListener(d,v,!1)}function F2(c,d,v,x,N){var $=x;if((d&1)===0&&(d&2)===0&&x!==null)e:for(;;){if(x===null)return;var W=x.tag;if(W===3||W===4){var fe=x.stateNode.containerInfo;if(fe===N||fe.nodeType===8&&fe.parentNode===N)break;if(W===4)for(W=x.return;W!==null;){var ye=W.tag;if((ye===3||ye===4)&&(ye=W.stateNode.containerInfo,ye===N||ye.nodeType===8&&ye.parentNode===N))return;W=W.return}for(;fe!==null;){if(W=Kl(fe),W===null)return;if(ye=W.tag,ye===5||ye===6){x=$=W;continue e}fe=fe.parentNode}}x=x.return}an(function(){var Ue=$,dt=Pt(v),gt=[];e:{var ut=kb.get(c);if(ut!==void 0){var $t=$i,Ht=c;switch(c){case"keypress":if(Li(v)===0)break e;case"keydown":case"keyup":$t=N2;break;case"focusin":Ht="focus",$t=tn;break;case"focusout":Ht="blur",$t=tn;break;case"beforeblur":case"afterblur":$t=tn;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$t=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$t=ve;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$t=Fa;break;case wb:case yb:case bb:$t=rn;break;case xb:$t=Ef;break;case"scroll":$t=yf;break;case"wheel":$t=Q$;break;case"copy":case"cut":case"paste":$t=Wr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$t=au}var It=(d&4)!==0,vr=!It&&c==="scroll",He=It?ut!==null?ut+"Capture":null:ut;It=[];for(var Ce=Ue,Fe;Ce!==null;){Fe=Ce;var St=Fe.stateNode;if(Fe.tag===5&&St!==null&&(Fe=St,He!==null&&(St=Wt(Ce,He),St!=null&&It.push(Xd(Ce,St,Fe)))),vr)break;Ce=Ce.return}0<It.length&&(ut=new $t(ut,Ht,null,v,dt),gt.push({event:ut,listeners:It}))}}if((d&7)===0){e:{if(ut=c==="mouseover"||c==="pointerover",$t=c==="mouseout"||c==="pointerout",ut&&v!==Ft&&(Ht=v.relatedTarget||v.fromElement)&&(Kl(Ht)||Ht[zo]))break e;if(($t||ut)&&(ut=dt.window===dt?dt:(ut=dt.ownerDocument)?ut.defaultView||ut.parentWindow:window,$t?(Ht=v.relatedTarget||v.toElement,$t=Ue,Ht=Ht?Kl(Ht):null,Ht!==null&&(vr=ot(Ht),Ht!==vr||Ht.tag!==5&&Ht.tag!==6)&&(Ht=null)):($t=null,Ht=Ue),$t!==Ht)){if(It=Zd,St="onMouseLeave",He="onMouseEnter",Ce="mouse",(c==="pointerout"||c==="pointerover")&&(It=au,St="onPointerLeave",He="onPointerEnter",Ce="pointer"),vr=$t==null?ut:du($t),Fe=Ht==null?ut:du(Ht),ut=new It(St,Ce+"leave",$t,v,dt),ut.target=vr,ut.relatedTarget=Fe,St=null,Kl(dt)===Ue&&(It=new It(He,Ce+"enter",Ht,v,dt),It.target=Fe,It.relatedTarget=vr,St=It),vr=St,$t&&Ht)t:{for(It=$t,He=Ht,Ce=0,Fe=It;Fe;Fe=cu(Fe))Ce++;for(Fe=0,St=He;St;St=cu(St))Fe++;for(;0<Ce-Fe;)It=cu(It),Ce--;for(;0<Fe-Ce;)He=cu(He),Fe--;for(;Ce--;){if(It===He||He!==null&&It===He.alternate)break t;It=cu(It),He=cu(He)}It=null}else It=null;$t!==null&&Ab(gt,ut,$t,It,!1),Ht!==null&&vr!==null&&Ab(gt,vr,Ht,It,!0)}}e:{if(ut=Ue?du(Ue):window,$t=ut.nodeName&&ut.nodeName.toLowerCase(),$t==="select"||$t==="input"&&ut.type==="file")var Vt=aT;else if(ob(ut))if(lb)Vt=cT;else{Vt=iT;var Xt=oT}else($t=ut.nodeName)&&$t.toLowerCase()==="input"&&(ut.type==="checkbox"||ut.type==="radio")&&(Vt=lT);if(Vt&&(Vt=Vt(c,Ue))){ib(gt,Vt,v,dt);break e}Xt&&Xt(c,ut,Ue),c==="focusout"&&(Xt=ut._wrapperState)&&Xt.controlled&&ut.type==="number"&&De(ut,"number",ut.value)}switch(Xt=Ue?du(Ue):window,c){case"focusin":(ob(Xt)||Xt.contentEditable==="true")&&(iu=Xt,$2=Ue,Gd=null);break;case"focusout":Gd=$2=iu=null;break;case"mousedown":T2=!0;break;case"contextmenu":case"mouseup":case"dragend":T2=!1,gb(gt,v,dt);break;case"selectionchange":if(fT)break;case"keydown":case"keyup":gb(gt,v,dt)}var Qt;if(M2)e:{switch(c){case"compositionstart":var sn="onCompositionStart";break e;case"compositionend":sn="onCompositionEnd";break e;case"compositionupdate":sn="onCompositionUpdate";break e}sn=void 0}else ou?sb(c,v)&&(sn="onCompositionEnd"):c==="keydown"&&v.keyCode===229&&(sn="onCompositionStart");sn&&(tb&&v.locale!=="ko"&&(ou||sn!=="onCompositionStart"?sn==="onCompositionEnd"&&ou&&(Qt=vf()):(fo=dt,Bl="value"in fo?fo.value:fo.textContent,ou=!0)),Xt=Mf(Ue,sn),0<Xt.length&&(sn=new sr(sn,c,null,v,dt),gt.push({event:sn,listeners:Xt}),Qt?sn.data=Qt:(Qt=ab(v),Qt!==null&&(sn.data=Qt)))),(Qt=eT?tT(c,v):nT(c,v))&&(Ue=Mf(Ue,"onBeforeInput"),0<Ue.length&&(dt=new sr("onBeforeInput","beforeinput",null,v,dt),gt.push({event:dt,listeners:Ue}),dt.data=Qt))}Cb(gt,d)})}function Xd(c,d,v){return{instance:c,listener:d,currentTarget:v}}function Mf(c,d){for(var v=d+"Capture",x=[];c!==null;){var N=c,$=N.stateNode;N.tag===5&&$!==null&&(N=$,$=Wt(c,v),$!=null&&x.unshift(Xd(c,$,N)),$=Wt(c,d),$!=null&&x.push(Xd(c,$,N))),c=c.return}return x}function cu(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function Ab(c,d,v,x,N){for(var $=d._reactName,W=[];v!==null&&v!==x;){var fe=v,ye=fe.alternate,Ue=fe.stateNode;if(ye!==null&&ye===x)break;fe.tag===5&&Ue!==null&&(fe=Ue,N?(ye=Wt(v,$),ye!=null&&W.unshift(Xd(v,ye,fe))):N||(ye=Wt(v,$),ye!=null&&W.push(Xd(v,ye,fe)))),v=v.return}W.length!==0&&c.push({event:d,listeners:W})}var gT=/\r\n?/g,vT=/\u0000|\uFFFD/g;function Nb(c){return(typeof c=="string"?c:""+c).replace(gT,`
|
|
38
|
+
`).replace(vT,"")}function Rf(c,d,v){if(d=Nb(d),Nb(c)!==d&&v)throw Error(n(425))}function Pf(){}var _2=null,V2=null;function Z2(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var z2=typeof setTimeout=="function"?setTimeout:void 0,wT=typeof clearTimeout=="function"?clearTimeout:void 0,Mb=typeof Promise=="function"?Promise:void 0,yT=typeof queueMicrotask=="function"?queueMicrotask:typeof Mb<"u"?function(c){return Mb.resolve(null).then(c).catch(bT)}:z2;function bT(c){setTimeout(function(){throw c})}function B2(c,d){var v=d,x=0;do{var N=v.nextSibling;if(c.removeChild(v),N&&N.nodeType===8)if(v=N.data,v==="/$"){if(x===0){c.removeChild(N),Zn(d);return}x--}else v!=="$"&&v!=="$?"&&v!=="$!"||x++;v=N}while(v);Zn(d)}function Oi(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return c}function Rb(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var v=c.data;if(v==="$"||v==="$!"||v==="$?"){if(d===0)return c;d--}else v==="/$"&&d++}c=c.previousSibling}return null}var uu=Math.random().toString(36).slice(2),po="__reactFiber$"+uu,Qd="__reactProps$"+uu,zo="__reactContainer$"+uu,U2="__reactEvents$"+uu,xT="__reactListeners$"+uu,kT="__reactHandles$"+uu;function Kl(c){var d=c[po];if(d)return d;for(var v=c.parentNode;v;){if(d=v[zo]||v[po]){if(v=d.alternate,d.child!==null||v!==null&&v.child!==null)for(c=Rb(c);c!==null;){if(v=c[po])return v;c=Rb(c)}return d}c=v,v=c.parentNode}return null}function Jd(c){return c=c[po]||c[zo],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function du(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function Lf(c){return c[Qd]||null}var W2=[],fu=-1;function Ii(c){return{current:c}}function tr(c){0>fu||(c.current=W2[fu],W2[fu]=null,fu--)}function Yn(c,d){fu++,W2[fu]=c.current,c.current=d}var Fi={},ns=Ii(Fi),Ls=Ii(!1),Gl=Fi;function hu(c,d){var v=c.type.contextTypes;if(!v)return Fi;var x=c.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===d)return x.__reactInternalMemoizedMaskedChildContext;var N={},$;for($ in v)N[$]=d[$];return x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=N),N}function $s(c){return c=c.childContextTypes,c!=null}function $f(){tr(Ls),tr(ns)}function Pb(c,d,v){if(ns.current!==Fi)throw Error(n(168));Yn(ns,d),Yn(Ls,v)}function Lb(c,d,v){var x=c.stateNode;if(d=d.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var N in x)if(!(N in d))throw Error(n(108,ge(c)||"Unknown",N));return K({},v,x)}function Tf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Fi,Gl=ns.current,Yn(ns,c),Yn(Ls,Ls.current),!0}function $b(c,d,v){var x=c.stateNode;if(!x)throw Error(n(169));v?(c=Lb(c,d,Gl),x.__reactInternalMemoizedMergedChildContext=c,tr(Ls),tr(ns),Yn(ns,c)):tr(Ls),Yn(Ls,v)}var Bo=null,Df=!1,K2=!1;function Tb(c){Bo===null?Bo=[c]:Bo.push(c)}function ST(c){Df=!0,Tb(c)}function _i(){if(!K2&&Bo!==null){K2=!0;var c=0,d=wn;try{var v=Bo;for(wn=1;c<v.length;c++){var x=v[c];do x=x(!0);while(x!==null)}Bo=null,Df=!1}catch(N){throw Bo!==null&&(Bo=Bo.slice(c+1)),be(Ut,_i),N}finally{wn=d,K2=!1}}return null}var pu=[],mu=0,Hf=null,Of=0,da=[],fa=0,Yl=null,Uo=1,Wo="";function ql(c,d){pu[mu++]=Of,pu[mu++]=Hf,Hf=c,Of=d}function Db(c,d,v){da[fa++]=Uo,da[fa++]=Wo,da[fa++]=Yl,Yl=c;var x=Uo;c=Wo;var N=32-we(x)-1;x&=~(1<<N),v+=1;var $=32-we(d)+N;if(30<$){var W=N-N%5;$=(x&(1<<W)-1).toString(32),x>>=W,N-=W,Uo=1<<32-we(d)+N|v<<N|x,Wo=$+c}else Uo=1<<$|v<<N|x,Wo=c}function G2(c){c.return!==null&&(ql(c,1),Db(c,1,0))}function Y2(c){for(;c===Hf;)Hf=pu[--mu],pu[mu]=null,Of=pu[--mu],pu[mu]=null;for(;c===Yl;)Yl=da[--fa],da[fa]=null,Wo=da[--fa],da[fa]=null,Uo=da[--fa],da[fa]=null}var qs=null,Xs=null,ar=!1,Va=null;function Hb(c,d){var v=ga(5,null,null,0);v.elementType="DELETED",v.stateNode=d,v.return=c,d=c.deletions,d===null?(c.deletions=[v],c.flags|=16):d.push(v)}function Ob(c,d){switch(c.tag){case 5:var v=c.type;return d=d.nodeType!==1||v.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,qs=c,Xs=Oi(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,qs=c,Xs=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(v=Yl!==null?{id:Uo,overflow:Wo}:null,c.memoizedState={dehydrated:d,treeContext:v,retryLane:1073741824},v=ga(18,null,null,0),v.stateNode=d,v.return=c,c.child=v,qs=c,Xs=null,!0):!1;default:return!1}}function q2(c){return(c.mode&1)!==0&&(c.flags&128)===0}function X2(c){if(ar){var d=Xs;if(d){var v=d;if(!Ob(c,d)){if(q2(c))throw Error(n(418));d=Oi(v.nextSibling);var x=qs;d&&Ob(c,d)?Hb(x,v):(c.flags=c.flags&-4097|2,ar=!1,qs=c)}}else{if(q2(c))throw Error(n(418));c.flags=c.flags&-4097|2,ar=!1,qs=c}}}function Ib(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;qs=c}function If(c){if(c!==qs)return!1;if(!ar)return Ib(c),ar=!0,!1;var d;if((d=c.tag!==3)&&!(d=c.tag!==5)&&(d=c.type,d=d!=="head"&&d!=="body"&&!Z2(c.type,c.memoizedProps)),d&&(d=Xs)){if(q2(c))throw Fb(),Error(n(418));for(;d;)Hb(c,d),d=Oi(d.nextSibling)}if(Ib(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));e:{for(c=c.nextSibling,d=0;c;){if(c.nodeType===8){var v=c.data;if(v==="/$"){if(d===0){Xs=Oi(c.nextSibling);break e}d--}else v!=="$"&&v!=="$!"&&v!=="$?"||d++}c=c.nextSibling}Xs=null}}else Xs=qs?Oi(c.stateNode.nextSibling):null;return!0}function Fb(){for(var c=Xs;c;)c=Oi(c.nextSibling)}function gu(){Xs=qs=null,ar=!1}function Q2(c){Va===null?Va=[c]:Va.push(c)}var ET=A.ReactCurrentBatchConfig;function e0(c,d,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var x=v.stateNode}if(!x)throw Error(n(147,c));var N=x,$=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===$?d.ref:(d=function(W){var fe=N.refs;W===null?delete fe[$]:fe[$]=W},d._stringRef=$,d)}if(typeof c!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,c))}return c}function Ff(c,d){throw c=Object.prototype.toString.call(d),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function _b(c){var d=c._init;return d(c._payload)}function Vb(c){function d(He,Ce){if(c){var Fe=He.deletions;Fe===null?(He.deletions=[Ce],He.flags|=16):Fe.push(Ce)}}function v(He,Ce){if(!c)return null;for(;Ce!==null;)d(He,Ce),Ce=Ce.sibling;return null}function x(He,Ce){for(He=new Map;Ce!==null;)Ce.key!==null?He.set(Ce.key,Ce):He.set(Ce.index,Ce),Ce=Ce.sibling;return He}function N(He,Ce){return He=Gi(He,Ce),He.index=0,He.sibling=null,He}function $(He,Ce,Fe){return He.index=Fe,c?(Fe=He.alternate,Fe!==null?(Fe=Fe.index,Fe<Ce?(He.flags|=2,Ce):Fe):(He.flags|=2,Ce)):(He.flags|=1048576,Ce)}function W(He){return c&&He.alternate===null&&(He.flags|=2),He}function fe(He,Ce,Fe,St){return Ce===null||Ce.tag!==6?(Ce=zg(Fe,He.mode,St),Ce.return=He,Ce):(Ce=N(Ce,Fe),Ce.return=He,Ce)}function ye(He,Ce,Fe,St){var Vt=Fe.type;return Vt===M?dt(He,Ce,Fe.props.children,St,Fe.key):Ce!==null&&(Ce.elementType===Vt||typeof Vt=="object"&&Vt!==null&&Vt.$$typeof===G&&_b(Vt)===Ce.type)?(St=N(Ce,Fe.props),St.ref=e0(He,Ce,Fe),St.return=He,St):(St=ch(Fe.type,Fe.key,Fe.props,null,He.mode,St),St.ref=e0(He,Ce,Fe),St.return=He,St)}function Ue(He,Ce,Fe,St){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==Fe.containerInfo||Ce.stateNode.implementation!==Fe.implementation?(Ce=Bg(Fe,He.mode,St),Ce.return=He,Ce):(Ce=N(Ce,Fe.children||[]),Ce.return=He,Ce)}function dt(He,Ce,Fe,St,Vt){return Ce===null||Ce.tag!==7?(Ce=sc(Fe,He.mode,St,Vt),Ce.return=He,Ce):(Ce=N(Ce,Fe),Ce.return=He,Ce)}function gt(He,Ce,Fe){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return Ce=zg(""+Ce,He.mode,Fe),Ce.return=He,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case L:return Fe=ch(Ce.type,Ce.key,Ce.props,null,He.mode,Fe),Fe.ref=e0(He,null,Ce),Fe.return=He,Fe;case T:return Ce=Bg(Ce,He.mode,Fe),Ce.return=He,Ce;case G:var St=Ce._init;return gt(He,St(Ce._payload),Fe)}if(Se(Ce)||I(Ce))return Ce=sc(Ce,He.mode,Fe,null),Ce.return=He,Ce;Ff(He,Ce)}return null}function ut(He,Ce,Fe,St){var Vt=Ce!==null?Ce.key:null;if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return Vt!==null?null:fe(He,Ce,""+Fe,St);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case L:return Fe.key===Vt?ye(He,Ce,Fe,St):null;case T:return Fe.key===Vt?Ue(He,Ce,Fe,St):null;case G:return Vt=Fe._init,ut(He,Ce,Vt(Fe._payload),St)}if(Se(Fe)||I(Fe))return Vt!==null?null:dt(He,Ce,Fe,St,null);Ff(He,Fe)}return null}function $t(He,Ce,Fe,St,Vt){if(typeof St=="string"&&St!==""||typeof St=="number")return He=He.get(Fe)||null,fe(Ce,He,""+St,Vt);if(typeof St=="object"&&St!==null){switch(St.$$typeof){case L:return He=He.get(St.key===null?Fe:St.key)||null,ye(Ce,He,St,Vt);case T:return He=He.get(St.key===null?Fe:St.key)||null,Ue(Ce,He,St,Vt);case G:var Xt=St._init;return $t(He,Ce,Fe,Xt(St._payload),Vt)}if(Se(St)||I(St))return He=He.get(Fe)||null,dt(Ce,He,St,Vt,null);Ff(Ce,St)}return null}function Ht(He,Ce,Fe,St){for(var Vt=null,Xt=null,Qt=Ce,sn=Ce=0,_r=null;Qt!==null&&sn<Fe.length;sn++){Qt.index>sn?(_r=Qt,Qt=null):_r=Qt.sibling;var In=ut(He,Qt,Fe[sn],St);if(In===null){Qt===null&&(Qt=_r);break}c&&Qt&&In.alternate===null&&d(He,Qt),Ce=$(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In,Qt=_r}if(sn===Fe.length)return v(He,Qt),ar&&ql(He,sn),Vt;if(Qt===null){for(;sn<Fe.length;sn++)Qt=gt(He,Fe[sn],St),Qt!==null&&(Ce=$(Qt,Ce,sn),Xt===null?Vt=Qt:Xt.sibling=Qt,Xt=Qt);return ar&&ql(He,sn),Vt}for(Qt=x(He,Qt);sn<Fe.length;sn++)_r=$t(Qt,He,sn,Fe[sn],St),_r!==null&&(c&&_r.alternate!==null&&Qt.delete(_r.key===null?sn:_r.key),Ce=$(_r,Ce,sn),Xt===null?Vt=_r:Xt.sibling=_r,Xt=_r);return c&&Qt.forEach(function(Yi){return d(He,Yi)}),ar&&ql(He,sn),Vt}function It(He,Ce,Fe,St){var Vt=I(Fe);if(typeof Vt!="function")throw Error(n(150));if(Fe=Vt.call(Fe),Fe==null)throw Error(n(151));for(var Xt=Vt=null,Qt=Ce,sn=Ce=0,_r=null,In=Fe.next();Qt!==null&&!In.done;sn++,In=Fe.next()){Qt.index>sn?(_r=Qt,Qt=null):_r=Qt.sibling;var Yi=ut(He,Qt,In.value,St);if(Yi===null){Qt===null&&(Qt=_r);break}c&&Qt&&Yi.alternate===null&&d(He,Qt),Ce=$(Yi,Ce,sn),Xt===null?Vt=Yi:Xt.sibling=Yi,Xt=Yi,Qt=_r}if(In.done)return v(He,Qt),ar&&ql(He,sn),Vt;if(Qt===null){for(;!In.done;sn++,In=Fe.next())In=gt(He,In.value,St),In!==null&&(Ce=$(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In);return ar&&ql(He,sn),Vt}for(Qt=x(He,Qt);!In.done;sn++,In=Fe.next())In=$t(Qt,He,sn,In.value,St),In!==null&&(c&&In.alternate!==null&&Qt.delete(In.key===null?sn:In.key),Ce=$(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In);return c&&Qt.forEach(function(rD){return d(He,rD)}),ar&&ql(He,sn),Vt}function vr(He,Ce,Fe,St){if(typeof Fe=="object"&&Fe!==null&&Fe.type===M&&Fe.key===null&&(Fe=Fe.props.children),typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case L:e:{for(var Vt=Fe.key,Xt=Ce;Xt!==null;){if(Xt.key===Vt){if(Vt=Fe.type,Vt===M){if(Xt.tag===7){v(He,Xt.sibling),Ce=N(Xt,Fe.props.children),Ce.return=He,He=Ce;break e}}else if(Xt.elementType===Vt||typeof Vt=="object"&&Vt!==null&&Vt.$$typeof===G&&_b(Vt)===Xt.type){v(He,Xt.sibling),Ce=N(Xt,Fe.props),Ce.ref=e0(He,Xt,Fe),Ce.return=He,He=Ce;break e}v(He,Xt);break}else d(He,Xt);Xt=Xt.sibling}Fe.type===M?(Ce=sc(Fe.props.children,He.mode,St,Fe.key),Ce.return=He,He=Ce):(St=ch(Fe.type,Fe.key,Fe.props,null,He.mode,St),St.ref=e0(He,Ce,Fe),St.return=He,He=St)}return W(He);case T:e:{for(Xt=Fe.key;Ce!==null;){if(Ce.key===Xt)if(Ce.tag===4&&Ce.stateNode.containerInfo===Fe.containerInfo&&Ce.stateNode.implementation===Fe.implementation){v(He,Ce.sibling),Ce=N(Ce,Fe.children||[]),Ce.return=He,He=Ce;break e}else{v(He,Ce);break}else d(He,Ce);Ce=Ce.sibling}Ce=Bg(Fe,He.mode,St),Ce.return=He,He=Ce}return W(He);case G:return Xt=Fe._init,vr(He,Ce,Xt(Fe._payload),St)}if(Se(Fe))return Ht(He,Ce,Fe,St);if(I(Fe))return It(He,Ce,Fe,St);Ff(He,Fe)}return typeof Fe=="string"&&Fe!==""||typeof Fe=="number"?(Fe=""+Fe,Ce!==null&&Ce.tag===6?(v(He,Ce.sibling),Ce=N(Ce,Fe),Ce.return=He,He=Ce):(v(He,Ce),Ce=zg(Fe,He.mode,St),Ce.return=He,He=Ce),W(He)):v(He,Ce)}return vr}var vu=Vb(!0),Zb=Vb(!1),_f=Ii(null),Vf=null,wu=null,J2=null;function eg(){J2=wu=Vf=null}function tg(c){var d=_f.current;tr(_f),c._currentValue=d}function ng(c,d,v){for(;c!==null;){var x=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,x!==null&&(x.childLanes|=d)):x!==null&&(x.childLanes&d)!==d&&(x.childLanes|=d),c===v)break;c=c.return}}function yu(c,d){Vf=c,J2=wu=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&d)!==0&&(Ts=!0),c.firstContext=null)}function ha(c){var d=c._currentValue;if(J2!==c)if(c={context:c,memoizedValue:d,next:null},wu===null){if(Vf===null)throw Error(n(308));wu=c,Vf.dependencies={lanes:0,firstContext:c}}else wu=wu.next=c;return d}var Xl=null;function rg(c){Xl===null?Xl=[c]:Xl.push(c)}function zb(c,d,v,x){var N=d.interleaved;return N===null?(v.next=v,rg(d)):(v.next=N.next,N.next=v),d.interleaved=v,Ko(c,x)}function Ko(c,d){c.lanes|=d;var v=c.alternate;for(v!==null&&(v.lanes|=d),v=c,c=c.return;c!==null;)c.childLanes|=d,v=c.alternate,v!==null&&(v.childLanes|=d),v=c,c=c.return;return v.tag===3?v.stateNode:null}var Vi=!1;function sg(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bb(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Go(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function Zi(c,d,v){var x=c.updateQueue;if(x===null)return null;if(x=x.shared,(Hn&2)!==0){var N=x.pending;return N===null?d.next=d:(d.next=N.next,N.next=d),x.pending=d,Ko(c,v)}return N=x.interleaved,N===null?(d.next=d,rg(x)):(d.next=N.next,N.next=d),x.interleaved=d,Ko(c,v)}function Zf(c,d,v){if(d=d.updateQueue,d!==null&&(d=d.shared,(v&4194240)!==0)){var x=d.lanes;x&=c.pendingLanes,v|=x,d.lanes=v,Hr(c,v)}}function Ub(c,d){var v=c.updateQueue,x=c.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var N=null,$=null;if(v=v.firstBaseUpdate,v!==null){do{var W={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};$===null?N=$=W:$=$.next=W,v=v.next}while(v!==null);$===null?N=$=d:$=$.next=d}else N=$=d;v={baseState:x.baseState,firstBaseUpdate:N,lastBaseUpdate:$,shared:x.shared,effects:x.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=d:c.next=d,v.lastBaseUpdate=d}function zf(c,d,v,x){var N=c.updateQueue;Vi=!1;var $=N.firstBaseUpdate,W=N.lastBaseUpdate,fe=N.shared.pending;if(fe!==null){N.shared.pending=null;var ye=fe,Ue=ye.next;ye.next=null,W===null?$=Ue:W.next=Ue,W=ye;var dt=c.alternate;dt!==null&&(dt=dt.updateQueue,fe=dt.lastBaseUpdate,fe!==W&&(fe===null?dt.firstBaseUpdate=Ue:fe.next=Ue,dt.lastBaseUpdate=ye))}if($!==null){var gt=N.baseState;W=0,dt=Ue=ye=null,fe=$;do{var ut=fe.lane,$t=fe.eventTime;if((x&ut)===ut){dt!==null&&(dt=dt.next={eventTime:$t,lane:0,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null});e:{var Ht=c,It=fe;switch(ut=d,$t=v,It.tag){case 1:if(Ht=It.payload,typeof Ht=="function"){gt=Ht.call($t,gt,ut);break e}gt=Ht;break e;case 3:Ht.flags=Ht.flags&-65537|128;case 0:if(Ht=It.payload,ut=typeof Ht=="function"?Ht.call($t,gt,ut):Ht,ut==null)break e;gt=K({},gt,ut);break e;case 2:Vi=!0}}fe.callback!==null&&fe.lane!==0&&(c.flags|=64,ut=N.effects,ut===null?N.effects=[fe]:ut.push(fe))}else $t={eventTime:$t,lane:ut,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null},dt===null?(Ue=dt=$t,ye=gt):dt=dt.next=$t,W|=ut;if(fe=fe.next,fe===null){if(fe=N.shared.pending,fe===null)break;ut=fe,fe=ut.next,ut.next=null,N.lastBaseUpdate=ut,N.shared.pending=null}}while(!0);if(dt===null&&(ye=gt),N.baseState=ye,N.firstBaseUpdate=Ue,N.lastBaseUpdate=dt,d=N.shared.interleaved,d!==null){N=d;do W|=N.lane,N=N.next;while(N!==d)}else $===null&&(N.shared.lanes=0);ec|=W,c.lanes=W,c.memoizedState=gt}}function Wb(c,d,v){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var x=c[d],N=x.callback;if(N!==null){if(x.callback=null,x=v,typeof N!="function")throw Error(n(191,N));N.call(x)}}}var t0={},mo=Ii(t0),n0=Ii(t0),r0=Ii(t0);function Ql(c){if(c===t0)throw Error(n(174));return c}function ag(c,d){switch(Yn(r0,d),Yn(n0,c),Yn(mo,t0),c=d.nodeType,c){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:Ne(null,"");break;default:c=c===8?d.parentNode:d,d=c.namespaceURI||null,c=c.tagName,d=Ne(d,c)}tr(mo),Yn(mo,d)}function bu(){tr(mo),tr(n0),tr(r0)}function Kb(c){Ql(r0.current);var d=Ql(mo.current),v=Ne(d,c.type);d!==v&&(Yn(n0,c),Yn(mo,v))}function og(c){n0.current===c&&(tr(mo),tr(n0))}var lr=Ii(0);function Bf(c){for(var d=c;d!==null;){if(d.tag===13){var v=d.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var ig=[];function lg(){for(var c=0;c<ig.length;c++)ig[c]._workInProgressVersionPrimary=null;ig.length=0}var Uf=A.ReactCurrentDispatcher,cg=A.ReactCurrentBatchConfig,Jl=0,cr=null,Mr=null,Ir=null,Wf=!1,s0=!1,a0=0,CT=0;function rs(){throw Error(n(321))}function ug(c,d){if(d===null)return!1;for(var v=0;v<d.length&&v<c.length;v++)if(!_a(c[v],d[v]))return!1;return!0}function dg(c,d,v,x,N,$){if(Jl=$,cr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Uf.current=c===null||c.memoizedState===null?MT:RT,c=v(x,N),s0){$=0;do{if(s0=!1,a0=0,25<=$)throw Error(n(301));$+=1,Ir=Mr=null,d.updateQueue=null,Uf.current=PT,c=v(x,N)}while(s0)}if(Uf.current=Yf,d=Mr!==null&&Mr.next!==null,Jl=0,Ir=Mr=cr=null,Wf=!1,d)throw Error(n(300));return c}function fg(){var c=a0!==0;return a0=0,c}function go(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ir===null?cr.memoizedState=Ir=c:Ir=Ir.next=c,Ir}function pa(){if(Mr===null){var c=cr.alternate;c=c!==null?c.memoizedState:null}else c=Mr.next;var d=Ir===null?cr.memoizedState:Ir.next;if(d!==null)Ir=d,Mr=c;else{if(c===null)throw Error(n(310));Mr=c,c={memoizedState:Mr.memoizedState,baseState:Mr.baseState,baseQueue:Mr.baseQueue,queue:Mr.queue,next:null},Ir===null?cr.memoizedState=Ir=c:Ir=Ir.next=c}return Ir}function o0(c,d){return typeof d=="function"?d(c):d}function hg(c){var d=pa(),v=d.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=c;var x=Mr,N=x.baseQueue,$=v.pending;if($!==null){if(N!==null){var W=N.next;N.next=$.next,$.next=W}x.baseQueue=N=$,v.pending=null}if(N!==null){$=N.next,x=x.baseState;var fe=W=null,ye=null,Ue=$;do{var dt=Ue.lane;if((Jl&dt)===dt)ye!==null&&(ye=ye.next={lane:0,action:Ue.action,hasEagerState:Ue.hasEagerState,eagerState:Ue.eagerState,next:null}),x=Ue.hasEagerState?Ue.eagerState:c(x,Ue.action);else{var gt={lane:dt,action:Ue.action,hasEagerState:Ue.hasEagerState,eagerState:Ue.eagerState,next:null};ye===null?(fe=ye=gt,W=x):ye=ye.next=gt,cr.lanes|=dt,ec|=dt}Ue=Ue.next}while(Ue!==null&&Ue!==$);ye===null?W=x:ye.next=fe,_a(x,d.memoizedState)||(Ts=!0),d.memoizedState=x,d.baseState=W,d.baseQueue=ye,v.lastRenderedState=x}if(c=v.interleaved,c!==null){N=c;do $=N.lane,cr.lanes|=$,ec|=$,N=N.next;while(N!==c)}else N===null&&(v.lanes=0);return[d.memoizedState,v.dispatch]}function pg(c){var d=pa(),v=d.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=c;var x=v.dispatch,N=v.pending,$=d.memoizedState;if(N!==null){v.pending=null;var W=N=N.next;do $=c($,W.action),W=W.next;while(W!==N);_a($,d.memoizedState)||(Ts=!0),d.memoizedState=$,d.baseQueue===null&&(d.baseState=$),v.lastRenderedState=$}return[$,x]}function Gb(){}function Yb(c,d){var v=cr,x=pa(),N=d(),$=!_a(x.memoizedState,N);if($&&(x.memoizedState=N,Ts=!0),x=x.queue,mg(Qb.bind(null,v,x,c),[c]),x.getSnapshot!==d||$||Ir!==null&&Ir.memoizedState.tag&1){if(v.flags|=2048,i0(9,Xb.bind(null,v,x,N,d),void 0,null),Fr===null)throw Error(n(349));(Jl&30)!==0||qb(v,d,N)}return N}function qb(c,d,v){c.flags|=16384,c={getSnapshot:d,value:v},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.stores=[c]):(v=d.stores,v===null?d.stores=[c]:v.push(c))}function Xb(c,d,v,x){d.value=v,d.getSnapshot=x,Jb(d)&&e3(c)}function Qb(c,d,v){return v(function(){Jb(d)&&e3(c)})}function Jb(c){var d=c.getSnapshot;c=c.value;try{var v=d();return!_a(c,v)}catch{return!0}}function e3(c){var d=Ko(c,1);d!==null&&Ua(d,c,1,-1)}function t3(c){var d=go();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o0,lastRenderedState:c},d.queue=c,c=c.dispatch=NT.bind(null,cr,c),[d.memoizedState,c]}function i0(c,d,v,x){return c={tag:c,create:d,destroy:v,deps:x,next:null},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.lastEffect=c.next=c):(v=d.lastEffect,v===null?d.lastEffect=c.next=c:(x=v.next,v.next=c,c.next=x,d.lastEffect=c)),c}function n3(){return pa().memoizedState}function Kf(c,d,v,x){var N=go();cr.flags|=c,N.memoizedState=i0(1|d,v,void 0,x===void 0?null:x)}function Gf(c,d,v,x){var N=pa();x=x===void 0?null:x;var $=void 0;if(Mr!==null){var W=Mr.memoizedState;if($=W.destroy,x!==null&&ug(x,W.deps)){N.memoizedState=i0(d,v,$,x);return}}cr.flags|=c,N.memoizedState=i0(1|d,v,$,x)}function r3(c,d){return Kf(8390656,8,c,d)}function mg(c,d){return Gf(2048,8,c,d)}function s3(c,d){return Gf(4,2,c,d)}function a3(c,d){return Gf(4,4,c,d)}function o3(c,d){if(typeof d=="function")return c=c(),d(c),function(){d(null)};if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function i3(c,d,v){return v=v!=null?v.concat([c]):null,Gf(4,4,o3.bind(null,d,c),v)}function gg(){}function l3(c,d){var v=pa();d=d===void 0?null:d;var x=v.memoizedState;return x!==null&&d!==null&&ug(d,x[1])?x[0]:(v.memoizedState=[c,d],c)}function c3(c,d){var v=pa();d=d===void 0?null:d;var x=v.memoizedState;return x!==null&&d!==null&&ug(d,x[1])?x[0]:(c=c(),v.memoizedState=[c,d],c)}function u3(c,d,v){return(Jl&21)===0?(c.baseState&&(c.baseState=!1,Ts=!0),c.memoizedState=v):(_a(v,d)||(v=un(),cr.lanes|=v,ec|=v,c.baseState=!0),d)}function jT(c,d){var v=wn;wn=v!==0&&4>v?v:4,c(!0);var x=cg.transition;cg.transition={};try{c(!1),d()}finally{wn=v,cg.transition=x}}function d3(){return pa().memoizedState}function AT(c,d,v){var x=Wi(c);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},f3(c))h3(d,v);else if(v=zb(c,d,v,x),v!==null){var N=bs();Ua(v,c,x,N),p3(v,d,x)}}function NT(c,d,v){var x=Wi(c),N={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(f3(c))h3(d,N);else{var $=c.alternate;if(c.lanes===0&&($===null||$.lanes===0)&&($=d.lastRenderedReducer,$!==null))try{var W=d.lastRenderedState,fe=$(W,v);if(N.hasEagerState=!0,N.eagerState=fe,_a(fe,W)){var ye=d.interleaved;ye===null?(N.next=N,rg(d)):(N.next=ye.next,ye.next=N),d.interleaved=N;return}}catch{}finally{}v=zb(c,d,N,x),v!==null&&(N=bs(),Ua(v,c,x,N),p3(v,d,x))}}function f3(c){var d=c.alternate;return c===cr||d!==null&&d===cr}function h3(c,d){s0=Wf=!0;var v=c.pending;v===null?d.next=d:(d.next=v.next,v.next=d),c.pending=d}function p3(c,d,v){if((v&4194240)!==0){var x=d.lanes;x&=c.pendingLanes,v|=x,d.lanes=v,Hr(c,v)}}var Yf={readContext:ha,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useInsertionEffect:rs,useLayoutEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useMutableSource:rs,useSyncExternalStore:rs,useId:rs,unstable_isNewReconciler:!1},MT={readContext:ha,useCallback:function(c,d){return go().memoizedState=[c,d===void 0?null:d],c},useContext:ha,useEffect:r3,useImperativeHandle:function(c,d,v){return v=v!=null?v.concat([c]):null,Kf(4194308,4,o3.bind(null,d,c),v)},useLayoutEffect:function(c,d){return Kf(4194308,4,c,d)},useInsertionEffect:function(c,d){return Kf(4,2,c,d)},useMemo:function(c,d){var v=go();return d=d===void 0?null:d,c=c(),v.memoizedState=[c,d],c},useReducer:function(c,d,v){var x=go();return d=v!==void 0?v(d):d,x.memoizedState=x.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},x.queue=c,c=c.dispatch=AT.bind(null,cr,c),[x.memoizedState,c]},useRef:function(c){var d=go();return c={current:c},d.memoizedState=c},useState:t3,useDebugValue:gg,useDeferredValue:function(c){return go().memoizedState=c},useTransition:function(){var c=t3(!1),d=c[0];return c=jT.bind(null,c[1]),go().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,v){var x=cr,N=go();if(ar){if(v===void 0)throw Error(n(407));v=v()}else{if(v=d(),Fr===null)throw Error(n(349));(Jl&30)!==0||qb(x,d,v)}N.memoizedState=v;var $={value:v,getSnapshot:d};return N.queue=$,r3(Qb.bind(null,x,$,c),[c]),x.flags|=2048,i0(9,Xb.bind(null,x,$,v,d),void 0,null),v},useId:function(){var c=go(),d=Fr.identifierPrefix;if(ar){var v=Wo,x=Uo;v=(x&~(1<<32-we(x)-1)).toString(32)+v,d=":"+d+"R"+v,v=a0++,0<v&&(d+="H"+v.toString(32)),d+=":"}else v=CT++,d=":"+d+"r"+v.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},RT={readContext:ha,useCallback:l3,useContext:ha,useEffect:mg,useImperativeHandle:i3,useInsertionEffect:s3,useLayoutEffect:a3,useMemo:c3,useReducer:hg,useRef:n3,useState:function(){return hg(o0)},useDebugValue:gg,useDeferredValue:function(c){var d=pa();return u3(d,Mr.memoizedState,c)},useTransition:function(){var c=hg(o0)[0],d=pa().memoizedState;return[c,d]},useMutableSource:Gb,useSyncExternalStore:Yb,useId:d3,unstable_isNewReconciler:!1},PT={readContext:ha,useCallback:l3,useContext:ha,useEffect:mg,useImperativeHandle:i3,useInsertionEffect:s3,useLayoutEffect:a3,useMemo:c3,useReducer:pg,useRef:n3,useState:function(){return pg(o0)},useDebugValue:gg,useDeferredValue:function(c){var d=pa();return Mr===null?d.memoizedState=c:u3(d,Mr.memoizedState,c)},useTransition:function(){var c=pg(o0)[0],d=pa().memoizedState;return[c,d]},useMutableSource:Gb,useSyncExternalStore:Yb,useId:d3,unstable_isNewReconciler:!1};function Za(c,d){if(c&&c.defaultProps){d=K({},d),c=c.defaultProps;for(var v in c)d[v]===void 0&&(d[v]=c[v]);return d}return d}function vg(c,d,v,x){d=c.memoizedState,v=v(x,d),v=v==null?d:K({},d,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var qf={isMounted:function(c){return(c=c._reactInternals)?ot(c)===c:!1},enqueueSetState:function(c,d,v){c=c._reactInternals;var x=bs(),N=Wi(c),$=Go(x,N);$.payload=d,v!=null&&($.callback=v),d=Zi(c,$,N),d!==null&&(Ua(d,c,N,x),Zf(d,c,N))},enqueueReplaceState:function(c,d,v){c=c._reactInternals;var x=bs(),N=Wi(c),$=Go(x,N);$.tag=1,$.payload=d,v!=null&&($.callback=v),d=Zi(c,$,N),d!==null&&(Ua(d,c,N,x),Zf(d,c,N))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var v=bs(),x=Wi(c),N=Go(v,x);N.tag=2,d!=null&&(N.callback=d),d=Zi(c,N,x),d!==null&&(Ua(d,c,x,v),Zf(d,c,x))}};function m3(c,d,v,x,N,$,W){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(x,$,W):d.prototype&&d.prototype.isPureReactComponent?!Kd(v,x)||!Kd(N,$):!0}function g3(c,d,v){var x=!1,N=Fi,$=d.contextType;return typeof $=="object"&&$!==null?$=ha($):(N=$s(d)?Gl:ns.current,x=d.contextTypes,$=(x=x!=null)?hu(c,N):Fi),d=new d(v,$),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=qf,c.stateNode=d,d._reactInternals=c,x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=N,c.__reactInternalMemoizedMaskedChildContext=$),d}function v3(c,d,v,x){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(v,x),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(v,x),d.state!==c&&qf.enqueueReplaceState(d,d.state,null)}function wg(c,d,v,x){var N=c.stateNode;N.props=v,N.state=c.memoizedState,N.refs={},sg(c);var $=d.contextType;typeof $=="object"&&$!==null?N.context=ha($):($=$s(d)?Gl:ns.current,N.context=hu(c,$)),N.state=c.memoizedState,$=d.getDerivedStateFromProps,typeof $=="function"&&(vg(c,d,$,v),N.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(d=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),d!==N.state&&qf.enqueueReplaceState(N,N.state,null),zf(c,v,N,x),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308)}function xu(c,d){try{var v="",x=d;do v+=he(x),x=x.return;while(x);var N=v}catch($){N=`
|
|
39
|
+
Error generating stack: `+$.message+`
|
|
40
|
+
`+$.stack}return{value:c,source:d,stack:N,digest:null}}function yg(c,d,v){return{value:c,source:null,stack:v??null,digest:d??null}}function bg(c,d){try{console.error(d.value)}catch(v){setTimeout(function(){throw v})}}var LT=typeof WeakMap=="function"?WeakMap:Map;function w3(c,d,v){v=Go(-1,v),v.tag=3,v.payload={element:null};var x=d.value;return v.callback=function(){rh||(rh=!0,Dg=x),bg(c,d)},v}function y3(c,d,v){v=Go(-1,v),v.tag=3;var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var N=d.value;v.payload=function(){return x(N)},v.callback=function(){bg(c,d)}}var $=c.stateNode;return $!==null&&typeof $.componentDidCatch=="function"&&(v.callback=function(){bg(c,d),typeof x!="function"&&(Bi===null?Bi=new Set([this]):Bi.add(this));var W=d.stack;this.componentDidCatch(d.value,{componentStack:W!==null?W:""})}),v}function b3(c,d,v){var x=c.pingCache;if(x===null){x=c.pingCache=new LT;var N=new Set;x.set(d,N)}else N=x.get(d),N===void 0&&(N=new Set,x.set(d,N));N.has(v)||(N.add(v),c=WT.bind(null,c,d,v),d.then(c,c))}function x3(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function k3(c,d,v,x,N){return(c.mode&1)===0?(c===d?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(d=Go(-1,1),d.tag=2,Zi(v,d,1))),v.lanes|=1),c):(c.flags|=65536,c.lanes=N,c)}var $T=A.ReactCurrentOwner,Ts=!1;function ys(c,d,v,x){d.child=c===null?Zb(d,null,v,x):vu(d,c.child,v,x)}function S3(c,d,v,x,N){v=v.render;var $=d.ref;return yu(d,N),x=dg(c,d,v,x,$,N),v=fg(),c!==null&&!Ts?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,Yo(c,d,N)):(ar&&v&&G2(d),d.flags|=1,ys(c,d,x,N),d.child)}function E3(c,d,v,x,N){if(c===null){var $=v.type;return typeof $=="function"&&!Zg($)&&$.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(d.tag=15,d.type=$,C3(c,d,$,x,N)):(c=ch(v.type,null,x,d,d.mode,N),c.ref=d.ref,c.return=d,d.child=c)}if($=c.child,(c.lanes&N)===0){var W=$.memoizedProps;if(v=v.compare,v=v!==null?v:Kd,v(W,x)&&c.ref===d.ref)return Yo(c,d,N)}return d.flags|=1,c=Gi($,x),c.ref=d.ref,c.return=d,d.child=c}function C3(c,d,v,x,N){if(c!==null){var $=c.memoizedProps;if(Kd($,x)&&c.ref===d.ref)if(Ts=!1,d.pendingProps=x=$,(c.lanes&N)!==0)(c.flags&131072)!==0&&(Ts=!0);else return d.lanes=c.lanes,Yo(c,d,N)}return xg(c,d,v,x,N)}function j3(c,d,v){var x=d.pendingProps,N=x.children,$=c!==null?c.memoizedState:null;if(x.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yn(Su,Qs),Qs|=v;else{if((v&1073741824)===0)return c=$!==null?$.baseLanes|v:v,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,Yn(Su,Qs),Qs|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=$!==null?$.baseLanes:v,Yn(Su,Qs),Qs|=x}else $!==null?(x=$.baseLanes|v,d.memoizedState=null):x=v,Yn(Su,Qs),Qs|=x;return ys(c,d,N,v),d.child}function A3(c,d){var v=d.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(d.flags|=512,d.flags|=2097152)}function xg(c,d,v,x,N){var $=$s(v)?Gl:ns.current;return $=hu(d,$),yu(d,N),v=dg(c,d,v,x,$,N),x=fg(),c!==null&&!Ts?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,Yo(c,d,N)):(ar&&x&&G2(d),d.flags|=1,ys(c,d,v,N),d.child)}function N3(c,d,v,x,N){if($s(v)){var $=!0;Tf(d)}else $=!1;if(yu(d,N),d.stateNode===null)Qf(c,d),g3(d,v,x),wg(d,v,x,N),x=!0;else if(c===null){var W=d.stateNode,fe=d.memoizedProps;W.props=fe;var ye=W.context,Ue=v.contextType;typeof Ue=="object"&&Ue!==null?Ue=ha(Ue):(Ue=$s(v)?Gl:ns.current,Ue=hu(d,Ue));var dt=v.getDerivedStateFromProps,gt=typeof dt=="function"||typeof W.getSnapshotBeforeUpdate=="function";gt||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(fe!==x||ye!==Ue)&&v3(d,W,x,Ue),Vi=!1;var ut=d.memoizedState;W.state=ut,zf(d,x,W,N),ye=d.memoizedState,fe!==x||ut!==ye||Ls.current||Vi?(typeof dt=="function"&&(vg(d,v,dt,x),ye=d.memoizedState),(fe=Vi||m3(d,v,fe,x,ut,ye,Ue))?(gt||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(d.flags|=4194308)):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=x,d.memoizedState=ye),W.props=x,W.state=ye,W.context=Ue,x=fe):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),x=!1)}else{W=d.stateNode,Bb(c,d),fe=d.memoizedProps,Ue=d.type===d.elementType?fe:Za(d.type,fe),W.props=Ue,gt=d.pendingProps,ut=W.context,ye=v.contextType,typeof ye=="object"&&ye!==null?ye=ha(ye):(ye=$s(v)?Gl:ns.current,ye=hu(d,ye));var $t=v.getDerivedStateFromProps;(dt=typeof $t=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(fe!==gt||ut!==ye)&&v3(d,W,x,ye),Vi=!1,ut=d.memoizedState,W.state=ut,zf(d,x,W,N);var Ht=d.memoizedState;fe!==gt||ut!==Ht||Ls.current||Vi?(typeof $t=="function"&&(vg(d,v,$t,x),Ht=d.memoizedState),(Ue=Vi||m3(d,v,Ue,x,ut,Ht,ye)||!1)?(dt||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate(x,Ht,ye),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate(x,Ht,ye)),typeof W.componentDidUpdate=="function"&&(d.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof W.componentDidUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=1024),d.memoizedProps=x,d.memoizedState=Ht),W.props=x,W.state=Ht,W.context=ye,x=Ue):(typeof W.componentDidUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=1024),x=!1)}return kg(c,d,v,x,$,N)}function kg(c,d,v,x,N,$){A3(c,d);var W=(d.flags&128)!==0;if(!x&&!W)return N&&$b(d,v,!1),Yo(c,d,$);x=d.stateNode,$T.current=d;var fe=W&&typeof v.getDerivedStateFromError!="function"?null:x.render();return d.flags|=1,c!==null&&W?(d.child=vu(d,c.child,null,$),d.child=vu(d,null,fe,$)):ys(c,d,fe,$),d.memoizedState=x.state,N&&$b(d,v,!0),d.child}function M3(c){var d=c.stateNode;d.pendingContext?Pb(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Pb(c,d.context,!1),ag(c,d.containerInfo)}function R3(c,d,v,x,N){return gu(),Q2(N),d.flags|=256,ys(c,d,v,x),d.child}var Sg={dehydrated:null,treeContext:null,retryLane:0};function Eg(c){return{baseLanes:c,cachePool:null,transitions:null}}function P3(c,d,v){var x=d.pendingProps,N=lr.current,$=!1,W=(d.flags&128)!==0,fe;if((fe=W)||(fe=c!==null&&c.memoizedState===null?!1:(N&2)!==0),fe?($=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(N|=1),Yn(lr,N&1),c===null)return X2(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((d.mode&1)===0?d.lanes=1:c.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(W=x.children,c=x.fallback,$?(x=d.mode,$=d.child,W={mode:"hidden",children:W},(x&1)===0&&$!==null?($.childLanes=0,$.pendingProps=W):$=uh(W,x,0,null),c=sc(c,x,v,null),$.return=d,c.return=d,$.sibling=c,d.child=$,d.child.memoizedState=Eg(v),d.memoizedState=Sg,c):Cg(d,W));if(N=c.memoizedState,N!==null&&(fe=N.dehydrated,fe!==null))return TT(c,d,W,x,fe,N,v);if($){$=x.fallback,W=d.mode,N=c.child,fe=N.sibling;var ye={mode:"hidden",children:x.children};return(W&1)===0&&d.child!==N?(x=d.child,x.childLanes=0,x.pendingProps=ye,d.deletions=null):(x=Gi(N,ye),x.subtreeFlags=N.subtreeFlags&14680064),fe!==null?$=Gi(fe,$):($=sc($,W,v,null),$.flags|=2),$.return=d,x.return=d,x.sibling=$,d.child=x,x=$,$=d.child,W=c.child.memoizedState,W=W===null?Eg(v):{baseLanes:W.baseLanes|v,cachePool:null,transitions:W.transitions},$.memoizedState=W,$.childLanes=c.childLanes&~v,d.memoizedState=Sg,x}return $=c.child,c=$.sibling,x=Gi($,{mode:"visible",children:x.children}),(d.mode&1)===0&&(x.lanes=v),x.return=d,x.sibling=null,c!==null&&(v=d.deletions,v===null?(d.deletions=[c],d.flags|=16):v.push(c)),d.child=x,d.memoizedState=null,x}function Cg(c,d){return d=uh({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function Xf(c,d,v,x){return x!==null&&Q2(x),vu(d,c.child,null,v),c=Cg(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function TT(c,d,v,x,N,$,W){if(v)return d.flags&256?(d.flags&=-257,x=yg(Error(n(422))),Xf(c,d,W,x)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):($=x.fallback,N=d.mode,x=uh({mode:"visible",children:x.children},N,0,null),$=sc($,N,W,null),$.flags|=2,x.return=d,$.return=d,x.sibling=$,d.child=x,(d.mode&1)!==0&&vu(d,c.child,null,W),d.child.memoizedState=Eg(W),d.memoizedState=Sg,$);if((d.mode&1)===0)return Xf(c,d,W,null);if(N.data==="$!"){if(x=N.nextSibling&&N.nextSibling.dataset,x)var fe=x.dgst;return x=fe,$=Error(n(419)),x=yg($,x,void 0),Xf(c,d,W,x)}if(fe=(W&c.childLanes)!==0,Ts||fe){if(x=Fr,x!==null){switch(W&-W){case 4:N=2;break;case 16:N=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:N=32;break;case 536870912:N=268435456;break;default:N=0}N=(N&(x.suspendedLanes|W))!==0?0:N,N!==0&&N!==$.retryLane&&($.retryLane=N,Ko(c,N),Ua(x,c,N,-1))}return Vg(),x=yg(Error(n(421))),Xf(c,d,W,x)}return N.data==="$?"?(d.flags|=128,d.child=c.child,d=KT.bind(null,c),N._reactRetry=d,null):(c=$.treeContext,Xs=Oi(N.nextSibling),qs=d,ar=!0,Va=null,c!==null&&(da[fa++]=Uo,da[fa++]=Wo,da[fa++]=Yl,Uo=c.id,Wo=c.overflow,Yl=d),d=Cg(d,x.children),d.flags|=4096,d)}function L3(c,d,v){c.lanes|=d;var x=c.alternate;x!==null&&(x.lanes|=d),ng(c.return,d,v)}function jg(c,d,v,x,N){var $=c.memoizedState;$===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:x,tail:v,tailMode:N}:($.isBackwards=d,$.rendering=null,$.renderingStartTime=0,$.last=x,$.tail=v,$.tailMode=N)}function $3(c,d,v){var x=d.pendingProps,N=x.revealOrder,$=x.tail;if(ys(c,d,x.children,v),x=lr.current,(x&2)!==0)x=x&1|2,d.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&L3(c,v,d);else if(c.tag===19)L3(c,v,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}x&=1}if(Yn(lr,x),(d.mode&1)===0)d.memoizedState=null;else switch(N){case"forwards":for(v=d.child,N=null;v!==null;)c=v.alternate,c!==null&&Bf(c)===null&&(N=v),v=v.sibling;v=N,v===null?(N=d.child,d.child=null):(N=v.sibling,v.sibling=null),jg(d,!1,N,v,$);break;case"backwards":for(v=null,N=d.child,d.child=null;N!==null;){if(c=N.alternate,c!==null&&Bf(c)===null){d.child=N;break}c=N.sibling,N.sibling=v,v=N,N=c}jg(d,!0,v,null,$);break;case"together":jg(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Qf(c,d){(d.mode&1)===0&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function Yo(c,d,v){if(c!==null&&(d.dependencies=c.dependencies),ec|=d.lanes,(v&d.childLanes)===0)return null;if(c!==null&&d.child!==c.child)throw Error(n(153));if(d.child!==null){for(c=d.child,v=Gi(c,c.pendingProps),d.child=v,v.return=d;c.sibling!==null;)c=c.sibling,v=v.sibling=Gi(c,c.pendingProps),v.return=d;v.sibling=null}return d.child}function DT(c,d,v){switch(d.tag){case 3:M3(d),gu();break;case 5:Kb(d);break;case 1:$s(d.type)&&Tf(d);break;case 4:ag(d,d.stateNode.containerInfo);break;case 10:var x=d.type._context,N=d.memoizedProps.value;Yn(_f,x._currentValue),x._currentValue=N;break;case 13:if(x=d.memoizedState,x!==null)return x.dehydrated!==null?(Yn(lr,lr.current&1),d.flags|=128,null):(v&d.child.childLanes)!==0?P3(c,d,v):(Yn(lr,lr.current&1),c=Yo(c,d,v),c!==null?c.sibling:null);Yn(lr,lr.current&1);break;case 19:if(x=(v&d.childLanes)!==0,(c.flags&128)!==0){if(x)return $3(c,d,v);d.flags|=128}if(N=d.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),Yn(lr,lr.current),x)break;return null;case 22:case 23:return d.lanes=0,j3(c,d,v)}return Yo(c,d,v)}var T3,Ag,D3,H3;T3=function(c,d){for(var v=d.child;v!==null;){if(v.tag===5||v.tag===6)c.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===d)break;for(;v.sibling===null;){if(v.return===null||v.return===d)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Ag=function(){},D3=function(c,d,v,x){var N=c.memoizedProps;if(N!==x){c=d.stateNode,Ql(mo.current);var $=null;switch(v){case"input":N=ke(c,N),x=ke(c,x),$=[];break;case"select":N=K({},N,{value:void 0}),x=K({},x,{value:void 0}),$=[];break;case"textarea":N=je(c,N),x=je(c,x),$=[];break;default:typeof N.onClick!="function"&&typeof x.onClick=="function"&&(c.onclick=Pf)}Zt(v,x);var W;v=null;for(Ue in N)if(!x.hasOwnProperty(Ue)&&N.hasOwnProperty(Ue)&&N[Ue]!=null)if(Ue==="style"){var fe=N[Ue];for(W in fe)fe.hasOwnProperty(W)&&(v||(v={}),v[W]="")}else Ue!=="dangerouslySetInnerHTML"&&Ue!=="children"&&Ue!=="suppressContentEditableWarning"&&Ue!=="suppressHydrationWarning"&&Ue!=="autoFocus"&&(a.hasOwnProperty(Ue)?$||($=[]):($=$||[]).push(Ue,null));for(Ue in x){var ye=x[Ue];if(fe=N!=null?N[Ue]:void 0,x.hasOwnProperty(Ue)&&ye!==fe&&(ye!=null||fe!=null))if(Ue==="style")if(fe){for(W in fe)!fe.hasOwnProperty(W)||ye&&ye.hasOwnProperty(W)||(v||(v={}),v[W]="");for(W in ye)ye.hasOwnProperty(W)&&fe[W]!==ye[W]&&(v||(v={}),v[W]=ye[W])}else v||($||($=[]),$.push(Ue,v)),v=ye;else Ue==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,fe=fe?fe.__html:void 0,ye!=null&&fe!==ye&&($=$||[]).push(Ue,ye)):Ue==="children"?typeof ye!="string"&&typeof ye!="number"||($=$||[]).push(Ue,""+ye):Ue!=="suppressContentEditableWarning"&&Ue!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ue)?(ye!=null&&Ue==="onScroll"&&er("scroll",c),$||fe===ye||($=[])):($=$||[]).push(Ue,ye))}v&&($=$||[]).push("style",v);var Ue=$;(d.updateQueue=Ue)&&(d.flags|=4)}},H3=function(c,d,v,x){v!==x&&(d.flags|=4)};function l0(c,d){if(!ar)switch(c.tailMode){case"hidden":d=c.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var x=null;v!==null;)v.alternate!==null&&(x=v),v=v.sibling;x===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:x.sibling=null}}function ss(c){var d=c.alternate!==null&&c.alternate.child===c.child,v=0,x=0;if(d)for(var N=c.child;N!==null;)v|=N.lanes|N.childLanes,x|=N.subtreeFlags&14680064,x|=N.flags&14680064,N.return=c,N=N.sibling;else for(N=c.child;N!==null;)v|=N.lanes|N.childLanes,x|=N.subtreeFlags,x|=N.flags,N.return=c,N=N.sibling;return c.subtreeFlags|=x,c.childLanes=v,d}function HT(c,d,v){var x=d.pendingProps;switch(Y2(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ss(d),null;case 1:return $s(d.type)&&$f(),ss(d),null;case 3:return x=d.stateNode,bu(),tr(Ls),tr(ns),lg(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(c===null||c.child===null)&&(If(d)?d.flags|=4:c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Va!==null&&(Ig(Va),Va=null))),Ag(c,d),ss(d),null;case 5:og(d);var N=Ql(r0.current);if(v=d.type,c!==null&&d.stateNode!=null)D3(c,d,v,x,N),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!x){if(d.stateNode===null)throw Error(n(166));return ss(d),null}if(c=Ql(mo.current),If(d)){x=d.stateNode,v=d.type;var $=d.memoizedProps;switch(x[po]=d,x[Qd]=$,c=(d.mode&1)!==0,v){case"dialog":er("cancel",x),er("close",x);break;case"iframe":case"object":case"embed":er("load",x);break;case"video":case"audio":for(N=0;N<Yd.length;N++)er(Yd[N],x);break;case"source":er("error",x);break;case"img":case"image":case"link":er("error",x),er("load",x);break;case"details":er("toggle",x);break;case"input":ze(x,$),er("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!$.multiple},er("invalid",x);break;case"textarea":Re(x,$),er("invalid",x)}Zt(v,$),N=null;for(var W in $)if($.hasOwnProperty(W)){var fe=$[W];W==="children"?typeof fe=="string"?x.textContent!==fe&&($.suppressHydrationWarning!==!0&&Rf(x.textContent,fe,c),N=["children",fe]):typeof fe=="number"&&x.textContent!==""+fe&&($.suppressHydrationWarning!==!0&&Rf(x.textContent,fe,c),N=["children",""+fe]):a.hasOwnProperty(W)&&fe!=null&&W==="onScroll"&&er("scroll",x)}switch(v){case"input":ae(x),tt(x,$,!0);break;case"textarea":ae(x),Y(x);break;case"select":case"option":break;default:typeof $.onClick=="function"&&(x.onclick=Pf)}x=N,d.updateQueue=x,x!==null&&(d.flags|=4)}else{W=N.nodeType===9?N:N.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=se(v)),c==="http://www.w3.org/1999/xhtml"?v==="script"?(c=W.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof x.is=="string"?c=W.createElement(v,{is:x.is}):(c=W.createElement(v),v==="select"&&(W=c,x.multiple?W.multiple=!0:x.size&&(W.size=x.size))):c=W.createElementNS(c,v),c[po]=d,c[Qd]=x,T3(c,d,!1,!1),d.stateNode=c;e:{switch(W=jt(v,x),v){case"dialog":er("cancel",c),er("close",c),N=x;break;case"iframe":case"object":case"embed":er("load",c),N=x;break;case"video":case"audio":for(N=0;N<Yd.length;N++)er(Yd[N],c);N=x;break;case"source":er("error",c),N=x;break;case"img":case"image":case"link":er("error",c),er("load",c),N=x;break;case"details":er("toggle",c),N=x;break;case"input":ze(c,x),N=ke(c,x),er("invalid",c);break;case"option":N=x;break;case"select":c._wrapperState={wasMultiple:!!x.multiple},N=K({},x,{value:void 0}),er("invalid",c);break;case"textarea":Re(c,x),N=je(c,x),er("invalid",c);break;default:N=x}Zt(v,N),fe=N;for($ in fe)if(fe.hasOwnProperty($)){var ye=fe[$];$==="style"?bt(c,ye):$==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,ye!=null&&st(c,ye)):$==="children"?typeof ye=="string"?(v!=="textarea"||ye!=="")&&Pe(c,ye):typeof ye=="number"&&Pe(c,""+ye):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(a.hasOwnProperty($)?ye!=null&&$==="onScroll"&&er("scroll",c):ye!=null&&C(c,$,ye,W))}switch(v){case"input":ae(c),tt(c,x,!1);break;case"textarea":ae(c),Y(c);break;case"option":x.value!=null&&c.setAttribute("value",""+te(x.value));break;case"select":c.multiple=!!x.multiple,$=x.value,$!=null?X(c,!!x.multiple,$,!1):x.defaultValue!=null&&X(c,!!x.multiple,x.defaultValue,!0);break;default:typeof N.onClick=="function"&&(c.onclick=Pf)}switch(v){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return ss(d),null;case 6:if(c&&d.stateNode!=null)H3(c,d,c.memoizedProps,x);else{if(typeof x!="string"&&d.stateNode===null)throw Error(n(166));if(v=Ql(r0.current),Ql(mo.current),If(d)){if(x=d.stateNode,v=d.memoizedProps,x[po]=d,($=x.nodeValue!==v)&&(c=qs,c!==null))switch(c.tag){case 3:Rf(x.nodeValue,v,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Rf(x.nodeValue,v,(c.mode&1)!==0)}$&&(d.flags|=4)}else x=(v.nodeType===9?v:v.ownerDocument).createTextNode(x),x[po]=d,d.stateNode=x}return ss(d),null;case 13:if(tr(lr),x=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(ar&&Xs!==null&&(d.mode&1)!==0&&(d.flags&128)===0)Fb(),gu(),d.flags|=98560,$=!1;else if($=If(d),x!==null&&x.dehydrated!==null){if(c===null){if(!$)throw Error(n(318));if($=d.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(n(317));$[po]=d}else gu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;ss(d),$=!1}else Va!==null&&(Ig(Va),Va=null),$=!0;if(!$)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=v,d):(x=x!==null,x!==(c!==null&&c.memoizedState!==null)&&x&&(d.child.flags|=8192,(d.mode&1)!==0&&(c===null||(lr.current&1)!==0?Rr===0&&(Rr=3):Vg())),d.updateQueue!==null&&(d.flags|=4),ss(d),null);case 4:return bu(),Ag(c,d),c===null&&qd(d.stateNode.containerInfo),ss(d),null;case 10:return tg(d.type._context),ss(d),null;case 17:return $s(d.type)&&$f(),ss(d),null;case 19:if(tr(lr),$=d.memoizedState,$===null)return ss(d),null;if(x=(d.flags&128)!==0,W=$.rendering,W===null)if(x)l0($,!1);else{if(Rr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(W=Bf(c),W!==null){for(d.flags|=128,l0($,!1),x=W.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),d.subtreeFlags=0,x=v,v=d.child;v!==null;)$=v,c=x,$.flags&=14680066,W=$.alternate,W===null?($.childLanes=0,$.lanes=c,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=W.childLanes,$.lanes=W.lanes,$.child=W.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=W.memoizedProps,$.memoizedState=W.memoizedState,$.updateQueue=W.updateQueue,$.type=W.type,c=W.dependencies,$.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),v=v.sibling;return Yn(lr,lr.current&1|2),d.child}c=c.sibling}$.tail!==null&&qe()>Eu&&(d.flags|=128,x=!0,l0($,!1),d.lanes=4194304)}else{if(!x)if(c=Bf(W),c!==null){if(d.flags|=128,x=!0,v=c.updateQueue,v!==null&&(d.updateQueue=v,d.flags|=4),l0($,!0),$.tail===null&&$.tailMode==="hidden"&&!W.alternate&&!ar)return ss(d),null}else 2*qe()-$.renderingStartTime>Eu&&v!==1073741824&&(d.flags|=128,x=!0,l0($,!1),d.lanes=4194304);$.isBackwards?(W.sibling=d.child,d.child=W):(v=$.last,v!==null?v.sibling=W:d.child=W,$.last=W)}return $.tail!==null?(d=$.tail,$.rendering=d,$.tail=d.sibling,$.renderingStartTime=qe(),d.sibling=null,v=lr.current,Yn(lr,x?v&1|2:v&1),d):(ss(d),null);case 22:case 23:return _g(),x=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==x&&(d.flags|=8192),x&&(d.mode&1)!==0?(Qs&1073741824)!==0&&(ss(d),d.subtreeFlags&6&&(d.flags|=8192)):ss(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function OT(c,d){switch(Y2(d),d.tag){case 1:return $s(d.type)&&$f(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return bu(),tr(Ls),tr(ns),lg(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 5:return og(d),null;case 13:if(tr(lr),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(n(340));gu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return tr(lr),null;case 4:return bu(),null;case 10:return tg(d.type._context),null;case 22:case 23:return _g(),null;case 24:return null;default:return null}}var Jf=!1,as=!1,IT=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function ku(c,d){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){pr(c,d,x)}else v.current=null}function Ng(c,d,v){try{v()}catch(x){pr(c,d,x)}}var O3=!1;function FT(c,d){if(_2=Pn,c=mb(),L2(c)){if("selectionStart"in c)var v={start:c.selectionStart,end:c.selectionEnd};else e:{v=(v=c.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var N=x.anchorOffset,$=x.focusNode;x=x.focusOffset;try{v.nodeType,$.nodeType}catch{v=null;break e}var W=0,fe=-1,ye=-1,Ue=0,dt=0,gt=c,ut=null;t:for(;;){for(var $t;gt!==v||N!==0&>.nodeType!==3||(fe=W+N),gt!==$||x!==0&>.nodeType!==3||(ye=W+x),gt.nodeType===3&&(W+=gt.nodeValue.length),($t=gt.firstChild)!==null;)ut=gt,gt=$t;for(;;){if(gt===c)break t;if(ut===v&&++Ue===N&&(fe=W),ut===$&&++dt===x&&(ye=W),($t=gt.nextSibling)!==null)break;gt=ut,ut=gt.parentNode}gt=$t}v=fe===-1||ye===-1?null:{start:fe,end:ye}}else v=null}v=v||{start:0,end:0}}else v=null;for(V2={focusedElem:c,selectionRange:v},Pn=!1,Dt=d;Dt!==null;)if(d=Dt,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Dt=c;else for(;Dt!==null;){d=Dt;try{var Ht=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Ht!==null){var It=Ht.memoizedProps,vr=Ht.memoizedState,He=d.stateNode,Ce=He.getSnapshotBeforeUpdate(d.elementType===d.type?It:Za(d.type,It),vr);He.__reactInternalSnapshotBeforeUpdate=Ce}break;case 3:var Fe=d.stateNode.containerInfo;Fe.nodeType===1?Fe.textContent="":Fe.nodeType===9&&Fe.documentElement&&Fe.removeChild(Fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(St){pr(d,d.return,St)}if(c=d.sibling,c!==null){c.return=d.return,Dt=c;break}Dt=d.return}return Ht=O3,O3=!1,Ht}function c0(c,d,v){var x=d.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var N=x=x.next;do{if((N.tag&c)===c){var $=N.destroy;N.destroy=void 0,$!==void 0&&Ng(d,v,$)}N=N.next}while(N!==x)}}function eh(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var v=d=d.next;do{if((v.tag&c)===c){var x=v.create;v.destroy=x()}v=v.next}while(v!==d)}}function Mg(c){var d=c.ref;if(d!==null){var v=c.stateNode;switch(c.tag){case 5:c=v;break;default:c=v}typeof d=="function"?d(c):d.current=c}}function I3(c){var d=c.alternate;d!==null&&(c.alternate=null,I3(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&(delete d[po],delete d[Qd],delete d[U2],delete d[xT],delete d[kT])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function F3(c){return c.tag===5||c.tag===3||c.tag===4}function _3(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||F3(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Rg(c,d,v){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?v.nodeType===8?v.parentNode.insertBefore(c,d):v.insertBefore(c,d):(v.nodeType===8?(d=v.parentNode,d.insertBefore(c,v)):(d=v,d.appendChild(c)),v=v._reactRootContainer,v!=null||d.onclick!==null||(d.onclick=Pf));else if(x!==4&&(c=c.child,c!==null))for(Rg(c,d,v),c=c.sibling;c!==null;)Rg(c,d,v),c=c.sibling}function Pg(c,d,v){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?v.insertBefore(c,d):v.appendChild(c);else if(x!==4&&(c=c.child,c!==null))for(Pg(c,d,v),c=c.sibling;c!==null;)Pg(c,d,v),c=c.sibling}var Kr=null,za=!1;function zi(c,d,v){for(v=v.child;v!==null;)V3(c,d,v),v=v.sibling}function V3(c,d,v){if(F&&typeof F.onCommitFiberUnmount=="function")try{F.onCommitFiberUnmount(Qe,v)}catch{}switch(v.tag){case 5:as||ku(v,d);case 6:var x=Kr,N=za;Kr=null,zi(c,d,v),Kr=x,za=N,Kr!==null&&(za?(c=Kr,v=v.stateNode,c.nodeType===8?c.parentNode.removeChild(v):c.removeChild(v)):Kr.removeChild(v.stateNode));break;case 18:Kr!==null&&(za?(c=Kr,v=v.stateNode,c.nodeType===8?B2(c.parentNode,v):c.nodeType===1&&B2(c,v),Zn(c)):B2(Kr,v.stateNode));break;case 4:x=Kr,N=za,Kr=v.stateNode.containerInfo,za=!0,zi(c,d,v),Kr=x,za=N;break;case 0:case 11:case 14:case 15:if(!as&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){N=x=x.next;do{var $=N,W=$.destroy;$=$.tag,W!==void 0&&(($&2)!==0||($&4)!==0)&&Ng(v,d,W),N=N.next}while(N!==x)}zi(c,d,v);break;case 1:if(!as&&(ku(v,d),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(fe){pr(v,d,fe)}zi(c,d,v);break;case 21:zi(c,d,v);break;case 22:v.mode&1?(as=(x=as)||v.memoizedState!==null,zi(c,d,v),as=x):zi(c,d,v);break;default:zi(c,d,v)}}function Z3(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new IT),d.forEach(function(x){var N=GT.bind(null,c,x);v.has(x)||(v.add(x),x.then(N,N))})}}function Ba(c,d){var v=d.deletions;if(v!==null)for(var x=0;x<v.length;x++){var N=v[x];try{var $=c,W=d,fe=W;e:for(;fe!==null;){switch(fe.tag){case 5:Kr=fe.stateNode,za=!1;break e;case 3:Kr=fe.stateNode.containerInfo,za=!0;break e;case 4:Kr=fe.stateNode.containerInfo,za=!0;break e}fe=fe.return}if(Kr===null)throw Error(n(160));V3($,W,N),Kr=null,za=!1;var ye=N.alternate;ye!==null&&(ye.return=null),N.return=null}catch(Ue){pr(N,d,Ue)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)z3(d,c),d=d.sibling}function z3(c,d){var v=c.alternate,x=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Ba(d,c),vo(c),x&4){try{c0(3,c,c.return),eh(3,c)}catch(It){pr(c,c.return,It)}try{c0(5,c,c.return)}catch(It){pr(c,c.return,It)}}break;case 1:Ba(d,c),vo(c),x&512&&v!==null&&ku(v,v.return);break;case 5:if(Ba(d,c),vo(c),x&512&&v!==null&&ku(v,v.return),c.flags&32){var N=c.stateNode;try{Pe(N,"")}catch(It){pr(c,c.return,It)}}if(x&4&&(N=c.stateNode,N!=null)){var $=c.memoizedProps,W=v!==null?v.memoizedProps:$,fe=c.type,ye=c.updateQueue;if(c.updateQueue=null,ye!==null)try{fe==="input"&&$.type==="radio"&&$.name!=null&&wt(N,$),jt(fe,W);var Ue=jt(fe,$);for(W=0;W<ye.length;W+=2){var dt=ye[W],gt=ye[W+1];dt==="style"?bt(N,gt):dt==="dangerouslySetInnerHTML"?st(N,gt):dt==="children"?Pe(N,gt):C(N,dt,gt,Ue)}switch(fe){case"input":Ke(N,$);break;case"textarea":re(N,$);break;case"select":var ut=N._wrapperState.wasMultiple;N._wrapperState.wasMultiple=!!$.multiple;var $t=$.value;$t!=null?X(N,!!$.multiple,$t,!1):ut!==!!$.multiple&&($.defaultValue!=null?X(N,!!$.multiple,$.defaultValue,!0):X(N,!!$.multiple,$.multiple?[]:"",!1))}N[Qd]=$}catch(It){pr(c,c.return,It)}}break;case 6:if(Ba(d,c),vo(c),x&4){if(c.stateNode===null)throw Error(n(162));N=c.stateNode,$=c.memoizedProps;try{N.nodeValue=$}catch(It){pr(c,c.return,It)}}break;case 3:if(Ba(d,c),vo(c),x&4&&v!==null&&v.memoizedState.isDehydrated)try{Zn(d.containerInfo)}catch(It){pr(c,c.return,It)}break;case 4:Ba(d,c),vo(c);break;case 13:Ba(d,c),vo(c),N=c.child,N.flags&8192&&($=N.memoizedState!==null,N.stateNode.isHidden=$,!$||N.alternate!==null&&N.alternate.memoizedState!==null||(Tg=qe())),x&4&&Z3(c);break;case 22:if(dt=v!==null&&v.memoizedState!==null,c.mode&1?(as=(Ue=as)||dt,Ba(d,c),as=Ue):Ba(d,c),vo(c),x&8192){if(Ue=c.memoizedState!==null,(c.stateNode.isHidden=Ue)&&!dt&&(c.mode&1)!==0)for(Dt=c,dt=c.child;dt!==null;){for(gt=Dt=dt;Dt!==null;){switch(ut=Dt,$t=ut.child,ut.tag){case 0:case 11:case 14:case 15:c0(4,ut,ut.return);break;case 1:ku(ut,ut.return);var Ht=ut.stateNode;if(typeof Ht.componentWillUnmount=="function"){x=ut,v=ut.return;try{d=x,Ht.props=d.memoizedProps,Ht.state=d.memoizedState,Ht.componentWillUnmount()}catch(It){pr(x,v,It)}}break;case 5:ku(ut,ut.return);break;case 22:if(ut.memoizedState!==null){W3(gt);continue}}$t!==null?($t.return=ut,Dt=$t):W3(gt)}dt=dt.sibling}e:for(dt=null,gt=c;;){if(gt.tag===5){if(dt===null){dt=gt;try{N=gt.stateNode,Ue?($=N.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none"):(fe=gt.stateNode,ye=gt.memoizedProps.style,W=ye!=null&&ye.hasOwnProperty("display")?ye.display:null,fe.style.display=ft("display",W))}catch(It){pr(c,c.return,It)}}}else if(gt.tag===6){if(dt===null)try{gt.stateNode.nodeValue=Ue?"":gt.memoizedProps}catch(It){pr(c,c.return,It)}}else if((gt.tag!==22&>.tag!==23||gt.memoizedState===null||gt===c)&>.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===c)break e;for(;gt.sibling===null;){if(gt.return===null||gt.return===c)break e;dt===gt&&(dt=null),gt=gt.return}dt===gt&&(dt=null),gt.sibling.return=gt.return,gt=gt.sibling}}break;case 19:Ba(d,c),vo(c),x&4&&Z3(c);break;case 21:break;default:Ba(d,c),vo(c)}}function vo(c){var d=c.flags;if(d&2){try{e:{for(var v=c.return;v!==null;){if(F3(v)){var x=v;break e}v=v.return}throw Error(n(160))}switch(x.tag){case 5:var N=x.stateNode;x.flags&32&&(Pe(N,""),x.flags&=-33);var $=_3(c);Pg(c,$,N);break;case 3:case 4:var W=x.stateNode.containerInfo,fe=_3(c);Rg(c,fe,W);break;default:throw Error(n(161))}}catch(ye){pr(c,c.return,ye)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function _T(c,d,v){Dt=c,B3(c)}function B3(c,d,v){for(var x=(c.mode&1)!==0;Dt!==null;){var N=Dt,$=N.child;if(N.tag===22&&x){var W=N.memoizedState!==null||Jf;if(!W){var fe=N.alternate,ye=fe!==null&&fe.memoizedState!==null||as;fe=Jf;var Ue=as;if(Jf=W,(as=ye)&&!Ue)for(Dt=N;Dt!==null;)W=Dt,ye=W.child,W.tag===22&&W.memoizedState!==null?K3(N):ye!==null?(ye.return=W,Dt=ye):K3(N);for(;$!==null;)Dt=$,B3($),$=$.sibling;Dt=N,Jf=fe,as=Ue}U3(c)}else(N.subtreeFlags&8772)!==0&&$!==null?($.return=N,Dt=$):U3(c)}}function U3(c){for(;Dt!==null;){var d=Dt;if((d.flags&8772)!==0){var v=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:as||eh(5,d);break;case 1:var x=d.stateNode;if(d.flags&4&&!as)if(v===null)x.componentDidMount();else{var N=d.elementType===d.type?v.memoizedProps:Za(d.type,v.memoizedProps);x.componentDidUpdate(N,v.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var $=d.updateQueue;$!==null&&Wb(d,$,x);break;case 3:var W=d.updateQueue;if(W!==null){if(v=null,d.child!==null)switch(d.child.tag){case 5:v=d.child.stateNode;break;case 1:v=d.child.stateNode}Wb(d,W,v)}break;case 5:var fe=d.stateNode;if(v===null&&d.flags&4){v=fe;var ye=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":ye.autoFocus&&v.focus();break;case"img":ye.src&&(v.src=ye.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Ue=d.alternate;if(Ue!==null){var dt=Ue.memoizedState;if(dt!==null){var gt=dt.dehydrated;gt!==null&&Zn(gt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}as||d.flags&512&&Mg(d)}catch(ut){pr(d,d.return,ut)}}if(d===c){Dt=null;break}if(v=d.sibling,v!==null){v.return=d.return,Dt=v;break}Dt=d.return}}function W3(c){for(;Dt!==null;){var d=Dt;if(d===c){Dt=null;break}var v=d.sibling;if(v!==null){v.return=d.return,Dt=v;break}Dt=d.return}}function K3(c){for(;Dt!==null;){var d=Dt;try{switch(d.tag){case 0:case 11:case 15:var v=d.return;try{eh(4,d)}catch(ye){pr(d,v,ye)}break;case 1:var x=d.stateNode;if(typeof x.componentDidMount=="function"){var N=d.return;try{x.componentDidMount()}catch(ye){pr(d,N,ye)}}var $=d.return;try{Mg(d)}catch(ye){pr(d,$,ye)}break;case 5:var W=d.return;try{Mg(d)}catch(ye){pr(d,W,ye)}}}catch(ye){pr(d,d.return,ye)}if(d===c){Dt=null;break}var fe=d.sibling;if(fe!==null){fe.return=d.return,Dt=fe;break}Dt=d.return}}var VT=Math.ceil,th=A.ReactCurrentDispatcher,Lg=A.ReactCurrentOwner,ma=A.ReactCurrentBatchConfig,Hn=0,Fr=null,yr=null,Gr=0,Qs=0,Su=Ii(0),Rr=0,u0=null,ec=0,nh=0,$g=0,d0=null,Ds=null,Tg=0,Eu=1/0,qo=null,rh=!1,Dg=null,Bi=null,sh=!1,Ui=null,ah=0,f0=0,Hg=null,oh=-1,ih=0;function bs(){return(Hn&6)!==0?qe():oh!==-1?oh:oh=qe()}function Wi(c){return(c.mode&1)===0?1:(Hn&2)!==0&&Gr!==0?Gr&-Gr:ET.transition!==null?(ih===0&&(ih=un()),ih):(c=wn,c!==0||(c=window.event,c=c===void 0?16:gs(c.type)),c)}function Ua(c,d,v,x){if(50<f0)throw f0=0,Hg=null,Error(n(185));Kt(c,v,x),((Hn&2)===0||c!==Fr)&&(c===Fr&&((Hn&2)===0&&(nh|=v),Rr===4&&Ki(c,Gr)),Hs(c,x),v===1&&Hn===0&&(d.mode&1)===0&&(Eu=qe()+500,Df&&_i()))}function Hs(c,d){var v=c.callbackNode;Sn(c,d);var x=kn(c,c===Fr?Gr:0);if(x===0)v!==null&&it(v),c.callbackNode=null,c.callbackPriority=0;else if(d=x&-x,c.callbackPriority!==d){if(v!=null&&it(v),d===1)c.tag===0?ST(Y3.bind(null,c)):Tb(Y3.bind(null,c)),yT(function(){(Hn&6)===0&&_i()}),v=null;else{switch(_o(x)){case 1:v=Ut;break;case 4:v=Nt;break;case 16:v=_t;break;case 536870912:v=Ze;break;default:v=_t}v=rx(v,G3.bind(null,c))}c.callbackPriority=d,c.callbackNode=v}}function G3(c,d){if(oh=-1,ih=0,(Hn&6)!==0)throw Error(n(327));var v=c.callbackNode;if(Cu()&&c.callbackNode!==v)return null;var x=kn(c,c===Fr?Gr:0);if(x===0)return null;if((x&30)!==0||(x&c.expiredLanes)!==0||d)d=lh(c,x);else{d=x;var N=Hn;Hn|=2;var $=X3();(Fr!==c||Gr!==d)&&(qo=null,Eu=qe()+500,nc(c,d));do try{BT();break}catch(fe){q3(c,fe)}while(!0);eg(),th.current=$,Hn=N,yr!==null?d=0:(Fr=null,Gr=0,d=Rr)}if(d!==0){if(d===2&&(N=Qn(c),N!==0&&(x=N,d=Og(c,N))),d===1)throw v=u0,nc(c,0),Ki(c,x),Hs(c,qe()),v;if(d===6)Ki(c,x);else{if(N=c.current.alternate,(x&30)===0&&!ZT(N)&&(d=lh(c,x),d===2&&($=Qn(c),$!==0&&(x=$,d=Og(c,$))),d===1))throw v=u0,nc(c,0),Ki(c,x),Hs(c,qe()),v;switch(c.finishedWork=N,c.finishedLanes=x,d){case 0:case 1:throw Error(n(345));case 2:rc(c,Ds,qo);break;case 3:if(Ki(c,x),(x&130023424)===x&&(d=Tg+500-qe(),10<d)){if(kn(c,0)!==0)break;if(N=c.suspendedLanes,(N&x)!==x){bs(),c.pingedLanes|=c.suspendedLanes&N;break}c.timeoutHandle=z2(rc.bind(null,c,Ds,qo),d);break}rc(c,Ds,qo);break;case 4:if(Ki(c,x),(x&4194240)===x)break;for(d=c.eventTimes,N=-1;0<x;){var W=31-we(x);$=1<<W,W=d[W],W>N&&(N=W),x&=~$}if(x=N,x=qe()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*VT(x/1960))-x,10<x){c.timeoutHandle=z2(rc.bind(null,c,Ds,qo),x);break}rc(c,Ds,qo);break;case 5:rc(c,Ds,qo);break;default:throw Error(n(329))}}}return Hs(c,qe()),c.callbackNode===v?G3.bind(null,c):null}function Og(c,d){var v=d0;return c.current.memoizedState.isDehydrated&&(nc(c,d).flags|=256),c=lh(c,d),c!==2&&(d=Ds,Ds=v,d!==null&&Ig(d)),c}function Ig(c){Ds===null?Ds=c:Ds.push.apply(Ds,c)}function ZT(c){for(var d=c;;){if(d.flags&16384){var v=d.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var x=0;x<v.length;x++){var N=v[x],$=N.getSnapshot;N=N.value;try{if(!_a($(),N))return!1}catch{return!1}}}if(v=d.child,d.subtreeFlags&16384&&v!==null)v.return=d,d=v;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ki(c,d){for(d&=~$g,d&=~nh,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var v=31-we(d),x=1<<v;c[v]=-1,d&=~x}}function Y3(c){if((Hn&6)!==0)throw Error(n(327));Cu();var d=kn(c,0);if((d&1)===0)return Hs(c,qe()),null;var v=lh(c,d);if(c.tag!==0&&v===2){var x=Qn(c);x!==0&&(d=x,v=Og(c,x))}if(v===1)throw v=u0,nc(c,0),Ki(c,d),Hs(c,qe()),v;if(v===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,rc(c,Ds,qo),Hs(c,qe()),null}function Fg(c,d){var v=Hn;Hn|=1;try{return c(d)}finally{Hn=v,Hn===0&&(Eu=qe()+500,Df&&_i())}}function tc(c){Ui!==null&&Ui.tag===0&&(Hn&6)===0&&Cu();var d=Hn;Hn|=1;var v=ma.transition,x=wn;try{if(ma.transition=null,wn=1,c)return c()}finally{wn=x,ma.transition=v,Hn=d,(Hn&6)===0&&_i()}}function _g(){Qs=Su.current,tr(Su)}function nc(c,d){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==-1&&(c.timeoutHandle=-1,wT(v)),yr!==null)for(v=yr.return;v!==null;){var x=v;switch(Y2(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&$f();break;case 3:bu(),tr(Ls),tr(ns),lg();break;case 5:og(x);break;case 4:bu();break;case 13:tr(lr);break;case 19:tr(lr);break;case 10:tg(x.type._context);break;case 22:case 23:_g()}v=v.return}if(Fr=c,yr=c=Gi(c.current,null),Gr=Qs=d,Rr=0,u0=null,$g=nh=ec=0,Ds=d0=null,Xl!==null){for(d=0;d<Xl.length;d++)if(v=Xl[d],x=v.interleaved,x!==null){v.interleaved=null;var N=x.next,$=v.pending;if($!==null){var W=$.next;$.next=N,x.next=W}v.pending=x}Xl=null}return c}function q3(c,d){do{var v=yr;try{if(eg(),Uf.current=Yf,Wf){for(var x=cr.memoizedState;x!==null;){var N=x.queue;N!==null&&(N.pending=null),x=x.next}Wf=!1}if(Jl=0,Ir=Mr=cr=null,s0=!1,a0=0,Lg.current=null,v===null||v.return===null){Rr=1,u0=d,yr=null;break}e:{var $=c,W=v.return,fe=v,ye=d;if(d=Gr,fe.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Ue=ye,dt=fe,gt=dt.tag;if((dt.mode&1)===0&&(gt===0||gt===11||gt===15)){var ut=dt.alternate;ut?(dt.updateQueue=ut.updateQueue,dt.memoizedState=ut.memoizedState,dt.lanes=ut.lanes):(dt.updateQueue=null,dt.memoizedState=null)}var $t=x3(W);if($t!==null){$t.flags&=-257,k3($t,W,fe,$,d),$t.mode&1&&b3($,Ue,d),d=$t,ye=Ue;var Ht=d.updateQueue;if(Ht===null){var It=new Set;It.add(ye),d.updateQueue=It}else Ht.add(ye);break e}else{if((d&1)===0){b3($,Ue,d),Vg();break e}ye=Error(n(426))}}else if(ar&&fe.mode&1){var vr=x3(W);if(vr!==null){(vr.flags&65536)===0&&(vr.flags|=256),k3(vr,W,fe,$,d),Q2(xu(ye,fe));break e}}$=ye=xu(ye,fe),Rr!==4&&(Rr=2),d0===null?d0=[$]:d0.push($),$=W;do{switch($.tag){case 3:$.flags|=65536,d&=-d,$.lanes|=d;var He=w3($,ye,d);Ub($,He);break e;case 1:fe=ye;var Ce=$.type,Fe=$.stateNode;if(($.flags&128)===0&&(typeof Ce.getDerivedStateFromError=="function"||Fe!==null&&typeof Fe.componentDidCatch=="function"&&(Bi===null||!Bi.has(Fe)))){$.flags|=65536,d&=-d,$.lanes|=d;var St=y3($,fe,d);Ub($,St);break e}}$=$.return}while($!==null)}J3(v)}catch(Vt){d=Vt,yr===v&&v!==null&&(yr=v=v.return);continue}break}while(!0)}function X3(){var c=th.current;return th.current=Yf,c===null?Yf:c}function Vg(){(Rr===0||Rr===3||Rr===2)&&(Rr=4),Fr===null||(ec&268435455)===0&&(nh&268435455)===0||Ki(Fr,Gr)}function lh(c,d){var v=Hn;Hn|=2;var x=X3();(Fr!==c||Gr!==d)&&(qo=null,nc(c,d));do try{zT();break}catch(N){q3(c,N)}while(!0);if(eg(),Hn=v,th.current=x,yr!==null)throw Error(n(261));return Fr=null,Gr=0,Rr}function zT(){for(;yr!==null;)Q3(yr)}function BT(){for(;yr!==null&&!vt();)Q3(yr)}function Q3(c){var d=nx(c.alternate,c,Qs);c.memoizedProps=c.pendingProps,d===null?J3(c):yr=d,Lg.current=null}function J3(c){var d=c;do{var v=d.alternate;if(c=d.return,(d.flags&32768)===0){if(v=HT(v,d,Qs),v!==null){yr=v;return}}else{if(v=OT(v,d),v!==null){v.flags&=32767,yr=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Rr=6,yr=null;return}}if(d=d.sibling,d!==null){yr=d;return}yr=d=c}while(d!==null);Rr===0&&(Rr=5)}function rc(c,d,v){var x=wn,N=ma.transition;try{ma.transition=null,wn=1,UT(c,d,v,x)}finally{ma.transition=N,wn=x}return null}function UT(c,d,v,x){do Cu();while(Ui!==null);if((Hn&6)!==0)throw Error(n(327));v=c.finishedWork;var N=c.finishedLanes;if(v===null)return null;if(c.finishedWork=null,c.finishedLanes=0,v===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var $=v.lanes|v.childLanes;if(wr(c,$),c===Fr&&(yr=Fr=null,Gr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||sh||(sh=!0,rx(_t,function(){return Cu(),null})),$=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||$){$=ma.transition,ma.transition=null;var W=wn;wn=1;var fe=Hn;Hn|=4,Lg.current=null,FT(c,v),z3(v,c),dT(V2),Pn=!!_2,V2=_2=null,c.current=v,_T(v),Te(),Hn=fe,wn=W,ma.transition=$}else c.current=v;if(sh&&(sh=!1,Ui=c,ah=N),$=c.pendingLanes,$===0&&(Bi=null),de(v.stateNode),Hs(c,qe()),d!==null)for(x=c.onRecoverableError,v=0;v<d.length;v++)N=d[v],x(N.value,{componentStack:N.stack,digest:N.digest});if(rh)throw rh=!1,c=Dg,Dg=null,c;return(ah&1)!==0&&c.tag!==0&&Cu(),$=c.pendingLanes,($&1)!==0?c===Hg?f0++:(f0=0,Hg=c):f0=0,_i(),null}function Cu(){if(Ui!==null){var c=_o(ah),d=ma.transition,v=wn;try{if(ma.transition=null,wn=16>c?16:c,Ui===null)var x=!1;else{if(c=Ui,Ui=null,ah=0,(Hn&6)!==0)throw Error(n(331));var N=Hn;for(Hn|=4,Dt=c.current;Dt!==null;){var $=Dt,W=$.child;if((Dt.flags&16)!==0){var fe=$.deletions;if(fe!==null){for(var ye=0;ye<fe.length;ye++){var Ue=fe[ye];for(Dt=Ue;Dt!==null;){var dt=Dt;switch(dt.tag){case 0:case 11:case 15:c0(8,dt,$)}var gt=dt.child;if(gt!==null)gt.return=dt,Dt=gt;else for(;Dt!==null;){dt=Dt;var ut=dt.sibling,$t=dt.return;if(I3(dt),dt===Ue){Dt=null;break}if(ut!==null){ut.return=$t,Dt=ut;break}Dt=$t}}}var Ht=$.alternate;if(Ht!==null){var It=Ht.child;if(It!==null){Ht.child=null;do{var vr=It.sibling;It.sibling=null,It=vr}while(It!==null)}}Dt=$}}if(($.subtreeFlags&2064)!==0&&W!==null)W.return=$,Dt=W;else e:for(;Dt!==null;){if($=Dt,($.flags&2048)!==0)switch($.tag){case 0:case 11:case 15:c0(9,$,$.return)}var He=$.sibling;if(He!==null){He.return=$.return,Dt=He;break e}Dt=$.return}}var Ce=c.current;for(Dt=Ce;Dt!==null;){W=Dt;var Fe=W.child;if((W.subtreeFlags&2064)!==0&&Fe!==null)Fe.return=W,Dt=Fe;else e:for(W=Ce;Dt!==null;){if(fe=Dt,(fe.flags&2048)!==0)try{switch(fe.tag){case 0:case 11:case 15:eh(9,fe)}}catch(Vt){pr(fe,fe.return,Vt)}if(fe===W){Dt=null;break e}var St=fe.sibling;if(St!==null){St.return=fe.return,Dt=St;break e}Dt=fe.return}}if(Hn=N,_i(),F&&typeof F.onPostCommitFiberRoot=="function")try{F.onPostCommitFiberRoot(Qe,c)}catch{}x=!0}return x}finally{wn=v,ma.transition=d}}return!1}function ex(c,d,v){d=xu(v,d),d=w3(c,d,1),c=Zi(c,d,1),d=bs(),c!==null&&(Kt(c,1,d),Hs(c,d))}function pr(c,d,v){if(c.tag===3)ex(c,c,v);else for(;d!==null;){if(d.tag===3){ex(d,c,v);break}else if(d.tag===1){var x=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Bi===null||!Bi.has(x))){c=xu(v,c),c=y3(d,c,1),d=Zi(d,c,1),c=bs(),d!==null&&(Kt(d,1,c),Hs(d,c));break}}d=d.return}}function WT(c,d,v){var x=c.pingCache;x!==null&&x.delete(d),d=bs(),c.pingedLanes|=c.suspendedLanes&v,Fr===c&&(Gr&v)===v&&(Rr===4||Rr===3&&(Gr&130023424)===Gr&&500>qe()-Tg?nc(c,0):$g|=v),Hs(c,d)}function tx(c,d){d===0&&((c.mode&1)===0?d=1:(d=zt,zt<<=1,(zt&130023424)===0&&(zt=4194304)));var v=bs();c=Ko(c,d),c!==null&&(Kt(c,d,v),Hs(c,v))}function KT(c){var d=c.memoizedState,v=0;d!==null&&(v=d.retryLane),tx(c,v)}function GT(c,d){var v=0;switch(c.tag){case 13:var x=c.stateNode,N=c.memoizedState;N!==null&&(v=N.retryLane);break;case 19:x=c.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(d),tx(c,v)}var nx;nx=function(c,d,v){if(c!==null)if(c.memoizedProps!==d.pendingProps||Ls.current)Ts=!0;else{if((c.lanes&v)===0&&(d.flags&128)===0)return Ts=!1,DT(c,d,v);Ts=(c.flags&131072)!==0}else Ts=!1,ar&&(d.flags&1048576)!==0&&Db(d,Of,d.index);switch(d.lanes=0,d.tag){case 2:var x=d.type;Qf(c,d),c=d.pendingProps;var N=hu(d,ns.current);yu(d,v),N=dg(null,d,x,c,N,v);var $=fg();return d.flags|=1,typeof N=="object"&&N!==null&&typeof N.render=="function"&&N.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,$s(x)?($=!0,Tf(d)):$=!1,d.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,sg(d),N.updater=qf,d.stateNode=N,N._reactInternals=d,wg(d,x,c,v),d=kg(null,d,x,!0,$,v)):(d.tag=0,ar&&$&&G2(d),ys(null,d,N,v),d=d.child),d;case 16:x=d.elementType;e:{switch(Qf(c,d),c=d.pendingProps,N=x._init,x=N(x._payload),d.type=x,N=d.tag=qT(x),c=Za(x,c),N){case 0:d=xg(null,d,x,c,v);break e;case 1:d=N3(null,d,x,c,v);break e;case 11:d=S3(null,d,x,c,v);break e;case 14:d=E3(null,d,x,Za(x.type,c),v);break e}throw Error(n(306,x,""))}return d;case 0:return x=d.type,N=d.pendingProps,N=d.elementType===x?N:Za(x,N),xg(c,d,x,N,v);case 1:return x=d.type,N=d.pendingProps,N=d.elementType===x?N:Za(x,N),N3(c,d,x,N,v);case 3:e:{if(M3(d),c===null)throw Error(n(387));x=d.pendingProps,$=d.memoizedState,N=$.element,Bb(c,d),zf(d,x,null,v);var W=d.memoizedState;if(x=W.element,$.isDehydrated)if($={element:x,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},d.updateQueue.baseState=$,d.memoizedState=$,d.flags&256){N=xu(Error(n(423)),d),d=R3(c,d,x,v,N);break e}else if(x!==N){N=xu(Error(n(424)),d),d=R3(c,d,x,v,N);break e}else for(Xs=Oi(d.stateNode.containerInfo.firstChild),qs=d,ar=!0,Va=null,v=Zb(d,null,x,v),d.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(gu(),x===N){d=Yo(c,d,v);break e}ys(c,d,x,v)}d=d.child}return d;case 5:return Kb(d),c===null&&X2(d),x=d.type,N=d.pendingProps,$=c!==null?c.memoizedProps:null,W=N.children,Z2(x,N)?W=null:$!==null&&Z2(x,$)&&(d.flags|=32),A3(c,d),ys(c,d,W,v),d.child;case 6:return c===null&&X2(d),null;case 13:return P3(c,d,v);case 4:return ag(d,d.stateNode.containerInfo),x=d.pendingProps,c===null?d.child=vu(d,null,x,v):ys(c,d,x,v),d.child;case 11:return x=d.type,N=d.pendingProps,N=d.elementType===x?N:Za(x,N),S3(c,d,x,N,v);case 7:return ys(c,d,d.pendingProps,v),d.child;case 8:return ys(c,d,d.pendingProps.children,v),d.child;case 12:return ys(c,d,d.pendingProps.children,v),d.child;case 10:e:{if(x=d.type._context,N=d.pendingProps,$=d.memoizedProps,W=N.value,Yn(_f,x._currentValue),x._currentValue=W,$!==null)if(_a($.value,W)){if($.children===N.children&&!Ls.current){d=Yo(c,d,v);break e}}else for($=d.child,$!==null&&($.return=d);$!==null;){var fe=$.dependencies;if(fe!==null){W=$.child;for(var ye=fe.firstContext;ye!==null;){if(ye.context===x){if($.tag===1){ye=Go(-1,v&-v),ye.tag=2;var Ue=$.updateQueue;if(Ue!==null){Ue=Ue.shared;var dt=Ue.pending;dt===null?ye.next=ye:(ye.next=dt.next,dt.next=ye),Ue.pending=ye}}$.lanes|=v,ye=$.alternate,ye!==null&&(ye.lanes|=v),ng($.return,v,d),fe.lanes|=v;break}ye=ye.next}}else if($.tag===10)W=$.type===d.type?null:$.child;else if($.tag===18){if(W=$.return,W===null)throw Error(n(341));W.lanes|=v,fe=W.alternate,fe!==null&&(fe.lanes|=v),ng(W,v,d),W=$.sibling}else W=$.child;if(W!==null)W.return=$;else for(W=$;W!==null;){if(W===d){W=null;break}if($=W.sibling,$!==null){$.return=W.return,W=$;break}W=W.return}$=W}ys(c,d,N.children,v),d=d.child}return d;case 9:return N=d.type,x=d.pendingProps.children,yu(d,v),N=ha(N),x=x(N),d.flags|=1,ys(c,d,x,v),d.child;case 14:return x=d.type,N=Za(x,d.pendingProps),N=Za(x.type,N),E3(c,d,x,N,v);case 15:return C3(c,d,d.type,d.pendingProps,v);case 17:return x=d.type,N=d.pendingProps,N=d.elementType===x?N:Za(x,N),Qf(c,d),d.tag=1,$s(x)?(c=!0,Tf(d)):c=!1,yu(d,v),g3(d,x,N),wg(d,x,N,v),kg(null,d,x,!0,c,v);case 19:return $3(c,d,v);case 22:return j3(c,d,v)}throw Error(n(156,d.tag))};function rx(c,d){return be(c,d)}function YT(c,d,v,x){this.tag=c,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ga(c,d,v,x){return new YT(c,d,v,x)}function Zg(c){return c=c.prototype,!(!c||!c.isReactComponent)}function qT(c){if(typeof c=="function")return Zg(c)?1:0;if(c!=null){if(c=c.$$typeof,c===D)return 11;if(c===B)return 14}return 2}function Gi(c,d){var v=c.alternate;return v===null?(v=ga(c.tag,d,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=d,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,d=c.dependencies,v.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function ch(c,d,v,x,N,$){var W=2;if(x=c,typeof c=="function")Zg(c)&&(W=1);else if(typeof c=="string")W=5;else e:switch(c){case M:return sc(v.children,N,$,d);case j:W=8,N|=8;break;case P:return c=ga(12,v,d,N|2),c.elementType=P,c.lanes=$,c;case U:return c=ga(13,v,d,N),c.elementType=U,c.lanes=$,c;case V:return c=ga(19,v,d,N),c.elementType=V,c.lanes=$,c;case _:return uh(v,N,$,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case R:W=10;break e;case H:W=9;break e;case D:W=11;break e;case B:W=14;break e;case G:W=16,x=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return d=ga(W,v,d,N),d.elementType=c,d.type=x,d.lanes=$,d}function sc(c,d,v,x){return c=ga(7,c,x,d),c.lanes=v,c}function uh(c,d,v,x){return c=ga(22,c,x,d),c.elementType=_,c.lanes=v,c.stateNode={isHidden:!1},c}function zg(c,d,v){return c=ga(6,c,null,d),c.lanes=v,c}function Bg(c,d,v){return d=ga(4,c.children!==null?c.children:[],c.key,d),d.lanes=v,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function XT(c,d,v,x,N){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gr(0),this.expirationTimes=gr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gr(0),this.identifierPrefix=x,this.onRecoverableError=N,this.mutableSourceEagerHydrationData=null}function Ug(c,d,v,x,N,$,W,fe,ye){return c=new XT(c,d,v,fe,ye),d===1?(d=1,$===!0&&(d|=8)):d=0,$=ga(3,null,null,d),c.current=$,$.stateNode=c,$.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},sg($),c}function QT(c,d,v){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:x==null?null:""+x,children:c,containerInfo:d,implementation:v}}function sx(c){if(!c)return Fi;c=c._reactInternals;e:{if(ot(c)!==c||c.tag!==1)throw Error(n(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if($s(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(c.tag===1){var v=c.type;if($s(v))return Lb(c,v,d)}return d}function ax(c,d,v,x,N,$,W,fe,ye){return c=Ug(v,x,!0,c,N,$,W,fe,ye),c.context=sx(null),v=c.current,x=bs(),N=Wi(v),$=Go(x,N),$.callback=d??null,Zi(v,$,N),c.current.lanes=N,Kt(c,N,x),Hs(c,x),c}function dh(c,d,v,x){var N=d.current,$=bs(),W=Wi(N);return v=sx(v),d.context===null?d.context=v:d.pendingContext=v,d=Go($,W),d.payload={element:c},x=x===void 0?null:x,x!==null&&(d.callback=x),c=Zi(N,d,W),c!==null&&(Ua(c,N,W,$),Zf(c,N,W)),W}function fh(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function ox(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<d?v:d}}function Wg(c,d){ox(c,d),(c=c.alternate)&&ox(c,d)}function JT(){return null}var ix=typeof reportError=="function"?reportError:function(c){console.error(c)};function Kg(c){this._internalRoot=c}hh.prototype.render=Kg.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(n(409));dh(c,d,null,null)},hh.prototype.unmount=Kg.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;tc(function(){dh(null,c,null,null)}),d[zo]=null}};function hh(c){this._internalRoot=c}hh.prototype.unstable_scheduleHydration=function(c){if(c){var d=on();c={blockedOn:null,target:c,priority:d};for(var v=0;v<ms.length&&d!==0&&d<ms[v].priority;v++);ms.splice(v,0,c),v===0&&oe(c)}};function Gg(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function ph(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function lx(){}function eD(c,d,v,x,N){if(N){if(typeof x=="function"){var $=x;x=function(){var Ue=fh(W);$.call(Ue)}}var W=ax(d,x,c,0,null,!1,!1,"",lx);return c._reactRootContainer=W,c[zo]=W.current,qd(c.nodeType===8?c.parentNode:c),tc(),W}for(;N=c.lastChild;)c.removeChild(N);if(typeof x=="function"){var fe=x;x=function(){var Ue=fh(ye);fe.call(Ue)}}var ye=Ug(c,0,!1,null,null,!1,!1,"",lx);return c._reactRootContainer=ye,c[zo]=ye.current,qd(c.nodeType===8?c.parentNode:c),tc(function(){dh(d,ye,v,x)}),ye}function mh(c,d,v,x,N){var $=v._reactRootContainer;if($){var W=$;if(typeof N=="function"){var fe=N;N=function(){var ye=fh(W);fe.call(ye)}}dh(d,W,c,N)}else W=eD(v,d,c,N,x);return fh(W)}An=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var v=Rt(d.pendingLanes);v!==0&&(Hr(d,v|1),Hs(d,qe()),(Hn&6)===0&&(Eu=qe()+500,_i()))}break;case 13:tc(function(){var x=Ko(c,1);if(x!==null){var N=bs();Ua(x,c,1,N)}}),Wg(c,1)}},Ks=function(c){if(c.tag===13){var d=Ko(c,134217728);if(d!==null){var v=bs();Ua(d,c,134217728,v)}Wg(c,134217728)}},Ps=function(c){if(c.tag===13){var d=Wi(c),v=Ko(c,d);if(v!==null){var x=bs();Ua(v,c,d,x)}Wg(c,d)}},on=function(){return wn},yn=function(c,d){var v=wn;try{return wn=c,d()}finally{wn=v}},Tt=function(c,d,v){switch(d){case"input":if(Ke(c,v),d=v.name,v.type==="radio"&&d!=null){for(v=c;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<v.length;d++){var x=v[d];if(x!==c&&x.form===c.form){var N=Lf(x);if(!N)throw Error(n(90));$e(x),Ke(x,N)}}}break;case"textarea":re(c,v);break;case"select":d=v.value,d!=null&&X(c,!!v.multiple,d,!1)}},nt=Fg,qt=tc;var tD={usingClientEntryPoint:!1,Events:[Jd,du,Lf,Xe,rt,Fg]},h0={findFiberByHostInstance:Kl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nD={bundleType:h0.bundleType,version:h0.version,rendererPackageName:h0.rendererPackageName,rendererConfig:h0.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=et(c),c===null?null:c.stateNode},findFiberByHostInstance:h0.findFiberByHostInstance||JT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gh.isDisabled&&gh.supportsFiber)try{Qe=gh.inject(nD),F=gh}catch{}}return Os.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tD,Os.createPortal=function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gg(d))throw Error(n(200));return QT(c,d,null,v)},Os.createRoot=function(c,d){if(!Gg(c))throw Error(n(299));var v=!1,x="",N=ix;return d!=null&&(d.unstable_strictMode===!0&&(v=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onRecoverableError!==void 0&&(N=d.onRecoverableError)),d=Ug(c,1,!1,null,null,v,!1,x,N),c[zo]=d.current,qd(c.nodeType===8?c.parentNode:c),new Kg(d)},Os.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=et(d),c=c===null?null:c.stateNode,c},Os.flushSync=function(c){return tc(c)},Os.hydrate=function(c,d,v){if(!ph(d))throw Error(n(200));return mh(null,c,d,!0,v)},Os.hydrateRoot=function(c,d,v){if(!Gg(c))throw Error(n(405));var x=v!=null&&v.hydratedSources||null,N=!1,$="",W=ix;if(v!=null&&(v.unstable_strictMode===!0&&(N=!0),v.identifierPrefix!==void 0&&($=v.identifierPrefix),v.onRecoverableError!==void 0&&(W=v.onRecoverableError)),d=ax(d,null,c,1,v??null,N,!1,$,W),c[zo]=d.current,qd(c),x)for(c=0;c<x.length;c++)v=x[c],N=v._getVersion,N=N(v._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[v,N]:d.mutableSourceEagerHydrationData.push(v,N);return new hh(d)},Os.render=function(c,d,v){if(!ph(d))throw Error(n(200));return mh(null,c,d,!1,v)},Os.unmountComponentAtNode=function(c){if(!ph(c))throw Error(n(40));return c._reactRootContainer?(tc(function(){mh(null,null,c,!1,function(){c._reactRootContainer=null,c[zo]=null})}),!0):!1},Os.unstable_batchedUpdates=Fg,Os.unstable_renderSubtreeIntoContainer=function(c,d,v,x){if(!ph(v))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return mh(c,d,v,!1,x)},Os.version="18.3.1-next-f1338f8080-20240426",Os}var yx;function iS(){if(yx)return Qg.exports;yx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qg.exports=uD(),Qg.exports}var bx;function dD(){if(bx)return vh;bx=1;var e=iS();return vh.createRoot=e.createRoot,vh.hydrateRoot=e.hydrateRoot,vh}var fD=dD();/**
|
|
41
|
+
* react-router v7.18.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/var lS=e=>{throw TypeError(e)},cS=(e,t,n)=>t.has(e)||lS("Cannot "+n),wa=(e,t,n)=>(cS(e,t,"read from private field"),n?n.call(e):t.get(e)),R0=(e,t,n)=>t.has(e)?lS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wo=(e,t,n,r)=>(cS(e,t,"write to private field"),t.set(e,n),n),am=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,om=/^[\\/]{2}/;function uS(e,t){return t+e.replace(/\\/g,"/")}var xx="popstate";function kx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function hD(e={}){function t(r,a){var h;let i=(h=a.state)==null?void 0:h.masked,{pathname:l,search:u,hash:f}=i||r.location;return Q0("",{pathname:l,search:u,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Es(a)}return mD(t,n,null,e)}function fn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pD(){return Math.random().toString(36).substring(2,10)}function Sx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Q0(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Oo(t):t,state:n,key:t&&t.key||r||pD(),mask:a}}function Es({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Oo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function mD(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,u="POP",f=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function g(){u="POP";let k=p(),S=k==null?null:k-h;h=k,f&&f({action:u,location:b.location,delta:S})}function m(k,S){u="PUSH";let E=kx(k)?k:Q0(b.location,k,S);h=p()+1;let C=Sx(E,h),A=b.createHref(E.mask||E);try{l.pushState(C,"",A)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(A)}i&&f&&f({action:u,location:b.location,delta:1})}function w(k,S){u="REPLACE";let E=kx(k)?k:Q0(b.location,k,S);h=p();let C=Sx(E,h),A=b.createHref(E.mask||E);l.replaceState(C,"",A),i&&f&&f({action:u,location:b.location,delta:0})}function y(k){return dS(a,k)}let b={get action(){return u},get location(){return e(a,l)},listen(k){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(xx,g),f=k,()=>{a.removeEventListener(xx,g),f=null}},createHref(k){return t(a,k)},createURL:y,encodeLocation(k){let S=y(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:m,replace:w,go(k){return l.go(k)}};return b}function dS(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),fn(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:Es(t);return a=a.replace(/ $/,"%20"),!n&&om.test(a)&&(a=r+a),new URL(a,r)}var P0,Ex=class{constructor(e){if(R0(this,P0,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(wa(this,P0).has(e))return wa(this,P0).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){wa(this,P0).set(e,t)}};P0=new WeakMap;var gD=new Set(["lazy","caseSensitive","path","id","index","children"]);function vD(e){return gD.has(e)}var wD=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function yD(e){return wD.has(e)}function bD(e){return e.index===!0}function J0(e,t,n=[],r={},a=!1){return e.map((i,l)=>{let u=[...n,String(l)],f=typeof i.id=="string"?i.id:u.join("-");if(fn(i.index!==!0||!i.children,"Cannot specify children on an index route"),fn(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),bD(i)){let h={...i,id:f};return r[f]=Cx(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=Cx(h,t(h)),i.children&&(h.children=J0(i.children,t,u,r,a)),h}})}function Cx(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function fS(e,t,n="/"){return Wa(e,t,n,!1)}function Wa(e,t,n,r,a){let i=typeof t=="string"?Oo(t):t,l=sa(i.pathname||"/",n);if(l==null)return null;let u=a??qh(e),f=null,h=wS(l);for(let p=0;f==null&&p<u.length;++p)f=RD(u[p],h,r);return f}function hS(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function qh(e){let t=pS(e);return xD(t),t}function pS(e,t=[],n=[],r="",a=!1){let i=(l,u,f=a,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;fn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=Aa([r,p.relativePath]),m=n.concat(p);l.children&&l.children.length>0&&(fn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),pS(l.children,t,m,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:ND(g,l.index),routesMeta:m.map((w,y)=>{let[b,k]=vS(w.relativePath,w.caseSensitive,y===m.length-1);return{...w,matcher:b,compiledParams:k}})})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let h of mS(l.path))i(l,u,!0,h)}),t}function mS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=mS(r.join("/")),u=[];return u.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&u.push(...l),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function xD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:MD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var kD=/^:[\w-]+$/,SD=3,ED=2,CD=1,jD=10,AD=-2,jx=e=>e==="*";function ND(e,t){let n=e.split("/"),r=n.length;return n.some(jx)&&(r+=AD),t&&(r+=ED),n.filter(a=>!jx(a)).reduce((a,i)=>a+(kD.test(i)?SD:i===""?CD:jD),r)}function MD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function RD(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,p=i==="/"?t:t.slice(i.length)||"/",g={path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m=f.matcher&&f.compiledParams?gS(g,p,f.matcher,f.compiledParams):bl(g,p),w=f.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=bl({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:Aa([i,m.pathname]),pathnameBase:$D(Aa([i,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(i=Aa([i,m.pathnameBase]))}return l}function hs(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(nr(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",a=l=>l==null?"":typeof l=="string"?l:String(l),i=n.split(/\/+/).map((l,u,f)=>{if(u===f.length-1&&l==="*")return a(t["*"]);const p=l.match(/^:([\w-]+)(\??)(.*)/);if(p){const[,g,m,w]=p;let y=t[g];return fn(m==="?"||y!=null,`Missing ":${g}" param`),encodeURIComponent(a(y))+w}return l.replace(/\?$/g,"")}).filter(l=>!!l);return r+i.join("/")}function bl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=vS(e.path,e.caseSensitive,e.end);return gS(e,t,n,r)}function gS(e,t,n,r){let a=t.match(n);if(!a)return null;let i=a[0],l=fd(i,1),u=a.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:g},m)=>{if(p==="*"){let y=u[m]||"";l=fd(i.slice(0,i.length-y.length),1)}const w=u[m];return g&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:l,pattern:e}}function vS(e,t=!1,n=!0){nr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,f,h,p)=>{if(r.push({paramName:u,isOptional:f!=null}),f){let g=p.charAt(h+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function wS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function sa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function PD({basename:e,pathname:t}){return t==="/"?e:Aa([e,t])}var wv=e=>am.test(e);function LD(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Oo(e):e,i;return n?(n=yv(n),n.startsWith("/")||n.startsWith("\\")?i=Ax(n.substring(1),"/"):i=Ax(n,t)):i=t,{pathname:i,search:TD(r),hash:DD(a)}}function Ax(e,t){let n=fd(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function t8(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function im(e){let t=yS(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function N1(e,t,n,r=!1){let a;typeof e=="string"?a=Oo(e):(a={...e},fn(!a.pathname||!a.pathname.includes("?"),t8("?","pathname","search",a)),fn(!a.pathname||!a.pathname.includes("#"),t8("#","pathname","hash",a)),fn(!a.search||!a.search.includes("#"),t8("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),g-=1;a.pathname=m.join("/")}u=g>=0?t[g]:"/"}let f=LD(a,u),h=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var yv=e=>e.replace(/[\\/]{2,}/g,"/"),Aa=e=>yv(e.join("/"));function fd(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var $D=e=>fd(e).replace(/^\/*/,"/"),TD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,HD=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],M1=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function e1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function R1(e){let t=e.map(n=>n.route.path).filter(Boolean);return Aa(t)||"/"}var bS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xS(e,t){let n=e;if(typeof n!="string"||!am.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(bS)try{let i=new URL(window.location.href),l=om.test(n)?new URL(uS(n,i.protocol)):new URL(n),u=sa(l.pathname,t);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{nr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var ul=Symbol("Uninstrumented");function OD(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(i){let l=Object.keys(n);for(let u of l)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Uu(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(i=>{let l=a[i],u=n[`lazy.${i}`];if(typeof l=="function"&&u.length>0){let f=Uu(u,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(a=>{let i=t[a];if(typeof i=="function"&&n[a].length>0){let l=i[ul]??i,u=Uu(n[a],l,(...f)=>Nx(f[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[ul]=l,r[a]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let i=a[ul]??a,l=Uu(n.middleware,i,(...u)=>Nx(u[0]));return l?(l[ul]=i,l):a})),r}function ID(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let i=Object.keys(a);for(let l of i)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[ul]??e.navigate,a=Uu(n.navigate,r,(...i)=>{let[l,u]=i;return{to:typeof l=="number"||typeof l=="string"?l:l?Es(l):".",...Mx(e,u??{})}});a&&(a[ul]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[ul]??e.fetch,a=Uu(n.fetch,r,(...i)=>{let[l,,u,f]=i;return{href:u??".",fetcherKey:l,...Mx(e,f??{})}});a&&(a[ul]=r,e.fetch=a)}return e}function Uu(e,t,n){return e.length===0?null:async(...r)=>{let a=await kS(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function kS(e,t,n,r){let a=e[r],i;if(a){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=kS(e,t,n,r-1),i=await l,fn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await a(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await u(),await l}else try{i={type:"success",value:await n()}}catch(l){i={type:"error",value:l}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Nx(e){let{request:t,context:n,params:r,pattern:a}=e;return{request:FD(t),params:{...r},pattern:a,context:_D(n)}}function Mx(e,t){return{currentUrl:Es(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function FD(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function _D(e){if(ZD(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var VD=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ZD(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===VD}var Rx=new URL("http://localhost");function bv(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Rx)}catch{return Rx}}function n8(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function zD(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===""||e.slice(n.length).startsWith("//"):!1}function Xu(e,t,n,r){let a=null;try{a=e==null?null:new URL(e,n)}catch{}let i=new URL(t,n),l=a!=null&&!n8(a,n),u=!n8(i,n);if(r==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!zD(e,a)||!n8(a,i)))throw new Error("External navigation is not allowed")}var SS=["POST","PUT","PATCH","DELETE"],BD=new Set(SS),UD=["GET",...SS],WD=new Set(UD),ES=new Set([301,302,303,307,308]),KD=new Set([307,308]),r8={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},GD={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},m0={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},YD=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),CS="remix-router-transitions",jS=Symbol("ResetLoaderData"),dc,Ou,Ji,Iu,qD=class{constructor(e){R0(this,dc),R0(this,Ou),R0(this,Ji),R0(this,Iu),wo(this,dc,e),wo(this,Ou,qh(e))}get stableRoutes(){return wa(this,dc)}get activeRoutes(){return wa(this,Ji)??wa(this,dc)}get branches(){return wa(this,Iu)??wa(this,Ou)}get hasHMRRoutes(){return wa(this,Ji)!=null}setRoutes(e){wo(this,dc,e),wo(this,Ou,qh(e))}setHmrRoutes(e){wo(this,Ji,e),wo(this,Iu,qh(e))}commitHmrRoutes(){wa(this,Ji)&&(wo(this,dc,wa(this,Ji)),wo(this,Ou,wa(this,Iu)),wo(this,Ji,void 0),wo(this,Iu,void 0))}};dc=new WeakMap;Ou=new WeakMap;Ji=new WeakMap;Iu=new WeakMap;function XD(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";fn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||YD,i=a;if(e.instrumentations){let ne=e.instrumentations;i=le=>({...a(le),...OD(ne.map(ce=>ce.route).filter(Boolean),le)})}let l={},u=new qD(J0(e.routes,i,void 0,l)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=e.dataStrategy||nH,p={...e.future},g=null,m=new Set,w=null,y=null,b=null,k=null,S=e.hydrationData!=null,E=Wa(u.activeRoutes,e.history.location,f,!1,u.branches),C=!1,A=null,L,T;if(E==null&&!e.patchRoutesOnNavigation){let ne=ba(404,{pathname:e.history.location.pathname}),{matches:le,route:ce}=wh(u.activeRoutes);L=!0,T=!L,E=le,A={[ce.id]:ne}}else if(E&&!e.hydrationData&&Yt(E,u.activeRoutes,e.history.location.pathname).active&&(E=null),E)if(E.some(ne=>ne.route.lazy))L=!1,T=!L;else if(!E.some(ne=>xv(ne.route)))L=!0,T=!L;else{let ne=e.hydrationData?e.hydrationData.loaderData:null,le=e.hydrationData?e.hydrationData.errors:null,ce=E;if(le){let Ve=E.findIndex(_e=>le[_e.route.id]!==void 0);ce=ce.slice(0,Ve+1)}T=!1,L=!0,ce.forEach(Ve=>{let _e=AS(Ve.route,ne,le);T=T||_e.renderFallback,L=L&&!_e.shouldLoad})}else{L=!1,T=!L,E=[];let ne=Yt(null,u.activeRoutes,e.history.location.pathname);ne.active&&ne.matches&&(C=!0,E=ne.matches)}let M,j={historyAction:e.history.action,location:e.history.location,matches:E,initialized:L,renderFallback:T,navigation:r8,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},P="POP",R=null,H=!1,D,U=!1,V=new Map,B=null,G=!1,_=!1,O=new Set,I=new Map,K=0,z=-1,q=new Map,Z=new Set,ee=new Map,he=new Map,ue=new Set,ge=new Map,te,J=null;function Q(){if(g=e.history.listen(({action:ne,location:le,delta:ce})=>{if(te){te(),te=void 0;return}nr(ge.size===0||ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ve=Je({currentLocation:j.location,nextLocation:le,historyAction:ne});if(Ve&&ce!=null){let _e=new Promise(xt=>{te=xt});e.history.go(ce*-1),xe(Ve,{state:"blocked",location:le,proceed(){xe(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:le}),_e.then(()=>e.history.go(ce))},reset(){let xt=new Map(j.blockers);xt.set(Ve,m0),ie({blockers:xt})}}),R==null||R.resolve(),R=null;return}return Ke(ne,le)}),n){xH(t,V);let ne=()=>kH(t,V);t.addEventListener("pagehide",ne),B=()=>t.removeEventListener("pagehide",ne)}return j.initialized||Ke("POP",j.location,{initialHydration:!0}),M}function ae(){g&&g(),B&&B(),m.clear(),D&&D.abort(),j.fetchers.forEach((ne,le)=>ft(j.fetchers,le)),j.blockers.forEach((ne,le)=>Tt(le))}function $e(ne){if(m.add(ne),w){let{newErrors:le}=w;w=null,ne(j,{deletedFetchers:[],newErrors:le,viewTransitionOpts:void 0,flushSync:!1})}return()=>m.delete(ne)}function ie(ne,le={}){ne.matches&&(ne.matches=ne.matches.map(_e=>{let xt=l[_e.route.id],yt=_e.route;return yt.element!==xt.element||yt.errorElement!==xt.errorElement||yt.hydrateFallbackElement!==xt.hydrateFallbackElement?{..._e,route:xt}:_e})),j={...j,...ne};let ce=[],Ve=[];j.fetchers.forEach((_e,xt)=>{_e.state==="idle"&&(ue.has(xt)?ce.push(xt):Ve.push(xt))}),ue.forEach(_e=>{!j.fetchers.has(_e)&&!I.has(_e)&&ce.push(_e)}),m.size===0&&(w={newErrors:ne.errors??null}),[...m].forEach(_e=>_e(j,{deletedFetchers:ce,newErrors:ne.errors??null,viewTransitionOpts:le.viewTransitionOpts,flushSync:le.flushSync===!0})),ce.forEach(_e=>ft(j.fetchers,_e)),Ve.forEach(_e=>j.fetchers.delete(_e))}function ke(ne,le,{flushSync:ce}={}){var Ae,me;let Ve=j.actionData!=null&&j.navigation.formMethod!=null&&ls(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Ae=ne.state)==null?void 0:Ae._isRedirect)!==!0,_e;le.actionData?Object.keys(le.actionData).length>0?_e=le.actionData:_e=null:Ve?_e=j.actionData:_e=null;let xt=le.loaderData?_x(j.loaderData,le.loaderData,le.matches||[],le.errors):j.loaderData,yt=j.blockers;yt.size>0&&(yt=new Map(yt),yt.forEach((et,Ct)=>yt.set(Ct,m0)));let kt=G?!1:qt(ne,le.matches||j.matches),ot=H===!0||j.navigation.formMethod!=null&&ls(j.navigation.formMethod)&&((me=ne.state)==null?void 0:me._isRedirect)!==!0;u.commitHmrRoutes(),G||P==="POP"||(P==="PUSH"?e.history.push(ne,ne.state):P==="REPLACE"&&e.history.replace(ne,ne.state));let ht;if(P==="POP"){let et=V.get(j.location.pathname);et&&et.has(ne.pathname)?ht={currentLocation:j.location,nextLocation:ne}:V.has(ne.pathname)&&(ht={currentLocation:ne,nextLocation:j.location})}else if(U){let et=V.get(j.location.pathname);et?et.add(ne.pathname):(et=new Set([ne.pathname]),V.set(j.location.pathname,et)),ht={currentLocation:j.location,nextLocation:ne}}ie({...le,actionData:_e,loaderData:xt,historyAction:P,location:ne,initialized:!0,renderFallback:!1,navigation:r8,revalidation:"idle",restoreScrollPosition:kt,preventScrollReset:ot,blockers:yt},{viewTransitionOpts:ht,flushSync:ce===!0}),P="POP",H=!1,U=!1,G=!1,_=!1,R==null||R.resolve(),R=null,J==null||J.resolve(),J=null}async function ze(ne,le){if(R==null||R.resolve(),R=null,typeof ne=="number"){R||(R=Bx());let be=R.promise;return e.history.go(ne),be}let ce=N6(j.location,j.matches,f,ne,le==null?void 0:le.fromRouteId,le==null?void 0:le.relative),{path:Ve,submission:_e,error:xt}=Px(!1,ce,le),yt;if(le!=null&&le.mask){let be=typeof le.mask=="string"?Oo(le.mask):{...j.location.mask,...le.mask};if(yt={pathname:be.pathname??"",search:be.search??"",hash:be.hash??""},om.test(yt.pathname))throw new Error("External navigation is not allowed");yt.pathname.startsWith("\\")&&(yt.pathname=yt.pathname.replace(/^\\+/,"/")),Xu(typeof le.mask=="string"?le.mask:Es(le.mask),Es(yt),e.history.createURL("/"),"reject")}let kt=j.location,ot=Q0(kt,Ve,le&&le.state,void 0,yt);ot={...ot,...e.history.encodeLocation(ot)},Xu(ne==null?e.history.createHref(j.location):typeof ne=="string"?ne:Es(ne),e.history.createHref(ot.mask||ot),e.history.createURL("/"),"reject");let ht=le&&le.replace!=null?le.replace:void 0,Ae="PUSH";ht===!0?Ae="REPLACE":ht===!1||_e!=null&&ls(_e.formMethod)&&_e.formAction===j.location.pathname+j.location.search&&(Ae="REPLACE");let me=le&&"preventScrollReset"in le?le.preventScrollReset===!0:void 0,et=(le&&le.flushSync)===!0,Ct=Je({currentLocation:kt,nextLocation:ot,historyAction:Ae});if(Ct){xe(Ct,{state:"blocked",location:ot,proceed(){xe(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:ot}),ze(ne,le)},reset(){let be=new Map(j.blockers);be.set(Ct,m0),ie({blockers:be})}});return}await Ke(Ae,ot,{submission:_e,pendingError:xt,preventScrollReset:me,replace:le&&le.replace,enableViewTransition:le&&le.viewTransition,flushSync:et,callSiteDefaultShouldRevalidate:le&&le.defaultShouldRevalidate})}function wt(){J||(J=Bx()),Be(),ie({revalidation:"loading"});let ne=J.promise;return j.navigation.state==="submitting"?ne:j.navigation.state==="idle"?(Ke(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),ne):(Ke(P||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:U===!0}),ne)}async function Ke(ne,le,ce){D&&D.abort(),D=null,P=ne,G=(ce&&ce.startUninterruptedRevalidation)===!0,nt(j.location,j.matches),H=(ce&&ce.preventScrollReset)===!0,U=(ce&&ce.enableViewTransition)===!0;let Ve=u.activeRoutes,_e=ce!=null&&ce.initialHydration&&j.matches&&j.matches.length>0&&!C?j.matches:Wa(Ve,le,f,!1,u.branches),xt=(ce&&ce.flushSync)===!0;if(_e&&j.initialized&&!_&&dH(j.location,le)&&!(ce&&ce.submission&&ls(ce.submission.formMethod))){ke(le,{matches:_e},{flushSync:xt});return}let yt=Yt(_e,Ve,le.pathname);if(yt.active&&yt.matches&&(_e=yt.matches),!_e){let{error:vt,notFoundMatches:Te,route:qe}=Et(le.pathname);ke(le,{matches:Te,loaderData:{},errors:{[qe.id]:vt}},{flushSync:xt});return}let kt=ce&&ce.overrideNavigation?{...ce.overrideNavigation,matches:_e,historyAction:ne}:void 0;D=new AbortController;let ot=Fu(e.history,le,D.signal,ce&&ce.submission),ht=e.getContext?await e.getContext():new Ex,Ae;if(ce&&ce.pendingError)Ae=[al(_e).route.id,{type:"error",error:ce.pendingError}];else if(ce&&ce.submission&&ls(ce.submission.formMethod)){let vt=await tt(ot,le,ce.submission,_e,ne,ht,yt.active,ce&&ce.initialHydration===!0,{replace:ce.replace,flushSync:xt});if(vt.shortCircuited)return;if(vt.pendingActionResult){let[Te,qe]=vt.pendingActionResult;if(ea(qe)&&e1(qe.error)&&qe.error.status===404){D=null,ke(le,{matches:vt.matches,loaderData:{},errors:{[Te]:qe.error}});return}}_e=vt.matches||_e,Ae=vt.pendingActionResult,kt=s8(le,_e,ne,ce.submission),xt=!1,yt.active=!1,ot=Fu(e.history,ot.url,ot.signal)}let{shortCircuited:me,matches:et,loaderData:Ct,errors:be,workingFetchers:it}=await De(ot,le,_e,ne,ht,yt.active,kt,ce&&ce.submission,ce&&ce.fetcherSubmission,ce&&ce.replace,ce&&ce.initialHydration===!0,xt,Ae,ce&&ce.callSiteDefaultShouldRevalidate);me||(D=null,ke(le,{matches:et||_e,...Vx(Ae),loaderData:Ct,errors:be,...it?{fetchers:it}:{}}))}async function tt(ne,le,ce,Ve,_e,xt,yt,kt,ot={}){Be();let ht=yH(le,Ve,_e,ce);if(ie({navigation:ht},{flushSync:ot.flushSync===!0}),yt){let et=await an(Ve,le.pathname,ne.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:be,route:it}=wh(u.activeRoutes);return{matches:be,pendingActionResult:[it.id,{type:"error",error:et.error}]}}let Ct=al(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[Ct,{type:"error",error:et.error}]}}else if(et.matches)Ve=et.matches;else{let{notFoundMatches:Ct,error:be,route:it}=Et(le.pathname);return{matches:Ct,pendingActionResult:[it.id,{type:"error",error:be}]}}}let Ae,me=Xh(Ve,le);if(!me.route.action&&!me.route.lazy)Ae={type:"error",error:ba(405,{method:ne.method,pathname:le.pathname,routeId:me.route.id})};else{let et=Qu(i,l,ne,le,Ve,me,kt?[]:r,xt),Ct=await se(ne,le,et,xt,null);if(Ae=Ct[me.route.id],!Ae){for(let be of Ve)if(Ct[be.route.id]){Ae=Ct[be.route.id];break}}if(ne.signal.aborted)return{shortCircuited:!0}}if(yc(Ae)){let et;return ot&&ot.replace!=null?et=ot.replace:et=Ox(Ae.response.headers.get("Location"),new URL(ne.url),f,e.history)===j.location.pathname+j.location.search,await Y(ne,Ae,!0,{submission:ce,replace:et}),{shortCircuited:!0}}if(ea(Ae)){let et=al(Ve,me.route.id);return(ot&&ot.replace)!==!0&&(P="PUSH"),{matches:Ve,pendingActionResult:[et.route.id,Ae,me.route.id]}}return{matches:Ve,pendingActionResult:[me.route.id,Ae]}}async function De(ne,le,ce,Ve,_e,xt,yt,kt,ot,ht,Ae,me,et,Ct){let be=yt||s8(le,ce,Ve,kt),it=kt||ot||zx(be),vt=!G&&!Ae;if(xt){if(vt){let ct=Se(et);ie({navigation:be,...ct!==void 0?{actionData:ct}:{}},{flushSync:me})}let Le=await an(ce,le.pathname,ne.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:Ot,route:zt}=wh(u.activeRoutes);return{matches:Ot,loaderData:{},errors:{[zt.id]:Le.error}}}let ct=al(Le.partialMatches).route.id;return{matches:Le.partialMatches,loaderData:{},errors:{[ct]:Le.error}}}else if(Le.matches)ce=Le.matches;else{let{error:ct,notFoundMatches:Ot,route:zt}=Et(le.pathname);return{matches:Ot,loaderData:{},errors:{[zt.id]:ct}}}}let Te=u.activeRoutes,{dsMatches:qe,revalidatingFetchers:Lt}=Lx(ne,_e,i,l,e.history,j,ce,it,le,Ae?[]:r,Ae===!0,_,O,ue,ee,Z,Te,f,e.patchRoutesOnNavigation!=null,u.branches,et,Ct);if(z=++K,!e.dataStrategy&&!qe.some(Le=>Le.shouldLoad)&&!qe.some(Le=>Le.route.middleware&&Le.route.middleware.length>0)&&Lt.length===0){let Le=new Map(j.fetchers),ct=jt(Le);return ke(le,{matches:ce,loaderData:{},errors:et&&ea(et[1])?{[et[0]]:et[1].error}:null,...Vx(et),...ct?{fetchers:Le}:{}},{flushSync:me}),{shortCircuited:!0}}if(vt){let Le={};if(!xt){Le.navigation=be;let ct=Se(et);ct!==void 0&&(Le.actionData=ct)}Lt.length>0&&(Le.fetchers=X(Lt)),ie(Le,{flushSync:me})}Lt.forEach(Le=>{at(Le.key),Le.controller&&I.set(Le.key,Le.controller)});let Ut=()=>Lt.forEach(Le=>at(Le.key));D&&D.signal.addEventListener("abort",Ut);let{loaderResults:Nt,fetcherResults:_t}=await Ne(qe,Lt,ne,le,_e);if(ne.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Ut),Lt.forEach(Le=>I.delete(Le.key));let Me=yh(Nt);if(Me)return await Y(ne,Me.result,!0,{replace:ht}),{shortCircuited:!0};if(Me=yh(_t),Me)return Z.add(Me.key),await Y(ne,Me.result,!0,{replace:ht}),{shortCircuited:!0};let Ze=new Map(j.fetchers),{loaderData:Qe,errors:F}=Fx(j,ce,Nt,et,Lt,_t,Ze);Ae&&j.errors&&(F={...j.errors,...F});let de=jt(Ze),we=Ft(z,Ze),We=de||we||Lt.length>0;return{matches:ce,loaderData:Qe,errors:F,...We?{workingFetchers:Ze}:{}}}function Se(ne){if(ne&&!ea(ne[1]))return{[ne[0]]:ne[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function X(ne){let le=new Map(j.fetchers);return ne.forEach(ce=>{let Ve=le.get(ce.key),_e=g0(void 0,Ve?Ve.data:void 0);le.set(ce.key,_e)}),le}async function je(ne,le,ce,Ve){at(ne);let _e=(Ve&&Ve.flushSync)===!0,xt=u.activeRoutes,yt=N6(j.location,j.matches,f,ce,le,Ve==null?void 0:Ve.relative),kt=Wa(xt,yt,f,!1,u.branches),ot=Yt(kt,xt,yt);if(ot.active&&ot.matches&&(kt=ot.matches),!kt){Pe(ne,le,ba(404,{pathname:yt}),{flushSync:_e});return}let{path:ht,submission:Ae,error:me}=Px(!0,yt,Ve);if(me){Pe(ne,le,me,{flushSync:_e});return}let et=e.getContext?await e.getContext():new Ex,Ct=(Ve&&Ve.preventScrollReset)===!0;if(Ae&&ls(Ae.formMethod)){await Re(ne,le,ht,kt,et,ot.active,_e,Ct,Ae,Ve&&Ve.defaultShouldRevalidate);return}ee.set(ne,{routeId:le,path:ht}),await re(ne,le,ht,kt,et,ot.active,_e,Ct,Ae)}async function Re(ne,le,ce,Ve,_e,xt,yt,kt,ot,ht){Be(),ee.delete(ne);let Ae=j.fetchers.get(ne);st(ne,bH(ot,Ae),{flushSync:yt});let me=new AbortController,et=Fu(e.history,ce,me.signal,ot);if(xt){let Jt=await an(Ve,new URL(et.url).pathname,et.signal,ne);if(Jt.type==="aborted")return;if(Jt.type==="error"){Pe(ne,le,Jt.error,{flushSync:yt});return}else if(Jt.matches)Ve=Jt.matches;else{Pe(ne,le,ba(404,{pathname:ce}),{flushSync:yt});return}}let Ct=Xh(Ve,ce);if(!Ct.route.action&&!Ct.route.lazy){let Jt=ba(405,{method:ot.formMethod,pathname:ce,routeId:le});Pe(ne,le,Jt,{flushSync:yt});return}I.set(ne,me);let be=K,it=Qu(i,l,et,ce,Ve,Ct,r,_e),vt=await se(et,ce,it,_e,ne),Te=vt[Ct.route.id];if(!Te){for(let Jt of it)if(vt[Jt.route.id]){Te=vt[Jt.route.id];break}}if(et.signal.aborted){I.get(ne)===me&&I.delete(ne);return}if(ue.has(ne)){if(yc(Te)||ea(Te)){st(ne,xo(void 0));return}}else{if(yc(Te))if(I.delete(ne),z>be){st(ne,xo(void 0));return}else return Z.add(ne),st(ne,g0(ot)),Y(et,Te,!1,{fetcherSubmission:ot,preventScrollReset:kt});if(ea(Te)){Pe(ne,le,Te.error);return}}let qe=j.navigation.location||j.location,Lt=Fu(e.history,qe,me.signal),Ut=u.activeRoutes,Nt=j.navigation.state!=="idle"?Wa(Ut,j.navigation.location,f,!1,u.branches):j.matches;fn(Nt,"Didn't find any matches after fetcher action");let _t=++K;q.set(ne,_t);let{dsMatches:Me,revalidatingFetchers:Ze}=Lx(Lt,_e,i,l,e.history,j,Nt,ot,qe,r,!1,_,O,ue,ee,Z,Ut,f,e.patchRoutesOnNavigation!=null,u.branches,[Ct.route.id,Te],ht),Qe=g0(ot,Te.data),F=new Map(j.fetchers);F.set(ne,Qe),Ze.filter(Jt=>Jt.key!==ne).forEach(Jt=>{let Sn=Jt.key,Qn=F.get(Sn),un=g0(void 0,Qn?Qn.data:void 0);F.set(Sn,un),at(Sn),Jt.controller&&I.set(Sn,Jt.controller)}),ie({fetchers:F});let de=()=>Ze.forEach(Jt=>at(Jt.key));me.signal.addEventListener("abort",de);let{loaderResults:we,fetcherResults:We}=await Ne(Me,Ze,Lt,qe,_e);if(me.signal.aborted)return;me.signal.removeEventListener("abort",de),q.delete(ne),I.delete(ne),Ze.forEach(Jt=>I.delete(Jt.key));let Le=j.fetchers.has(ne),ct=Jt=>{if(!Le)return Jt;let Sn=new Map(Jt.fetchers);return Sn.set(ne,xo(Te.data)),{...Jt,fetchers:Sn}},Ot=yh(we);if(Ot)return j=ct(j),Y(Lt,Ot.result,!1,{preventScrollReset:kt});if(Ot=yh(We),Ot)return Z.add(Ot.key),j=ct(j),Y(Lt,Ot.result,!1,{preventScrollReset:kt});let zt=new Map(j.fetchers);Le&&zt.set(ne,xo(Te.data));let{loaderData:Rt,errors:kn}=Fx(j,Nt,we,void 0,Ze,We,zt);Ft(_t,zt),j.navigation.state==="loading"&&_t>z?(fn(P,"Expected pending action"),D&&D.abort(),ke(j.navigation.location,{matches:Nt,loaderData:Rt,errors:kn,fetchers:zt})):(ie({errors:kn,loaderData:_x(j.loaderData,Rt,Nt,kn),fetchers:zt}),_=!1)}async function re(ne,le,ce,Ve,_e,xt,yt,kt,ot){let ht=j.fetchers.get(ne);st(ne,g0(ot,ht?ht.data:void 0),{flushSync:yt});let Ae=new AbortController,me=Fu(e.history,ce,Ae.signal);if(xt){let Te=await an(Ve,new URL(me.url).pathname,me.signal,ne);if(Te.type==="aborted")return;if(Te.type==="error"){Pe(ne,le,Te.error,{flushSync:yt});return}else if(Te.matches)Ve=Te.matches;else{Pe(ne,le,ba(404,{pathname:ce}),{flushSync:yt});return}}let et=Xh(Ve,ce);I.set(ne,Ae);let Ct=K,be=Qu(i,l,me,ce,Ve,et,r,_e),it=await se(me,ce,be,_e,ne),vt=it[et.route.id];if(!vt){for(let Te of Ve)if(it[Te.route.id]){vt=it[Te.route.id];break}}if(I.get(ne)===Ae&&I.delete(ne),!me.signal.aborted){if(ue.has(ne)){st(ne,xo(void 0));return}if(yc(vt))if(z>Ct){st(ne,xo(void 0));return}else{Z.add(ne),await Y(me,vt,!1,{preventScrollReset:kt});return}if(ea(vt)){Pe(ne,le,vt.error);return}st(ne,xo(vt.data))}}async function Y(ne,le,ce,{submission:Ve,fetcherSubmission:_e,preventScrollReset:xt,replace:yt}={}){ce||(R==null||R.resolve(),R=null),le.response.headers.has("X-Remix-Revalidate")&&(_=!0);let kt=le.response.headers.get("Location");fn(kt,"Expected a Location header on the redirect Response");let ot=kt,ht=new URL(ne.url);kt=Ox(kt,ht,f,e.history),Xu(ot,kt,ht,"allow-explicit");let Ae=Q0(j.location,kt,{_isRedirect:!0});if(n){let vt=!1;if(le.response.headers.has("X-Remix-Reload-Document"))vt=!0;else if(wv(kt)){const Te=dS(t,kt,!0);vt=Te.origin!==t.location.origin||sa(Te.pathname,f)==null}if(vt){yt?t.location.replace(kt):t.location.assign(kt);return}}D=null;let me=yt===!0||le.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:Ct,formEncType:be}=j.navigation;!Ve&&!_e&&et&&Ct&&be&&(Ve=zx(j.navigation));let it=Ve||_e;if(KD.has(le.response.status)&&it&&ls(it.formMethod))await Ke(me,Ae,{submission:{...it,formAction:kt},preventScrollReset:xt||H,enableViewTransition:ce?U:void 0});else{let vt=s8(Ae,[],me,Ve);await Ke(me,Ae,{overrideNavigation:vt,fetcherSubmission:_e,preventScrollReset:xt||H,enableViewTransition:ce?U:void 0})}}async function se(ne,le,ce,Ve,_e){var kt;let xt,yt={};try{xt=await sH(h,ne,le,ce,_e,Ve,!1)}catch(ot){return ce.filter(ht=>ht.shouldLoad).forEach(ht=>{yt[ht.route.id]={type:"error",error:ot}}),yt}if(ne.signal.aborted)return yt;if(!ls(ne.method))for(let ot of ce){if(((kt=xt[ot.route.id])==null?void 0:kt.type)==="error")break;!xt.hasOwnProperty(ot.route.id)&&!j.loaderData.hasOwnProperty(ot.route.id)&&(!j.errors||!j.errors.hasOwnProperty(ot.route.id))&&ot.shouldCallHandler()&&(xt[ot.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ot.route.id}`)})}for(let[ot,ht]of Object.entries(xt))if(mH(ht)){let Ae=ht.result;yt[ot]={type:"redirect",response:lH(Ae,ne,ot,ce,f)}}else yt[ot]=await iH(ht);return yt}async function Ne(ne,le,ce,Ve,_e){let xt=se(ce,Ve,ne,_e,null),yt=Promise.all(le.map(async ht=>{if(ht.matches&&ht.match&&ht.request&&ht.controller){let me=(await se(ht.request,ht.path,ht.matches,_e,ht.key))[ht.match.route.id];return{[ht.key]:me}}else return Promise.resolve({[ht.key]:{type:"error",error:ba(404,{pathname:ht.path})}})})),kt=await xt,ot=(await yt).reduce((ht,Ae)=>Object.assign(ht,Ae),{});return{loaderResults:kt,fetcherResults:ot}}function Be(){_=!0,ee.forEach((ne,le)=>{I.has(le)&&O.add(le),at(le)})}function st(ne,le,ce={}){let Ve=new Map(j.fetchers);Ve.set(ne,le),ie({fetchers:Ve},{flushSync:(ce&&ce.flushSync)===!0})}function Pe(ne,le,ce,Ve={}){let _e=al(j.matches,le),xt=new Map(j.fetchers);ft(xt,ne),ie({errors:{[_e.route.id]:ce},fetchers:xt},{flushSync:(Ve&&Ve.flushSync)===!0})}function Oe(ne){return he.set(ne,(he.get(ne)||0)+1),ue.has(ne)&&ue.delete(ne),j.fetchers.get(ne)||GD}function Ge(ne,le){at(ne,le==null?void 0:le.reason),st(ne,xo(null))}function ft(ne,le){let ce=j.fetchers.get(le);I.has(le)&&!(ce&&ce.state==="loading"&&q.has(le))&&at(le),ee.delete(le),q.delete(le),Z.delete(le),ue.delete(le),O.delete(le),ne.delete(le)}function bt(ne){let le=(he.get(ne)||0)-1;le<=0?(he.delete(ne),ue.add(ne)):he.set(ne,le),ie({fetchers:new Map(j.fetchers)})}function at(ne,le){let ce=I.get(ne);ce&&(ce.abort(le),I.delete(ne))}function Zt(ne,le){for(let ce of ne){let Ve=le.get(ce);fn(Ve,`Expected fetcher: ${ce}`);let _e=xo(Ve.data);le.set(ce,_e)}}function jt(ne){let le=[],ce=!1;for(let Ve of Z){let _e=ne.get(Ve);fn(_e,`Expected fetcher: ${Ve}`),_e.state==="loading"&&(Z.delete(Ve),le.push(Ve),ce=!0)}return Zt(le,ne),ce}function Ft(ne,le){let ce=[];for(let[Ve,_e]of q)if(_e<ne){let xt=le.get(Ve);fn(xt,`Expected fetcher: ${Ve}`),xt.state==="loading"&&(at(Ve),q.delete(Ve),ce.push(Ve))}return Zt(ce,le),ce.length>0}function Pt(ne,le){let ce=j.blockers.get(ne)||m0;return ge.get(ne)!==le&&ge.set(ne,le),ce}function Tt(ne){j.blockers.delete(ne),ge.delete(ne)}function xe(ne,le){let ce=j.blockers.get(ne)||m0;fn(ce.state==="unblocked"&&le.state==="blocked"||ce.state==="blocked"&&le.state==="blocked"||ce.state==="blocked"&&le.state==="proceeding"||ce.state==="blocked"&&le.state==="unblocked"||ce.state==="proceeding"&&le.state==="unblocked",`Invalid blocker state transition: ${ce.state} -> ${le.state}`);let Ve=new Map(j.blockers);Ve.set(ne,le),ie({blockers:Ve})}function Je({currentLocation:ne,nextLocation:le,historyAction:ce}){if(ge.size===0)return;ge.size>1&&nr(!1,"A router only supports one blocker at a time");let Ve=Array.from(ge.entries()),[_e,xt]=Ve[Ve.length-1],yt=j.blockers.get(_e);if(!(yt&&yt.state==="proceeding")&&xt({currentLocation:ne,nextLocation:le,historyAction:ce}))return _e}function Et(ne){let le=ba(404,{pathname:ne}),ce=u.activeRoutes,{matches:Ve,route:_e}=wh(ce);return{notFoundMatches:Ve,route:_e,error:le}}function Xe(ne,le,ce){if(y=ne,k=le,b=ce||null,!S&&j.navigation===r8){S=!0;let Ve=qt(j.location,j.matches);Ve!=null&&ie({restoreScrollPosition:Ve})}return()=>{y=null,k=null,b=null}}function rt(ne,le){return b&&b(ne,le.map(Ve=>hS(Ve,j.loaderData)))||ne.key}function nt(ne,le){if(y&&k){let ce=rt(ne,le);y[ce]=k()}}function qt(ne,le){if(y){let ce=rt(ne,le),Ve=y[ce];if(typeof Ve=="number")return Ve}return null}function Yt(ne,le,ce){if(e.patchRoutesOnNavigation){let Ve=u.branches;if(ne){if(Object.keys(ne[0].params).length>0)return{active:!0,matches:Wa(le,ce,f,!0,Ve)}}else return{active:!0,matches:Wa(le,ce,f,!0,Ve)||[]}}return{active:!1,matches:null}}async function an(ne,le,ce,Ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:ne};let _e=ne;for(;;){let xt=l;try{await e.patchRoutesOnNavigation({signal:ce,path:le,matches:_e,fetcherKey:Ve,patch:(ht,Ae)=>{ce.aborted||$x(ht,Ae,u,xt,i,!1)}})}catch(ht){return{type:"error",error:ht,partialMatches:_e}}if(ce.aborted)return{type:"aborted"};let yt=u.branches,kt=Wa(u.activeRoutes,le,f,!1,yt),ot=null;if(kt){if(Object.keys(kt[0].params).length===0)return{type:"success",matches:kt};if(ot=Wa(u.activeRoutes,le,f,!0,yt),!(ot&&_e.length<ot.length&&Wt(_e,ot.slice(0,_e.length))))return{type:"success",matches:kt}}if(ot||(ot=Wa(u.activeRoutes,le,f,!0,yt)),!ot||Wt(_e,ot))return{type:"success",matches:null};_e=ot}}function Wt(ne,le){return ne.length===le.length&&ne.every((ce,Ve)=>ce.route.id===le[Ve].route.id)}function Rn(ne){l={},u.setHmrRoutes(J0(ne,i,void 0,l))}function Bt(ne,le,ce=!1){$x(ne,le,u,l,i,ce),u.hasHMRRoutes||ie({})}return M={get basename(){return f},get future(){return p},get state(){return j},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return t},initialize:Q,subscribe:$e,enableScrollRestoration:Xe,navigate:ze,fetch:je,revalidate:wt,createHref:ne=>e.history.createHref(ne),createURL:ne=>e.history.createURL(ne),encodeLocation:ne=>e.history.encodeLocation(ne),getFetcher:Oe,resetFetcher:Ge,deleteFetcher:bt,dispose:ae,getBlocker:Pt,deleteBlocker:Tt,patchRoutes:Bt,_internalFetchControllers:I,_internalSetRoutes:Rn,_internalSetStateDoNotUseOrYouWillBreakYourApp(ne){ie(ne)}},e.instrumentations&&(M=ID(M,e.instrumentations.map(ne=>ne.router).filter(Boolean))),M}function QD(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function N6(e,t,n,r,a,i){let l,u;if(a){l=[];for(let h of t)if(l.push(h),h.route.id===a){u=h;break}}else l=t,u=t[t.length-1];let f=N1(r||".",im(l),sa(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=Sv(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let p=new URLSearchParams(f.search),g=p.getAll("index");p.delete("index"),g.filter(w=>w).forEach(w=>p.append("index",w));let m=p.toString();f.search=m?`?${m}`:""}}return n!=="/"&&(f.pathname=PD({basename:n,pathname:f.pathname})),Es(f)}function Px(e,t,n){if(!n||!QD(n))return{path:t};if(n.formMethod&&!wH(n.formMethod))return{path:t,error:ba(405,{method:n.formMethod})};let r=()=>({path:t,error:ba(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=TS(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ls(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,[w,y])=>`${m}${w}=${y}
|
|
50
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!ls(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}fn(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=P6(n.formData),f=n.formData;else if(n.body instanceof FormData)u=P6(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Ix(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Ix(u)}catch{return r()}let h={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(ls(h.formMethod))return{path:t,submission:h};let p=Oo(t);return e&&p.search&&Sv(p.search)&&u.append("index",""),p.search=`?${u}`,{path:Es(p),submission:h}}function Lx(e,t,n,r,a,i,l,u,f,h,p,g,m,w,y,b,k,S,E,C,A,L){var G;let T=A?ea(A[1])?A[1].error:A[1].data:void 0,M=a.createURL(i.location),j=a.createURL(f),P;if(p&&i.errors){let _=Object.keys(i.errors)[0];P=l.findIndex(O=>O.route.id===_)}else if(A&&ea(A[1])){let _=A[0];P=l.findIndex(O=>O.route.id===_)-1}let R=A?A[1].statusCode:void 0,H=R&&R>=400,D={currentUrl:M,currentParams:((G=i.matches[0])==null?void 0:G.params)||{},nextUrl:j,nextParams:l[0].params,...u,actionResult:T,actionStatus:R},U=R1(l),V=l.map((_,O)=>{let{route:I}=_,K=null;if(P!=null&&O>P)K=!1;else if(I.lazy)K=!0;else if(!xv(I))K=!1;else if(p){let{shouldLoad:ee}=AS(I,i.loaderData,i.errors);K=ee}else JD(i.loaderData,i.matches[O],_)&&(K=!0);if(K!==null)return M6(n,r,e,f,U,_,h,t,K);let z=!1;typeof L=="boolean"?z=L:H?z=!1:(g||M.pathname+M.search===j.pathname+j.search||M.search!==j.search||eH(i.matches[O],_))&&(z=!0);let q={...D,defaultShouldRevalidate:z},Z=V0(_,q);return M6(n,r,e,f,U,_,h,t,Z,q,L)}),B=[];return y.forEach((_,O)=>{if(p||!l.some(ue=>ue.route.id===_.routeId)||w.has(O))return;let I=i.fetchers.get(O),K=I&&I.state!=="idle"&&I.data===void 0,z=Wa(k,_.path,S??"/",!1,C);if(!z){if(E&&K)return;B.push({key:O,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(b.has(O))return;let q=Xh(z,_.path),Z=new AbortController,ee=Fu(a,_.path,Z.signal),he=null;if(m.has(O))m.delete(O),he=Qu(n,r,ee,_.path,z,q,h,t);else if(K)g&&(he=Qu(n,r,ee,_.path,z,q,h,t));else{let ue;typeof L=="boolean"?ue=L:H?ue=!1:ue=g;let ge={...D,defaultShouldRevalidate:ue};V0(q,ge)&&(he=Qu(n,r,ee,_.path,z,q,h,t,ge))}he&&B.push({key:O,routeId:_.routeId,path:_.path,matches:he,match:q,request:ee,controller:Z})}),{dsMatches:V,revalidatingFetchers:B}}function xv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function AS(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!xv(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;if(!r&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let i=!r&&!a;return{shouldLoad:i,renderFallback:i}}function JD(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function eH(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function V0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function $x(e,t,n,r,a,i){let l;if(e){let h=r[e];fn(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),l=h.children}else l=n.activeRoutes;let u=[],f=[];if(t.forEach(h=>{let p=l.find(g=>NS(h,g));p?f.push({existingRoute:p,newRoute:h}):u.push(h)}),u.length>0){let h=J0(u,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...h)}if(i&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:p,newRoute:g}=f[h],m=p,[w]=J0([g],a,[],{},!0);Object.assign(m,{element:w.element?w.element:m.element,errorElement:w.errorElement?w.errorElement:m.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:m.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function NS(e,t){var n;return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:((n=e.children)==null?void 0:n.every((r,a)=>{var i;return(i=t.children)==null?void 0:i.some(l=>NS(r,l))}))??!1:!1}var Tx=new WeakMap,MS=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(fn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let l=Tx.get(a);l||(l={},Tx.set(a,l));let u=l[e];if(u)return u;let f=(async()=>{let h=vD(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(h)nr(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)nr(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await i();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},Dx=new WeakMap;function tH(e,t,n,r,a){let i=n[e.id];if(fn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=Dx.get(i);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{fn(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),w={};for(let y in m){let b=m[y];if(b===void 0)continue;let k=yD(y),E=i[y]!==void 0&&y!=="hasErrorBoundary";k?nr(!k,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?nr(!E,`Route "${i.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):w[y]=b}Object.assign(i,w),Object.assign(i,{...r(i),lazy:void 0})})();return Dx.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(e.lazy),u=[],f;for(let p of l){if(a&&a.includes(p))continue;let g=MS({key:p,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),p===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function Hx(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,i)=>{n[t[i].route.id]=a}),n}async function nH(e){return e.matches.some(t=>t.route.middleware)?RS(e,()=>Hx(e)):Hx(e)}function RS(e,t){return rH(e,t,r=>{if(vH(r))throw r;return r},hH,n);function n(r,a,i){if(i)return Promise.resolve(Object.assign(i.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,u=Math.min(Math.max(l.findIndex(h=>h.route.id===a),0),Math.max(l.findIndex(h=>h.shouldCallHandler()),0)),f=al(l,l[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function rH(e,t,n,r,a){let{matches:i,...l}=e,u=i.flatMap(h=>h.route.middleware?h.route.middleware.map(p=>[h.route.id,p]):[]);return await PS(l,u,t,n,r,a)}async function PS(e,t,n,r,a,i,l=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[l];if(!f)return await n();let[h,p]=f,g,m=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await PS(e,t,n,r,a,i,l+1)},g.value}catch(w){return g={value:await i(w,h,g)},g.value}};try{let w=await p(e,m),y=w!=null?r(w):void 0;return a(y)?y:g?y??g.value:(g={value:await m()},g.value)}catch(w){return await i(w,h,g)}}function LS(e,t,n,r,a){let i=MS({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=tH(r.route,ls(n.method)?"action":"loader",t,e,a);return{middleware:i,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function M6(e,t,n,r,a,i,l,u,f,h=null,p){let g=!1,m=LS(e,t,n,i,l);return{...i,_lazyPromises:m,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(w){return g=!0,h?typeof p=="boolean"?V0(i,{...h,defaultShouldRevalidate:p}):typeof w=="boolean"?V0(i,{...h,defaultShouldRevalidate:w}):V0(i,h):f},resolve(w){let{lazy:y,loader:b,middleware:k}=i.route,S=g||f||w&&!ls(n.method)&&(y||b),E=k&&k.length>0&&!b&&!y;return S&&(ls(n.method)||!E)?aH({request:n,path:r,pattern:a,match:i,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:w,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Qu(e,t,n,r,a,i,l,u,f=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:LS(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:M6(e,t,n,r,R1(a),h,l,u,!0,f))}async function sH(e,t,n,r,a,i,l){r.some(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(r.map(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware}));let u={request:t,url:$S(t,n),pattern:R1(r),params:r[0].params,context:i,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let g=u;return RS(g,()=>p({...g,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>{var g,m;return[(g=p._lazyPromises)==null?void 0:g.handler,(m=p._lazyPromises)==null?void 0:m.route]}))}catch{}return h}async function aH({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,h,p=ls(e.method),g=p?"action":"loader",m=w=>{let y,b=new Promise((E,C)=>y=C);h=()=>y(),e.signal.addEventListener("abort",h);let k=E=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${r.route.id}]`)):w({request:e,url:$S(e,t),pattern:n,params:r.params,context:u},...E!==void 0?[E]:[]),S=(async()=>{try{return{type:"data",result:await(l?l(C=>k(C)):k())}}catch(E){return{type:"error",result:E}}})();return Promise.race([S,b])};try{let w=p?r.route.action:r.route.loader;if(a||i)if(w){let y,[b]=await Promise.all([m(w).catch(k=>{y=k}),a,i]);if(y!==void 0)throw y;f=b}else{await a;let y=p?r.route.action:r.route.loader;if(y)[f]=await Promise.all([m(y),i]);else if(g==="action"){let b=new URL(e.url),k=b.pathname+b.search;throw ba(405,{method:e.method,pathname:k,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)f=await m(w);else{let y=new URL(e.url),b=y.pathname+y.search;throw ba(404,{pathname:b})}}catch(w){return{type:"error",result:w}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function oH(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function iH(e){var r,a,i,l,u;let{result:t,type:n}=e;if(kv(t)){let f;try{f=await oH(t)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new M1(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Zx(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:fH(t),statusCode:e1(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:e1(t)?t.status:void 0}:Zx(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function lH(e,t,n,r,a){let i=e.headers.get("Location");if(fn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!wv(i)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=N6(new URL(t.url),l,a,i),e.headers.set("Location",i)}return e}var cH=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function R6(e){try{return cH.includes(new URL(e).protocol)}catch{return!1}}function Ox(e,t,n,r){if(wv(e)){let a=e,i=om.test(a)?new URL(uS(a,t.protocol)):new URL(a);if(R6(i.toString()))throw new Error("Invalid redirect location");let l=sa(i.pathname,n)!=null;if(i.origin===t.origin&&l)return yv(i.pathname)+i.search+i.hash}try{let a=r.createURL(e);if(R6(a.toString()))throw new Error("Invalid redirect location")}catch{}return e}function Fu(e,t,n,r){let a=e.createURL(TS(t)).toString(),i={signal:n};if(r&&ls(r.formMethod)){let{formMethod:l,formEncType:u}=r;i.method=l.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=P6(r.formData):i.body=r.formData}return new Request(a,i)}function $S(e,t){let n=new URL(e.url),r=typeof t=="string"?Oo(t):t;if(n.pathname=r.pathname||"/",r.search){let a=new URLSearchParams(r.search),i=a.getAll("index");a.delete("index");for(let l of i.filter(Boolean))a.append("index",l);n.search=a.size?`?${a.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function P6(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ix(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function uH(e,t,n,r=!1,a=!1){let i={},l=null,u,f=!1,h={},p=n&&ea(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let m=g.route.id,w=t[m];if(fn(!yc(w),"Cannot handle redirect results in processLoaderData"),ea(w)){let y=w.error;if(p!==void 0&&(y=p,p=void 0),l=l||{},a)l[m]=y;else{let b=al(e,m);l[b.route.id]==null&&(l[b.route.id]=y)}r||(i[m]=jS),f||(f=!0,u=e1(w.error)?w.error.status:500),w.headers&&(h[m]=w.headers)}else i[m]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[m]=w.headers)}),p!==void 0&&n&&(l={[n[0]]:p},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:l,statusCode:u||200,loaderHeaders:h}}function Fx(e,t,n,r,a,i,l){let{loaderData:u,errors:f}=uH(t,n,r);return a.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:g,controller:m}=h;if(m&&m.signal.aborted)return;let w=i[p];if(fn(w,"Did not find corresponding fetcher result"),ea(w)){let y=al(e.matches,g==null?void 0:g.route.id);f&&f[y.route.id]||(f={...f,[y.route.id]:w.error}),l.delete(p)}else if(yc(w))fn(!1,"Unhandled fetcher revalidation redirect");else{let y=xo(w.data);l.set(p,y)}}),{loaderData:u,errors:f}}function _x(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==jS).reduce((i,[l,u])=>(i[l]=u,i),{});for(let i of n){let l=i.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&i.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function Vx(e){return e?ea(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function al(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function wh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ba(e,{pathname:t,routeId:n,method:r,type:a,message:i}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new M1(e||500,l,new Error(u),!0)}function yh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(yc(a))return{key:r,result:a}}}function TS(e){let t=typeof e=="string"?Oo(e):e;return Es({...t,hash:""})}function dH(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function fH(e){var t,n;return new M1(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function hH(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&pH(n))}function pH(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function mH(e){return kv(e.result)&&ES.has(e.result.status)}function ea(e){return e.type==="error"}function yc(e){return(e&&e.type)==="redirect"}function Zx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function kv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function gH(e){return ES.has(e)}function vH(e){return kv(e)&&gH(e.status)&&e.headers.has("Location")}function wH(e){return WD.has(e.toUpperCase())}function ls(e){return BD.has(e.toUpperCase())}function Sv(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xh(e,t){let n=typeof t=="string"?Oo(t).search:t.search;if(e[e.length-1].route.index&&Sv(n||""))return e[e.length-1];let r=yS(e);return r[r.length-1]}function zx(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:i,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function s8(e,t,n,r){return r?{state:"loading",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function yH(e,t,n,r){return{state:"submitting",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function g0(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function bH(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function xo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function xH(e,t){try{let n=e.sessionStorage.getItem(CS);if(n){let r=JSON.parse(n);for(let[a,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function kH(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(CS,JSON.stringify(n))}catch(r){nr(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Bx(){let e,t,n=new Promise((r,a)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{a(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var _c=s.createContext(null);_c.displayName="DataRouter";var jd=s.createContext(null);jd.displayName="DataRouterState";var DS=s.createContext(!1);function HS(){return s.useContext(DS)}var Ev=s.createContext({isTransitioning:!1});Ev.displayName="ViewTransition";var OS=s.createContext(new Map);OS.displayName="Fetchers";var SH=s.createContext(null);SH.displayName="Await";var Rs=s.createContext(null);Rs.displayName="Navigation";var lm=s.createContext(null);lm.displayName="Location";var $a=s.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Cv=s.createContext(null);Cv.displayName="RouteError";var IS="REACT_ROUTER_ERROR",EH="REDIRECT",CH="ROUTE_ERROR_RESPONSE";function jH(e){if(e.startsWith(`${IS}:${EH}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function AH(e){if(e.startsWith(`${IS}:${CH}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new M1(t.status,t.statusText,t.data)}catch{}}function NH(e,{relative:t}={}){fn(Vc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=s.useContext(Rs),{hash:a,pathname:i,search:l}=P1(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:Aa([n,i])),r.createHref({pathname:u,search:l,hash:a})}function Vc(){return s.useContext(lm)!=null}function Bn(){return fn(Vc(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(lm).location}function mn(e){fn(Vc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Bn();return s.useMemo(()=>bl(e,wS(t)),[t,e])}var FS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _S(e){s.useContext(Rs).static||s.useLayoutEffect(e)}function Un(){let{isDataRoute:e}=s.useContext($a);return e?ZH():MH()}function MH(){fn(Vc(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(_c),{basename:t,navigator:n}=s.useContext(Rs),{matches:r}=s.useContext($a),{pathname:a}=Bn(),i=JSON.stringify(im(r)),l=s.useRef(!1);return _S(()=>{l.current=!0}),s.useCallback((f,h={})=>{if(nr(l.current,FS),!l.current)return;if(typeof f=="number"){n.go(f);return}let p=N1(f,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Aa([t,p.pathname])),Xu(typeof f=="string"?f:Es(f),n.createHref(p),bv(n),"reject"),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,i,a,e])}var VS=s.createContext(null);function RH(){return s.useContext(VS)}function PH(e){let t=s.useContext($a).outlet;return s.useMemo(()=>t&&s.createElement(VS.Provider,{value:e},t),[t,e])}function aa(){let{matches:e}=s.useContext($a),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function P1(e,{relative:t}={}){let{matches:n}=s.useContext($a),{pathname:r}=Bn(),a=JSON.stringify(im(n));return s.useMemo(()=>N1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function LH(e,t,n){fn(Vc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=s.useContext(Rs),{matches:a}=s.useContext($a),i=a[a.length-1],l=i?i.params:{},u=i?i.pathname:"/",f=i?i.pathnameBase:"/",h=i&&i.route;{let k=h&&h.path||"";US(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
51
|
+
|
|
52
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=Bn(),g;g=p;let m=g.pathname||"/",w=m;if(f!=="/"){let k=f.replace(/^\//,"").split("/");w="/"+m.replace(/^\//,"").split("/").slice(k.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(k=>Object.assign(k,{route:n.manifest[k.route.id]||k.route})):fS(e,{pathname:w});return nr(h||y!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),nr(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),OH(y&&y.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:Aa([f,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:Aa([f,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),a,n)}function $H(){let e=BS(),t=e1(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=s.createElement(s.Fragment,null,s.createElement("p",null,"💿 Hey developer 👋"),s.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",s.createElement("code",{style:i},"ErrorBoundary")," or"," ",s.createElement("code",{style:i},"errorElement")," prop on your route.")),s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),n?s.createElement("pre",{style:a},n):null,l)}var TH=s.createElement($H,null),ZS=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=AH(e.digest);n&&(e=n)}let t=e!==void 0?s.createElement($a.Provider,{value:this.props.routeContext},s.createElement(Cv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?s.createElement(DH,{error:e},t):t}};ZS.contextType=DS;var a8=new WeakMap;function DH({children:e,error:t}){let{basename:n,navigator:r}=s.useContext(Rs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=jH(t.digest);if(a){let i=a8.get(t);if(i)throw i;let l=xS(a.location,n),u=l.absoluteURL||l.to;if(Xu(a.location,u,bv(r),"allow-explicit"),R6(u))throw new Error("Invalid redirect location");if(bS&&!a8.get(t))if(l.isExternal||a.reloadDocument)window.location.href=u;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw a8.set(t,f),f}return s.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function HH({routeContext:e,match:t,children:n}){let r=s.useContext(_c);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement($a.Provider,{value:e},n)}function OH(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let p=a.findIndex(g=>g.route.id&&(i==null?void 0:i[g.route.id])!==void 0);fn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<a.length;p++){let g=a[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=p),g.route.id){let{loaderData:m,errors:w}=r,y=g.route.loader&&!m.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||y){n.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(p,g)=>{var m,w;f(p,{location:r.location,params:((w=(m=r.matches)==null?void 0:m[0])==null?void 0:w.params)??{},pattern:R1(r.matches),errorInfo:g})}:void 0;return a.reduceRight((p,g,m)=>{let w,y=!1,b=null,k=null;r&&(w=i&&g.route.id?i[g.route.id]:void 0,b=g.route.errorElement||TH,l&&(u<0&&m===0?(US("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,k=null):u===m&&(y=!0,k=g.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,m+1)),E=()=>{let C;return w?C=b:y?C=k:g.route.Component?C=s.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=p,s.createElement(HH,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:C})};return r&&(g.route.ErrorBoundary||g.route.errorElement||m===0)?s.createElement(ZS,{location:r.location,revalidation:r.revalidation,component:b,error:w,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):E()},null)}function jv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IH(e){let t=s.useContext(_c);return fn(t,jv(e)),t}function Av(e){let t=s.useContext(jd);return fn(t,jv(e)),t}function FH(e){let t=s.useContext($a);return fn(t,jv(e)),t}function Nv(e){let t=FH(e),n=t.matches[t.matches.length-1];return fn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function _H(){return Nv("useRouteId")}function VH(){let e=Av("useNavigation");return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function zS(){let{matches:e,loaderData:t}=Av("useMatches");return s.useMemo(()=>e.map(n=>hS(n,t)),[e,t])}function BS(){var r;let e=s.useContext(Cv),t=Av("useRouteError"),n=Nv("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function ZH(){let{router:e}=IH("useNavigate"),t=Nv("useNavigate"),n=s.useRef(!1);return _S(()=>{n.current=!0}),s.useCallback(async(a,i={})=>{nr(n.current,FS),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Ux={};function US(e,t,n){!t&&!Ux[e]&&(Ux[e]=!0,nr(!1,n))}var Wx={};function Kx(e,t){!e&&!Wx[t]&&(Wx[t]=!0,console.warn(t))}var zH="useOptimistic",Gx=Fc[zH],BH=()=>{};function UH(e){return Gx?Gx(e):[e,BH]}function WH(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&nr(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:s.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&nr(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:s.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&nr(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var KH=["HydrateFallback","hydrateFallbackElement"],GH=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function YH({router:e,flushSync:t,onError:n,useTransitions:r}){r=HS()||r;let[i,l]=s.useState(e.state),[u,f]=UH(i),[h,p]=s.useState(),[g,m]=s.useState({isTransitioning:!1}),[w,y]=s.useState(),[b,k]=s.useState(),[S,E]=s.useState(),C=s.useRef(new Map),A=s.useCallback((j,{deletedFetchers:P,newErrors:R,flushSync:H,viewTransitionOpts:D})=>{R&&n&&Object.values(R).forEach(V=>{var B;return n(V,{location:j.location,params:((B=j.matches[0])==null?void 0:B.params)??{},pattern:R1(j.matches)})}),j.fetchers.forEach((V,B)=>{V.data!==void 0&&C.current.set(B,V.data)}),P.forEach(V=>C.current.delete(V)),Kx(H===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let U=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Kx(D==null||U,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!U){t&&H?t(()=>l(j)):r===!1?l(j):s.startTransition(()=>{r===!0&&f(V=>Yx(V,j)),l(j)});return}if(t&&H){t(()=>{b&&(w==null||w.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>l(j))});V.finished.finally(()=>{t(()=>{y(void 0),k(void 0),p(void 0),m({isTransitioning:!1})})}),t(()=>k(V));return}b?(w==null||w.resolve(),b.skipTransition(),E({state:j,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(p(j),m({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,b,w,r,f,n]);s.useLayoutEffect(()=>e.subscribe(A),[e,A]),s.useEffect(()=>{g.isTransitioning&&!g.flushSync&&y(new GH)},[g]),s.useEffect(()=>{if(w&&h&&e.window){let j=h,P=w.promise,R=e.window.document.startViewTransition(async()=>{r===!1?l(j):s.startTransition(()=>{r===!0&&f(H=>Yx(H,j)),l(j)}),await P});R.finished.finally(()=>{y(void 0),k(void 0),p(void 0),m({isTransitioning:!1})}),k(R)}},[h,w,e.window,r,f]),s.useEffect(()=>{w&&h&&u.location.key===h.location.key&&w.resolve()},[w,b,u.location,h]),s.useEffect(()=>{!g.isTransitioning&&S&&(p(S.state),m({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[g.isTransitioning,S]);let L=s.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:j=>e.navigate(j),push:(j,P,R)=>e.navigate(j,{state:P,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(j,P,R)=>e.navigate(j,{replace:!0,state:P,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[e]),T=e.basename||"/",M=s.useMemo(()=>({router:e,navigator:L,static:!1,basename:T,onError:n}),[e,L,T,n]);return s.createElement(s.Fragment,null,s.createElement(_c.Provider,{value:M},s.createElement(jd.Provider,{value:u},s.createElement(OS.Provider,{value:C.current},s.createElement(Ev.Provider,{value:g},s.createElement(QH,{basename:T,location:u.location,navigationType:u.historyAction,navigator:L,useTransitions:r},s.createElement(qH,{routes:e.routes,manifest:e.manifest,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function Yx(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var qH=s.memo(XH);function XH({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return LH(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function Pa({to:e,replace:t,state:n,relative:r}){fn(Vc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:i}=s.useContext(Rs);nr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=s.useContext($a),{pathname:u}=Bn(),f=Un(),h=N1(e,im(l),u,r==="path");Xu(typeof e=="string"?e:Es(e),i.createHref(h),bv(i),"reject");let p=JSON.stringify(h);return s.useEffect(()=>{f(JSON.parse(p),{replace:t,state:n,relative:r})},[f,p,r,t,n]),null}function Zc(e){return PH(e.context)}function QH({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:l}){fn(!Vc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=s.useMemo(()=>({basename:u,navigator:a,static:i,useTransitions:l,future:{}}),[u,a,i,l]);typeof n=="string"&&(n=Oo(n));let{pathname:h="/",search:p="",hash:g="",state:m=null,key:w="default",mask:y}=n,b=s.useMemo(()=>{let k=sa(h,u);return k==null?null:{location:{pathname:k,search:p,hash:g,state:m,key:w,mask:y},navigationType:r}},[u,h,p,g,m,w,r,y]);return nr(b!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:s.createElement(Rs.Provider,{value:f},s.createElement(lm.Provider,{children:t,value:b}))}var Qh="get",Jh="application/x-www-form-urlencoded";function cm(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function JH(e){return cm(e)&&e.tagName.toLowerCase()==="button"}function eO(e){return cm(e)&&e.tagName.toLowerCase()==="form"}function tO(e){return cm(e)&&e.tagName.toLowerCase()==="input"}function nO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rO(e,t){return e.button===0&&(!t||t==="_self")&&!nO(e)}function L6(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function sO(e,t){let n=L6(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var bh=null;function aO(){if(bh===null)try{new FormData(document.createElement("form"),0),bh=!1}catch{bh=!0}return bh}var oO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function o8(e){return e!=null&&!oO.has(e)?(nr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jh}"`),null):e}function iO(e,t){let n,r,a,i,l;if(eO(e)){let u=e.getAttribute("action");r=u?sa(u,t):null,n=e.getAttribute("method")||Qh,a=o8(e.getAttribute("enctype"))||Jh,i=new FormData(e)}else if(JH(e)||tO(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?sa(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Qh,a=o8(e.getAttribute("formenctype"))||o8(u.getAttribute("enctype"))||Jh,i=new FormData(u,e),!aO()){let{name:h,type:p,value:g}=e;if(p==="image"){let m=h?`${h}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else h&&i.append(h,g)}}else{if(cm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qh,r=null,a=Jh,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var lO={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},cO=/[&><\u2028\u2029]/g;function qx(e){return e.replace(cO,t=>lO[t])}function Mv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WS(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&sa(a.pathname,t)==="/"?a.pathname=`${fd(t)}/_root.${r}`:a.pathname=`${fd(a.pathname)}.${r}`,a}async function uO(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dO(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function fO(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await uO(i,n);return l.links?l.links():[]}return[]}));return gO(r.flat(1).filter(dO).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Xx(e,t,n,r,a,i){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var p;return n[h].pathname!==f.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,h)=>l(f,h)||u(f,h)):i==="data"?t.filter((f,h)=>{var g;let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(l(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function hO(e,t,{includeHydrateFallback:n}={}){return pO(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function pO(e){return[...new Set(e)]}function mO(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function gO(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(mO(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function Rv(){let e=s.useContext(_c);return Mv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function vO(){let e=s.useContext(jd);return Mv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var um=s.createContext(void 0);um.displayName="FrameworkContext";function dm(){let e=s.useContext(um);return Mv(e,"You must render this element inside a <HydratedRouter> element"),e}function wO(e,t){let n=s.useContext(um),[r,a]=s.useState(!1),[i,l]=s.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,m=s.useRef(null);s.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=S=>{S.forEach(E=>{l(E.isIntersecting)})},k=new IntersectionObserver(b,{threshold:.5});return m.current&&k.observe(m.current),()=>{k.disconnect()}}},[e]),s.useEffect(()=>{if(r){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[r]);let w=()=>{a(!0)},y=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:v0(u,w),onBlur:v0(f,y),onMouseEnter:v0(h,w),onMouseLeave:v0(p,y),onTouchStart:v0(g,w)}]:[!1,m,{}]}function v0(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yO({page:e,...t}){let n=HS(),{nonce:r}=dm(),{router:a}=Rv(),i=s.useMemo(()=>fS(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(xO,{page:e,matches:i,...t}):s.createElement(kO,{page:e,matches:i,...t})):null}function bO(e){let{manifest:t,routeModules:n}=dm(),[r,a]=s.useState([]);return s.useEffect(()=>{let i=!1;return fO(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function xO({page:e,matches:t,...n}){let r=Bn(),{future:a}=dm(),{basename:i}=Rv(),l=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let u=WS(e,i,a.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?f=!0:h.push(p.route.id);return f&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[i,a.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,l.map(u=>s.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function kO({page:e,matches:t,...n}){let r=Bn(),{future:a,manifest:i,routeModules:l}=dm(),{basename:u}=Rv(),{loaderData:f,matches:h}=vO(),p=s.useMemo(()=>Xx(e,t,h,i,r,"data"),[e,t,h,i,r]),g=s.useMemo(()=>Xx(e,t,h,i,r,"assets"),[e,t,h,i,r]),m=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,k=!1;if(t.forEach(E=>{var A;let C=i.routes[E.route.id];!C||!C.hasLoader||(!p.some(L=>L.route.id===E.route.id)&&E.route.id in f&&((A=l[E.route.id])!=null&&A.shouldRevalidate)||C.hasClientLoader?k=!0:b.add(E.route.id))}),b.size===0)return[];let S=WS(e,u,a.v8_trailingSlashAwareDataRequests,"data");return k&&b.size>0&&S.searchParams.set("_routes",t.filter(E=>b.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[u,a.v8_trailingSlashAwareDataRequests,f,r,i,p,t,e,l]),w=s.useMemo(()=>hO(g,i),[g,i]),y=bO(g);return s.createElement(s.Fragment,null,m.map(b=>s.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),w.map(b=>s.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:k})=>s.createElement("link",{key:b,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function SO(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var EO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{EO&&(window.__reactRouterVersion="7.18.3")}catch{}function CO(e,t){return XD({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:hD({window:t==null?void 0:t.window}),hydrationData:jO(),routes:e,mapRouteProperties:WH,hydrationRouteProperties:KH,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,instrumentations:t==null?void 0:t.instrumentations}).initialize()}function jO(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:AO(e.errors)}),e}function AO(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new M1(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(typeof a.__subType=="string"&&HD.includes(a.__subType)){let i=window[a.__subType];if(typeof i=="function")try{let l=new i(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(a.message);i.stack="",n[r]=i}}else n[r]=a;return n}var Vn=s.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,mask:u,state:f,target:h,to:p,preventScrollReset:g,viewTransition:m,defaultShouldRevalidate:w,...y},b){let{basename:k,navigator:S,useTransitions:E}=s.useContext(Rs),C=typeof p=="string"&&am.test(p),A=xS(p,k);p=A.to;let L=NH(p,{relative:a}),T=Bn(),M=null;if(u){let B=N1(u,[],T.mask?T.mask.pathname:"/",!0);k!=="/"&&(B.pathname=B.pathname==="/"?k:Aa([k,B.pathname])),M=S.createHref(B)}let[j,P,R]=wO(r,y),H=PO(p,{replace:l,mask:u,state:f,target:h,preventScrollReset:g,relative:a,viewTransition:m,defaultShouldRevalidate:w,useTransitions:E});function D(B){t&&t(B),B.defaultPrevented||H(B)}let U=!(A.isExternal||i),V=s.createElement("a",{...y,...R,href:(U?M:void 0)||A.absoluteURL||L,onClick:U?D:t,ref:SO(b,P),target:h,"data-discover":!C&&n==="render"?"true":void 0});return j&&!C?s.createElement(s.Fragment,null,V,s.createElement(yO,{page:L})):V});Vn.displayName="Link";var NO=s.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:u,children:f,...h},p){let g=P1(l,{relative:h.relative}),m=Bn(),w=s.useContext(jd),{navigator:y,basename:b}=s.useContext(Rs),k=w!=null&&IO(g)&&u===!0,S=y.encodeLocation?y.encodeLocation(g).pathname:g.pathname,E=m.pathname,C=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(E=E.toLowerCase(),C=C?C.toLowerCase():null,S=S.toLowerCase()),C&&b&&(C=sa(C,b)||C);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let L=E===S||!a&&E.startsWith(S)&&E.charAt(A)==="/",T=C!=null&&(C===S||!a&&C.startsWith(S)&&C.charAt(S.length)==="/"),M={isActive:L,isPending:T,isTransitioning:k},j=L?t:void 0,P;typeof r=="function"?P=r(M):P=[r,L?"active":null,T?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let R=typeof i=="function"?i(M):i;return s.createElement(Vn,{...h,"aria-current":j,className:P,ref:p,style:R,to:l,viewTransition:u},typeof f=="function"?f(M):f)});NO.displayName="NavLink";var MO=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=Qh,action:u,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:m,...w},y)=>{let{useTransitions:b}=s.useContext(Rs),k=TO(),S=DO(u,{relative:h}),E=l.toLowerCase()==="get"?"get":"post",C=typeof u=="string"&&am.test(u),A=L=>{if(f&&f(L),L.defaultPrevented)return;L.preventDefault();let T=L.nativeEvent.submitter,M=(T==null?void 0:T.getAttribute("formmethod"))||l,j=()=>k(T||L.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:a,state:i,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:m});b&&n!==!1?s.startTransition(()=>j()):j()};return s.createElement("form",{ref:y,method:E,action:S,onSubmit:r?f:A,...w,"data-discover":!C&&e==="render"?"true":void 0})});MO.displayName="Form";function KS({getKey:e,storageKey:t,...n}){let r=s.useContext(um),{basename:a}=s.useContext(Rs),i=Bn(),l=zS();HO({getKey:e,storageKey:t});let u=s.useMemo(()=>{if(!r||!e)return null;let h=T6(i,l,a,e);return h!==i.key?h:null},[]);if(!r||r.isSpaMode)return null;let f=((h,p)=>{if(!window.history.state||!window.history.state.key){let g=Math.random().toString(32).slice(2);window.history.replaceState({key:g},"")}try{let m=JSON.parse(sessionStorage.getItem(h)||"{}")[p||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(g){console.error(g),sessionStorage.removeItem(h)}}).toString();return n.nonce==null&&(r!=null&&r.nonce)&&(n.nonce=r.nonce),s.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${f})(${qx(JSON.stringify(t||$6))}, ${qx(JSON.stringify(u))})`}})}KS.displayName="ScrollRestoration";function GS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pv(e){let t=s.useContext(_c);return fn(t,GS(e)),t}function RO(e){let t=s.useContext(jd);return fn(t,GS(e)),t}function PO(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f,useTransitions:h}={}){let p=Un(),g=Bn(),m=P1(e,{relative:l});return s.useCallback(w=>{if(rO(w,t)){w.preventDefault();let y=n!==void 0?n:Es(g)===Es(m),b=()=>p(e,{replace:y,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f});h?s.startTransition(()=>b()):b()}},[g,p,m,n,r,a,t,e,i,l,u,f,h])}function Al(e){nr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=s.useRef(L6(e)),n=s.useRef(!1),r=Bn(),a=s.useMemo(()=>sO(r.search,n.current?null:t.current),[r.search]),i=Un(),l=s.useCallback((u,f)=>{const h=L6(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,i("?"+h,f)},[i,a]);return[a,l]}var LO=0,$O=()=>`__${String(++LO)}__`;function TO(){let{router:e}=Pv("useSubmit"),{basename:t}=s.useContext(Rs),n=_H(),r=e.fetch,a=e.navigate;return s.useCallback(async(i,l={})=>{let{action:u,method:f,encType:h,formData:p,body:g}=iO(i,t);if(l.navigate===!1){let m=l.fetcherKey||$O();await r(m,n,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function DO(e,{relative:t}={}){let{basename:n}=s.useContext(Rs),r=s.useContext($a);fn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...P1(e||".",{relative:t})},l=Bn();if(e==null){i.search=l.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(p=>p==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Aa([n,i.pathname])),Es(i)}var $6="react-router-scroll-positions",xh={};function T6(e,t,n,r){let a=null;return r&&(n!=="/"?a=r({...e,pathname:sa(e.pathname,n)||e.pathname},t):a=r(e,t)),a==null&&(a=e.key),a}function HO({getKey:e,storageKey:t}={}){let{router:n}=Pv("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:a}=RO("useScrollRestoration"),{basename:i}=s.useContext(Rs),l=Bn(),u=zS(),f=VH();s.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),OO(s.useCallback(()=>{if(f.state==="idle"){let h=T6(l,u,i,e);xh[h]=window.scrollY}try{sessionStorage.setItem(t||$6,JSON.stringify(xh))}catch(h){nr(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${h}).`)}window.history.scrollRestoration="auto"},[f.state,e,i,l,u,t])),typeof document<"u"&&(s.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(t||$6);h&&(xh=JSON.parse(h))}catch{}},[t]),s.useLayoutEffect(()=>{let h=n==null?void 0:n.enableScrollRestoration(xh,()=>window.scrollY,e?(p,g)=>T6(p,g,i,e):void 0);return()=>h&&h()},[n,i,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}}catch{nr(!1,`"${l.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[l,r,a]))}function OO(e,t){let{capture:n}={};s.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function IO(e,{relative:t}={}){let n=s.useContext(Ev);fn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Pv("useViewTransitionState"),a=P1(e,{relative:t});if(!n.isTransitioning)return!1;let i=sa(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=sa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bl(a.pathname,l)!=null||bl(a.pathname,i)!=null}const FO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.41,51.63a108,108,0,1,0,0,152.74A107.38,107.38,0,0,0,204.41,51.63Zm-17,17A83.85,83.85,0,0,1,196.26,79L169,111.09l-23.3-65.21A83.52,83.52,0,0,1,187.43,68.6Zm-118.85,0a83.44,83.44,0,0,1,51.11-24.2l14.16,39.65L65.71,71.61C66.64,70.59,67.59,69.59,68.58,68.6ZM48,153.7a84.48,84.48,0,0,1,3.4-60.3L92.84,101Zm20.55,33.7A83.94,83.94,0,0,1,59.74,177L87,144.91l23.3,65.21A83.53,83.53,0,0,1,68.58,187.4Zm36.36-63.61,15.18-17.85,23.06,4.21,7.88,22.06-15.17,17.85-23.06-4.21Zm82.49,63.61a83.49,83.49,0,0,1-51.11,24.2L122.15,172l68.14,12.44C189.36,185.41,188.41,186.41,187.43,187.4ZM163.16,155,208,102.3a84.43,84.43,0,0,1-3.41,60.3Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M195.88,60.12a96,96,0,1,0,0,135.76A96,96,0,0,0,195.88,60.12Zm-55.34,103h0l-36.68-6.69h0L91.32,121.3l24.14-28.41h0l36.68,6.69,12.54,35.12Z",opacity:"0.2"}),s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,0,0,54.46,54.46,104,104,0,0,0,128,232h.09A104,104,0,0,0,232,128ZM49.18,88.92l51.21,9.35L46.65,161.53A88.39,88.39,0,0,1,49.18,88.92Zm160.17,5.54a88.41,88.41,0,0,1-2.53,72.62l-51.21-9.35Zm-8.08-15.2L167.55,119,139.63,40.78a87.38,87.38,0,0,1,50.6,25A88.74,88.74,0,0,1,201.27,79.26ZM122.43,40.19l17.51,49L58.3,74.32a89.28,89.28,0,0,1,7.47-8.55A87.37,87.37,0,0,1,122.43,40.19ZM54.73,176.74,88.45,137l27.92,78.18a88,88,0,0,1-61.64-38.48Zm78.84,39.06-17.51-49L139.14,171h0l58.52,10.69a87.5,87.5,0,0,1-64.13,34.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.12,55.88A102,102,0,0,0,55.87,200.12,102,102,0,1,0,200.12,55.88Zm-102,66.67,19.65-23.14,29.86,5.46,10.21,28.58-19.65,23.14-29.86-5.46ZM209.93,90.69a90.24,90.24,0,0,1-2,78.63l-56.14-10.24Zm-6.16-11.28-36.94,43.48L136.66,38.42a89.31,89.31,0,0,1,55,25.94A91.33,91.33,0,0,1,203.77,79.41Zm-139.41-15A89.37,89.37,0,0,1,123.81,38.1L143,91.82,54.75,75.71A91.2,91.2,0,0,1,64.36,64.36ZM48,86.68l56.14,10.24L46.07,165.31a90.24,90.24,0,0,1,2-78.63Zm4.21,89.91,36.94-43.48,30.17,84.47a89.31,89.31,0,0,1-55-25.94A91.33,91.33,0,0,1,52.23,176.59Zm139.41,15a89.32,89.32,0,0,1-59.45,26.26L113,164.18l88.24,16.11A91.2,91.2,0,0,1,191.64,191.64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198.71,57.29A100,100,0,1,0,57.29,198.71,100,100,0,1,0,198.71,57.29Zm10.37,114.27-61-11.14L210.4,87a92.26,92.26,0,0,1-1.32,84.52ZM95.87,122.13,117,97.24l32.14,5.86,11,30.77L139,158.76l-32.14-5.86ZM206.24,79.58l-40.13,47.25L133.75,36.2a92.09,92.09,0,0,1,72.49,43.38ZM63,63a91.31,91.31,0,0,1,62.26-26.88L146,94.41,51.32,77.11A92.94,92.94,0,0,1,63,63Zm-16,21.49,61,11.14L45.6,169a92.26,92.26,0,0,1,1.32-84.52Zm2.84,92,40.13-47.25,32.36,90.63a92.09,92.09,0,0,1-72.49-43.38Zm143.29,16.63a91.31,91.31,0,0,1-62.26,26.88L110,161.59l94.72,17.3A92.94,92.94,0,0,1,193.05,193.05Z"}))]]),_O=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V88a20,20,0,0,0,16,19.6V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V107.6A20,20,0,0,0,244,88V64A20,20,0,0,0,224,44ZM36,68H220V84H36ZM52,188V108H204v80Zm112-52a12,12,0,0,1-12,12H104a12,12,0,0,1,0-24h48A12,12,0,0,1,164,136Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,96v96a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm-72,96H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm72-56H32V64H224V88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V88a14,14,0,0,0,14,14h2v90a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V102h2a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM210,192a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V102H210ZM226,88a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2ZM98,136a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,136Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V88a12,12,0,0,0,12,12h4v92a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V100h4a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM212,192a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V100H212ZM228,88a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4ZM100,136a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,136Z"}))]]),VO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40.49-100.49a12,12,0,0,1-17,17L140,117v51a12,12,0,0,1-24,0V117l-11.51,11.52a12,12,0,0,1-17-17l32-32a12,12,0,0,1,17,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,101.66a8,8,0,0,1-11.32,0L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,165.66,125.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm36.24-102.24a6,6,0,1,1-8.48,8.48L134,102.49V168a6,6,0,0,1-12,0V102.49l-21.76,21.75a6,6,0,0,1-8.48-8.48l32-32a6,6,0,0,1,8.48,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-102.83a4,4,0,0,1-5.66,5.66L132,97.66V168a4,4,0,0,1-8,0V97.66L98.83,122.83a4,4,0,0,1-5.66-5.66l32-32a4,4,0,0,1,5.66,0Z"}))]]),ZO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),zO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),BO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),UO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,143.51a12,12,0,0,1-17,17L140,109V224a12,12,0,0,1-24,0V109L64.49,160.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0ZM216,28H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,144H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M133.66,66.34a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,152h64v72a8,8,0,0,0,16,0V152h64a8,8,0,0,0,5.66-13.66ZM75.31,136,128,83.31,180.69,136ZM224,40a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34A8,8,0,0,1,200,152H136v72a8,8,0,0,1-16,0V152H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,139.76a6,6,0,1,1-8.48,8.48L134,86.49V224a6,6,0,0,1-12,0V86.49L60.24,148.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0ZM216,34H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34a8,8,0,0,1-11.32,11.32L136,91.31V224a8,8,0,0,1-16,0V91.31L61.66,149.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,141.17a4,4,0,0,1-5.66,5.66L132,81.66V224a4,4,0,0,1-8,0V81.66L58.83,146.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0ZM216,36H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"}))]]),WO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),s.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),KO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),GO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),YO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),qO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120.49,167.51a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L68,179V48a12,12,0,0,1,24,0V179l11.51-11.52A12,12,0,0,1,120.49,167.51Zm96-96-32-32a12,12,0,0,0-17,0l-32,32a12,12,0,0,0,17,17L164,77V208a12,12,0,0,0,24,0V77l11.51,11.52a12,12,0,0,0,17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,48V208H80V48Z",opacity:"0.2"}),s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M119.39,172.94a8,8,0,0,1-1.73,8.72l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,48,168H72V48a8,8,0,0,1,16,0V168h24A8,8,0,0,1,119.39,172.94Zm94.27-98.6-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,144,88h24V208a8,8,0,0,0,16,0V88h24a8,8,0,0,0,5.66-13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L74,193.51V48a6,6,0,0,1,12,0V193.51l21.76-21.75A6,6,0,0,1,116.24,171.76Zm96-96-32-32a6,6,0,0,0-8.48,0l-32,32a6,6,0,0,0,8.48,8.48L170,62.49V208a6,6,0,0,0,12,0V62.49l21.76,21.75a6,6,0,0,0,8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M114.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L76,198.34V48a4,4,0,0,1,8,0V198.34l25.17-25.17A4,4,0,0,1,114.83,173.17Zm96-96-32-32a4,4,0,0,0-5.66,0l-32,32a4,4,0,0,0,5.66,5.66L172,57.66V208a4,4,0,0,0,8,0V57.66l25.17,25.17a4,4,0,1,0,5.66-5.66Z"}))]]),XO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]),QO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z",opacity:"0.2"}),s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z"}))]]),JO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z",opacity:"0.2"}),s.createElement("path",{d:"M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z"}))]]),eI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),s.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),tI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),s.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]),nI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),s.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),rI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),s.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),sI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40V208H152V40Z",opacity:"0.2"}),s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z"}))]]),aI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),oI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"}))]]),iI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]),lI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),cI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,72V216H40V72Z",opacity:"0.2"}),s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,72V216a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H184A8,8,0,0,1,192,72Zm24-40H72a8,8,0,0,0,0,16H208V184a8,8,0,0,0,16,0V40A8,8,0,0,0,216,32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,66H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H184a6,6,0,0,0,6-6V72A6,6,0,0,0,184,66Zm-6,144H46V78H178ZM222,40V184a6,6,0,0,1-12,0V46H72a6,6,0,0,1,0-12H216A6,6,0,0,1,222,40Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,68H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H184a4,4,0,0,0,4-4V72A4,4,0,0,0,184,68Zm-4,144H44V76H180ZM220,40V184a4,4,0,0,1-8,0V44H72a4,4,0,0,1,0-8H216A4,4,0,0,1,220,40Z"}))]]),uI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,12H80A28,28,0,0,0,52,40V216a28,28,0,0,0,28,28h96a28,28,0,0,0,28-28V40A28,28,0,0,0,176,12ZM76,76H180V180H76Zm4-40h96a4,4,0,0,1,4,4V52H76V40A4,4,0,0,1,80,36Zm96,184H80a4,4,0,0,1-4-4V204H180v12A4,4,0,0,1,176,220Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,56V200H64V56Z",opacity:"0.2"}),s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM80,32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,18H80A22,22,0,0,0,58,40V216a22,22,0,0,0,22,22h96a22,22,0,0,0,22-22V40A22,22,0,0,0,176,18ZM70,62H186V194H70ZM80,30h96a10,10,0,0,1,10,10V50H70V40A10,10,0,0,1,80,30Zm96,196H80a10,10,0,0,1-10-10V206H186v10A10,10,0,0,1,176,226Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,20H80A20,20,0,0,0,60,40V216a20,20,0,0,0,20,20h96a20,20,0,0,0,20-20V40A20,20,0,0,0,176,20ZM68,60H188V196H68ZM80,28h96a12,12,0,0,1,12,12V52H68V40A12,12,0,0,1,80,28Zm96,200H80a12,12,0,0,1-12-12V204H188v12A12,12,0,0,1,176,228Z"}))]]),dI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),fI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,32V224a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16V32A16,16,0,0,1,96,16h64A16,16,0,0,1,176,32Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,16H96A16,16,0,0,0,80,32V224a16,16,0,0,0,16,16h64a16,16,0,0,0,16-16V32A16,16,0,0,0,160,16ZM128,208a12,12,0,1,1,12-12A12,12,0,0,1,128,208Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,72Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M118,60a10,10,0,1,1,10,10A10,10,0,0,1,118,60Zm10,58a10,10,0,1,0,10,10A10,10,0,0,0,128,118Zm0,68a10,10,0,1,0,10,10A10,10,0,0,0,128,186Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,60a8,8,0,1,1,8,8A8,8,0,0,1,120,60Zm8,60a8,8,0,1,0,8,8A8,8,0,0,0,128,120Zm0,68a8,8,0,1,0,8,8A8,8,0,0,0,128,188Z"}))]]),hI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]),pI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,100H132.92l78.14-20.63a12,12,0,0,0,8.52-14.75l-8.16-30a19.94,19.94,0,0,0-24.3-13.95L34.79,60.87a19.74,19.74,0,0,0-12.14,9.27,19.48,19.48,0,0,0-1.95,15L28,112v88a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V112A12,12,0,0,0,216,100ZM124.89,61.91l18.29,10.56-25.95,6.85L98.94,68.76Zm64.45-17,3.91,14.35-17.13,4.52L157.83,53.21ZM66,77.46,84.29,88l-35.4,9.35L45,83ZM204,196H52V124H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M67.71,64.59l47.79,27.6L40.43,112,32.27,82a7.76,7.76,0,0,1,5.58-9.52ZM199.84,37.76a7.9,7.9,0,0,0-9.66-5.49L126.61,49.05,174.4,76.64,208,67.77Z",opacity:"0.2"}),s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07L164.57,71,136.44,54.72ZM77.55,70.27l28.12,16.24-59.6,15.73-6-22.08Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,106H86.68L209.53,73.57a6,6,0,0,0,4.26-7.38l-8.16-30a13.94,13.94,0,0,0-17-9.72L36.32,66.67a13.77,13.77,0,0,0-8.48,6.47,13.57,13.57,0,0,0-1.36,10.42L34,111.34c0,.22,0,.44,0,.66v88a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V112A6,6,0,0,0,216,106ZM125.75,55.48l33,19.07-42.43,11.2-33-19.07Zm66-17.41a1.92,1.92,0,0,1,2.34,1.26l6.57,24.18L175.26,70.2l-33-19.07ZM38.23,79.14a1.85,1.85,0,0,1,1.15-.87L66.86,71l33,19.08L44.66,104.68l-6.6-24.27A1.63,1.63,0,0,1,38.23,79.14ZM210,200a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V118H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,108H71.26L209,71.64a4,4,0,0,0,2.84-4.92l-8.16-30a11.92,11.92,0,0,0-14.54-8.31L36.83,68.61a11.78,11.78,0,0,0-7.26,5.53A11.59,11.59,0,0,0,28.41,83l7.67,28.19A3.87,3.87,0,0,0,36,112v88a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V112A4,4,0,0,0,216,108ZM126,53.33l38,21.92L116.08,87.9,78.12,66Zm65.16-17.2a4,4,0,0,1,1-.13A3.88,3.88,0,0,1,196,38.81l7.1,26.12L175,72.35,137,50.43Zm-154.7,42a3.86,3.86,0,0,1,2.37-1.8l28.27-7.46,38,21.91L43.25,107.12,36.13,80.94A3.66,3.66,0,0,1,36.5,78.14ZM212,200a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V116H212Z"}))]]),mI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),gI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84ZM104,132h48a12,12,0,0,1,0,24H104a12,12,0,0,1,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H104a6,6,0,0,1,0-12h48A6,6,0,0,1,158,144Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H104a4,4,0,0,1,0-8h48A4,4,0,0,1,156,144Z"}))]]),vI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,88a12,12,0,0,1,12-12h32a12,12,0,0,1,12,12v32a12,12,0,0,1-24,0V100H152A12,12,0,0,1,140,88ZM72,180h32a12,12,0,0,0,0-24H84V136a12,12,0,0,0-24,0v32A12,12,0,0,0,72,180ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM88,192H56a8,8,0,0,1-8-8V152a8,8,0,0,1,16,0v24H88a8,8,0,0,1,0,16Zm120-88a8,8,0,0,1-16,0V80H168a8,8,0,0,1,0-16h32a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,80v32a6,6,0,0,1-12,0V86H160a6,6,0,0,1,0-12h32A6,6,0,0,1,198,80ZM96,170H70V144a6,6,0,0,0-12,0v32a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12ZM230,56V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,80v32a4,4,0,0,1-8,0V84H160a4,4,0,0,1,0-8h32A4,4,0,0,1,196,80ZM96,172H68V144a4,4,0,0,0-8,0v32a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8ZM228,56V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),wI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"}))]]),yI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H190.06A33.82,33.82,0,0,0,196,49.69,36.62,36.62,0,0,0,158.31,12,33.44,33.44,0,0,0,134,23.25a54.65,54.65,0,0,0-6,8.3,54.65,54.65,0,0,0-6-8.3A33.44,33.44,0,0,0,97.69,12,36.62,36.62,0,0,0,60,49.69,33.82,33.82,0,0,0,65.94,68H40A20,20,0,0,0,20,88v32a20,20,0,0,0,16,19.6V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V139.6A20,20,0,0,0,236,120V88A20,20,0,0,0,216,68Zm-4,48H140V92h72ZM152,39.17A9.59,9.59,0,0,1,159,36h.35A12.62,12.62,0,0,1,172,49,9.59,9.59,0,0,1,168.83,56c-6.9,6.12-18.25,9.26-27.63,10.76C142.7,57.42,145.84,46.07,152,39.17ZM87.7,39.7A12.8,12.8,0,0,1,96.61,36H97A9.59,9.59,0,0,1,104,39.17c6.12,6.9,9.26,18.24,10.75,27.61C105.45,65.27,94,62.13,87.17,56A9.59,9.59,0,0,1,84,49,12.72,12.72,0,0,1,87.7,39.7ZM44,92h72v24H44Zm16,48h56v56H60Zm80,56V140h56v56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,128v72a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V120H40V88h80v32h16V88h80v32H136v92a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM84.51,59a13.69,13.69,0,0,1-4.5-10A16.62,16.62,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92C109.71,70.39,94,67.43,84.51,59Zm87,0c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08,13.69,13.69,0,0,1,171.49,59Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H174.74a46.41,46.41,0,0,0,6-4.48,27.56,27.56,0,0,0,9.22-20A30.63,30.63,0,0,0,158.5,18a27.56,27.56,0,0,0-20,9.22A57.1,57.1,0,0,0,128,45.76a57.1,57.1,0,0,0-10.48-18.53A27.56,27.56,0,0,0,97.5,18,30.63,30.63,0,0,0,66,49.51a27.56,27.56,0,0,0,9.22,20,45.74,45.74,0,0,0,6,4.48H40A14,14,0,0,0,26,88v32a14,14,0,0,0,14,14h2v66a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V134h2a14,14,0,0,0,14-14V88A14,14,0,0,0,216,74ZM135.77,63c2.25-12.12,6.29-21.75,11.69-27.85A15.68,15.68,0,0,1,158.86,30h.55A18.6,18.6,0,0,1,178,49.14a15.68,15.68,0,0,1-5.18,11.4C162.1,70,143.92,72.83,134.34,73.65,134.59,70.76,135,67.08,135.77,63ZM83.45,35.45A18.69,18.69,0,0,1,96.59,30h.55a15.68,15.68,0,0,1,11.4,5.18C118,45.9,120.83,64.08,121.65,73.66c-2.89-.25-6.57-.68-10.61-1.43C98.92,70,89.29,65.94,83.19,60.53A15.64,15.64,0,0,1,78,49.14,18.65,18.65,0,0,1,83.45,35.45ZM38,120V88a2,2,0,0,1,2-2h82v36H40A2,2,0,0,1,38,120Zm16,80V134h68v68H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V134h68Zm16-80a2,2,0,0,1-2,2H134V86h82a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H166.81a50.54,50.54,0,0,0,12.63-8A25.53,25.53,0,0,0,188,49.44,28.62,28.62,0,0,0,158.56,20,25.53,25.53,0,0,0,140,28.56c-5.91,6.67-9.63,15.36-12,23.69-2.35-8.33-6.07-17-12-23.69A25.53,25.53,0,0,0,97.44,20,28.62,28.62,0,0,0,68,49.44,25.53,25.53,0,0,0,76.56,68a50.54,50.54,0,0,0,12.63,8H40A12,12,0,0,0,28,88v32a12,12,0,0,0,12,12h4v68a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V132h4a12,12,0,0,0,12-12V88A12,12,0,0,0,216,76ZM146,33.86A17.59,17.59,0,0,1,158.8,28h.61A20.62,20.62,0,0,1,180,49.2,17.6,17.6,0,0,1,174.14,62c-12.09,10.7-33.07,13.21-42,13.79C132.76,66.93,135.26,46,146,33.86ZM76,49.2A20.62,20.62,0,0,1,96.59,28h.61A17.59,17.59,0,0,1,110,33.86c10.71,12.09,13.21,33.07,13.79,42-8.89-.58-29.87-3.09-42-13.79A17.6,17.6,0,0,1,76,49.2ZM36,120V88a4,4,0,0,1,4-4h84v40H40A4,4,0,0,1,36,120Zm16,80V132h72v72H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V132h72Zm16-80a4,4,0,0,1-4,4H132V84h84a4,4,0,0,1,4,4Z"}))]]),bI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z",opacity:"0.2"}),s.createElement("path",{d:"M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z"}))]]),xI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]),kI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.8,85.49l-116-64a12,12,0,0,0-11.6,0l-116,64a12,12,0,0,0,0,21l21.8,12v47.76a19.89,19.89,0,0,0,5.09,13.32C46.63,194.7,77,220,128,220a136.88,136.88,0,0,0,40-5.75V240a12,12,0,0,0,24,0V204.12a119.53,119.53,0,0,0,30.91-24.51A19.89,19.89,0,0,0,228,166.29V118.53l21.8-12a12,12,0,0,0,0-21ZM128,45.71,219.16,96,186,114.3a1.88,1.88,0,0,1-.18-.12l-52-28.69a12,12,0,0,0-11.6,21l39,21.49L128,146.3,36.84,96ZM128,196c-40.42,0-64.65-19.07-76-31.27v-33l70.2,38.74a12,12,0,0,0,11.6,0L168,151.64v37.23A110.46,110.46,0,0,1,128,196Zm76-31.27a93.21,93.21,0,0,1-12,10.81V138.39l12-6.62Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,113.07v53.22a8,8,0,0,1-2,5.31c-11.3,12.59-38.9,36.4-86,36.4s-74.68-23.81-86-36.4a8,8,0,0,1-2-5.31V113.07L128,160Z",opacity:"0.2"}),s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,207.24a119,119,0,0,0,16-7.73V240a8,8,0,0,1-16,0Zm11.76-88.43-56-29.87a8,8,0,0,0-7.52,14.12L171,128l17-9.06Zm64-29.87-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V130.67L171,128l-43,22.93L43.83,106l0,0L25,96,128,41.07,231,96l-18.78,10-.06,0L188,118.94a8,8,0,0,1,4,6.93v73.64a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M250.82,90.71l-120-64a5.94,5.94,0,0,0-5.64,0l-120,64a6,6,0,0,0,0,10.58L34,116.67v49.62a14,14,0,0,0,3.55,9.32C50.42,189.94,79.29,214,128,214a127.21,127.21,0,0,0,50-9.73V240a6,6,0,0,0,12,0V198.35a113.18,113.18,0,0,0,28.45-22.75,13.91,13.91,0,0,0,3.55-9.31V116.67l28.82-15.38a6,6,0,0,0,0-10.58ZM128,202c-44,0-70-21.56-81.52-34.41a2,2,0,0,1-.48-1.3V123.07l79.18,42.22a6,6,0,0,0,5.64,0L178,140.13v51C165,197.35,148.45,202,128,202Zm82-35.71a2,2,0,0,1-.48,1.3A100.25,100.25,0,0,1,190,184.3V133.73l20-10.66Zm-22.15-45a6.27,6.27,0,0,0-1-.71l-56-29.86a6,6,0,0,0-5.64,10.58L175.25,128,128,153.2,20.75,96,128,38.8,235.25,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.88,92.47l-120-64a4,4,0,0,0-3.76,0l-120,64a4,4,0,0,0,0,7.06L36,115.47v50.82a11.92,11.92,0,0,0,3,8c12.65,14.09,41,37.73,89,37.73,21,0,38.2-4.52,52-10.79V240a4,4,0,0,0,8,0V197.18a111.64,111.64,0,0,0,29-22.91,11.94,11.94,0,0,0,3-8V115.47l29.88-15.94a4,4,0,0,0,0-7.06ZM128,204c-44.83,0-71.25-22-83-35.08a3.92,3.92,0,0,1-1-2.63V119.73l82.12,43.8a4,4,0,0,0,3.76,0L180,136.8v55.53C166.58,199,149.39,204,128,204Zm84-37.71a4,4,0,0,1-1,2.64,103.32,103.32,0,0,1-23,19v-55.4l24-12.8Zm-24.59-42.51a4,4,0,0,0-1.53-1.44l-56-29.87a4,4,0,0,0-3.76,7.06L179.5,128,128,155.47,16.5,96,128,36.53,239.5,96Z"}))]]),SI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.63,23.14a12,12,0,0,1,15-8A72.34,72.34,0,0,1,228.4,32a12,12,0,0,1-16.58,17.35,48.31,48.31,0,0,0-19.2-11.2A12,12,0,0,1,184.63,23.14ZM232.85,167.8A92,92,0,0,1,64.31,190l-40-69.32A32,32,0,0,1,36,77a31.72,31.72,0,0,1,7.54-3.14A32,32,0,0,1,88.65,32.45a32,32,0,0,1,53,3.55l14.53,25.17A32,32,0,0,1,206.35,68l17.31,30A91.38,91.38,0,0,1,232.85,167.8Zm-30-57.81L185.57,80a8,8,0,0,0-13.86,8h0l6.68,11.57a12,12,0,0,1-3.18,15.59,28,28,0,0,0-6.41,38.1,12,12,0,1,1-19.86,13.46,52.05,52.05,0,0,1,3.9-63.4L120.9,48A8,8,0,0,0,107,56l24.25,42a12,12,0,1,1-20.78,12L79.33,56a8,8,0,0,0-13.85,8L99,122a12,12,0,0,1-20.78,12L58.93,100.67a8,8,0,1,0-13.85,8L85.1,178a68,68,0,0,0,117.78-68ZM50.46,198a12,12,0,1,0-20.78,12,132.79,132.79,0,0,0,20,26.38,12,12,0,1,0,17.17-16.76A109.2,109.2,0,0,1,50.46,198Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,213.27A80,80,0,0,1,74.7,184l-40-69.32a20,20,0,0,1,34.64-20L55.08,70A20,20,0,0,1,89.73,50l6.92,12h0a20,20,0,0,1,34.64-20l30,52A20,20,0,0,1,196,74l17.31,30A80,80,0,0,1,184,213.27Z",opacity:"0.2"}),s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,98.46A88,88,0,1,1,67.08,186.77h0L26.15,115.88a16,16,0,0,1,27.69-16L72.4,132a8,8,0,0,0,13.86-8L47,56A16,16,0,0,1,74.69,40L114,108a8,8,0,1,0,13.85-8l-30-52a16,16,0,0,1,27.71-16L166,102.12A48.25,48.25,0,0,0,152,136a47.59,47.59,0,0,0,9.6,28.8,8,8,0,1,0,12.79-9.61A32,32,0,0,1,181,110.26a8,8,0,0,0,2.17-10.43L171.71,80a16,16,0,0,1,27.71-16l19.89,34.46Zm-29.37-57A43.74,43.74,0,0,1,216.74,62l.33.57a8,8,0,0,0,13.86-8L230.6,54a59.64,59.64,0,0,0-36.54-28,8,8,0,0,0-4.12,15.46ZM79.58,225.72A103.58,103.58,0,0,1,53.93,196a8,8,0,0,0-13.86,8,119.56,119.56,0,0,0,29.6,34.28,8,8,0,0,0,9.91-12.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.44,101,201.13,71a26,26,0,0,0-45.58,1L136.47,39a26,26,0,0,0-46.14,2.19A26,26,0,0,0,49.88,73l3.29,5.7a26,26,0,0,0-23.69,39L69.5,187a85.44,85.44,0,0,0,52.21,40.08,86.71,86.71,0,0,0,22.4,3,86,86,0,0,0,74.33-129Zm-3,62.16A74,74,0,0,1,79.89,181l-40-69.32a14,14,0,0,1,24.25-14L83.36,131a6,6,0,0,0,10.39-6L60.27,67A14,14,0,1,1,84.52,53l31.17,54a6,6,0,0,0,5.2,3,5.9,5.9,0,0,0,3-.81,6,6,0,0,0,2.2-8.2L101.83,59a14,14,0,0,1,24.25-14l34.2,59.23a46,46,0,0,0-6.4,59.13,6,6,0,0,0,9.94-6.73,34,34,0,0,1,7.76-46.26,6,6,0,0,0,1.6-7.8L166.49,91a14,14,0,1,1,24.25-14l17.31,30A73.53,73.53,0,0,1,215.44,163.14ZM186.18,32.22A6,6,0,0,1,193.52,28a57.59,57.59,0,0,1,35.32,27l.33.57a6,6,0,1,1-10.39,6l-.33-.57a45.69,45.69,0,0,0-28-21.43A6,6,0,0,1,186.18,32.22ZM79.32,235.71a6,6,0,0,1-8.42,1A117.79,117.79,0,0,1,41.79,203a6,6,0,0,1,10.4-6,105.48,105.48,0,0,0,26.14,30.29A6,6,0,0,1,79.32,235.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.71,102,199.4,72a24,24,0,0,0-43.57,4.52L134.74,40a24,24,0,0,0-43.69,4.9A24,24,0,0,0,51.61,72l5.31,9.19a24,24,0,0,0-25.71,35.47l40,69.32a83.4,83.4,0,0,0,51,39.14,84.45,84.45,0,0,0,21.88,2.9,84,84,0,0,0,72.6-126Zm.67,61.67A76,76,0,0,1,78.16,182l-40-69.32a16,16,0,0,1,27.71-16L85.09,130A4,4,0,0,0,92,126L58.54,68A16,16,0,1,1,86.25,52l31.17,54a4,4,0,1,0,6.93-4L100.1,60a16,16,0,0,1,27.72-16l35,60.63a44,44,0,0,0-7.28,57.61,4,4,0,1,0,6.62-4.49,36,36,0,0,1,8.22-49,4,4,0,0,0,1.07-5.2L164.76,92a16,16,0,1,1,27.71-16l17.31,30A75.52,75.52,0,0,1,217.38,163.65ZM188.12,32.74A4,4,0,0,1,193,29.9,55.65,55.65,0,0,1,227.11,56l.33.58A4,4,0,0,1,226,62a4,4,0,0,1-5.47-1.46l-.33-.57A47.62,47.62,0,0,0,191,37.63,4,4,0,0,1,188.12,32.74ZM77.75,234.48A4,4,0,0,1,74.61,236a4,4,0,0,1-2.47-.86A115.55,115.55,0,0,1,43.53,202a4,4,0,1,1,6.92-4,107.72,107.72,0,0,0,26.64,30.86A4,4,0,0,1,77.75,234.48Z"}))]]),EI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z",opacity:"0.2"}),s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z"}))]]),CI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V40A20,20,0,0,0,200,20Zm-4,192H60V44H196ZM84,68A12,12,0,0,1,96,56h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,68Zm8.8,127.37a48,48,0,0,1,70.4,0,12,12,0,0,0,17.6-16.32,72,72,0,0,0-19.21-14.68,44,44,0,1,0-67.19,0,72.12,72.12,0,0,0-19.2,14.68,12,12,0,0,0,17.6,16.32ZM128,116a20,20,0,1,1-20,20A20,20,0,0,1,128,116Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,32H56a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H200a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32ZM128,168a32,32,0,1,1,32-32A32,32,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24ZM96,48h64a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16Zm84.81,150.4a8,8,0,0,1-11.21-1.6,52,52,0,0,0-83.2,0,8,8,0,1,1-12.8-9.6A67.88,67.88,0,0,1,101,165.51a40,40,0,1,1,53.94,0A67.88,67.88,0,0,1,182.4,187.2,8,8,0,0,1,180.81,198.4ZM152,136a24,24,0,1,1-24-24A24,24,0,0,1,152,136Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M151.11,166.13a38,38,0,1,0-46.22,0A65.75,65.75,0,0,0,75.2,188.4a6,6,0,0,0,9.6,7.2,54,54,0,0,1,86.4,0,6,6,0,0,0,9.6-7.2A65.75,65.75,0,0,0,151.11,166.13ZM128,110a26,26,0,1,1-26,26A26,26,0,0,1,128,110Zm72-84H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V40A14,14,0,0,0,200,26Zm2,190a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2ZM90,64a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H96A6,6,0,0,1,90,64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M146.7,166.75a36,36,0,1,0-37.4,0A63.61,63.61,0,0,0,76.8,189.6a4,4,0,0,0,6.4,4.8,56,56,0,0,1,89.6,0,4,4,0,0,0,6.4-4.8A63.65,63.65,0,0,0,146.7,166.75ZM100,136a28,28,0,1,1,28,28A28,28,0,0,1,100,136ZM200,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Zm4,188a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4ZM92,64a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Z"}))]]),jI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),AI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v63.72L186.14,97.86a20,20,0,0,0-28.28,0L52,203.72V52ZM85.66,204,172,117.66l32,32V204ZM76,96a20,20,0,1,1,20,20A20,20,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40H48a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h8.69L166.34,106.34a8,8,0,0,1,11.32,0L216,144.69V48A8,8,0,0,0,208,40ZM96,112a16,16,0,1,1,16-16A16,16,0,0,1,96,112Z",opacity:"0.2"}),s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM80,96a16,16,0,1,1,16,16A16,16,0,0,1,80,96Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2v82.2l-28.1-28.1a14,14,0,0,0-19.8,0L54.2,210H48A2,2,0,0,1,46,208Zm162,2H71.17l99.41-99.41a2,2,0,0,1,2.83,0L210,147.17V208A2,2,0,0,1,208,210ZM96,118A22,22,0,1,0,74,96,22,22,0,0,0,96,118Zm0-32A10,10,0,1,1,86,96,10,10,0,0,1,96,86Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4v87l-31.51-31.52a12,12,0,0,0-17,0L55,212H48A4,4,0,0,1,44,208Zm164,4H66.34L169.17,109.17a4,4,0,0,1,5.66,0L212,146.34V208A4,4,0,0,1,208,212ZM96,116A20,20,0,1,0,76,96,20,20,0,0,0,96,116Zm0-32A12,12,0,1,1,84,96,12,12,0,0,1,96,84Z"}))]]),NI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,88a16,16,0,1,1,16,16A16,16,0,0,1,160,88Zm76-32V160a20,20,0,0,1-20,20H204v20a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V88A20,20,0,0,1,40,68H60V56A20,20,0,0,1,80,36H216A20,20,0,0,1,236,56ZM180,180H80a20,20,0,0,1-20-20V92H44V196H180Zm-21.66-24L124,121.66,89.66,156ZM212,60H84v67.72l25.86-25.86a20,20,0,0,1,28.28,0L192.28,156H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56v82.06l-23.72-23.72a8,8,0,0,0-11.31,0L163.31,140,113.66,90.34a8,8,0,0,0-11.32,0L64,128.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,56H216v62.75l-10.07-10.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L72,109.37ZM184,200H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V132l36-36,49.66,49.66a8,8,0,0,0,11.31,0L194.63,120,216,141.38V168ZM160,84a12,12,0,1,1,12,12A12,12,0,0,1,160,84Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM172,72a12,12,0,1,1-12,12A12,12,0,0,1,172,72Zm12,128H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V120.69l30.34-30.35a8,8,0,0,1,11.32,0L163.31,140,189,114.34a8,8,0,0,1,11.31,0L216,130.07V168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H72A14,14,0,0,0,58,56V74H40A14,14,0,0,0,26,88V200a14,14,0,0,0,14,14H184a14,14,0,0,0,14-14V182h18a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM70,56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2v67.57L204.53,110.1a14,14,0,0,0-19.8,0l-21.42,21.41L117.9,86.1a14,14,0,0,0-19.8,0L70,114.2ZM186,200a2,2,0,0,1-2,2H40a2,2,0,0,1-2-2V88a2,2,0,0,1,2-2H58v82a14,14,0,0,0,14,14H186Zm30-30H72a2,2,0,0,1-2-2V131.17l36.58-36.58a2,2,0,0,1,2.83,0l49.66,49.66a6,6,0,0,0,8.49,0l25.65-25.66a2,2,0,0,1,2.83,0l22,22V168A2,2,0,0,1,216,170ZM162,84a10,10,0,1,1,10,10A10,10,0,0,1,162,84Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,56H216v62.75l-10.07-10.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L72,109.37ZM184,200H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V132l36-36,49.66,49.66a8,8,0,0,0,11.31,0L194.63,120,216,141.38V168ZM160,84a12,12,0,1,1,12,12A12,12,0,0,1,160,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H72A12,12,0,0,0,60,56V76H40A12,12,0,0,0,28,88V200a12,12,0,0,0,12,12H184a12,12,0,0,0,12-12V180h20a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM68,56a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4v72.4l-16.89-16.89a12,12,0,0,0-17,0l-22.83,22.83L116.49,87.51a12,12,0,0,0-17,0L68,119ZM188,200a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V88a4,4,0,0,1,4-4H60v84a12,12,0,0,0,12,12H188Zm28-28H72a4,4,0,0,1-4-4V130.34l37.17-37.17a4,4,0,0,1,5.66,0l49.66,49.66a4,4,0,0,0,5.65,0l25.66-25.66a4,4,0,0,1,5.66,0L220,139.71V168A4,4,0,0,1,216,172ZM164,84a8,8,0,1,1,8,8A8,8,0,0,1,164,84Z"}))]]),MI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,128a60,60,0,0,1-102.43,42.43l-.49-.53L89.22,102.31a36,36,0,1,0,0,51.38l3.08-3.48a12,12,0,1,1,18,15.91l-3.35,3.78-.49.53a60,60,0,1,1,0-84.86l.49.53,59.86,67.59a36,36,0,1,0,0-51.38l-3.08,3.48a12,12,0,1,1-18-15.91l3.35-3.78.49-.53A60,60,0,0,1,252,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.94,161.94a48,48,0,0,1-67.88,0L128,128l30.06-33.94a48,48,0,0,1,67.88,67.88ZM30.06,94.06a48,48,0,0,0,67.88,67.88L128,128,97.94,94.06A48,48,0,0,0,30.06,94.06Z",opacity:"0.2"}),s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM204.28,156.28a40,40,0,0,1-56.4.17L97.29,111.34,97,111A24,24,0,1,0,97,145c.36-.36.71-.73,1-1.1a8,8,0,1,1,12,10.6c-.55.62-1.13,1.23-1.71,1.81a40,40,0,1,1-.17-56.73l50.58,45.11.33.31A24,24,0,1,0,159,111c-.36.36-.7.72-1,1.1a8,8,0,0,1-12-10.59c.54-.62,1.12-1.24,1.71-1.82a40,40,0,0,1,56.57,56.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,128a54,54,0,0,1-92.18,38.18,3.07,3.07,0,0,1-.25-.26l-60-67.74a42,42,0,1,0,0,59.64l8.57-9.67a6,6,0,1,1,9,8l-8.69,9.81a3.07,3.07,0,0,1-.25.26,54,54,0,1,1,0-76.36,3.07,3.07,0,0,1,.25.26l60,67.74a42,42,0,1,0,0-59.64l-8.57,9.67a6,6,0,1,1-9-8l8.69-9.81a3.07,3.07,0,0,1,.25-.26A54,54,0,0,1,246,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,128a52,52,0,0,1-88.77,36.77l-.17-.18L95,96.8a44,44,0,1,0,0,62.4l8.6-9.72a4,4,0,0,1,6,5.3l-8.68,9.81-.17.18a52,52,0,1,1,0-73.54l.17.18,60,67.79a44,44,0,1,0,0-62.4l-8.6,9.72a4,4,0,0,1-6-5.3l8.68-9.81.17-.18A52,52,0,0,1,244,128Z"}))]]),RI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),PI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z",opacity:"0.2"}),s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z"}))]]),LI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z"}))]]),$I=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),TI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),s.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),DI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,120a52.06,52.06,0,0,0-52-52H160.32c-3.44-.21-52.6-4-99.46-43.3A20,20,0,0,0,28,40V200a19.8,19.8,0,0,0,11.54,18.12,19.86,19.86,0,0,0,21.32-2.81A192.92,192.92,0,0,1,144,174.47v26.2a20,20,0,0,0,8.9,16.64,11.35,11.35,0,0,0,1.39.8l14.44,7.06A20,20,0,0,0,198.37,213l11.09-41.82A52.07,52.07,0,0,0,252,120ZM52,191.63V48.4c36.17,28.07,72.17,38.1,92,41.66V150C124.17,153.52,88.17,163.55,52,191.63ZM176.39,202.2,168,198.1V172h16.4ZM200,148H168V92h32a28,28,0,1,1,0,56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,120a40,40,0,0,1-40,40H160V80h40A40,40,0,0,1,240,120Z",opacity:"0.2"}),s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,72H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48,48,0,0,0,200,72ZM179,207.89l0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,120a46.05,46.05,0,0,0-46-46H160.15c-2.58-.15-54.1-3.57-103.15-44.71A14,14,0,0,0,34,40V200a13.85,13.85,0,0,0,8.07,12.68A14.16,14.16,0,0,0,48,214a13.9,13.9,0,0,0,9-3.3c40-33.52,81.57-42,97-44.07v34a14,14,0,0,0,6.23,11.65l11,7.33a14,14,0,0,0,21.32-8.17l12.13-45.71A46.07,46.07,0,0,0,246,120ZM49.29,201.52A2,2,0,0,1,46,200V40a1.9,1.9,0,0,1,1.15-1.8A2.08,2.08,0,0,1,48,38a1.91,1.91,0,0,1,1.26.48c44,36.92,89,45.19,104.71,47v69C138.29,156.33,93.3,164.61,49.29,201.52Zm131.64,7a2,2,0,0,1-3.05,1.18l-11-7.33a2,2,0,0,1-.89-1.67V166h26.2ZM200,154H166V86h34a34,34,0,1,1,0,68Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,76H160.1c-2.19-.11-54.55-3.38-104.38-45.17A12,12,0,0,0,36,40V200a11.88,11.88,0,0,0,6.92,10.87A12.18,12.18,0,0,0,48,212a11.93,11.93,0,0,0,7.69-2.83c42.46-35.62,86.76-43.25,100.28-44.8v36.29a12,12,0,0,0,5.34,10l11,7.33a12,12,0,0,0,18.28-7l12.49-47.09A44,44,0,0,0,200,76Zm-44,80.3c-13.53,1.35-60,8.62-105.42,46.75A4,4,0,0,1,44,200V40a4,4,0,0,1,2.3-3.62A4.32,4.32,0,0,1,48.05,36a3.88,3.88,0,0,1,2.53,1C96,75.09,142.47,82.36,156,83.71ZM182.87,209a4,4,0,0,1-6.1,2.36l-11-7.33a4,4,0,0,1-1.78-3.33V164h30.8ZM200,156H164V84h36a36,36,0,0,1,0,72Z"}))]]),HI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),OI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,80a32,32,0,1,0-32-32A32,32,0,0,0,160,80Zm0-40a8,8,0,1,1-8,8A8,8,0,0,1,160,40Zm94.32,153.88L199.76,101.8A19.85,19.85,0,0,0,182.55,92h0a19.83,19.83,0,0,0-17.2,9.8l-18.7,31.55-37.42-63.5a20,20,0,0,0-34.46,0L1.66,193.91A12,12,0,0,0,12,212H244a12,12,0,0,0,10.32-18.12ZM92,87.87,108.57,116H75.43ZM33,188l28.28-48h61.44L151,188Zm145.86,0L160.56,157l22-37.1L222.94,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,52a20,20,0,1,1,20,20A20,20,0,0,1,144,52Zm49.44,55.92a8,8,0,0,0-13.77,0l-33,55.75-21-35.67H50.35L8,200H248Z",opacity:"0.2"}),s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l33,56Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254.88,195.92l-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84l-15.64,26.39a4,4,0,0,0,0,4.07l26.8,45.47a8.13,8.13,0,0,1-1.89,10.55,8,8,0,0,1-11.8-2.26L101.79,71.88a16,16,0,0,0-27.58,0L1.11,195.94a8,8,0,0,0,1,9.52A8.23,8.23,0,0,0,8.23,208H247.77a8.29,8.29,0,0,0,6.09-2.55A8,8,0,0,0,254.88,195.92ZM64.43,120,88,80l23.57,40ZM140,52a24,24,0,1,1,24,24A24,24,0,0,1,140,52Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,78a26,26,0,1,0-26-26A26,26,0,0,0,164,78Zm0-40a14,14,0,1,1-14,14A14,14,0,0,1,164,38Zm89.16,158.94L198.6,104.86a13.9,13.9,0,0,0-12-6.86h0a13.88,13.88,0,0,0-12,6.86l-27.88,47.05-46.56-79a14,14,0,0,0-24.13,0L2.83,197A6,6,0,0,0,8,206H248a6,6,0,0,0,5.16-9.06ZM86.27,79a2,2,0,0,1,3.46,0l25.34,43H60.93ZM18.5,194l35.36-60h68.29l19.3,32.77,0,0,16,27.2Zm152.93,0-17.85-30.29L184.83,111a2,2,0,0,1,1.72-1,1.93,1.93,0,0,1,1.72,1l49.2,83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l18.74,31.8,0,0L154,192Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,76a24,24,0,1,0-24-24A24,24,0,0,0,164,76Zm0-40a16,16,0,1,1-16,16A16,16,0,0,1,164,36Zm87.44,162-54.56-92.08A11.91,11.91,0,0,0,186.55,100h0a11.89,11.89,0,0,0-10.32,5.88l-29.61,50L98.34,73.91a12,12,0,0,0-20.68,0L4.55,198A4,4,0,0,0,8,204H248a4,4,0,0,0,3.44-6ZM84.55,78a4,4,0,0,1,6.9,0l27.12,46H57.43ZM15,196l37.71-64h70.58L161,196Zm155.29,0-19-32.29L183.11,110a4,4,0,0,1,6.88,0l51,86Z"}))]]),II=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,178.57,87.73l-72-39.42Zm0,78.83L56,76,81.56,62l72,39.41ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l24-13.13V152a12,12,0,0,0,24,0V109.92l24-13.13v76.65Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,.7-3.25Z",opacity:"0.2"}),s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,178.57,94.57,94.05,48.31ZM122,223,39,177.57a2,2,0,0,1-1-1.75V86.66l84,46ZM43.49,76,81.56,55.15l84.51,46.26L128,122.24ZM218,175.82a2,2,0,0,1-1,1.75h0L134,223V132.64l36-19.71V152a6,6,0,0,0,12,0V106.37l36-19.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,178.5,96.89a4,4,0,0,0-.58-.4l-88-48.18Zm1.92,96L39.33,76,81.56,52.87l88.67,48.54Zm-89.92,54.8a4,4,0,0,1-2.08-3.5V83.29l88,48.16v94.91Zm179.84,0h0l-85.92,47V131.45l40-21.89V152a4,4,0,0,0,8,0V105.18l40-21.89v92.53A4,4,0,0,1,217.92,179.32Z"}))]]),FI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),_I=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]),VI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),ZI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),zI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),BI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z"}))]]),UI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116,128V48a12,12,0,0,1,24,0v80a12,12,0,0,1-24,0Zm66.55-82a12,12,0,0,0-13.1,20.1C191.41,80.37,204,103,204,128a76,76,0,0,1-152,0c0-25,12.59-47.63,34.55-61.95A12,12,0,0,0,73.45,46C44.56,64.78,28,94.69,28,128a100,100,0,0,0,200,0C228,94.69,211.44,64.78,182.55,46Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm-8,40a8,8,0,0,1,16,0v64a8,8,0,0,1-16,0Zm8,144A80,80,0,0,1,83.55,61.48a8,8,0,1,1,8.9,13.29,64,64,0,1,0,71.1,0,8,8,0,1,1,8.9-13.29A80,80,0,0,1,128,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M122,128V48a6,6,0,0,1,12,0v80a6,6,0,0,1-12,0Zm57.28-77A6,6,0,0,0,172.72,61C196.41,76.47,210,100.88,210,128a82,82,0,0,1-164,0c0-27.12,13.59-51.53,37.28-67A6,6,0,0,0,76.72,51C49.57,68.68,34,96.75,34,128a94,94,0,0,0,188,0C222,96.75,206.43,68.68,179.28,51Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M124,128V48a4,4,0,0,1,8,0v80a4,4,0,0,1-8,0Zm54.18-75.35a4,4,0,1,0-4.36,6.7C198.08,75.17,212,100.2,212,128a84,84,0,0,1-168,0c0-27.8,13.92-52.83,38.18-68.65a4,4,0,0,0-4.36-6.7C51.24,70,36,97.44,36,128a92,92,0,0,0,184,0C220,97.44,204.76,70,178.18,52.65Z"}))]]),WI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),KI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),GI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z",opacity:"0.2"}),s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z"}))]]),YI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),s.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),s.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),qI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z"}))]]),XI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,96a12,12,0,0,0-.44-3.3L221.2,42.51A20.08,20.08,0,0,0,202,28H54A20.08,20.08,0,0,0,34.8,42.51L20.46,92.7A12,12,0,0,0,20,96h0v16a43.94,43.94,0,0,0,16,33.92V216a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V145.92A43.94,43.94,0,0,0,236,112V96ZM57.05,52H199l9.14,32H47.91Zm91,56v4a20,20,0,0,1-40,0v-4ZM53,128.71A20,20,0,0,1,44,112v-4H84v4a20,20,0,0,1-20,20,19.76,19.76,0,0,1-9.07-2.2A11.54,11.54,0,0,0,53,128.71ZM196,204H60V155.81c1.32.12,2.65.19,4,.19a43.86,43.86,0,0,0,32-13.85,43.89,43.89,0,0,0,64,0A43.86,43.86,0,0,0,192,156c1.35,0,2.68-.07,4-.19Zm16-92a20,20,0,0,1-9,16.71,11.66,11.66,0,0,0-1.88,1.09A20,20,0,0,1,172,112v-4h40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,96v16a32,32,0,0,1-64,0V96H96v16a32,32,0,0,1-64,0V96L46.34,45.8A8,8,0,0,1,54,40H202a8,8,0,0,1,7.69,5.8Z",opacity:"0.2"}),s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM54,48H202l11.42,40H42.61Zm98,56v8a24,24,0,0,1-48,0v-8ZM51.06,132.2A24,24,0,0,1,40,112v-8H88v8a24,24,0,0,1-35.12,21.26A7.88,7.88,0,0,0,51.06,132.2ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm16-96a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM88,112a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8H88Zm64,0a24,24,0,0,1-48,0v-8h48Zm64,0a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M26.22,94.41A6,6,0,0,0,26,96v16A38,38,0,0,0,42,143V216a6,6,0,0,0,6,6H208a6,6,0,0,0,6-6V143A38,38,0,0,0,230,112V96a5.91,5.91,0,0,0-.23-1.64L215.43,44.15A14.07,14.07,0,0,0,202,34H54A14.07,14.07,0,0,0,40.57,44.15Zm25.89-47A2,2,0,0,1,54,46H202a2,2,0,0,1,1.92,1.45L216.05,90H40ZM102,102h52v10a26,26,0,0,1-52,0Zm-64,0H90v10a26,26,0,0,1-38.18,23,6,6,0,0,0-1.65-1A26,26,0,0,1,38,112ZM202,210H54V148.66a38,38,0,0,0,42-16.21,37.95,37.95,0,0,0,64,0,38,38,0,0,0,42,16.21Zm3.83-76a6,6,0,0,0-1.65,1A26,26,0,0,1,166,112V102h52v10A26,26,0,0,1,205.83,134Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,96a7.89,7.89,0,0,0-.3-2.2L217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.8A7.89,7.89,0,0,0,24,96h0v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96ZM54,48H202l11.42,40H42.61Zm50,56h48v8a24,24,0,0,1-48,0Zm-16,0v8a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm4.93-75.8a8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48v8A24,24,0,0,1,204.93,132.2Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M28.15,95A3.81,3.81,0,0,0,28,96v16a36,36,0,0,0,16,29.92V216a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V141.92A36,36,0,0,0,228,112V96a3.81,3.81,0,0,0-.17-1.08L213.5,44.7A12,12,0,0,0,202,36H54A12,12,0,0,0,42.5,44.7Zm22-48.08A4,4,0,0,1,54,44H202a4,4,0,0,1,3.84,2.9L218.7,92H37.3ZM100,100h56v12a28,28,0,0,1-56,0ZM36,112V100H92v12a28,28,0,0,1-41.37,24.59,4,4,0,0,0-1.31-.76A28,28,0,0,1,36,112ZM204,212H52V145.94a36,36,0,0,0,44-17.48,36,36,0,0,0,64,0,36,36,0,0,0,44,17.48Zm2.68-76.17a3.94,3.94,0,0,0-1.3.76A28,28,0,0,1,164,112V100h56v12A28,28,0,0,1,206.68,135.83Z"}))]]),QI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,148H203.89c.07-1.33.11-2.66.11-4a76,76,0,0,0-152,0c0,1.34,0,2.67.11,4H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM76,144a52,52,0,0,1,104,0c0,1.34-.07,2.67-.17,4H76.17C76.07,146.67,76,145.34,76,144Zm144,56a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24H208A12,12,0,0,1,220,200ZM12.62,92.21a12,12,0,0,1,15.17-7.59l12,4a12,12,0,1,1-7.58,22.77l-12-4A12,12,0,0,1,12.62,92.21Zm56-48.41a12,12,0,1,1,22.76-7.59l4,12A12,12,0,1,1,72.62,55.8Zm140,60a12,12,0,0,1,7.59-15.18l12-4a12,12,0,0,1,7.58,22.77l-12,4a12,12,0,0,1-15.17-7.59Zm-48-55.59,4-12a12,12,0,1,1,22.76,7.59l-4,12a12,12,0,1,1-22.76-7.59Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,144a64.33,64.33,0,0,1-2,16H66a64,64,0,1,1,126-16Z",opacity:"0.2"}),s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,160a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H56.45a73.54,73.54,0,0,1-.45-8,72,72,0,0,1,144,0,73.54,73.54,0,0,1-.45,8H240A8,8,0,0,1,248,160Zm-40,32H48a8,8,0,0,0,0,16H208a8,8,0,0,0,0-16ZM80.84,59.58a8,8,0,0,0,14.32-7.16l-8-16a8,8,0,0,0-14.32,7.16ZM20.42,103.16l16,8a8,8,0,1,0,7.16-14.31l-16-8a8,8,0,1,0-7.16,14.31ZM216,112a8,8,0,0,0,3.57-.84l16-8a8,8,0,1,0-7.16-14.31l-16,8A8,8,0,0,0,216,112ZM164.42,63.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.32-7.16l-8,16A8,8,0,0,0,164.42,63.16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,154H197.28a70.91,70.91,0,0,0,.72-10,70,70,0,0,0-140,0,70.91,70.91,0,0,0,.72,10H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM70,144a58,58,0,1,1,115.13,10H70.87A58.63,58.63,0,0,1,70,144Zm144,56a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12H208A6,6,0,0,1,214,200ZM74.63,42.69a6,6,0,0,1,10.74-5.37l8,16a6,6,0,0,1-10.74,5.36Zm-56,50.63a6,6,0,0,1,8.05-2.69l16,8a6,6,0,0,1-5.36,10.74l-16-8A6,6,0,0,1,18.63,93.32Zm192,13.36a6,6,0,0,1,2.69-8.05l16-8a6,6,0,1,1,5.36,10.74l-16,8a6,6,0,0,1-8.05-2.69Zm-48-53.36,8-16a6,6,0,0,1,10.74,5.37l-8,16a6,6,0,1,1-10.74-5.36Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,156H194.94A68,68,0,1,0,60,144a68.73,68.73,0,0,0,1.06,12H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM68,144a60,60,0,1,1,118.79,12H69.21A60.16,60.16,0,0,1,68,144Zm144,56a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8H208A4,4,0,0,1,212,200ZM76.42,41.79a4,4,0,0,1,7.16-3.58l8,16a4,4,0,0,1-7.16,3.58Zm-56,52.42a4,4,0,0,1,5.37-1.79l16,8a4,4,0,0,1-3.58,7.16l-16-8A4,4,0,0,1,20.42,94.21Zm192,11.58a4,4,0,0,1,1.79-5.37l16-8a4,4,0,1,1,3.58,7.16l-16,8a4,4,0,0,1-5.37-1.79Zm-48-51.58,8-16a4,4,0,1,1,7.16,3.58l-8,16a4,4,0,0,1-7.16-3.58Z"}))]]),JI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),eF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),tF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0ZM96.49,80.49,116,61v83a12,12,0,0,0,24,0V61l19.51,19.52a12,12,0,1,0,17-17l-40-40a12,12,0,0,0-17,0l-40,40a12,12,0,1,0,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM88,80h32v64a8,8,0,0,0,16,0V80h32a8,8,0,0,0,5.66-13.66l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,88,80Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0ZM92.24,76.24,122,46.49V144a6,6,0,0,0,12,0V46.49l29.76,29.75a6,6,0,0,0,8.48-8.48l-40-40a6,6,0,0,0-8.48,0l-40,40a6,6,0,0,0,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0ZM90.83,74.83,124,41.66V144a4,4,0,0,0,8,0V41.66l33.17,33.17a4,4,0,1,0,5.66-5.66l-40-40a4,4,0,0,0-5.66,0l-40,40a4,4,0,0,0,5.66,5.66Z"}))]]),nF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),rF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20ZM79.57,196.57a60,60,0,0,1,96.86,0,83.72,83.72,0,0,1-96.86,0ZM100,120a28,28,0,1,1,28,28A28,28,0,0,1,100,120ZM194,179.94a83.48,83.48,0,0,0-29-23.42,52,52,0,1,0-74,0,83.48,83.48,0,0,0-29,23.42,84,84,0,1,1,131.9,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26ZM71.44,198a66,66,0,0,1,113.12,0,89.8,89.8,0,0,1-113.12,0ZM94,120a34,34,0,1,1,34,34A34,34,0,0,1,94,120Zm99.51,69.64a77.53,77.53,0,0,0-40-31.38,46,46,0,1,0-51,0,77.53,77.53,0,0,0-40,31.38,90,90,0,1,1,131,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28ZM68.87,198.42a68,68,0,0,1,118.26,0,91.8,91.8,0,0,1-118.26,0Zm124.3-5.55a75.61,75.61,0,0,0-44.51-34,44,44,0,1,0-41.32,0,75.61,75.61,0,0,0-44.51,34,92,92,0,1,1,130.34,0ZM128,156a36,36,0,1,1,36-36A36,36,0,0,1,128,156Z"}))]]),sF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z",opacity:"0.2"}),s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z"}))]]),aF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),oF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),iF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),lF=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),YS=s.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),At=s.forwardRef((e,t)=>{const{alt:n,color:r,size:a,weight:i,mirrored:l,children:u,weights:f,...h}=e,{color:p="currentColor",size:g,weight:m="regular",mirrored:w=!1,...y}=s.useContext(YS);return s.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a??g,height:a??g,fill:r??p,viewBox:"0 0 256 256",transform:l||w?"scale(-1, 1)":void 0,...y,...h},!!n&&s.createElement("title",null,n),u,f.get(i??m))});At.displayName="IconBase";const qS=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:FO}));qS.displayName="ApertureIcon";const XS=qS,QS=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:_O}));QS.displayName="ArchiveIcon";const fm=QS,JS=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:VO}));JS.displayName="ArrowCircleUpIcon";const eE=JS,tE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:ZO}));tE.displayName="ArrowClockwiseIcon";const nE=tE,rE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:zO}));rE.displayName="ArrowCounterClockwiseIcon";const t1=rE,sE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:BO}));sE.displayName="ArrowLeftIcon";const Lv=sE,aE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:UO}));aE.displayName="ArrowLineUpIcon";const cF=aE,oE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:WO}));oE.displayName="ArrowRightIcon";const xa=oE,iE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:KO}));iE.displayName="ArrowSquareOutIcon";const Ac=iE,lE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:GO}));lE.displayName="ArrowUpIcon";const cE=lE,uE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:YO}));uE.displayName="ArrowsClockwiseIcon";const mp=uE,dE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:qO}));dE.displayName="ArrowsDownUpIcon";const uF=dE,fE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:XO}));fE.displayName="ArrowsOutSimpleIcon";const dF=fE,hE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:QO}));hE.displayName="BellIcon";const i8=hE,pE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:JO}));pE.displayName="BookOpenIcon";const fF=pE,mE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:eI}));mE.displayName="CaretDownIcon";const xl=mE,gE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:tI}));gE.displayName="CaretLeftIcon";const Ta=gE,vE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:nI}));vE.displayName="CaretRightIcon";const Nl=vE,wE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:rI}));wE.displayName="CaretUpIcon";const hF=wE,yE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:sI}));yE.displayName="ChartBarIcon";const pF=yE,bE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:aI}));bE.displayName="CheckIcon";const Gn=bE,xE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:oI}));xE.displayName="CircleIcon";const mF=xE,kE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:iI}));kE.displayName="CircleHalfIcon";const gF=kE,SE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:lI}));SE.displayName="CopyIcon";const gp=SE,EE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:cI}));EE.displayName="CopySimpleIcon";const Qx=EE,CE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:uI}));CE.displayName="DeviceMobileIcon";const vF=CE,jE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:dI}));jE.displayName="DotsThreeIcon";const $v=jE,AE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:fI}));AE.displayName="DotsThreeVerticalIcon";const Tv=AE,NE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:hI}));NE.displayName="DownloadSimpleIcon";const ME=NE,RE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:pI}));RE.displayName="FilmSlateIcon";const hm=RE,PE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:mI}));PE.displayName="FolderSimpleIcon";const Dv=PE,LE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:gI}));LE.displayName="FolderSimpleMinusIcon";const $E=LE,TE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:vI}));TE.displayName="FrameCornersIcon";const DE=TE,HE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:wI}));HE.displayName="GearSixIcon";const wF=HE,OE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:yI}));OE.displayName="GiftIcon";const yF=OE,IE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:bI}));IE.displayName="GithubLogoIcon";const bF=IE,FE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:xI}));FE.displayName="GlobeIcon";const xF=FE,_E=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:kI}));_E.displayName="GraduationCapIcon";const kF=_E,VE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:SI}));VE.displayName="HandWavingIcon";const SF=VE,ZE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:EI}));ZE.displayName="HouseIcon";const EF=ZE,zE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:CI}));zE.displayName="IdentificationBadgeIcon";const pm=zE,BE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:jI}));BE.displayName="ImageIcon";const CF=BE,UE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:AI}));UE.displayName="ImageSquareIcon";const Da=UE,WE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:NI}));WE.displayName="ImagesIcon";const jF=WE,KE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:MI}));KE.displayName="InfinityIcon";const GE=KE,YE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:RI}));YE.displayName="InfoIcon";const mm=YE,qE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:PI}));qE.displayName="KeyIcon";const XE=qE,QE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:LI}));QE.displayName="KeyboardIcon";const AF=QE,JE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:$I}));JE.displayName="LightningIcon";const n1=JE,eC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:TI}));eC.displayName="MagnifyingGlassIcon";const hd=eC,tC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:DI}));tC.displayName="MegaphoneIcon";const NF=tC,nC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:HI}));nC.displayName="MinusIcon";const MF=nC,rC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:OI}));rC.displayName="MountainsIcon";const RF=rC,sC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:II}));sC.displayName="PackageIcon";const gm=sC,aC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:FI}));aC.displayName="PaletteIcon";const PF=aC,oC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:_I}));oC.displayName="PaperclipIcon";const LF=oC,iC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:VI}));iC.displayName="PencilSimpleIcon";const Ad=iC,lC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:ZI}));lC.displayName="PencilSimpleLineIcon";const $F=lC,cC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:zI}));cC.displayName="PlusIcon";const mr=cC,uC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:BI}));uC.displayName="PlusCircleIcon";const TF=uC,dC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:UI}));dC.displayName="PowerIcon";const fC=dC,hC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:WI}));hC.displayName="QuestionIcon";const DF=hC,pC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:KI}));pC.displayName="SidebarSimpleIcon";const HF=pC,mC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:GI}));mC.displayName="SlidersHorizontalIcon";const Hv=mC,gC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:YI}));gC.displayName="StackIcon";const vC=gC,wC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:qI}));wC.displayName="StarIcon";const eo=wC,yC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:XI}));yC.displayName="StorefrontIcon";const bC=yC,xC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:QI}));xC.displayName="SunHorizonIcon";const kC=xC,SC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:JI}));SC.displayName="TrashIcon";const Ml=SC,EC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:eF}));EC.displayName="TrashSimpleIcon";const vm=EC,CC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:tF}));CC.displayName="UploadSimpleIcon";const Ov=CC,jC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:nF}));jC.displayName="UserIcon";const OF=jC,AC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:rF}));AC.displayName="UserCircleIcon";const IF=AC,NC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:sF}));NC.displayName="UserPlusIcon";const FF=NC,MC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:aF}));MC.displayName="WarningIcon";const wm=MC,RC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:oF}));RC.displayName="WarningCircleIcon";const zc=RC,PC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:iF}));PC.displayName="XIcon";const jn=PC,LC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:lF}));LC.displayName="XCircleIcon";const _F=LC;var Br=iS(),VF=Object.defineProperty,Iv=(e,t)=>VF(e,"name",{value:t,configurable:!0});function D6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Iv(D6,"setRef");function $C(...e){return t=>{let n=!1;const r=e.map(a=>{const i=D6(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():D6(e[a],null)}}}}Iv($C,"composeRefs");function hn(...e){return s.useCallback($C(...e),e)}Iv(hn,"useComposedRefs");var ZF=Object.defineProperty,ao=(e,t)=>ZF(e,"name",{value:t,configurable:!0});function to(e){const t=s.forwardRef((n,r)=>{let{children:a,...i}=n,l=null,u=!1;const f=[];H6(a)&&typeof kh=="function"&&(a=kh(a._payload)),s.Children.forEach(a,m=>{var w;if(OC(m)){u=!0;const y=m;let b="child"in y.props?y.props.child:y.props.children;H6(b)&&typeof kh=="function"&&(b=kh(b._payload)),l=zF(y,b),f.push((w=l==null?void 0:l.props)==null?void 0:w.children)}else f.push(m)}),l?l=s.cloneElement(l,void 0,f):!u&&s.Children.count(a)===1&&s.isValidElement(a)&&(l=a);const h=l?HC(l):void 0,p=hn(r,h);if(!l){if(a||a===0)throw new Error(u?WF(e):UF(e));return a}const g=DC(i,l.props??{});return l.type!==s.Fragment&&(g.ref=r?p:h),s.cloneElement(l,g)});return t.displayName=`${e}.Slot`,t}ao(to,"createSlot");var Bc=to("Slot"),TC=Symbol.for("radix.slottable");function Fv(e){const t=ao(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=TC,t}ao(Fv,"createSlottable");var ym=Fv("Slottable"),zF=ao((e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function DC(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const f=i(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}ao(DC,"mergeProps");function HC(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ao(HC,"getElementRef");function OC(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TC}ao(OC,"isSlottable");var BF=Symbol.for("react.lazy");function H6(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===BF&&"_payload"in e&&IC(e._payload)}ao(H6,"isLazyComponent");function IC(e){return typeof e=="object"&&e!==null&&"then"in e}ao(IC,"isPromiseLike");var UF=ao(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),WF=ao(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),kh=Fc[" use ".trim().toString()],KF=Object.defineProperty,GF=(e,t)=>KF(e,"name",{value:t,configurable:!0}),YF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vn=YF.reduce((e,t)=>{const n=to(`Primitive.${t}`),r=s.forwardRef((a,i)=>{const{asChild:l,...u}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _v(e,t){e&&Br.flushSync(()=>e.dispatchEvent(t))}GF(_v,"dispatchDiscreteCustomEvent");var qF=Object.defineProperty,XF=(e,t)=>qF(e,"name",{value:t,configurable:!0}),FC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),QF=s.forwardRef(XF(function(t,n){return o.jsx(vn.span,{...t,ref:n,style:{...FC,...t.style}})},"VisuallyHidden")),_C=QF,JF=Object.defineProperty,ka=(e,t)=>JF(e,"name",{value:t,configurable:!0});function e_(e,t){const n=s.createContext(t);n.displayName=e+"Context";const r=ka(i=>{const{children:l,...u}=i,f=s.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:f,children:l})},"Provider");r.displayName=e+"Provider";function a(i,l={}){const{optional:u=!1}=l,f=s.useContext(n);if(f)return f;if(t!==void 0)return t;if(!u)throw new Error(`\`${i}\` must be used within \`${e}\``)}return ka(a,"useContext"),[r,a]}ka(e_,"createContext");function Zs(e,t=[]){let n=[];function r(i,l){const u=s.createContext(l);u.displayName=i+"Context";const f=n.length;n=[...n,l];const h=ka(g=>{var S;const{scope:m,children:w,...y}=g,b=((S=m==null?void 0:m[e])==null?void 0:S[f])||u,k=s.useMemo(()=>y,Object.values(y));return o.jsx(b.Provider,{value:k,children:w})},"Provider");h.displayName=i+"Provider";function p(g,m,w={}){var S;const{optional:y=!1}=w,b=((S=m==null?void 0:m[e])==null?void 0:S[f])||u,k=s.useContext(b);if(k)return k;if(l!==void 0)return l;if(!y)throw new Error(`\`${g}\` must be used within \`${i}\``)}return ka(p,"useContext"),[h,p]}ka(r,"createContext");const a=ka(()=>{const i=n.map(l=>s.createContext(l));return ka(function(u){const f=(u==null?void 0:u[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])},"useScope")},"createScope");return a.scopeName=e,[r,VC(a,...t)]}ka(Zs,"createContextScope");function VC(...e){const t=e[0];if(e.length===1)return t;const n=ka(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return ka(function(i){const l=r.reduce((u,{useScope:f,scopeName:h})=>{const g=f(i)[`__scope${h}`];return{...u,...g}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ka(VC,"composeContextScopes");var t_=Object.defineProperty,Zr=(e,t)=>t_(e,"name",{value:t,configurable:!0});function bm(e){const t=e+"CollectionProvider",[n,r]=Zs(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=Zr(b=>{const{scope:k,children:S}=b,E=s.useRef(null),C=s.useRef(new Map).current;return o.jsx(a,{scope:k,itemMap:C,collectionRef:E,children:S})},"CollectionProvider");l.displayName=t;const u=e+"CollectionSlot",f=to(u),h=s.forwardRef((b,k)=>{const{scope:S,children:E}=b,C=i(u,S),A=hn(k,C.collectionRef);return o.jsx(f,{ref:A,children:E})});h.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",m=to(p),w=s.forwardRef((b,k)=>{const{scope:S,children:E,...C}=b,A=s.useRef(null),L=hn(k,A),T=i(p,S);return s.useEffect(()=>(T.itemMap.set(A,{ref:A,...C}),()=>void T.itemMap.delete(A))),o.jsx(m,{[g]:"",ref:L,children:E})});w.displayName=p;function y(b){const k=i(e+"CollectionConsumer",b);return s.useCallback(()=>{const E=k.collectionRef.current;if(!E)return[];const C=Array.from(E.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort((T,M)=>C.indexOf(T.ref.current)-C.indexOf(M.ref.current))},[k.collectionRef,k.itemMap])}return Zr(y,"useCollection"),[{Provider:l,Slot:h,ItemSlot:w},y,r]}Zr(bm,"createCollection");var Jx=new WeakMap,br,Js,l8=(Js=class extends Map{constructor(n){super(n);dx(this,br);Yg(this,br,[...super.keys()]),Jx.set(this,!0)}set(n,r){return Jx.get(this)&&(this.has(n)?os(this,br)[os(this,br).indexOf(n)]=n:os(this,br).push(n)),super.set(n,r),this}insert(n,r,a){const i=this.has(r),l=os(this,br).length,u=Vv(n);let f=u>=0?u:l+u;const h=f<0||f>=l?-1:f;if(h===this.size||i&&h===this.size-1||h===-1)return this.set(r,a),this;const p=this.size+(i?0:1);u<0&&f++;const g=[...os(this,br)];let m,w=!1;for(let y=f;y<p;y++)if(f===y){let b=g[y];g[y]===r&&(b=g[y+1]),i&&this.delete(r),m=this.get(b),this.set(r,a)}else{!w&&g[y-1]===r&&(w=!0);const b=g[w?y:y-1],k=m;m=this.get(b),this.delete(b),this.set(b,k)}return this}with(n,r,a){const i=new Js(this);return i.insert(n,r,a),i}before(n){const r=os(this,br).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,a){const i=os(this,br).indexOf(n);return i===-1?this:this.insert(i,r,a)}after(n){let r=os(this,br).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,a){const i=os(this,br).indexOf(n);return i===-1?this:this.insert(i+1,r,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Yg(this,br,[]),super.clear()}delete(n){const r=super.delete(n);return r&&os(this,br).splice(os(this,br).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=ep(os(this,br),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=ep(os(this,br),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return os(this,br).indexOf(n)}keyAt(n){return ep(os(this,br),n)}from(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return i;a++}}findIndex(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return a;a++}return-1}filter(n,r){const a=[];let i=0;for(const l of this)Reflect.apply(n,r,[l,i,this])&&a.push(l),i++;return new Js(a)}map(n,r){const a=[];let i=0;for(const l of this)a.push([l[0],Reflect.apply(n,r,[l,i,this])]),i++;return new Js(a)}reduce(...n){const[r,a]=n;let i=0,l=a??this.at(0);for(const u of this)i===0&&n.length===1?l=u:l=Reflect.apply(r,this,[l,u,i,this]),i++;return l}reduceRight(...n){const[r,a]=n;let i=a??this.at(-1);for(let l=this.size-1;l>=0;l--){const u=this.at(l);l===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,l,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Js(r)}toReversed(){const n=new Js;for(let r=this.size-1;r>=0;r--){const a=this.keyAt(r),i=this.get(a);n.set(a,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Js(r)}slice(n,r){const a=new Js;let i=this.size-1;if(n===void 0)return a;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let l=n;l<=i;l++){const u=this.keyAt(l),f=this.get(u);a.set(u,f)}return a}every(n,r){let a=0;for(const i of this){if(!Reflect.apply(n,r,[i,a,this]))return!1;a++}return!0}some(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return!0;a++}return!1}},br=new WeakMap,Zr(Js,"OrderedDict"),Js);function ep(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=ZC(e,t);return n===-1?void 0:e[n]}Zr(ep,"at");function ZC(e,t){const n=e.length,r=Vv(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}Zr(ZC,"toSafeIndex");function Vv(e){return e!==e||e===0?0:Math.trunc(e)}Zr(Vv,"toSafeInteger");function n_(e){const t=e+"CollectionProvider",[n,r]=Zs(t),[a,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new l8,setItemMap:Zr(()=>{},"setItemMap")}),l=Zr(({state:C,...A})=>C?o.jsx(f,{...A,state:C}):o.jsx(u,{...A}),"CollectionProvider");l.displayName=t;const u=Zr(C=>{const A=k();return o.jsx(f,{...C,state:A})},"CollectionInit");u.displayName=t+"Init";const f=Zr(C=>{const{scope:A,children:L,state:T}=C,M=s.useRef(null),[j,P]=s.useState(null),R=hn(M,P),[H,D]=T;return s.useEffect(()=>{if(!j)return;const U=UC(()=>{});return U.observe(j,{childList:!0,subtree:!0}),()=>{U.disconnect()}},[j]),o.jsx(a,{scope:A,itemMap:H,setItemMap:D,collectionRef:R,collectionRefObject:M,collectionElement:j,children:L})},"CollectionProviderImpl");f.displayName=t+"Impl";const h=e+"CollectionSlot",p=to(h),g=s.forwardRef((C,A)=>{const{scope:L,children:T}=C,M=i(h,L),j=hn(A,M.collectionRef);return o.jsx(p,{ref:j,children:T})});g.displayName=h;const m=e+"CollectionItemSlot",w="data-radix-collection-item",y=to(m),b=s.forwardRef((C,A)=>{const{scope:L,children:T,...M}=C,j=s.useRef(null),[P,R]=s.useState(null),H=hn(A,j,R),D=i(m,L),{setItemMap:U}=D,V=s.useRef(M);zC(V.current,M)||(V.current=M);const B=V.current;return s.useEffect(()=>{const G=B;return U(_=>P?_.has(P)?_.set(P,{...G,element:P}).toSorted(O6):(_.set(P,{...G,element:P}),_.toSorted(O6)):_),()=>{U(_=>!P||!_.has(P)?_:(_.delete(P),new l8(_)))}},[P,B,U]),o.jsx(y,{[w]:"",ref:H,children:T})});b.displayName=m;function k(){return s.useState(new l8)}Zr(k,"useInitCollection");function S(C){const{itemMap:A}=i(e+"CollectionConsumer",C);return A}return Zr(S,"useCollection"),[{Provider:l,Slot:g,ItemSlot:b},{createCollectionScope:r,useCollection:S,useInitCollection:k}]}Zr(n_,"createCollection");function zC(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!Object.prototype.hasOwnProperty.call(t,a)||e[a]!==t[a])return!1;return!0}Zr(zC,"shallowEqual");function BC(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Zr(BC,"isElementPreceding");function O6(e,t){return!e[1].element||!t[1].element?0:BC(e[1].element,t[1].element)?-1:1}Zr(O6,"sortByDocumentPosition");function UC(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Zr(UC,"getChildListObserver");var r_=Object.defineProperty,Nd=(e,t)=>r_(e,"name",{value:t,configurable:!0}),WC=!!(typeof window<"u"&&window.document&&window.document.createElement);function Mt(e,t,{checkForDefaultPrevented:n=!0}={}){return Nd(function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}Nd(Mt,"composeEventHandlers");function s_(e){var t;if(!WC)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Nd(s_,"getOwnerWindow");function I6(e){if(!WC)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Nd(I6,"getOwnerDocument");function KC(e,t=!1){const{activeElement:n}=I6(e);if(!(n!=null&&n.nodeName))return null;if(GC(n)&&n.contentDocument)return KC(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=I6(n).getElementById(r);if(a)return a}}return n}Nd(KC,"getActiveElement");function GC(e){return e.tagName==="IFRAME"}Nd(GC,"isFrame");var Er=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},a_=Object.defineProperty,o_=(e,t)=>a_(e,"name",{value:t,configurable:!0}),e5=Fc[" useEffectEvent ".trim().toString()],t5=Fc[" useInsertionEffect ".trim().toString()];function YC(e){if(typeof e5=="function")return e5(e);const t=s.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof t5=="function"?t5(()=>{t.current=e}):Er(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}o_(YC,"useEffectEvent");var i_=Object.defineProperty,L1=(e,t)=>i_(e,"name",{value:t,configurable:!0}),l_=Fc[" useInsertionEffect ".trim().toString()]||Er;function wi({prop:e,defaultProp:t,onChange:n=L1(()=>{},"onChange"),caller:r}){const[a,i,l]=qC({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a,h=s.useCallback(p=>{var g;if(u){const m=XC(p)?p(e):p;m!==e&&((g=l.current)==null||g.call(l,m))}else i(p)},[u,e,i,l]);return[f,h]}L1(wi,"useControllableState");function qC({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),a=s.useRef(n),i=s.useRef(t);return l_(()=>{i.current=t},[t]),s.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}L1(qC,"useUncontrolledState");function XC(e){return typeof e=="function"}L1(XC,"isFunction");var n5=Symbol("RADIX:SYNC_STATE");function c_(e,t,n,r){const{prop:a,defaultProp:i,onChange:l,caller:u}=t,f=a!==void 0,h=YC(l),p=[{...n,state:i}];r&&p.push(r);const[g,m]=s.useReducer((k,S)=>{if(S.type===n5)return{...k,state:S.state};const E=e(k,S);return f&&!Object.is(E.state,k.state)&&h(E.state),E},...p),w=g.state,y=s.useRef(w);s.useEffect(()=>{y.current!==w&&(y.current=w,f||h(w))},[w,y,f]);const b=s.useMemo(()=>a!==void 0?{...g,state:a}:g,[g,a]);return s.useEffect(()=>{f&&!Object.is(a,g.state)&&m({type:n5,state:a})},[a,g.state,f]),[b,m]}L1(c_,"useControllableStateReducer");var u_=Object.defineProperty,yi=(e,t)=>u_(e,"name",{value:t,configurable:!0});function QC(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}yi(QC,"useStateMachine");var ps=yi(e=>{const{present:t,children:n}=e,r=JC(t),a=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=ej(r.ref,tj(a));return typeof n=="function"||r.isPresent?s.cloneElement(a,{ref:i}):null},"Presence");function JC(e){const[t,n]=s.useState(),r=s.useRef(null),a=s.useRef(e),i=s.useRef("none"),l=s.useRef(void 0),u=e?"mounted":"unmounted",[f,h]=QC(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{f==="mounted"?(i.current=l.current??_u(r.current),l.current=void 0):i.current="none"},[f]),Er(()=>{const p=r.current,g=a.current;if(g!==e){const w=i.current,y=_u(p);e?(l.current=y,h("MOUNT")):y==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(g&&w!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),Er(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,m=yi(y=>{const k=_u(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&k&&(h("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),w=yi(y=>{y.target===t&&(i.current=_u(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:s.useCallback(p=>{if(p){const g=getComputedStyle(p);r.current=g,l.current=_u(g)}else r.current=null;n(p)},[])}}yi(JC,"usePresence");function F6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}yi(F6,"setRef");function ej(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(l=>{const u=F6(l,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():F6(r[l],null)}}},[])}yi(ej,"useStableComposedRefs");function _u(e){return(e==null?void 0:e.animationName)||"none"}yi(_u,"getAnimationName");function tj(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}yi(tj,"getElementRef");var d_=Object.defineProperty,f_=(e,t)=>d_(e,"name",{value:t,configurable:!0}),h_=Fc[" useId ".trim().toString()]||(()=>{}),p_=0;function Na(e){const[t,n]=s.useState(h_());return Er(()=>{e||n(r=>r??String(p_++))},[e]),e||(t?`radix-${t}`:"")}f_(Na,"useId");var m_=Object.defineProperty,nj=(e,t)=>m_(e,"name",{value:t,configurable:!0}),rj=s.createContext(void 0),g_=nj(e=>{const{dir:t,children:n}=e;return o.jsx(rj.Provider,{value:t,children:n})},"DirectionProvider");function $1(e){const t=s.useContext(rj);return e||t||"ltr"}nj($1,"useDirection");var v_=g_,w_=Object.defineProperty,y_=(e,t)=>w_(e,"name",{value:t,configurable:!0});function kr(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}y_(kr,"useCallbackRef");var b_=Object.defineProperty,Vr=(e,t)=>b_(e,"name",{value:t,configurable:!0}),_6="dismissableLayer.update",x_="dismissableLayer.pointerDownOutside",k_="dismissableLayer.focusOutside",r5,sj=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),T1=s.forwardRef(Vr(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:h,...p}=t,g=s.useContext(sj),[m,w]=s.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=s.useState({}),k=hn(n,w),S=Array.from(g.layers),[E]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?S.indexOf(E):-1,A=m?S.indexOf(m):-1,L=g.layersWithOutsidePointerEventsDisabled.size>0,T=A>=C,M=s.useRef(!1),j=oj(D=>{l==null||l(D),f==null||f(D),D.defaultPrevented||h==null||h()},{ownerDocument:y,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(D=>{if(!(D instanceof Node))return!1;const U=[...g.branches].some(V=>V.contains(D));return T&&!U},[g.branches,T])}),P=ij(D=>{if(a&&M.current)return;const U=D.target;[...g.branches].some(B=>B.contains(U))||(u==null||u(D),f==null||f(D),D.defaultPrevented||h==null||h())},y),R=m?A===S.length-1:!1,H=kr(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&h&&(D.preventDefault(),h()))});return s.useEffect(()=>{if(R)return y.addEventListener("keydown",H,{capture:!0}),()=>y.removeEventListener("keydown",H,{capture:!0})},[y,R,H]),s.useEffect(()=>{if(m)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(r5=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(m)),g.layers.add(m),V6(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(m),g.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=r5))}},[m,y,r,g]),s.useEffect(()=>()=>{m&&(g.layers.delete(m),g.layersWithOutsidePointerEventsDisabled.delete(m),V6())},[m,g]),s.useEffect(()=>{const D=Vr(()=>b({}),"handleUpdate");return document.addEventListener(_6,D),()=>document.removeEventListener(_6,D)},[]),o.jsx(vn.div,{...p,ref:k,style:{pointerEvents:L?T?"auto":"none":void 0,...t.style},onFocusCapture:Mt(t.onFocusCapture,P.onFocusCapture),onBlurCapture:Mt(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Mt(t.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function aj(){const e=s.useContext(sj),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Vr(aj,"useDismissableLayerSurface");var S_=Vr(()=>!0,"IS_TRUE");function oj(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:l=S_}=t,u=kr(e),f=s.useRef(!1),h=s.useRef(!1),p=s.useRef(new Map),g=s.useRef(()=>{});return s.useEffect(()=>{function m(){h.current=!1,a.current=!1,p.current.clear()}Vr(m,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}Vr(w,"isOutsideInteractionIntercepted");function y(C){if(!h.current)return;const A=C.target;A instanceof Node&&[...i].some(T=>T.contains(A))||p.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{h.current&&g.current()},0)}Vr(y,"handleInteractionCapture");function b(C){h.current&&p.current.set(C.type,!1)}Vr(b,"handleInteractionBubble");const k=Vr(C=>{if(C.target&&!f.current){let A=function(){n.removeEventListener("click",g.current);const T=w();m(),T||Zv(x_,u,L,{discrete:!0})};if(Vr(A,"handleAndDispatchPointerDownOutsideEvent"),!l(C.target)){n.removeEventListener("click",g.current),m(),f.current=!1;return}const L={originalEvent:C};h.current=!0,a.current=r&&C.button===0,p.current.clear(),!r||C.button!==0?A():(n.removeEventListener("click",g.current),g.current=A,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),m();f.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of S)n.addEventListener(C,y,!0),n.addEventListener(C,b);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",k),n.removeEventListener("click",g.current);for(const C of S)n.removeEventListener(C,y,!0),n.removeEventListener(C,b)}},[n,u,r,a,i,l]),{onPointerDownCapture:Vr(()=>f.current=!0,"onPointerDownCapture")}}Vr(oj,"usePointerDownOutside");function ij(e,t=globalThis==null?void 0:globalThis.document){const n=kr(e),r=s.useRef(!1);return s.useEffect(()=>{const a=Vr(i=>{i.target&&!r.current&&Zv(k_,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:Vr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Vr(()=>r.current=!1,"onBlurCapture")}}Vr(ij,"useFocusOutside");function V6(){const e=new CustomEvent(_6);document.dispatchEvent(e)}Vr(V6,"dispatchUpdate");function Zv(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?_v(a,i):a.dispatchEvent(i)}Vr(Zv,"handleAndDispatchCustomEvent");var E_=Object.defineProperty,Ss=(e,t)=>E_(e,"name",{value:t,configurable:!0}),c8="focusScope.autoFocusOnMount",u8="focusScope.autoFocusOnUnmount",s5={bubbles:!1,cancelable:!0},Md=s.forwardRef(Ss(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=t,[f,h]=s.useState(null),p=kr(i),g=kr(l),m=s.useRef(null),w=hn(n,h),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let k=function(A){if(y.paused||!f)return;const L=A.target;f.contains(L)?m.current=L:Jo(m.current,{select:!0})},S=function(A){if(y.paused||!f)return;const L=A.relatedTarget;L!==null&&(f.contains(L)||Jo(m.current,{select:!0}))},E=function(A){if(document.activeElement===document.body)for(const T of A)T.removedNodes.length>0&&Jo(f)};Ss(k,"handleFocusIn"),Ss(S,"handleFocusOut"),Ss(E,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",S);const C=new MutationObserver(E);return f&&C.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),C.disconnect()}}},[a,f,y.paused]),s.useEffect(()=>{if(f){a5.add(y);const k=document.activeElement;if(!f.contains(k)){const E=new CustomEvent(c8,s5);f.addEventListener(c8,p),f.dispatchEvent(E),E.defaultPrevented||(lj(hj(zv(f)),{select:!0}),document.activeElement===k&&Jo(f))}return()=>{f.removeEventListener(c8,p),setTimeout(()=>{const E=new CustomEvent(u8,s5);f.addEventListener(u8,g),f.dispatchEvent(E),E.defaultPrevented||Jo(k??document.body,{select:!0}),f.removeEventListener(u8,g),a5.remove(y)},0)}}},[f,p,g,y]);const b=s.useCallback(k=>{if(!r&&!a||y.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,E=document.activeElement;if(S&&E){const C=k.currentTarget,[A,L]=cj(C);A&&L?!k.shiftKey&&E===L?(k.preventDefault(),r&&Jo(A,{select:!0})):k.shiftKey&&E===A&&(k.preventDefault(),r&&Jo(L,{select:!0})):E===C&&k.preventDefault()}},[r,a,y.paused]);return o.jsx(vn.div,{tabIndex:-1,...u,ref:w,onKeyDown:b})},"FocusScope"));function lj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Jo(r,{select:t}),document.activeElement!==n)return}Ss(lj,"focusFirst");function cj(e){const t=zv(e),n=Z6(t,e),r=Z6(t.reverse(),e);return[n,r]}Ss(cj,"getTabbableEdges");function zv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ss(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Ss(zv,"getTabbableCandidates");function Z6(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):uj(r,{upTo:t})))return r}Ss(Z6,"findVisible");function uj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ss(uj,"isHidden");function dj(e){return e instanceof HTMLInputElement&&"select"in e}Ss(dj,"isSelectableInput");function Jo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dj(e)&&t&&e.select()}}Ss(Jo,"focus");var a5=fj();function fj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=z6(e,t),e.unshift(t)},remove(t){var n;e=z6(e,t),(n=e[0])==null||n.resume()}}}Ss(fj,"createFocusScopesStack");function z6(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ss(z6,"arrayRemove");function hj(e){return e.filter(t=>t.tagName!=="A")}Ss(hj,"removeLinks");var C_=Object.defineProperty,j_=(e,t)=>C_(e,"name",{value:t,configurable:!0}),D1=s.forwardRef(j_(function(t,n){var f;const{container:r,...a}=t,[i,l]=s.useState(!1);Er(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Br.createPortal(o.jsx(vn.div,{...a,ref:n}),u):null},"Portal")),A_=Object.defineProperty,Bv=(e,t)=>A_(e,"name",{value:t,configurable:!0}),Sh=0,yo=null;function N_(e){return Rd(),e.children}Bv(N_,"FocusGuards");function Rd(){s.useEffect(()=>{yo||(yo={start:B6(),end:B6()});const{start:e,end:t}=yo;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Sh++,()=>{Sh===1&&(yo==null||yo.start.remove(),yo==null||yo.end.remove(),yo=null),Sh=Math.max(0,Sh-1)}},[])}Bv(Rd,"useFocusGuards");function B6(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Bv(B6,"createFocusGuard");var So=function(){return So=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},So.apply(this,arguments)};function pj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function M_(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var tp="right-scroll-bar-position",np="width-before-scroll-bar",R_="with-scroll-bars-hidden",P_="--removed-body-scroll-bar-size";function d8(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function L_(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var $_=typeof window<"u"?s.useLayoutEffect:s.useEffect,o5=new WeakMap;function T_(e,t){var n=L_(null,function(r){return e.forEach(function(a){return d8(a,r)})});return $_(function(){var r=o5.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(u){i.has(u)||d8(u,null)}),i.forEach(function(u){a.has(u)||d8(u,l)})}o5.set(n,e)},[e]),n}function D_(e){return e}function H_(e,t){t===void 0&&(t=D_);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var f=function(){var p=l;l=[],p.forEach(i)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return a}function O_(e){e===void 0&&(e={});var t=H_(null);return t.options=So({async:!0,ssr:!1},e),t}var mj=function(e){var t=e.sideCar,n=pj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,So({},n))};mj.isSideCarExport=!0;function I_(e,t){return e.useMedium(t),mj}var gj=O_(),f8=function(){},xm=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:f8,onWheelCapture:f8,onTouchMoveCapture:f8}),a=r[0],i=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,m=e.sideCar,w=e.noRelative,y=e.noIsolation,b=e.inert,k=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,C=e.gapMode,A=pj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=m,T=T_([n,t]),M=So(So({},A),a);return s.createElement(s.Fragment,null,p&&s.createElement(L,{sideCar:gj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:y,inert:b,setCallbacks:i,allowPinchZoom:!!k,lockRef:n,gapMode:C}),l?s.cloneElement(s.Children.only(u),So(So({},M),{ref:T})):s.createElement(E,So({},M,{className:f,ref:T}),u))});xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xm.classNames={fullWidth:np,zeroRight:tp};var F_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function __(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=F_();return t&&e.setAttribute("nonce",t),e}function V_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Z_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var z_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=__())&&(V_(t,n),Z_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},B_=function(){var e=z_();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vj=function(){var e=B_(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},U_={left:0,top:0,right:0,gap:0},h8=function(e){return parseInt(e||"",10)||0},W_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[h8(n),h8(r),h8(a)]},K_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return U_;var t=W_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},G_=vj(),Ju="data-scroll-locked",Y_=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
+
.`.concat(R_,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(Ju,`] {
|
|
58
|
+
overflow: hidden `).concat(r,`;
|
|
59
|
+
overscroll-behavior: contain;
|
|
60
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
+
padding-left: `.concat(a,`px;
|
|
62
|
+
padding-top: `).concat(i,`px;
|
|
63
|
+
padding-right: `).concat(l,`px;
|
|
64
|
+
margin-left:0;
|
|
65
|
+
margin-top:0;
|
|
66
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
67
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.`).concat(tp,` {
|
|
71
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(np,` {
|
|
75
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(tp," .").concat(tp,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(np," .").concat(np,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(Ju,`] {
|
|
87
|
+
`).concat(P_,": ").concat(u,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},i5=function(){var e=parseInt(document.body.getAttribute(Ju)||"0",10);return isFinite(e)?e:0},q_=function(){s.useEffect(function(){return document.body.setAttribute(Ju,(i5()+1).toString()),function(){var e=i5()-1;e<=0?document.body.removeAttribute(Ju):document.body.setAttribute(Ju,e.toString())}},[])},X_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;q_();var i=s.useMemo(function(){return K_(a)},[a]);return s.createElement(G_,{styles:Y_(i,!t,a,n?"":"!important")})},U6=!1;if(typeof window<"u")try{var Eh=Object.defineProperty({},"passive",{get:function(){return U6=!0,!0}});window.addEventListener("test",Eh,Eh),window.removeEventListener("test",Eh,Eh)}catch{U6=!1}var ju=U6?{passive:!1}:!1,Q_=function(e){return e.tagName==="TEXTAREA"},wj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q_(e)&&n[t]==="visible")},J_=function(e){return wj(e,"overflowY")},eV=function(e){return wj(e,"overflowX")},l5=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=yj(e,r);if(a){var i=bj(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yj=function(e,t){return e==="v"?J_(t):eV(t)},bj=function(e,t){return e==="v"?tV(t):nV(t)},rV=function(e,t){return e==="h"&&t==="rtl"?-1:1},sV=function(e,t,n,r,a){var i=rV(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,f=t.contains(u),h=!1,p=l>0,g=0,m=0;do{if(!u)break;var w=bj(e,u),y=w[0],b=w[1],k=w[2],S=b-k-i*y;(y||S)&&yj(e,u)&&(g+=S,m+=y);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(m)<1)&&(h=!0),h},Ch=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},c5=function(e){return[e.deltaX,e.deltaY]},u5=function(e){return e&&"current"in e?e.current:e},aV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oV=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},iV=0,Au=[];function lV(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),a=s.useState(iV++)[0],i=s.useState(vj)[0],l=s.useRef(e);s.useEffect(function(){l.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=M_([e.lockRef.current],(e.shards||[]).map(u5),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var S=Ch(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-S[0],A="deltaY"in b?b.deltaY:E[1]-S[1],L,T=b.target,M=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&M==="h"&&T.type==="range")return!1;var j=window.getSelection(),P=j&&j.anchorNode,R=P?P===T||P.contains(T):!1;if(R)return!1;var H=l5(M,T);if(!H)return!0;if(H?L=M:(L=M==="v"?"h":"v",H=l5(M,T)),!H)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=L),!L)return!0;var D=r.current||L;return sV(D,k,b,D==="h"?C:A)},[]),f=s.useCallback(function(b){var k=b;if(!(!Au.length||Au[Au.length-1]!==i)){var S="deltaY"in k?c5(k):Ch(k),E=t.current.filter(function(L){return L.name===k.type&&(L.target===k.target||k.target===L.shadowParent)&&aV(L.delta,S)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var C=(l.current.shards||[]).map(u5).filter(Boolean).filter(function(L){return L.contains(k.target)}),A=C.length>0?u(k,C[0]):!l.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),h=s.useCallback(function(b,k,S,E){var C={name:b,delta:k,target:S,should:E,shadowParent:cV(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),p=s.useCallback(function(b){n.current=Ch(b),r.current=void 0},[]),g=s.useCallback(function(b){h(b.type,c5(b),b.target,u(b,e.lockRef.current))},[]),m=s.useCallback(function(b){h(b.type,Ch(b),b.target,u(b,e.lockRef.current))},[]);s.useEffect(function(){return Au.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",f,ju),document.addEventListener("touchmove",f,ju),document.addEventListener("touchstart",p,ju),function(){Au=Au.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,ju),document.removeEventListener("touchmove",f,ju),document.removeEventListener("touchstart",p,ju)}},[]);var w=e.removeScrollBar,y=e.inert;return s.createElement(s.Fragment,null,y?s.createElement(i,{styles:oV(a)}):null,w?s.createElement(X_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const uV=I_(gj,lV);var H1=s.forwardRef(function(e,t){return s.createElement(xm,So({},e,{ref:t,sideCar:uV}))});H1.classNames=xm.classNames;var dV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nu=new WeakMap,jh=new WeakMap,Ah={},p8=0,xj=function(e){return e&&(e.host||xj(e.parentNode))},fV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xj(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},hV=function(e,t,n,r){var a=fV(t,Array.isArray(e)?e:[e]);Ah[n]||(Ah[n]=new WeakMap);var i=Ah[n],l=[],u=new Set,f=new Set(a),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};a.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(m){if(u.has(m))p(m);else try{var w=m.getAttribute(r),y=w!==null&&w!=="false",b=(Nu.get(m)||0)+1,k=(i.get(m)||0)+1;Nu.set(m,b),i.set(m,k),l.push(m),b===1&&y&&jh.set(m,!0),k===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return p(t),u.clear(),p8++,function(){l.forEach(function(g){var m=Nu.get(g)-1,w=i.get(g)-1;Nu.set(g,m),i.set(g,w),m||(jh.has(g)||g.removeAttribute(r),jh.delete(g)),w||g.removeAttribute(n)}),p8--,p8||(Nu=new WeakMap,Nu=new WeakMap,jh=new WeakMap,Ah={})}},km=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=dV(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),hV(r,a,n,"aria-hidden")):function(){return null}},pV=Object.defineProperty,oa=(e,t)=>pV(e,"name",{value:t,configurable:!0}),Uv="Dialog",[kj,Sj]=Zs(Uv),[mV,oo]=kj(Uv),Rl=oa(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=s.useRef(null),f=s.useRef(null),[h,p]=wi({prop:r,defaultProp:a??!1,onChange:i,caller:Uv}),[g,m]=s.useState(0),[w,y]=s.useState(0);return o.jsx(mV,{scope:t,triggerRef:u,contentRef:f,contentId:Na(),titleId:Na(),descriptionId:Na(),titlePresent:g>0,descriptionPresent:w>0,setTitleCount:m,setDescriptionCount:y,open:h,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(b=>!b),[p]),modal:l,children:n})},"Dialog"),gV="DialogTrigger",Wv=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(gV,r),l=hn(n,i.triggerRef);return o.jsx(vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Sm(i.open),...a,ref:l,onClick:Mt(t.onClick,i.onOpenToggle)})},"DialogTrigger")),Ej="DialogPortal",[vV,Cj]=kj(Ej,{forceMount:void 0}),Pl=oa(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=oo(Ej,t);return o.jsx(vV,{scope:t,forceMount:n,children:s.Children.map(r,l=>o.jsx(ps,{present:n||i.open,children:o.jsx(D1,{asChild:!0,container:a,children:l})}))})},"DialogPortal"),W6="DialogOverlay",Ll=s.forwardRef(oa(function(t,n){const r=Cj(W6,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=oo(W6,t.__scopeDialog);return l.modal?o.jsx(ps,{present:a||l.open,children:o.jsx(yV,{...i,ref:n})}):null},"DialogOverlay")),wV=to("DialogOverlay.RemoveScroll"),yV=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(W6,r),l=aj(),u=hn(n,l);return o.jsx(H1,{as:wV,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(vn.div,{"data-state":Sm(i.open),...a,ref:u,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),r1="DialogContent",$l=s.forwardRef(oa(function(t,n){const r=Cj(r1,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=oo(r1,t.__scopeDialog);return o.jsx(ps,{present:a||l.open,children:l.modal?o.jsx(bV,{...i,ref:n}):o.jsx(xV,{...i,ref:n})})},"DialogContent")),bV=s.forwardRef(oa(function(t,n){const r=oo(r1,t.__scopeDialog),a=s.useRef(null),i=hn(n,r.contentRef,a);return s.useEffect(()=>{const l=a.current;if(l)return km(l)},[]),o.jsx(jj,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Mt(t.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Mt(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:Mt(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),xV=s.forwardRef(oa(function(t,n){const r=oo(r1,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(jj,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"DialogContentNonModal")),jj=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=t,f=oo(r1,r);return Rd(),o.jsx(o.Fragment,{children:o.jsx(Md,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(T1,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":Sm(f.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),kV="DialogTitle",Tl=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(kV,r),{setTitleCount:l}=i;return Er(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(vn.h2,{id:i.titleId,...a,ref:n})},"DialogTitle")),SV="DialogDescription",Kv=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(SV,r),{setDescriptionCount:l}=i;return Er(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(vn.p,{id:i.descriptionId,...a,ref:n})},"DialogDescription")),EV="DialogClose",O1=s.forwardRef(oa(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(EV,r);return o.jsx(vn.button,{type:"button",...a,ref:n,onClick:Mt(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function Sm(e){return e?"open":"closed"}oa(Sm,"getState");var CV=Object.defineProperty,Ai=(e,t)=>CV(e,"name",{value:t,configurable:!0}),jV="AlertDialog",[AV,V0e]=Zs(jV,[Sj]),Ni=Sj(),NV=Ai(e=>{const{__scopeAlertDialog:t,...n}=e,r=Ni(t);return o.jsx(Rl,{...r,...n,modal:!0})},"AlertDialog"),MV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Ni(r);return o.jsx(Wv,{...i,...a,ref:n})},"AlertDialogTrigger")),RV=Ai(e=>{const{__scopeAlertDialog:t,...n}=e,r=Ni(t);return o.jsx(Pl,{...r,...n})},"AlertDialogPortal"),PV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Ni(r);return o.jsx(Ll,{...i,...a,ref:n})},"AlertDialogOverlay")),LV="AlertDialogContent",[$V,TV]=AV(LV),DV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,children:a,...i}=t,l=Ni(r),u=s.useRef(null),f=hn(n,u),h=s.useRef(null);return o.jsx($V,{scope:r,cancelRef:h,children:o.jsx($l,{role:"alertdialog",...l,...i,ref:f,onOpenAutoFocus:Mt(i.onOpenAutoFocus,p=>{var g;p.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:a})})},"AlertDialogContent")),HV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Ni(r);return o.jsx(Tl,{...i,...a,ref:n})},"AlertDialogTitle")),OV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Ni(r);return o.jsx(Kv,{...i,...a,ref:n})},"AlertDialogDescription")),IV=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Ni(r);return o.jsx(O1,{...i,...a,ref:n})},"AlertDialogAction")),FV="AlertDialogCancel",_V=s.forwardRef(Ai(function(t,n){const{__scopeAlertDialog:r,...a}=t,{cancelRef:i}=TV(FV,r),l=Ni(r),u=hn(n,i);return o.jsx(O1,{...l,...a,ref:u})},"AlertDialogCancel")),VV=NV,ZV=MV,zV=RV,BV=PV,UV=DV,WV=IV,KV=_V,GV=HV,YV=OV,qV=Object.defineProperty,XV=(e,t)=>qV(e,"name",{value:t,configurable:!0});function Aj(e){const[t,n]=s.useState(void 0);return Er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const f=i.borderBoxSize,h=Array.isArray(f)?f[0]:f;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}XV(Aj,"useSize");const QV=["top","right","bottom","left"],kl=Math.min,ii=Math.max,vp=Math.round,Nh=Math.floor,li=e=>({x:e,y:e}),JV={left:"right",right:"left",bottom:"top",top:"bottom"};function Nj(e,t,n){return ii(e,kl(t,n))}function bi(e,t){return typeof e=="function"?e(t):e}function Sl(e){return e.split("-")[0]}function Pd(e){return e.split("-")[1]}function Gv(e){return e==="x"?"y":"x"}function Yv(e){return e==="y"?"height":"width"}function Co(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qv(e){return Gv(Co(e))}function eZ(e,t,n){n===void 0&&(n=!1);const r=Pd(e),a=qv(e),i=Yv(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=wp(l)),[l,wp(l)]}function tZ(e){const t=wp(e);return[K6(e),t,K6(t)]}function K6(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const d5=["left","right"],f5=["right","left"],nZ=["top","bottom"],rZ=["bottom","top"];function sZ(e,t,n){switch(e){case"top":case"bottom":return n?t?f5:d5:t?d5:f5;case"left":case"right":return t?nZ:rZ;default:return[]}}function aZ(e,t,n,r){const a=Pd(e);let i=sZ(Sl(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(K6)))),i}function wp(e){const t=Sl(e);return JV[t]+e.slice(t.length)}function oZ(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function Mj(e){return typeof e!="number"?oZ(e):{top:e,right:e,bottom:e,left:e}}function yp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function h5(e,t,n){let{reference:r,floating:a}=e;const i=Co(t),l=qv(t),u=Yv(l),f=Sl(t),h=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,m=r[u]/2-a[u]/2;let w;switch(f){case"top":w={x:p,y:r.y-a.height};break;case"bottom":w={x:p,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:g};break;case"left":w={x:r.x-a.width,y:g};break;default:w={x:r.x,y:r.y}}const y=Pd(t);return y&&(w[l]+=m*(y==="end"?1:-1)*(n&&h?-1:1)),w}async function iZ(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:m=!1,padding:w=0}=bi(t,e),y=Mj(w),k=u[m?g==="floating"?"reference":"floating":g],S=yp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),E=g==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),A=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},L=yp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:C,strategy:f}):E);return{top:(S.top-L.top+y.top)/A.y,bottom:(L.bottom-S.bottom+y.bottom)/A.y,left:(S.left-L.left+y.left)/A.x,right:(L.right-S.right+y.right)/A.x}}const lZ=50,cZ=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:iZ},f=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=h5(h,r,f),m=r,w=0;const y={};for(let b=0;b<i.length;b++){const k=i[b];if(!k)continue;const{name:S,fn:E}=k,{x:C,y:A,data:L,reset:T}=await E({x:p,y:g,initialPlacement:r,placement:m,strategy:a,middlewareData:y,rects:h,platform:u,elements:{reference:e,floating:t}});p=C??p,g=A??g,y[S]={...y[S],...L},T&&w<lZ&&(w++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(h=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:p,y:g}=h5(h,m,f)),b=-1)}return{x:p,y:g,placement:m,strategy:a,middlewareData:y}},uZ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:f}=t,{element:h,padding:p=0}=bi(e,t)||{};if(h==null)return{};const g=Mj(p),m={x:n,y:r},w=qv(a),y=Yv(w),b=await l.getDimensions(h),k=w==="y",S=k?"top":"left",E=k?"bottom":"right",C=k?"clientHeight":"clientWidth",A=i.reference[y]+i.reference[w]-m[w]-i.floating[y],L=m[w]-i.reference[w],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let M=T?T[C]:0;(!M||!await(l.isElement==null?void 0:l.isElement(T)))&&(M=u.floating[C]||i.floating[y]);const j=A/2-L/2,P=M/2-b[y]/2-1,R=kl(g[S],P),H=kl(g[E],P),D=M-b[y]-H,U=M/2-b[y]/2+j,V=Nj(R,U,D),B=!f.arrow&&Pd(a)!=null&&U!==V&&i.reference[y]/2-(U<R?R:H)-b[y]/2<0,G=B?U<R?U-R:U-D:0;return{[w]:m[w]+G,data:{[w]:V,centerOffset:U-V-G,...B&&{alignmentOffset:G}},reset:B}}}),dZ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...k}=bi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Sl(a),E=Co(u),C=Sl(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(h.floating)),L=m||(C||!b?[wp(u)]:tZ(u)),T=y!=="none";!m&&T&&L.push(...aZ(u,b,y,A));const M=[u,...L],j=await f.detectOverflow(t,k),P=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&P.push(j[S]),g){const V=eZ(a,l,A);P.push(j[V[0]],j[V[1]])}if(R=[...R,{placement:a,overflows:P}],!P.every(V=>V<=0)){var H,D;const V=(((H=i.flip)==null?void 0:H.index)||0)+1,B=M[V];if(B&&(!(g==="alignment"?E!==Co(B):!1)||R.every(O=>Co(O.placement)===E?O.overflows[0]>0:!0)))return{data:{index:V,overflows:R},reset:{placement:B}};let G=(D=R.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!G)switch(w){case"bestFit":{var U;const _=(U=R.filter(O=>{if(T){const I=Co(O.placement);return I===E||I==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(I=>I>0).reduce((I,K)=>I+K,0)]).sort((O,I)=>O[1]-I[1])[0])==null?void 0:U[0];_&&(G=_);break}case"initialPlacement":G=u;break}if(a!==G)return{reset:{placement:G}}}return{}}}};function p5(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function m5(e){return QV.some(t=>e[t]>=0)}const fZ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=bi(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),u=p5(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:m5(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),u=p5(l,n.floating);return{data:{escapedOffsets:u,escaped:m5(u)}}}default:return{}}}}},Rj=new Set(["left","top"]);async function hZ(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Sl(n),u=Pd(n),f=Co(n)==="y",h=Rj.has(l)?-1:1,p=i&&f?-1:1,g=bi(t,e);let{mainAxis:m,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof y=="number"&&(w=u==="end"?y*-1:y),f?{x:w*p,y:m*h}:{x:m*h,y:w*p}}const pZ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,f=await hZ(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},mZ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:f={fn:E=>{let{x:C,y:A}=E;return{x:C,y:A}}},...h}=bi(e,t),p={x:n,y:r},g=await i.detectOverflow(t,h),m=Co(a),w=Gv(m);let y=p[w],b=p[m];const k=(E,C)=>Nj(C+g[E==="y"?"top":"left"],C,C-g[E==="y"?"bottom":"right"]);l&&(y=k(w,y)),u&&(b=k(m,b));const S=f.fn({...t,[w]:y,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[w]:l,[m]:u}}}}}},gZ=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:i,placement:l,rects:u,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:g=!0}=bi(e,t),m={x:a,y:i},w=Co(l),y=Gv(w);let b=m[y],k=m[w];const S=bi(h,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const L=y==="y"?"height":"width",T=u.reference[y]-u.floating[L]+E.mainAxis,M=u.reference[y]+u.reference[L]-E.mainAxis;b<T?b=T:b>M&&(b=M)}if(g){var C,A;const L=y==="y"?"width":"height",T=Rj.has(Sl(l)),M=u.reference[w]-u.floating[L]+(T&&((C=f.offset)==null?void 0:C[w])||0)+(T?0:E.crossAxis),j=u.reference[w]+u.reference[L]+(T?0:((A=f.offset)==null?void 0:A[w])||0)-(T?E.crossAxis:0);k<M?k=M:k>j&&(k=j)}return{[y]:b,[w]:k}}}},vZ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:i}=t,{apply:l=()=>{},...u}=bi(e,t),f=await a.detectOverflow(t,u),h=Sl(n),p=Pd(n),g=Co(n)==="y",{width:m,height:w}=r.floating;let y,b;h==="top"||h==="bottom"?(y=h,b=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(b=h,y=p==="end"?"top":"bottom");const k=w-f.top-f.bottom,S=m-f.left-f.right,E=kl(w-f[y],k),C=kl(m-f[b],S),A=t.middlewareData.shift,L=!A;let T=E,M=C;A!=null&&A.enabled.x&&(M=S),A!=null&&A.enabled.y&&(T=k),L&&!p&&(g?M=m-2*ii(f.left,f.right):T=w-2*ii(f.top,f.bottom)),await l({...t,availableWidth:M,availableHeight:T});const j=await a.getDimensions(i.floating);return m!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}};function Em(){return typeof window<"u"}function Ld(e){return Pj(e)?(e.nodeName||"").toLowerCase():"#document"}function Fs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mi(e){var t;return(t=(Pj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pj(e){return Em()?e instanceof Node||e instanceof Fs(e).Node:!1}function Lo(e){return Em()?e instanceof Element||e instanceof Fs(e).Element:!1}function Dl(e){return Em()?e instanceof HTMLElement||e instanceof Fs(e).HTMLElement:!1}function g5(e){return!Em()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fs(e).ShadowRoot}function Cm(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function wZ(e){return/^(table|td|th)$/.test(Ld(e))}function jm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yZ=/transform|translate|scale|rotate|perspective|filter/,bZ=/paint|layout|strict|content/,ac=e=>!!e&&e!=="none";let m8;function Xv(e){const t=Lo(e)?$o(e):e;return ac(t.transform)||ac(t.translate)||ac(t.scale)||ac(t.rotate)||ac(t.perspective)||!Qv()&&(ac(t.backdropFilter)||ac(t.filter))||yZ.test(t.willChange||"")||bZ.test(t.contain||"")}function xZ(e){let t=Nc(e);for(;Dl(t)&&!s1(t);){if(Xv(t))return t;if(jm(t))return null;t=Nc(t)}return null}function Qv(){return m8==null&&(m8=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),m8}function s1(e){return/^(html|body|#document)$/.test(Ld(e))}function $o(e){return Fs(e).getComputedStyle(e)}function Am(e){return Lo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nc(e){if(Ld(e)==="html")return e;const t=e.assignedSlot||e.parentNode||g5(e)&&e.host||Mi(e);return g5(t)?t.host:t}function Lj(e){const t=Nc(e);return s1(t)?(e.ownerDocument||e).body:Dl(t)&&Cm(t)?t:Lj(t)}function a1(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Lj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Fs(a);if(i){const u=G6(l);return t.concat(l,l.visualViewport||[],Cm(a)?a:[],u&&n?a1(u):[])}else return t.concat(a,a1(a,[],n))}function G6(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $j(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Dl(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=vp(n)!==i||vp(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Jv(e){return Lo(e)?e:e.contextElement}function ed(e){const t=Jv(e);if(!Dl(t))return li(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=$j(t);let l=(i?vp(n.width):n.width)/r,u=(i?vp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const kZ=li(0);function Tj(e){const t=Fs(e);return!Qv()||!t.visualViewport?kZ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SZ(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Fs(e)}function Mc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Jv(e);let l=li(1);t&&(r?Lo(r)&&(l=ed(r)):l=ed(e));const u=SZ(i,n,r)?Tj(i):li(0);let f=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i&&r){const m=Fs(i),w=Lo(r)?Fs(r):r;let y=m,b=G6(y);for(;b&&w!==y;){const k=ed(b),S=b.getBoundingClientRect(),E=$o(b),C=S.left+(b.clientLeft+parseFloat(E.paddingLeft))*k.x,A=S.top+(b.clientTop+parseFloat(E.paddingTop))*k.y;f*=k.x,h*=k.y,p*=k.x,g*=k.y,f+=C,h+=A,y=Fs(b),b=G6(y)}}return yp({width:p,height:g,x:f,y:h})}function Nm(e,t){const n=Am(e).scrollLeft;return t?t.left+n:Mc(Mi(e)).left+n}function Dj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Nm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function EZ(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Mi(r),u=t?jm(t.floating):!1;if(r===l||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=li(1);const p=li(0),g=Dl(r);if((g||!i)&&((Ld(r)!=="body"||Cm(l))&&(f=Am(r)),g)){const w=Mc(r);h=ed(r),p.x=w.x+r.clientLeft,p.y=w.y+r.clientTop}const m=l&&!g&&!i?Dj(l,f):li(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+m.x,y:n.y*h.y-f.scrollTop*h.y+p.y+m.y}}function CZ(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jZ(e){const t=Am(e),n=e.ownerDocument.body,r=ii(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=ii(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Nm(e);const l=-t.scrollTop;return $o(n).direction==="rtl"&&(i+=ii(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:l}}const AZ=25;function NZ(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=Fs(e),i=Mi(e),l=a.visualViewport;let u=i.clientWidth,f=i.clientHeight,h=0,p=0;if(l){const m=!Qv()||t==="fixed";r?m||(h=-l.offsetLeft,p=-l.offsetTop):(u=l.width,f=l.height,m&&(h=l.offsetLeft,p=l.offsetTop))}if(Nm(i)<=0){const m=i.ownerDocument,w=m.body,y=getComputedStyle(w),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(i.clientWidth-w.clientWidth-b),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?k/2:k;S<=AZ&&(u-=S)}return{width:u,height:f,x:h,y:p}}function MZ(e,t){const n=Mc(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ed(e),l=e.clientWidth*i.x,u=e.clientHeight*i.y,f=a*i.x,h=r*i.y;return{width:l,height:u,x:f,y:h}}function v5(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=NZ(e,n,t);else if(t==="document")r=jZ(Mi(e));else if(Lo(t))r=MZ(t,n);else{const a=Tj(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return yp(r)}function RZ(e,t){const n=t.get(e);if(n)return n;let r=a1(e,[],!1).filter(u=>Lo(u)&&Ld(u)!=="body"),a=null;const i=$o(e).position==="fixed";let l=i?Nc(e):e;for(;Lo(l)&&!s1(l);){const u=$o(l),f=Xv(l),h=a?a.position:i?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(g=>g!==l):a=u,l=Nc(l)}return t.set(e,r),r}function PZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?jm(t)?[]:RZ(t,this._c):[].concat(n),r],u=v5(t,l[0],a);let f=u.top,h=u.right,p=u.bottom,g=u.left;for(let m=1;m<l.length;m++){const w=v5(t,l[m],a);f=ii(w.top,f),h=kl(w.right,h),p=kl(w.bottom,p),g=ii(w.left,g)}return{width:h-g,height:p-f,x:g,y:f}}function LZ(e){const{width:t,height:n}=$j(e);return{width:t,height:n}}function $Z(e,t,n){const r=Dl(t),a=Mi(t),i=n==="fixed",l=Mc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=li(0);if((r||!i)&&((Ld(t)!=="body"||Cm(a))&&(u=Am(t)),r)){const m=Mc(t,!0,i,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}!r&&a&&(f.x=Nm(a));const h=a&&!r&&!i?Dj(a,u):li(0),p=l.left+u.scrollLeft-f.x-h.x,g=l.top+u.scrollTop-f.y-h.y;return{x:p,y:g,width:l.width,height:l.height}}function g8(e){return $o(e).position==="static"}function w5(e,t){if(!Dl(e)||$o(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mi(e)===n&&(n=n.ownerDocument.body),n}function Hj(e,t){const n=Fs(e);if(jm(e))return n;if(!Dl(e)){let a=Nc(e);for(;a&&!s1(a);){if(Lo(a)&&!g8(a))return a;a=Nc(a)}return n}let r=w5(e,t);for(;r&&wZ(r)&&g8(r);)r=w5(r,t);return r&&s1(r)&&g8(r)&&!Xv(r)?n:r||xZ(e)||n}const TZ=async function(e){const t=this.getOffsetParent||Hj,n=this.getDimensions,r=await n(e.floating);return{reference:$Z(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DZ(e){return $o(e).direction==="rtl"}const HZ={convertOffsetParentRelativeRectToViewportRelativeRect:EZ,getDocumentElement:Mi,getClippingRect:PZ,getOffsetParent:Hj,getElementRects:TZ,getClientRects:CZ,getDimensions:LZ,getScale:ed,isElement:Lo,isRTL:DZ};function Oj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function OZ(e,t,n){let r=null,a;const i=Mi(e);function l(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function u(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),l();const m=e.getBoundingClientRect(),{left:w,top:y,width:b,height:k}=m;if(p||t(),!b||!k)return;const S=Nh(y),E=Nh(i.clientWidth-(w+b)),C=Nh(i.clientHeight-(y+k)),A=Nh(w),T={rootMargin:-S+"px "+-E+"px "+-C+"px "+-A+"px",threshold:ii(0,kl(1,g))||1};let M=!0;function j(P){const R=P[0].intersectionRatio;if(!Oj(m,e.getBoundingClientRect()))return u();if(R!==g){if(!M)return u();R?u(!1,R):a=setTimeout(()=>{u(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(j,{...T,root:i.ownerDocument})}catch{r=new IntersectionObserver(j,T)}r.observe(e)}const f=Fs(e),h=()=>u(n);return f.addEventListener("resize",h),u(!0),()=>{f.removeEventListener("resize",h),l()}}function Ij(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Jv(e),p=a||i?[...h?a1(h):[],...t?a1(t):[]]:[];p.forEach(S=>{a&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const g=h&&u?OZ(h,n,i):null;let m=-1,w=null;l&&(w=new ResizeObserver(S=>{let[E]=S;E&&E.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=w)==null||C.observe(t)})),n()}),h&&!f&&w.observe(h),t&&w.observe(t));let y,b=f?Mc(e):null;f&&k();function k(){const S=Mc(e);b&&!Oj(b,S)&&n(),b=S,y=requestAnimationFrame(k)}return n(),()=>{var S;p.forEach(E=>{a&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),g==null||g(),(S=w)==null||S.disconnect(),w=null,f&&cancelAnimationFrame(y)}}const Fj=pZ,_j=mZ,Vj=dZ,IZ=vZ,FZ=fZ,Y6=uZ,_Z=gZ,Zj=(e,t,n)=>{const r=new Map,a=n??{},i={...HZ,...a.platform,_c:r};return cZ(e,t,{...a,platform:i})};var VZ=typeof document<"u",ZZ=function(){},rp=VZ?s.useLayoutEffect:ZZ;function bp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!bp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!bp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function y5(e,t){const n=zj(e);return Math.round(t*n)/n}function v8(e){const t=s.useRef(e);return rp(()=>{t.current=e}),t}function zZ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[p,g]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,w]=s.useState(r);bp(m,r)||w(r);const[y,b]=s.useState(null),[k,S]=s.useState(null),E=s.useCallback(O=>{O!==T.current&&(T.current=O,b(O))},[]),C=s.useCallback(O=>{O!==M.current&&(M.current=O,S(O))},[]),A=i||y,L=l||k,T=s.useRef(null),M=s.useRef(null),j=s.useRef(p),P=f!=null,R=v8(f),H=v8(a),D=v8(h),U=s.useCallback(()=>{if(!T.current||!M.current)return;const O={placement:t,strategy:n,middleware:m};H.current&&(O.platform=H.current),Zj(T.current,M.current,O).then(I=>{const K={...I,isPositioned:D.current!==!1};V.current&&!bp(j.current,K)&&(j.current=K,Br.flushSync(()=>{g(K)}))})},[m,t,n,H,D]);rp(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[h]);const V=s.useRef(!1);rp(()=>(V.current=!0,()=>{V.current=!1}),[]),rp(()=>{if(A&&(T.current=A),L&&(M.current=L),A&&L){if(R.current)return R.current(A,L,U);U()}},[A,L,U,R,P]);const B=s.useMemo(()=>({reference:T,floating:M,setReference:E,setFloating:C}),[E,C]),G=s.useMemo(()=>({reference:A,floating:L}),[A,L]),_=s.useMemo(()=>{const O={position:n,left:0,top:0};if(!G.floating)return O;const I=y5(G.floating,p.x),K=y5(G.floating,p.y);return u?{...O,transform:"translate("+I+"px, "+K+"px)",...zj(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:K}},[n,u,G.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:U,refs:B,elements:G,floatingStyles:_}),[p,U,B,G,_])}const BZ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Y6({element:r.current,padding:a}).fn(n):{}:r?Y6({element:r,padding:a}).fn(n):{}}}},UZ=(e,t)=>{const n=Fj(e);return{name:n.name,fn:n.fn,options:[e,t]}},WZ=(e,t)=>{const n=_j(e);return{name:n.name,fn:n.fn,options:[e,t]}},KZ=(e,t)=>({fn:_Z(e).fn,options:[e,t]}),GZ=(e,t)=>{const n=Vj(e);return{name:n.name,fn:n.fn,options:[e,t]}},YZ=(e,t)=>{const n=IZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},qZ=(e,t)=>{const n=FZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},XZ=(e,t)=>{const n=BZ(e);return{name:n.name,fn:n.fn,options:[e,t]}};var QZ=Object.defineProperty,JZ=(e,t)=>QZ(e,"name",{value:t,configurable:!0}),ez=s.forwardRef(JZ(function(t,n){const{children:r,width:a=10,height:i=5,...l}=t;return o.jsx(vn.svg,{...l,ref:n,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),tz=ez,nz=Object.defineProperty,ci=(e,t)=>nz(e,"name",{value:t,configurable:!0}),Bj="Popper",[Uj,Hl]=Zs(Bj),[rz,Wj]=Uj(Bj),sz=ci(e=>{const{__scopePopper:t,children:n}=e,[r,a]=s.useState(null),[i,l]=s.useState(void 0);return o.jsx(rz,{scope:t,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:l,children:n})},"Popper"),az="PopperAnchor",oz=s.forwardRef(ci(function(t,n){const{__scopePopper:r,virtualRef:a,...i}=t,l=Wj(az,r),u=s.useRef(null),f=l.onAnchorChange,h=s.useCallback(b=>{u.current=b,b&&f(b)},[f]),p=hn(n,h),g=s.useRef(null);s.useEffect(()=>{if(!a)return;const b=g.current;g.current=a.current,b!==g.current&&f(g.current)});const m=l.placementState&&Mm(l.placementState),w=m==null?void 0:m[0],y=m==null?void 0:m[1];return a?null:o.jsx(vn.div,{"data-radix-popper-side":w,"data-radix-popper-align":y,...i,ref:p})},"PopperAnchor")),Kj="PopperContent",[iz,lz]=Uj(Kj),cz=s.forwardRef(ci(function(t,n){var J,Q,ae,$e,ie,ke,ze;const{__scopePopper:r,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:m="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:b,...k}=t,S=Wj(Kj,r),[E,C]=s.useState(null),A=hn(n,C),[L,T]=s.useState(null),M=Aj(L),j=(M==null?void 0:M.width)??0,P=(M==null?void 0:M.height)??0,R=a+(l!=="center"?"-"+l:""),H=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},D=Array.isArray(p)?p:[p],U=D.length>0,V={padding:H,boundary:D.filter(Gj),altBoundary:U},{refs:B,floatingStyles:G,placement:_,isPositioned:O,middlewareData:I}=zZ({strategy:"fixed",placement:R,whileElementsMounted:ci((...wt)=>Ij(...wt,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[UZ({mainAxis:i+P,alignmentAxis:u}),h&&WZ({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?KZ():void 0,...V}),h&&GZ({...V}),YZ({...V,apply:ci(({elements:wt,rects:Ke,availableWidth:tt,availableHeight:De})=>{const{width:Se,height:X}=Ke.reference,je=wt.floating.style;je.setProperty("--radix-popper-available-width",`${tt}px`),je.setProperty("--radix-popper-available-height",`${De}px`),je.setProperty("--radix-popper-anchor-width",`${Se}px`),je.setProperty("--radix-popper-anchor-height",`${X}px`)},"apply")}),L&&XZ({element:L,padding:f}),hz({arrowWidth:j,arrowHeight:P}),w&&qZ({strategy:"referenceHidden",...V,boundary:U?V.boundary:void 0})]}),K=S.setPlacementState;Er(()=>(K(_),()=>{K(void 0)}),[_,K]);const[z,q]=Mm(_),Z=kr(b);Er(()=>{O&&(Z==null||Z())},[O,Z]);const ee=(J=I.arrow)==null?void 0:J.x,he=(Q=I.arrow)==null?void 0:Q.y,ue=((ae=I.arrow)==null?void 0:ae.centerOffset)!==0,[ge,te]=s.useState();return Er(()=>{E&&te(window.getComputedStyle(E).zIndex)},[E]),o.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:O?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[($e=I.transformOrigin)==null?void 0:$e.x,(ie=I.transformOrigin)==null?void 0:ie.y].join(" "),...((ke=I.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(iz,{scope:r,placedSide:z,placedAlign:q,onArrowChange:T,arrowX:ee,arrowY:he,shouldHideArrow:ue,children:o.jsx(vn.div,{"data-side":z,"data-align":q,...k,ref:A,style:{...k.style,animation:O?(ze=k.style)==null?void 0:ze.animation:"none"}})})})},"PopperContent")),uz="PopperArrow",dz={top:"bottom",right:"left",bottom:"top",left:"right"},fz=s.forwardRef(ci(function(t,n){const{__scopePopper:r,...a}=t,i=lz(uz,r),l=dz[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(tz,{...a,ref:n,style:{...a.style,display:"block"}})})},"PopperArrow"));function Gj(e){return e!==null}ci(Gj,"isNotNull");var hz=ci(e=>({name:"transformOrigin",options:e,fn(t){var k,S,E;const{placement:n,rects:r,middlewareData:a}=t,l=((k=a.arrow)==null?void 0:k.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[h,p]=Mm(n),g={start:"0%",center:"50%",end:"100%"}[p],m=(((S=a.arrow)==null?void 0:S.x)??0)+u/2,w=(((E=a.arrow)==null?void 0:E.y)??0)+f/2;let y="",b="";return h==="bottom"?(y=l?g:`${m}px`,b=`${-f}px`):h==="top"?(y=l?g:`${m}px`,b=`${r.floating.height+f}px`):h==="right"?(y=`${-f}px`,b=l?g:`${w}px`):h==="left"&&(y=`${r.floating.width+f}px`,b=l?g:`${w}px`),{data:{x:y,y:b}}}}),"transformOrigin");function Mm(e){const[t,n="center"]=e.split("-");return[t,n]}ci(Mm,"getSideAndAlignFromPlacement");var Rm=sz,I1=oz,Pm=cz,pz=fz,mz=Object.defineProperty,ew=(e,t)=>mz(e,"name",{value:t,configurable:!0}),w8=!1;function Yj(){const[e,t]=s.useState(w8);return s.useEffect(()=>{w8||(w8=!0,t(!0))},[]),e}ew(Yj,"useIsHydrated");var qj=Fc[" useSyncExternalStore ".trim().toString()];function Xj(){return()=>{}}ew(Xj,"subscribe");function Qj(){return qj(Xj,()=>!0,()=>!1)}ew(Qj,"useIsHydratedModern");var gz=typeof qj=="function"?Qj:Yj,vz=Object.defineProperty,Uc=(e,t)=>vz(e,"name",{value:t,configurable:!0}),y8="rovingFocusGroup.onEntryFocus",wz={bubbles:!1,cancelable:!0},Lm="RovingFocusGroup",[q6,Jj,yz]=bm(Lm),[bz,eA]=Zs(Lm,[yz]),[xz,kz]=bz(Lm),Sz=s.forwardRef(Uc(function(t,n){return o.jsx(q6.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(q6.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(Ez,{...t,ref:n})})})},"RovingFocusGroup")),Ez=s.forwardRef(Uc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...m}=t,w=s.useRef(null),y=hn(n,w),b=$1(l),[k,S]=wi({prop:u,defaultProp:f??null,onChange:h,caller:Lm}),[E,C]=s.useState(!1),A=kr(p),L=Jj(r),T=s.useRef(!1),[M,j]=s.useState(0);return s.useEffect(()=>{const P=w.current;if(P)return P.addEventListener(y8,A),()=>P.removeEventListener(y8,A)},[A]),o.jsx(xz,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:k,onItemFocus:s.useCallback(P=>S(P),[S]),onItemShiftTab:s.useCallback(()=>C(!0),[]),onFocusableItemAdd:s.useCallback(()=>j(P=>P+1),[]),onFocusableItemRemove:s.useCallback(()=>j(P=>P-1),[]),children:o.jsx(vn.div,{tabIndex:E||M===0?-1:0,"data-orientation":a,...m,ref:y,style:{outline:"none",...t.style},onMouseDown:Mt(t.onMouseDown,()=>{T.current=!0}),onFocus:Mt(t.onFocus,P=>{const R=!T.current;if(P.target===P.currentTarget&&R&&!E){const H=new CustomEvent(y8,wz);if(P.currentTarget.dispatchEvent(H),!H.defaultPrevented){const D=L().filter(_=>_.focusable),U=D.find(_=>_.active),V=D.find(_=>_.id===k),G=[U,V,...D].filter(Boolean).map(_=>_.ref.current);tw(G,g)}}T.current=!1}),onBlur:Mt(t.onBlur,()=>C(!1))})})},"RovingFocusGroupImpl")),Cz="RovingFocusGroupItem",jz=s.forwardRef(Uc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:l,children:u,...f}=t,h=Na(),p=l||h,g=kz(Cz,r),m=g.currentTabStopId===p,w=Jj(r),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:k}=g,S=gz();return Er(()=>{if(!(!S||!a))return y(),()=>b()},[S,a,y,b]),s.useEffect(()=>{if(!(S||!a))return y(),()=>b()},[S,a,y,b]),o.jsx(q6.ItemSlot,{scope:r,id:p,focusable:a,active:i,children:o.jsx(vn.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:Mt(t.onMouseDown,E=>{a?g.onItemFocus(p):E.preventDefault()}),onFocus:Mt(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:Mt(t.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const C=nA(E,g.orientation,g.dir);if(C!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let L=w().filter(T=>T.focusable).map(T=>T.ref.current);if(C==="last")L.reverse();else if(C==="prev"||C==="next"){C==="prev"&&L.reverse();const T=L.indexOf(E.currentTarget);L=g.loop?rA(L,T+1):L.slice(T+1)}setTimeout(()=>tw(L))}}),children:typeof u=="function"?u({isCurrentTabStop:m,hasTabStop:k!=null}):u})})},"RovingFocusGroupItem")),Az={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Uc(tA,"getDirectionAwareKey");function nA(e,t,n){const r=tA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Az[r]}Uc(nA,"getFocusIntent");function tw(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Uc(tw,"focusFirst");function rA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Uc(rA,"wrapArray");var Nz=Sz,Mz=jz,Rz=Object.defineProperty,Ln=(e,t)=>Rz(e,"name",{value:t,configurable:!0}),X6=["Enter"," "],Pz=["ArrowDown","PageUp","Home"],sA=["ArrowUp","PageDown","End"],Lz=[...Pz,...sA],$z={ltr:[...X6,"ArrowRight"],rtl:[...X6,"ArrowLeft"]},Tz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$m="Menu",[o1,Dz,Hz]=bm($m),[Wc,Tm]=Zs($m,[Hz,Hl,eA]),nw=Hl(),aA=eA(),[Oz,Kc]=Wc($m),[Iz,F1]=Wc($m),Fz=Ln(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=nw(t),[f,h]=s.useState(null),p=s.useRef(!1),g=kr(i),m=$1(a);return s.useEffect(()=>{const w=Ln(()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=Ln(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),s.useEffect(()=>{if(!n)return;const w=Ln(()=>g(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,g]),o.jsx(Rm,{...u,children:o.jsx(Oz,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:h,children:o.jsx(Iz,{scope:t,onClose:s.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:m,modal:l,children:r})})})},"Menu"),oA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t,i=nw(r);return o.jsx(I1,{...i,...a,ref:n})},"MenuAnchor")),iA="MenuPortal",[_z,lA]=Wc(iA,{forceMount:void 0}),Vz=Ln(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Kc(iA,t);return o.jsx(_z,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(D1,{asChild:!0,container:a,children:r})})})},"MenuPortal"),Xa="MenuContent",[Zz,rw]=Wc(Xa),zz=s.forwardRef(Ln(function(t,n){const r=lA(Xa,t.__scopeMenu),{forceMount:a=r.forceMount,...i}=t,l=Kc(Xa,t.__scopeMenu),u=F1(Xa,t.__scopeMenu);return o.jsx(o1.Provider,{scope:t.__scopeMenu,children:o.jsx(ps,{present:a||l.open,children:o.jsx(o1.Slot,{scope:t.__scopeMenu,children:u.modal?o.jsx(Bz,{...i,ref:n}):o.jsx(Uz,{...i,ref:n})})})})},"MenuContent")),Bz=s.forwardRef(Ln(function(t,n){const r=Kc(Xa,t.__scopeMenu),a=s.useRef(null),i=hn(n,a);return s.useEffect(()=>{const l=a.current;if(l)return km(l)},[]),o.jsx(sw,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mt(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Uz=s.forwardRef(Ln(function(t,n){const r=Kc(Xa,t.__scopeMenu);return o.jsx(sw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Wz=to("MenuContent.ScrollLock"),sw=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,loop:a=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:w,onDismiss:y,disableOutsideScroll:b,...k}=t,S=Kc(Xa,r),E=F1(Xa,r),C=nw(r),A=aA(r),L=Dz(r),[T,M]=s.useState(null),j=s.useRef(null),P=hn(n,j,S.onContentChange),R=s.useRef(0),H=s.useRef(""),D=s.useRef(0),U=s.useRef(null),V=s.useRef("right"),B=s.useRef(0),G=b?H1:s.Fragment,_=b?{as:Wz,allowPinchZoom:!0}:void 0,O=Ln(K=>{var te,J;const z=H.current+K,q=L().filter(Q=>!Q.disabled),Z=document.activeElement,ee=(te=q.find(Q=>Q.ref.current===Z))==null?void 0:te.textValue,he=q.map(Q=>Q.textValue),ue=gA(he,z,ee),ge=(J=q.find(Q=>Q.textValue===ue))==null?void 0:J.ref.current;Ln((function Q(ae){H.current=ae,window.clearTimeout(R.current),ae!==""&&(R.current=window.setTimeout(()=>Q(""),1e3))}),"updateSearch")(z),ge&&setTimeout(()=>ge.focus())},"handleTypeaheadSearch");s.useEffect(()=>()=>window.clearTimeout(R.current),[]),Rd();const I=s.useCallback(K=>{var q,Z;return V.current===((q=U.current)==null?void 0:q.side)&&wA(K,(Z=U.current)==null?void 0:Z.area)},[]);return o.jsx(Zz,{scope:r,searchRef:H,onItemEnter:s.useCallback(K=>{I(K)&&K.preventDefault()},[I]),onItemLeave:s.useCallback(K=>{var z;I(K)||((z=j.current)==null||z.focus(),M(null))},[I]),onTriggerLeave:s.useCallback(K=>{I(K)&&K.preventDefault()},[I]),pointerGraceTimerRef:D,onPointerGraceIntentChange:s.useCallback(K=>{U.current=K},[]),children:o.jsx(G,{..._,children:o.jsx(Md,{asChild:!0,trapped:i,onMountAutoFocus:Mt(l,K=>{var z;K.preventDefault(),(z=j.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:o.jsx(T1,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:w,onDismiss:y,children:o.jsx(Nz,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:a,currentTabStopId:T,onCurrentTabStopIdChange:M,onEntryFocus:Mt(h,K=>{E.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Pm,{role:"menu","aria-orientation":"vertical","data-state":ow(S.open),"data-radix-menu-content":"",dir:E.dir,...C,...k,ref:P,style:{outline:"none",...k.style},onKeyDown:Mt(k.onKeyDown,K=>{const q=K.target.closest("[data-radix-menu-content]")===K.currentTarget,Z=K.ctrlKey||K.altKey||K.metaKey,ee=K.key.length===1;q&&(K.key==="Tab"&&K.preventDefault(),!Z&&ee&&O(K.key));const he=j.current;if(K.target!==he||!Lz.includes(K.key))return;K.preventDefault();const ge=L().filter(te=>!te.disabled).map(te=>te.ref.current);sA.includes(K.key)&&ge.reverse(),pA(ge)}),onBlur:Mt(t.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(R.current),H.current="")}),onPointerMove:Mt(t.onPointerMove,pd(K=>{const z=K.target,q=B.current!==K.clientX;if(K.currentTarget.contains(z)&&q){const Z=K.clientX>B.current?"right":"left";V.current=Z,B.current=K.clientX}}))})})})})})})},"MenuContentImpl")),cA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(vn.div,{role:"group",...a,ref:n})},"MenuGroup")),Kz=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(vn.div,{...a,ref:n})},"MenuLabel")),Q6="MenuItem",b5="menu.itemSelect",aw=s.forwardRef(Ln(function(t,n){const{disabled:r=!1,onSelect:a,...i}=t,l=s.useRef(null),u=F1(Q6,t.__scopeMenu),f=rw(Q6,t.__scopeMenu),h=hn(n,l),p=s.useRef(!1),g=Ln(()=>{const m=l.current;if(!r&&m){const w=new CustomEvent(b5,{bubbles:!0,cancelable:!0});m.addEventListener(b5,y=>a==null?void 0:a(y),{once:!0}),_v(m,w),w.defaultPrevented?p.current=!1:u.onClose()}},"handleSelect");return o.jsx(uA,{...i,ref:h,disabled:r,onClick:Mt(t.onClick,g),onPointerDown:m=>{var w;(w=t.onPointerDown)==null||w.call(t,m),p.current=!0},onPointerUp:Mt(t.onPointerUp,m=>{var w;p.current||(w=m.currentTarget)==null||w.click()}),onKeyDown:Mt(t.onKeyDown,m=>{r||m.target!==m.currentTarget||f.searchRef.current!==""&&m.key===" "||X6.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})},"MenuItem")),uA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,disabled:a=!1,textValue:i,...l}=t,u=rw(Q6,r),f=aA(r),h=s.useRef(null),p=hn(n,h),[g,m]=s.useState(!1),[w,y]=s.useState("");return s.useEffect(()=>{const b=h.current;b&&y((b.textContent??"").trim())},[l.children]),o.jsx(o1.ItemSlot,{scope:r,disabled:a,textValue:i??w,children:o.jsx(Mz,{asChild:!0,...f,focusable:!a,children:o.jsx(vn.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:p,onPointerMove:Mt(t.onPointerMove,pd(b=>{a?u.onItemLeave(b):(u.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Mt(t.onPointerLeave,pd(b=>u.onItemLeave(b))),onFocus:Mt(t.onFocus,()=>m(!0)),onBlur:Mt(t.onBlur,()=>m(!1))})})})},"MenuItemImpl")),Gz=s.forwardRef(Ln(function(t,n){const{checked:r=!1,onCheckedChange:a,...i}=t;return o.jsx(fA,{scope:t.__scopeMenu,checked:r,children:o.jsx(aw,{role:"menuitemcheckbox","aria-checked":i1(r)?"mixed":r,...i,ref:n,"data-state":Dm(r),onSelect:Mt(i.onSelect,()=>a==null?void 0:a(i1(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Yz="MenuRadioGroup",[qz,Xz]=Wc(Yz,{value:void 0,onValueChange:Ln(()=>{},"onValueChange")}),Qz=s.forwardRef(Ln(function(t,n){const{value:r,onValueChange:a,...i}=t,l=kr(a);return o.jsx(qz,{scope:t.__scopeMenu,value:r,onValueChange:l,children:o.jsx(cA,{...i,ref:n})})},"MenuRadioGroup")),Jz="MenuRadioItem",eB=s.forwardRef(Ln(function(t,n){const{value:r,...a}=t,i=Xz(Jz,t.__scopeMenu),l=r===i.value;return o.jsx(fA,{scope:t.__scopeMenu,checked:l,children:o.jsx(aw,{role:"menuitemradio","aria-checked":l,...a,ref:n,"data-state":Dm(l),onSelect:Mt(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),dA="MenuItemIndicator",[fA,tB]=Wc(dA,{checked:!1}),nB=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,forceMount:a,...i}=t,l=tB(dA,r);return o.jsx(ps,{present:a||i1(l.checked)||l.checked===!0,children:o.jsx(vn.span,{...i,ref:n,"data-state":Dm(l.checked)})})},"MenuItemIndicator")),rB=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(vn.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),sB="MenuSub",[Z0e,hA]=Wc(sB),Mh="MenuSubTrigger",aB=s.forwardRef(Ln(function(t,n){const r=Kc(Mh,t.__scopeMenu),a=F1(Mh,t.__scopeMenu),i=hA(Mh,t.__scopeMenu),l=rw(Mh,t.__scopeMenu),u=s.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=l,p={__scopeMenu:t.__scopeMenu},g=s.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);s.useEffect(()=>g,[g]),s.useEffect(()=>{const w=f.current;return()=>{window.clearTimeout(w),h(null)}},[f,h]);const m=hn(n,i.onTriggerChange);return o.jsx(oA,{asChild:!0,...p,children:o.jsx(uA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?i.contentId:void 0,"data-state":ow(r.open),...t,ref:m,onClick:w=>{var y;(y=t.onClick)==null||y.call(t,w),!(t.disabled||w.defaultPrevented)&&(w.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Mt(t.onPointerMove,pd(w=>{l.onItemEnter(w),!w.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:Mt(t.onPointerLeave,pd(w=>{var b,k;g();const y=(b=r.content)==null?void 0:b.getBoundingClientRect();if(y){const S=(k=r.content)==null?void 0:k.dataset.side,E=S==="right",C=E?-5:5,A=y[E?"left":"right"],L=y[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:w.clientX+C,y:w.clientY},{x:A,y:y.top},{x:L,y:y.top},{x:L,y:y.bottom},{x:A,y:y.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(w),w.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Mt(t.onKeyDown,w=>{var b;t.disabled||w.target!==w.currentTarget||l.searchRef.current!==""&&w.key===" "||$z[a.dir].includes(w.key)&&(r.onOpenChange(!0),(b=r.content)==null||b.focus(),w.preventDefault())})})})},"MenuSubTrigger")),oB="MenuSubContent",iB=s.forwardRef(Ln(function(t,n){const r=lA(Xa,t.__scopeMenu),{forceMount:a=r.forceMount,align:i="start",...l}=t,u=Kc(Xa,t.__scopeMenu),f=F1(Xa,t.__scopeMenu),h=hA(oB,t.__scopeMenu),p=s.useRef(null),g=hn(n,p);return o.jsx(o1.Provider,{scope:t.__scopeMenu,children:o.jsx(ps,{present:a||u.open,children:o.jsx(o1.Slot,{scope:t.__scopeMenu,children:o.jsx(sw,{id:h.contentId,"aria-labelledby":h.triggerId,...l,ref:g,align:i,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var w;f.isUsingKeyboardRef.current&&((w=p.current)==null||w.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Mt(t.onFocusOutside,m=>{m.target!==h.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Mt(t.onEscapeKeyDown,m=>{f.onClose(),m.preventDefault()}),onKeyDown:Mt(t.onKeyDown,m=>{var b;const w=m.currentTarget.contains(m.target),y=Tz[f.dir].includes(m.key);w&&y&&(u.onOpenChange(!1),(b=h.trigger)==null||b.focus(),m.preventDefault())})})})})})},"MenuSubContent"));function ow(e){return e?"open":"closed"}Ln(ow,"getOpenState");function i1(e){return e==="indeterminate"}Ln(i1,"isIndeterminate");function Dm(e){return i1(e)?"indeterminate":e?"checked":"unchecked"}Ln(Dm,"getCheckedState");function pA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Ln(pA,"focusFirst");function mA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ln(mA,"wrapArray");function gA(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=mA(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}Ln(gA,"getNextMatch");function vA(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,m=f.y;p>r!=m>r&&n<(g-h)*(r-p)/(m-p)+h&&(a=!a)}return a}Ln(vA,"isPointInPolygon");function wA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return vA(n,t)}Ln(wA,"isPointerInGraceArea");function pd(e){return t=>t.pointerType==="mouse"?e(t):void 0}Ln(pd,"whenMouse");var yA=Fz,bA=oA,xA=Vz,kA=zz,SA=cA,EA=Kz,CA=aw,jA=Gz,AA=Qz,NA=eB,MA=nB,RA=rB,PA=aB,LA=iB,lB=Object.defineProperty,Qr=(e,t)=>lB(e,"name",{value:t,configurable:!0}),iw="ContextMenu",[cB,z0e]=Zs(iw,[Tm]),zs=Tm(),[uB,$A]=cB(iw),dB=Qr(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,dir:i,modal:l=!0}=e,u=s.useRef(!1),[f,h]=wi({prop:a,defaultProp:!1,onChange:r,caller:iw}),p=zs(t);return o.jsx(uB,{scope:t,open:f,onOpenChange:h,modal:l,hasInteractedRef:u,children:o.jsx(yA,{...p,dir:i,open:f,onOpenChange:h,modal:l,children:n})})},"ContextMenu"),fB="ContextMenuTrigger",hB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,disabled:a=!1,...i}=t,l=$A(fB,r),u=zs(r),[f,h]=s.useState({x:0,y:0}),p=s.useMemo(()=>({current:{getBoundingClientRect:Qr(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=s.useRef(0),m=s.useCallback(()=>window.clearTimeout(g.current),[]),w=Qr(y=>{l.hasInteractedRef.current=!0,h({x:y.clientX,y:y.clientY}),l.onOpenChange(!0)},"handleOpen");return s.useEffect(()=>m,[m]),s.useEffect(()=>void(a&&m()),[a,m]),o.jsxs(o.Fragment,{children:[o.jsx(bA,{...u,virtualRef:p}),o.jsx(vn.span,{"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,...i,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:Mt(t.onContextMenu,y=>{m(),w(y),y.preventDefault()}),onPointerDown:a?t.onPointerDown:Mt(t.onPointerDown,L0(y=>{m(),l.open&&l.onOpenChange(!1),g.current=window.setTimeout(()=>w(y),700)})),onPointerMove:a?t.onPointerMove:Mt(t.onPointerMove,L0(m)),onPointerCancel:a?t.onPointerCancel:Mt(t.onPointerCancel,L0(m)),onPointerUp:a?t.onPointerUp:Mt(t.onPointerUp,L0(m))})]})},"ContextMenuTrigger")),pB=Qr(e=>{const{__scopeContextMenu:t,...n}=e,r=zs(t);return o.jsx(xA,{...r,...n})},"ContextMenuPortal"),mB="ContextMenuContent",gB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=$A(mB,r),l=zs(r),u=s.useRef(!1);return o.jsx(kA,{...l,...a,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{var h;(h=t.onCloseAutoFocus)==null||h.call(t,f),!f.defaultPrevented&&u.current&&f.preventDefault(),u.current=!1},onInteractOutside:f=>{var h;(h=t.onInteractOutside)==null||h.call(t,f),!f.defaultPrevented&&!i.modal&&(u.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),vB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(SA,{...i,...a,ref:n})},"ContextMenuGroup")),wB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(EA,{...i,...a,ref:n})},"ContextMenuLabel")),yB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(CA,{...i,...a,ref:n})},"ContextMenuItem")),bB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(jA,{...i,...a,ref:n})},"ContextMenuCheckboxItem")),xB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(AA,{...i,...a,ref:n})},"ContextMenuRadioGroup")),kB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(NA,{...i,...a,ref:n})},"ContextMenuRadioItem")),SB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(MA,{...i,...a,ref:n})},"ContextMenuItemIndicator")),EB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(RA,{...i,...a,ref:n})},"ContextMenuSeparator")),CB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(PA,{...i,...a,ref:n})},"ContextMenuSubTrigger")),jB=s.forwardRef(Qr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=zs(r);return o.jsx(LA,{...i,...a,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function L0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Qr(L0,"whenTouchOrPen");var AB=dB,NB=hB,TA=pB,MB=gB,RB=vB,PB=wB,LB=yB,$B=bB,TB=xB,DB=kB,DA=SB,HB=EB,OB=CB,IB=jB,FB=Object.defineProperty,Bs=(e,t)=>FB(e,"name",{value:t,configurable:!0}),lw="DropdownMenu",[_B,B0e]=Zs(lw,[Tm]),Us=Tm(),[VB,HA]=_B(lw),ZB=Bs(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=Us(t),h=s.useRef(null),[p,g]=wi({prop:a,defaultProp:i??!1,onChange:l,caller:lw});return o.jsx(VB,{scope:t,triggerId:Na(),triggerRef:h,contentId:Na(),open:p,onOpenChange:g,onOpenToggle:s.useCallback(()=>g(m=>!m),[g]),modal:u,children:o.jsx(yA,{...f,open:p,onOpenChange:g,dir:r,modal:u,children:n})})},"DropdownMenu"),zB="DropdownMenuTrigger",BB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,disabled:a=!1,...i}=t,l=HA(zB,r),u=Us(r),f=hn(n,l.triggerRef);return o.jsx(bA,{asChild:!0,...u,children:o.jsx(vn.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:f,onPointerDown:Mt(t.onPointerDown,h=>{!a&&h.button===0&&h.ctrlKey===!1&&(l.onOpenToggle(),l.open||h.preventDefault())}),onKeyDown:Mt(t.onKeyDown,h=>{a||(["Enter"," "].includes(h.key)&&l.onOpenToggle(),h.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})},"DropdownMenuTrigger")),UB=Bs(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Us(t);return o.jsx(xA,{...r,...n})},"DropdownMenuPortal"),WB="DropdownMenuContent",KB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=HA(WB,r),l=Us(r),u=s.useRef(!1);return o.jsx(kA,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...a,ref:n,onCloseAutoFocus:Mt(t.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:Mt(t.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,g=h.button===2||p;(!i.modal||g)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),GB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(SA,{...i,...a,ref:n})},"DropdownMenuGroup")),YB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(EA,{...i,...a,ref:n})},"DropdownMenuLabel")),qB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(CA,{...i,...a,ref:n})},"DropdownMenuItem")),XB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(jA,{...i,...a,ref:n})},"DropdownMenuCheckboxItem")),QB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(AA,{...i,...a,ref:n})},"DropdownMenuRadioGroup")),JB=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(NA,{...i,...a,ref:n})},"DropdownMenuRadioItem")),eU=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(MA,{...i,...a,ref:n})},"DropdownMenuItemIndicator")),tU=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(RA,{...i,...a,ref:n})},"DropdownMenuSeparator")),nU=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(PA,{...i,...a,ref:n})},"DropdownMenuSubTrigger")),rU=s.forwardRef(Bs(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Us(r);return o.jsx(LA,{...i,...a,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),sU=ZB,aU=BB,OA=UB,oU=KB,iU=GB,lU=YB,cU=qB,uU=XB,dU=QB,fU=JB,IA=eU,hU=tU,pU=nU,mU=rU,gU=Object.defineProperty,vU=(e,t)=>gU(e,"name",{value:t,configurable:!0});function FA(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}vU(FA,"usePrevious");var wU=Object.defineProperty,yU=(e,t)=>wU(e,"name",{value:t,configurable:!0});function xp(e,[t,n]){return Math.min(n,Math.max(t,e))}yU(xp,"clamp");var bU=Object.defineProperty,Io=(e,t)=>bU(e,"name",{value:t,configurable:!0}),cw="Popover",[_A,U0e]=Zs(cw,[Hl]),Hm=Hl(),[xU,Ol]=_A(cw),kU=Io(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=Hm(t),f=s.useRef(null),[h,p]=s.useState(!1),[g,m]=wi({prop:r,defaultProp:a??!1,onChange:i,caller:cw});return o.jsx(Rm,{...u,children:o.jsx(xU,{scope:t,contentId:Na(),triggerRef:f,open:g,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(w=>!w),[m]),hasCustomAnchor:h,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})},"Popover"),SU="PopoverAnchor",EU=s.forwardRef(Io(function(t,n){const{__scopePopover:r,...a}=t,i=Ol(SU,r),l=Hm(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return s.useEffect(()=>(u(),()=>f()),[u,f]),o.jsx(I1,{...l,...a,ref:n})},"PopoverAnchor")),CU="PopoverTrigger",jU=s.forwardRef(Io(function(t,n){const{__scopePopover:r,...a}=t,i=Ol(CU,r),l=Hm(r),u=hn(n,i.triggerRef),f=o.jsx(vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":uw(i.open),...a,ref:u,onClick:Mt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:o.jsx(I1,{asChild:!0,...l,children:f})},"PopoverTrigger")),VA="PopoverPortal",[AU,NU]=_A(VA,{forceMount:void 0}),MU=Io(e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Ol(VA,t);return o.jsx(AU,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(D1,{asChild:!0,container:a,children:r})})})},"PopoverPortal"),l1="PopoverContent",RU=s.forwardRef(Io(function(t,n){const r=NU(l1,t.__scopePopover),{forceMount:a=r.forceMount,...i}=t,l=Ol(l1,t.__scopePopover);return o.jsx(ps,{present:a||l.open,children:l.modal?o.jsx(LU,{...i,ref:n}):o.jsx($U,{...i,ref:n})})},"PopoverContent")),PU=to("PopoverContent.RemoveScroll"),LU=s.forwardRef(Io(function(t,n){const r=Ol(l1,t.__scopePopover),a=s.useRef(null),i=hn(n,a),l=s.useRef(!1);return s.useEffect(()=>{const u=a.current;if(u)return km(u)},[]),o.jsx(H1,{as:PU,allowPinchZoom:!0,children:o.jsx(ZA,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mt(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),l.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Mt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;l.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:Mt(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),$U=s.forwardRef(Io(function(t,n){const r=Ol(l1,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(ZA,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"PopoverContentNonModal")),ZA=s.forwardRef(Io(function(t,n){const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,...m}=t,w=Ol(l1,r),y=Hm(r);return Rd(),o.jsx(Md,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(T1,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(Pm,{"data-state":uw(w.open),role:"dialog",id:w.contentId,...y,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),TU="PopoverClose",DU=s.forwardRef(Io(function(t,n){const{__scopePopover:r,...a}=t,i=Ol(TU,r);return o.jsx(vn.button,{type:"button",...a,ref:n,onClick:Mt(t.onClick,()=>i.onOpenChange(!1))})},"PopoverClose"));function uw(e){return e?"open":"closed"}Io(uw,"getState");var HU=kU,OU=EU,IU=jU,FU=MU,_U=RU,VU=DU,ZU=Object.defineProperty,Cn=(e,t)=>ZU(e,"name",{value:t,configurable:!0});function zA(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}Cn(zA,"useStateMachine");var BA="ScrollArea",[UA,W0e]=Zs(BA),[zU,Ha]=UA(BA),BU=s.forwardRef(Cn(function(t,n){const{__scopeScrollArea:r,type:a="hover",dir:i,scrollHideDelay:l=600,...u}=t,[f,h]=s.useState(null),[p,g]=s.useState(null),[m,w]=s.useState(null),[y,b]=s.useState(null),[k,S]=s.useState(null),[E,C]=s.useState(0),[A,L]=s.useState(0),[T,M]=s.useState(!1),[j,P]=s.useState(!1),R=hn(n,h),H=$1(i);return o.jsx(zU,{scope:r,type:a,dir:H,scrollHideDelay:l,scrollArea:f,viewport:p,onViewportChange:g,content:m,onContentChange:w,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:T,onScrollbarXEnabledChange:M,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:j,onScrollbarYEnabledChange:P,onCornerWidthChange:C,onCornerHeightChange:L,children:o.jsx(vn.div,{dir:H,...u,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":A+"px",...t.style}})})},"ScrollArea")),UU="ScrollAreaViewport",WU=s.forwardRef(Cn(function(t,n){const{__scopeScrollArea:r,children:a,nonce:i,...l}=t,u=Ha(UU,r),f=s.useRef(null),h=hn(n,f,u.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(KU,{nonce:i}),o.jsx(vn.div,{"data-radix-scroll-area-viewport":"",...l,ref:h,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})},"ScrollAreaViewport")),KU=s.memo(Cn(function({nonce:t}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),Ri="ScrollAreaScrollbar",GU=s.forwardRef(Cn(function(t,n){const{forceMount:r,...a}=t,i=Ha(Ri,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=t.orientation==="horizontal";return s.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type==="hover"?o.jsx(YU,{...a,ref:n,forceMount:r}):i.type==="scroll"?o.jsx(qU,{...a,ref:n,forceMount:r}):i.type==="auto"?o.jsx(WA,{...a,ref:n,forceMount:r}):i.type==="always"?o.jsx(dw,{...a,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),YU=s.forwardRef(Cn(function(t,n){const{forceMount:r,...a}=t,i=Ha(Ri,t.__scopeScrollArea),[l,u]=s.useState(!1);return s.useEffect(()=>{const f=i.scrollArea;let h=0;if(f){const p=Cn(()=>{window.clearTimeout(h),u(!0)},"handlePointerEnter"),g=Cn(()=>{h=window.setTimeout(()=>u(!1),i.scrollHideDelay)},"handlePointerLeave");return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[i.scrollArea,i.scrollHideDelay]),o.jsx(ps,{present:r||l,children:o.jsx(WA,{"data-state":l?"visible":"hidden",...a,ref:n})})},"ScrollAreaScrollbarHover")),qU=s.forwardRef(Cn(function(t,n){const{forceMount:r,...a}=t,i=Ha(Ri,t.__scopeScrollArea),l=t.orientation==="horizontal",u=V1(()=>h("SCROLL_END"),100),[f,h]=zA("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,i.scrollHideDelay,h]),s.useEffect(()=>{const p=i.viewport,g=l?"scrollLeft":"scrollTop";if(p){let m=p[g];const w=Cn(()=>{const y=p[g];m!==y&&(h("SCROLL"),u()),m=y},"handleScroll");return p.addEventListener("scroll",w),()=>p.removeEventListener("scroll",w)}},[i.viewport,l,h,u]),o.jsx(ps,{present:r||f!=="hidden",children:o.jsx(dw,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:n,onPointerEnter:Mt(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Mt(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),WA=s.forwardRef(Cn(function(t,n){const r=Ha(Ri,t.__scopeScrollArea),{forceMount:a,...i}=t,[l,u]=s.useState(!1),f=t.orientation==="horizontal",h=V1(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?p:g)}},10);return Rc(r.viewport,h),Rc(r.content,h),o.jsx(ps,{present:a||l,children:o.jsx(dw,{"data-state":l?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarAuto")),dw=s.forwardRef(Cn(function(t,n){const{orientation:r="vertical",...a}=t,i=Ha(Ri,t.__scopeScrollArea),l=s.useRef(null),u=s.useRef(0),[f,h]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=fw(f.viewport,f.content),g={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:Cn(w=>l.current=w,"onThumbChange"),onThumbPointerUp:Cn(()=>u.current=0,"onThumbPointerUp"),onThumbPointerDown:Cn(w=>u.current=w,"onThumbPointerDown")};function m(w,y){return qA(w,u.current,f,y)}return Cn(m,"getScrollPosition"),r==="horizontal"?o.jsx(XU,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollLeft,y=e4(w,f,i.dir);l.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollLeft=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollLeft=m(w,i.dir))}}):r==="vertical"?o.jsx(QU,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollTop,y=e4(w,f);l.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollTop=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollTop=m(w))}}):null},"ScrollAreaScrollbarVisible")),XU=s.forwardRef(Cn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=Ha(Ri,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=hn(n,h,l.onScrollbarXChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(GA,{"data-orientation":"horizontal",...i,ref:p,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_1(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.x),onDragScroll:g=>t.onDragScroll(g.x),onWheelScroll:(g,m)=>{if(l.viewport){const w=l.viewport.scrollLeft+g.deltaX;t.onWheelScroll(w),pw(w,m)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:c1(u.paddingLeft),paddingEnd:c1(u.paddingRight)}})}})},"ScrollAreaScrollbarX")),QU=s.forwardRef(Cn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=Ha(Ri,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=hn(n,h,l.onScrollbarYChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(GA,{"data-orientation":"vertical",...i,ref:p,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_1(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.y),onDragScroll:g=>t.onDragScroll(g.y),onWheelScroll:(g,m)=>{if(l.viewport){const w=l.viewport.scrollTop+g.deltaY;t.onWheelScroll(w),pw(w,m)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:c1(u.paddingTop),paddingEnd:c1(u.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[JU,KA]=UA(Ri),GA=s.forwardRef(Cn(function(t,n){const{__scopeScrollArea:r,sizes:a,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:g,onResize:m,...w}=t,y=Ha(Ri,r),[b,k]=s.useState(null),S=hn(n,k),E=s.useRef(null),C=s.useRef(""),A=y.viewport,L=a.content-a.viewport,T=kr(g),M=kr(h),j=V1(m,10);function P(R){if(E.current){const H=R.clientX-E.current.left,D=R.clientY-E.current.top;p({x:H,y:D})}}return Cn(P,"handleDragScroll"),s.useEffect(()=>{const R=Cn(H=>{const D=H.target;(b==null?void 0:b.contains(D))&&T(H,L)},"handleWheel");return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[A,b,L,T]),s.useEffect(M,[a,M]),Rc(b,j),Rc(y.content,j),o.jsx(JU,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:kr(l),onThumbPointerUp:kr(u),onThumbPositionChange:M,onThumbPointerDown:kr(f),children:o.jsx(vn.div,{...w,ref:S,style:{position:"absolute",...w.style},onPointerDown:Mt(t.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),E.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),P(R))}),onPointerMove:Mt(t.onPointerMove,P),onPointerUp:Mt(t.onPointerUp,R=>{const H=R.target;H.hasPointerCapture(R.pointerId)&&H.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=C.current,y.viewport&&(y.viewport.style.scrollBehavior=""),E.current=null})})})},"ScrollAreaScrollbarImpl")),J6="ScrollAreaThumb",eW=s.forwardRef(Cn(function(t,n){const{forceMount:r,...a}=t,i=KA(J6,t.__scopeScrollArea);return o.jsx(ps,{present:r||i.hasThumb,children:o.jsx(tW,{ref:n,...a})})},"ScrollAreaThumb")),tW=s.forwardRef(Cn(function(t,n){const{__scopeScrollArea:r,style:a,...i}=t,l=Ha(J6,r),u=KA(J6,r),{onThumbPositionChange:f}=u,h=hn(n,u.onThumbChange),p=s.useRef(void 0),g=V1(()=>{p.current&&(p.current(),p.current=void 0)},100);return s.useEffect(()=>{const m=l.viewport;if(m){const w=Cn(()=>{if(g(),!p.current){const y=sW(m,f);p.current=y,f()}},"handleScroll");return f(),m.addEventListener("scroll",w),()=>m.removeEventListener("scroll",w)}},[l.viewport,g,f]),o.jsx(vn.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Mt(t.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,k=m.clientY-y.top;u.onThumbPointerDown({x:b,y:k})}),onPointerUp:Mt(t.onPointerUp,u.onThumbPointerUp)})},"ScrollAreaThumbImpl")),YA="ScrollAreaCorner",nW=s.forwardRef(Cn(function(t,n){const r=Ha(YA,t.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?o.jsx(rW,{...t,ref:n}):null},"ScrollAreaCorner")),rW=s.forwardRef(Cn(function(t,n){const{__scopeScrollArea:r,...a}=t,i=Ha(YA,r),[l,u]=s.useState(0),[f,h]=s.useState(0),p=!!(l&&f),{onCornerWidthChange:g,onCornerHeightChange:m}=i;return Rc(i.scrollbarX,()=>{var y;const w=((y=i.scrollbarX)==null?void 0:y.offsetHeight)||0;i.onCornerHeightChange(w),h(w)}),Rc(i.scrollbarY,()=>{var y;const w=((y=i.scrollbarY)==null?void 0:y.offsetWidth)||0;i.onCornerWidthChange(w),u(w)}),s.useEffect(()=>()=>{g(0),m(0)},[g,m]),p?o.jsx(vn.div,{...a,ref:n,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function c1(e){return e?parseInt(e,10):0}Cn(c1,"toInt");function fw(e,t){const n=e/t;return isNaN(n)?0:n}Cn(fw,"getThumbRatio");function _1(e){const t=fw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Cn(_1,"getThumbSize");function qA(e,t,n,r="ltr"){const a=_1(n),i=a/2,l=t||i,u=a-l,f=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return hw([f,h],g)(e)}Cn(qA,"getScrollPositionFromPointer");function e4(e,t,n="ltr"){const r=_1(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,f=n==="ltr"?[0,l]:[l*-1,0],h=xp(e,f);return hw([0,l],[0,u])(h)}Cn(e4,"getThumbOffsetFromScroll");function hw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Cn(hw,"linearScale");function pw(e,t){return e>0&&e<t}Cn(pw,"isScrollingWithinScrollbarBounds");var sW=Cn((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Cn((function a(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(a)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function V1(e,t){const n=kr(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Cn(V1,"useDebounceCallback");function Rc(e,t){const n=kr(t);Er(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}Cn(Rc,"useResizeObserver");var XA=BU,QA=WU,t4=GU,n4=eW,aW=nW,oW=Object.defineProperty,_n=(e,t)=>oW(e,"name",{value:t,configurable:!0}),iW=[" ","Enter","ArrowUp","ArrowDown"],lW=[" ","Enter"],md="Select",[Om,mw,cW]=bm(md),[Gc,K0e]=Zs(md,[cW,Hl]),gw=Hl(),[uW,Il]=Gc(md),[dW,fW]=Gc(md);function JA(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:f,dir:h,name:p,autoComplete:g,disabled:m,required:w,form:y,internal_do_not_use_render:b}=e,k=gw(t),[S,E]=s.useState(null),[C,A]=s.useState(null),[L,T]=s.useState(!1),M=$1(h),[j,P]=wi({prop:r,defaultProp:a??!1,onChange:i,caller:md}),[R,H]=wi({prop:l,defaultProp:u,onChange:f,caller:md}),D=s.useRef(null),U=s.useRef(R);s.useEffect(()=>{const q=y?S==null?void 0:S.ownerDocument.getElementById(y):S==null?void 0:S.form;if(q instanceof HTMLFormElement){const Z=_n(()=>H(U.current),"reset");return q.addEventListener("reset",Z),()=>q.removeEventListener("reset",Z)}},[y,S,H]);const V=S?!!y||!!S.closest("form"):!0,[B,G]=s.useState(new Set),_=Na(),O=Array.from(B).map(q=>q.props.value).join(";"),I=s.useCallback(q=>{G(Z=>new Set(Z).add(q))},[]),K=s.useCallback(q=>{G(Z=>{const ee=new Set(Z);return ee.delete(q),ee})},[]),z={required:w,trigger:S,onTriggerChange:E,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:L,onValueNodeHasChildrenChange:T,contentId:_,value:R,onValueChange:H,open:j,onOpenChange:P,dir:M,triggerPointerDownPosRef:D,disabled:m,name:p,autoComplete:g,form:y,nativeOptions:B,nativeSelectKey:O,isFormControl:V};return o.jsx(Rm,{...k,children:o.jsx(uW,{scope:t,...z,children:o.jsx(Om.Provider,{scope:t,children:o.jsx(dW,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:K,children:nN(b)?b(z):n})})})})}_n(JA,"SelectProvider");var hW=_n(e=>{const{__scopeSelect:t,children:n,...r}=e;return o.jsx(JA,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:a})=>o.jsxs(o.Fragment,{children:[n,a?o.jsx(BW,{__scopeSelect:t}):null]})})},"Select"),pW="SelectTrigger",mW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,disabled:a=!1,...i}=t,l=gw(r),u=Il(pW,r),f=u.disabled||a,h=hn(n,u.onTriggerChange),p=mw(r),g=s.useRef("touch"),[m,w,y]=vw(k=>{const S=p().filter(A=>!A.disabled),E=S.find(A=>A.value===u.value),C=ww(S,k,E);C!==void 0&&u.onValueChange(C.value)}),b=_n(k=>{f||(u.onOpenChange(!0),y()),k&&(u.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return o.jsx(I1,{asChild:!0,...l,children:o.jsx(vn.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":Z1(u.value)?"":void 0,...i,ref:h,onClick:Mt(i.onClick,k=>{k.currentTarget.focus(),g.current!=="mouse"&&b(k)}),onPointerDown:Mt(i.onPointerDown,k=>{g.current=k.pointerType;const S=k.target;S.hasPointerCapture(k.pointerId)&&S.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(b(k),k.preventDefault())}),onKeyDown:Mt(i.onKeyDown,k=>{const S=m.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&w(k.key),!(S&&k.key===" ")&&iW.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),gW="SelectValue",vW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,className:a,style:i,children:l,placeholder:u="",...f}=t,h=Il(gW,r),{onValueNodeHasChildrenChange:p}=h,g=l!==void 0,m=hn(n,h.onValueNodeChange);Er(()=>{p(g)},[p,g]);const w=Z1(h.value);return o.jsx(vn.span,{...f,asChild:w?!1:f.asChild,ref:m,style:{pointerEvents:"none"},children:o.jsx(s.Fragment,{children:w?u:l},w?"placeholder":"value")})},"SelectValue")),wW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,children:a,...i}=t;return o.jsx(vn.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})},"SelectIcon")),yW="SelectPortal",[bW,xW]=Gc(yW,{forceMount:void 0}),kW=_n(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return o.jsx(bW,{scope:e.__scopeSelect,forceMount:n,children:o.jsx(D1,{asChild:!0,...r})})},"SelectPortal"),Pc="SelectContent",SW=s.forwardRef(_n(function(t,n){const r=xW(Pc,t.__scopeSelect),{forceMount:a=r.forceMount,...i}=t,l=Il(Pc,t.__scopeSelect),[u,f]=s.useState();return Er(()=>{f(new DocumentFragment)},[]),o.jsx(ps,{present:a||l.open,children:({present:h})=>h?o.jsx(jW,{...i,ref:n}):o.jsx(EW,{...i,fragment:u})})},"SelectContent")),EW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,children:a,fragment:i}=t;return i?Br.createPortal(o.jsx(eN,{scope:r,children:o.jsx(Om.Slot,{scope:r,children:o.jsx("div",{ref:n,children:a})})}),i):null},"SelectContentFragment")),Ka=10,[eN,Im]=Gc(Pc),CW=to("SelectContent.RemoveScroll"),jW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r}=t,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:k,avoidCollisions:S,...E}=t,C=Il(Pc,r),[A,L]=s.useState(null),[T,M]=s.useState(null),j=hn(n,L),[P,R]=s.useState(null),[H,D]=s.useState(null),U=mw(r),[V,B]=s.useState(!1),G=s.useRef(!1);s.useEffect(()=>{if(A)return km(A)},[A]),Rd();const _=s.useCallback(te=>{const[J,...Q]=U().map(ie=>ie.ref.current),[ae]=Q.slice(-1),$e=document.activeElement;for(const ie of te)if(ie===$e||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===J&&T&&(T.scrollTop=0),ie===ae&&T&&(T.scrollTop=T.scrollHeight),ie==null||ie.focus(),document.activeElement!==$e))return},[U,T]),O=s.useCallback(()=>_([P,A]),[_,P,A]);s.useEffect(()=>{V&&O()},[V,O]);const{onOpenChange:I,triggerPointerDownPosRef:K}=C;s.useEffect(()=>{if(A){let te={x:0,y:0};const J=_n(ae=>{var $e,ie;te={x:Math.abs(Math.round(ae.pageX)-((($e=K.current)==null?void 0:$e.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((ie=K.current)==null?void 0:ie.y)??0))}},"handlePointerMove"),Q=_n(ae=>{te.x<=10&&te.y<=10?ae.preventDefault():ae.composedPath().includes(A)||I(!1),document.removeEventListener("pointermove",J),K.current=null},"handlePointerUp");return K.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",Q,{capture:!0})}}},[A,I,K]),s.useEffect(()=>{const te=_n(()=>I(!1),"close");return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[I]);const[z,q]=vw(te=>{const J=U().filter($e=>!$e.disabled),Q=J.find($e=>$e.ref.current===document.activeElement),ae=ww(J,te,Q);ae&&setTimeout(()=>{var $e;return($e=ae.ref.current)==null?void 0:$e.focus()})}),Z=s.useCallback((te,J,Q)=>{const ae=!G.current&&!Q;(C.value!==void 0&&C.value===J||ae)&&(R(te),ae&&(G.current=!0))},[C.value]),ee=s.useCallback(()=>A==null?void 0:A.focus(),[A]),he=s.useCallback((te,J,Q)=>{const ae=!G.current&&!Q;(C.value!==void 0&&C.value===J||ae)&&D(te)},[C.value]),ue=a==="popper"?x5:AW,ge=ue===x5?{side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:k,avoidCollisions:S}:{};return o.jsx(eN,{scope:r,content:A,viewport:T,onViewportChange:M,itemRefCallback:Z,selectedItem:P,onItemLeave:ee,itemTextRefCallback:he,focusSelectedItem:O,selectedItemText:H,position:a,isPositioned:V,searchRef:z,children:o.jsx(H1,{as:CW,allowPinchZoom:!0,children:o.jsx(Md,{asChild:!0,trapped:C.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Mt(i,te=>{var J;(J=C.trigger)==null||J.focus({preventScroll:!0}),te.preventDefault()}),children:o.jsx(T1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:o.jsx(ue,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:te=>te.preventDefault(),...E,...ge,onPlaced:()=>B(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Mt(E.onKeyDown,te=>{const J=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!J&&te.key.length===1&&q(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ae=U().filter($e=>!$e.disabled).map($e=>$e.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const $e=te.target,ie=ae.indexOf($e);ae=ae.slice(ie+1)}setTimeout(()=>_(ae)),te.preventDefault()}})})})})})})},"SelectContentImpl")),AW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,onPlaced:a,...i}=t,l=Il(Pc,r),u=Im(Pc,r),[f,h]=s.useState(null),[p,g]=s.useState(null),m=hn(n,g),w=mw(r),y=s.useRef(!1),b=s.useRef(!0),{viewport:k,selectedItem:S,selectedItemText:E,focusSelectedItem:C}=u,A=s.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&p&&k&&S&&E){const j=l.trigger.getBoundingClientRect(),P=p.getBoundingClientRect(),R=l.valueNode.getBoundingClientRect(),H=E.getBoundingClientRect();if(l.dir!=="rtl"){const $e=H.left-P.left,ie=R.left-$e,ke=j.left-ie,ze=j.width+ke,wt=Math.max(ze,P.width),Ke=window.innerWidth-Ka,tt=xp(ie,[Ka,Math.max(Ka,Ke-wt)]);f.style.minWidth=ze+"px",f.style.left=tt+"px"}else{const $e=P.right-H.right,ie=window.innerWidth-R.right-$e,ke=window.innerWidth-j.right-ie,ze=j.width+ke,wt=Math.max(ze,P.width),Ke=window.innerWidth-Ka,tt=xp(ie,[Ka,Math.max(Ka,Ke-wt)]);f.style.minWidth=ze+"px",f.style.right=tt+"px"}const D=w(),U=window.innerHeight-Ka*2,V=k.scrollHeight,B=window.getComputedStyle(p),G=parseInt(B.borderTopWidth,10),_=parseInt(B.paddingTop,10),O=parseInt(B.borderBottomWidth,10),I=parseInt(B.paddingBottom,10),K=G+_+V+I+O,z=Math.min(S.offsetHeight*5,K),q=window.getComputedStyle(k),Z=parseInt(q.paddingTop,10),ee=parseInt(q.paddingBottom,10),he=j.top+j.height/2-Ka,ue=U-he,ge=S.offsetHeight/2,te=S.offsetTop+ge,J=G+_+te,Q=K-J;if(J<=he){const $e=D.length>0&&S===D[D.length-1].ref.current;f.style.bottom="0px";const ie=p.clientHeight-k.offsetTop-k.offsetHeight,ke=Math.max(ue,ge+($e?ee:0)+ie+O),ze=J+ke;f.style.height=ze+"px"}else{const $e=D.length>0&&S===D[0].ref.current;f.style.top="0px";const ke=Math.max(he,G+k.offsetTop+($e?Z:0)+ge)+Q;f.style.height=ke+"px",k.scrollTop=J-he+k.offsetTop}f.style.margin=`${Ka}px 0`,f.style.minHeight=z+"px",f.style.maxHeight=U+"px",a==null||a(),requestAnimationFrame(()=>y.current=!0)}},[w,l.trigger,l.valueNode,f,p,k,S,E,l.dir,a]);Er(()=>A(),[A]);const[L,T]=s.useState();Er(()=>{p&&T(window.getComputedStyle(p).zIndex)},[p]);const M=s.useCallback(j=>{j&&b.current===!0&&(A(),C==null||C(),b.current=!1)},[A,C]);return o.jsx(NW,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:M,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:o.jsx(vn.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),x5=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,align:a="start",collisionPadding:i=Ka,...l}=t,u=gw(r);return o.jsx(Pm,{...u,...l,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[NW,MW]=Gc(Pc,{}),k5="SelectViewport",RW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,nonce:a,...i}=t,l=Im(k5,r),u=MW(k5,r),f=hn(n,l.onViewportChange),h=s.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Om.Slot,{scope:r,children:o.jsx(vn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Mt(i.onScroll,p=>{const g=p.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=u;if(w!=null&&w.current&&m){const y=Math.abs(h.current-g.scrollTop);if(y>0){const b=window.innerHeight-Ka*2,k=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),E=Math.max(k,S);if(E<b){const C=E+y,A=Math.min(b,C),L=C-A;m.style.height=A+"px",m.style.bottom==="0px"&&(g.scrollTop=L>0?L:0,m.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})},"SelectViewport")),PW="SelectGroup",[LW,$W]=Gc(PW),TW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,...a}=t,i=Na();return o.jsx(LW,{scope:r,id:i,children:o.jsx(vn.div,{role:"group","aria-labelledby":i,...a,ref:n})})},"SelectGroup")),DW="SelectLabel",HW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,...a}=t,i=$W(DW,r);return o.jsx(vn.div,{id:i.id,...a,ref:n})},"SelectLabel")),r4="SelectItem",[OW,tN]=Gc(r4),IW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,value:a,disabled:i=!1,textValue:l,...u}=t,f=Il(r4,r),h=Im(r4,r),p=f.value===a,[g,m]=s.useState(l??""),[w,y]=s.useState(!1),b=kr(A=>{var L;return(L=h.itemRefCallback)==null?void 0:L.call(h,A,a,i)}),k=hn(n,b),S=Na(),E=s.useRef("touch"),C=_n(()=>{i||(f.onValueChange(a),f.onOpenChange(!1))},"handleSelect");return o.jsx(OW,{scope:r,value:a,disabled:i,textId:S,isSelected:p,onItemTextChange:s.useCallback(A=>{m(L=>L||((A==null?void 0:A.textContent)??"").trim())},[]),children:o.jsx(Om.ItemSlot,{scope:r,value:a,disabled:i,textValue:g,children:o.jsx(vn.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:k,onFocus:Mt(u.onFocus,()=>y(!0)),onBlur:Mt(u.onBlur,()=>y(!1)),onClick:Mt(u.onClick,()=>{E.current!=="mouse"&&C()}),onPointerUp:Mt(u.onPointerUp,()=>{E.current==="mouse"&&C()}),onPointerDown:Mt(u.onPointerDown,A=>{E.current=A.pointerType}),onPointerMove:Mt(u.onPointerMove,A=>{var L;E.current=A.pointerType,i?(L=h.onItemLeave)==null||L.call(h):E.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Mt(u.onPointerLeave,A=>{var L;A.currentTarget===document.activeElement&&((L=h.onItemLeave)==null||L.call(h))}),onKeyDown:Mt(u.onKeyDown,A=>{var T;i||A.target!==A.currentTarget||((T=h.searchRef)==null?void 0:T.current)!==""&&A.key===" "||(lW.includes(A.key)&&C(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),Rh="SelectItemText",FW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,className:a,style:i,...l}=t,u=Il(Rh,r),f=Im(Rh,r),h=tN(Rh,r),p=fW(Rh,r),[g,m]=s.useState(null),w=kr(C=>{var A;return(A=f.itemTextRefCallback)==null?void 0:A.call(f,C,h.value,h.disabled)}),y=hn(n,m,h.onItemTextChange,w),b=g==null?void 0:g.textContent,k=s.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=p;return Er(()=>(S(k),()=>E(k)),[S,E,k]),o.jsxs(o.Fragment,{children:[o.jsx(vn.span,{id:h.textId,...l,ref:y}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Z1(u.value)?Br.createPortal(l.children,u.valueNode):null]})},"SelectItemText")),_W="SelectItemIndicator",VW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,...a}=t;return tN(_W,r).isSelected?o.jsx(vn.span,{"aria-hidden":!0,...a,ref:n}):null},"SelectItemIndicator")),ZW=s.forwardRef(_n(function(t,n){const{__scopeSelect:r,...a}=t;return o.jsx(vn.div,{"aria-hidden":!0,...a,ref:n})},"SelectSeparator")),zW="SelectBubbleInput",BW=s.forwardRef(_n(function({__scopeSelect:t,...n},r){const a=Il(zW,t),{value:i,onValueChange:l,required:u,disabled:f,name:h,autoComplete:p,form:g}=a,{nativeOptions:m,nativeSelectKey:w}=a,y=s.useRef(null),b=hn(r,y),k=i??"",S=FA(k),E=Array.from(m).some(C=>(C.props.value??"")==="");return s.useEffect(()=>{const C=y.current;if(!C)return;const A=window.HTMLSelectElement.prototype,T=Object.getOwnPropertyDescriptor(A,"value").set;if(S!==k&&T){const M=new Event("change",{bubbles:!0});T.call(C,k),C.dispatchEvent(M)}},[S,k]),o.jsxs(vn.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:h,autoComplete:p,disabled:f,form:g,onChange:C=>l(C.target.value),...n,style:{...FC,...n.style},ref:b,defaultValue:k,children:[Z1(i)&&!E?o.jsx("option",{value:""}):null,Array.from(m)]},w)},"SelectBubbleInput"));function nN(e){return typeof e=="function"}_n(nN,"isFunction");function Z1(e){return e===""||e===void 0}_n(Z1,"shouldShowPlaceholder");function vw(e){const t=kr(e),n=s.useRef(""),r=s.useRef(0),a=s.useCallback(l=>{const u=n.current+l;t(u),_n((function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(u)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}_n(vw,"useTypeaheadSearch");function ww(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=rN(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}_n(ww,"findNextItem");function rN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}_n(rN,"wrapArray");var UW=Object.defineProperty,Lr=(e,t)=>UW(e,"name",{value:t,configurable:!0}),[yw,G0e]=Zs("Tooltip",[Hl]),Fm=Hl(),WW="TooltipProvider",KW=700,s4="tooltip.open",[GW,bw]=yw(WW),YW=Lr(e=>{const{__scopeTooltip:t,delayDuration:n=KW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),u=s.useRef(!1),f=s.useRef(0);return s.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),o.jsx(GW,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),l.current=!1)},[r]),onClose:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:s.useCallback(h=>{u.current=h},[]),disableHoverableContent:a,children:i})},"TooltipProvider"),a4="Tooltip",[qW,z1]=yw(a4),XW=Lr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,f=bw(a4,e.__scopeTooltip),h=Fm(t),[p,g]=s.useState(null),[m,w]=s.useState(void 0),y=Na(),b=s.useRef(0),k=l??f.disableHoverableContent,S=u??f.delayDuration,E=s.useRef(!1),[C,A]=wi({prop:r,defaultProp:a??!1,onChange:Lr(R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(s4))):f.onClose(),i==null||i(R)},"onChange"),caller:a4}),L=s.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),T=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,A(!0)},[A]),M=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,A(!1)},[A]),j=s.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,A(!0),b.current=0},S)},[S,A]);s.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const P=m??y;return o.jsx(Rm,{...h,children:o.jsx(qW,{scope:t,contentId:P,setContentId:w,open:C,stateAttribute:L,trigger:p,onTriggerChange:g,onTriggerEnter:s.useCallback(()=>{f.isOpenDelayedRef.current?j():T()},[f.isOpenDelayedRef,j,T]),onTriggerLeave:s.useCallback(()=>{k?M():(window.clearTimeout(b.current),b.current=0)},[M,k]),onOpen:T,onClose:M,disableHoverableContent:k,children:n})})},"Tooltip"),S5="TooltipTrigger",QW=s.forwardRef(Lr(function(t,n){const{__scopeTooltip:r,...a}=t,i=z1(S5,r),l=bw(S5,r),u=Fm(r),f=s.useRef(null),h=hn(n,f,i.onTriggerChange),p=s.useRef(!1),g=s.useRef(!1),m=s.useCallback(()=>p.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),o.jsx(I1,{asChild:!0,...u,children:o.jsx(vn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:h,onPointerMove:Mt(t.onPointerMove,w=>{w.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),g.current=!0)}),onPointerLeave:Mt(t.onPointerLeave,()=>{i.onTriggerLeave(),g.current=!1}),onPointerDown:Mt(t.onPointerDown,()=>{i.open&&i.onClose(),p.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Mt(t.onFocus,()=>{p.current||i.onOpen()}),onBlur:Mt(t.onBlur,i.onClose),onClick:Mt(t.onClick,i.onClose)})})},"TooltipTrigger")),sN="TooltipPortal",[JW,eK]=yw(sN,{forceMount:void 0}),tK=Lr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=z1(sN,t);return o.jsx(JW,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(D1,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),u1="TooltipContent",nK=s.forwardRef(Lr(function(t,n){const r=eK(u1,t.__scopeTooltip),{forceMount:a=r.forceMount,side:i="top",...l}=t,u=z1(u1,t.__scopeTooltip);return o.jsx(ps,{present:a||u.open,children:u.disableHoverableContent?o.jsx(aN,{side:i,...l,ref:n}):o.jsx(rK,{side:i,...l,ref:n})})},"TooltipContent")),rK=s.forwardRef(Lr(function(t,n){const r=z1(u1,t.__scopeTooltip),a=bw(u1,t.__scopeTooltip),i=s.useRef(null),l=hn(n,i),[u,f]=s.useState(null),{trigger:h,onClose:p}=r,g=i.current,{onPointerInTransitChange:m}=a,w=s.useCallback(()=>{f(null),m(!1)},[m]),y=s.useCallback((b,k)=>{const S=b.currentTarget,E={x:b.clientX,y:b.clientY},C=oN(E,S.getBoundingClientRect()),A=iN(E,C),L=lN(k.getBoundingClientRect()),T=uN([...A,...L]);f(T),m(!0)},[m]);return s.useEffect(()=>()=>w(),[w]),s.useEffect(()=>{if(h&&g){const b=Lr(S=>y(S,g),"handleTriggerLeave"),k=Lr(S=>y(S,h),"handleContentLeave");return h.addEventListener("pointerleave",b),g.addEventListener("pointerleave",k),()=>{h.removeEventListener("pointerleave",b),g.removeEventListener("pointerleave",k)}}},[h,g,y,w]),s.useEffect(()=>{if(u){const b=Lr(k=>{const S=k.target,E={x:k.clientX,y:k.clientY},C=(h==null?void 0:h.contains(S))||(g==null?void 0:g.contains(S)),A=!cN(E,u);C?w():A&&(w(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,g,u,p,w]),o.jsx(aN,{...t,ref:l})},"TooltipContentHoverable")),sK=Fv("TooltipContent"),aN=s.forwardRef(Lr(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":i,id:l,onEscapeKeyDown:u,onPointerDownOutside:f,...h}=t,p=z1(u1,r),g=Fm(r),{onClose:m}=p;s.useEffect(()=>(document.addEventListener(s4,m),()=>document.removeEventListener(s4,m)),[m]),s.useEffect(()=>{if(p.trigger){const y=Lr(b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[p.trigger,m]);const{setContentId:w}=p;return Er(()=>(w(l),()=>{w(void 0)}),[l,w]),o.jsx(T1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:y=>y.preventDefault(),onDismiss:m,children:o.jsxs(Pm,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(sK,{children:a}),i?o.jsx(_C,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),aK=s.forwardRef(Lr(function(t,n){const{__scopeTooltip:r,...a}=t,i=Fm(r);return o.jsx(pz,{...i,...a,ref:n})},"TooltipArrow"));function oN(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Lr(oN,"getExitSideFromRect");function iN(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Lr(iN,"getPaddedExitPoints");function lN(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}Lr(lN,"getPointsFromRect");function cN(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,m=f.y;p>r!=m>r&&n<(g-h)*(r-p)/(m-p)+h&&(a=!a)}return a}Lr(cN,"isPointInPolygon");function uN(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dN(t)}Lr(uN,"getHull");function dN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Lr(dN,"getHullPresorted");var oK=YW,iK=XW,lK=QW,cK=tK,uK=nK,dK=aK,b8={exports:{}};/*!
|
|
93
|
+
Copyright (c) 2018 Jed Watson.
|
|
94
|
+
Licensed under the MIT License (MIT), see
|
|
95
|
+
http://jedwatson.github.io/classnames
|
|
96
|
+
*/var E5;function fK(){return E5||(E5=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(i=a(i,r(u)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var l="";for(var u in i)t.call(i,u)&&i[u]&&(l=a(l,u));return l}function a(i,l){return l?i?i+" "+l:i+l:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(b8)),b8.exports}var hK=fK();const Gt=oS(hK),io={asChild:{type:"boolean"}},Mo={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}},xw={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}},pK=["1","2","3","4"],fN={...io,align:{type:"enum",className:"rt-r-align",values:["start","center"],default:"center"},size:{type:"enum",className:"rt-r-size",values:pK,default:"3",responsive:!0},width:Mo.width,minWidth:Mo.minWidth,maxWidth:{...Mo.maxWidth,default:"600px"},...xw},hN=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Fl={color:{type:"enum",values:hN,default:void 0}},kw={color:{type:"enum",values:hN,default:""}},Yc={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}},mK=["normal","start","end","both"],pN={trim:{type:"enum",className:"rt-r-lt",values:mK,responsive:!0}},gK=["left","center","right"],mN={align:{type:"enum",className:"rt-r-ta",values:gK,responsive:!0}},vK=["wrap","nowrap","pretty","balance"],gN={wrap:{type:"enum",className:"rt-r-tw",values:vK,responsive:!0}},vN={truncate:{type:"boolean",className:"rt-truncate"}},wK=["light","regular","medium","bold"],wN={weight:{type:"enum",className:"rt-r-weight",values:wK,responsive:!0}},yK=["h1","h2","h3","h4","h5","h6"],bK=["1","2","3","4","5","6","7","8","9"],xK={as:{type:"enum",values:yK,default:"h1"},...io,size:{type:"enum",className:"rt-r-size",values:bK,default:"6",responsive:!0},...wN,...mN,...pN,...vN,...gN,...Fl,...Yc},kK=["initial","xs","sm","md","lg","xl"],Sw=new Set(kK);function yN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Z0(e){return typeof e=="object"&&e!==null&&Object.keys(e).some(t=>Sw.has(t))}function el({className:e,customProperties:t,...n}){const r=kp({allowArbitraryValues:!0,className:e,...n}),a=SK({customProperties:t,...n});return[r,a]}function kp({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:a=i=>i}){const i=[];if(t){if(typeof t=="string"&&r.includes(t))return C5(n,t,a);if(Z0(t)){const l=t;for(const u in l){if(!yN(l,u)||!Sw.has(u))continue;const f=l[u];if(f!==void 0){if(r.includes(f)){const h=C5(n,f,a),p=u==="initial"?h:`${u}:${h}`;i.push(p)}else if(e){const h=u==="initial"?n:`${u}:${n}`;i.push(h)}}}return i.join(" ")}if(e)return n}}function C5(e,t,n){const r=e?"-":"",a=n(t),i=a==null?void 0:a.startsWith("-"),l=i?"-":"",u=i?a==null?void 0:a.substring(1):a;return`${l}${e}${r}${u}`}function SK({customProperties:e,value:t,propValues:n,parseValue:r=a=>a}){let a={};if(!(!t||typeof t=="string"&&n.includes(t))){if(typeof t=="string"&&(a=Object.fromEntries(e.map(i=>[i,t]))),Z0(t)){const i=t;for(const l in i){if(!yN(i,l)||!Sw.has(l))continue;const u=i[l];if(!n.includes(u))for(const f of e)a={[l==="initial"?f:`${f}-${l}`]:u,...a}}}for(const i in a){const l=a[i];l!==void 0&&(a[i]=r(l))}return a}}function Sp(...e){let t={};for(const n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}function EK(...e){return Object.assign({},...e)}function Ar(e,...t){let n,r;const a={...e},i=EK(...t);for(const l in i){let u=a[l];const f=i[l];if(f.default!==void 0&&u===void 0&&(u=f.default),f.type==="enum"&&![f.default,...f.values].includes(u)&&!Z0(u)&&(u=f.default),a[l]=u,"className"in f&&f.className){delete a[l];const h="responsive"in f;if(!u||Z0(u)&&!h)continue;if(Z0(u)&&(f.default!==void 0&&u.initial===void 0&&(u.initial=f.default),f.type==="enum"&&([f.default,...f.values].includes(u.initial)||(u.initial=f.default))),f.type==="enum"){const p=kp({allowArbitraryValues:!1,value:u,className:f.className,propValues:f.values,parseValue:f.parseValue});n=Gt(n,p);continue}if(f.type==="string"||f.type==="enum | string"){const p=f.type==="string"?[]:f.values,[g,m]=el({className:f.className,customProperties:f.customProperties,propValues:p,parseValue:f.parseValue,value:u});r=Sp(r,m),n=Gt(n,g);continue}if(f.type==="boolean"&&u){n=Gt(n,f.className);continue}}}return a.className=Gt(n,e.className),a.style=Sp(r,e.style),a}const oc=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Fo={m:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:oc,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}},Ew=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="h1",color:l,...u}=Ar(e,xK,Fo);return s.createElement(Bc,{"data-accent-color":l,...u,ref:t,className:Gt("rt-Heading",r)},a?n:s.createElement(i,null,n))});Ew.displayName="Heading";const CK=["span","div","label","p"],jK=["1","2","3","4","5","6","7","8","9"],AK={as:{type:"enum",values:CK,default:"span"},...io,size:{type:"enum",className:"rt-r-size",values:jK,responsive:!0},...wN,...mN,...pN,...vN,...gN,...Fl,...Yc},Lc=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="span",color:l,...u}=Ar(e,AK,Fo);return s.createElement(Bc,{"data-accent-color":l,...u,ref:t,className:Gt("rt-Text",r)},a?n:s.createElement(i,null,n))});Lc.displayName="Text";function NK(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}const MK=["none","small","medium","large","full"],_m={radius:{type:"enum",values:MK,default:void 0}},ta={hasBackground:{default:!0},appearance:{default:"inherit"},accentColor:{default:"indigo"},grayColor:{default:"auto"},panelBackground:{default:"translucent"},radius:{default:"medium"},scaling:{default:"100%"}},Mu=()=>{},Ep=s.createContext(void 0);function Cw(){const e=s.useContext(Ep);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const lo=s.forwardRef((e,t)=>s.useContext(Ep)===void 0?s.createElement(oK,{delayDuration:200},s.createElement(v_,{dir:"ltr"},s.createElement(bN,{...e,ref:t}))):s.createElement(jw,{...e,ref:t}));lo.displayName="Theme";const bN=s.forwardRef((e,t)=>{const{appearance:n=ta.appearance.default,accentColor:r=ta.accentColor.default,grayColor:a=ta.grayColor.default,panelBackground:i=ta.panelBackground.default,radius:l=ta.radius.default,scaling:u=ta.scaling.default,hasBackground:f=ta.hasBackground.default,...h}=e,[p,g]=s.useState(n);s.useEffect(()=>g(n),[n]);const[m,w]=s.useState(r);s.useEffect(()=>w(r),[r]);const[y,b]=s.useState(a);s.useEffect(()=>b(a),[a]);const[k,S]=s.useState(i);s.useEffect(()=>S(i),[i]);const[E,C]=s.useState(l);s.useEffect(()=>C(l),[l]);const[A,L]=s.useState(u);return s.useEffect(()=>L(u),[u]),s.createElement(jw,{...h,ref:t,isRoot:!0,hasBackground:f,appearance:p,accentColor:m,grayColor:y,panelBackground:k,radius:E,scaling:A,onAppearanceChange:g,onAccentColorChange:w,onGrayColorChange:b,onPanelBackgroundChange:S,onRadiusChange:C,onScalingChange:L})});bN.displayName="ThemeRoot";const jw=s.forwardRef((e,t)=>{const n=s.useContext(Ep),{asChild:r,isRoot:a,hasBackground:i,appearance:l=(n==null?void 0:n.appearance)??ta.appearance.default,accentColor:u=(n==null?void 0:n.accentColor)??ta.accentColor.default,grayColor:f=(n==null?void 0:n.resolvedGrayColor)??ta.grayColor.default,panelBackground:h=(n==null?void 0:n.panelBackground)??ta.panelBackground.default,radius:p=(n==null?void 0:n.radius)??ta.radius.default,scaling:g=(n==null?void 0:n.scaling)??ta.scaling.default,onAppearanceChange:m=Mu,onAccentColorChange:w=Mu,onGrayColorChange:y=Mu,onPanelBackgroundChange:b=Mu,onRadiusChange:k=Mu,onScalingChange:S=Mu,...E}=e,C=r?Bc:"div",A=f==="auto"?NK(u):f,L=e.appearance==="light"||e.appearance==="dark",T=i===void 0?a||L:i;return s.createElement(Ep.Provider,{value:s.useMemo(()=>({appearance:l,accentColor:u,grayColor:f,resolvedGrayColor:A,panelBackground:h,radius:p,scaling:g,onAppearanceChange:m,onAccentColorChange:w,onGrayColorChange:y,onPanelBackgroundChange:b,onRadiusChange:k,onScalingChange:S}),[l,u,f,A,h,p,g,m,w,y,b,k,S])},s.createElement(C,{"data-is-root-theme":a?"true":"false","data-accent-color":u,"data-gray-color":A,"data-has-background":T?"true":"false","data-panel-background":h,"data-radius":p,"data-scaling":g,ref:t,...E,className:Gt("radix-themes",{light:l==="light",dark:l==="dark"},E.className)}))});jw.displayName="ThemeImpl";const Pi=e=>{if(!s.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${s.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e},B1=e=>s.createElement(VV,{...e});B1.displayName="AlertDialog.Root";const xN=s.forwardRef(({children:e,...t},n)=>s.createElement(ZV,{...t,ref:n,asChild:!0},Pi(e)));xN.displayName="AlertDialog.Trigger";const U1=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=fN,{className:i}=Ar({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=Ar(t,a);return s.createElement(zV,{container:f,forceMount:u},s.createElement(lo,{asChild:!0},s.createElement(BV,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${i}`},s.createElement(UV,{...h,ref:n,className:Gt("rt-BaseDialogContent","rt-AlertDialogContent",l)}))))))});U1.displayName="AlertDialog.Content";const W1=s.forwardRef((e,t)=>s.createElement(GV,{asChild:!0},s.createElement(Ew,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));W1.displayName="AlertDialog.Title";const K1=s.forwardRef((e,t)=>s.createElement(YV,{asChild:!0},s.createElement(Lc,{as:"p",size:"3",...e,asChild:!1,ref:t})));K1.displayName="AlertDialog.Description";const G1=s.forwardRef(({children:e,...t},n)=>s.createElement(WV,{...t,ref:n,asChild:!0},Pi(e)));G1.displayName="AlertDialog.Action";const Y1=s.forwardRef(({children:e,...t},n)=>s.createElement(KV,{...t,ref:n,asChild:!0},Pi(e)));Y1.displayName="AlertDialog.Cancel";function RK(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const a=s.Children.only(r);return s.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}const PK=["1","2","3"],LK=["solid","soft","surface","outline"],$K={...io,size:{type:"enum",className:"rt-r-size",values:PK,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:LK,default:"soft"},...kw,...Yc,..._m},kN=s.forwardRef((e,t)=>{const{asChild:n,className:r,color:a,radius:i,...l}=Ar(e,$K,Fo),u=n?Bc:"span";return s.createElement(u,{"data-accent-color":a,"data-radius":i,...l,ref:t,className:Gt("rt-reset","rt-Badge",r)})});kN.displayName="Badge";const SN=Bc,TK=["div","span"],DK=["none","inline","inline-block","block","contents"],HK={as:{type:"enum",values:TK,default:"div"},...io,display:{type:"enum",className:"rt-r-display",values:DK,responsive:!0}},ic=["0","1","2","3","4","5","6","7","8","9"],OK={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:ic,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:ic,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:ic,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:ic,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:ic,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:ic,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:ic,responsive:!0}},x8=["visible","hidden","clip","scroll","auto"],IK=["static","relative","absolute","fixed","sticky"],w0=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],FK=["0","1"],_K=["0","1"],VK=["start","center","end","baseline","stretch"],ZK=["start","center","end","baseline","stretch"],EN={...OK,...Mo,...xw,position:{type:"enum",className:"rt-r-position",values:IK,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:w0,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:w0,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:w0,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:w0,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:w0,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:x8,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:x8,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:x8,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:FK,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:_K,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:VK,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:ZK,responsive:!0}},z0=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=Ar(e,HK,EN,Fo);return s.createElement(r?SN:a,{...i,ref:t,className:Gt("rt-Box",n)})});z0.displayName="Box";const zK=["1","2","3","4"],BK=["classic","solid","soft","surface","outline","ghost"],j5={...io,size:{type:"enum",className:"rt-r-size",values:zK,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:BK,default:"solid"},...kw,...Yc,..._m,loading:{type:"boolean",className:"rt-loading",default:!1}},k8=["0","1","2","3","4","5","6","7","8","9"],UK={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:k8,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:k8,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:k8,responsive:!0}},WK=["div","span"],KK=["none","inline-flex","flex"],GK=["row","column","row-reverse","column-reverse"],YK=["start","center","end","baseline","stretch"],qK=["start","center","end","between"],XK=["nowrap","wrap","wrap-reverse"],QK={as:{type:"enum",values:WK,default:"div"},...io,display:{type:"enum",className:"rt-r-display",values:KK,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:GK,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:YK,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:qK,parseValue:JK,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:XK,responsive:!0},...UK};function JK(e){return e==="between"?"space-between":e}const Vs=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=Ar(e,QK,EN,Fo);return s.createElement(r?SN:a,{...i,ref:t,className:Gt("rt-Flex",n)})});Vs.displayName="Flex";const eG=["1","2","3"],tG={size:{type:"enum",className:"rt-r-size",values:eG,default:"2",responsive:!0},loading:{type:"boolean",default:!0}},Pr=s.forwardRef((e,t)=>{const{className:n,children:r,loading:a,...i}=Ar(e,tG,Fo);if(!a)return r;const l=s.createElement("span",{...i,ref:t,className:Gt("rt-Spinner",n)},s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}));return r===void 0?l:s.createElement(Vs,{asChild:!0,position:"relative",align:"center",justify:"center"},s.createElement("span",null,s.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},r),s.createElement(Vs,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,l))))});Pr.displayName="Spinner";const nG=_C;function CN(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r)]))}function rG(e){return e==="3"?"3":"2"}function sG(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}const jN=s.forwardRef((e,t)=>{const{size:n=j5.size.default}=e,{className:r,children:a,asChild:i,color:l,radius:u,disabled:f=e.loading,...h}=Ar(e,j5,Fo),p=i?Bc:"button";return s.createElement(p,{"data-disabled":f||void 0,"data-accent-color":l,"data-radius":u,...h,ref:t,className:Gt("rt-reset","rt-BaseButton",r),disabled:f},e.loading?s.createElement(s.Fragment,null,s.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},a),s.createElement(nG,null,a),s.createElement(Vs,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,s.createElement(Pr,{size:CN(n,sG)})))):a)});jN.displayName="BaseButton";const Sa=s.forwardRef(({className:e,...t},n)=>s.createElement(jN,{...t,ref:n,className:Gt("rt-Button",e)}));Sa.displayName="Button";const aG=["1","2","3"],oG=["soft","surface","outline"],A5={...io,size:{type:"enum",className:"rt-r-size",values:aG,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:oG,default:"soft"},...kw,...Yc},AN=s.createContext({}),o4=s.forwardRef((e,t)=>{const{size:n=A5.size.default}=e,{asChild:r,children:a,className:i,color:l,...u}=Ar(e,A5,Fo),f=r?Bc:"div";return s.createElement(f,{"data-accent-color":l,...u,className:Gt("rt-CalloutRoot",i),ref:t},s.createElement(AN.Provider,{value:s.useMemo(()=>({size:n}),[n])},a))});o4.displayName="Callout.Root";const iG=s.forwardRef(({className:e,...t},n)=>s.createElement("div",{...t,className:Gt("rt-CalloutIcon",e),ref:n}));iG.displayName="Callout.Icon";const i4=s.forwardRef(({className:e,...t},n)=>{const{size:r}=s.useContext(AN);return s.createElement(Lc,{as:"p",size:CN(r,rG),...t,asChild:!1,ref:n,className:Gt("rt-CalloutText",e)})});i4.displayName="Callout.Text";const lG=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));lG.displayName="ThickDividerHorizontalIcon";const $d=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));$d.displayName="ThickCheckIcon";const NN=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));NN.displayName="ChevronDownIcon";const Aw=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Aw.displayName="ThickChevronRightIcon";const cG=["1","2","3"],y0={...io,size:{values:cG,default:"1"},..._m,scrollbars:{default:"both"}};function uG(e){const{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,...f}=e;return{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,rest:f}}const lc=Fo.m.values;function dG(e){const[t,n]=el({className:"rt-r-m",customProperties:["--margin"],propValues:lc,value:e.m}),[r,a]=el({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:lc,value:e.mx}),[i,l]=el({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:lc,value:e.my}),[u,f]=el({className:"rt-r-mt",customProperties:["--margin-top"],propValues:lc,value:e.mt}),[h,p]=el({className:"rt-r-mr",customProperties:["--margin-right"],propValues:lc,value:e.mr}),[g,m]=el({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:lc,value:e.mb}),[w,y]=el({className:"rt-r-ml",customProperties:["--margin-left"],propValues:lc,value:e.ml});return[Gt(t,r,i,u,h,g,w),Sp(n,a,l,f,p,m,y)]}const q1=s.forwardRef((e,t)=>{const{rest:n,...r}=uG(e),[a,i]=dG(r),{asChild:l,children:u,className:f,style:h,type:p,scrollHideDelay:g=p!=="scroll"?0:void 0,dir:m,size:w=y0.size.default,radius:y=y0.radius.default,scrollbars:b=y0.scrollbars.default,...k}=n;return s.createElement(XA,{type:p,scrollHideDelay:g,className:Gt("rt-ScrollAreaRoot",a,f),style:Sp(i,h),asChild:l},RK({asChild:l,children:u},S=>s.createElement(s.Fragment,null,s.createElement(QA,{...k,ref:t,className:"rt-ScrollAreaViewport"},S),s.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),b!=="vertical"?s.createElement(t4,{"data-radius":y,orientation:"horizontal",className:Gt("rt-ScrollAreaScrollbar",kp({className:"rt-r-size",value:w,propValues:y0.size.values}))},s.createElement(n4,{className:"rt-ScrollAreaThumb"})):null,b!=="horizontal"?s.createElement(t4,{"data-radius":y,orientation:"vertical",className:Gt("rt-ScrollAreaScrollbar",kp({className:"rt-r-size",value:w,propValues:y0.size.values}))},s.createElement(n4,{className:"rt-ScrollAreaThumb"})):null,b==="both"?s.createElement(aW,{className:"rt-ScrollAreaCorner"}):null)))});q1.displayName="ScrollArea";const fG=["1","2"],hG=["solid","soft"],jo={size:{type:"enum",className:"rt-r-size",values:fG,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:hG,default:"solid"},...Fl,...Yc},MN={...io,...Fl},RN={...Fl},PN={...Fl},X1=e=>s.createElement(AB,{...e});X1.displayName="ContextMenu.Root";const Q1=s.forwardRef(({children:e,...t},n)=>s.createElement(NB,{...t,ref:n,asChild:!0},Pi(e)));Q1.displayName="ContextMenu.Trigger";const LN=s.createContext({}),J1=s.forwardRef((e,t)=>{const n=Cw(),{size:r=jo.size.default,variant:a=jo.variant.default,highContrast:i=jo.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=Ar(e,jo),m=f||n.accentColor;return s.createElement(TA,{container:h,forceMount:p},s.createElement(lo,{asChild:!0},s.createElement(MB,{"data-accent-color":m,alignOffset:-Number(r)*4,collisionPadding:10,...g,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",l)},s.createElement(q1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-ContextMenuViewport")},s.createElement(LN.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:m,highContrast:i}),[r,a,m,i])},u))))))});J1.displayName="ContextMenu.Content";const pG=s.forwardRef(({className:e,...t},n)=>s.createElement(PB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuLabel","rt-ContextMenuLabel",e)}));pG.displayName="ContextMenu.Label";const ef=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=MN.color.default,shortcut:i,...l}=e;return s.createElement(LB,{"data-accent-color":a,...l,ref:t,className:Gt("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",n)},s.createElement(ym,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},i))});ef.displayName="ContextMenu.Item";const mG=s.forwardRef(({className:e,...t},n)=>s.createElement(RB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuGroup","rt-ContextMenuGroup",e)}));mG.displayName="ContextMenu.Group";const gG=s.forwardRef(({className:e,...t},n)=>s.createElement(TB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",e)}));gG.displayName="ContextMenu.RadioGroup";const vG=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=PN.color.default,...i}=e;return s.createElement(DB,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Gt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",r)},s.createElement(ym,null,n),s.createElement(DA,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement($d,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});vG.displayName="ContextMenu.RadioItem";const wG=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=RN.color.default,...l}=e;return s.createElement($B,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Gt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",r)},s.createElement(ym,null,n),s.createElement(DA,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement($d,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},a))});wG.displayName="ContextMenu.CheckboxItem";const yG=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(OB,{...a,asChild:!1,ref:t,className:Gt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},s.createElement(Aw,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});yG.displayName="ContextMenu.SubTrigger";const bG=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(LN),{className:l,children:u,container:f,forceMount:h,...p}=Ar({size:n,variant:r,color:a,highContrast:i,...e},jo);return s.createElement(TA,{container:f,forceMount:h},s.createElement(lo,{asChild:!0},s.createElement(IB,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",l)},s.createElement(q1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-ContextMenuViewport")},u)))))});bG.displayName="ContextMenu.SubContent";const Vm=s.forwardRef(({className:e,...t},n)=>s.createElement(HB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuSeparator","rt-ContextMenuSeparator",e)}));Vm.displayName="ContextMenu.Separator";const Nw=e=>s.createElement(Rl,{...e,modal:!0});Nw.displayName="Dialog.Root";const xG=s.forwardRef(({children:e,...t},n)=>s.createElement(Wv,{...t,ref:n,asChild:!0},Pi(e)));xG.displayName="Dialog.Trigger";const Mw=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=fN,{className:i}=Ar({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=Ar(t,a);return s.createElement(Pl,{container:f,forceMount:u},s.createElement(lo,{asChild:!0},s.createElement(Ll,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${i}`},s.createElement($l,{...h,ref:n,className:Gt("rt-BaseDialogContent","rt-DialogContent",l)}))))))});Mw.displayName="Dialog.Content";const Rw=s.forwardRef((e,t)=>s.createElement(Tl,{asChild:!0},s.createElement(Ew,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));Rw.displayName="Dialog.Title";const kG=s.forwardRef((e,t)=>s.createElement(Kv,{asChild:!0},s.createElement(Lc,{as:"p",size:"3",...e,asChild:!1,ref:t})));kG.displayName="Dialog.Description";const SG=s.forwardRef(({children:e,...t},n)=>s.createElement(O1,{...t,ref:n,asChild:!0},Pi(e)));SG.displayName="Dialog.Close";const Cs=e=>s.createElement(sU,{...e});Cs.displayName="DropdownMenu.Root";const js=s.forwardRef(({children:e,...t},n)=>s.createElement(aU,{...t,ref:n,asChild:!0},Pi(e)));js.displayName="DropdownMenu.Trigger";const $N=s.createContext({}),As=s.forwardRef((e,t)=>{const n=Cw(),{size:r=jo.size.default,variant:a=jo.variant.default,highContrast:i=jo.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=Ar(e,jo),m=f||n.accentColor;return s.createElement(OA,{container:h,forceMount:p},s.createElement(lo,{asChild:!0},s.createElement(oU,{"data-accent-color":m,align:"start",sideOffset:4,collisionPadding:10,...g,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",l)},s.createElement(q1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},s.createElement($N.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:m,highContrast:i}),[r,a,m,i])},u))))))});As.displayName="DropdownMenu.Content";const l4=s.forwardRef(({className:e,...t},n)=>s.createElement(lU,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));l4.displayName="DropdownMenu.Label";const Wn=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=MN.color.default,shortcut:i,...l}=e;return s.createElement(cU,{"data-accent-color":a,...l,ref:t,className:Gt("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},s.createElement(ym,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});Wn.displayName="DropdownMenu.Item";const EG=s.forwardRef(({className:e,...t},n)=>s.createElement(iU,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));EG.displayName="DropdownMenu.Group";const Cp=s.forwardRef(({className:e,...t},n)=>s.createElement(dU,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));Cp.displayName="DropdownMenu.RadioGroup";const Wu=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=PN.color.default,...i}=e;return s.createElement(fU,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Gt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",r)},n,s.createElement(IA,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement($d,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});Wu.displayName="DropdownMenu.RadioItem";const CG=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=RN.color.default,...l}=e;return s.createElement(uU,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Gt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",r)},n,s.createElement(IA,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement($d,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},a))});CG.displayName="DropdownMenu.CheckboxItem";const jG=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(pU,{...a,asChild:!1,ref:t,className:Gt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s.createElement(Aw,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});jG.displayName="DropdownMenu.SubTrigger";const AG=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext($N),{className:l,children:u,container:f,forceMount:h,...p}=Ar({size:n,variant:r,color:a,highContrast:i,...e},jo);return s.createElement(OA,{container:f,forceMount:h},s.createElement(lo,{asChild:!0},s.createElement(mU,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},s.createElement(q1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},u)))))});AG.displayName="DropdownMenu.SubContent";const kc=s.forwardRef(({className:e,...t},n)=>s.createElement(hU,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));kc.displayName="DropdownMenu.Separator";const NG=["1","2","3","4"],MG={...io,size:{type:"enum",className:"rt-r-size",values:NG,default:"2",responsive:!0},width:Mo.width,minWidth:Mo.minWidth,maxWidth:{...Mo.maxWidth,default:"480px"},...xw},gd=e=>s.createElement(HU,{...e});gd.displayName="Popover.Root";const vd=s.forwardRef(({children:e,...t},n)=>s.createElement(IU,{...t,ref:n,asChild:!0},Pi(e)));vd.displayName="Popover.Trigger";const wd=s.forwardRef((e,t)=>{const{className:n,forceMount:r,container:a,...i}=Ar(e,MG);return s.createElement(FU,{container:a,forceMount:r},s.createElement(lo,{asChild:!0},s.createElement(_U,{align:"start",sideOffset:8,collisionPadding:10,...i,ref:t,className:Gt("rt-PopperContent","rt-PopoverContent",n)})))});wd.displayName="Popover.Content";const RG=s.forwardRef(({children:e,...t},n)=>s.createElement(VU,{...t,ref:n,asChild:!0},Pi(e)));RG.displayName="Popover.Close";const PG=s.forwardRef(({children:e,...t},n)=>s.createElement(OU,{...t,ref:n}));PG.displayName="Popover.Anchor";const LG=["1","2","3"],Pw={size:{type:"enum",className:"rt-r-size",values:LG,default:"2",responsive:!0}},$G=["classic","surface","soft","ghost"],TG={variant:{type:"enum",className:"rt-variant",values:$G,default:"surface"},...Fl,..._m,placeholder:{type:"string"}},DG=["solid","soft"],HG={variant:{type:"enum",className:"rt-variant",values:DG,default:"solid"},...Fl,...Yc},Lw=s.createContext({}),TN=e=>{const{children:t,size:n=Pw.size.default,...r}=e;return s.createElement(hW,{...r},s.createElement(Lw.Provider,{value:s.useMemo(()=>({size:n}),[n])},t))};TN.displayName="Select.Root";const DN=s.forwardRef((e,t)=>{const n=s.useContext(Lw),{children:r,className:a,color:i,radius:l,placeholder:u,...f}=Ar({size:n==null?void 0:n.size,...e},{size:Pw.size},TG,Fo);return s.createElement(mW,{asChild:!0},s.createElement("button",{"data-accent-color":i,"data-radius":l,...f,ref:t,className:Gt("rt-reset","rt-SelectTrigger",a)},s.createElement("span",{className:"rt-SelectTriggerInner"},s.createElement(vW,{placeholder:u},r)),s.createElement(wW,{asChild:!0},s.createElement(NN,{className:"rt-SelectIcon"}))))});DN.displayName="Select.Trigger";const HN=s.forwardRef((e,t)=>{const n=s.useContext(Lw),{className:r,children:a,color:i,container:l,...u}=Ar({size:n==null?void 0:n.size,...e},{size:Pw.size},HG),f=Cw(),h=i||f.accentColor;return s.createElement(kW,{container:l},s.createElement(lo,{asChild:!0},s.createElement(SW,{"data-accent-color":h,sideOffset:4,...u,asChild:!1,ref:t,className:Gt({"rt-PopperContent":u.position==="popper"},"rt-SelectContent",r)},s.createElement(XA,{type:"auto",className:"rt-ScrollAreaRoot"},s.createElement(RW,{asChild:!0,className:"rt-SelectViewport"},s.createElement(QA,{className:"rt-ScrollAreaViewport",style:{overflowY:void 0}},a)),s.createElement(t4,{className:"rt-ScrollAreaScrollbar rt-r-size-1",orientation:"vertical"},s.createElement(n4,{className:"rt-ScrollAreaThumb"}))))))});HN.displayName="Select.Content";const ON=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(IW,{...a,asChild:!1,ref:t,className:Gt("rt-SelectItem",n)},s.createElement(VW,{className:"rt-SelectItemIndicator"},s.createElement($d,{className:"rt-SelectItemIndicatorIcon"})),s.createElement(FW,null,r))});ON.displayName="Select.Item";const OG=s.forwardRef(({className:e,...t},n)=>s.createElement(TW,{...t,asChild:!1,ref:n,className:Gt("rt-SelectGroup",e)}));OG.displayName="Select.Group";const IG=s.forwardRef(({className:e,...t},n)=>s.createElement(HW,{...t,asChild:!1,ref:n,className:Gt("rt-SelectLabel",e)}));IG.displayName="Select.Label";const FG=s.forwardRef(({className:e,...t},n)=>s.createElement(ZW,{...t,asChild:!1,ref:n,className:Gt("rt-SelectSeparator",e)}));FG.displayName="Select.Separator";const _G={content:{type:"ReactNode",required:!0},width:Mo.width,minWidth:Mo.minWidth,maxWidth:{...Mo.maxWidth,default:"360px"}},$w=s.forwardRef((e,t)=>{const{children:n,className:r,open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f,content:h,container:p,forceMount:g,...m}=Ar(e,_G),w={open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f};return s.createElement(iK,{...w},s.createElement(lK,{asChild:!0},n),s.createElement(cK,{container:p,forceMount:g},s.createElement(lo,{asChild:!0},s.createElement(uK,{sideOffset:4,collisionPadding:10,...m,asChild:!1,ref:t,className:Gt("rt-TooltipContent",r)},s.createElement(Lc,{as:"p",className:"rt-TooltipText",size:"1"},h),s.createElement(dK,{className:"rt-TooltipArrow"})))))});$w.displayName="Tooltip";const qr={lastBrand:"scenri:last-brand",engine:"scenri:engine",quality:"scenri:quality",count:"scenri:count",format:"scenri:format",assetsOpen:"scenri:assets-open",ovlPanelW:"scenri:ovl-panel-w",pstudioRailW:"scenri:pstudio-rail-w",assetsExpanded:"scenri:assets-expanded",tileSize:"scenri:tile-size",wallDensity:"scenri:wall-density",feedSort:"scenri:feed-sort",feedCounts:"scenri:feed-counts"};function IN(e,t){try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}const c4="scenri:pref-changed";function FN(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}try{window.dispatchEvent(new CustomEvent(c4,{detail:{key:e,value:t}}))}catch{}}function u4(e,t){try{const n=localStorage.getItem(e);return n===null?null:(localStorage.setItem(t,n),localStorage.removeItem(e),n)}catch{return null}}function Ma(e,t){const[n,r]=s.useState(()=>IN(e,t)),a=s.useRef(n);return s.useEffect(()=>{Object.is(a.current,n)||(a.current=n,FN(e,n))},[e,n]),s.useEffect(()=>{const i=l=>{const u=l.detail;(u==null?void 0:u.key)===e&&r(f=>Object.is(f,u.value)?f:u.value)};return window.addEventListener(c4,i),()=>window.removeEventListener(c4,i)},[e]),[n,r]}function VG(e,t){const[n,r]=s.useState(()=>{try{const a=sessionStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});return s.useEffect(()=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}function S8(e,t){const[n,r]=Ma(e,t),[a,i]=s.useState(null);return[a??n,u=>{i(null),r(u)},i,a]}const ZG=()=>IN(qr.lastBrand,null),zG=e=>FN(qr.lastBrand,e),d4="sc-theme",BG="bt-theme",UG=()=>window.matchMedia("(prefers-color-scheme: light)").matches,_N=s.createContext({choice:"system",mode:"dark",setChoice:()=>{},toggle:()=>{}}),WG=()=>s.useContext(_N);function KG(){const e=localStorage.getItem(d4)??u4(BG,d4);return e==="light"||e==="dark"||e==="system"?e:"system"}function GG({children:e}){const[t,n]=s.useState(KG),[r,a]=s.useState(()=>UG()?"light":"dark");s.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: light)"),f=()=>a(u.matches?"light":"dark");return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);const i=t==="system"?r:t;s.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem(d4,t)},[i,t]);const l=s.useMemo(()=>({choice:t,mode:i,setChoice:n,toggle:()=>n(i==="dark"?"light":"dark")}),[t,i]);return o.jsx(_N.Provider,{value:l,children:o.jsx(lo,{appearance:i,accentColor:"gray",grayColor:"gray",radius:"large",scaling:"100%",children:e})})}const VN=s.createContext({push:()=>{}}),rr=()=>s.useContext(VN),YG=3,qG=140,B0=e=>{var t;return!!(e.action||(t=e.actions)!=null&&t.length)},XG=e=>{var t;return((t=e.actions)!=null&&t.length?e.actions:e.action?[e.action]:[]).slice(0,2)};function E8(e){var a;if(e.kind==="error")return 1/0;const t=e.title.length+(((a=e.detail)==null?void 0:a.length)??0),n=B0(e)?9e3:4e3,r=B0(e)?14e3:8e3;return Math.min(n+Math.max(0,t-40)*45,r)}function QG(e,t,n){const r=n>1?` (${n} times)`:"";return`${e}${r}${t?` ${t}`:""}`}const JG=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function eY({kind:e}){if(e==="info")return null;const t=e==="success"?Gn:e==="warning"?wm:zc;return o.jsx(t,{className:"sc-toast-ic",size:16,weight:"regular","aria-hidden":"true"})}function tY({children:e}){const[t,n]=s.useState([]),r=s.useRef(1),a=s.useRef([]),i=s.useRef(new Map),l=s.useRef(null),u=s.useRef(null),f=s.useRef(null),h=s.useRef(new Map),p=s.useCallback(E=>{a.current=E,n(E)},[]),g=s.useCallback(E=>{const C=E.kind==="error"?u.current:l.current;if(!C)return;const A=QG(E.title,E.detail,E.count);C.textContent=A,window.setTimeout(()=>{C.textContent===A&&(C.textContent="")},1e3)},[]),m=s.useCallback(E=>{const C=i.current.get(E);(C==null?void 0:C.handle)!=null&&window.clearTimeout(C.handle),i.current.delete(E),p(a.current.map(A=>A.id===E&&!A.leaving?{...A,leaving:!0}:A)),window.setTimeout(()=>p(a.current.filter(A=>A.id!==E)),qG+40)},[p]),w=s.useCallback((E,C)=>{if(!Number.isFinite(C))return;const A=i.current.get(E)??{remaining:C,since:0,handle:null};A.handle!=null&&window.clearTimeout(A.handle),A.remaining=C,A.since=Date.now(),A.handle=window.setTimeout(()=>m(E),C),i.current.set(E,A)},[m]),y=s.useCallback(E=>{const C=i.current.get(E);!C||C.handle==null||(window.clearTimeout(C.handle),C.handle=null,C.remaining=Math.max(0,C.remaining-(Date.now()-C.since)))},[]),b=s.useCallback(E=>{const C=i.current.get(E);!C||C.handle!=null||w(E,C.remaining)},[w]);s.useEffect(()=>{const E=()=>{const C=[...i.current.keys()];document.hidden?C.forEach(y):C.forEach(b)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[y,b]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const C=new Map,A=!JG();for(const L of E.querySelectorAll("[data-toast-id]")){const T=Number(L.dataset.toastId),M=L.getBoundingClientRect().top;C.set(T,M);const j=h.current.get(T);if(!A||j===void 0||L.hasAttribute("data-leaving"))continue;const P=j-M;P&&(L.style.transition="none",L.style.transform=`translateY(${P}px)`,L.getBoundingClientRect(),L.style.transition="transform 160ms cubic-bezier(.2, .7, .3, 1)",L.style.transform="")}h.current=C},[t]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const C=()=>{const T=document.querySelector(".sc-canvas-dock");if(!T||!t.length){delete E.dataset.overDock;return}const M=E.getBoundingClientRect(),j=T.getBoundingClientRect();M.left<j.right&&j.left<M.right?(E.style.setProperty("--sc-toasts-over-dock",`${Math.round(window.innerHeight-j.top+10)}px`),E.dataset.overDock=""):delete E.dataset.overDock};C(),window.addEventListener("resize",C);const A=document.querySelector(".sc-canvas-dock"),L=typeof ResizeObserver>"u"||!A?null:new ResizeObserver(C);return L==null||L.observe(A),()=>{window.removeEventListener("resize",C),L==null||L.disconnect()}},[t]);const k=s.useCallback(E=>{const C=a.current.filter(j=>!j.leaving),A=B0(E)?void 0:C.find(j=>j.kind===E.kind&&j.title===E.title&&j.detail===E.detail&&!B0(j));if(A){const j={...A,count:A.count+1};p(a.current.map(R=>R.id===A.id?j:R));const P=i.current.get(A.id);P&&P.handle==null?P.remaining=E8(j):w(A.id,E8(j)),j.quiet||g(j);return}const L={...E,id:r.current++,count:1},T=[...a.current,L],M=j=>!j.leaving;for(;T.filter(M).length>YG;){let j=T.findIndex(H=>M(H)&&H.kind!=="error"&&!B0(H));j===-1&&(j=T.findIndex(H=>M(H)&&H.kind!=="error")),j===-1&&(j=T.findIndex(M));const P=T.splice(j,1)[0],R=i.current.get(P.id);(R==null?void 0:R.handle)!=null&&window.clearTimeout(R.handle),i.current.delete(P.id)}p(T),w(L.id,E8(L)),L.quiet||g(L)},[g,w,p]),S=s.useMemo(()=>({push:k}),[k]);return s.useEffect(()=>{if(typeof localStorage<"u"&&localStorage.getItem("scenri:toast-probe"))return window.__scenriToast=k,()=>{delete window.__scenriToast}},[k]),o.jsxs(VN.Provider,{value:S,children:[e,Br.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:l,className:"sc-vh",role:"status","aria-live":"polite"}),o.jsx("div",{ref:u,className:"sc-vh","aria-live":"assertive","aria-atomic":"true"}),o.jsx("section",{className:"sc-toasts","aria-label":"Alerts",ref:f,onPointerDown:N5,onMouseDown:N5,children:t.map(E=>{const C=XG(E);return o.jsx("div",{className:"sc-toast-wrap","data-toast-id":E.id,"data-leaving":E.leaving||void 0,children:o.jsxs("article",{className:"sc-toast","data-kind":E.kind,onPointerEnter:()=>y(E.id),onPointerLeave:()=>b(E.id),onFocus:()=>y(E.id),onBlur:A=>{A.currentTarget.contains(A.relatedTarget)||b(E.id)},children:[o.jsx(eY,{kind:E.kind}),o.jsxs("div",{className:"sc-toast-body",children:[o.jsxs("div",{className:"sc-toast-top",children:[o.jsxs("div",{className:"sc-toast-txt",children:[o.jsxs("b",{children:[E.title,E.count>1?o.jsxs("span",{className:"sc-toast-n",children:["×",E.count]}):null]}),E.detail?o.jsx("small",{children:E.detail.slice(0,160)}):null]}),o.jsx("button",{type:"button",className:"sc-toast-x",onClick:()=>m(E.id),"aria-label":"Dismiss",children:o.jsx(jn,{size:14,weight:"regular"})})]}),C.length?o.jsx("div",{className:"sc-toast-acts",children:C.map(A=>o.jsx("button",{type:"button",className:"sc-toast-act",onClick:()=>{A.onClick(),m(E.id)},children:A.label},A.label))}):null]})]})},E.id)})})]}),document.body)]})}function N5(e){e.stopPropagation(),e.type==="mousedown"&&e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()}async function Ye(e,t,n,r,a){const i=await fetch(t,{method:e,signal:r,keepalive:a==null?void 0:a.keepalive,headers:n!==void 0?{"content-type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){let l=`HTTP ${i.status}`;try{const u=await i.json();l=u.error??l,u.details&&(l+=`: ${u.details.join("; ")}`)}catch{}throw Object.assign(new Error(l),{status:i.status,method:e,url:t})}return i.json()}const nY=(e,t,n)=>Ye("DELETE",`/api/brands/${e}/${t}/${n}`),f4=(e,t)=>nY(e,"products",t);async function ZN(e,t,n={}){const r=new FormData;n.role&&r.append("role",n.role),n.background&&r.append("background",n.background),r.append("file",t);const a=await fetch(`/api/brands/${e}/logos`,{method:"POST",body:r});if(!a.ok)throw new Error((await a.json().catch(()=>({}))).error??`HTTP ${a.status}`);return a.json()}const rY=e=>`/api/brands/${e}/export`;async function sY(e,t,n,r){const a=new FormData;a.append("file",n);const i=await fetch(`/api/brands/${e}/products/${t}/shots`,{method:"POST",body:a});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`HTTP ${i.status}`);return i.json()}async function d1(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/images",{method:"POST",body:t});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??`HTTP ${n.status}`);return(await n.json()).hash}function jp(e){if(!e||typeof e!="object")return e;const{products:t,scenes:n,characters:r,...a}=e;return a}function aY(e,t,n){try{return fetch(`/api/brands/${e}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({brand:jp(t),keepAssets:!0,base:jp(n)}),keepalive:!0}).then(r=>r.ok?r.json():null).catch(()=>null)}catch{return Promise.resolve(null)}}const Tr=e=>`/api/images/${e}`,Jr=e=>e!=null&&e.startsWith("asset:")?Tr(e.slice(6)):null,zN={large:960,tile:640,small:320,micro:160},gn=(e,t)=>`${Tr(e)}/thumb?w=${zN[t]}`,Zm=(e,t)=>e!=null&&e.startsWith("asset:")?gn(e.slice(6),t):null,oY=/^\/api\/images\/([a-f0-9]{32})(?:\/thumb\?w=\d+)?$/,iY=/^(\/api\/(?:(?:presenter-avatars|presenter-thumbnails|scene-thumbnails|demo-product-thumbnails|showcase-previews)\/[a-z0-9-]+|scene-previews\/[a-z0-9-]+\/ref-[0-9]{2})\.jpg)(?:\?v=(\d+))?(?:[?&]w=\d+)?$/;function $n(e,t){if(!e)return e;const n=oY.exec(e);if(n)return t==="full"?Tr(n[1]):gn(n[1],t);const r=iY.exec(e);if(!r)return e;const a=r[2]?`${r[1]}?v=${r[2]}`:r[1];return t==="full"?a:`${a}${r[2]?"&":"?"}w=${zN[t]}`}function bc(e){const t=$n(e,"tile"),n=$n(e,"large");if(!(!t||!n||t===n))return`${t} 640w, ${n} 960w`}const BN={large:"(max-width: 720px) 50vw, 360px",compact:"(max-width: 720px) 50vw, 240px"};function M5(e){return e.every(t=>t.kind==="root")}let UN=new Map;function lY(e){const t=new Map;for(const n of e)for(const r of n.legacyNames??[])r!==n.name&&t.set(r,n.name);UN=t}function cY(e){var r;const t=e.promptHead??"",n=(r=/^\[([^\]]+)\]/.exec(t))==null?void 0:r[1];if(n)return UN.get(n)??n;if(t.startsWith("Remove all overlaid marketing text")||t.startsWith("Remove ALL text"))return"Text lift"}function Dr(e){const t=cY(e);return t||(e.promptHead??"").trim().split(/\s+/).slice(0,6).join(" ")||(e.kind==="edit"?"Edit":"Generation")}const WN=[{id:"newest",label:"Newest first"},{id:"oldest",label:"Oldest first"},{id:"cost",label:"Highest cost"},{id:"keepers",label:"Keepers first"}];function uY(e){return WN.some(t=>t.id===e)}const KN=[{id:"all",label:"All"},{id:"keepers",label:"Keepers"},{id:"archived",label:"Archived"}];function dY(e){return KN.some(t=>t.id===e)}function fY(e){var r;const t=new URLSearchParams;e.lens&&e.lens!=="all"&&t.set("lens",e.lens),e.set&&t.set("set",e.set),e.ungrouped&&t.set("ungrouped","1"),e.lineage&&t.set("lineage",e.lineage),e.token&&t.set("token",e.token),(r=e.q)!=null&&r.trim()&&t.set("q",e.q.trim()),e.sort&&e.sort!=="newest"&&t.set("sort",e.sort),e.limit&&t.set("limit",String(e.limit)),e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return n?`?${n}`:""}function h4(e,t){const n=e.findIndex(r=>r.id===t);return n<0?{at:n,prev:null,next:null}:{at:n,prev:e[n-1]??null,next:e[n+1]??null}}const Ku=(e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id),Ee={brands:()=>Ye("GET","/api/brands"),createBrand:e=>Ye("POST","/api/brands",{brand:e}),brandFromUrl:e=>Ye("POST","/api/brands/from-url",{url:e}),updateBrand:(e,t,n)=>Ye("PUT",`/api/brands/${e}`,{brand:jp(t),keepAssets:!0,base:jp(n)}),deleteBrand:e=>Ye("DELETE",`/api/brands/${e}`),guide:()=>Ye("GET","/api/guide"),guideIntent:e=>Ye("POST","/api/guide",e,void 0,{keepalive:!0}),refreshBrandFromUrl:(e,t)=>Ye("POST",`/api/brands/${e}/refresh-from-url`,t?{url:t}:{}),updateLogo:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/logos/${t}`,n),deleteLogo:(e,t)=>Ye("DELETE",`/api/brands/${e}/logos/${t}`),projects:e=>Ye("GET",`/api/projects?brandId=${encodeURIComponent(e)}`),createProject:(e,t)=>Ye("POST","/api/projects",{brandId:e,name:t}),tree:e=>Ye("GET",`/api/projects/${e}/tree`),activity:e=>Ye("GET",`/api/brands/${e}/activity`),workspace:e=>Ye("GET",`/api/brands/${e}/workspace`),feed:(e,t,n)=>Ye("GET",`/api/brands/${e}/feed${fY(t)}`,void 0,n),node:e=>Ye("GET",`/api/nodes/${e}`),lineage:e=>Ye("GET",`/api/nodes/${e}/lineage`),usage:e=>Ye("GET",`/api/brands/${e}/usage`),sets:e=>Ye("GET",`/api/brands/${e}/sets`),createSet:(e,t)=>Ye("POST",`/api/brands/${e}/sets`,{name:t}),renameSet:(e,t)=>Ye("PATCH",`/api/sets/${e}`,{name:t}),deleteSet:e=>Ye("DELETE",`/api/sets/${e}`),addToSet:(e,t)=>Ye("POST",`/api/sets/${e}/nodes`,{nodeIds:t}),removeFromSet:(e,t)=>Ye("POST",`/api/sets/${e}/nodes/remove`,{nodeIds:t}),engines:()=>Ye("GET","/api/engines"),codexStatus:(e={})=>Ye("GET",`/api/engines/codex/status${e.force?"?force=1":""}`),repairCodexEnv:e=>Ye("POST","/api/engines/codex/repair-env",{keys:e}),restoreCodexEnv:()=>Ye("POST","/api/engines/codex/restore-env"),installCodex:()=>Ye("POST","/api/engines/codex/install"),loginCodex:()=>Ye("POST","/api/engines/codex/login"),setCap:(e,t)=>Ye("PUT","/api/caps",{engineId:e,capUsd:t}),addNode:e=>Ye("POST","/api/nodes",e),cancelNode:e=>Ye("POST",`/api/nodes/${e}/cancel`),retryNode:e=>Ye("POST",`/api/nodes/${e}/retry`),scenes:()=>Ye("GET","/api/scenes"),presenters:()=>Ye("GET","/api/presenters"),presenterFrames:e=>Ye("GET",`/api/presenter-previews/${e}`),demoProducts:()=>Ye("GET","/api/demo-products"),demoProductFrames:e=>Ye("GET",`/api/demo-product-previews/${e}`),showcase:()=>Ye("GET","/api/showcase"),previewBrief:(e,t,n,r)=>Ye("POST","/api/brief/preview",{brief:e,engineId:t,brandId:n,...r?{parentId:r}:{}}),keep:(e,t)=>Ye("POST",`/api/nodes/${e}/keep`,{kept:t}),archiveNode:(e,t)=>Ye("POST",`/api/nodes/${e}/archive`,{archived:t}),deleteNode:e=>Ye("DELETE",`/api/nodes/${e}`),deleteNodesBatch:e=>Ye("POST","/api/nodes/delete-batch",{nodeIds:e}),settings:()=>Ye("GET","/api/settings"),saveSettings:e=>Ye("PUT","/api/settings",e),costs:()=>Ye("GET","/api/costs/summary"),home:()=>Ye("GET","/api/home"),reveal:()=>Ye("POST","/api/system/reveal"),version:()=>Ye("GET","/api/version"),updateStatus:()=>Ye("GET","/api/update/status"),updateCheck:()=>Ye("POST","/api/update/check"),updateApply:()=>Ye("POST","/api/update/apply"),updateRestart:()=>Ye("POST","/api/update/restart"),desktop:()=>Ye("GET","/api/desktop"),phone:(e=!1)=>Ye("GET",e?"/api/phone?fresh=1":"/api/phone"),phoneNewCode:()=>Ye("POST","/api/phone/code"),phoneHelp:()=>Ye("GET","/api/phone/help"),phoneAllow:()=>Ye("POST","/api/phone/allow"),desktopInstall:()=>Ye("POST","/api/desktop/install"),quit:()=>Ye("POST","/api/system/quit"),releaseNotes:()=>Ye("GET","/api/release/notes"),releaseSeen:e=>Ye("POST","/api/release/seen",{version:e}),releaseUsed:e=>Ye("POST","/api/release/used",{feature:e}),sceneFrames:e=>Ye("GET",`/api/scene-previews/${e}`),pickSceneView:(e,t)=>Ye("POST",`/api/scenes/${e}/views/${t}/pick`),deleteData:e=>Ye("DELETE",`/api/data?scope=${e}`),libraryProduct:(e,t)=>Ye("GET",`/api/brands/${e}/products-library/${encodeURIComponent(t)}`),productsLibrary:e=>Ye("GET",`/api/brands/${e}/products-library`),catalogImport:(e,t,n)=>Ye("POST",`/api/brands/${e}/catalog/import`,n?{url:t,urls:n}:{url:t}),catalogScan:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/scan`,t?{url:t}:{}),catalogDetails:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/details`,{urls:t}),catalogScanState:(e,t,n)=>Ye("GET",`/api/brands/${e}/catalog/scans/${t}`,void 0,n),cancelCatalogScan:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/scans/${t}/cancel`),catalogJob:(e,t)=>Ye("GET",`/api/brands/${e}/catalog/jobs/${t}`),catalogJobs:e=>Ye("GET",`/api/brands/${e}/catalog/jobs`),cancelCatalogJob:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/jobs/${t}/cancel`),deleteCatalogProduct:(e,t)=>Ye("DELETE",`/api/brands/${e}/catalog/products/${t}`),updateProduct:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/products/${t}`,n),updateCatalogProduct:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/catalog/products/${t}`,n),productSize:(e,t)=>Ye("GET",`/api/brands/${e}/products/${t}/size`),setProductSize:(e,t,n)=>Ye("PUT",`/api/brands/${e}/products/${t}/size`,{size:n}),setProductShots:(e,t,n)=>Ye("PUT",`/api/brands/${e}/products/${t}/shots`,{files:n}),assetBuildCapabilities:()=>Ye("GET","/api/asset-builds/capabilities"),startAssetBuild:(e,t)=>Ye("POST",`/api/brands/${e}/asset-builds`,t),assetBuild:(e,t)=>Ye("GET",`/api/brands/${e}/asset-builds/${t}`),assetBuilds:e=>Ye("GET",`/api/brands/${e}/asset-builds`),cancelAssetBuild:(e,t)=>Ye("POST",`/api/brands/${e}/asset-builds/${t}/cancel`),deleteAssetBuild:(e,t)=>Ye("DELETE",`/api/brands/${e}/asset-builds/${t}`),createProduct:(e,t)=>Ye("POST",`/api/brands/${e}/products`,t),createPresenterDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts`,t),presenterDrafts:e=>Ye("GET",`/api/brands/${e}/presenter-drafts`),presenterDraft:(e,t)=>Ye("GET",`/api/brands/${e}/presenter-drafts/${t}`),updatePresenterDraft:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/presenter-drafts/${t}`,n),generateDraftView:(e,t,n,r={})=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/generate`,r),approveDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/approve`),redoDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/redo`),revertDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/revert`),stopDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/stop`),restoreDraftView:(e,t,n,r)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/restore`,{hash:r}),savePresenterDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/save`),deletePresenterDraft:(e,t)=>Ye("DELETE",`/api/brands/${e}/presenter-drafts/${t}`),createPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters`,t),updatePresenter:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/presenters/${t}`,n),deletePresenter:(e,t)=>Ye("DELETE",`/api/brands/${e}/presenters/${t}`),duplicatePresenter:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenters/${t}/duplicate`,{name:n}),editPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters/${t}/edit`),revertPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters/${t}/revert`),createScene:(e,t)=>Ye("POST",`/api/brands/${e}/scenes`,t),updateScene:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/scenes/${t}`,n),deleteScene:(e,t)=>Ye("DELETE",`/api/brands/${e}/scenes/${t}`),sceneExamples:(e,t)=>Ye("GET",`/api/brands/${e}/scenes/${t}/examples`),drawSceneExamples:(e,t,n)=>Ye("POST",`/api/brands/${e}/scenes/${t}/examples`,n),stopSceneExamples:(e,t)=>Ye("POST",`/api/brands/${e}/scenes/${t}/examples/stop`),removeSceneExample:(e,t,n)=>Ye("DELETE",`/api/brands/${e}/scenes/${t}/examples/${n}`),generateScenePreview:(e,t)=>Ye("POST",`/api/brands/${e}/scenes/${t}/preview`),rereadScene:(e,t,n)=>Ye("POST",`/api/brands/${e}/scenes/${t}/reread`,{correction:n}),startSceneStudioJob:(e,t)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs`,t),sceneStudioJob:(e,t)=>Ye("GET",`/api/brands/${e}/scene-studio/jobs/${t}`),cancelSceneStudioJob:(e,t)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/cancel`),labelSceneStudioJob:(e,t,n)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/label`,{label:n}),attachSceneStudioJob:(e,t,n)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/attach`,{sceneId:n})},p4="scenri:guide-heading",hY=["first-shot","refine","product","presenter","scene","reuse"],pY=e=>hY.includes(e);function mY(){try{const e=typeof window>"u"?null:window.sessionStorage.getItem(p4);if(!e)return null;if(e.startsWith("{")){const t=JSON.parse(e);return typeof t.brandId=="string"&&pY(t.task)?{brandId:t.brandId,task:t.task}:null}return{brandId:e,task:"first-shot"}}catch{return null}}function GN(e){try{e?window.sessionStorage.setItem(p4,JSON.stringify(e)):window.sessionStorage.removeItem(p4)}catch{}}const gY={loaded:!1,heading:null,eligible:!1,welcome:null,hidden:!0,done:{},lessons:{},progress:{},dismissed:[],active:null,activeNodes:[],activeDraftId:null,counts:null};let no={...gY,heading:mY()},R5=null,C8=null,P5=!1;const m4=new Set;function Sc(e){no=e;for(const t of m4)t()}function YN(e){const t=e;return{...t,lessons:t.lessons??{},progress:t.progress??{},loaded:!0,heading:no.heading}}function Ap(){return C8??(C8=Ee.guide().then(e=>Sc(YN(e))).catch(()=>{no.loaded||Sc({...no,loaded:!0})}).finally(()=>{C8=null})),C8}function vY(){return!P5&&typeof document<"u"&&(P5=!0,document.addEventListener("visibilitychange",()=>{!document.hidden&&no.loaded&&Ap()})),R5??(R5=Ap()),R5}function j8(){return Ap()}function wY(e,t){var n,r;return"welcome"in t?{...e,welcome:t.welcome}:"hidden"in t?{...e,hidden:t.hidden}:"finish"in t?{...e,lessons:e.lessons[t.finish]?e.lessons:{...e.lessons,[t.finish]:new Date().toISOString()},...((n=e.active)==null?void 0:n.task)===t.finish?{active:null,activeNodes:[],activeDraftId:null}:{}}:"dismiss"in t?{...e,dismissed:e.dismissed.includes(t.dismiss)?e.dismissed:[...e.dismissed,t.dismiss],...((r=e.active)==null?void 0:r.task)===t.dismiss?{active:{...e.active,paused:!0}}:{}}:e}function fc(e){const t=no;return Sc(wY(no,e)),Ee.guideIntent(e).then(n=>Sc(YN(n))).catch(()=>{Sc(t),Ap()})}function yY(e){return m4.add(e),()=>m4.delete(e)}const qN=e=>`scenri:guide-via-bar:${e}`,g4=(e,t)=>t==="first-shot"||t==="reuse"?qN(e):`scenri:guide-via:${e}:${t}`;function XN(e,t){const n={brandId:e,task:t};GN(n),Sc({...no,heading:n})}function v4(){GN(null),no.heading&&Sc({...no,heading:null})}function sp(){return no}function Tw(){return s.useSyncExternalStore(yY,sp)}const pt={root:"/",setup:"/setup",brand:"/:brandSlug",kit:"/:brandSlug/kit",products:"/:brandSlug/products",product:"/:brandSlug/products/:productId",scenes:"/:brandSlug/places",sceneStudio:"/:brandSlug/places/new/:convoId?",scene:"/:brandSlug/places/:sceneId",sceneEdit:"/:brandSlug/places/:sceneId/edit/:convoId?",presenters:"/:brandSlug/people",presenterStudio:"/:brandSlug/people/new/:draftId?",presenter:"/:brandSlug/people/:presenterId",presenterEdit:"/:brandSlug/people/:presenterId/edit",hub:"/:brandSlug/create",hubShot:"/:brandSlug/create/shots/:shotId",set:"/:brandSlug/sets/:setSlug",setShot:"/:brandSlug/sets/:setSlug/shots/:shotId",whatsNew:"/:brandSlug/whats-new",legacy:"/b/*",legacyPresenters:"/:brandSlug/presenters/*",legacyScenes:"/:brandSlug/scenes/*",notFound:"*"},To=e=>hs(pt.brand,{brandSlug:e.slug}),td=e=>hs(pt.products,{brandSlug:e.slug}),Ea=(e,t)=>hs(pt.product,{brandSlug:e.slug,productId:t}),ml=e=>hs(pt.scenes,{brandSlug:e.slug}),zr=(e,t)=>hs(pt.scene,{brandSlug:e.slug,sceneId:t}),gl=(e,t)=>hs(pt.sceneStudio,{brandSlug:e.slug,convoId:t??void 0}),Dw=(e,t,n)=>hs(pt.sceneEdit,{brandSlug:e.slug,sceneId:t,convoId:n??void 0}),ui=e=>hs(pt.presenters,{brandSlug:e.slug}),Ra=(e,t)=>hs(pt.presenter,{brandSlug:e.slug,presenterId:t}),vl=(e,t)=>hs(pt.presenterStudio,{brandSlug:e.slug,draftId:t??void 0}),zm=(e,t)=>hs(pt.presenterEdit,{brandSlug:e.slug,presenterId:t}),Sr=e=>hs(pt.hub,{brandSlug:e.slug}),$0=(e,t)=>hs(pt.set,{brandSlug:e.slug,setSlug:t.slug}),Np=e=>hs(pt.whatsNew,{brandSlug:e.slug}),Bm=(e,t,n)=>t?hs(pt.setShot,{brandSlug:e.slug,setSlug:t.slug,shotId:n}):hs(pt.hubShot,{brandSlug:e.slug,shotId:n});function bY(e,t=""){const[,,n,...r]=e.split("/");if(!n)return pt.root;const a=`/${n}${xY(r)}`;return t?a+t:a}function xY(e){const[t,n,r,a]=e;return t==="create"?r&&n==="n"?`/create/shots/${r}`:"/create":t==="s"&&n?a&&r==="n"?`/sets/${n}/shots/${a}`:`/sets/${n}`:t==="brand"?"/kit":t==="p"?"/create":t==="n"&&n?`/create/shots/${n}`:e.length?`/${[JN[t]??t,...e.slice(1)].join("/")}`:""}const QN={presenter:"person",scene:"place"},L5=(e,t)=>e.get(QN[t])??e.get(t),$5=["person","presenter","place","scene"],yd=(e,t)=>`${QN[e]}=${encodeURIComponent(t)}`,kY=e=>e==="places"||e==="scenes"?"Places":e==="products"?"Products":void 0,SY=e=>e==="person"||e==="presenter"?"presenter":e==="place"||e==="scene"?"scene":null,JN={presenters:"people",scenes:"places"};function EY(e,t="",n=""){const[,r,a,...i]=e.split("/");return`/${[r,JN[a]??a,...i].join("/")}${t}${n}`}const A8="Scenri",T5=" - ",D5=40,CY=[["whatsnew","What's new"],["setup","Providers"],["settings","Settings"]],jY=[[pt.setup,"Set up",!1],[pt.hubShot,"Shot",!1],[pt.setShot,"Shot",!1],[pt.hub,"Create",!1],[pt.set,"Create",!0],[pt.kit,"Brand kit",!1],[pt.whatsNew,"What's new",!1],[pt.product,"Products",!0],[pt.products,"Products",!1],[pt.scene,"Places",!0],[pt.scenes,"Places",!1],[pt.presenter,"People",!0],[pt.presenters,"People",!1],[pt.brand,"Home",!1]];function AY(e){if(!e)return null;const t=e.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").replace(/\s+/g," ").trim();return t?t.length>D5?`${t.slice(0,D5-1).trimEnd()}…`:t:null}function NY(e,t="",n=null){const r=new URLSearchParams(t);for(const[a,i]of CY)if(r.has(a))return i+T5+A8;for(const[a,i,l]of jY)if(bl(a,e))return((l?AY(n):null)??i)+T5+A8;return A8}const eM=s.createContext(null);function MY(){const{pathname:e,search:t}=Bn(),[n,r]=s.useState(null);return s.useEffect(()=>{document.title=NY(e,t,n)},[e,t,n]),r}function qc(e){const t=s.useContext(eM);s.useEffect(()=>{if(t)return t(e??null),()=>t(null)},[t,e])}function xi(e,t){return JSON.stringify(e)===JSON.stringify(t)?e:t}function Um(e){const t=e.current;e.current=[];for(const n of t)n()}const RY={scenes:[],collections:[],verticals:[],loaded:!1,error:!1};function PY(){const[e,t]=s.useState(RY),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.scenes().then(f=>{lY(f.scenes),u&&t(h=>xi(h,{scenes:f.scenes,collections:f.collections,verticals:f.verticals,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&Um(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const LY={presenters:[],categories:[],styles:[],loaded:!1,error:!1};function $Y(){const[e,t]=s.useState(LY),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.presenters().then(f=>{u&&t(h=>xi(h,{presenters:f.presenters,categories:f.categories,styles:f.styles,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&Um(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const TY={demoProducts:[],categories:[],loaded:!1,error:!1};function DY(){const[e,t]=s.useState(TY),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.demoProducts().then(f=>{u&&t(h=>xi(h,{demoProducts:f.demoProducts,categories:f.categories,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&Um(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const HY={showcase:[],categories:[],loaded:!1,error:!1};function OY(){const[e,t]=s.useState(HY),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.showcase().then(f=>{u&&t(h=>xi(h,{showcase:f.showcase,categories:f.categories,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&Um(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const Ph=[{id:"brand",label:"Brand kit",Icon:PF,scope:"brand",sub:e=>`What every shot for ${e} can draw on.`},{id:"usage",label:"Usage",Icon:pF,scope:"brand",sub:e=>`What ${e} has made, one square per day.`},{id:"engines",label:"Providers",Icon:n1,scope:"studio",sub:()=>"Where your images are made, and what each may spend."},{id:"appearance",label:"Appearance",Icon:gF,scope:"studio",sub:()=>"How Scenri looks on this device."},{id:"library",label:"Library",Icon:Dv,scope:"studio",sub:()=>"Your work, as plain files on this computer. Back them up like anything else."},{id:"phone",label:"Local access",Icon:vF,scope:"studio",sub:()=>"Open Scenri on your phone, tablet or another computer, or from your desktop.",feature:"local-access"},{id:"updates",label:"Updates",Icon:mp,scope:"studio",sub:()=>"How this copy of Scenri stays current."},{id:"about",label:"About",Icon:mm,scope:"studio",sub:()=>"The copy of Scenri you are running."},{id:"danger",label:"Danger zone",Icon:vm,scope:"apart",sub:()=>"These do not come back. Export from Library first if you are not certain."}],tM={brand:"brand",usage:"usage",engines:"engines",budget:"engines",general:"appearance",appearance:"appearance",library:"library",phone:"phone",updates:"updates",about:"about",danger:"danger"},IY="index",nM=e=>e!==null&&Object.prototype.hasOwnProperty.call(tM,e),FY=e=>nM(e)?tM[e]:"brand",_Y=e=>!nM(e);function rM(e){return e.milestones.map(t=>t.label)}const ol=[{id:"first-shot",title:"Make your first shot",summary:"A shot is three things Scenri keeps for you, put together and directed: what you sell, who shows it, and where it happens. Start with ours to see the shape of it, then swap in your own.",milestones:[{label:"Open Create",moments:["go"]},{label:"Choose a product",moments:["product"]},{label:"Choose a person",moments:["presenter"]},{label:"Choose a place",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"Open your shot",moments:["result"]}]},{id:"product",title:"Add your product",summary:"Your own product, added once from its packshots or straight from your store, and exact in every shot you make from then on. Nothing is drawn here and nothing is spent.",milestones:[{label:"Find where your products live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Add its photos, or bring in your store",moments:["product"]}]},{id:"reuse",title:"Use it again",summary:"The same saved product in a different world. This is the whole point of keeping ingredients: one thing you added once, shot again and again without describing it twice.",milestones:[{label:"Open Create",moments:["go"]},{label:"Add the product you saved",moments:["product"]},{label:"Put it somewhere else",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"See the same product in both",moments:["again"]}],needs:"product"},{id:"presenter",title:"Create a person",summary:"One person Scenri keeps, invented question by question or built from photos of someone real, who stays the same face across every shot you put them in.",milestones:[{label:"Find where your people live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe someone, or add photos",moments:["start"]},{label:"Decide the face",moments:["face"]},{label:"Save them to the brand",moments:["save"]}]},{id:"scene",title:"Build a place",summary:"A setting and its light, saved to shoot in again, from pictures of it or a few questions.",milestones:[{label:"Find where your places live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe the place, or add pictures",moments:["start"]},{label:"Read what your shots are told",moments:["words"]},{label:"Use it",moments:["use"]}]},{id:"refine",title:"Refine a shot",summary:"Change one thing about a shot you already have and keep everything else, including the original. This is how a shot gets good: one change at a time, never a fresh start.",milestones:[{label:"Find the shots you have made",moments:["go"]},{label:"Choose a shot to change",moments:["choose"]},{label:"Say the one thing to change",moments:["ask","refine-failed"]},{label:"See the change on the trail",moments:["refining","refined"]}],needs:"shot"}],w4={shot:{note:"Refining starts from a shot you have made.",action:"Make a shot first",status:"Needs a shot"},product:{note:"Using one again starts with a product of your own.",action:"Add a product first",status:"Needs a product"}};function VY(e){return ol.find(t=>t.id===e||Hw(t.id)===e)??null}const ZY={presenter:"person",scene:"place"},Hw=e=>ZY[e]??e;function zY(e,t,n,r){var a,i,l;return((i=(a=t.progress)==null?void 0:a[e])==null?void 0:i.brandId)===n&&r>0?"active":(l=t.lessons)!=null&&l[e]?"done":"new"}function BY(e,t){return e.find(n=>t(n)!=="done")??null}const Ow=Object.fromEntries(ol.map(e=>[e.id,Object.fromEntries(e.milestones.flatMap((t,n)=>t.moments.map(r=>[r,n])))]));function sM(e,t){let n=0;for(const r of t){const a=Ow[e][r];a!==void 0&&a>n&&(n=a)}return n}function UY(e,t){return sM(e,t)>0}function WY(e,t){var a;const n=Ow[e][t],r=((a=ol.find(i=>i.id===e))==null?void 0:a.milestones.length)??0;return n===void 0||!r?null:{at:n+1,of:r}}const N8=e=>e.status==="done"&&e.images>0;function H5(e,t,n){const r=sM(e,t);return n?Math.max(KY(e,n),r):r}function KY(e,t){const n=t.moment?Ow[e][t.moment]:void 0;if(n!==void 0)return n;switch(e){case"first-shot":return t.nodes.some(N8)?5:t.nodes.length>0?4:0;case"reuse":return t.nodes.some(N8)?4:t.nodes.length>0?3:0;case"presenter":return t.draft?3:0;case"refine":return t.nodes.some(N8)||t.nodes.some(r=>r.status==="running")?3:0;default:return 0}}const y4={"first-shot":{square:new URL("/assets/first-shot-square-hTczF9bl.webp",import.meta.url).href,wide:new URL("/assets/first-shot-wide-BSpJwjNx.webp",import.meta.url).href},product:{square:new URL("/assets/product-square-DPR77tr0.webp",import.meta.url).href,wide:new URL("/assets/product-wide-DLSsO8IK.webp",import.meta.url).href},reuse:{square:new URL("/assets/reuse-square-CMLhjEwt.webp",import.meta.url).href,wide:new URL("/assets/reuse-wide-DbbTeKsL.webp",import.meta.url).href},presenter:{square:new URL("/assets/presenter-square-BpqHv8Aq.webp",import.meta.url).href,wide:new URL("/assets/presenter-wide-ecc4y7eJ.webp",import.meta.url).href},scene:{square:new URL("/assets/scene-square-CQBwEfXy.webp",import.meta.url).href,wide:new URL("/assets/scene-wide-CJ9ENIrh.webp",import.meta.url).href},refine:{square:new URL("/assets/refine-square-CietHTPe.webp",import.meta.url).href,wide:new URL("/assets/refine-wide-BM5sVq6w.webp",import.meta.url).href}},aM=["settings","setup","new","whatsnew","learn","welcome"];function _l(){const{open:e}=jr("settings");return s.useCallback(t=>e(t??IY),[e])}function GY(){const{open:e}=jr("welcome");return s.useCallback(()=>e("1"),[e])}const b4={current:null};function oM(){const{open:e}=jr("learn");return s.useCallback((t="lessons")=>e(Hw(t)),[e])}const O5="codex-cli";function Vl(){const{open:e}=jr("setup");return s.useCallback((t=O5)=>{e(typeof t=="string"?t:O5)},[e])}function iM(e){var t;e.preventDefault(),(t=e.currentTarget)==null||t.focus({preventScroll:!0})}function lM({failure:e,density:t,onRetry:n,dismiss:r}){const a=_l(),i=Vl(),{remedy:l}=e,u=t==="tile",f=()=>{l&&(l.opens==="setup"?i("codex-cli"):a(l.opens))},h=n&&e.retryable,p=w=>u?`sc-s${w?" sc-s-primary":""}`:`sc-btn ${w?"sc-btn-primary":"sc-btn-ghost"}`,g=!u&&!!e.fix,m=!u&&!!e.raw;return o.jsxs("div",{className:"sc-fail","data-density":t,"data-kind":e.kind,"data-long":e.title.length>90||void 0,role:u?void 0:"alert",children:[o.jsx("span",{className:"sc-fail-ic","aria-hidden":!0,children:o.jsx(zc,{size:u?15:21,weight:"fill"})}),o.jsxs("div",{className:"sc-fail-txt",children:[o.jsx("b",{children:e.title}),g&&o.jsx("small",{children:e.fix})]}),(l||h||r)&&o.jsxs("div",{className:"sc-fail-acts",children:[l&&o.jsx("button",{type:"button",className:p(!0),onClick:f,children:l.label}),h&&o.jsxs("button",{type:"button",className:p(!l),onClick:n,children:[o.jsx(t1,{size:u?12:14})," Try again"]}),r&&o.jsx("button",{type:"button",className:"sc-fail-alt",onClick:r.onClick,children:r.label})]}),m&&o.jsxs("details",{className:"sc-fail-raw",children:[o.jsx("summary",{children:"Details"}),o.jsx("pre",{children:e.raw})]})]})}function Iw({failure:e,action:t,tone:n="error"}){return o.jsx("div",{className:"sc-failrow","data-tone":n,role:n==="error"?"alert":"status",children:o.jsxs("div",{className:"sc-banner","data-tone":n==="error"?"error":void 0,children:[o.jsx("span",{className:"sc-banner-ic",children:n==="error"?o.jsx(zc,{size:16,weight:"fill"}):o.jsx(mm,{size:16,weight:"fill"})}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:e.title}),e.fix&&o.jsx("small",{children:e.fix})]}),t]})})}function cM(e){return{get(t){try{return e().getItem(t)}catch{return null}},set(t,n){try{e().setItem(t,n)}catch{}},del(t){try{e().removeItem(t)}catch{}},keys(t){try{const n=e(),r=[];for(let a=0;a<n.length;a++){const i=n.key(a);i!=null&&i.startsWith(t)&&r.push(i)}return r}catch{return[]}}}}const Cr=cM(()=>localStorage),Xc=cM(()=>sessionStorage),uM=720*60*60*1e3;function dM(e){return e?e.phase==="ready"?e.blockReason!=="dev"&&e.blockReason!=="unsupervised"&&e.blockReason!=="launcher-too-old":e.canApply:!1}function YY(e){return!!(e!=null&&e.available)&&e.blockReason!=="dev"}function qY(e){return e.phase==="staging"?{kind:"downloading"}:e.phase==="ready"?{kind:"ready",version:e.stagedVersion??e.latest??e.current}:e.phase==="error"&&e.available?{kind:"stage-error"}:{kind:"announce",oneClick:dM(e)}}function XY(e,t){return e!==null&&t!==e}const QY=e=>e!==200;async function JY(e,t){const n=t.sleep??(r=>new Promise(a=>setTimeout(a,r)));for(let r=0;r<=t.boundMs;r+=t.stepMs){if(QY(await e()))return!0;await n(t.stepMs)}return!1}const eq=1800*1e3,I5=300*1e3,M8=e=>new Promise(t=>setTimeout(t,e)),fM="scenri:update-dismissed",tq=()=>Xc.get(fM),nq=e=>Xc.set(fM,e),hM=s.createContext(null);function Wm(){const e=s.useContext(hM);if(!e)throw new Error("useUpdateCenter must be used inside UpdateCenterProvider");return e}function rq({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(tq),u=s.useRef(void 0),f=s.useRef(!1),[h,p]=s.useState(!1);s.useEffect(()=>{let R=!0;return Ee.version().then(H=>R&&p(H.thisComputer===!0)).catch(()=>{}),()=>{R=!1}},[]),s.useEffect(()=>{let R=!0;const H=async()=>{if(!(!R||f.current)){if(!document.hidden)try{const U=await Ee.updateStatus();R&&n(U)}catch{}R&&(u.current=window.setTimeout(H,eq))}};H();const D=()=>{document.hidden||!R||(window.clearTimeout(u.current),H())};return document.addEventListener("visibilitychange",D),window.addEventListener("focus",D),()=>{R=!1,window.clearTimeout(u.current),document.removeEventListener("visibilitychange",D),window.removeEventListener("focus",D)}},[]);const[g,m]=s.useState(null),w=s.useCallback(async()=>{a(!0);try{n(await Ee.updateCheck()),m(null)}catch(R){m(String((R==null?void 0:R.message)??R))}finally{a(!1)}},[]),y=s.useCallback(()=>{const R=t==null?void 0:t.latest;R&&(nq(R),l(R))},[t]),b=(t==null?void 0:t.latest)!=null&&t.latest===i,[k,S]=s.useState("idle"),[E,C]=s.useState(null),A=s.useCallback(async R=>{S("restarting");try{await Ee.updateRestart()}catch(D){if(typeof D.status=="number"){S("idle"),C(String((D==null?void 0:D.message)??D));return}}const H=Date.now()+3e4;for(;Date.now()<H;){await M8(800);try{if((await Ee.version()).version!==R){location.reload();return}}catch{}}S("idle"),C("The restart did not complete. Check the terminal Scenri runs in.")},[]),L=s.useCallback(async()=>{if(k!=="idle")return{kind:"still-running"};S("stopping");try{await Ee.quit()}catch(H){if(typeof H.status=="number")return S("idle"),{kind:"refused",reason:String((H==null?void 0:H.message)??H)}}return await JY(()=>fetch("/api/version",{cache:"no-store"}).then(H=>H.status,()=>null),{boundMs:8e3,stepMs:250})?(f.current=!0,S("stopped"),{kind:"stopped"}):(S("idle"),{kind:"still-running"})},[k]);s.useEffect(()=>{k==="stopped"&&window.close()},[k]);const T=s.useCallback(async()=>{if(k!=="idle")return;C(null);const R=t==null?void 0:t.current;try{if((t==null?void 0:t.phase)!=="ready"){S("applying"),await Ee.updateApply();const H=Date.now()+I5;let D=!1;for(;Date.now()<H;){await M8(1500);const U=await Ee.updateStatus();if(n(U),U.phase==="ready"){D=!0;break}if(U.phase==="error"){C(U.error??"The update could not be staged."),S("idle");return}}if(!D){C("Couldn't download the update. Try again."),S("idle");return}}await A(R)}catch(H){C(String((H==null?void 0:H.message)??H)),S("idle")}},[k,t,A]),M=s.useRef(!1);s.useEffect(()=>{if((t==null?void 0:t.phase)!=="staging"||k!=="idle"||M.current)return;M.current=!0;let R=!0;const H=Date.now()+I5;return(async()=>{for(;R&&Date.now()<H;){if(await M8(1500),!R)return;try{const U=await Ee.updateStatus();if(!R||(n(U),U.phase!=="staging"))return}catch{}}})().finally(()=>{M.current=!1}),()=>{R=!1}},[t==null?void 0:t.phase,k]);const{pathname:j}=Bn(),P=j===pt.setup;return o.jsxs(hM.Provider,{value:{status:t,checking:r,checkNow:w,checkError:g,dismissed:b,dismiss:y,apply:T,quit:L,thisComputer:h,busy:k,applyError:E},children:[k==="stopped"?o.jsx(aq,{}):e,k!=="restarting"&&k!=="stopped"&&h&&YY(t)&&!b&&!P&&o.jsx(oq,{}),k==="restarting"&&o.jsx(sq,{version:(t==null?void 0:t.stagedVersion)??(t==null?void 0:t.latest)??null})]})}function sq({version:e}){return o.jsxs(pM,{children:[o.jsx(eE,{size:22}),o.jsx("b",{children:e?`Updating to Scenri ${e}`:"Updating Scenri"}),o.jsx("small",{children:"Restarting. This page reconnects by itself."})]})}function aq(){return o.jsxs(pM,{className:"sc-upd-stopped",children:[o.jsx(fC,{size:22}),o.jsx("b",{children:"Scenri is shut down"}),o.jsx("small",{children:"You can close this tab. Start it again from your desktop icon or with npx scenri."})]})}function pM({children:e,className:t}){return Br.createPortal(o.jsx("div",{className:t?`sc-upd-overlay ${t}`:"sc-upd-overlay",role:"status","aria-live":"polite",children:o.jsx("div",{className:"sc-upd-overlay-card",children:e})}),document.body)}function oq(){const{status:e,dismiss:t,apply:n,busy:r,applyError:a}=Wm(),i=_l();if(!e)return null;const l=qY(e),u=l.kind==="downloading"?"Downloading update…":l.kind==="ready"?`Scenri ${l.version} is ready`:l.kind==="stage-error"?"Couldn't download the update":"A new update is available",f=r==="applying"?"Updating…":l.kind==="stage-error"?"Try again":"Update",h=l.kind!=="announce"||l.oneClick;return o.jsxs("div",{className:"sc-upd-float",role:"status",children:[o.jsx(yF,{className:"sc-upd-float-dot",size:16,weight:"fill","aria-hidden":"true"}),o.jsxs("span",{className:"sc-upd-float-txt",children:[u,a&&l.kind!=="downloading"&&o.jsx("small",{children:a})]}),o.jsx("button",{type:"button",className:"sc-upd-float-later",onClick:t,children:l.kind==="ready"?"Later":"Not now"}),l.kind!=="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:r!=="idle",onClick:()=>h?void n():i("updates"),children:f})]})}function iq(e,t){return!e||t.updatedAt>=e.updatedAt}function lq(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0||e[n]===t||!iq(e[n],t))return e;const r=e.slice();return r[n]=t,r}function cq(e,t,n){if(!e)return t;const r=new Map(e.map(l=>[l.id,l]));let a=e.length===t.length;const i=t.map((l,u)=>{const f=r.get(l.id),h=f&&n.has(l.id)&&!(l.updatedAt>f.updatedAt)?f:l;return h!==e[u]&&(a=!1),h});return a?e:i}const Fw=(e,t)=>`scenri:new-${e}-${t}`,uq=e=>Xc.get(e),dq=(e,t)=>Xc.set(e,t);function T0(e){Xc.del(e),Cr.del(e)}function R8(e){var t,n,r;return!!((t=e.name)!=null&&t.trim())||!!((n=e.instruction)!=null&&n.trim())||!!((r=e.importUrl)!=null&&r.trim())||(e.facets??[]).length>0||(e.imageHashes??[]).length>0}const F5=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function mM(e,t){const n=Fw(e,t),r=uq(n);if(!r)return null;let a;try{a=JSON.parse(r)}catch{return T0(n),null}if(typeof a!="object"||a===null)return T0(n),null;const i=a;if(i.v!==1||i.brandId!==e||i.kind!==t)return T0(n),null;const l=Date.now()-Date.parse(i.updatedAt??"");return!Number.isFinite(l)||l>uM?(T0(n),null):{v:1,brandId:e,kind:t,updatedAt:i.updatedAt,name:typeof i.name=="string"?i.name:"",instruction:typeof i.instruction=="string"?i.instruction:"",facets:F5(i.facets),imageHashes:F5(i.imageHashes),importUrl:typeof i.importUrl=="string"?i.importUrl:"",pending:typeof i.pending=="string"?i.pending:null}}function P8(e,t,n){const r={v:1,brandId:e,kind:t,updatedAt:new Date().toISOString(),name:n.name??"",instruction:n.instruction??"",facets:n.facets??[],imageHashes:n.imageHashes??[],importUrl:n.importUrl??"",pending:n.pending??null};dq(Fw(e,t),JSON.stringify(r))}function Vu(e,t){T0(Fw(e,t))}function fq(e,t,n){const r=mM(e,t);(r==null?void 0:r.pending)===n&&Vu(e,t)}function hq(e,t){if(!e)return!1;if(e.pending===null)return!0;const n=t??"unknown";return n==="failed"||n==="cancelled"||n==="unknown"}const Gu=e=>`scenri:draft-${e}`;let x4=0;function pq(){return x4+=1,()=>{x4-=1}}const Ec=()=>x4>0?"":"&fresh=1",mq=e=>Cr.get(e),gq=(e,t)=>Cr.set(e,t),ap=e=>Cr.del(e);function L8(e,t){return e.some(n=>n.t==="text"?!!n.v.trim():n.t!=="template")||Object.values(t).some(n=>!!n.trim())}function _5(e){const t=mq(Gu(e));if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!="object"||n===null)return null;const r=n;if(r.v!==1||r.brandId!==e||!Array.isArray(r.tokens)||typeof r.tplFields!="object"||!r.tplFields||r.branchId)return ap(Gu(e)),null;const a=Date.now()-Date.parse(r.updatedAt??"");return!Number.isFinite(a)||a>uM?(ap(Gu(e)),null):{v:1,brandId:e,updatedAt:r.updatedAt,tokens:r.tokens,tplFields:r.tplFields,setSlug:r.setSlug??null,...k4(r.lent)?{lent:k4(r.lent)}:{}}}function k4(e){if(typeof e!="object"||e===null)return;const t=e,n={...typeof t.format=="string"?{format:t.format}:{},...typeof t.count=="number"&&Number.isInteger(t.count)&&t.count>0?{count:t.count}:{},...typeof t.quality=="string"?{quality:t.quality}:{}};return Object.keys(n).length?n:void 0}function _w(e,t){const n=k4(t.lent),r={v:1,brandId:e,updatedAt:new Date().toISOString(),tokens:t.tokens,tplFields:t.tplFields,setSlug:t.setSlug??null,...n?{lent:n}:{}};gq(Gu(e),JSON.stringify(r))}function V5(e){ap(Gu(e))}const S4="scenri:draft-returned";function vq(e,t){_w(e,t),window.dispatchEvent(new CustomEvent(S4,{detail:e}))}const gM="the engine",vM=/no engine here can draw/i,wq=[{re:/Codex plan's usage limit is used up/i,kind:"credit",title:()=>"",remedy:{label:"Use a provider key instead",opens:"engines"},retryable:!1},{re:/environment is overriding that sign-in/i,kind:"auth",title:()=>"An API key on this computer is overriding your Codex sign-in.",fix:"Tell Scenri to ignore it, then run this again.",remedy:{label:"Fix this",opens:"setup"},retryable:!0},{re:/codex.*(not logged in|login required|\b401\b|unauthorized|token.*expired)/i,kind:"auth",title:()=>"Codex is signed out on this machine.",fix:"Sign in with your ChatGPT account, then run this again.",remedy:{label:"Sign in",opens:"setup"},retryable:!1},{re:/HTTP 401\b|missing authentication|no auth credentials|invalid api key|unauthorized/i,kind:"auth",title:e=>`${bo(e)} did not accept your API key.`,fix:"Add or replace the key, then run this again.",remedy:{label:"Add key",opens:"engines"},retryable:!1},{re:/HTTP 403\b|forbidden/i,kind:"auth",title:e=>`${bo(e)} refused this key.`,fix:"It may not cover the model this shot asked for.",remedy:{label:"Check key",opens:"engines"},retryable:!1},{re:/spend cap for .*would exceed it|spend cap for/i,kind:"budget",title:e=>`This would go past your monthly cap for ${e}.`,fix:"Raise the cap, or wait for the month to roll over.",remedy:{label:"Open budget",opens:"budget"},retryable:!1},{re:/HTTP 402\b|insufficient (credit|funds|balance)|out of credit|billing|payment required/i,kind:"credit",title:e=>`${bo(e)} is out of credit.`,fix:"Top up with the provider, then run this again.",retryable:!0},{re:/HTTP 429\b|rate.?limit|too many requests/i,kind:"rate",title:e=>`${bo(e)} is rate limiting this key.`,fix:"Give it a minute, then try again.",retryable:!0},{re:/moderation|content policy|safety system|flagged|violat(es|ion)|blocked by/i,kind:"policy",title:e=>`${bo(e)} declined this brief.`,fix:"Reword what you asked for and run it again.",retryable:!1},{re:/cannot carry enough reference images/i,kind:"references",title:()=>"",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/no usable photo/i,kind:"references",title:()=>"",retryable:!1},{re:/cannot produce the requested aspect ratio|engine returned \d+x\d+ for a \d+x\d+ request/i,kind:"format",title:e=>`${bo(e)} cannot make this shape.`,fix:"Pick another format, or an engine that can.",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/HTTP 404\b|model not found|no endpoints found|no allowed providers/i,kind:"model",title:e=>`${bo(e)} has no model for this shot.`,fix:"Pick another engine in the composer, or connect one in Providers.",remedy:{label:"Providers",opens:"engines"},retryable:!1},{re:vM,kind:"setup",title:()=>"Image generation is not set up yet.",fix:"Set it up, and this goes on from where it stopped.",remedy:{label:"Set up",opens:"setup"},retryable:!1},{re:/reading pictures needs codex/i,kind:"setup",title:()=>"Reading pictures needs Codex, which is not set up yet.",fix:"Set it up, and the pictures are read from where they are.",remedy:{label:"Set up",opens:"setup"},retryable:!1},{re:/failed to spawn codex|codex.*enoent|command not found/i,kind:"setup",title:()=>"Codex is not installed on this machine.",fix:"Run setup once and this works from then on.",remedy:{label:"Set up Codex",opens:"setup"},retryable:!1},{re:/code-mode host/i,kind:"setup",title:()=>"Codex could not start its tool host.",fix:"A Windows setting is blocking it. Set SafeDllSearchMode to 1 and restart Windows.",retryable:!1},{re:/could not verify codex/i,kind:"setup",title:()=>"Scenri could not verify Codex.",fix:"Open setup and check again. If Codex was just installed, restart Scenri.",remedy:{label:"Check Codex",opens:"setup"},retryable:!0},{re:/codex cli .* is too old|Scenri needs \d+\.\d+\.\d+ or newer/i,kind:"setup",title:()=>"Codex CLI needs an update.",fix:"Update Codex, then run this again.",remedy:{label:"Update Codex",opens:"setup"},retryable:!1},{re:/ChatGPT plan cannot run .+ in Codex/i,kind:"setup",title:()=>"Your ChatGPT plan cannot run this Codex model.",fix:"Choose another model in Codex, then run this again.",retryable:!1},{re:/\brun aborted\b/i,kind:"cancelled",title:()=>"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",retryable:!0},{re:/produced no output for \d+s/i,kind:"timeout",title:()=>"Codex never started answering.",fix:"Try again. If it keeps happening, run Codex once in a terminal to check it still works.",retryable:!0},{re:/Codex CLI timed out after/i,kind:"timeout",title:()=>"Codex ran out of time on this shot.",fix:"Try again. Fewer variants or fewer reference photos finish faster.",retryable:!0},{re:/generation timed out after \d+ minutes?/i,kind:"timeout",title:()=>"This run hit the overall time limit.",fix:"Try again, with fewer variants if it repeats.",retryable:!0},{re:/timed out|ETIMEDOUT/i,kind:"timeout",title:e=>`${bo(e)} took too long to answer.`,fix:"Try again.",retryable:!0},{re:/ENOTFOUND|ECONNREFUSED|ECONNRESET|EAI_AGAIN|fetch failed|network error/i,kind:"network",title:e=>`Could not reach ${e}.`,fix:"Check your connection, then try again.",retryable:!0},{re:/interrupted\W+server restarted/i,kind:"restarted",title:()=>"Scenri restarted while this was rendering.",fix:"The shot was lost, not the brief. Run it again.",retryable:!0},{re:/HTTP 5\d\d\b|internal server error|bad gateway|service unavailable|overloaded|upstream/i,kind:"server",title:e=>`${bo(e)} had a problem on its end.`,fix:"Nothing wrong on your side. Try again shortly.",retryable:!0},{re:/produced no images|returned no image|no images returned|finished but produced no/i,kind:"empty",title:e=>`${bo(e)} finished without making a picture.`,fix:"Run it again. This usually clears on a second try.",retryable:!0}];function bo(e){return e===gM?"The engine":e}function co(e,t){const n=(e??"").trim(),r=(t??"").replace(/\s*\(BYOK\)\s*$/i,"").trim()||gM;if(!n)return{kind:"unknown",title:"This shot did not finish.",raw:"",retryable:!0};for(const a of wq){if(!a.re.test(n))continue;const i=a.title(r)||yq(n);return{kind:a.kind,title:i,fix:a.fix,raw:n,remedy:a.remedy,retryable:a.retryable}}return{kind:"unknown",title:"This shot did not finish.",raw:n,retryable:!0}}function wM(){return{kind:"cancelled",title:"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",raw:"",retryable:!0}}function ln(e,t,n){const r=e instanceof Error?e.message:typeof e=="string"?e:String((e==null?void 0:e.message)??e),a=co(r,n),i=a.kind==="unknown"?a.raw||void 0:[a.title,a.fix].filter(Boolean).join(" ");return{kind:"error",title:t,detail:i}}function yq(e){const t=e.trim();if(!t)return t;const n=t[0].toUpperCase()+t.slice(1);return/[.!?]$/.test(n)?n:`${n}.`}const Km=[{id:"portrait",tier:"core",gate:!0,from:[],strip:"Face",name:"face"},{id:"front",tier:"core",gate:!0,from:["portrait"],strip:"Full body",name:"full body"},{id:"three-quarter",tier:"core",from:["portrait","front"],strip:"Three-quarter",name:"three-quarter view"},{id:"back",tier:"supplementary",from:["portrait","front"],strip:"Back",name:"back view"},{id:"left",tier:"supplementary",from:["portrait","front"],strip:"Left",name:"left view"},{id:"right",tier:"supplementary",from:["portrait","front"],strip:"Right",name:"right view"}],tf=e=>Km.filter(e).map(t=>t.id),yM=tf(()=>!0),bq=tf(e=>e.tier==="core"),bM=tf(e=>e.tier==="supplementary"),$c=Object.fromEntries(Km.map(e=>[e.id,e.strip])),xn=Object.fromEntries(Km.map(e=>[e.id,e.name])),Cc=e=>xn[e],xM=Object.fromEntries(Km.map(e=>[e.id,e.from])),E4=new Set(tf(e=>e.gate===!0)),ei=e=>E4.has(e)?void 0:"auto",U0=4,Z5=25*1024*1024,di=e=>tf(t=>{var n;return t.tier==="core"||!!e.extras||((n=e.views[t.id])==null?void 0:n.status)!=="empty"});function Gm(e){return di(e).find(t=>e.views[t].status!=="approved")??null}const xq=e=>Gm(e)===null,fi=e=>e.views.portrait.status==="approved"||!!e.views.portrait.prior,Tc=e=>e.stage!=="idle"||!!e.activeView;function Vw(e){if(Tc(e))return null;const t=Gm(e);if(!t)return null;const n=e.views[t];return n.status!=="empty"&&n.status!=="stale"||n.error?null:xM[t].every(r=>e.views[r].status==="approved")?t:null}function kM(e,t){return t??(Tc(e)?e.activeView:null)??Gm(e)??"portrait"}function SM(e,t){return di(e).map(n=>{const r=e.views[n],a=n===t?"current":r.status==="approved"?"approved":r.status==="stale"?"stale":"todo";return{view:n,label:$c[n],state:a,hash:r.hash,photo:r.origin==="photo",drawing:e.activeView===n,approved:r.status==="approved",error:!!r.error}})}const kq={woman:"a woman",man:"a man",androgynous:"an androgynous person"},Sq={woman:"her",man:"his",androgynous:"their"},Mp=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|she|he|her|his)\b/i,Eq=/^(my|a|an|the|this|that|is|it|its|their|there|hey|hi|hello|yo|ok|okay|please|thanks|thank|you|your|dear|bro|bruh|dude|mate|sir|maam|madam|just|like|some)$/i;function Cq(e){const t=e.trim().split(/[^\p{L}\p{N}']+/u).filter(Boolean);return t.some(n=>Mp.test(n))?t.every(n=>Eq.test(n)||Mp.test(n)):!1}const Zw=/\b(\d0s|\d{2}\s*(years|yo)|teen|twenties|thirties|forties|fifties|sixties|seventies|elderly|young|old(er)?|middle-aged|adult)\b/i,jq=120,Aq=18;function Nq(e){const t=e.match(/\d+/g);return t!=null&&t.length?t.every(n=>{const r=Number(n);return r>=Aq&&r<=jq}):!1}const Mq=/\b(hair|bald|shaved|buzz|blonde?|brunette|redhead|ginger|greying|silver|auburn|platinum)\b/i,Rq=/\b(skin|complexion|fair|pale|light|olive|tan|tanned|brown|deep|dark|ebony|black|white|freckled|golden)\b/i,Pq=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|guys|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|person|people|someone|somebody|model|teen|teenager|kid|child|adult|senior)\b/i,Lq=/\b(hair|haired|curly|wavy|straight|braids?|bob|ponytail|bun|fringe|bangs|beard|beardless|moustache|mustache|stubble|goatee|clean-shaven|freckles?|glasses|spectacles|tattoos?|piercings?|eyes?|eyebrows?|brows|jaw|jawline|cheekbones|nose|lips|mouth|smile|smiling|face|features|forehead|dimples|scar|wrinkles|build|figure|frame|body|tall|short|slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size|height|weight|presence|vibe|energy|look|looks|looking|calm|warm|confident|elegant|composed|friendly|serious|intense|soft|gentle|bright|energetic|quiet|poised|relaxed|playful|stern|kind|charming|handsome|beautiful|pretty|striking|rugged|graceful|sporty|nerdy|bookish|professional|corporate|casual|older|younger|taller|shorter|longer|slimmer|leaner|heavier|broader|bigger|smaller|thinner|thicker|softer|sharper|lighter|darker|natural|makeup|make-up|lipstick|jewelry|earrings)\b/i,$q=/\b(mediterranean|asian|indian|chinese|japanese|korean|african|nordic|scandinavian|latin[ao]?|hispanic|arab|arabic|middle eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipin[ao]|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|mixed|biracial)\b/i,ya=e=>Pq.test(e)||Zw.test(e)||Mq.test(e)||Rq.test(e)||Lq.test(e)||$q.test(e);function Tq(e,t){const n=t.trim();if(!n)return"";const r=[],a=e.steer&&!Mp.test(n)?kq[e.steer]:"";if(a&&r.push(a),e.age&&!Zw.test(n)){const l=e.steer?Sq[e.steer]:"their",u=e.age==="60+"?`in ${l} 60s or older`:`in ${l} ${e.age}`;r.push(a?u:`someone ${u}`)}const i=[];return i.length&&r.push(`with ${i.join(" and ")}`),r.length?`${r.join(" ")}, ${n}`:n}function Dq(e,t){var r;const n=((r=e.analysis)==null?void 0:r.suitableCategories)??[];return!n.length||t.length?null:n}function EM(e){return yM.some(t=>{const n=e.views[t];return!!n.hash&&n.origin!=="photo"&&n.status!=="empty"})}function Hq(e,t){if(Tc(e))return"Still drawing";for(const n of di(e)){const r=e.views[n];if(r.status==="candidate")return`Decide on the ${Cc(n)} first`;if(r.status==="stale")return`Redo the ${Cc(n)} first`;if(r.status!=="approved")return`Use the ${Cc(n)} first`}return t.trim()?null:"Give them a name"}const CM=/\b(hair|bald|fringe|bangs|beard|moustache|mustache|stubble|skin|freckles?|complexion|age|older|younger|\d0s|face|facial|jaw|chin|cheek(bone)?s?|nose|eyes?|brows?|eyebrows?|lips?|mouth|teeth|wrinkles?|build|weight|heavier|slimmer|thinner|leaner|broader|muscular|athletic|curvier|taller|shorter|height|gender|woman|man|feminine|masculine|glasses|tattoo|scar)\b/i;function jM(e,t,n){if(!e.trim())return{blocked:"Say what should change."};if(!fi(n))return n.views.portrait.status!=="candidate"?{blocked:"Nothing to adjust yet."}:{view:"portrait",scope:"identity"};if(t==="portrait"||CM.test(e))return n.source==="photos"?{blocked:"Their photos define who they are. Change a drawn view instead."}:{view:"portrait",scope:"identity"};const a=n.views[t];return a.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:a.status!=="approved"&&a.status!=="candidate"?{blocked:`Nothing drawn for the ${Cc(t)} yet.`}:{view:t,scope:"view"}}function z5(e,t){return fi(t)?t.source==="photos"?"Changes this view only. Their photos define who they are.":e==="portrait"?"Changes the person. The other views are redrawn after you use it.":"Changes this view only. Hair, skin, age or build change the person.":"An adjustment keeps this person. Try again rolls a new one."}function Oq(e,t,n){const r=e.trim(),a=jM(r||"this",t,n);if("blocked"in a)return r?{chip:null,hint:a.blocked,tone:"alert"}:{chip:null,hint:z5(t,n)};const i=fi(n)?a.scope==="identity"?"Changing the person":`Refining the ${xn[a.view]}`:"Adjusting the face";return{chip:{view:a.view,label:i},hint:z5(t,n)}}const B5=e=>e.charAt(0).toUpperCase()+e.slice(1);function Iq(e){var p,g,m,w;if(e.source!=="photos"||e.stage==="analyzing")return null;const t=(p=e.readError)==null?void 0:p.trim();if(t){const y=co(t);return{text:`The photos could not be read${y.kind!=="unknown"?`. ${y.title}`:`: ${/[.!?]$/.test(t)?t:`${t}.`}`} Their face is drawn from them anyway.`,tone:"warn"}}const n=(m=(g=e.analysis)==null?void 0:g.conflict)==null?void 0:m.trim();if(n)return{text:`These photos may show more than one person: ${n}`,tone:"warn"};const r=((w=e.analysis)==null?void 0:w.photos)??[];if(r.length&&r.every(y=>y.usable===!1))return null;const a=di(e),i=a.filter(y=>e.views[y].origin==="photo"),l=a.filter(y=>e.views[y].origin!=="photo"),u=y=>y.length<=2?y.map(Cc).join(" and "):`${y.slice(0,-1).map(Cc).join(", ")} and ${Cc(y[y.length-1])}`,f=i.length?`${B5(u(i))} from your ${i.length===1?"photo":"photos"}.`:"";if(!l.length)return{text:f};const h=l.length>=3&&i.length?"The rest are drawn from them.":`${B5(u(l))} ${l.length===1?"is":"are"} drawn from them.`;return{text:[f,h].filter(Boolean).join(" ")}}const AM=e=>{var t;return(e.activeView?(t=e.views[e.activeView])==null?void 0:t.startedAt:void 0)??e.updatedAt};function NM(e){var r;if(e.stage==="analyzing")return`Reading ${e.source==="photos"?"the photos":"the face"}`;const t=e.activeView;if(!t)return;const n=!!((r=e.views[t])!=null&&r.hash);return t==="portrait"?n?"Adjusting the face":"Drawing the face":`${n?"Redrawing":"Drawing"} the ${xn[t]}`}function zw(e,t){return MM(t).some(n=>!!e.views[n].hash)}function MM(e){const t=new Set;for(let n=!0;n;){n=!1;for(const r of yM)r===e||t.has(r)||xM[r].some(a=>a===e||t.has(a))&&(t.add(r),n=!0)}return[...t]}function Fq(e,t){const n=e.views[t].hash;return n?MM(t).some(r=>{const a=e.views[r];return!!a.hash&&!(a.conditionedOn??[]).includes(n)}):!1}function RM(e,t){const n=new Set,r=[];for(const a of e.results??[])a.view!==t||a.how==="restored"||n.has(a.hash)||(n.add(a.hash),r.push({n:r.length+1,hash:a.hash,current:e.views[t].hash===a.hash}));return r.length>1?r:[]}const _q=["hero","close","hands","angle","bold"],Qa={hero:"Hero",close:"Close-up",hands:"Hands",angle:"Another angle",bold:"A bold one"},dl={place:"Empty",hero:"Hero",close:"Close-up",hands:"Hands",angle:"Angle",bold:"Bold"},C4=e=>e==="Place"?dl.place:e,U5={hero:"hero",close:"close-up",hands:"hands",angle:"other angle",bold:"bold one"},PM=(e,t)=>!!e&&e.status==="running"&&e.roles.includes(t)&&!e.done.includes(t)&&!e.failed.some(n=>n.role===t);function LM(e=[],t){const n=[];for(const r of _q){const a=e.find(l=>l.role===r);if(PM(t,r)||(t==null?void 0:t.status)==="running"&&t.done.includes(r)&&!a){n.push({role:r,state:"drawing",...a?{url:a.url,hash:a.hash}:{}});continue}if(a){n.push({role:r,state:"shown",url:a.url,hash:a.hash,earlier:a.earlier,...a.setup?{setup:a.setup}:{}});continue}const i=t==null?void 0:t.failed.find(l=>l.role===r);i&&n.push({role:r,state:"failed",error:i.error})}return n}function Vq(e,t=[],n){return e.filter(r=>!t.some(a=>a.role===r)&&!PM(n,r))}function Zq(e=[]){return e.filter(t=>t.earlier).map(t=>t.role)}function Bw(e){if(e.status==="failed")return e.error??"The examples did not draw";if(e.status==="cancelled")return"Stopped";const t=e.total?` · ${e.done??0} of ${e.total}`:"";if(e.status==="running"){const n=e.step&&e.step in U5?U5[e.step]:null;return`${n?`Drawing the ${n}`:"Drawing examples"}${t}`}return e.done===1?"One example drawn":`${e.done??0} examples drawn`}function f1(e){const t=co(e);return t.kind==="unknown"?null:[t.title,t.fix].filter(Boolean).join(" ")}const $M=50;function Ya(e){return Date.parse(e.includes("T")?e:`${e.replace(" ","T")}Z`)}function qa(e){return e.startedAt||e.createdAt}function Ym(e,t=Date.now()){const n=Ya(e);return Number.isNaN(n)?0:Math.max(0,Math.round((t-n)/1e3))}function Uw(e,t=Date.now()){const n=Ym(e,t);return n<20?"generating":n<60?"still generating":"taking longer than usual"}function Dc(e,t=Date.now()){const n=Ym(e,t),r=u=>String(u).padStart(2,"0"),a=Math.floor(n/3600),i=Math.floor(n%3600/60),l=n%60;return a>0?`${a}:${r(i)}:${r(l)}`:`${i}:${r(l)}`}function TM(e,t=Date.now()){const n=Ym(e,t);if(n<45)return"just now";if(n<3600)return`${Math.round(n/60)}m ago`;if(n<86400)return`${Math.floor(n/3600)}h ago`;const r=Math.floor(n/86400);return r===1?"Yesterday":`${r}d ago`}function DM(e){if(!e)return 0;if(e.stage==="discovering")return e.discovered?15:8;if(e.stage==="fetching_products"){const t=Math.max(e.discovered,e.fetched,1);return 15+Math.min(45,Math.round(e.fetched/t*45))}if(e.stage==="processing_assets"){const t=Math.max(e.imagesTotal,1);return 60+Math.min(35,Math.round(e.imagesDone/t*35))}return e.stage==="completed"||e.stage==="no_catalog"?100:e.stage==="partial"?95:5}const HM=e=>e.setNames.length>0?`${e.setNames.join(", ")} · `:"";function zq(e){const t=co(e);return t.kind==="restarted"?t.title:e??"failed"}function j4(e,t,n=Date.now(),r=1){const a=HM(e),i=r>1?`${r} shots`:"ready",l=e.status==="running"?`${a}${Uw(qa(e),n)}`:e.status==="error"?`${a}${zq(e.error)}`:e.status==="cancelled"?`${a}cancelled`:`${a}${i}`;return{id:`node:${e.id}`,kind:e.kind==="edit"?"edit":"generation",state:e.status,title:e.kind==="edit"?`Edit · ${Dr(e)}`:Dr(e),subtitle:l,thumb:e.images[0]??null,percent:null,startedAt:e.status==="running"?qa(e):e.createdAt,href:Bm(t,null,e.id)}}function Bq(e,t,n=Date.now()){var f,h;const r=[...e].sort((p,g)=>(p.batchIndex??0)-(g.batchIndex??0)),a=r[0];if(r.length===1)return j4(a,t,n);const i=r.filter(p=>p.status==="done"&&p.images.length>0),l=r.some(p=>p.status==="running")?"running":i.length?"done":r.some(p=>p.status==="error")?"error":"cancelled",u=j4({...a,status:l,images:((f=i[0])==null?void 0:f.images)??[],error:l==="error"?((h=r.find(p=>p.status==="error"))==null?void 0:h.error)??null:a.error},t,n,r.length);return l==="done"&&i.length<r.length?{...u,subtitle:`${HM(a)}${i.length} of ${r.length} shots`}:u}function Uq(e){var t,n;return e.stage==="no_catalog"||e.stage==="failed"&&((n=(t=e.errors)==null?void 0:t[0])==null?void 0:n.code)==="empty_catalog"}const A4="content:library";function Wq(e,t){const n={id:A4,kind:"library",thumb:null,startedAt:e.startedAt??t,href:null},r=e.total??0;if(e.arriving)return{...n,state:"running",title:"Downloading the Scenri library",subtitle:r?`${e.landed??0} of ${r} pictures`:"Pictures for the examples, products and people",percent:e.totalBytes?Math.min(99,Math.floor((e.bytes??0)/e.totalBytes*100)):null};if(e.outcome==="complete")return{...n,state:"done",title:"Scenri library downloaded",subtitle:r?`${r} pictures for the examples, products and people`:"Pictures for the examples",percent:100};if(e.outcome==="partial"){const a=e.failed??0;return{...n,state:"partial",title:"Scenri library partly downloaded",subtitle:`${a} ${a===1?"picture":"pictures"} did not download. Scenri tries again when it next starts.`,percent:null}}return null}function Kq(e){return e==="library"?"Downloading the library":e==="catalog"?"Importing":"Rendering"}function Gq(e){const t=e.filter(n=>n.state==="running");return t.find(n=>n.kind!=="library")??t[0]??null}function Yq(e,t){const n=Uq(e),r=n||e.stage==="completed"?"done":e.stage==="partial"?"partial":e.stage==="cancelled"?"cancelled":e.stage==="failed"?"error":"running";let a=e.url;try{a=new URL(e.url).hostname.replace(/^www\./,"")}catch{}const i=e.stage==="discovering"?e.discovered?`Found ${e.discovered.toLocaleString()} products`:"Looking for products":e.stage==="processing_assets"&&e.imagesTotal?`${e.imagesDone.toLocaleString()} of ${e.imagesTotal.toLocaleString()} pictures`:e.stage==="fetching_products"&&e.fetched>e.upserted&&e.discovered?`Reading ${e.fetched.toLocaleString()} of ${e.discovered.toLocaleString()} products`:e.discovered?`${e.upserted.toLocaleString()} of ${e.discovered.toLocaleString()} products`:`${e.upserted.toLocaleString()} products`;return{id:`catalog:${e.id}`,kind:"catalog",state:r,title:a,subtitle:n?"No shop on this site":r==="error"||r==="cancelled"||r==="partial"?e.message??"Import failed":i,thumb:null,percent:n?100:DM(e),startedAt:e.createdAt,href:td(t)}}function qq(e,t){const n=e.stage==="done"?"done":e.stage==="failed"?"error":e.stage==="cancelled"?"cancelled":"running",r=n==="error"?e.error??"failed":n==="cancelled"?"stopped":n==="done"?e.warnings[0]??e.coverage[0]??(e.kind==="presenter"?"Ready to cast":"Ready to use"):e.message??(e.kind==="presenter"?"Building the studio views":"Reading the references");return{id:`build:${e.id}`,kind:e.kind,state:n,title:e.name,subtitle:r,thumb:e.previewHash,percent:e.steps>0?Math.min(100,Math.round(e.step/e.steps*100)):null,startedAt:e.startedAt,href:e.assetId?e.kind==="presenter"?Ra(t,e.assetId):zr(t,e.assetId):null}}function Xq(e){if(e.kind==="examples"){const n=Bw(e);return e.status==="done"&&e.error?`${n} · ${Math.max(1,(e.total??0)-(e.done??0))} did not draw`:n}if(e.status==="failed")return e.error??"It did not finish";if(e.status==="cancelled")return"Stopped";if(e.kind==="scene")return e.status==="running"?e.step==="reading"?"Reading the place":e.step==="changing"?"Changing the words":"Drawing the picture":e.job==="change"&&!e.thumb?"The words are changed":e.attachTo?"On its place now":"The picture is drawn";const t=e.step&&e.step in xn?xn[e.step]:null;return e.status==="running"?t?`Drawing the ${t}`:"Reading the photos":e.awaiting&&t?`The ${t} is ready to look at`:e.total&&e.done===e.total?"Every view is drawn":e.total?`${e.done??0} of ${e.total} views`:"Drawn"}function Qq(e,t){const n=e.status==="failed"?"error":e.status==="done"&&e.error?"partial":e.status,r=e.kind==="examples"?e.sceneId?zr(t,e.sceneId):null:e.kind==="scene"?e.conversation?e.sceneId?Dw(t,e.sceneId,e.conversation):gl(t,e.conversation):e.attachTo?zr(t,e.attachTo):null:e.presenterId?zm(t,e.presenterId):e.draftId?vl(t,e.draftId):null;return{id:e.id,kind:e.kind==="examples"?"scene":e.kind,state:n,title:e.name.trim()||(e.kind==="presenter"?"New person":"New place"),subtitle:Xq(e),thumb:e.thumb,percent:e.kind!=="scene"&&e.total?Math.round((e.done??0)/e.total*100):null,startedAt:e.startedAt,href:r}}const N4=e=>e.startsWith("scene:")||e.startsWith("presenter:")||e.startsWith("examples:");function W5(e,t){return e?e.split("?")[0].replace(/\/$/,"")===t.replace(/\/$/,""):!1}function K5(e,t,n){var l;if(!e.id.startsWith("examples:")||!e.href)return!1;const r=e.href.split("?")[0].split("/").pop(),a=t.match(/\/places\/([^/]+)\/edit(?:\/|$)/);if(a)return a[1]===r;const i=t.match(/\/places\/new\/([^/]+)/);if(!i)return!1;try{return((l=JSON.parse(Cr.get(`scenri:scene-studio:${n}:${i[1]}`)??"null"))==null?void 0:l.sceneId)===r}catch{return!1}}function Jq(e,t=12){const n=e.filter(a=>a.state==="running"),r=e.filter(a=>a.state!=="running").sort((a,i)=>Ya(i.startedAt)-Ya(a.startedAt)).slice(0,t);return n.sort((a,i)=>Ya(a.startedAt)-Ya(i.startedAt)),[...n,...r]}function eX(e,t,n=new Date){if(!e)return[];const r=[];for(const a of t){if(a.state==="running")continue;const i=e.get(a.id);i&&i.state!=="running"||r.push({id:a.id,kind:a.kind,state:a.state,title:a.title,subtitle:a.subtitle,thumb:a.thumb,at:n.toISOString(),href:a.href})}return r}function tX(e,t){if(!e)return[];const n=new Set(t.map(r=>r.id));return[...e.values()].filter(r=>r.state==="running"&&!n.has(r.id)&&(N4(r.id)||r.id.startsWith("build:"))).map(r=>({...r,state:"error",subtitle:"Lost when Scenri restarted. Start it again."}))}function nX(e,t){return e.length===0?null:new Map([...t.map(n=>[n.id,n]),...e.map(n=>[n.id,n])])}function rX(e,t,n=$M){if(t.length===0)return e;const r=new Set(t.map(a=>a.id));return[...t,...e.filter(a=>!r.has(a.id))].sort((a,i)=>Ya(i.at)-Ya(a.at)).slice(0,n)}function sX(e,t){const n=e.filter(a=>!a.watched);if(!t)return n.length;const r=Ya(t);return n.filter(a=>Ya(a.at)>r).length}const OM=e=>`scenri:notifications-${e}`,IM=e=>`scenri:notifications-seen-${e}`,FM=e=>Cr.get(e),_M=(e,t)=>Cr.set(e,t);function G5(e){const t=FM(OM(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}const Y5=(e,t)=>_M(OM(e),JSON.stringify(t.slice(0,$M))),q5=e=>FM(IM(e)),aX=(e,t)=>_M(IM(e),t),VM=e=>`scenri:activity-running-${e}`;function oX(e){const t=Xc.get(VM(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>(r==null?void 0:r.state)==="running"):[]}catch{return[]}}const iX=(e,t)=>Xc.set(VM(e),JSON.stringify(t.filter(n=>n.state==="running")));function $8(e,t){return e===t?!0:e.length!==t.length?!1:JSON.stringify(e)===JSON.stringify(t)}const lX=1500,cX=5e3,ZM=s.createContext(null);function ia(){const e=s.useContext(ZM);if(!e)throw new Error("useTaskCenter must be used inside TaskCenterProvider");return e}let X5=null,Q5=!1;function uX({brand:e,onActivity:t,children:n}){const r=Un(),{push:a}=rr(),{refreshBrands:i,noteContent:l}=Mn(),u=e.id,[f,h]=s.useState([]),[p,g]=s.useState([]),[m,w]=s.useState([]),y=s.useRef(e);y.current=e;const b=s.useRef([]);b.current=p;const[k,S]=s.useState(()=>G5(u)),[E,C]=s.useState(()=>q5(u)),[A,L]=s.useState(!1),T=s.useRef(null),M=s.useRef(!1),j=s.useRef(null),P=s.useRef(null),R=s.useRef(new Set),H=s.useRef(0),D=s.useRef(new Set),U=s.useRef(i);U.current=i;const V=s.useRef(l);V.current=l;const B=s.useRef(null),G=s.useRef(A);G.current=A;const _=s.useRef(r);_.current=r;const{pathname:O}=Bn(),I=s.useRef(!1);I.current=/\/(create|sets)(\/|$)/.test(O);const K=s.useRef(a);K.current=a;const z=s.useRef(t);z.current=t,s.useEffect(()=>{Ee.version().then(({version:ge})=>{P.current??(P.current=ge)}).catch(()=>{})},[]),s.useEffect(()=>{T.current=null,R.current=new Set,H.current=0,D.current=new Set,h([]),g([]),w([]),S(G5(u)),C(q5(u))},[u]);const q=s.useCallback(async()=>{var De,Se;let ge,te,J;try{const[{nodes:X,jobs:je,studio:Re=[],boot:re,content:Y},{builds:se}]=await Promise.all([Ee.activity(u),Ee.assetBuilds(u)]);if(y.current.id!==u)return;te=se,J=Re,re&&j.current&&re!==j.current&&(M.current=!0,Ee.version().then(({version:Pe})=>{XY(P.current,Pe)&&location.reload()}).catch(()=>{})),re&&(j.current=re),(De=z.current)==null||De.call(z,u,X),V.current(Y),Y!=null&&Y.arriving&&(X5??(X5=new Date().toISOString()));const Ne=new Map,Be=[];for(const Pe of X)Pe.batchId?Ne.set(Pe.batchId,[...Ne.get(Pe.batchId)??[],Pe]):Be.push(Pe);const st=Date.now();ge=[...Be.map(Pe=>j4(Pe,y.current,st)),...[...Ne.values()].map(Pe=>Bq(Pe,y.current,st)),...je.map(Pe=>Yq(Pe,y.current)),...se.map(Pe=>qq(Pe,y.current)),...Re.map(Pe=>Qq(Pe,y.current)),...Y?[Wq(Y,X5??new Date().toISOString())].filter(Pe=>Pe!==null):[]]}catch{M.current=!0;return}const Q=te.filter(X=>X.finished&&X.assetId&&!D.current.has(X.id)),ae=new Set(te.map(X=>X.id)),$e=b.current.some(X=>!X.finished&&!ae.has(X.id)),ie=J.filter(X=>X.kind==="scene"&&X.status==="done"&&!!X.attachTo&&!D.current.has(X.id));for(const X of ie)D.current.add(X.id);const ke=J.filter(X=>X.kind==="examples"&&(X.done??0)>0).map(X=>`${X.id}:${X.done}`).filter(X=>!D.current.has(X));for(const X of ke)D.current.add(X);if(Q.length||$e||ie.length||ke.length){for(const X of Q)D.current.add(X.id),fq(u,X.kind,X.id);if(await U.current(),y.current.id!==u)return}g(X=>$8(X,te)?X:te),w(X=>$8(X,J)?X:J);const ze=T.current??nX(oX(u),ge),wt=M.current?tX(ze,ge):[];M.current=!1;const Ke=eX(ze,[...ge,...wt]).filter(X=>X.id!==A4?!0:Q5?!1:(Q5=!0,!0));T.current=new Map(ge.map(X=>[X.id,X])),iX(u,ge.filter(X=>X.id!==A4)),H.current=ge.filter(X=>X.state==="running").length;const tt=Jq(ge);if(h(X=>$8(X,tt)?X:tt),Ke.length!==0&&(S(X=>{const je=window.location.pathname,Re=Ke.map(Y=>Y.kind==="library"?Y.state==="done"?{...Y,watched:!0}:Y:N4(Y.id)&&(W5(Y.href,je)||K5(Y,je,u))?{...Y,watched:!0}:I.current&&Y.state!=="error"?{...Y,watched:!0}:Y),re=rX(X,Re);return Y5(u,re),re}),!G.current))for(const X of Ke){if(X.kind==="library"||R.current.has(X.id)||(R.current.add(X.id),X.state==="cancelled"))continue;if(N4(X.id)){const re=window.location.pathname;if(W5(X.href,re)||K5(X,re,u))continue;const Y=X.href,se=Y?[{label:"Open",onClick:()=>_.current(Y)}]:void 0;if(X.state==="error"){K.current({kind:"error",title:`${X.title} did not finish`,detail:X.subtitle,actions:se});continue}if(X.state==="partial"){K.current({kind:"warning",title:X.id.startsWith("examples:")?`Some ${X.title} examples did not draw`:`${X.title} did not fully finish`,detail:X.subtitle,actions:se});continue}K.current({kind:"success",title:X.id.startsWith("examples:")?`${X.title} examples are ready`:X.kind==="scene"&&!X.thumb?`${X.title} is changed`:`${X.title} is drawn`,detail:X.kind==="presenter"?X.subtitle:void 0,actions:se});continue}if(X.state!=="error"&&I.current&&X.kind!=="presenter"&&X.kind!=="scene")continue;const je=X.href,Re=je?{label:"View",onClick:()=>_.current(je)}:void 0;if(X.state==="error"){const re=I.current&&(X.kind==="generation"||X.kind==="edit");K.current({kind:"error",title:`${X.title} failed`,detail:X.subtitle,action:Re,quiet:re});continue}if(X.kind==="presenter"||X.kind==="scene"){const re=X.id.startsWith("build:")?((Se=te.find(se=>`build:${se.id}`===X.id))==null?void 0:Se.assetId)??null:null,Y=Sr(y.current);K.current({kind:"success",title:`${X.title} is ready`,detail:X.subtitle,actions:je?[{label:X.kind==="presenter"?"View person":"View place",onClick:()=>_.current(je)},{label:"Use in a shot",onClick:()=>_.current(`${Y}?${yd(X.kind==="presenter"?"presenter":"scene",re??"")}&compose=1${Ec()}`)}]:void 0});continue}if(X.kind==="catalog"&&X.state==="partial"){K.current({kind:"warning",title:"Some products did not import",detail:X.subtitle,action:Re});continue}K.current({kind:"success",title:X.kind==="catalog"?"Import finished":"Generation finished",detail:X.kind==="catalog"?X.title:void 0,action:Re})}},[u]);s.useEffect(()=>{let ge=null,te=!0,J=0;const Q=async $e=>{if(!te||$e!==J||(document.hidden||await q(),!te||$e!==J))return;const ie=!document.hidden&&H.current>0;ge=setTimeout(()=>void Q($e),ie?lX:cX)},ae=()=>{ge&&clearTimeout(ge),ge=null,J+=1,document.hidden||Q(J)};return B.current=ae,Q(J),document.addEventListener("visibilitychange",ae),window.addEventListener("focus",ae),()=>{te=!1,B.current=null,ge&&clearTimeout(ge),document.removeEventListener("visibilitychange",ae),window.removeEventListener("focus",ae)}},[q]);const Z=s.useCallback(()=>{var ge;return(ge=B.current)==null?void 0:ge.call(B)},[]),ee=s.useCallback(()=>{const ge=new Date().toISOString();C(ge),aX(u,ge)},[u]),he=s.useCallback(()=>{S([]),Y5(u,[]),ee()},[u,ee]),ue=s.useMemo(()=>({tasks:f,running:f.filter(ge=>ge.state==="running").length,builds:p,studio:m,feed:k,unread:sX(k,E),markSeen:ee,clearFeed:he,panelOpen:A,setPanelOpen:L,poke:Z}),[f,p,m,k,E,ee,he,A,Z]);return o.jsx(ZM.Provider,{value:ue,children:n})}const zM=["primary","mark","wordmark","monochrome","alternate"],Ww=["light","dark","any"],Lh={primary:"Primary logo",mark:"Mark",wordmark:"Wordmark",monochrome:"Monochrome",alternate:"Alternate"},dX=/^[a-f0-9]{32}$/,fX=e=>{const t=String(e??"");if(!t.startsWith("asset:"))return null;const n=t.slice(6);return dX.test(n)?n:null},hX=e=>zM.includes(e)?e:"primary",pX=e=>Ww.includes(e)?e:"any";function nf(e){return(Array.isArray(e==null?void 0:e.logos)?e.logos:[]).filter(n=>n&&String(n.file??"").trim()).map(n=>{const r=fX(n.file),a=String(n.clearSpace??"").trim();return{hash:r,file:String(n.file),role:hX(n.role),background:pX(n.background),...a?{clearSpace:a}:{},attachable:r!==null}})}function rf(e){return nf(e).filter(t=>t.attachable)}function qm(e){return e.find(t=>t.role==="primary")??e[0]??null}function mX(e){return qm(nf(e))}function gX(e){const t=nf(e);return t.find(n=>n.role==="mark")??qm(t)}function vX(e){const t=nf(e).filter(a=>a.hash),n=t.find(a=>a.role==="mark");if(n)return{mark:n,square:!0};const r=qm(t);return!r||r.role==="wordmark"?null:{mark:r,square:!1}}const wX=1.6,yX=(e,t)=>t>0&&e/t<=wX;function bX(e,t){const n=(i,l)=>Math.min(l-1,Math.max(0,Math.round(i*(l-1))));return[[n(.5,e),n(.03,t)],[n(.5,e),n(1-.03,t)],[n(.03,e),n(.5,t)],[n(1-.03,e),n(.5,t)],[n(.12,e),n(.12,t)],[n(1-.12,e),n(.12,t)],[n(.12,e),n(1-.12,t)],[n(1-.12,e),n(1-.12,t)]]}const xX=e=>e.length>0&&e.every(t=>t>=200);function Xm(e,t){var a;const n={primary:"logo",mark:"mark",wordmark:"wordmark",monochrome:"monochrome logo",alternate:"alternate logo"},r=String(((a=e==null?void 0:e.meta)==null?void 0:a.name)??"").trim();return r?`${r} ${n[t.role]}`:`Brand ${n[t.role]}`}function Kw(e){const{brand:t}=cn(),{pathname:n}=Bn(),r=!!mn(pt.brand),a=!!mn({path:pt.hub,end:!1}),i=!!mn({path:pt.set,end:!1}),l=a||i,u=!!mn({path:pt.products,end:!1}),f=!!mn({path:pt.scenes,end:!1}),h=!!mn({path:pt.presenters,end:!1}),p=g=>g?"fill":"regular";return[{key:"home",label:"Home",icon:o.jsx(EF,{size:e,weight:p(r)}),active:r,to:To(t)},{key:"create",label:"Create",icon:o.jsx(TF,{size:e,weight:p(l)}),active:l,to:l?`${n}?compose=1`:`${Sr(t)}?compose=1`},{key:"products",label:"Products",icon:o.jsx(gm,{size:e,weight:p(u)}),active:u,to:td(t)},{key:"presenters",label:"People",icon:o.jsx(pm,{size:e,weight:p(h)}),active:h,to:ui(t)},{key:"scenes",label:"Places",icon:o.jsx(hm,{size:e,weight:p(f)}),active:f,to:ml(t)}]}const Ca=e=>{var t,n;return((n=(t=e.json)==null?void 0:t.meta)==null?void 0:n.name)??e.slug};function kX(e){return([...e.trim()].find(n=>new RegExp("\\p{L}|\\p{N}","u").test(n))??"?").toUpperCase()}function SX(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"#ffffff";const[n,r,a]=[0,2,4].map(l=>Number.parseInt(t[1].slice(l,l+2),16)/255),i=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(a)>.42?"#0a0a0a":"#ffffff"}const J5=new Map;function EX(e,t){const n=e.naturalWidth,r=e.naturalHeight,a=t||yX(n,r);let i=!1;try{const l=document.createElement("canvas");l.width=n,l.height=r;const u=l.getContext("2d",{willReadFrequently:!0});u&&(u.drawImage(e,0,0),i=xX(bX(n,r).map(([f,h])=>u.getImageData(f,h,1,1).data[3])))}catch{}return{fits:a,bleed:i}}function BM({brand:e,size:t=20,round:n=!1}){var h,p,g;const[,r]=s.useReducer(m=>m+1,0),a=vX(e.json),i=a?Zm(a.mark.file,"micro"):null,l=i?J5.get(i):void 0,u=i&&(l!=null&&l.fits)?i:null,f=((g=(p=(h=e.json)==null?void 0:h.palette)==null?void 0:p.primary)==null?void 0:g.hex)??"#6b6b6b";return o.jsxs("span",{className:"sc-brand-av","data-logo":u?"":void 0,"data-bleed":u&&(l!=null&&l.bleed)?"":void 0,"data-round":n||void 0,style:{width:t,height:t,fontSize:Math.round(t*.5),...u?{}:{background:f,color:SX(f)}},"aria-hidden":!0,children:[u?o.jsx("img",{src:u,alt:""}):kX(Ca(e)),i&&!l&&o.jsx("img",{src:i,alt:"",hidden:!0,onLoad:m=>{J5.set(i,EX(m.currentTarget,!!(a!=null&&a.square))),r()}})]})}function CX(){const e=Kw(22);return o.jsx("nav",{className:"sc-tabbar","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsxs(Vn,{to:t.to,"data-on":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:[o.jsx("span",{className:"sc-tab-ic",children:t.icon}),o.jsx("span",{className:"sc-tab-lb",children:t.label})]})},t.key))})})}function jX({value:e,size:t,stroke:n=1.5,indeterminate:r=!1}){const a=(t-n)/2,i=2*Math.PI*a,l=Math.max(0,Math.min(1,e)),u=f=>o.jsx("circle",{className:"sc-ring-arc",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n,strokeLinecap:"round",strokeDasharray:f,strokeDashoffset:r?0:i*(1-l),transform:`rotate(-90 ${t/2} ${t/2})`});return o.jsxs("svg",{className:"sc-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[!r&&o.jsx("circle",{className:"sc-ring-track",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n}),r?o.jsx("g",{className:"sc-ring-spin",children:u(`${i*.28} ${i}`)}):null,!r&&l>0?u(String(i)):null]})}function AX({mode:e,lead:t,running:n,unread:r,animate:a}){const i=NX(a);if(e==="busy"&&t){const l=t.percent!==null;return o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-ring","data-bare":t.thumb?void 0:"",children:[o.jsx(jX,{value:l?(t.percent??0)/100:0,indeterminate:!l,size:32}),t.thumb?o.jsx("img",{src:gn(t.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):o.jsx(i8,{size:16}),n>1&&o.jsx("span",{className:"sc-act-n",children:n})]})})}return e==="new"?o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-bell",children:[o.jsx(i8,{size:18}),o.jsx("span",{className:"sc-act-n",children:r>9?"9+":r})]})}):o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsx(i8,{size:18})})}function NX(e){return s.useRef(e).current}const Rp=new Set;let nd=0;const UM=e=>{nd=requestAnimationFrame(UM);for(const t of Rp)t(e/1e3)};function WM(e){Rp.add(e),nd||(nd=requestAnimationFrame(UM))}function KM(e){Rp.delete(e),!Rp.size&&nd&&(cancelAnimationFrame(nd),nd=0)}function MX(e){let t=[0],n=1;for(;n<e;){const r=n*2,a=new Array(r*r);for(let i=0;i<r;i++)for(let l=0;l<r;l++)a[i*r+l]=4*t[i%n*n+l%n]+[0,2,3,1][Math.floor(i/n)*2+Math.floor(l/n)];t=a,n=r}return t}function RX(e,t,n){const r=MX(e).map(i=>(i+.5)/(e*e)),a=new Float32Array(t*n);for(let i=0,l=0;i<n;i++)for(let u=0;u<t;u++,l++)a[l]=r[i%e*e+u%e];return a}function W0(e){const t=getComputedStyle(e),n=ek(t.getPropertyValue("--sc-fg").trim()||"#f5f5f5"),r=ek(t.getPropertyValue("--sc-raised").trim()||"#1a1a1a");return{ink:[0,1,2].map(a=>Math.round(n[a]*.22+r[a]*.78)),ground:r}}const M4=e=>(255<<24|e[2]<<16|e[1]<<8|e[0])>>>0,T8=(e,t,n)=>(.2126*e+.7152*t+.0722*n)/255,h1=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function PX(e){const t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const n=window.matchMedia("(prefers-color-scheme: dark)");return n.addEventListener("change",e),()=>{t.disconnect(),n.removeEventListener("change",e)}}function ek(e){const t=document.createElement("canvas");t.width=t.height=1;const n=t.getContext("2d");if(!n)return[110,110,110];n.fillStyle=e,n.fillRect(0,0,1,1);const r=n.getImageData(0,0,1,1).data;return[r[0],r[1],r[2]]}const Ru=2,LX=8,GM=.55,YM=Math.PI*2,$X=e=>e<0?0:e>1?1:e,qM=e=>e-Math.floor(e),Gw=e=>{const t=$X(e);return t*t*(3-2*t)},Pp=(e,t,n)=>Gw((e-t)/(n-t)),Yw=(e,t)=>4*(.35*e+.8*t)/YM;function TX(e){const t=Math.min(1,Math.max(.3,e/240));return{short:e*t,gain:1+(1-t)*.6}}function XM(e,t){const n=Math.max(4,Math.round(e/Ru)),r=Math.max(4,Math.round(t/Ru)),a=n*Ru,i=r*Ru,{short:l,gain:u}=TX(Math.min(a,i)),f=new Float32Array(n*r),h=new Float64Array(n*r),p=new Float64Array(n*r);for(let g=0,m=0;g<r;g++)for(let w=0;w<n;w++,m++){const y=((w+.5)*Ru-a/2)/l,b=-((g+.5)*Ru-i/2)/l,k=Math.hypot(y,b);f[m]=u*GM*Gw(k**1.2),h[m]=1/Math.max(k,1e-6)**1.2,p[m]=6*Math.atan2(b,y)/YM}return{w:n,h:r,shape:f,curl:h,arm:p,thr:RX(LX,n,r)}}const DX=.6,HX=(e,t)=>t===null?1:Gw((e-t)/DX);function R4(e,t,n,r){const a=e.getContext("2d"),i=M4(t.ink);let l=null,u=null,f=new Uint32Array(0);return{size(h,p){a&&(l=XM(h,p),e.width=l.w,e.height=l.h,u=a.createImageData(l.w,l.h),f=new Uint32Array(u.data.buffer))},draw(h){if(!a||!l||!u)return;const p=HX(h,r),g=Yw(h,n),{shape:m,curl:w,arm:y,thr:b}=l;for(let k=0;k<f.length;k++)f[k]=m[k]*p*qM(w[k]+y[k]+g)>b[k]?i:0;a.putImageData(u,0,0)}}}function QM(e,t,n,r,a){const i=e.getContext("2d"),{w:l,h:u,shape:f,curl:h,arm:p,thr:g}=XM(r,a);e.width=l,e.height=u;const m=document.createElement("canvas");m.width=l,m.height=u;const w=m.getContext("2d",{willReadFrequently:!0});if(!i||!w)return null;w.imageSmoothingQuality="high";const y=Math.max(l/t.naturalWidth,u/t.naturalHeight),b=l/y,k=u/y;w.drawImage(t,(t.naturalWidth-b)/2,(t.naturalHeight-k)/2,b,k,0,0,l,u);const S=w.getImageData(0,0,l,u).data,E=T8(...n.ink)>T8(...n.ground),C=new Float32Array(l*u),A=new Float32Array(l*u);for(let R=0;R<C.length;R++){const H=R*4,D=T8(S[H],S[H+1],S[H+2]);C[R]=GM*(E?D:1-D);const U=C[R]>g[R]?n.ink:n.ground,V=(Math.abs(U[0]-S[H])+Math.abs(U[1]-S[H+1])+Math.abs(U[2]-S[H+2]))/765;A[R]=(1-V+g[R])/2}const L=FX(A),T=M4(n.ink),M=M4(n.ground),j=i.createImageData(l,u),P=new Uint32Array(j.data.buffer);return(R,H,D)=>{for(let U=0;U<P.length;U++){if(L[U]<H){P[U]=0;continue}const V=f[U]*qM(h[U]+p[U]+D);P[U]=V+(C[U]-V)*R>g[U]?T:M}i.putImageData(j,0,0)}}const Lp=900;function OX(e,t,n,r,a,i,l){const u=QM(e,t,n,a,i),f=Lp/1e3;return{ms:Lp,draw(h){const p=Math.min(h,.6);u==null||u(Pp(h,0,.6),Pp(h,.35,1),Yw(l+f*(p-p*p/1.2),r))}}}function IX(e,t,n,r,a,i,l){const u=QM(e,t,n,a,i),f=Lp/1e3;return{ms:Lp,draw(h){const p=Math.max(0,h-.4);u==null||u(1-Pp(h,.4,1),1-Pp(h,0,.65),Yw(l+f-f*(.36-p*p)/1.2,r))}}}function FX(e){const n=l=>Math.min(1023,Math.floor(l*1024)),r=new Uint32Array(1024);for(let l=0;l<e.length;l++)r[n(e[l])]++;const a=new Float64Array(1024);for(let l=1;l<1024;l++)a[l]=a[l-1]+r[l-1];const i=new Float32Array(e.length);for(let l=0;l<e.length;l++){const u=n(e[l]);i[l]=(a[u]+r[u]/2)/e.length}return i}const _X=4;let qi=null;function VX(e,t){var l;const n=performance.now()/1e3,r=qi&&Date.now()-qi.epoch<2500?qi:null;if(e)return r||(qi={perf:n,epoch:Date.now()}),((l=r??qi)==null?void 0:l.perf)??n;if(!t)return null;const a=Ya(t);if(Number.isNaN(a))return null;const i=(Date.now()-a)/1e3;return i>_X?null:qi&&Math.abs(a-qi.epoch)<2500?qi.perf:n-Math.max(0,i)}const $h=new Map;function La({index:e=0,appear:t,since:n,from:r}){const a=s.useRef(null),i=s.useRef(null),[l]=s.useState(()=>VX(t,n)),[u]=s.useState(r),[f,h]=s.useState(()=>!!u&&!h1());return s.useLayoutEffect(()=>{const p=a.current;if(!(p!=null&&p.getContext("2d")))return;const g=h1(),m=i.current,w=u&&(m!=null&&m.complete)&&m.naturalWidth?u:null,y=g||w?null:l;let b=R4(p,W0(p),e,y),k=!0;const S=()=>{const R=p.getBoundingClientRect();R.width<2||R.height<2||(b.size(R.width,R.height),b.draw(performance.now()/1e3))};let E=null,C=0,A=0;const L=()=>{E=null,m&&(m.style.visibility="hidden"),h(!1),S()};if(w&&m){const R=p.getBoundingClientRect(),H=performance.now();for(const[U,V]of $h)H-V>1e4&&$h.delete(U);const D=$h.get(w.at)??H;$h.set(w.at,D),E=IX(p,m,W0(p),e,R.width,R.height,D/1e3),C=H-D,A=H,C<E.ms?E.draw(C/E.ms):L()}else m?L():S();const T=R=>{if(E){const H=R*1e3;C+=Math.min(50,Math.max(0,H-A)),A=H,C<E.ms?E.draw(C/E.ms):L()}else k&&b.draw(R)},M=new ResizeObserver(()=>{E||S()});M.observe(p);const j=new IntersectionObserver(([R])=>{k=R.isIntersecting});j.observe(p);const P=PX(()=>{b=R4(p,W0(p),e,y),E||S()});return g||WM(T),()=>{KM(T),M.disconnect(),j.disconnect(),P()}},[e,l,u]),o.jsxs("span",{className:"sc-rendering","aria-hidden":!0,children:[f&&u&&o.jsx("img",{ref:i,className:"sc-rendering-from",src:u.src,alt:"",decoding:"sync"}),o.jsx("canvas",{ref:a,className:"sc-swirl"})]})}function tk({onClose:e,onSeen:t,onOpenDetail:n}){const{tasks:r,feed:a,unread:i,clearFeed:l}=ia(),u=r.filter(S=>S.state==="running"),{brand:f}=cn(),{push:h}=rr(),p=BX(1e3),g=s.useRef(null),m=s.useRef(null),w=s.useRef(!1);s.useEffect(()=>{var S;!w.current||a.length>0||(w.current=!1,(S=g.current)==null||S.focus({preventScroll:!0}))},[a.length]);const y=()=>{w.current=!0,l()},b=S=>{var E;S.detail===0&&((E=m.current)==null||E.focus({preventScroll:!0})),t()},k=S=>{if(S.startsWith("node:")){Ee.cancelNode(S.slice(5)).catch(E=>h(ln(E,"Could not cancel this shot")));return}if(S.startsWith("build:")){Ee.cancelAssetBuild(f.id,S.slice(6)).catch(E=>h(ln(E,"Could not stop this build")));return}if(S.startsWith("scene:")){Ee.cancelSceneStudioJob(f.id,S.slice(6)).catch(E=>h(ln(E,"Could not stop this place")));return}if(S.startsWith("presenter:")){const E=S.split(":")[1]??"";Ee.stopDraft(f.id,E).catch(C=>h(ln(C,"Could not stop this person")));return}S.startsWith("catalog:")&&Ee.cancelCatalogJob(f.id,S.slice(8)).catch(E=>h(ln(E,"Could not stop this import")))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-head",children:"Activity"}),u.length>0&&o.jsxs("section",{"aria-label":"In progress",children:[o.jsx("h3",{className:"sc-notif-label",children:"In progress"}),u.map(S=>o.jsx(ZX,{task:S,now:p,onNavigate:e,onCancel:k,onOpenDetail:n},S.id))]}),a.length===0&&u.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsxs("section",{"aria-label":"Notifications",children:[o.jsxs("div",{className:"sc-notif-label",children:[o.jsx("h3",{children:"Notifications"}),a.length>0&&o.jsxs("span",{className:"sc-notif-acts",children:[i>0&&o.jsx("button",{type:"button",className:"sc-notif-seen",onClick:b,children:"Mark all read"}),o.jsx("button",{ref:m,type:"button",className:"sc-notif-clear",onClick:y,children:"Clear all"})]})]}),a.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsx("div",{className:"sc-notif-scroll",children:a.map(S=>o.jsx(zX,{item:S,now:p,onNavigate:e,onSeen:t},S.id))})]})]})}function JM({task:e}){return e.thumb?o.jsx("img",{src:gn(e.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):e.state==="running"?e.kind==="catalog"||e.kind==="library"?o.jsx("span",{className:"sc-placeholder"}):o.jsx(La,{}):e.state==="error"?o.jsx(zc,{size:17,weight:"fill"}):e.state==="cancelled"?o.jsx(_F,{size:17,color:"var(--sc-fg3)"}):e.kind==="catalog"?o.jsx(bC,{size:17}):e.kind==="library"?o.jsx(jF,{size:17}):e.kind==="presenter"?o.jsx(pm,{size:17}):e.kind==="scene"?o.jsx(hm,{size:17}):o.jsx(Da,{size:17})}function ZX({task:e,now:t,onNavigate:n,onCancel:r,onOpenDetail:a}){const i=e.state==="running",l=e.id.startsWith("node:")||e.id.startsWith("build:")||e.id.startsWith("catalog:"),u=i&&e.id.startsWith("catalog:")?e.id.slice(8):null,f=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(JM,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle}),i&&e.percent!==null?o.jsx("span",{className:"sc-notif-meter",role:"progressbar","aria-label":e.title,"aria-valuenow":e.percent,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${e.percent}%`}})}):null]}),o.jsx("span",{className:"sc-notif-time",children:i?Dc(e.startedAt,t):TM(e.startedAt,t)})]});return o.jsxs("div",{className:"sc-notif-row-wrap",children:[u?o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,onClick:()=>a(u),children:f}):e.href?o.jsx(Vn,{className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,to:e.href,onClick:n,children:f}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,disabled:!0,children:f}),i&&l&&o.jsx("button",{type:"button",className:"sc-notif-row-cancel",onClick:h=>{h.stopPropagation(),r(e.id)},children:"Cancel"})]})}function zX({item:e,now:t,onNavigate:n,onSeen:r}){const a=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(JM,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle})]}),o.jsx("span",{className:"sc-notif-time",children:TM(e.at,t)})]});return e.href?o.jsx(Vn,{className:"sc-notif-row","data-state":e.state,to:e.href,onClick:()=>{r(),n()},children:a}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,disabled:!0,children:a})}function BX(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function Td(e){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(0),a=u=>{u.pointerType==="mouse"&&u.button!==0||(n.current={y:u.clientY,t:u.timeStamp},r.current=0,t.current&&(t.current.style.transition="none"),u.currentTarget.setPointerCapture(u.pointerId))},i=u=>{!n.current||!t.current||(r.current=Math.max(0,u.clientY-n.current.y),t.current.style.transform=`translateY(${r.current}px)`)},l=u=>{const f=n.current;if(n.current=null,!f||!t.current)return;t.current.style.transition="";const h=r.current/Math.max(1,u.timeStamp-f.t);if(r.current>96||h>.45){e();return}t.current.style.transform=""};return{sheet:t,grip:{onPointerDown:a,onPointerMove:i,onPointerUp:l,onPointerCancel:l}}}function eR({label:e,onClose:t,children:n}){const{sheet:r,grip:a}=Td(t);return s.useEffect(()=>{const i=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),Br.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-notif-scrim",onClick:t,"aria-hidden":!0}),o.jsxs("div",{ref:r,className:"sc-notif-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[o.jsx("div",{className:"sc-shotsheet-grip",...a,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),n]})]}),document.body)}function tR(e,t){const{pathname:n}=Bn(),r=s.useRef(t);r.current=t,s.useEffect(()=>{r.current()},[n]),s.useEffect(()=>{if(!e)return;const a=()=>r.current();return window.addEventListener("scenri:modal-open",a),()=>window.removeEventListener("scenri:modal-open",a)},[e])}const UX=new Set(["Shift","Control","Alt","AltGraph","Meta","CapsLock","Fn","FnLock","Hyper","Super","OS"]);let $p=null;function nk(e){$p!==e&&($p=e,document.documentElement.dataset.input=e)}function WX(){const e=n=>{n.isComposing||n.key==="Unidentified"||UX.has(n.key)||nk("keyboard")},t=()=>nk("pointer");return window.addEventListener("keydown",e,!0),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("keydown",e,!0),window.removeEventListener("pointerdown",t,!0)}}function KX(){return $p}function Qm(e){return $p!=="pointer"&&e.matches(":focus-visible")}function hr({label:e,open:t,children:n}){return o.jsx($w,{content:e,className:"sc-tip",maxWidth:"220px",...t?{open:!0}:{},children:rR(n)})}function nR(e,t,n){return n?t:o.jsx(hr,{label:e,children:t})}function rR(e){const t=e.props.onFocus;return s.cloneElement(e,{onFocus:n=>{t==null||t(n),KX()==="pointer"&&n.preventDefault()}})}function Ws({open:e=!0,className:t,maxWidth:n,described:r,children:a,onDismiss:i,onOpenAutoFocus:l,onCloseAutoFocus:u,onPaste:f,tone:h}){const{sheet:p,grip:g}=Td(i);s.useEffect(()=>{e&&window.dispatchEvent(new CustomEvent("scenri:modal-open"))},[e]);const m=l??iM,w=u;return o.jsx(Rl,{open:e,onOpenChange:y=>!y&&i(),children:o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-newdlg-scrim","data-tone":h}),o.jsx($l,{className:"sc-newdlg-layer",...r?{}:{"aria-describedby":void 0},onOpenAutoFocus:m,onCloseAutoFocus:w,onPaste:f,onPointerDown:y=>{y.target===y.currentTarget&&i()},children:o.jsxs("div",{ref:p,className:["sc-newdlg",t].filter(Boolean).join(" "),style:n?{"--sc-newdlg-max":n}:void 0,children:[o.jsx("div",{className:"sc-shotsheet-grip",...g,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),a]})})]})})}function Ns({className:e,children:t}){return o.jsx(Tl,{className:e,children:t})}const Ms=s.forwardRef(function({children:t,...n},r){return o.jsx(O1,{asChild:!0,ref:r,...n,children:t})});function Hc({className:e,asChild:t,children:n}){return o.jsx(Kv,{className:e,asChild:t,children:n})}const rk=300,GX={queued:"Waiting to start",discovering:"Looking through the site",fetching_products:"Reading products",processing_assets:"Saving pictures",completed:"Finished",partial:"Finished, with some gaps",no_catalog:"No shop on this site",cancelled:"Stopped",failed:"Could not finish"};function P4({brandId:e,jobId:t,onDismiss:n}){const[r,a]=s.useState(null),[i,l]=s.useState(!1);s.useEffect(()=>{let g=!1,m;const w=async()=>{try{const y=await Ee.catalogJob(e,t);if(g)return;a(y),y.finishedAt||(m=setTimeout(w,rk))}catch{g||(m=setTimeout(w,rk*3))}};return w(),()=>{g=!0,m&&clearTimeout(m)}},[e,t]);const u=!!r&&!r.finishedAt,f=r?DM(r):0,h=(r==null?void 0:r.errors)??[],p=async()=>{l(!0);try{await Ee.cancelCatalogJob(e,t)}catch{l(!1)}};return o.jsxs(Ws,{open:!0,className:"sc-imp",maxWidth:"440px",described:!0,onDismiss:n,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Importing products"}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(Hc,{className:"sc-imp-sub",children:o.jsxs("span",{role:"status",children:[r?GX[r.stage]??"Working":"Getting the details",r!=null&&r.message?` · ${r.message}`:""]})}),u&&o.jsx("span",{className:"sc-imp-meter",role:"progressbar","aria-label":"Import progress","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${f}%`}})}),o.jsxs("ul",{className:"sc-imp-lines",children:[o.jsxs("li",{children:[o.jsx("span",{children:"Found on the site"}),o.jsx("b",{children:((r==null?void 0:r.discovered)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Read"}),o.jsx("b",{children:((r==null?void 0:r.fetched)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Saved"}),o.jsx("b",{children:((r==null?void 0:r.upserted)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Pictures"}),o.jsxs("b",{children:[((r==null?void 0:r.imagesDone)??0).toLocaleString(),r!=null&&r.imagesTotal?` of ${r.imagesTotal.toLocaleString()}`:""]})]})]}),h.length>0&&o.jsxs("details",{className:"sc-imp-errs",children:[o.jsx("summary",{children:h.length===1?"1 thing went wrong":`${h.length} things went wrong`}),o.jsx("ul",{children:h.slice(0,8).map((g,m)=>o.jsx("li",{children:g.message},m))})]}),o.jsxs("div",{className:"sc-imp-foot",children:[u?o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void p(),disabled:i,children:i?"Stopping":"Stop importing"}):o.jsx("span",{className:"sc-imp-done",children:(r==null?void 0:r.stage)==="cancelled"?"Stopped. What was already imported is kept.":"Nothing left to do."}),o.jsx("button",{type:"button",className:"sc-wiz-cta",onClick:n,children:u?"Leave it running":"Close"})]})]})}const la="(max-width: 767px)";function Nr(e){const[t,n]=s.useState(()=>window.matchMedia(e).matches);return s.useEffect(()=>{const r=window.matchMedia(e),a=()=>n(r.matches);return a(),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[e]),t}const sk=new Map;function YX(e){let t=sk.get(e);if(!t){const n=window.matchMedia(e);t={mq:n,subscribe:r=>(n.addEventListener("change",r),()=>n.removeEventListener("change",r))},sk.set(e,t)}return t}function qw(){const e=YX("(hover: none)");return s.useSyncExternalStore(e.subscribe,()=>e.mq.matches,()=>!1)}function qX(){const{tasks:e,running:t,unread:n,panelOpen:r,setPanelOpen:a,markSeen:i}=ia(),{brand:l}=cn(),u=Nr(la),f=XX(),[h,p]=s.useState(null);s.useEffect(()=>p(null),[l.id]),tR(r,()=>a(!1));const g=Gq(e),m=t>0?"busy":n>0?"new":"quiet",w="Activity"+(n?`, ${n} unread`:"")+(t?`, ${t} task${t===1?"":"s"} running`:""),y=m==="busy"&&g?`${Kq(g.kind)}, ${Dc(g.startedAt,Date.now())}`:"Activity",b=o.jsx(AX,{mode:m,lead:g,running:t,unread:n,animate:f});return u?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":m,"data-on":r||void 0,"aria-label":w,"aria-expanded":r,onClick:()=>a(!r),children:b}),r?o.jsx(eR,{label:"Activity",onClose:()=>a(!1),children:o.jsx(tk,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})}):null,h?o.jsx(P4,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]}):o.jsxs(o.Fragment,{children:[o.jsxs(gd,{open:r,onOpenChange:a,children:[o.jsx(hr,{label:y,children:o.jsx(vd,{children:o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":m,"aria-label":w,children:b})})}),o.jsx(wd,{align:"end",sideOffset:20,className:"sc-notif-pop","aria-label":"Activity",children:o.jsx(tk,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})})]}),h?o.jsx(P4,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]})}function XX(){const[e,t]=s.useState(!1),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,t(!0))},[]),e}function QX(){const e=Kw(16);return o.jsx("nav",{className:"sc-nav sc-desktop-only","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsx(Vn,{to:t.to,"data-active":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:t.label})},t.key))})})}const L4=s.createContext(null);function sR({label:e,className:t,offset:n=22,trigger:r,children:a}){const i=Nr(la),[l,u]=s.useState(!1),f=s.useRef(null),h=()=>u(!1),p=s.useCallback(()=>{var g;return(g=f.current)==null?void 0:g.focus({preventScroll:!0})},[]);return tR(l,h),i?o.jsxs(o.Fragment,{children:[s.cloneElement(r,{ref:f,onClick:()=>u(!l),"aria-haspopup":"dialog","aria-expanded":l,"data-on":l||void 0}),l&&o.jsx(eR,{label:e,onClose:h,children:o.jsxs("div",{className:"sc-menu-sheet",children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(L4.Provider,{value:{close:h,focusTrigger:p},children:a})]})})]}):o.jsxs(Cs,{open:l,onOpenChange:u,modal:!1,children:[o.jsx(js,{children:s.cloneElement(r,{ref:f})}),o.jsxs(As,{align:"end",sideOffset:n,className:`sc-menu ${t??""}`,onPointerDownOutside:g=>{var m;(m=f.current)!=null&&m.contains(g.target)&&g.preventDefault()},onCloseAutoFocus:g=>{g.preventDefault();const m=document.activeElement;(!m||m===document.body)&&p()},children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(L4.Provider,{value:{close:null,focusTrigger:p},children:a})]})]})}function rd({className:e="sc-menu-item",to:t,onSelect:n,disabled:r,children:a,...i}){const l=s.useContext(L4),u=l==null?void 0:l.close,f=n?()=>{l==null||l.focusTrigger(),setTimeout(()=>{l==null||l.focusTrigger(),n()},0)}:void 0;if(u){const h=()=>{u(),f==null||f()};return t?o.jsx(Vn,{className:e,to:t,onClick:u,...i,children:a}):o.jsx("button",{type:"button",className:e,onClick:h,disabled:r,...i,children:a})}return t?o.jsx(Wn,{asChild:!0,className:e,...i,children:o.jsx(Vn,{to:t,children:a})}):o.jsx(Wn,{className:e,onSelect:f,disabled:r,...i,children:a})}function aR(e,t){return[...e].sort((n,r)=>t(n).localeCompare(t(r),void 0,{sensitivity:"base"})||n.slug.localeCompare(r.slug))}function JX(e,t,n){const r=t.trim().toLowerCase(),a=r?e.filter(i=>n(i).toLowerCase().includes(r)||i.slug.toLowerCase().includes(r)):e;return aR(a,n)}function Xn({label:e,title:t,body:n,busy:r,onConfirm:a,fullWidth:i,open:l,onOpenChange:u,tone:f="red"}){const h=s.useRef(!1);s.useEffect(()=>{h.current=!1},[l]);const p=()=>{h.current||(h.current=!0,a())},g=s.useRef(null),m=l!==void 0;return o.jsxs(B1,{open:l,onOpenChange:w=>{w&&(h.current=!1),u==null||u(w)},children:[l===void 0&&o.jsx(xN,{children:o.jsx("button",{type:"button",className:f==="red"?"sc-btn sc-btn-ghost sc-btn-red":"sc-btn sc-btn-ghost",disabled:r,style:i?{width:"100%"}:void 0,children:e})}),o.jsxs(U1,{maxWidth:"420px",onOpenAutoFocus:()=>{m&&(g.current=document.activeElement)},onCloseAutoFocus:w=>{var y;!m||!((y=g.current)!=null&&y.isConnected)||(w.preventDefault(),g.current.focus())},children:[o.jsx(W1,{children:t}),o.jsx(K1,{size:"2",children:n}),o.jsxs(Vs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Y1,{children:o.jsx(Sa,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(G1,{children:o.jsx(Sa,{color:"red",onClick:p,disabled:r,children:e})})]})]})]})}function eQ(){const{brand:e}=cn(),t=_l(),n=Un(),r=Wm(),{push:a}=rr(),[i,l]=s.useState(!1),u=async()=>{const f=await r.quit();f.kind==="refused"&&a({kind:"warning",title:"Scenri is still working",detail:f.reason}),f.kind==="still-running"&&a({kind:"error",title:"Scenri did not shut down",detail:"It is still running. Try again in a moment."})};return o.jsxs(o.Fragment,{children:[o.jsxs(sR,{label:"Brands",className:"sc-menu-brand",trigger:o.jsx("button",{type:"button",className:"sc-org-btn","aria-label":`${Ca(e)}, brand and settings`,children:o.jsx(BM,{brand:e,size:32,round:!0})}),children:[o.jsx(nQ,{}),o.jsx("div",{className:"sc-menu-rule"}),o.jsxs(rd,{onSelect:()=>n("/setup"),children:[o.jsx(mr,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up a brand"})]}),o.jsxs(rd,{onSelect:()=>t(),children:[o.jsx(wF,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Settings"})]}),r.thisComputer&&o.jsxs(rd,{"data-quit":"",onSelect:()=>l(!0),children:[o.jsx(fC,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Shut down Scenri"})]})]}),o.jsx(Xn,{open:i,onOpenChange:l,label:"Shut down Scenri",title:"Shut down Scenri?",body:"This stops the Scenri server on this machine. Every open tab loses the studio until you start it again, from your desktop icon or with npx scenri.",busy:r.busy!=="idle",onConfirm:()=>void u()})]})}const tQ=7;function nQ(){const{brands:e}=Mn(),{brand:t}=cn(),n=Un(),[r,a]=s.useState(""),i=m=>Ca(m).trim().toLowerCase(),l=new Map;for(const m of e)l.set(i(m),(l.get(i(m))??0)+1);const u=e.length>=tQ,f=r.trim(),h=u&&f?JX(e,f,Ca):[],p=m=>{const w=m.id===t.id,y=(l.get(i(m))??0)>1;return o.jsxs(rd,{"data-current":w||void 0,"data-two-line":y||void 0,onSelect:w?void 0:()=>n(To(m)),children:[o.jsx(BM,{brand:m,size:20,round:!0}),o.jsxs("span",{className:"sc-menu-brand-lb",children:[o.jsx("span",{dir:"auto",children:Ca(m)}),y&&o.jsxs("span",{className:"sc-menu-brand-sub",children:["/",m.slug]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Gn,{size:14,className:"sc-menu-check","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", current brand"})]})]},m.id)},g=aR(e.filter(m=>m.id!==t.id),Ca);return u?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"sc-menu-find",children:[o.jsx(hd,{size:16,"aria-hidden":"true"}),o.jsx("input",{type:"search",value:r,placeholder:"Find a brand","aria-label":"Find a brand",onChange:m=>a(m.target.value),onKeyDown:m=>{const w=h.find(y=>y.id!==t.id);m.key!=="Enter"||!w||(m.preventDefault(),n(To(w)))}})]}),o.jsx("div",{className:"sc-menu-brands",children:f?h.length>0?h.map(p):o.jsx("p",{className:"sc-menu-none",children:"No brand by that name."}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})})]}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})}function rQ(){const e=Nr("(min-width: 1024px)"),t=oM(),[n]=Al();return e?o.jsx("button",{type:"button",className:"sc-learn-btn","aria-haspopup":"dialog","data-on":n.has("learn")||void 0,onClick:()=>t(),children:"Learn"}):null}function ki(e){var n;if(e.avatarUrl)return{src:e.avatarUrl};const t=e.previewUrl??((n=e.shots)==null?void 0:n[0])??null;return t?{src:t,crop:"top"}:{src:null}}function Xw(e){const t=Jr(e.avatar);if(t)return{src:t};const n=a=>{var i;return Array.isArray(a)?Jr((i=a[0])==null?void 0:i.file):null},r=Jr(e.preview)??n(e.shots)??n(e.sourceRefs);return r?{src:r,crop:"top"}:{src:null}}const oR=["hero","close","hands","angle","bold"],$4=e=>Array.isArray(e)?e.map(t=>Jr(t==null?void 0:t.file)).filter(t=>!!t):[],Qw=e=>{var t;return(((t=e==null?void 0:e.json)==null?void 0:t.characters)??[]).filter(n=>(n==null?void 0:n.origin)==="custom")};function p1(e){return e.length<2?[...e]:e.slice().reverse()}function iR(e){const t=e.filter(n=>n.origin!=="catalog");return t.length===e.length?p1(e):[...p1(t),...e.filter(n=>n.origin==="catalog")]}function sf(e){return p1(Qw(e).filter(t=>!t.supersededBy).map(lR))}function sQ(e,t){const n=Qw(e).find(r=>r.id===t);return n?lR(n):void 0}function Jw(e,t){var i;const n=Qw(e),r=new Set([t]);let a=t;for(;;){const l=(i=n.find(u=>u.id===a))==null?void 0:i.supersededBy;if(typeof l!="string"||!l||r.has(l)||!n.some(u=>u.id===l))return a;r.add(l),a=l}}function lR(e){var a;const t=$4(e.shots),n=$4(e.sourceRefs),r=Jr(e.preview)??t[0]??n[0]??null;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,presentation:e.presentation==="man"?"man":"woman",descriptor:String(e.descriptor??""),ageRange:String(e.ageRange??""),hair:String(e.hair??""),identityNotes:String(e.identityNotes??""),negativeConstraints:Array.isArray(e.negativeConstraints)?e.negativeConstraints.map(String):[],facial:String(e.facial??""),skin:String(e.skin??""),build:String(e.build??""),wardrobeDefault:"",suitableCategories:Array.isArray(e.suitableCategories)?e.suitableCategories.map(String):[],suitableStyles:[],width:1024,height:1280,previewUrl:r,avatarUrl:Jr(e.avatar),custom:!0,shots:t,sourceRefs:n,identityEdits:Array.isArray(e.identityEdits)?e.identityEdits.map(String):[],...e.revisionOf?{revisionOf:String(e.revisionOf)}:{},...e.supersededBy?{supersededBy:String(e.supersededBy)}:{},...e.source==="synthetic"||e.source==="photos"?{source:e.source}:{},...(a=e.likeness)!=null&&a.attestedAt?{likeness:{attestedAt:String(e.likeness.attestedAt),version:String(e.likeness.version??"v1")}}:{}}}function Qc(e){var n;const t=((n=e==null?void 0:e.json)==null?void 0:n.scenes)??[];return p1(t.map(oQ))}function m1(e,t){return Qc(e).find(n=>n.id===t)}const aQ=["place",...oR];function oQ(e){var l;const t=$4(e.refs),n=Jr(e.preview)??null,r=Array.isArray(e.examples)?e.examples.filter(u=>oR.includes(u==null?void 0:u.role)&&Jr(u==null?void 0:u.file)).map(u=>({role:u.role,url:Jr(u.file),hash:String(u.file).slice(6),earlier:u.from!==e.preview,with:u.presenter?"presenter":"product",...u.setup?{setup:String(u.setup)}:{}})):void 0,a=aQ.includes(e.cover)?e.cover:void 0,i=a&&a!=="place"?(l=r==null?void 0:r.find(u=>u.role===a&&!u.earlier))==null?void 0:l.url:void 0;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,description:String(e.description??""),lighting:String(e.lighting??""),subject:e.subject==="product"||e.subject==="person"?e.subject:"either",collections:Array.isArray(e.collections)?e.collections.map(String):[],verticals:Array.isArray(e.verticals)?e.verticals.map(String):[],keywords:Array.isArray(e.keywords)?e.keywords.map(String):void 0,prompt:String(e.prompt??""),width:Number(e.width)||1024,height:Number(e.height)||1280,previewUrl:i??n,placeUrl:n,...a?{cover:a}:{},previewColor:null,custom:!0,refs:t,previewHash:/^asset:[a-f0-9]{32}$/.test(String(e.preview??""))?String(e.preview).slice(6):null,...e.anchor===!0?{anchor:!0}:{},instruction:e.instruction?String(e.instruction):void 0,camera:e.camera?String(e.camera):void 0,figure:e.figure?String(e.figure):void 0,figureTreatment:e.figureTreatment?String(e.figureTreatment):void 0,setups:Array.isArray(e.setups)?e.setups.filter(u=>(u==null?void 0:u.id)&&(u==null?void 0:u.label)&&(u==null?void 0:u.camera)).map(u=>({id:String(u.id),label:String(u.label),camera:String(u.camera)})):void 0,examples:r}}function iQ(e){const t=e.cover;return!t||t==="place"?"place":!e.examples||e.examples.some(n=>n.role===t&&!n.earlier)?t:"place"}function Tp(e,t){const n=new Set(e.map(r=>r.id));return[...e,...t.filter(r=>!n.has(r.id))]}function op(e,t){return t.map(n=>n.t==="character"&&n.id?{...n,id:Jw(e,n.id)}:n)}function cR(){const{brand:e,products:t}=cn(),{scenes:n,presenters:r,demoProducts:a,showcase:i}=Mn();return s.useMemo(()=>{const l={presenters:sf(e),scenes:Qc(e)},u=new Set,f=y=>!y||u.has(y)?null:(u.add(y),y),h=(y,b)=>{for(const k of y){const S=f(b(k));if(S)return $n(S,"tile")}return null},p=y=>h(i.filter(b=>{var k;return(((k=b.brief)==null?void 0:k.tokens)??[]).some(S=>(S==null?void 0:S.t)===y)}),b=>b.previewUrl),g=h([...t].reverse(),y=>{var b,k;return Jr((k=(b=y==null?void 0:y.shots)==null?void 0:b[0])==null?void 0:k.file)}),m=h(l.presenters,y=>y.previewUrl??ki(y).src),w=h(l.scenes,y=>y.previewUrl);return{product:{url:g??p("product")??h(a,y=>y.previewUrl)??null,count:t.length,own:!!g},presenter:{url:m??p("character")??h(r,y=>y.previewUrl??ki(y).src)??null,count:l.presenters.length,own:!!m},scene:{url:w??h(n,y=>y.previewUrl)??p("template")??null,count:l.scenes.length,own:!!w}}},[e,t,n,r,a,i])}const lQ=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",nouns:"products",icon:gm},{kind:"presenter",label:"Person",line:"Who appears in the shot",noun:"person",nouns:"people",icon:pm},{kind:"scene",label:"Place",line:"Where it happens, and its light",noun:"place",nouns:"places",icon:hm}],ak=(e,t,n)=>e===0?"None yet":`${e} ${e===1?t:n}`;function cQ({suggest:e,onPick:t}){const n=s.useRef(null),{close:r}=jr("new"),a=cR(),i=()=>{var l,u;(u=(l=n.current)==null?void 0:l.querySelector(e?`[data-kind="${e}"]`:"[data-kind]"))==null||u.focus()};return s.useEffect(i,[e]),o.jsxs(Ws,{className:"sc-newpick",maxWidth:"620px",onDismiss:r,onOpenAutoFocus:l=>{l.preventDefault(),i()},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Add to this brand"}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx("p",{className:"sc-newdlg-sub",children:"The three things every shot is made from."}),o.jsx("div",{className:"sc-newdlg-body",children:o.jsx("div",{className:"sc-pickgrid",ref:n,children:lQ.map(({kind:l,label:u,line:f,noun:h,nouns:p,icon:g})=>{const{url:m,count:w,own:y}=a[l];return o.jsxs("button",{type:"button",className:"sc-pick","data-kind":l,onClick:()=>t(l),"aria-label":`${u}. ${f}. ${ak(w,h,p)}.`,children:[o.jsxs("span",{className:"sc-pick-media",children:[m?o.jsx("img",{src:m,alt:"",loading:"lazy"}):o.jsx("span",{className:"sc-pick-blank",children:o.jsx(g,{size:22})}),y&&o.jsx("span",{className:"sc-pick-mine",children:"Yours"})]}),o.jsxs("span",{className:"sc-pick-cap",children:[o.jsx("b",{children:u}),o.jsx("small",{children:f})]}),o.jsx("span",{className:"sc-pick-count",children:ak(w,h,p)})]},l)})})})]})}const sd=14,uQ=768,Si=[{px:190,label:"Compact",cells:3,cols:6,min:200},{px:320,label:"Large",cells:2,cols:5,min:280}];function dQ(e){let t=Si[0];for(const n of Si)Math.abs(n.px-e)<Math.abs(t.px-e)&&(t=n);return t}const uR=320;function dR(e){const t=typeof e=="number"&&Number.isFinite(e)?e:uR;let n=Si[0].px;for(const r of Si)Math.abs(r.px-t)<Math.abs(n-t)&&(n=r.px);return n}const bd=5;function Jc(e){const t=typeof e=="number"?e:bd;return t===7||t===5?t:t===6?5:bd}const fQ={5:8,7:14};function hQ(e){const[t,n]=s.useState(0);return s.useLayoutEffect(()=>{if(!e)return;const r=e.clientWidth;n(a=>a===r?a:r)}),s.useLayoutEffect(()=>{if(!e)return;const r=()=>{const i=e.clientWidth;n(l=>l===i?l:i)};r();const a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}function pQ(){const[e,t]=s.useState(()=>window.innerWidth);return s.useEffect(()=>{let n=0;const r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>t(window.innerWidth))};return window.addEventListener("resize",r),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r)}},[]),e}function D8(e,t){return Math.max(1,Math.floor((e-sd*(t-1))/t))}function mQ(e,t,n){if(e<=0)return{tile:t,cols:1};if(n)return{tile:Math.floor((e-sd)/2),cols:2};const r=Si[1],a=Si[0],i=Math.min(r.cols,Math.max(1,Math.floor((e+sd)/(r.min+sd))));if(dQ(t).px===r.px)return{tile:D8(e,i),cols:i};let l=Math.min(a.cols,i+1);return l>1&&D8(e,l)<a.min&&(l=i),{tile:D8(e,l),cols:l}}function ok(e){return Math.max(1,e)}function Jm(e){return Jc(e)===5?"large":"compact"}const af=s.createContext("large");function fR(){return s.useContext(af)}const gQ=[{value:7,label:"Compact",hint:"More cards per row",cells:3},{value:5,label:"Large",hint:"Fewer, larger cards",cells:2}],vQ=Si.map(e=>({value:e.px,label:e.label,hint:e.label==="Compact"?"More shots per row":"Fewer, larger shots",cells:e.cells}));function e2({value:e,onChange:t}){return o.jsx(hR,{label:"Grid size",value:Jc(e),options:gQ,onChange:n=>t(n)})}function wQ({value:e,onChange:t}){return o.jsx(hR,{label:"Shot size",value:dR(e),options:vQ,onChange:t})}function hR({label:e,value:t,options:n,onChange:r}){const a=s.useRef(null);return s.useLayoutEffect(()=>{const i=a.current;if(!i)return;const l=()=>{const f=i.querySelector(":scope > button[data-on]");if(!f){i.style.setProperty("--sc-density-x","0px"),i.style.setProperty("--sc-density-w","0px");return}i.style.setProperty("--sc-density-x",`${f.offsetLeft}px`),i.style.setProperty("--sc-density-w",`${f.offsetWidth}px`)};l(),i.dataset.inkReady||requestAnimationFrame(()=>{i.dataset.inkReady=""});const u=new ResizeObserver(l);return u.observe(i),()=>u.disconnect()},[t]),o.jsxs("div",{ref:a,className:"sc-density",role:"radiogroup","aria-label":e,children:[o.jsx("span",{className:"sc-density-ink","aria-hidden":!0}),n.map(i=>{const l=t===i.value;return o.jsx("button",{type:"button",role:"radio",className:"sc-density-opt","aria-checked":l,"aria-label":i.label,title:i.hint,"data-on":l||void 0,onClick:()=>{l||r(i.value)},children:o.jsx(yQ,{cells:i.cells})},i.value)})]})}function yQ({cells:e}){const t=e,n=16,r=1.5,a=1.5,l=(n-r*2-a*(t-1))/t,u=Math.max(.6,l*.22),f=[];for(let h=0;h<t;h++)for(let p=0;p<t;p++)f.push({x:r+p*(l+a),y:r+h*(l+a)});return o.jsx("svg",{className:"sc-density-icon",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:f.map(h=>o.jsx("rect",{x:h.x,y:h.y,width:l,height:l,rx:u,ry:u,fill:"currentColor"},`${h.x}-${h.y}`))})}function t2(e){const t=Jc(e),n=(t===5?Si[1]:Si[0]).min;return{"--sc-wall-cols":String(t),"--sc-tile-min":`${n}px`}}function ad({name:e}){const t={size:14,"aria-hidden":!0};switch(e){case"open":return o.jsx(DE,{...t});case"continue":return o.jsx(xa,{...t});case"open-tab":return o.jsx(Ac,{...t});case"refine":return o.jsx(GE,{...t});case"select":return o.jsx(Gn,{...t,weight:"bold"});case"keep":return o.jsx(eo,{...t});case"kept":return o.jsx(eo,{...t,weight:"fill"});case"unset":return o.jsx($E,{...t});case"versions":return o.jsx(vC,{...t});case"archive":return o.jsx(fm,{...t});case"restore":return o.jsx(t1,{...t});case"delete":case"discard":return o.jsx(Ml,{...t});case"use":return o.jsx(mr,{...t});case"duplicate":return o.jsx(gp,{...t});case"rename":return o.jsx($F,{...t});case"edit":return o.jsx(Ad,{...t});case"cover":return o.jsx(CF,{...t})}}const pR=new Set;function T4(e){return pR.has(e)}function D4(e){e&&pR.add(e)}function ja({src:e,srcSet:t,sizes:n=BN.large,crop:r,wait:a,blank:i="sc-lookpage-ref-blank",keep:l}){const[u,f]=s.useState({src:e,srcSet:t}),h=!!l&&u.src!==e&&T4(u.src);s.useEffect(()=>{if(!h){f(M=>M.src===e&&M.srcSet===t?M:{src:e,srcSet:t});return}let L=!0;const T=new Image;return t&&(T.sizes=n,T.srcset=t),T.src=e,T.decode().catch(()=>{}).then(()=>{L&&(D4(e),f({src:e,srcSet:t}))}),()=>{L=!1}},[h,e,t,n]);const p=h?u.src:e,g=h?u.srcSet:t,[m,w]=s.useState(null),[y,b]=s.useState(null),k=s.useRef(null),S=s.useCallback(()=>{D4(p),b(p)},[p]),E=s.useCallback(L=>{k.current=L,L!=null&&L.complete&&L.naturalWidth&&S()},[S]);if(s.useLayoutEffect(()=>{const L=k.current;L!=null&&L.complete&&L.naturalWidth&&S()},[S]),m===p)return o.jsx("span",{className:i,"aria-hidden":!0,children:o.jsx(Da,{size:20})});const C=T4(p),A=C||y===p;return o.jsxs(o.Fragment,{children:[a&&!A&&o.jsx("span",{className:"sc-placeholder"}),o.jsx("img",{ref:E,src:p,...g?{srcSet:g,sizes:n}:{},alt:"",loading:C?"eager":"lazy",decoding:C?"sync":"async","data-reveal":"","data-ready":A||void 0,"data-cached":C||void 0,...r?{"data-crop":r}:{},onLoad:S,onError:()=>w(p)})]})}function ey(){return o.jsx("div",{className:"sc-lookpage-refs",children:o.jsx("div",{className:"sc-lookpage-ref",children:o.jsx("span",{className:"sc-lookpage-ref-blank",children:o.jsx(Da,{size:20})})})})}function ty({node:e,to:t}){return o.jsx(Vn,{className:"sc-lookcard","aria-label":`Open ${Dr(e)}`,to:t,children:o.jsx(ja,{src:gn(e.images[0],"tile"),blank:"sc-lookcard-blank"})})}function od({label:e,children:t}){const n=s.useRef(null),r=s.useRef(null),a=s.useRef(!1),i=s.useRef(()=>{});s.useLayoutEffect(()=>{const u=n.current,f=r.current;if(!u||!f)return;let h=0;const p=()=>{const w=f.scrollWidth-f.clientWidth;if(w<=1){delete u.dataset.overflowLeft,delete u.dataset.overflowRight;return}f.scrollLeft>2?u.dataset.overflowLeft="":delete u.dataset.overflowLeft,f.scrollLeft<w-2?u.dataset.overflowRight="":delete u.dataset.overflowRight};i.current=p,p();const g=()=>{h||(h=requestAnimationFrame(()=>{h=0,p()}))},m=new ResizeObserver(()=>p());return m.observe(f),f.addEventListener("scroll",g,{passive:!0}),()=>{h&&cancelAnimationFrame(h),i.current=()=>{},m.disconnect(),f.removeEventListener("scroll",g)}},[]);const l=u=>{const f=r.current;if(!(f!=null&&f.firstElementChild)||a.current)return;const h=f.firstElementChild.getBoundingClientRect().width+16,p=f.scrollWidth/2;u<0&&f.scrollLeft<h&&(f.scrollLeft+=p);const g=f.scrollLeft,m=u*h,w=performance.now();a.current=!0;const y=b=>{const k=Math.min(1,(b-w)/420);f.scrollLeft=g+m*(1-(1-k)**3),i.current(),k<1?requestAnimationFrame(y):(a.current=!1,f.scrollLeft>=p&&(f.scrollLeft-=p),i.current())};requestAnimationFrame(y)};return o.jsxs("section",{className:"sc-lookpage-band",children:[o.jsx("p",{className:"sc-bandhead",children:e}),o.jsxs("div",{className:"sc-slider",ref:n,children:[o.jsx("button",{type:"button",className:"sc-slider-arrow prev","aria-label":"Previous",onClick:()=>l(-1),children:o.jsx(Ta,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-slider-arrow next","aria-label":"Next",onClick:()=>l(1),children:o.jsx(Nl,{size:13,weight:"bold"})}),o.jsxs("div",{className:"sc-slider-track",ref:r,children:[t,t]})]})]})}function ik(e,t,n){return e.map(r=>o.jsxs("span",{style:{display:"contents"},children:[r.separated&&o.jsx(n,{}),o.jsxs(t,{color:r.danger?"red":void 0,onSelect:r.onSelect,children:[o.jsx(ad,{name:r.icon}),r.label]})]},r.key))}function bQ({id:e,previewUrl:t,pending:n,title:r,primary:a,secondary:i,useLabel:l,variant:u,onOpen:f,onUse:h,href:p,selected:g,onToggle:m,bookmarked:w,onBookmark:y,menu:b,fresh:k,size:S="grid",chosen:E,batching:C,onPick:A}){const[L,T]=s.useState(!1),M=s.useRef(null),j=qw(),P=fR(),R=(ee,he)=>nR(ee,he,j),H=u==="use"&&!!f&&!!h&&!C,D=b??[],U=D.find(ee=>ee.key==="delete"),V=D.length>0,B=ee=>{ee.preventDefault(),ee.stopPropagation(),A==null||A(e)};s.useEffect(()=>{if(!L)return;const ee=he=>{var ue;(ue=M.current)!=null&&ue.contains(he.target)||T(!1)};return document.addEventListener("pointerdown",ee),()=>document.removeEventListener("pointerdown",ee)},[L]);const G=t?o.jsx(ja,{src:$n(t,"tile"),srcSet:bc(t),sizes:BN[P],wait:!0,keep:!0,blank:"sc-lookcard-blank"}):n?o.jsx("span",{className:"sc-lookcard-blank","data-waiting":!0,children:o.jsx("span",{className:"sc-placeholder"})}):o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Da,{size:20})}),_=ee=>{ee.preventDefault(),ee.stopPropagation()},O=V?o.jsxs(Cs,{children:[R("More",o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${a}`,onClick:ee=>ee.stopPropagation(),onContextMenu:ee=>ee.stopPropagation(),children:[o.jsx(Tv,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx($v,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})),o.jsx(As,{side:"top",align:"end",sideOffset:4,collisionPadding:12,children:ik(D,Wn,kc)})]}):null,I=O||U||y?o.jsxs("div",{className:"sc-corner",children:[O,U&&R(U.label,o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-remove sc-cell-danger","aria-label":U.label,onClick:ee=>{_(ee),U.onSelect()},children:o.jsx(Ml,{size:15})})),y&&R(w?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-keep","data-on":w||void 0,"aria-pressed":!!w,"aria-label":w?`Remove ${a} from Keepers`:`Add ${a} to Keepers`,onClick:ee=>{_(ee),y(e)},children:o.jsx(eo,{size:15,weight:w?"fill":"regular"})}))]}):null,K=o.jsx("span",{className:"sc-lookcard-cap",title:r,children:o.jsxs("span",{className:"sc-lookcard-copy",children:[o.jsx("b",{dir:"auto",children:a}),i&&o.jsx("span",{children:i})]})});if(u==="select")return o.jsxs("button",{type:"button",className:"sc-lookcard","data-fb-id":e,"data-variant":"select","data-size":S,"data-on":g||void 0,"data-just-added":k||void 0,"aria-pressed":!!g,"aria-label":r,onClick:()=>m==null?void 0:m(e),children:[o.jsxs("span",{className:"sc-lookcard-media",children:[G,o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0}),o.jsx("span",{className:"sc-lookcard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]}),K]});const z=()=>{if(C&&A){A(e);return}if(H&&j){if(!L){T(!0);return}T(!1)}f?f(e):h==null||h(e)},q=()=>{T(!1),h==null||h(e)},Z=o.jsxs("div",{ref:M,className:"sc-lookcard","data-fb":"catalog-card","data-fb-id":e,"data-variant":u,"data-size":S,"data-armed":L||void 0,"data-just-added":k||void 0,"data-picked":E||void 0,"data-batching":C||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[p?o.jsxs(Vn,{className:"sc-lookcard-open",to:p,"aria-label":C?`${E?"Deselect":"Select"} ${a}`:r,onClick:ee=>{if(C&&A){B(ee);return}if(H&&j){if(!L){ee.preventDefault(),T(!0);return}T(!1)}},children:[G,!C&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}):o.jsxs("button",{type:"button",className:"sc-lookcard-open",onClick:z,"aria-label":C?`${E?"Deselect":"Select"} ${a}`:r,children:[G,!C&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}),H&&o.jsx("button",{type:"button",className:"sc-lookcard-use",onClick:q,children:l}),A&&R(E?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":E||void 0,"aria-pressed":!!E,"aria-label":E?`Deselect ${a}`:`Select ${a}`,onClick:B,children:o.jsx(Gn,{size:13,weight:"bold"})}))]}),I,K]});return D.length===0||j?Z:o.jsxs(X1,{children:[o.jsx(Q1,{children:Z}),o.jsx(J1,{children:ik(D,ef,Vm)})]})}function n2({size:e="grid",count:t=4,caption:n=!0}){return o.jsx(o.Fragment,{children:Array.from({length:t},(r,a)=>o.jsx("div",{className:"sc-lookcard sc-wait-late","data-variant":"skeleton","data-size":e,"data-caption":n?void 0:"photo","aria-hidden":!0},a))})}const Dd=s.memo(bQ),xQ=/^(p|product|products|item|items|dp|sku)$/i;function kQ(e){let t="";try{const r=new URL(e).pathname.split("/").filter(Boolean);t=[...r].reverse().find(a=>!xQ.test(a)&&!/^\d+$/.test(a))??r.at(-1)??""}catch{t=e}const n=decodeURIComponent(t).replace(/\.(html?|php|aspx?)$/i,"").replace(/[-_+]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function SQ(e,t){if(!t)return!0;const n=a=>a.toLowerCase().replace(/[^a-z0-9]+/g," "),r=n(e);return n(t).split(" ").filter(Boolean).every(a=>r.includes(a))}const H8=24,EQ=12;function mR({brandId:e,scan:t,busy:n,error:r,onImport:a,onImportAll:i,onDismiss:l}){const u=s.useMemo(()=>t.candidateUrls.length?t.candidateUrls:(t.cards??[]).map(Z=>Z.url).filter(Boolean),[t.candidateUrls,t.cards]),[f,h]=s.useState(""),[p,g]=s.useState(()=>new Set(u)),[m,w]=s.useState(H8),[y,b]=s.useState(()=>{const Z=new Map;for(const ee of t.cards??[])ee.url&&Z.set(ee.url,{externalKey:ee.externalKey,title:ee.title,url:ee.url,images:ee.image?[{url:ee.image}]:[]});for(const ee of t.candidates)ee.url&&Z.set(ee.url,ee);return Z}),k=s.useRef(new Set),S=s.useRef(y),E=s.useRef(!0),[C,A]=s.useState(0);s.useEffect(()=>(E.current=!0,()=>{E.current=!1}),[]);const[L,T]=s.useState(null),M=s.useRef(null),j=s.useMemo(()=>u.map(Z=>({url:Z,name:kQ(Z)})),[u]),P=s.useMemo(()=>j.filter(Z=>SQ(Z.name,f)),[j,f]),R=s.useMemo(()=>P.slice(0,m),[P,m]);s.useEffect(()=>w(H8),[f]);const H=s.useRef([]),D=s.useRef(0),U=s.useRef(()=>{}),V=2,B=120,G=s.useCallback(()=>{for(;D.current<V&&H.current.length;){const Z=H.current.splice(Math.max(0,H.current.length-EQ));if(!Z.length)return;D.current++,A(D.current),Ee.catalogDetails(e,Z).then(({products:ee})=>{if(!E.current)return;const he=new Map(S.current);for(const ue of ee)ue.url&&he.set(ue.url,ue);for(let ue=0;ue<ee.length&&ue<Z.length;ue++)he.has(Z[ue])||he.set(Z[ue],ee[ue]);S.current=he,b(he)}).catch(()=>{for(const ee of Z)k.current.delete(ee)}).finally(()=>{D.current=Math.max(0,D.current-1),E.current&&(A(D.current),U.current())})}},[e]);U.current=G,s.useEffect(()=>{const Z=M.current;if(!Z)return;const ee=new IntersectionObserver(he=>{let ue=!1;for(const ge of he){if(!ge.isIntersecting)continue;const te=ge.target.dataset.fbId;if(ee.unobserve(ge.target),!(!te||S.current.has(te)||k.current.has(te))){for(k.current.add(te),H.current.push(te);H.current.length>B;){const J=H.current.shift();J&&k.current.delete(J)}ue=!0}}ue&&U.current()},{root:Z,rootMargin:"250% 0px"});for(const he of Z.querySelectorAll("[data-fb-id]"))ee.observe(he);return()=>ee.disconnect()},[m,f]),s.useEffect(()=>{if(!L||m>=P.length)return;const Z=L.closest(".sc-wizpick-grid"),ee=new IntersectionObserver(he=>{he.some(ue=>ue.isIntersecting)&&w(ue=>ue+H8)},{root:Z,rootMargin:"0px 0px 300% 0px"});return ee.observe(L),()=>ee.disconnect()},[L,m,P.length]);const _=s.useCallback(Z=>{g(ee=>{const he=new Set(ee);return he.delete(Z)||he.add(Z),he})},[]),O=P.length>0&&P.every(Z=>p.has(Z.url)),I=p.size===u.length,K=()=>{g(Z=>{const ee=new Set(Z);for(const he of P)O?ee.delete(he.url):ee.add(he.url);return ee})},z=p.size,q=z===1?"1 product":`${z.toLocaleString()} products`;return o.jsxs(Ws,{open:!0,className:"sc-wizpick",maxWidth:"760px",described:!0,onDismiss:l,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Products on your site"}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(Hc,{className:"sc-wizpick-sub",children:`${u.length.toLocaleString()} found. Everything is selected; untick what you do not want, or search for what you do.`}),o.jsxs("div",{className:"sc-wizpick-tools",children:[o.jsxs("span",{className:"sc-wizpick-search",children:[o.jsx(hd,{size:13}),o.jsx("input",{type:"search",value:f,onChange:Z=>h(Z.target.value),placeholder:`Search ${u.length.toLocaleString()} products`,"aria-label":"Search products"})]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:K,disabled:!P.length,children:O?"Select none":f?`Select these ${P.length.toLocaleString()}`:"Select all"}),o.jsxs("span",{className:"sc-wizpick-count",children:[z.toLocaleString()," selected"]})]}),o.jsxs("div",{className:"sc-wizpick-grid",ref:M,children:[R.map(Z=>{var he,ue;const ee=y.get(Z.url);return o.jsx(Dd,{id:Z.url,previewUrl:((ue=(he=ee==null?void 0:ee.images)==null?void 0:he[0])==null?void 0:ue.url)??null,pending:!ee,title:(ee==null?void 0:ee.title)??Z.name,primary:(ee==null?void 0:ee.title)??Z.name,secondary:(ee==null?void 0:ee.price)!=null?`${ee.currency??""} ${ee.price}`.trim():(ee==null?void 0:ee.category)??"",useLabel:"Import",variant:"select",selected:p.has(Z.url),onToggle:_,size:"grid"},Z.url)}),m<P.length&&o.jsx("div",{className:"sc-wizpick-end",ref:T,"aria-hidden":!0}),!P.length&&o.jsxs("p",{className:"sc-wizpick-empty",children:["Nothing here matches “",f,"”."]})]}),o.jsxs("div",{className:"sc-wizpick-foot",children:[o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:l,children:"Not now"}),r?o.jsx("span",{className:"sc-wizpick-error",role:"alert",children:r}):C>0&&o.jsx("span",{className:"sc-wizpick-loading",children:"Loading products"}),o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!z||n||y.size===0&&C>0,onClick:()=>I?i():a([...p]),children:n?"Importing":`Import ${q}`})]})]})}const O8=700,CQ=45e3,jQ=3e3;function gR(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),[f,h]=s.useState(null),[p,g]=s.useState(0),m=s.useRef(!0);s.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]),s.useEffect(()=>{if(!e)return;let b=!1,k,S=null;i(!0),u(!1),r(null),h(null);const E=(A,L)=>{r(A),h(L),i(!1),u(!0)};return(async()=>{try{const{scanId:A}=await Ee.catalogScan(e,t);if(S=A,b||!m.current){Ee.cancelCatalogScan(e,A).catch(()=>{});return}const L=Date.now()+CQ,T=async()=>{if(!(b||!m.current)){if(Date.now()>L){E(null,{kind:"timeout"});return}try{const M=await Ee.catalogScanState(e,A,AbortSignal.timeout(jQ));if(b||!m.current)return;if(M.status==="running"){k=setTimeout(T,O8);return}M.result?E(M.result,null):E(null,{kind:"error",reason:M.error??"The look for a shop did not finish."})}catch(M){if(b||!m.current)return;if((M==null?void 0:M.status)===404){E(null,{kind:"error",reason:"The look for a shop was interrupted."});return}k=setTimeout(T,O8)}}};k=setTimeout(T,O8)}catch{b||E(null,{kind:"error",reason:"The look for a shop could not start."})}})(),()=>{b=!0,k&&clearTimeout(k),S&&Ee.cancelCatalogScan(e,S).catch(()=>{})}},[e,t,p]);const w=s.useCallback(()=>g(b=>b+1),[]);return{scan:n,scanning:a,settled:l,outcome:a?{kind:"scanning"}:f||(n?{kind:"result",scan:n}:{kind:"idle"}),retry:w}}const g1=[{key:"fragrance",label:"Fragrance",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"footwear",label:"Footwear",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"lateral-side",label:"Lateral side"},{key:"medial-side",label:"Medial side"}]},{key:"apparel",label:"Apparel",angles:[{key:"front",label:"Front"},{key:"back",label:"Back"},{key:"three-quarter",label:"Three-quarter"}]},{key:"furniture",label:"Furniture",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beauty",label:"Beauty / skincare",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"electronics",label:"Electronics",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"back",label:"Back"}]},{key:"jewelry",label:"Jewelry",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"accessories",label:"Accessories",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beverage",label:"Beverage",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"food",label:"Food",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"other",label:"Other",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]}],ny=new Map(g1.map(e=>[e.key,e]));ny.get("other");function v1(e){var t;return e?((t=ny.get(e))==null?void 0:t.label)??e:null}function AQ(e,t){const n=[e??"",...t??[]].join(" ").toLowerCase();if(!n.trim())return;const r=[["fragrance",["fragrance","perfume","eau de","cologne"]],["footwear",["shoe","sneaker","boot","sandal","footwear"]],["apparel",["shirt","dress","jacket","pant","apparel","clothing","hoodie"]],["furniture",["chair","table","sofa","furniture","shelf","desk"]],["beauty",["skincare","serum","cream","lotion","cosmetic","makeup","beauty"]],["electronics",["electronic","headphone","speaker","charger","device","gadget"]],["jewelry",["jewelry","jewellery","necklace","bracelet","earring","ring"]],["accessories",["bag","handbag","wallet","watch","accessory","accessories"]],["beverage",["drink","beverage","soda","juice","coffee","tea"]],["food",["food","snack","grocery","sauce","spice","pantry"]]];for(const[a,i]of r)if(i.some(l=>n.includes(l)))return a}function ry(e){return e.category&&ny.has(e.category)?e.category:AQ(e.productType,e.tags)??null}function NQ({title:e,sub:t,error:n,footnote:r,primaryLabel:a,ready:i,blocked:l,busy:u,width:f="440px",onBack:h,onPrimary:p,onPasteFiles:g,children:m}){const{close:w}=jr("new");return o.jsxs(Ws,{maxWidth:f,onDismiss:w,onPaste:y=>{var k;if(!g)return;const b=Array.from(((k=y.clipboardData)==null?void 0:k.files)??[]).filter(S=>S.type.startsWith("image/"));b.length&&(y.preventDefault(),g(b))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[h&&o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:h,"aria-label":"Back",children:o.jsx(Ta,{size:15})}),o.jsx(Ns,{className:"sc-newdlg-title",children:e}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),t&&o.jsx("p",{className:"sc-newdlg-sub",children:t}),o.jsx("div",{className:"sc-newdlg-body",children:m}),o.jsxs("div",{className:"sc-newdlg-foot",children:[n&&o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-dlg-go","aria-disabled":!i||u||void 0,title:l,onClick:()=>{i&&!u&&p()},children:[u?o.jsx(Pr,{size:"1"}):null,a]}),r&&o.jsx("p",{className:"sc-dlg-foot",children:r})]})]})}function vR({onFiles:e,onReject:t,disabled:n}){const r=s.useRef(0),[a,i]=s.useState(!1),l=s.useCallback(()=>{r.current=0,i(!1)},[]);return{dragOver:a,dropProps:{"data-drag-over":a||void 0,onDragEnter:f=>{n||!Array.from(f.dataTransfer.types).includes("Files")||(f.preventDefault(),r.current++,i(!0))},onDragOver:f=>{n||f.preventDefault()},onDragLeave:()=>{r.current=Math.max(0,r.current-1),r.current===0&&i(!1)},onDrop:f=>{if(n)return;f.preventDefault(),l();const h=Array.from(f.dataTransfer.files).filter(p=>p.type.startsWith("image/"));h.length?e(h):t==null||t()}}}}function lk({label:e,hint:t,busy:n,disabled:r,multiple:a=!0,accept:i="image/*",onFiles:l,onReject:u,children:f}){const h=s.useRef(null),{dropProps:p}=vR({onFiles:l,onReject:u,disabled:r||n});return o.jsxs("button",{type:"button",className:"sc-dropzone",disabled:r||n,onClick:()=>{var g;return(g=h.current)==null?void 0:g.click()},...p,children:[o.jsx("input",{ref:h,type:"file",accept:i,multiple:a,hidden:!0,onChange:g=>{const m=Array.from(g.target.files??[]);g.target.value="",m.length&&l(m)}}),n?o.jsx(Pr,{}):f,o.jsx("span",{className:"sc-dropzone-label",children:e}),t&&o.jsx("small",{children:t})]})}function wR({hashes:e,max:t,label:n,hint:r,busy:a,onAdd:i,onRemove:l,onReject:u}){if(e.length===0)return o.jsx("div",{className:"sc-assetwell",children:o.jsx(lk,{label:n,hint:r,busy:a,onFiles:i,onReject:u,children:o.jsx(mr,{size:18})})});const f=t-e.length;return o.jsxs("div",{className:"sc-assetform-refs",children:[e.map((h,p)=>o.jsxs("span",{className:"sc-assetform-ref",children:[o.jsx("img",{src:gn(h,"micro"),alt:`Reference ${p+1}`,loading:"lazy",decoding:"async"}),o.jsx("button",{type:"button",className:"sc-assetform-drop","aria-label":`Remove reference ${p+1}`,onClick:()=>l(h),children:o.jsx(jn,{size:11,weight:"bold"})})]},h)),f>0&&o.jsx(lk,{label:`${f} more`,busy:a,onFiles:i,onReject:u,children:o.jsx(mr,{size:15})})]})}let D0=null;const yR=(e,t)=>`${e}:${t}`;function MQ(e,t,n){D0={key:yR(e,t),fields:n}}function RQ(e,t){if(!D0||D0.key!==yR(e,t))return null;const{fields:n}=D0;return D0=null,n}const ck={name:"",instruction:"",facets:[],imageHashes:[],importUrl:""};function PQ(e,t,n){const r=n.restore??!1,[a,i]=s.useState(ck),[l,u]=s.useState(!1),[f,h]=s.useState(null),p=s.useRef(null),g=s.useRef(null),m=s.useRef(n.pendingState);m.current=n.pendingState;const w=s.useRef(n.exists);w.current=n.exists;const y=s.useRef(n.onDiscarded);y.current=n.onDiscarded;const b=s.useRef(a);b.current=a,s.useEffect(()=>{var P;if(r){const R=RQ(e,t);if(R){i(R);return}}const M=mM(e,t),j=M!=null&&M.pending?m.current(M.pending):null;if(M!=null&&M.pending&&j==="unknown"&&((P=w.current)!=null&&P.call(w,M.name))){Vu(e,t);return}if(M&&!M.pending){Vu(e,t);return}M&&hq(M,j)&&(g.current=M.pending,i({name:M.name,instruction:M.instruction,facets:M.facets,imageHashes:M.imageHashes,importUrl:M.importUrl}))},[e,t,r]);const k=s.useCallback(M=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{g.current&&R8(M)?P8(e,t,{...M,pending:g.current}):Vu(e,t)},400)},[e,t]),S=s.useCallback(M=>{i(j=>{const P={...j,...typeof M=="function"?M(j):M};return k(P),P})},[k]),E=s.useCallback(()=>{var j;p.current&&clearTimeout(p.current);const M=b.current;if(g.current&&R8(M)){P8(e,t,{...M,pending:g.current});return}Vu(e,t),R8(M)&&(MQ(e,t,M),(j=y.current)==null||j.call(y))},[e,t]);s.useEffect(()=>(window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E),E()}),[E]);const C=s.useCallback(async M=>{u(!0),h(null);try{const j=n.max-b.current.imageHashes.length,P=[];for(const R of M.slice(0,j))P.push(await d1(R));S(R=>({imageHashes:[...new Set([...R.imageHashes,...P])].slice(0,n.max)}))}catch(j){h(String(j.message??j))}finally{u(!1)}},[n.max,S]),A=s.useCallback(M=>S(j=>({imageHashes:j.imageHashes.filter(P=>P!==M)})),[S]),L=s.useCallback(M=>S(j=>({facets:j.facets.includes(M)?j.facets.filter(P=>P!==M):[...j.facets,M]})),[S]),T=s.useCallback(M=>{if(p.current&&clearTimeout(p.current),!M){Vu(e,t),g.current=null,i(ck);return}g.current=M,i(j=>(P8(e,t,{...j,pending:M}),j))},[e,t]);return{fields:a,set:S,uploading:l,err:f,setErr:h,addFiles:C,removeHash:A,toggleFacet:L,submitted:T}}const uk=6,LQ=3;function $Q({onBack:e,onStarted:t,restore:n,onDiscarded:r}){var j,P;const{brand:a}=cn(),{applyBrand:i}=Mn(),[l,u]=s.useState(!1),[f,h]=s.useState(!1),[p,g]=s.useState(!1),m=PQ(a.id,"product",{max:uk,pendingState:()=>"unknown",restore:n,onDiscarded:r}),w=m.fields.imageHashes.length>0&&!m.uploading,y=m.uploading?"Photos are still uploading":w?void 0:"Add at least one photo",b=async()=>{u(!0),m.setErr(null);try{const{productId:R,...H}=await Ee.createProduct(a.id,{name:m.fields.name.trim(),imageHashes:m.fields.imageHashes,category:m.fields.facets[0]});i(H);const D=m.fields.name.trim()||"Product";m.submitted(null),t({kind:"product",id:R,name:D})}catch(R){m.setErr(String(R.message??R))}finally{u(!1)}},[k,S]=s.useState(null),{scan:E,scanning:C,settled:A}=gR(k?a.id:null,k??void 0),L=async R=>{const H=k??m.fields.importUrl.trim()??"";h(!0),m.setErr(null);try{await Ee.catalogImport(a.id,H,R),m.set({importUrl:""}),S(null),t({kind:"product",id:"",name:H})}catch(D){m.setErr(String(D.message??D))}finally{h(!1)}},T=()=>{var H,D;const R=m.fields.importUrl.trim()||(((D=(H=a.json)==null?void 0:H.meta)==null?void 0:D.website)??"");R&&(m.setErr(null),S(R))};s.useEffect(()=>{!k||!A||E&&E.verdict==="found"&&E.candidates.length||L()},[E,A,k]);const M=R=>{R.key==="Enter"&&(R.preventDefault(),w&&!l&&b())};return o.jsxs(NQ,{title:"New product",error:m.err,footnote:"Added to this brand. No preview.",primaryLabel:"Add product",ready:w,blocked:y,busy:l,onBack:e,onPrimary:()=>void b(),onPasteFiles:R=>void m.addFiles(R),children:[o.jsxs("div",{className:"sc-assetform",children:[o.jsx(wR,{hashes:m.fields.imageHashes,max:uk,label:"Add packshots",hint:`Straight, well-lit packshots. The first ${LQ} are the ones a shot attaches.`,busy:m.uploading,onAdd:R=>void m.addFiles(R),onRemove:m.removeHash,onReject:()=>m.setErr("Drop an image file.")}),o.jsx("div",{className:"sc-assetform-fields",children:o.jsxs("div",{className:"sc-assetform-field",children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-product-name",children:"Name"}),o.jsx("input",{id:"sc-product-name",className:"sc-in",type:"text",placeholder:"Name this product",value:m.fields.name,onChange:R=>m.set({name:R.target.value}),onKeyDown:M})]})}),o.jsxs("fieldset",{className:"sc-assetform-facets",children:[o.jsx("legend",{children:"Category"}),o.jsx("div",{className:"sc-assetform-facets-chips",children:g1.map(R=>o.jsx("button",{type:"button",className:"sc-chip","data-on":m.fields.facets[0]===R.key||void 0,"aria-pressed":m.fields.facets[0]===R.key,onClick:()=>m.set({facets:m.fields.facets[0]===R.key?[]:[R.key]}),children:R.label},R.key))})]})]}),o.jsx("div",{className:"sc-newdlg-secondary",children:p?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-import-url",children:"Your store's address"}),o.jsxs("div",{className:"sc-newdlg-secrow",children:[o.jsx("input",{id:"sc-import-url",className:"sc-in",type:"url",placeholder:((P=(j=a.json)==null?void 0:j.meta)==null?void 0:P.website)??"https://yourstore.com",value:m.fields.importUrl,onChange:R=>m.set({importUrl:R.target.value}),onKeyDown:R=>{R.key==="Enter"&&T()}}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:f||C,onClick:T,children:C?"Looking…":f?"Starting…":"Import"})]})]}):o.jsx("button",{type:"button",className:"sc-newdlg-secmore",onClick:()=>g(!0),children:"Import a catalog from a store URL"})}),E&&E.verdict==="found"&&E.candidates.length>0&&o.jsx(mR,{brandId:a.id,scan:E,busy:f,onImport:R=>void L(R),onImportAll:()=>void L(),onDismiss:()=>S(null)})]})}const I8="1",TQ={product:"Product",presenter:"Person",scene:"Place"},DQ=["product","presenter","scene"],HQ=e=>!!e&&DQ.includes(e),bR=s.createContext(null);function xR(){const e=s.useContext(bR);if(!e)throw new Error("useCreateAsset must be used inside AssetCreateHost");return e}function Zl(){return xR().open}function kR(){const e=!!mn({path:pt.products,end:!1}),t=!!mn({path:pt.presenters,end:!1}),n=!!mn({path:pt.scenes,end:!1});return e?"product":t?"presenter":n?"scene":null}function sy(){const{announce:e,caps:t}=xR();return{announce:e,caps:t}}function OQ({children:e}){const{brand:t}=cn(),n=Un(),r=Bn(),{push:a}=rr(),{refreshBrands:i}=Mn(),{builds:l,poke:u}=ia(),f=jr("new"),h=f.value,p=kR(),g=!!mn({path:pt.presenterStudio}),m=!!mn({path:pt.presenterEdit}),w=!!mn({path:pt.sceneStudio}),y=!!mn({path:pt.sceneEdit}),[b,k]=s.useState(null),[S,E]=s.useState(!1),[C,A]=s.useState(!1),L=s.useRef(null),T=s.useRef(null),M=f.open,j=f.set,P=f.close,R=s.useCallback((Z,ee)=>{if(L.current=Z==="choose"||!(ee!=null&&ee.onCreated)?null:{kind:Z,fn:ee.onCreated},Z==="presenter"){n(vl(t));return}if(Z==="scene"){n(gl(t),{state:{from:r.pathname+r.search}});return}T.current=document.activeElement instanceof HTMLElement?document.activeElement:null,E(Z==="choose"),A(!1),M(Z==="choose"?I8:Z)},[M,n,t,r.pathname,r.search]);s.useEffect(()=>{const Z=SY(h);Z==="presenter"&&n(vl(t),{replace:!0}),Z==="scene"&&n(gl(t),{replace:!0})},[h,n,t]);const H=s.useCallback(()=>{L.current=null,E(!1),P()},[P]),D=s.useCallback(Z=>{a({kind:"success",title:`${TQ[Z]} discarded`,detail:"Nothing was saved.",action:{label:"Undo",onClick:()=>{A(!0),E(!1),M(Z)}}})},[M,a]);s.useEffect(()=>{h===null&&A(!1)},[h]),s.useEffect(()=>{if(h!==null)return;const Z=T.current;T.current=null,Z!=null&&Z.isConnected&&Z.focus()},[h]);const U=h!==null||g||m||w||y,V=jr("setup").value,B=jr("settings").value,G=!!V||!!B;s.useEffect(()=>{if(!U||G)return;let Z=!0,ee=null;const he=ue=>Ee.assetBuildCapabilities().then(ge=>Z&&k(ge)).catch(()=>{Z&&ue&&(ee=setTimeout(()=>he(!1),600))});return he(!0),()=>{Z=!1,ee&&clearTimeout(ee)}},[U,G]);const _=s.useCallback(Z=>{const ee=l.find(he=>he.id===Z);return ee?ee.stage==="failed"?"failed":ee.stage==="cancelled"?"cancelled":ee.stage==="done"?"done":"running":"unknown"},[l]),O=s.useCallback((Z,ee)=>{var te;const he=L.current;L.current=null,u();const ue=!!(ee!=null&&ee.quiet);if(Z.kind==="product"){if(!Z.id){a({kind:"info",title:"Importing your catalog",detail:Z.name});return}(he==null?void 0:he.kind)==="product"&&he.fn(Z),a({kind:"success",title:`${Z.name} added`,actions:[{label:"Add details",onClick:()=>n(Ea(t,Z.id))},{label:"Use in a shot",onClick:()=>n(`${Sr(t)}?product=${Z.id}&compose=1${Ec()}`)}]});return}if(Z.kind==="presenter"){if((he==null?void 0:he.kind)==="presenter"&&he.fn(Z),ue)return;a({kind:"success",title:`${Z.name} added`,actions:[{label:"Use in a shot",onClick:()=>n(`${Sr(t)}?${yd("presenter",Z.id)}&compose=1${Ec()}`)}]});return}if(i(),(he==null?void 0:he.kind)==="scene"&&he.fn(Z),ue)return;const ge=(te=Z.verticals)!=null&&te.length?`Filed under ${Z.verticals.join(" and ")}.`:void 0;a({kind:"success",title:Z.how==="updated"?`${Z.name} changed`:`${Z.name} saved`,detail:ge,actions:[{label:"Open",onClick:()=>n(zr(t,Z.id))},{label:"Use in a shot",onClick:()=>n(`${Sr(t)}?${yd("scene",Z.id)}&compose=1${Ec()}`)}]})},[t,n,u,a,i]),I=s.useCallback(Z=>{O(Z),H()},[H,O]),K=s.useMemo(()=>({open:R,announce:O,caps:b}),[R,O,b]),z=HQ(h)?h:null,q={onBack:S?()=>j(I8):void 0,onStarted:I,caps:b,pendingState:_,restore:C,onDiscarded:()=>z&&D(z)};return o.jsxs(bR.Provider,{value:K,children:[e,h===I8&&o.jsx(cQ,{suggest:p,onPick:Z=>{if(Z==="presenter"){n(vl(t),{replace:!0});return}if(Z==="scene"){n(gl(t),{replace:!0});return}E(!0),j(Z)}}),z==="product"&&o.jsx($Q,{...q},"product")]})}const dk=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",nouns:"products",icon:gm},{kind:"presenter",label:"Person",line:"Who appears in the shot",noun:"person",nouns:"people",icon:pm},{kind:"scene",label:"Place",line:"Where it happens, and its light",noun:"place",nouns:"places",icon:hm}],IQ={product:"New product",presenter:"New person",scene:"New place"};function FQ(){var f,h;const e=Zl(),t=kR(),n=cR(),{showcase:r}=Mn(),a=((f=r.find(p=>p.previewUrl))==null?void 0:f.previewUrl)??null,i=Kw(16).find(p=>p.key==="create"),l=i?`${i.to}&attach=all`:"",u=t?IQ[t]:"New";return o.jsxs("div",{className:"sc-new",children:[t?o.jsxs("button",{type:"button",className:"sc-new-go","aria-label":u,"data-guide":"library.new",onClick:()=>e(t),children:[o.jsx(mr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsxs("span",{className:"sc-new-lb",children:[o.jsx("span",{className:"sc-new-verb",children:"New "}),o.jsx("span",{className:"sc-new-kind",children:(h=dk.find(p=>p.kind===t))==null?void 0:h.noun})]})]}):o.jsxs(Vn,{className:"sc-new-go",to:l,"aria-label":"New shot","data-attach-opener":"",children:[o.jsx(mr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsx("span",{className:"sc-new-lb",children:"New"})]}),o.jsx("span",{className:"sc-new-split","aria-hidden":"true"}),o.jsxs(sR,{label:"New",className:"sc-menu-start",trigger:o.jsx("button",{type:"button",className:"sc-new-more","aria-label":"Other ways to start",children:o.jsx(xl,{size:12,weight:"bold",className:"sc-new-caret","aria-hidden":"true"})}),children:[o.jsxs(rd,{className:"sc-menu-item sc-start-row","data-lead":"",to:l,children:[o.jsx("span",{className:"sc-start-pic",children:a?o.jsx("img",{src:$n(a,"tile"),alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(XS,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:"New shot"}),o.jsx("small",{children:"Write a brief, get a shot"})]})]}),o.jsx("div",{className:"sc-menu-label",children:"Add to this brand"}),dk.map(p=>{const{url:g,count:m}=n[p.kind];return o.jsxs(rd,{className:"sc-menu-item sc-start-row",onSelect:()=>e(p.kind),children:[o.jsx("span",{className:"sc-start-pic",children:g?o.jsx("img",{src:g,alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(p.icon,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:p.label}),o.jsx("small",{children:p.line})]}),o.jsxs("span",{className:"sc-start-n",children:[m===0?"None yet":m,o.jsx("span",{className:"sc-vh",children:` ${m===1?p.noun:p.nouns} so far`})]})]},p.kind)})]})]})}const _Q=24,VQ=8;function ZQ(){const e=Nr(la),{pathname:t}=Bn();s.useEffect(()=>{const n=document.querySelector(".sc-shell");if(!n||(delete n.dataset.condensed,e))return;let r=0;const a=i=>{const l=i.target;!(l!=null&&l.dataset)||!("pageScroll"in l.dataset)||r||(r=requestAnimationFrame(()=>{r=0;const u=n.dataset.condensed!==void 0,f=l.scrollTop;(u?f<=VQ:f>_Q)&&(u?delete n.dataset.condensed:n.dataset.condensed="")}))};return n.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>{r&&cancelAnimationFrame(r),n.removeEventListener("scroll",a,{capture:!0}),delete n.dataset.condensed}},[e,t])}const SR=["M64 18.71V38.8L51.38 51.39V12.62H57.9C61.27 12.62 64 15.35 64 18.72V18.71Z","M12.62 12.62V51.39H6.1C2.73 51.39 0 48.66 0 45.29V25.2L12.62 12.61V12.62Z","M51.38 51.38L38.79 64H18.7C15.33 64 12.6 61.27 12.6 57.9V51.38H51.37H51.38Z","M12.62 12.62L25.2 0H45.29C48.66 0 51.39 2.73 51.39 6.1V12.62H12.62Z"],zQ=["M100.99 28.93L91.76 27.8C88.5 27.41 87.19 26.58 87.19 25.1C87.19 23.45 89.98 22.49 94.29 22.49C99.38 22.49 102.43 23.36 104.17 26.58L111.61 24.27C108.65 17.87 102.08 16 94.98 16C85.1 16 78.7 19.31 78.7 25.97C78.7 31.02 82.49 33.81 90.28 34.76L98.68 35.8C102.29 36.24 103.3 37.19 103.3 38.5C103.3 40.24 100.64 41.46 95.59 41.46C89.41 41.46 87.01 40.2 85.31 37.02L77.52 39.33C80.31 45.77 86.92 47.95 95.07 47.95C105.17 47.95 111.88 44.55 111.88 37.72C111.88 32.84 108.53 29.84 101 28.93H100.99Z","M132.73 22.66C137 22.66 140.87 24.01 142.7 28.54L150.49 26.67C148.79 20.66 142.3 16.05 132.6 16.05C121.41 16.05 113.44 22.23 113.44 31.98C113.44 41.73 121.41 48 132.6 48C142.31 48 148.8 43.3 150.49 37.29L142.7 35.42C140.87 39.95 137 41.3 132.73 41.3C126.94 41.3 122.24 38.38 122.24 32.42V31.55C122.24 25.59 126.94 22.67 132.73 22.67V22.66Z","M161.51 34.89H179.58V28.71H161.51V22.97H181.54V16.52H152.8V47.43H181.84V40.99H161.51V34.89Z","M208.71 33.85H208.67L193.86 16.52H184.94V47.43H193.04V27.49H193.08L210.15 47.43H216.81V16.52H208.71V33.85Z","M252.25 26.8C252.25 20.14 248.07 16.52 239.84 16.52H220.77V47.43H229.48V37.5H236.62L242.63 47.43H252.56L245.55 36.37C249.9 34.8 252.25 31.62 252.25 26.79V26.8ZM243.54 27.32C243.54 29.98 242.06 31.28 239.06 31.28H229.48V22.96H239.06C242.06 22.96 243.54 24.27 243.54 26.88V27.32Z","M263.79 16.52H255.08V47.43H263.79V16.52Z"];function BQ(e){return o.jsx("svg",{viewBox:"0 0 263.79 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:[...SR,...zQ].map(t=>o.jsx("path",{d:t},t))})}function UQ(e){return o.jsx("svg",{viewBox:"0 0 64 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:SR.map(t=>o.jsx("path",{d:t},t))})}function WQ(){const{brand:e}=cn();return ZQ(),o.jsxs("header",{className:"sc-topbar",children:[o.jsx("a",{className:"sc-skip",href:"#main",children:"Skip to content"}),o.jsx("div",{className:"sc-topbar-lead",children:o.jsx(Vn,{className:"sc-wordmark","aria-label":"Scenri home",to:To(e),children:o.jsx(BQ,{"aria-hidden":"true"})})}),o.jsx(QX,{}),o.jsxs("div",{className:"sc-topbar-end",children:[o.jsx(rQ,{}),o.jsx(qX,{}),o.jsx(FQ,{}),o.jsx(eQ,{})]})]})}const KQ=60;function GQ(){s.useEffect(()=>{const e=window.visualViewport;if(!e)return;const t=document.documentElement,n=()=>{const r=window.innerHeight-e.height-e.offsetTop;t.style.setProperty("--sc-kb",r>KQ?`${Math.round(r)}px`:"0px")};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),t.style.removeProperty("--sc-kb")}},[])}const ER=s.createContext(null);function CR(){return s.useContext(ER)}function YQ({brand:e,children:t}){const n=e.id,[r,a]=s.useState({products:[],loaded:!1}),i=s.useRef(null),{tasks:l}=ia(),u=l.filter(w=>w.kind==="catalog").map(w=>`${w.id}:${w.state}`).join("|"),f=l.some(w=>w.kind==="catalog"&&w.state==="running"),h=s.useRef(0),p=s.useRef(n);p.current=n;const g=s.useCallback(async()=>{const w=++h.current;try{const y=await Ee.productsLibrary(n);if(w!==h.current||p.current!==n)return;const b=JSON.stringify(y.products);if(i.current===b)return;i.current=b,a({products:y.products,loaded:!0})}catch{if(w!==h.current||p.current!==n)return;a(y=>({products:y.products,loaded:!0}))}},[n]);s.useEffect(()=>{i.current=null,a({products:[],loaded:!1})},[n]),s.useEffect(()=>{g()},[g,e.updatedAt,u]),s.useEffect(()=>{if(!f)return;const w=setInterval(()=>void g(),2e3);return()=>clearInterval(w)},[f,g]);const m=s.useMemo(()=>({products:r.products,productsLoaded:r.loaded,importing:f,refreshProducts:g}),[r.products,r.loaded,f,g]);return o.jsx(ER.Provider,{value:m,children:t})}function qQ({feature:e}){const{isNew:t}=eu();return t(e)?o.jsx("span",{className:"sc-tag sc-tag-new",children:"New"}):null}function us({title:e,sub:t,children:n}){return o.jsxs("section",{className:"sc-set-sec",children:[(e||t)&&o.jsxs("div",{className:"sc-set-sech",children:[e&&o.jsx("h3",{children:e}),t&&o.jsx("p",{children:t})]}),o.jsx("div",{className:"sc-set-card",children:n})]})}const XQ={npx:"run with npx",global:"installed with npm",managed:"managed install",dev:"running from source",unknown:"local studio"};function QQ({version:e}){return o.jsxs(us,{children:[o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Scenri"}),o.jsxs("small",{children:[e?`v${e.version}`:""," · ",XQ[(e==null?void 0:e.installKind)??"unknown"]]})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"License"}),o.jsx("small",{children:"AGPL-3.0 for the app · Apache-2.0 for the .brand format"})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open source"}),o.jsxs("small",{children:["Built by Tony Gorb ·"," ",o.jsx("a",{href:"https://scenri.co",target:"_blank",rel:"noreferrer",children:"scenri.co"})," ","·"," ",o.jsx("a",{href:"https://github.com/tonygorb/scenri",target:"_blank",rel:"noreferrer",children:"GitHub"})]})]})})]})}function H4({w:e,h:t,slot:n,box:r}){const a=r/Math.max(e,t);return o.jsx("span",{className:"sc-ratio-slot",style:{width:n,height:n},"aria-hidden":!0,children:o.jsx("span",{className:"sc-ratio",style:{width:Math.round(e*a),height:Math.round(t*a)}})})}const fk=()=>o.jsx("span",{className:"sc-setpop-tick","aria-hidden":!0,children:o.jsx(Gn,{size:12,weight:"bold"})});function ri({label:e,value:t,ids:n,unavailable:r=[],onChange:a,className:i,children:l}){const u=s.useRef(null),f=n.filter(p=>!r.includes(p)),h=p=>{var y,b;const g=p.key==="ArrowDown"||p.key==="ArrowRight"?1:p.key==="ArrowUp"||p.key==="ArrowLeft"?-1:p.key==="Home"?"first":p.key==="End"?"last":null;if(g===null||!f.length)return;p.preventDefault();const m=f.indexOf(t),w=g==="first"?f[0]:g==="last"?f[f.length-1]:g===1?f[m<0||m===f.length-1?0:m+1]:f[m<=0?f.length-1:m-1];a(w),(b=(y=u.current)==null?void 0:y.querySelector(`[data-id="${w}"]`))==null||b.focus()};return o.jsx("div",{className:i,role:"radiogroup","aria-label":e,ref:u,tabIndex:-1,onKeyDown:h,children:l})}const si=s.forwardRef(function({id:t,on:n,unavailable:r,label:a,onPick:i,className:l,children:u,...f},h){return o.jsx("button",{...f,ref:h,type:"button",role:"radio","data-id":t,className:l,"aria-checked":n,"aria-label":a,"aria-disabled":r||void 0,"data-on":n||void 0,tabIndex:n?0:-1,onClick:p=>{var g;(g=f.onClick)==null||g.call(f,p),r||i()},children:u})}),JQ=({children:e})=>o.jsx("p",{className:"sc-setpop-foot",children:e}),hk=[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}];function eJ(){const{choice:e,setChoice:t}=WG();return o.jsx(us,{children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Theme"}),o.jsx("small",{children:"Follows your system unless you pick a side."})]}),o.jsx(ri,{label:"Theme",className:"sc-seg",value:e,ids:hk.map(n=>n.id),onChange:n=>t(n),children:hk.map(n=>o.jsx(si,{id:n.id,className:"sc-seg-o",on:e===n.id,label:n.label,onPick:()=>t(n.id),children:n.label},n.id))})]})})}function tJ({value:e,onChange:t,placeholder:n,label:r,suggestions:a,max:i=24,maxLength:l=200}){const[u,f]=s.useState(""),h=e.length>=i,p=m=>{const w=m.trim().slice(0,l);f(""),!(!w||h)&&(e.some(y=>y.toLowerCase()===w.toLowerCase())||t([...e,w]))},g=!h&&a&&a.length>0?o.jsx("div",{className:"sc-chips-sugg",children:a.map(m=>o.jsx("button",{type:"button",className:"sc-chip",onClick:()=>p(m),"aria-label":`Never show ${m}`,children:m},m))}):null;return o.jsxs(o.Fragment,{children:[e.length===0&&g,o.jsxs("div",{className:"sc-chips",children:[e.map((m,w)=>o.jsxs("span",{className:"sc-chips-item",children:[o.jsx("span",{dir:"auto",children:m}),o.jsx("button",{type:"button",onClick:()=>t(e.filter((y,b)=>b!==w)),"aria-label":`Remove ${m}`,children:o.jsx(jn,{size:10,weight:"bold"})})]},m)),o.jsx("input",{className:"sc-chips-in",value:u,"aria-label":r,placeholder:h?void 0:e.length?"Add another…":n??"Add one…",disabled:h,dir:"auto",onChange:m=>{const w=m.target.value;if(w.includes(",")){const y=w.split(",");for(const b of y.slice(0,-1))p(b);f(y[y.length-1]);return}f(w.slice(0,l))},onKeyDown:m=>{m.key==="Enter"?(m.preventDefault(),p(u)):m.key==="Backspace"&&!u&&e.length&&t(e.slice(0,-1))},onBlur:()=>p(u)})]}),e.length>0&&g]})}const nJ=["competitor logos in frame","visible text or wordmarks on clothing","alcohol","children","visible clutter or mess","heavy skin retouching","neon or harsh colour","pure white studio backgrounds"],pk=e=>e.trim().toLowerCase();function rJ(e){const t=new Set((e??[]).map(pk));return nJ.filter(n=>!t.has(pk(n)))}function sJ({doc:e}){var a;const t=((a=e.json)==null?void 0:a.rules)??{},n=t.never??[],r=i=>{const l={...t};i.length?l.never=i:delete l.never,e.patch({rules:l})};return o.jsx("div",{className:"sc-nv",children:o.jsx(tJ,{label:"Things this brand never shows",value:n,placeholder:"Or type your own",suggestions:rJ(n),max:24,onChange:r})})}function aJ(){const{brand:e}=cn(),{applyBrand:t}=Mn(),{push:n}=rr(),[r,a]=s.useState({}),[i,l]=s.useState("idle"),u=s.useRef(r);u.current=r;const f=s.useRef(e);f.current=e;const h=s.useRef(null),p=s.useRef({}),g=s.useRef(!1),m=s.useRef(!1),w=s.useCallback(()=>({...f.current.json??{},...u.current}),[]),y=s.useCallback(async()=>{if(!Object.keys(u.current).length)return;if(g.current){m.current=!0;return}g.current=!0,l("saving");const C=u.current;try{const A=await Ee.updateBrand(f.current.id,w(),{...p.current});t(A);for(const L of Object.keys(C))u.current[L]===C[L]?delete p.current[L]:p.current[L]=C[L];a(L=>{const T={...L};for(const M of Object.keys(C))L[M]===C[M]&&delete T[M];return T}),l(m.current?"pending":"idle")}catch(A){l("error"),n({...ln(A,"Could not save the brand"),action:{label:"Retry",onClick:()=>void y()}})}finally{g.current=!1,m.current&&(m.current=!1,y())}},[t,w,n]),b=s.useCallback((C,A)=>{var M;h.current&&(clearTimeout(h.current),h.current=null);for(const j of Object.keys(C))j in p.current||(p.current[j]=((M=f.current.json)==null?void 0:M[j])??null);const L={...u.current,...C};u.current=L,a(L),l("pending");const T=(A==null?void 0:A.debounce)??0;T>0?h.current=setTimeout(()=>void y(),T):y()},[y]),k=s.useCallback(async()=>{h.current&&(clearTimeout(h.current),h.current=null),await y()},[y]),S=s.useCallback(C=>{a({}),u.current={},p.current={},t(C),l("idle")},[t]),E=e.id;return s.useEffect(()=>{a({}),u.current={},p.current={},l("idle")},[E]),s.useEffect(()=>{const C=()=>{Object.keys(u.current).length&&aY(f.current.id,w(),{...p.current}).then(A=>{A&&t(A)})};return window.addEventListener("beforeunload",C),()=>{window.removeEventListener("beforeunload",C),h.current&&clearTimeout(h.current),C()}},[w,t]),{json:w(),state:i,patch:b,flush:k,applyRow:S}}function ay(e){const t=s.useRef(e);t.current=e,s.useEffect(()=>()=>t.current(),[])}function oJ(e){return e==="saving"?"Saving…":e==="pending"?"Unsaved changes":e==="error"?"Not saved":"Saved"}function iJ({brand:e,doc:t}){const{push:n}=rr(),[r,a]=s.useState(!1),i=t.json??{},l=i.meta??{},u=l.name??e.slug,f=nf(i),h=qm(f)??void 0,p=f.filter(b=>b!==h),g=b=>{const k={...l};for(const[S,E]of Object.entries(b)){const C=E.trim();C?k[S]=C:delete k[S]}k.name||(k.name=l.name),t.patch({meta:k})},m=async(b,k)=>{a(!0);try{await t.flush(),t.applyRow(await k())}catch(S){n(ln(S,b))}finally{a(!1)}},w=b=>void m("Could not upload that mark",async()=>{const k=await ZN(e.id,b[0]),S=k.logoEdge;return S&&S<512&&n({kind:"warning",title:"Logo added, but it is small",detail:`Only ${S}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`}),k}),{dropProps:y}=vR({onFiles:w,onReject:()=>n({kind:"warning",title:"That is not an image",detail:"Drop a PNG, SVG or JPG."}),disabled:r});return o.jsxs("div",{className:"sc-ident",...y,children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Logo"}),o.jsx("small",{children:"Drop an image, or tap to add."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx(lJ,{mark:h,name:u,busy:r,onUpload:w}),(h==null?void 0:h.attachable)&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:r,onClick:()=>void m("Could not remove that mark",()=>Ee.deleteLogo(e.id,h.hash??"")),children:"Remove"})]})]}),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Sits on"}),o.jsx("small",{children:"So a dark mark is not shown on a dark ground."})]}),o.jsx("select",{className:"sc-in",value:h.background,disabled:r||!h.attachable,onChange:b=>void m("Could not update that mark",()=>Ee.updateLogo(e.id,h.hash??"",{background:b.target.value})),"aria-label":"Sits on",children:Ww.map(b=>o.jsx("option",{value:b,children:b==="any"?"Any background":`On ${b}`},b))})]}),o.jsx(mk,{label:"Name",value:l.name??"",placeholder:e.slug,maxLength:120,onCommit:b=>g({name:b})}),o.jsx(mk,{label:"Tagline",value:l.tagline??"",placeholder:"Add a tagline",maxLength:200,onCommit:b=>g({tagline:b})}),p.map(b=>o.jsx(cJ,{mark:b,busy:r,onRole:k=>void m("Could not retag that mark",()=>Ee.updateLogo(e.id,b.hash??"",{role:k})),onBackground:k=>void m("Could not update that mark",()=>Ee.updateLogo(e.id,b.hash??"",{background:k})),onRemove:()=>void m("Could not remove that mark",()=>Ee.deleteLogo(e.id,b.hash??""))},b.hash??b.file)),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Variant"}),o.jsx("small",{children:"A second mark for dark or light grounds."})]}),o.jsxs("label",{className:"sc-btn sc-btn-ghost",children:[o.jsx(mr,{size:12}),"Add",o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:r,onChange:b=>{const k=Array.from(b.target.files??[]);b.target.value="",k.length&&w(k)}})]})]})]})}function mk({label:e,value:t,placeholder:n,maxLength:r,onCommit:a}){const[i,l]=s.useState(t),u=s.useRef(t),f=p=>{u.current=p,l(p)};s.useEffect(()=>{u.current=t,l(t)},[t]);const h=()=>{const p=u.current.trim();p!==t&&a(p)};return ay(h),o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:e})}),o.jsx("input",{className:"sc-in",value:i,placeholder:n,"aria-label":e,maxLength:r,dir:"auto",onChange:p=>f(p.target.value),onBlur:()=>{h(),f(u.current.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),p.currentTarget.blur()),p.key==="Escape"&&(f(t),p.currentTarget.blur())}})]})}function lJ({mark:e,name:t,busy:n,onUpload:r}){const[a,i]=s.useState(null);if(e){const l=e.hash?Tr(e.hash):e.file;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:l,alt:`${t} logo`,onLoad:u=>{const f=u.currentTarget,h=Math.max(f.naturalWidth,f.naturalHeight);i(h>0&&h<512?h:null)}})}),a!==null&&o.jsxs("small",{className:"sc-mark-small",children:["Only ",a,"px across. Fine lettering may not survive generation."]})]})}return o.jsxs("label",{className:"sc-well","data-empty":"","aria-label":"Add logo",children:[o.jsx(Ov,{size:16}),o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:n,onChange:l=>{const u=Array.from(l.target.files??[]);l.target.value="",u.length&&r(u)}})]})}function cJ({mark:e,busy:t,onRole:n,onBackground:r,onRemove:a}){const i=e.hash?Tr(e.hash):e.file;return o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:Lh[e.role]})}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:i,alt:Lh[e.role]})}),o.jsx("select",{className:"sc-in",value:e.role,disabled:t||!e.attachable,onChange:l=>n(l.target.value),"aria-label":"Mark role",children:zM.map(l=>o.jsx("option",{value:l,children:Lh[l]},l))}),o.jsx("select",{className:"sc-in",value:e.background,disabled:t||!e.attachable,onChange:l=>r(l.target.value),"aria-label":"Sits on",children:Ww.map(l=>o.jsx("option",{value:l,children:l==="any"?"Any background":`On ${l}`},l))}),e.attachable&&o.jsx("button",{type:"button",disabled:t,onClick:a,"aria-label":`Remove ${Lh[e.role]}`,children:o.jsx(vm,{size:13})})]})]})}const gk={primary:"Primary",secondary:"Secondary",accent:"Accent",neutral:"Neutral"},uJ=(e,t)=>t<=1?gk[e]:`${gk[e]} ${t}`;function dJ(e){return/^(Primary|Secondary|Accent|Neutral)( [2-9]\d*)?$/.test(String(e??"").trim())}const fJ=/^#[0-9A-F]{6}$/;function dr(e){const t=String(e??"").trim(),n=(t.startsWith("#")?t.slice(1):t).toUpperCase();if(/^[0-9A-F]{3}$/.test(n)){const[a,i,l]=n;return`#${a}${a}${i}${i}${l}${l}`}const r=`#${n}`;return fJ.test(r)?r:null}const hJ=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;function pJ(e){const t=String(e??"").trim();return hJ.test(t)?dr(t):null}function ra(e){const t=[],n={primary:0,secondary:0,accent:0,neutral:0},r=(a,i)=>{const l=dr(String((a==null?void 0:a.hex)??""));if(!l)return;n[i]+=1;const u=String((a==null?void 0:a.name)??"").trim();t.push({hex:l,name:u||uJ(i,n[i]),slot:i})};r(e==null?void 0:e.primary,"primary"),r(e==null?void 0:e.secondary,"secondary");for(const a of Array.isArray(e==null?void 0:e.accent)?e.accent:[])r(a,"accent");for(const a of Array.isArray(e==null?void 0:e.neutrals)?e.neutrals:[])r(a,"neutral");return t}function oy(e,t){const n={},r=[],a=[],i=p=>{const g=p.name.trim();return g&&!dJ(g)?{hex:p.hex,name:g}:{hex:p.hex}};for(const p of e){const g=dr(p.hex);if(!g)continue;const m=i({...p,hex:g});p.slot==="neutral"?a.push(m):r.push(m)}const[l,u,...f]=r;l&&(n.primary=l),u&&(n.secondary=u),f.length&&(n.accent=f),a.length&&(n.neutrals=a);const h=String((t==null?void 0:t.usage)??"").trim();return h&&(n.usage=h),n}const vk=e=>e.slot!=="neutral";function r2(e){var l;const t=(l=e[e.length-1])==null?void 0:l.hex;if(!t)return"#808080";const n=Number.parseInt(t.slice(1),16),[r,a,i]=[n>>16&255,n>>8&255,n&255];return`#${[i,r,a].map(u=>u.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function jR(e,t){const n=dr(t);if(!n)return{palette:e,added:!1,swatch:null};const r=ra(e),a=r.find(f=>f.hex===n);if(a)return{palette:e,added:!1,swatch:a};const i=[...r,{hex:n,name:"",slot:r.length?"accent":"primary"}],l=oy(i,e),u=ra(l).find(f=>f.hex===n)??null;return{palette:l,added:!0,swatch:u}}function mJ(e,t){const n=dr(t);if(!n)return{palette:e,removed:!1};const r=ra(e),a=r.filter(i=>i.hex!==n);return a.length===r.length?{palette:e,removed:!1}:{palette:oy(a,e),removed:!0}}function s2(){return(s2=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function AR(e,t){if(e==null)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function K0(e){var t=s.useRef(e),n=s.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var w1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},G0=function(e){return"touches"in e},O4=function(e){return e&&e.ownerDocument.defaultView||self},wk=function(e,t,n){var r=e.getBoundingClientRect(),a=G0(t)?(function(i,l){for(var u=0;u<i.length;u++)if(i[u].identifier===l)return i[u];return i[0]})(t.touches,n):t;return{left:w1((a.pageX-(r.left+O4(e).pageXOffset))/r.width),top:w1((a.pageY-(r.top+O4(e).pageYOffset))/r.height)}},yk=function(e){!G0(e)&&e.preventDefault()},NR=zn.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,a=AR(e,["onMove","onKey","onEnd"]),i=s.useRef(null),l=K0(t),u=K0(n),f=K0(r),h=s.useRef(null),p=s.useRef(!1),g=s.useMemo(function(){var k=function(C){yk(C),(G0(C)?C.touches.length>0:C.buttons>0)&&i.current?l(wk(i.current,C,h.current)):(E(!1),f())},S=function(){E(!1),f()};function E(C){var A=p.current,L=O4(i.current),T=C?L.addEventListener:L.removeEventListener;T(A?"touchmove":"mousemove",k),T(A?"touchend":"mouseup",S)}return[function(C){var A=C.nativeEvent,L=i.current;if(L&&(yk(A),!(function(M,j){return j&&!G0(M)})(A,p.current)&&L)){if(G0(A)){p.current=!0;var T=A.changedTouches||[];T.length&&(h.current=T[0].identifier)}L.focus(),l(wk(L,A,h.current)),E(!0)}},function(C){var A=C.which||C.keyCode;A<37||A>40||(C.preventDefault(),u({left:A===39?.05:A===37?-.05:0,top:A===40?.05:A===38?-.05:0}))},function(C){var A=C.which||C.keyCode;A>=37&&A<=40&&f()},E]},[u,l,f]),m=g[0],w=g[1],y=g[2],b=g[3];return s.useEffect(function(){return b},[b]),zn.createElement("div",s2({},a,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:i,onKeyDown:w,onKeyUp:y,tabIndex:0,role:"slider"}))}),iy=function(e){return e.filter(Boolean).join(" ")},MR=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,i=iy(["react-colorful__pointer",e.className]);return zn.createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},zn.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Xr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},gJ=function(e){return xJ(I4(e))},I4=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Xr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Xr(parseInt(e.substring(6,8),16)/255,2):1}},vJ=function(e){return bJ(yJ(e))},wJ=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:Xr(e.h),s:Xr(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Xr(a/2),a:Xr(r,2)}},F4=function(e){var t=wJ(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},yJ=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),l=r*(1-n),u=r*(1-(t-i)*n),f=r*(1-(1-t+i)*n),h=i%6;return{r:Xr(255*[r,u,l,l,f,r][h]),g:Xr(255*[f,r,r,u,l,l][h]),b:Xr(255*[l,l,f,r,r,u][h]),a:Xr(a,2)}},Th=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},bJ=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=a<1?Th(Xr(255*a)):"";return"#"+Th(t)+Th(n)+Th(r)+i},xJ=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=Math.max(t,n,r),l=i-Math.min(t,n,r),u=l?i===t?(n-r)/l:i===n?2+(r-t)/l:4+(t-n)/l:0;return{h:Xr(60*(u<0?u+6:u)),s:Xr(i?l/i*100:0),v:Xr(i/255*100),a}},kJ=zn.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,a=iy(["react-colorful__hue",e.className]);return zn.createElement("div",{className:a},zn.createElement(NR,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:w1(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":Xr(t),"aria-valuemax":"360","aria-valuemin":"0"},zn.createElement(MR,{className:"react-colorful__hue-pointer",left:t/360,color:F4({h:t,s:100,v:100,a:1})})))}),SJ=zn.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,a={backgroundColor:F4({h:t.h,s:100,v:100,a:1})};return zn.createElement("div",{className:"react-colorful__saturation",style:a},zn.createElement(NR,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:w1(t.s+100*i.left,0,100),v:w1(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+Xr(t.s)+"%, Brightness "+Xr(t.v)+"%"},zn.createElement(MR,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:F4(t)})))}),RR=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},EJ=function(e,t){return e.toLowerCase()===t.toLowerCase()||RR(I4(e),I4(t))};function CJ(e,t,n,r){var a=K0(n),i=K0(r),l=s.useState(function(){return e.toHsva(t)}),u=l[0],f=l[1],h=s.useRef({color:t,hsva:u}),p=s.useRef(!1);s.useEffect(function(){if(!e.equal(t,h.current.color)){var w=e.toHsva(t);h.current={hsva:w,color:t},f(w),p.current=!1}},[t,e]),s.useEffect(function(){var w;RR(u,h.current.hsva)||e.equal(w=e.fromHsva(u),h.current.color)||(h.current={hsva:u,color:w},a(w),p.current=!0)},[u,e,a]);var g=s.useCallback(function(w){f(function(y){return Object.assign({},y,w)})},[]),m=s.useCallback(function(){p.current&&(p.current=!1,i(h.current.color))},[i]);return[u,g,m]}var jJ=typeof window<"u"?s.useLayoutEffect:s.useEffect,AJ=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},bk=new WeakMap,NJ=function(e){jJ(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!bk.has(r)){var a="head"in r?r.head:r,i=(a.ownerDocument||document).createElement("style");i.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var l=AJ();l&&i.setAttribute("nonce",l),bk.set(r,i),a.appendChild(i)}}},[])},MJ=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,i=e.onChange,l=e.onChangeEnd,u=AR(e,["className","colorModel","color","onChange","onChangeEnd"]),f=s.useRef(null);NJ(f);var h=CJ(n,a,i,l),p=h[0],g=h[1],m=h[2],w=iy(["react-colorful",t]);return zn.createElement("div",s2({},u,{ref:f,className:w}),zn.createElement(SJ,{hsva:p,onChange:g,onChangeEnd:m}),zn.createElement(kJ,{hue:p.h,onChange:g,onChangeEnd:m,className:"react-colorful__last-control"}))},RJ={defaultColor:"000",toHsva:gJ,fromHsva:function(e){return vJ({h:e.h,s:e.s,v:e.v,a:1})},equal:EJ},PJ=function(e){return zn.createElement(MJ,s2({},e,{colorModel:RJ}))};function xd({value:e,onChange:t,label:n,presets:r,className:a,triggerStyle:i,triggerProps:l,tip:u,commitMode:f="live",align:h="start",children:p}){const g=dr(e)??"#000000",[m,w]=s.useState(g),[y,b]=s.useState(!1);s.useEffect(()=>{y||w(g)},[g,y]);const k=L=>{const T=dr(L);T&&(w(T),f==="live"&&t(T))},S=L=>{const T=dr(L);T&&(w(T),t(T),f==="close"&&b(!1))},E=L=>{if(b(L),L||f!=="close")return;const T=dr(m);T&&T!==g&&t(T)},C=[...new Set((r??[]).map(L=>dr(L)).filter(L=>!!L))],A=o.jsx(vd,{children:o.jsx("button",{type:"button",className:a??"sc-cp-trigger",style:{background:g,...i},"aria-label":n,...l,children:p})});return o.jsxs(gd,{open:y,onOpenChange:E,children:[u?o.jsx(hr,{label:n,children:A}):A,o.jsxs(wd,{className:"sc-cp",align:h,sideOffset:6,width:"232px",children:[o.jsx(PJ,{color:m,onChange:k}),o.jsxs("div",{className:"sc-cp-foot",children:[o.jsx("span",{className:"sc-cp-preview",style:{background:m},"aria-hidden":!0}),o.jsx("input",{className:"sc-cp-hex",value:m,spellCheck:!1,maxLength:7,"aria-label":"Hex value",onChange:L=>{w(L.target.value);const T=dr(L.target.value);T&&f==="live"&&t(T)},onBlur:()=>w(dr(m)??g),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),f==="close"?S(m):b(!1))}})]}),C.length>0&&o.jsx("div",{className:"sc-cp-presets",children:C.map(L=>o.jsx("button",{type:"button",style:{background:L},"data-on":L===m||void 0,title:L,"aria-label":L,onClick:()=>f==="close"?S(L):k(L)},L))})]})]})}function LJ({doc:e,suggestions:t}){var w;const n=(w=e.json)==null?void 0:w.palette,[r,a]=s.useState(()=>ra(n)),i=JSON.stringify(n??{});s.useEffect(()=>{a(ra(n))},[i]);const l=(y,b=0)=>{a(y),e.patch({palette:oy(y,n)},{debounce:b})},u=(y,b,k=0)=>l(r.map((S,E)=>E===y?{...S,...b}:S),k),f=()=>l([...r,{hex:r2(r),name:"",slot:r.length?"accent":"primary"}]),h=(t??[]).filter(y=>{const b=dr(y.hex);return b&&!r.some(k=>k.hex===b)}),p=(y,b)=>o.jsx($J,{swatch:y,presets:r.map(k=>k.hex),onHex:k=>u(b,{hex:k},300),onRemove:()=>l(r.filter((k,S)=>S!==b))},`${y.slot}-${b}`),g=r.map((y,b)=>[y,b]),m=g.filter(([y])=>!vk(y));return o.jsxs("div",{className:"sc-pal",children:[r.length===0&&o.jsx("p",{className:"sc-pal-empty",children:"No colours yet. Add one and it becomes a chip you can drop into any shot."}),g.filter(([y])=>vk(y)).map(([y,b])=>p(y,b)),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sc-pal-group",children:"Neutrals"}),m.map(([y,b])=>p(y,b))]}),o.jsxs("div",{className:"sc-pal-foot",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:f,children:[o.jsx(mr,{size:12}),"Add colour"]}),h.length>0&&o.jsxs("span",{className:"sc-pal-sugg",children:[o.jsx("small",{children:"From the website"}),h.map(y=>{const b=dr(y.hex);return o.jsx("button",{type:"button",className:"sc-pal-sugg-chip",style:{background:b},title:`Add ${b}`,"aria-label":`Add ${b}`,onClick:()=>l([...r,{hex:b,name:"",slot:"accent"}])},b)})]})]})]})}function $J({swatch:e,presets:t,onHex:n,onRemove:r}){const[a,i]=s.useState(e.hex);s.useEffect(()=>i(e.hex),[e.hex]);const l=()=>{const u=dr(a);u&&n(u),i(u??e.hex)};return ay(()=>{a!==e.hex&&l()}),o.jsxs("div",{className:"sc-pal-row",children:[o.jsx(xd,{value:e.hex,onChange:n,label:`${e.name} color`,presets:t,className:"sc-pal-chip"}),o.jsx("span",{className:"sc-pal-name",children:e.name}),o.jsx("input",{className:"sc-in sc-pal-hex",value:a,spellCheck:!1,maxLength:7,"aria-label":`${e.name} hex`,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur())}}),o.jsx("button",{type:"button",className:"sc-pal-act","data-danger":"",onClick:r,"aria-label":`Remove ${e.name}`,title:"Remove",children:o.jsx(vm,{size:13})})]})}function TJ({onSaveState:e}){var w,y;const{brand:t}=cn(),{push:n}=rr(),r=aJ();s.useEffect(()=>e(r.state),[r.state,e]);const[a,i]=s.useState(!1),[l,u]=s.useState([]),f=((y=(w=r.json)==null?void 0:w.meta)==null?void 0:y.website)??"",[h,p]=s.useState(f);s.useEffect(()=>p(f),[f]);const g=()=>{var E;const b=h.trim(),k=b&&!/^https?:\/\//i.test(b)?`https://${b}`:b;p(k);const S={...((E=r.json)==null?void 0:E.meta)??{}};k?S.website=k:delete S.website,r.patch({meta:S})};ay(()=>{h.trim()!==f&&g()});const m=async()=>{var b,k,S;i(!0);try{await r.flush();const E=await Ee.refreshBrandFromUrl(t.id);r.applyRow(E),u(((b=E.suggestions)==null?void 0:b.palette)??[]),n({kind:(k=E.warnings)!=null&&k.length?"warning":"success",title:"Read the website again",detail:(S=E.warnings)!=null&&S.length?E.warnings.join(" "):"Your edits were kept."})}catch(E){n(ln(E,"Could not read that website"))}finally{i(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(us,{title:"Identity",sub:"The name and the mark.",children:o.jsx(iJ,{brand:t,doc:r})}),o.jsx(us,{title:"Palette",sub:"Favoured on a shot that asks for the kit.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(LJ,{doc:r,suggestions:l})})}),o.jsx(us,{title:"We never",sub:"Held on every shot, whether the kit is asked for or not.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(sJ,{doc:r})})}),o.jsxs(us,{title:"Website and file",sub:"The kit is a file, not a lock-in.",children:[o.jsxs("div",{className:"sc-set-row","data-stack":"",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Website"}),o.jsx("small",{children:"Reads colours and marks from the site again. Edits are kept; new colours are offered, not applied."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("input",{className:"sc-in",value:h,type:"url",inputMode:"url",placeholder:"acme.coffee","aria-label":"Brand website",onChange:b=>p(b.target.value),onBlur:g,onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),b.currentTarget.blur())}}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:!f||a,onClick:()=>void m(),children:[a?o.jsx(Pr,{size:"1"}):o.jsx(nE,{size:13})," Refresh"]})]})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export .brand"}),o.jsx("small",{"data-prose":"",children:"A zip holding brand.json and every image it references: the form any tool can read."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:rY(t.id),download:!0,onClick:()=>void r.flush(),children:"Export"})]})]})]})}const wl=e=>e.replace(/\s*\(BYOK\)\s*$/i,""),y1="codex-cli";function DJ(e,t){var n;return e.some(r=>r.id===t)?t:((n=e[0])==null?void 0:n.id)??y1}const HJ=e=>e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");function OJ(e){return e.free?e.localOnly?"Runs on your ChatGPT plan":"No cost per image":`$${HJ(e.perGeneration)} / image`}function IJ(e,t){if(t)return e.available?"Manage":"Connect";if(e.available)return e.id===y1?"Manage":null;switch(e.code){case"update-needed":return"Update";case"env-conflict":return"Fix";case"not-installed":case"not-authenticated":case"unverified":return"Set up";default:return null}}function FJ(e){if(e.trim()==="")return null;const t=e.trim().replace(/^\$\s*|\s*\$$/g,"").replace(/\s+/g,""),n=/^\d{1,3}(,\d{3})+(\.\d+)?$/.test(t)?t.replace(/,/g,""):t;if(/^(\d+(\.\d*)?|\.\d+)$/.test(n))return Number(n)}function _J({engines:e,onSaved:t,thisComputer:n}){const r=e.filter(f=>!f.free),{push:a}=rr(),[i,l]=s.useState({});s.useEffect(()=>{l(Object.fromEntries(r.map(f=>[f.id,f.cap===null?"":String(f.cap)])))},[e]);const u=async f=>{const h=g=>l(m=>({...m,[f.id]:g===null?"":String(g)})),p=FJ(i[f.id]??"");if(p===void 0){h(f.cap),a({kind:"warning",title:"That is not an amount",detail:"Type the cap in dollars, like 20 or 12.50."});return}if(p===f.cap){h(p);return}try{await Ee.setCap(f.id,p),h(p),t()}catch(g){h(f.cap),a(ln(g,"Could not save that cap"))}};return r.length?o.jsx(us,{title:"Monthly caps",sub:n?"Your own API budget. Generation stops before a cap is crossed, so a runaway loop cannot spend your month.":"Your own API budget. Generation stops before a cap is crossed. Caps are set on the computer running Scenri.",children:r.map(f=>{const h=f.generationsLeft,p=f.generationsTotal,g=p&&p>0?Math.min(100,Math.round((p-(h??0))/p*100)):0,m=`$${f.monthlySpend.toFixed(2)} this month`;return o.jsxs("div",{className:"sc-cap",children:[o.jsxs("div",{className:"sc-cap-top",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:wl(f.displayName)}),o.jsx("small",{children:h===null?m:`${m} · ${h} left`})]}),o.jsxs("div",{className:"sc-cap-in",children:[o.jsx("span",{className:"sc-cap-dollar",children:"$"}),o.jsx("input",{className:"sc-in",inputMode:"decimal",placeholder:"None",value:i[f.id]??"",onChange:w=>l(y=>({...y,[f.id]:w.target.value})),onBlur:()=>void u(f),disabled:!n,"aria-label":`${wl(f.displayName)} monthly cap in dollars`})]})]}),p!==null&&o.jsx("div",{className:"sc-meter",children:o.jsx("i",{style:{width:`${g}%`}})})]},f.id)})}):o.jsx(us,{title:"Monthly caps",sub:"Nothing to cap yet. Caps apply to engines you pay for per image. Codex usage counts against your ChatGPT plan, which OpenAI meters, not Scenri.",children:o.jsx("p",{className:"sc-set-empty",children:"Add a paid engine key and its cap appears here."})})}function VJ({onDone:e,thisComputer:t}){const{brand:n,resetShots:r}=cn(),{refresh:a}=Mn(),i=Un(),[l,u]=s.useState(!1),f=s.useCallback(async h=>{u(!0);try{await Ee.deleteData(h),e(),h==="shots"&&r(),h==="all"&&window.location.replace("/")}finally{u(!1)}},[e,r]);return o.jsxs(o.Fragment,{children:[o.jsx(us,{title:"This brand",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete this brand"}),o.jsxs("small",{"data-prose":"",children:["Removes ",Ca(n),", its sets and every shot. Other brands stay."]})]}),o.jsx(Xn,{label:"Delete brand",title:`Delete ${Ca(n)}?`,body:"The kit, its sets and every shot go with it. Exports you already downloaded stay yours.",busy:l,onConfirm:()=>{u(!0),Ee.deleteBrand(n.id).then(()=>a()).then(()=>i("/",{replace:!0})).finally(()=>u(!1))}})]})}),t&&o.jsxs(us,{title:"Every brand",children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete generated shots"}),o.jsx("small",{"data-prose":"",children:"Removes every set and every generated shot, in every brand. Brands, products, people and places stay."})]}),o.jsx(Xn,{label:"Delete shots",title:"Delete every generated shot?",body:"Brands, products, people and places stay. Every set and every generated shot goes.",busy:l,onConfirm:()=>void f("shots")})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete all local data"}),o.jsx("small",{"data-prose":"",children:"Brands, cast, sets, shots and saved keys, in one go."})]}),o.jsx(Xn,{label:"Delete everything",title:"Delete everything on this machine?",body:"The whole library folder is removed: brands, cast, sets, shots and your saved keys. There is no undo.",busy:l,onConfirm:()=>void f("all")})]})]})]})}function ZJ(e,t){return t?{body:t,action:"retry"}:e?e.installKind==="dev"?{body:"Running from source; nothing to put on a desktop.",action:null}:e.supported?e.installed?{body:"Scenri is on your desktop.",action:"recreate"}:{body:"Open Scenri without a terminal.",action:"add"}:{body:"Desktop shortcuts are not available on this system yet.",action:null}:{body:"Checking this machine.",action:null}}function zJ({status:e,onStatus:t}){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),f=s.useRef(null);s.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=async()=>{if(!a){i(!0),r(null);try{await Ee.desktopInstall(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1600),t(await Ee.desktop())}catch(g){r(String((g==null?void 0:g.message)??g))}finally{i(!1)}}},p=ZJ(e,n);return o.jsx(us,{title:"This computer",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Desktop shortcut"}),o.jsx("small",{"data-prose":"",children:p.body})]}),p.action&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a,onClick:()=>void h(),children:l?"Added":a?"Adding…":p.action==="add"?"Add to desktop":p.action==="recreate"?"Recreate":"Try again"})]})})}function PR(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z"})})}function BJ(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})})}function UJ(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M24 10.262v2.712h-9.518V24h-3.034V10.262zm0-5.131v2.717H8.755V24H5.722V5.131zM24 0v2.717H3.034V24H0V0z"})})}const WJ=[{engineId:"openrouter",settingKey:"openrouter_api_key",hint:"sk-or-...",keysUrl:"https://openrouter.ai/keys"},{engineId:"replicate",settingKey:"replicate_api_token",hint:"r8_...",keysUrl:"https://replicate.com/account/api-tokens"},{engineId:"fal",settingKey:"fal_key",hint:"fal_...",keysUrl:"https://fal.ai/dashboard/keys"}],LR=e=>WJ.find(t=>t.engineId===e),$R={"codex-cli":{Mark:PR,size:16,plate:"#FFFFFF",ink:"#000000"},openrouter:{Mark:BJ,size:18,plate:"#FFFFFF",ink:"#7624F4"},replicate:{Mark:UJ,size:15,plate:"#E42022",ink:"#FFFFFF"}},TR=e=>{const t=$R[e];return t?{plate:t.plate,ink:t.ink}:void 0},KJ={demo:mF};function DR({engineId:e,scale:t=1}){const n=$R[e];if(n){const a=Math.round(n.size*t);return o.jsx(n.Mark,{width:a,height:a})}const r=KJ[e]??n1;return o.jsx(r,{size:Math.round(15*t)})}const GJ=e=>[...e].sort((t,n)=>+(n.id===y1)-+(t.id===y1));function YJ({engines:e}){const t=Vl(),r=e.filter(a=>a.available).length===0;return o.jsx(us,{children:GJ(e).map(a=>{const i=LR(a.id),l=wl(a.displayName),u=IJ(a,!!i),f=a.available?"Connected":null,h=!f&&a.reason&&(!u||a.code==="unverified"),p=TR(a.id);return o.jsxs("div",{className:"sc-eng","data-connected":a.available?"":void 0,children:[o.jsx("span",{className:"sc-eng-ic","data-brand":p?"":void 0,style:p?{"--sc-plate":p.plate,"--sc-ink":p.ink}:void 0,children:o.jsx(DR,{engineId:a.id})}),o.jsxs("span",{className:"sc-eng-name",children:[o.jsx("b",{children:l}),o.jsx("small",{children:OJ(a)})]}),f&&o.jsxs("span",{className:"sc-stat",children:[o.jsx("span",{className:"d"}),f]}),h&&o.jsx("span",{className:"sc-stat sc-stat-why",children:a.reason}),u&&o.jsx("button",{type:"button",className:`sc-btn ${r&&!i?"sc-btn-primary":"sc-btn-ghost"} sc-eng-act`,onClick:()=>t(a.id),"aria-label":`${u} ${l}`,children:u})]},a.id)})})}const qJ=e=>e>1e9?`${(e/1e9).toFixed(1)} GB`:e>1e6?`${Math.round(e/1e6)} MB`:`${Math.round(e/1e3)} KB`,F8=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function XJ(e){return e===0?0:e<3?1:e<6?2:e<12?3:4}function xk(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function kk(e,t){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),a=new Date(r);a.setDate(r.getDate()-r.getDay()-(t-1)*7);const i=(t-1)*7+r.getDay()+1,l=[],u=[];let f=-1,h=0;for(let p=0;p<i;p++){const g=new Date(a);g.setDate(a.getDate()+p);const m=xk(g),w=e.get(m)??0;if(h+=w,l.push({key:m,level:XJ(w),title:w?`${w} run${w===1?"":"s"} on ${g.getDate()} ${F8[g.getMonth()]}`:`nothing on ${g.getDate()} ${F8[g.getMonth()]}`}),g.getDay()===0){const y=g.getMonth()!==f&&g.getDate()<=7;y&&(f=g.getMonth()),u.push({key:m,label:y?F8[g.getMonth()]:""})}}return{cells:l,months:u,sum:h,from:xk(a)}}function QJ({info:e,thisComputer:t}){const{push:n}=rr();return o.jsxs(us,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Library folder"}),o.jsx("small",{children:e?[e.dir,`${qJ(e.bytes)} across ${e.images} images`].filter(Boolean).join(" · "):"…"})]}),t&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void Ee.reveal().catch(r=>n(ln(r,"Could not open the library folder"))),children:"Reveal"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export everything"}),o.jsx("small",{children:"One zip: brands, cast, prompts, shots. Never keys."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:"/api/export/all",download:!0,children:"Export"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Telemetry"}),o.jsx("small",{children:"There is none. This row exists to say so."})]}),o.jsx("span",{className:"sc-tag",children:"off, permanently"})]})]})}async function JJ(e,t){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.activeElement,r=document.createElement("textarea");r.value=e,r.readOnly=!0,r.setAttribute("aria-hidden","true"),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;",(t??document.body).appendChild(r);try{return r.focus(),r.select(),r.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{r.remove(),n==null||n.focus()}}const Hd=function(e,t){let a=e;const i=H0[t];let l=null,u=0,f=null;const h=[],p={},g=function(M,j){u=a*4+17,l=(function(P){const R=new Array(P);for(let H=0;H<P;H+=1){R[H]=new Array(P);for(let D=0;D<P;D+=1)R[H][D]=null}return R})(u),m(0,0),m(u-7,0),m(0,u-7),b(),y(),S(M,j),a>=7&&k(M),f==null&&(f=A(a,i,h)),E(f,j)},m=function(M,j){for(let P=-1;P<=7;P+=1)if(!(M+P<=-1||u<=M+P))for(let R=-1;R<=7;R+=1)j+R<=-1||u<=j+R||(0<=P&&P<=6&&(R==0||R==6)||0<=R&&R<=6&&(P==0||P==6)||2<=P&&P<=4&&2<=R&&R<=4?l[M+P][j+R]=!0:l[M+P][j+R]=!1)},w=function(){let M=0,j=0;for(let P=0;P<8;P+=1){g(!0,P);const R=Qi.getLostPoint(p);(P==0||M>R)&&(M=R,j=P)}return j},y=function(){for(let M=8;M<u-8;M+=1)l[M][6]==null&&(l[M][6]=M%2==0);for(let M=8;M<u-8;M+=1)l[6][M]==null&&(l[6][M]=M%2==0)},b=function(){const M=Qi.getPatternPosition(a);for(let j=0;j<M.length;j+=1)for(let P=0;P<M.length;P+=1){const R=M[j],H=M[P];if(l[R][H]==null)for(let D=-2;D<=2;D+=1)for(let U=-2;U<=2;U+=1)D==-2||D==2||U==-2||U==2||D==0&&U==0?l[R+D][H+U]=!0:l[R+D][H+U]=!1}},k=function(M){const j=Qi.getBCHTypeNumber(a);for(let P=0;P<18;P+=1){const R=!M&&(j>>P&1)==1;l[Math.floor(P/3)][P%3+u-8-3]=R}for(let P=0;P<18;P+=1){const R=!M&&(j>>P&1)==1;l[P%3+u-8-3][Math.floor(P/3)]=R}},S=function(M,j){const P=i<<3|j,R=Qi.getBCHTypeInfo(P);for(let H=0;H<15;H+=1){const D=!M&&(R>>H&1)==1;H<6?l[H][8]=D:H<8?l[H+1][8]=D:l[u-15+H][8]=D}for(let H=0;H<15;H+=1){const D=!M&&(R>>H&1)==1;H<8?l[8][u-H-1]=D:H<9?l[8][15-H-1+1]=D:l[8][15-H-1]=D}l[u-8][8]=!M},E=function(M,j){let P=-1,R=u-1,H=7,D=0;const U=Qi.getMaskFunction(j);for(let V=u-1;V>0;V-=2)for(V==6&&(V-=1);;){for(let B=0;B<2;B+=1)if(l[R][V-B]==null){let G=!1;D<M.length&&(G=(M[D]>>>H&1)==1),U(R,V-B)&&(G=!G),l[R][V-B]=G,H-=1,H==-1&&(D+=1,H=7)}if(R+=P,R<0||u<=R){R-=P,P=-P;break}}},C=function(M,j){let P=0,R=0,H=0;const D=new Array(j.length),U=new Array(j.length);for(let _=0;_<j.length;_+=1){const O=j[_].dataCount,I=j[_].totalCount-O;R=Math.max(R,O),H=Math.max(H,I),D[_]=new Array(O);for(let Z=0;Z<D[_].length;Z+=1)D[_][Z]=255&M.getBuffer()[Z+P];P+=O;const K=Qi.getErrorCorrectPolynomial(I),q=b1(D[_],K.getLength()-1).mod(K);U[_]=new Array(K.getLength()-1);for(let Z=0;Z<U[_].length;Z+=1){const ee=Z+q.getLength()-U[_].length;U[_][Z]=ee>=0?q.getAt(ee):0}}let V=0;for(let _=0;_<j.length;_+=1)V+=j[_].totalCount;const B=new Array(V);let G=0;for(let _=0;_<R;_+=1)for(let O=0;O<j.length;O+=1)_<D[O].length&&(B[G]=D[O][_],G+=1);for(let _=0;_<H;_+=1)for(let O=0;O<j.length;O+=1)_<U[O].length&&(B[G]=U[O][_],G+=1);return B},A=function(M,j,P){const R=Sk.getRSBlocks(M,j),H=Ek();for(let U=0;U<P.length;U+=1){const V=P[U];H.put(V.getMode(),4),H.put(V.getLength(),Qi.getLengthInBits(V.getMode(),M)),V.write(H)}let D=0;for(let U=0;U<R.length;U+=1)D+=R[U].dataCount;if(H.getLengthInBits()>D*8)throw"code length overflow. ("+H.getLengthInBits()+">"+D*8+")";for(H.getLengthInBits()+4<=D*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=D*8||(H.put(236,8),H.getLengthInBits()>=D*8));)H.put(17,8);return C(H,R)};p.addData=function(M,j){j=j||"Byte";let P=null;switch(j){case"Numeric":P=eee(M);break;case"Alphanumeric":P=tee(M);break;case"Byte":P=nee(M);break;case"Kanji":P=ree(M);break;default:throw"mode:"+j}h.push(P),f=null},p.isDark=function(M,j){if(M<0||u<=M||j<0||u<=j)throw M+","+j;return l[M][j]},p.getModuleCount=function(){return u},p.make=function(){if(a<1){let M=1;for(;M<40;M++){const j=Sk.getRSBlocks(M,i),P=Ek();for(let H=0;H<h.length;H++){const D=h[H];P.put(D.getMode(),4),P.put(D.getLength(),Qi.getLengthInBits(D.getMode(),M)),D.write(P)}let R=0;for(let H=0;H<j.length;H++)R+=j[H].dataCount;if(P.getLengthInBits()<=R*8)break}a=M}g(!1,w())},p.createTableTag=function(M,j){M=M||2,j=typeof j>"u"?M*4:j;let P="";P+='<table style="',P+=" border-width: 0px; border-style: none;",P+=" border-collapse: collapse;",P+=" padding: 0px; margin: "+j+"px;",P+='">',P+="<tbody>";for(let R=0;R<p.getModuleCount();R+=1){P+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)P+='<td style="',P+=" border-width: 0px; border-style: none;",P+=" border-collapse: collapse;",P+=" padding: 0px; margin: 0px;",P+=" width: "+M+"px;",P+=" height: "+M+"px;",P+=" background-color: ",P+=p.isDark(R,H)?"#000000":"#ffffff",P+=";",P+='"/>';P+="</tr>"}return P+="</tbody>",P+="</table>",P},p.createSvgTag=function(M,j,P,R){let H={};typeof arguments[0]=="object"&&(H=arguments[0],M=H.cellSize,j=H.margin,P=H.alt,R=H.title),M=M||2,j=typeof j>"u"?M*4:j,P=typeof P=="string"?{text:P}:P||{},P.text=P.text||null,P.id=P.text?P.id||"qrcode-description":null,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-title":null;const D=p.getModuleCount()*M+j*2;let U,V,B,G,_="",O;for(O="l"+M+",0 0,"+M+" -"+M+",0 0,-"+M+"z ",_+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',_+=H.scalable?"":' width="'+D+'px" height="'+D+'px"',_+=' viewBox="0 0 '+D+" "+D+'" ',_+=' preserveAspectRatio="xMinYMin meet"',_+=R.text||P.text?' role="img" aria-labelledby="'+L([R.id,P.id].join(" ").trim())+'"':"",_+=">",_+=R.text?'<title id="'+L(R.id)+'">'+L(R.text)+"</title>":"",_+=P.text?'<description id="'+L(P.id)+'">'+L(P.text)+"</description>":"",_+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',_+='<path d="',B=0;B<p.getModuleCount();B+=1)for(G=B*M+j,U=0;U<p.getModuleCount();U+=1)p.isDark(B,U)&&(V=U*M+j,_+="M"+V+","+G+O);return _+='" stroke="transparent" fill="black"/>',_+="</svg>",_},p.createDataURL=function(M,j){M=M||2,j=typeof j>"u"?M*4:j;const P=p.getModuleCount()*M+j*2,R=j,H=P-j;return iee(P,P,function(D,U){if(R<=D&&D<H&&R<=U&&U<H){const V=Math.floor((D-R)/M),B=Math.floor((U-R)/M);return p.isDark(B,V)?0:1}else return 1})},p.createImgTag=function(M,j,P){M=M||2,j=typeof j>"u"?M*4:j;const R=p.getModuleCount()*M+j*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(M,j),H+='"',H+=' width="',H+=R,H+='"',H+=' height="',H+=R,H+='"',P&&(H+=' alt="',H+=L(P),H+='"'),H+="/>",H};const L=function(M){let j="";for(let P=0;P<M.length;P+=1){const R=M.charAt(P);switch(R){case"<":j+="<";break;case">":j+=">";break;case"&":j+="&";break;case'"':j+=""";break;default:j+=R;break}}return j},T=function(M){M=typeof M>"u"?2:M;const P=p.getModuleCount()*1+M*2,R=M,H=P-M;let D,U,V,B,G;const _={"██":"█","█ ":"▀"," █":"▄"," ":" "},O={"██":"▀","█ ":"▀"," █":" "," ":" "};let I="";for(D=0;D<P;D+=2){for(V=Math.floor((D-R)/1),B=Math.floor((D+1-R)/1),U=0;U<P;U+=1)G="█",R<=U&&U<H&&R<=D&&D<H&&p.isDark(V,Math.floor((U-R)/1))&&(G=" "),R<=U&&U<H&&R<=D+1&&D+1<H&&p.isDark(B,Math.floor((U-R)/1))?G+=" ":G+="█",I+=M<1&&D+1>=H?O[G]:_[G];I+=`
|
|
97
|
+
`}return P%2&&M>0?I.substring(0,I.length-P-1)+Array(P+1).join("▀"):I.substring(0,I.length-1)};return p.createASCII=function(M,j){if(M=M||1,M<2)return T(j);M-=1,j=typeof j>"u"?M*2:j;const P=p.getModuleCount()*M+j*2,R=j,H=P-j;let D,U,V,B;const G=Array(M+1).join("██"),_=Array(M+1).join(" ");let O="",I="";for(D=0;D<P;D+=1){for(V=Math.floor((D-R)/M),I="",U=0;U<P;U+=1)B=1,R<=U&&U<H&&R<=D&&D<H&&p.isDark(V,Math.floor((U-R)/M))&&(B=0),I+=B?G:_;for(V=0;V<M;V+=1)O+=I+`
|
|
98
|
+
`}return O.substring(0,O.length-1)},p.renderTo2dContext=function(M,j){j=j||2;const P=p.getModuleCount();for(let R=0;R<P;R++)for(let H=0;H<P;H++)M.fillStyle=p.isDark(R,H)?"black":"white",M.fillRect(H*j,R*j,j,j)},p};Hd.stringToBytes=function(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t.push(r&255)}return t};Hd.createStringToBytes=function(e,t){const n=(function(){const a=aee(e),i=function(){const f=a.read();if(f==-1)throw"eof";return f};let l=0;const u={};for(;;){const f=a.read();if(f==-1)break;const h=i(),p=i(),g=i(),m=String.fromCharCode(f<<8|h),w=p<<8|g;u[m]=w,l+=1}if(l!=t)throw l+" != "+t;return u})(),r=63;return function(a){const i=[];for(let l=0;l<a.length;l+=1){const u=a.charCodeAt(l);if(u<128)i.push(u);else{const f=n[a.charAt(l)];typeof f=="number"?(f&255)==f?i.push(f):(i.push(f>>>8),i.push(f&255)):i.push(r)}}return i}};const is={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},H0={L:1,M:0,Q:3,H:2},Xi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Qi=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r=21522,a={},i=function(l){let u=0;for(;l!=0;)u+=1,l>>>=1;return u};return a.getBCHTypeInfo=function(l){let u=l<<10;for(;i(u)-i(t)>=0;)u^=t<<i(u)-i(t);return(l<<10|u)^r},a.getBCHTypeNumber=function(l){let u=l<<12;for(;i(u)-i(n)>=0;)u^=n<<i(u)-i(n);return l<<12|u},a.getPatternPosition=function(l){return e[l-1]},a.getMaskFunction=function(l){switch(l){case Xi.PATTERN000:return function(u,f){return(u+f)%2==0};case Xi.PATTERN001:return function(u,f){return u%2==0};case Xi.PATTERN010:return function(u,f){return f%3==0};case Xi.PATTERN011:return function(u,f){return(u+f)%3==0};case Xi.PATTERN100:return function(u,f){return(Math.floor(u/2)+Math.floor(f/3))%2==0};case Xi.PATTERN101:return function(u,f){return u*f%2+u*f%3==0};case Xi.PATTERN110:return function(u,f){return(u*f%2+u*f%3)%2==0};case Xi.PATTERN111:return function(u,f){return(u*f%3+(u+f)%2)%2==0};default:throw"bad maskPattern:"+l}},a.getErrorCorrectPolynomial=function(l){let u=b1([1],0);for(let f=0;f<l;f+=1)u=u.multiply(b1([1,tl.gexp(f)],0));return u},a.getLengthInBits=function(l,u){if(1<=u&&u<10)switch(l){case is.MODE_NUMBER:return 10;case is.MODE_ALPHA_NUM:return 9;case is.MODE_8BIT_BYTE:return 8;case is.MODE_KANJI:return 8;default:throw"mode:"+l}else if(u<27)switch(l){case is.MODE_NUMBER:return 12;case is.MODE_ALPHA_NUM:return 11;case is.MODE_8BIT_BYTE:return 16;case is.MODE_KANJI:return 10;default:throw"mode:"+l}else if(u<41)switch(l){case is.MODE_NUMBER:return 14;case is.MODE_ALPHA_NUM:return 13;case is.MODE_8BIT_BYTE:return 16;case is.MODE_KANJI:return 12;default:throw"mode:"+l}else throw"type:"+u},a.getLostPoint=function(l){const u=l.getModuleCount();let f=0;for(let g=0;g<u;g+=1)for(let m=0;m<u;m+=1){let w=0;const y=l.isDark(g,m);for(let b=-1;b<=1;b+=1)if(!(g+b<0||u<=g+b))for(let k=-1;k<=1;k+=1)m+k<0||u<=m+k||b==0&&k==0||y==l.isDark(g+b,m+k)&&(w+=1);w>5&&(f+=3+w-5)}for(let g=0;g<u-1;g+=1)for(let m=0;m<u-1;m+=1){let w=0;l.isDark(g,m)&&(w+=1),l.isDark(g+1,m)&&(w+=1),l.isDark(g,m+1)&&(w+=1),l.isDark(g+1,m+1)&&(w+=1),(w==0||w==4)&&(f+=3)}for(let g=0;g<u;g+=1)for(let m=0;m<u-6;m+=1)l.isDark(g,m)&&!l.isDark(g,m+1)&&l.isDark(g,m+2)&&l.isDark(g,m+3)&&l.isDark(g,m+4)&&!l.isDark(g,m+5)&&l.isDark(g,m+6)&&(f+=40);for(let g=0;g<u;g+=1)for(let m=0;m<u-6;m+=1)l.isDark(m,g)&&!l.isDark(m+1,g)&&l.isDark(m+2,g)&&l.isDark(m+3,g)&&l.isDark(m+4,g)&&!l.isDark(m+5,g)&&l.isDark(m+6,g)&&(f+=40);let h=0;for(let g=0;g<u;g+=1)for(let m=0;m<u;m+=1)l.isDark(m,g)&&(h+=1);const p=Math.abs(100*h/u/u-50)/5;return f+=p*10,f},a})(),tl=(function(){const e=new Array(256),t=new Array(256);for(let r=0;r<8;r+=1)e[r]=1<<r;for(let r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(let r=0;r<255;r+=1)t[e[r]]=r;const n={};return n.glog=function(r){if(r<1)throw"glog("+r+")";return t[r]},n.gexp=function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return e[r]},n})(),b1=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const n=(function(){let a=0;for(;a<e.length&&e[a]==0;)a+=1;const i=new Array(e.length-a+t);for(let l=0;l<e.length-a;l+=1)i[l]=e[l+a];return i})(),r={};return r.getAt=function(a){return n[a]},r.getLength=function(){return n.length},r.multiply=function(a){const i=new Array(r.getLength()+a.getLength()-1);for(let l=0;l<r.getLength();l+=1)for(let u=0;u<a.getLength();u+=1)i[l+u]^=tl.gexp(tl.glog(r.getAt(l))+tl.glog(a.getAt(u)));return b1(i,0)},r.mod=function(a){if(r.getLength()-a.getLength()<0)return r;const i=tl.glog(r.getAt(0))-tl.glog(a.getAt(0)),l=new Array(r.getLength());for(let u=0;u<r.getLength();u+=1)l[u]=r.getAt(u);for(let u=0;u<a.getLength();u+=1)l[u]^=tl.gexp(tl.glog(a.getAt(u))+i);return b1(l,0).mod(a)},r},Sk=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(a,i){const l={};return l.totalCount=a,l.dataCount=i,l},n={},r=function(a,i){switch(i){case H0.L:return e[(a-1)*4+0];case H0.M:return e[(a-1)*4+1];case H0.Q:return e[(a-1)*4+2];case H0.H:return e[(a-1)*4+3];default:return}};return n.getRSBlocks=function(a,i){const l=r(a,i);if(typeof l>"u")throw"bad rs block @ typeNumber:"+a+"/errorCorrectionLevel:"+i;const u=l.length/3,f=[];for(let h=0;h<u;h+=1){const p=l[h*3+0],g=l[h*3+1],m=l[h*3+2];for(let w=0;w<p;w+=1)f.push(t(g,m))}return f},n})(),Ek=function(){const e=[];let t=0;const n={};return n.getBuffer=function(){return e},n.getAt=function(r){const a=Math.floor(r/8);return(e[a]>>>7-r%8&1)==1},n.put=function(r,a){for(let i=0;i<a;i+=1)n.putBit((r>>>a-i-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(r){const a=Math.floor(t/8);e.length<=a&&e.push(0),r&&(e[a]|=128>>>t%8),t+=1},n},eee=function(e){const t=is.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(l){return n.length},r.write=function(l){const u=n;let f=0;for(;f+2<u.length;)l.put(a(u.substring(f,f+3)),10),f+=3;f<u.length&&(u.length-f==1?l.put(a(u.substring(f,f+1)),4):u.length-f==2&&l.put(a(u.substring(f,f+2)),7))};const a=function(l){let u=0;for(let f=0;f<l.length;f+=1)u=u*10+i(l.charAt(f));return u},i=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;throw"illegal char :"+l};return r},tee=function(e){const t=is.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(i){return n.length},r.write=function(i){const l=n;let u=0;for(;u+1<l.length;)i.put(a(l.charAt(u))*45+a(l.charAt(u+1)),11),u+=2;u<l.length&&i.put(a(l.charAt(u)),6)};const a=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;if("A"<=i&&i<="Z")return i.charCodeAt(0)-65+10;switch(i){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+i}};return r},nee=function(e){const t=is.MODE_8BIT_BYTE,n=Hd.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(a){return n.length},r.write=function(a){for(let i=0;i<n.length;i+=1)a.put(n[i],8)},r},ree=function(e){const t=is.MODE_KANJI,n=Hd.stringToBytes;(function(i,l){const u=n(i);if(u.length!=2||(u[0]<<8|u[1])!=l)throw"sjis not supported."})("友",38726);const r=n(e),a={};return a.getMode=function(){return t},a.getLength=function(i){return~~(r.length/2)},a.write=function(i){const l=r;let u=0;for(;u+1<l.length;){let f=(255&l[u])<<8|255&l[u+1];if(33088<=f&&f<=40956)f-=33088;else if(57408<=f&&f<=60351)f-=49472;else throw"illegal char at "+(u+1)+"/"+f;f=(f>>>8&255)*192+(f&255),i.put(f,13),u+=2}if(u<l.length)throw"illegal char at "+(u+1)},a},HR=function(){const e=[],t={};return t.writeByte=function(n){e.push(n&255)},t.writeShort=function(n){t.writeByte(n),t.writeByte(n>>>8)},t.writeBytes=function(n,r,a){r=r||0,a=a||n.length;for(let i=0;i<a;i+=1)t.writeByte(n[i+r])},t.writeString=function(n){for(let r=0;r<n.length;r+=1)t.writeByte(n.charCodeAt(r))},t.toByteArray=function(){return e},t.toString=function(){let n="";n+="[";for(let r=0;r<e.length;r+=1)r>0&&(n+=","),n+=e[r];return n+="]",n},t},see=function(){let e=0,t=0,n=0,r="";const a={},i=function(u){r+=String.fromCharCode(l(u&63))},l=function(u){if(u<0)throw"n:"+u;if(u<26)return 65+u;if(u<52)return 97+(u-26);if(u<62)return 48+(u-52);if(u==62)return 43;if(u==63)return 47;throw"n:"+u};return a.writeByte=function(u){for(e=e<<8|u&255,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},a.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0){const u=3-n%3;for(let f=0;f<u;f+=1)r+="="}},a.toString=function(){return r},a},aee=function(e){const t=e;let n=0,r=0,a=0;const i={};i.read=function(){for(;a<8;){if(n>=t.length){if(a==0)return-1;throw"unexpected end of file./"+a}const f=t.charAt(n);if(n+=1,f=="=")return a=0,-1;if(f.match(/^\s$/))continue;r=r<<6|l(f.charCodeAt(0)),a+=6}const u=r>>>a-8&255;return a-=8,u};const l=function(u){if(65<=u&&u<=90)return u-65;if(97<=u&&u<=122)return u-97+26;if(48<=u&&u<=57)return u-48+52;if(u==43)return 62;if(u==47)return 63;throw"c:"+u};return i},oee=function(e,t){const n=e,r=t,a=new Array(e*t),i={};i.setPixel=function(h,p,g){a[p*n+h]=g},i.write=function(h){h.writeString("GIF87a"),h.writeShort(n),h.writeShort(r),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(n),h.writeShort(r),h.writeByte(0);const p=2,g=u(p);h.writeByte(p);let m=0;for(;g.length-m>255;)h.writeByte(255),h.writeBytes(g,m,255),m+=255;h.writeByte(g.length-m),h.writeBytes(g,m,g.length-m),h.writeByte(0),h.writeString(";")};const l=function(h){const p=h;let g=0,m=0;const w={};return w.write=function(y,b){if(y>>>b)throw"length over";for(;g+b>=8;)p.writeByte(255&(y<<g|m)),b-=8-g,y>>>=8-g,m=0,g=0;m=y<<g|m,g=g+b},w.flush=function(){g>0&&p.writeByte(m)},w},u=function(h){const p=1<<h,g=(1<<h)+1;let m=h+1;const w=f();for(let E=0;E<p;E+=1)w.add(String.fromCharCode(E));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(g));const y=HR(),b=l(y);b.write(p,m);let k=0,S=String.fromCharCode(a[k]);for(k+=1;k<a.length;){const E=String.fromCharCode(a[k]);k+=1,w.contains(S+E)?S=S+E:(b.write(w.indexOf(S),m),w.size()<4095&&(w.size()==1<<m&&(m+=1),w.add(S+E)),S=E)}return b.write(w.indexOf(S),m),b.write(g,m),b.flush(),y.toByteArray()},f=function(){const h={};let p=0;const g={};return g.add=function(m){if(g.contains(m))throw"dup key:"+m;h[m]=p,p+=1},g.size=function(){return p},g.indexOf=function(m){return h[m]},g.contains=function(m){return typeof h[m]<"u"},g};return i},iee=function(e,t,n){const r=oee(e,t);for(let u=0;u<t;u+=1)for(let f=0;f<e;f+=1)r.setPixel(f,u,n(f,u));const a=HR();r.write(a);const i=see(),l=a.toByteArray();for(let u=0;u<l.length;u+=1)i.writeByte(l[u]);return i.flush(),"data:image/gif;base64,"+i};Hd.stringToBytes;const _8=4;function lee({value:e,label:t,size:n=200}){const{side:r,path:a}=s.useMemo(()=>{const i=Hd(0,"M");i.addData(e),i.make();const l=i.getModuleCount();let u="";for(let f=0;f<l;f++)for(let h=0;h<l;h++)i.isDark(f,h)&&(u+=`M${h+_8} ${f+_8}h1v1h-1z`);return{side:l+_8*2,path:u}},[e]);return o.jsxs("svg",{className:"sc-qr",viewBox:`0 0 ${r} ${r}`,width:n,height:n,role:"img","aria-label":t,shapeRendering:"crispEdges",children:[o.jsx("rect",{className:"sc-qr-plate",width:r,height:r}),o.jsx("path",{className:"sc-qr-ink",d:a})]})}const cee=3e4,uee=5*6e4;function dee(e,t=!1){return t?{sentence:"Could not read this computer's network.",action:"check"}:e?e.reach==="this-computer"?{sentence:"Scenri was started for this computer only. Start it without SCENRI_HOST to open it on your phone.",action:null}:e.problem==="no-network"?{sentence:"Connect this computer to Wi-Fi, then check again.",action:"check"}:e.problem==="blocked"||!e.url?{sentence:"Another app is holding this address, so phones cannot open Scenri yet.",action:"check"}:{sentence:"Point your phone's camera at the code, or copy the link for another computer.",action:"copy"}:{sentence:"Checking this computer's network.",action:null}}const fee=e=>e.url,hee=e=>`${e.slice(0,3)} ${e.slice(3)}`;function pee(e,t,n){return e.lastVisit&&e.lastVisit.at>=t-uee?"connected":n-t>=cee?"stuck":"waiting"}function mee(e,t){var n;return e==="connected"?`Connected. Scenri opened on your ${((n=t.lastVisit)==null?void 0:n.device)??"device"}.`:e==="stuck"?"No phone has opened it yet.":"Waiting for your phone…"}function gee(e,t){return e==="blocked"&&t==="darwin"?{text:"Your Mac's firewall is blocking Scenri, so your phone cannot open it yet.",canAllow:!0}:e==="blocked"&&t==="win32"?{text:"Windows Firewall is blocking Scenri on this network, so your phone cannot open it yet.",canAllow:!0}:e==="blocks-all"?{text:"Your Mac's firewall blocks every incoming connection. To open Scenri on your phone, turn off Block all incoming connections in System Settings, Network, Firewall, Options.",canAllow:!1}:null}function vee(e,t){const n=t==="darwin";switch(e){case"asking":return n?"Enter your Mac password to allow Scenri.":"Choose Yes when Windows asks to allow Scenri.";case"done":return"Allowed. Scan the code again.";case"cancelled":return"Nothing changed. Press Allow Scenri to try again.";case"failed":case"unsupported":return n?"Could not change the firewall. Open System Settings, Network, Firewall, Options, and set node to allow incoming connections.":"Could not change the firewall. Open Windows Security, Firewall and network protection, Allow an app through firewall, and tick Node.js for Private and Public.";default:return null}}function wee(e,t){const n=["Your phone has to be on the same Wi-Fi as this computer. Guest networks keep devices apart."];return e!=="blocked"&&e!=="blocks-all"&&e!=="ok"&&n.push("If this computer asks whether node may accept incoming connections, allow it."),n.push("If your phone's browser asks to find devices on your local network, allow it."),t.others.length&&n.push(`Or try ${t.others.join(" or ")}.`),n}const yee=2e3;function bee(){const{markUsed:e}=eu();s.useLayoutEffect(()=>{e("local-access")},[e]);const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(null),[u,f]=s.useState(()=>Date.now()),[h,p]=s.useState(!1),[g,m]=s.useState(null),[w,y]=s.useState("idle"),[b,k]=s.useState(!1),S=s.useRef(null),E=s.useRef(null),{push:C}=rr(),A=s.useCallback(async(G=!1)=>{try{n(await Ee.phone(G)),a(!1)}catch{a(!0)}},[]),[L,T]=s.useState(!1),M=async()=>{T(!0);try{n(await Ee.phoneNewCode()),l(Date.now())}catch{C({kind:"warning",title:"Could not make a new code"})}finally{T(!1)}};s.useEffect(()=>{A();const G=setInterval(()=>{f(Date.now()),A()},yee);return()=>{clearInterval(G),S.current&&clearTimeout(S.current)}},[A]);const j=t?fee(t):null;s.useEffect(()=>{j&&i===null&&l(Date.now())},[j,i]);const P=t&&j&&i!==null?pee(t,i,u):null;s.useEffect(()=>{P==="stuck"&&p(!0)},[P]);const R=!!j&&!!(t!=null&&t.thisComputer);s.useEffect(()=>{if(!R)return;let G=!0;return Ee.phoneHelp().then(_=>G&&m(_.firewall)).catch(()=>G&&m("unknown")),()=>{G=!1}},[R]);const H=dee(t,r),D=t?gee(g,t.platform):null,U=t?vee(w,t.platform):null,V=async()=>{j&&(await JJ(j,E.current)?(k(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>k(!1),1600)):C({kind:"warning",title:"Could not copy the link",detail:j}))},B=async()=>{y("asking");try{const G=await Ee.phoneAllow();m(G.firewall),y(G.result)}catch{y("failed")}};return o.jsxs(us,{title:"Other devices",children:[o.jsxs("div",{className:"sc-set-row",ref:E,children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open on your phone"}),o.jsx("small",{"data-prose":"",children:H.sentence})]}),H.action==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void V(),children:o.jsx("span",{"aria-live":"polite",children:b?"Copied":"Copy link"})}),H.action==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void A(!0),children:"Check again"})]}),t&&j&&o.jsxs("div",{className:"sc-phone",children:[o.jsx(lee,{value:j,label:`QR code for ${t.address}`}),o.jsxs("div",{className:"sc-phone-how",children:[o.jsxs("p",{children:["No camera? Go to ",o.jsx("b",{className:"sc-phone-key",children:t.address})," in any browser on the same Wi-Fi, then enter ",o.jsx("b",{className:"sc-phone-key",children:hee(t.code)}),"."]}),t.thisComputer&&D&&o.jsxs("div",{className:"sc-phone-fw",role:"status",children:[o.jsx("p",{children:D.text}),D.canAllow&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:w==="asking",onClick:()=>void B(),children:w==="asking"?"Waiting for your permission…":"Allow Scenri"})]}),t.thisComputer&&U&&o.jsx("p",{className:"sc-phone-allow","data-state":w,"aria-live":"polite",children:U}),t.thisComputer&&P&&o.jsx("p",{className:"sc-phone-arrival","data-state":P,"aria-live":"polite",children:mee(P,t)}),t.thisComputer&&o.jsxs("details",{className:"sc-phone-help",open:h,onToggle:G=>p(G.currentTarget.open),children:[o.jsx("summary",{children:"Not opening?"}),o.jsx("ul",{children:wee(g,t).map(G=>o.jsx("li",{children:G},G))})]})]})]}),(t==null?void 0:t.thisComputer)&&j&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"New code"}),o.jsx("small",{"data-prose":"",children:"Signs out every phone and tablet. They scan the new code to open Scenri again."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:L,onClick:()=>void M(),children:L?"Making…":"New code"})]})]})}function xee(e){switch(e){case"npx":return"npx scenri update";case"global":case"managed":return"scenri update";default:return"npx scenri@latest"}}function kee({version:e}){var k;const t=Wm(),n=eu(),{brand:r}=cn(),a=t.status,[i,l]=s.useState(null),[u,f]=s.useState(!1);s.useEffect(()=>{Ee.settings().then(S=>l(!!S.updateCheck)).catch(()=>{})},[]);const h=async()=>{if(i===null)return;const S=!i;l(S);try{await Ee.saveSettings({updateCheck:S})}catch{l(!S)}},p=s.useRef(null);s.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=xee(e==null?void 0:e.installKind),m=async()=>{try{await navigator.clipboard.writeText(g),f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1600)}catch{}},w=t.checking?o.jsx("span",{className:"sc-tag",children:"checking…"}):a!=null&&a.available?o.jsxs("span",{className:"sc-tag sc-tag-gold",children:[a.latest," available"]}):t.checkError||a!=null&&a.error?o.jsx("span",{className:"sc-tag",children:"couldn't check for updates"}):a!=null&&a.checkedAt?o.jsx("span",{className:"sc-tag",children:"up to date"}):null;let y,b;return a!=null&&a.available?(e==null?void 0:e.installKind)==="dev"?(y="Running from source. Pull and rebuild when you're ready; nothing here touches your checkout.",b=null):(e==null?void 0:e.thisComputer)!==!0?(y="Updates are installed on the computer running Scenri.",b=null):dM(a)?a.phase==="ready"?(y=t.applyError??`${a.stagedVersion} is downloaded and verified. Restarting finishes it.`,b="restart"):a.phase==="staging"?(y="Downloading in the background. Nothing interrupts your work.",b="downloading"):a.phase==="error"?(y=t.applyError??a.error??"Couldn't download the update. Try again.",b="update"):(y=`You are on ${a.current}.`,b="update"):(y=o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{children:g})," in a terminal, then start Scenri again. Your library is not part of the app and stays put."]}),b="copy"):(y=a&&!a.enabled?"Automatic checks are off. Checking here still works.":"New versions announce themselves here.",b="check"),o.jsxs(us,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Updates"}),o.jsxs("small",{"data-prose":"",children:[y,(a==null?void 0:a.available)&&a.phase!=="ready"&&a.notesUrl&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:a.notesUrl,target:"_blank",rel:"noreferrer",children:["See what's in ",a.latest]})]})]})]}),w,b==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:t.checking,onClick:()=>void t.checkNow(),children:"Check for updates"}),(b==="update"||b==="restart")&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:t.busy!=="idle",onClick:()=>void t.apply(),children:t.busy!=="idle"?"Updating…":(a==null?void 0:a.phase)==="error"?"Try again":"Update"}),b==="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!0,children:"Downloading…"}),b==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void m(),children:u?"Copied":"Copy command"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Automatic updates"}),o.jsx("small",{"data-prose":"",children:"A version check every six hours; new versions download in the background, and restarting is always your call. Off means Scenri never calls anywhere by itself."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:i===null,onClick:()=>void h(),children:i===null?"…":i?"Turn off":"Turn on"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"What's new"}),o.jsx("small",{children:((k=n.featured)==null?void 0:k.title)??"What changed in Scenri, newest first."})]}),o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:Np(r),children:"Show"})]})]})}function Ck({weeks:e,months:t,cells:n}){return o.jsxs("div",{className:"sc-heat-range","data-weeks":e,children:[o.jsx("div",{className:"sc-heat-months",children:t.map(r=>o.jsx("span",{children:r.label},r.key))}),o.jsx("div",{className:"sc-heat-grid",children:n.map(r=>o.jsx("i",{"data-l":r.level||void 0,title:r.title},r.key))})]})}function See({brandId:e}){const[t,n]=s.useState(null);s.useEffect(()=>{let u=!0;return n(null),Ee.usage(e).then(f=>u&&n(f.days)).catch(()=>u&&n([])),()=>{u=!1}},[e]);const{year:r,quarter:a,total:i,byKind:l}=s.useMemo(()=>{const u=new Map;for(const g of t??[])u.set(g.day,(u.get(g.day)??0)+g.generations+g.edits);const f=kk(u,53),h=kk(u,13),p={generation:0,edit:0};for(const g of t??[])g.day<f.from||(p.generation+=g.generations,p.edit+=g.edits);return{year:f,quarter:h,total:f.sum,byKind:p}},[t]);return o.jsx(us,{sub:t===null?"Counting your runs…":i?`${i.toLocaleString()} runs in the last year: ${l.generation.toLocaleString()} generations, ${l.edit.toLocaleString()} edits.`:"Nothing made yet this year. The first shot lands here.",children:o.jsxs("div",{className:"sc-heat",children:[o.jsx(Ck,{weeks:53,months:r.months,cells:r.cells}),o.jsx(Ck,{weeks:13,months:a.months,cells:a.cells})]})})}function Eee({engines:e,brandId:t,onSaved:n}){const r=jr("settings"),a=r.value!==null,[i,l]=s.useState(null);s.useEffect(()=>{if(!a||i)return;let y=!0;return Ee.version().then(b=>y&&l(b)).catch(()=>{}),()=>{y=!1}},[a,i]);const[u,f]=s.useState(null);s.useEffect(()=>{if(!a)return;let y=!0;return Ee.home().then(b=>y&&f(b)).catch(()=>{}),()=>{y=!1}},[a]);const[h,p]=s.useState(null),g=(i==null?void 0:i.thisComputer)===!0;s.useEffect(()=>{if(!a||!g)return;let y=!0;return Ee.desktop().then(b=>y&&p(b)).catch(()=>{}),()=>{y=!1}},[a,g]);const[m,w]=s.useState("idle");return o.jsx(Ws,{open:a,className:"sc-set",maxWidth:"880px",onDismiss:r.close,children:o.jsx(Cee,{value:r.value,onPick:r.set,saved:o.jsx(jee,{state:m}),page:y=>o.jsx(Aee,{page:y,engines:e,brandId:t,onSaved:n,onKitState:w,version:i,home:u,desktop:h,onDesktop:p})})})}function Cee({value:e,onPick:t,saved:n,page:r}){const a=Nr(la),{brand:i}=cn(),l=FY(e),[u,f]=s.useState(()=>_Y(e)),h=s.useRef(new Map),p=s.useRef(!1);s.useEffect(()=>{var y;!a||!u||!p.current||(p.current=!1,(y=h.current.get(l))==null||y.focus({preventScroll:!0}))},[a,u,l]);const g=y=>{t(y),f(!1)},m=Ph.find(y=>y.id===l);if(a&&!u)return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>{p.current=!0,f(!0)},"aria-label":"Settings",children:o.jsx(Ta,{size:15})}),o.jsx(Ns,{className:"sc-newdlg-title",children:m.label}),l==="brand"&&n,o.jsx(jk,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-set-body",children:o.jsxs("div",{className:"sc-set-scroll",children:[o.jsx("p",{className:"sc-set-lede",children:m.sub(Ca(i))}),r(l)]})})]},`page-${l}`);const w=y=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-set-item","data-danger":y.scope==="apart"?"":void 0,"aria-current":!a&&l===y.id?"page":void 0,ref:b=>{b?h.current.set(y.id,b):h.current.delete(y.id)},onClick:()=>g(y.id),children:[o.jsx(y.Icon,{size:16,className:"sc-set-item-ic"}),o.jsx("span",{className:"sc-set-item-lb",children:y.label}),y.feature&&o.jsx(qQ,{feature:y.feature}),a&&o.jsx(Nl,{size:14,className:"sc-set-item-go"})]})},y.id);return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Settings"}),o.jsx(jk,{})]}),o.jsxs("div",{className:"sc-newdlg-body sc-set-body",children:[o.jsxs("nav",{className:"sc-set-rail","aria-label":"Settings",children:[o.jsx("p",{className:"sc-set-group",children:"This brand"}),o.jsx("ul",{children:Ph.filter(y=>y.scope==="brand").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Studio"}),o.jsx("ul",{children:Ph.filter(y=>y.scope==="studio").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Delete"}),o.jsx("ul",{className:"sc-set-apart",children:Ph.filter(y=>y.scope==="apart").map(w)})]}),!a&&o.jsxs("div",{className:"sc-set-scroll",children:[o.jsxs("header",{className:"sc-set-head",children:[o.jsxs("span",{className:"sc-set-head-say",children:[o.jsx("h2",{children:m.label}),o.jsx("p",{children:m.sub(Ca(i))})]}),l==="brand"&&n]}),r(l)]},l)]})]},"index")}function jee({state:e}){const[t,n]=s.useState(!1),r=s.useRef(e);return s.useEffect(()=>{const a=r.current;if(r.current=e,e!=="idle"){n(!0);return}if(a==="idle")return;const i=setTimeout(()=>n(!1),1600);return()=>clearTimeout(i)},[e]),o.jsxs("span",{className:"sc-set-saved","data-on":t?"":void 0,"data-state":e,"aria-live":"polite",children:[e==="idle"&&o.jsx(Gn,{size:12,weight:"bold"}),oJ(e)]})}function Aee({page:e,engines:t,brandId:n,onSaved:r,onKitState:a,version:i,home:l,desktop:u,onDesktop:f}){const h=(i==null?void 0:i.thisComputer)===!0;switch(e){case"brand":return o.jsx(TJ,{onSaveState:a});case"usage":return o.jsx(See,{brandId:n});case"engines":return o.jsxs(o.Fragment,{children:[o.jsx(YJ,{engines:t}),o.jsx(_J,{engines:t,onSaved:r,thisComputer:h})]});case"appearance":return o.jsx(eJ,{});case"library":return o.jsx(QJ,{info:l,thisComputer:h});case"phone":return o.jsxs(o.Fragment,{children:[o.jsx(bee,{}),h&&o.jsx(zJ,{status:u,onStatus:f})]});case"updates":return o.jsx(kee,{version:i});case"about":return o.jsx(QQ,{version:i});case"danger":return o.jsx(VJ,{onDone:r,thisComputer:h})}}function jk(){return o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}function Nee(e){return!e.lead||e.spent||e.firstUse||e.onPage||!e.loaded||!e.visible||e.dialogOpen?!1:e.running===0&&!e.builds.some(t=>!t.finished)}function Mee(e){return e>0?`See ${e} more update${e===1?"":"s"}`:"See all updates"}const OR="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1920'%20height='1080'%20viewBox='0%200%201920%201080'%20fill='none'%3e%3c!--%20Scenri%20og-image,%20Figma%20hYeysad0V3rwpN49vWNSeE%20node%205480:2:%20the%20ground%20and%20the%20logo,%20paths%20as%20exported%20--%3e%3ctitle%3eScenri%3c/title%3e%3crect%20width='1920'%20height='1080'%20fill='%2311100E'/%3e%3cpath%20d='M872.355%20532.044L846.18%20528.839C836.935%20527.733%20833.219%20525.379%20833.219%20521.182C833.219%20516.503%20841.132%20513.78%20853.355%20513.78C867.79%20513.78%20876.439%20516.247%20881.374%20525.379L902.473%20518.828C894.079%20500.678%20875.447%20495.375%20855.311%20495.375C827.292%20495.375%20809.142%20504.762%20809.142%20523.649C809.142%20537.971%20819.891%20545.883%20841.982%20548.577L865.804%20551.527C876.042%20552.774%20878.906%20555.469%20878.906%20559.184C878.906%20564.118%20871.363%20567.578%20857.041%20567.578C839.515%20567.578%20832.709%20564.005%20827.888%20554.986L805.796%20561.537C813.708%20579.801%20832.454%20585.983%20855.567%20585.983C884.21%20585.983%20903.239%20576.341%20903.239%20556.972C903.239%20543.132%20893.738%20534.624%20872.384%20532.044H872.355Z'%20fill='%23fff'/%3e%3cpath%20d='M962.368%20514.262C974.478%20514.262%20985.453%20518.091%20990.643%20530.938L1012.73%20525.635C1007.91%20508.591%20989.508%20495.517%20962%20495.517C930.266%20495.517%20907.663%20513.043%20907.663%20540.693C907.663%20568.344%20930.266%20586.125%20962%20586.125C989.537%20586.125%201007.94%20572.796%201012.73%20555.752L990.643%20550.449C985.453%20563.296%20974.478%20567.124%20962.368%20567.124C945.948%20567.124%20932.619%20558.843%20932.619%20541.941V539.474C932.619%20522.572%20945.948%20514.291%20962.368%20514.291V514.262Z'%20fill='%23fff'/%3e%3cpath%20d='M1043.99%20548.946H1095.23V531.42H1043.99V515.142H1100.79V496.85H1019.29V584.509H1101.64V566.245H1043.99V548.946Z'%20fill='%23fff'/%3e%3cpath%20d='M1177.84%20545.997H1177.73L1135.73%20496.85H1110.43V584.509H1133.4V527.96H1133.52L1181.93%20584.509H1200.81V496.85H1177.84V545.997Z'%20fill='%23fff'/%3e%3cpath%20d='M1301.32%20526.003C1301.32%20507.116%201289.47%20496.85%201266.13%20496.85H1212.04V584.509H1236.75V556.348H1256.99L1274.04%20584.509H1302.2L1282.32%20553.143C1294.66%20548.691%201301.32%20539.672%201301.32%20525.975V526.003ZM1276.62%20527.478C1276.62%20535.021%201272.42%20538.708%201263.91%20538.708H1236.75V515.113H1263.91C1272.42%20515.113%201276.62%20518.828%201276.62%20526.23V527.478Z'%20fill='%23fff'/%3e%3cpath%20d='M1334.05%20496.85H1309.35V584.509H1334.05V496.85Z'%20fill='%23fff'/%3e%3cpath%20d='M767.454%20503.06V560.034L731.665%20595.739V485.79H750.155C759.712%20485.79%20767.454%20493.532%20767.454%20503.089V503.06Z'%20fill='%23fff'/%3e%3cpath%20d='M621.744%20485.789V595.739H603.253C593.696%20595.739%20585.954%20587.997%20585.954%20578.44V521.466L621.744%20485.761V485.789Z'%20fill='%23fff'/%3e%3cpath%20d='M731.664%20595.71L695.96%20631.5H638.986C629.429%20631.5%20621.687%20623.758%20621.687%20614.201V595.71H731.636H731.664Z'%20fill='%23fff'/%3e%3cpath%20d='M621.744%20485.79L657.42%20450H714.394C723.951%20450%20731.693%20457.742%20731.693%20467.299V485.79H621.744Z'%20fill='%23fff'/%3e%3c/svg%3e",Ree="/assets/whatsnew-stage-DlyjaAn6.webp",Pee=["January","February","March","April","May","June","July","August","September","October","November","December"];function IR(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const n=Pee[Number(t[2])-1];return n?`${Number(t[3])} ${n} ${t[1]}`:e}function Lee(e){const t=IR(e);if(t===e)return e;const[n,r,a]=t.split(" ");return`${n} ${r.slice(0,3)} ${a}`}const $ee="/assets/0.17.0-select-several-DdAw3yQ3.webp",Tee="/assets/0.17.1-presenter-identity-BfgRpajU.webp",Dee="/assets/0.17.2-presenter-prompt-BiaRpVJN.webp",Hee="/assets/0.18.0-portrait-standard-CrJ6Ixm2.webp",Oee="/assets/0.19.0-home-examples-Dv7HjKk9.webp",Iee="/assets/0.20.0-made-in-place-B0L_kS__.webp",Fee="/assets/0.21.0-home-examples-J92K_hqk.webp",_ee="/assets/0.22.0-people-places-DBgKia30.webp",Vee=Object.assign({"./assets/whatsnew/0.17.0-select-several.webp":$ee,"./assets/whatsnew/0.17.1-presenter-identity.webp":Tee,"./assets/whatsnew/0.17.2-presenter-prompt.webp":Dee,"./assets/whatsnew/0.18.0-portrait-standard.webp":Hee,"./assets/whatsnew/0.19.0-home-examples.webp":Oee,"./assets/whatsnew/0.20.0-made-in-place.webp":Iee,"./assets/whatsnew/0.21.0-home-examples.webp":Fee,"./assets/whatsnew/0.22.0-people-places.webp":_ee});function Zee(e){return Vee[`./assets/whatsnew/${e}`]??null}const FR="Scenri could not read its release notes. If you are running a development server, it may predate this page; restart it and try again.",_R="There is nothing new to show here yet.",zee={fetchpriority:"high"};function VR(e){var r;const t=(r=e==null?void 0:e.sections.find(a=>a.image))==null?void 0:r.image,n=t?Zee(t.file):null;return t&&n?{src:n,alt:t.alt}:null}function ZR({picture:e,eager:t=!1,onOpen:n,onBroken:r}){const[a,i]=s.useState("wait"),l=s.useCallback(h=>{h!=null&&h.complete&&h.naturalWidth>0&&i("ready")},[]);if(a==="broken")return null;const u=a==="ready"||void 0,f=o.jsx("img",{ref:l,...t?zee:void 0,src:e.src,alt:e.alt,loading:t?"eager":"lazy",decoding:"async",onLoad:()=>i("ready"),onError:()=>{i("broken"),r==null||r()}});return n?o.jsxs("button",{type:"button",className:"sc-wn-media","data-ready":u,"aria-haspopup":"dialog",onClick:n,children:[f,o.jsx("span",{className:"sc-vh",children:", view larger"}),o.jsx("span",{className:"sc-corner","aria-hidden":"true",children:o.jsx("span",{className:"sc-cell-ctl",children:o.jsx(dF,{size:14})})})]}):o.jsx("div",{className:"sc-wn-media","data-ready":u,children:f})}function Bee({src:e,alt:t,onClose:n}){const r=s.useRef(null);return o.jsx(Rl,{open:!0,onOpenChange:a=>!a&&n(),children:o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-wn-lb-scrim"}),o.jsxs($l,{className:"sc-wn-lb","aria-describedby":void 0,onOpenAutoFocus:a=>{r.current=document.activeElement,iM(a)},onCloseAutoFocus:a=>{var i;a.preventDefault(),(i=r.current)!=null&&i.isConnected&&r.current.focus()},onClick:n,children:[o.jsx(Tl,{className:"sc-vh",children:t}),o.jsx("div",{className:"sc-wn-media sc-wn-lb-stage","data-ready":!0,children:o.jsx("img",{src:e,alt:t})}),o.jsx(O1,{className:"sc-icon-btn sc-wn-lb-close","aria-label":"Close",children:o.jsx(jn,{size:16})})]})]})})}function zR({version:e,current:t=!1}){return o.jsxs("span",{className:"sc-tag sc-tag-version","data-on":t||void 0,children:[o.jsx("span",{className:"sc-vh",children:"Version "}),e,t&&o.jsx("span",{className:"sc-vh",children:", the version you are on"})]})}function Uee({sections:e}){return o.jsx("div",{className:"sc-wn-areas",children:e.map(t=>o.jsxs("section",{className:"sc-wn-area",children:[o.jsx("h3",{children:t.heading}),o.jsx("p",{children:t.body})]},t.heading))})}function BR({entry:e,current:t=!1,hideVersion:n=!1}){return o.jsxs("p",{className:"sc-wn-when",children:[!n&&o.jsx(zR,{version:e.version,current:t}),o.jsxs("time",{dateTime:e.date,children:[o.jsx("span",{"aria-hidden":"true",children:Lee(e.date)}),o.jsx("span",{className:"sc-vh",children:IR(e.date)})]})]})}function Wee({version:e,current:t}){return o.jsxs("div",{className:"sc-wn-media sc-wn-fallback","data-ready":!0,children:[o.jsx("img",{src:OR,alt:""}),o.jsx("span",{className:"sc-wn-fallback-chip","data-theme":"dark",children:o.jsx(zR,{version:e,current:t})})]})}function Kee({href:e,version:t}){return o.jsxs("a",{className:"sc-wn-notes",href:e,target:"_blank",rel:"noopener noreferrer",children:["Release notes",o.jsxs("span",{className:"sc-vh",children:[" for ",t," on GitHub, opens in a new tab"]}),o.jsx(Ac,{size:12,"aria-hidden":"true"})]})}function Gee(){const e=jr("whatsnew"),{brand:t}=cn(),{status:n,featured:r,recent:a,unseen:i,lead:l,running:u,markSeen:f}=eu(),h=e.value!==null&&n!=="loading",p=r,g=s.useRef({open:!1,more:0});h&&!g.current.open?g.current={open:!0,more:i.filter(A=>A!==(p==null?void 0:p.version)).length}:h||(g.current.open=!1);const m=()=>{f(),e.close()},w=s.useRef(h);s.useEffect(()=>{w.current&&!h&&f(),w.current=h},[h,f]);const[y,b]=s.useState(null),k=p&&y!==p.version?VR(p):null,S=(k==null?void 0:k.src)??OR;s.useEffect(()=>{if(l)for(const A of[S,Ree]){const L=new Image;L.fetchPriority="high",L.src=A}},[l,S]);const E=s.useRef(!1),C=A=>{!A.metaKey&&!A.ctrlKey&&!A.shiftKey&&!A.altKey&&(E.current=!0)};return o.jsxs(Ws,{open:h,className:"sc-wn",tone:"dim",maxWidth:"520px",described:!0,onDismiss:m,onCloseAutoFocus:A=>{E.current&&(A.preventDefault(),E.current=!1)},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"What's new"}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx("div",{className:"sc-newdlg-body",children:p?o.jsxs("article",{className:"sc-wn-ex",children:[k?o.jsx(ZR,{picture:k,eager:!0,onBroken:()=>b(p.version)},p.version):o.jsx(Wee,{version:p.version,current:p.version===u}),o.jsx(BR,{entry:p,current:p.version===u,hideVersion:!k}),o.jsx(Hc,{asChild:!0,children:o.jsx("h3",{className:"sc-wn-hed",children:o.jsx(Vn,{className:"sc-wn-ex-link",to:`${Np(t)}#v${p.version}`,replace:!0,onClick:C,children:p.title})})})]}):o.jsx(Hc,{className:"sc-wn-txt",children:n==="failed"?FR:_R})}),o.jsxs("div",{className:"sc-newdlg-foot sc-wn-foot",children:[a.length>0&&o.jsxs(Vn,{className:"sc-wn-link",to:Np(t),replace:!0,onClick:C,children:[Mee(g.current.more),o.jsx(xa,{size:13,"aria-hidden":"true"})]}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",children:"Got it"})})]})]})}function Yee(e){return{installed:e==="not-authenticated"||e==="signing-in"||e==="update-needed"||e==="env-conflict"||e==="repairing"||e==="ready",signedIn:e==="env-conflict"||e==="repairing"||e==="ready",connected:e==="ready",now:e==="not-installed"||e==="installing"?"install":e==="not-authenticated"||e==="signing-in"?"signin":e==="env-conflict"||e==="repairing"?"connect":null}}function UR(e){return e.length===0?"that key":e.length===1?`the ${e[0]} variable`:`the ${e.slice(0,-1).join(", ")} and ${e[e.length-1]} variables`}function qee(e){return`Scenri will start Codex without ${UR(e)}. Nothing on your computer changes, and you can undo this here later.`}function Xee(e){return`Scenri is starting Codex without ${UR(e)} on this computer.`}const Qee=2e3,Jee=5*6e4;function ete({engines:e,onSaved:t}){const n=jr("setup"),r=n.close,a=n.value,i=a?LR(a):void 0,u=!!i||a==="codex-cli",f=e.find(g=>g.id===a),[h,p]=s.useState(!0);return s.useEffect(()=>{let g=!0;return Ee.version().then(m=>g&&p(m.thisComputer!==!1)).catch(()=>{}),()=>{g=!1}},[]),o.jsx(Ws,{open:u,className:"sc-setup",maxWidth:"520px",onDismiss:r,onOpenAutoFocus:i&&h?g=>{var m;g.preventDefault(),(m=g.target.querySelector(".sc-setup-key input"))==null||m.focus()}:void 0,children:i?o.jsx(tte,{provider:i,name:f?wl(f.displayName):i.engineId,connected:!!(f!=null&&f.available),thisComputer:h,onSaved:t,onDone:r}):o.jsx(nte,{engines:e,onSaved:t,onDone:r})})}function WR({title:e}){return o.jsxs("div",{className:"sc-newdlg-head sc-setup-head",children:[o.jsx(Ns,{className:"sc-newdlg-title sc-setup-title",children:e}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]})}function tte({provider:e,name:t,connected:n,thisComputer:r,onSaved:a,onDone:i}){const[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(null),[m,w]=s.useState(!1),y=async()=>{const k=l.trim();if(k){h(!0),g(null);try{await Ee.saveSettings({[e.settingKey]:k}),u(""),a(),i()}catch(S){g(S.message)}finally{h(!1)}}},b=async()=>{h(!0),g(null);try{await Ee.saveSettings({[e.settingKey]:""});const k=await Ee.settings();if(a(),k[e.settingKey]){w(!0);return}i()}catch(k){g(k.message)}finally{h(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(WR,{title:n?`${t} key`:`Connect ${t}`}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(KR,{engineId:e.engineId,name:t,state:n?"Connected":"Not connected",ready:n}),o.jsx("p",{className:"sc-setup-lead",children:r?n?`A key is saved for ${t}. Paste a new one to replace it, or disconnect to remove it from this computer.`:`Paste a key from ${t}. It is stored in your library folder on this computer, sent only to ${t}, and never shown again.`:"Keys are added on the computer running Scenri."})]}),r&&o.jsxs("form",{className:"sc-setup-key",onSubmit:k=>{k.preventDefault(),y()},children:[o.jsx("input",{className:"sc-in",type:"password",placeholder:e.hint,value:l,onChange:k=>u(k.target.value),autoComplete:"off",name:e.settingKey,"aria-label":`${t} key`}),o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:f||!l.trim(),children:[f?o.jsx(Pr,{size:"1"}):o.jsx(XE,{size:15}),n?"Replace key":"Connect"]}),o.jsxs("a",{className:"sc-setup-alt",href:e.keysUrl,target:"_blank",rel:"noreferrer",children:["Get a key ",o.jsx(Ac,{size:13})]})]})]}),r&&n&&o.jsx("div",{className:"sc-setup-cut",children:o.jsx(Xn,{label:"Disconnect",title:`Disconnect ${t}?`,body:"The key is deleted from this computer. Nothing you have already generated changes, and you can paste a new key at any time.",busy:f,onConfirm:()=>void b()})}),m&&o.jsxs("p",{className:"sc-setup-note",children:["The stored key is gone, but ",t," is still connected through the ",e.settingKey.toUpperCase()," ","environment variable on this computer. Remove it from your shell to disconnect fully."]}),p&&o.jsx("div",{className:"sc-setup-problem",children:o.jsxs("p",{"data-detail":"",children:[o.jsx(wm,{size:15})," ",p]})})]})]})}function nte({engines:e,onSaved:t,onDone:n}){const r=Vl(),[a,i]=s.useState("checking"),[l,u]=s.useState(null),[f,h]=s.useState(!1),[p,g]=s.useState("mac"),[m,w]=s.useState(null),[y,b]=s.useState([]),[k,S]=s.useState([]),E=s.useRef(null),C=s.useCallback(()=>{E.current!==null&&(window.clearInterval(E.current),E.current=null)},[]),A=s.useCallback(async(G=!1)=>{const{state:_,reason:O,platform:I,conflictKeys:K,ignoredKeys:z}=await Ee.codexStatus({force:G});return I&&g(I),w(O??null),b(K??[]),S(z??[]),i(_),_},[]);s.useEffect(()=>(u(null),i("checking"),A().catch(()=>i("unverified")),C),[A,C]);const L=s.useCallback(()=>{u(null),i("checking"),A(!0).catch(()=>i("unverified"))},[A]),T=async()=>{u(null),i("repairing");try{const{state:G,conflictKeys:_,ignoredKeys:O,reason:I}=await Ee.repairCodexEnv(y);b(_??[]),S(O??[]),w(I??null),i(G)}catch(G){u({detail:G.message}),i("env-conflict")}},M=async()=>{u(null),i("checking");try{const{state:G,conflictKeys:_,ignoredKeys:O}=await Ee.restoreCodexEnv();b(_??[]),S(O??[]),i(G)}catch{A().catch(()=>i("unverified"))}};s.useEffect(()=>{a==="ready"&&t()},[a,t]);const j=async()=>{u(null),i("installing");try{const G=await Ee.installCodex();if(G.ok||G.state!=="not-installed"){i(G.state);return}u({detail:G.detail,command:G.fallbackCommand,docsUrl:G.docsUrl}),i(G.state)}catch(G){u({detail:G.message,command:"npm install -g @openai/codex"}),i("not-installed")}},P=async()=>{u(null),i("signing-in");const G=Date.now();C(),E.current=window.setInterval(()=>{if(Date.now()-G>Jee){C(),i("not-authenticated"),u({detail:"Sign-in did not finish. Try again, or use the command below.",command:"codex login"});return}Ee.codexStatus().then(({state:_})=>{_==="ready"&&(C(),i("ready"))}).catch(()=>{})},Qee);try{const _=await Ee.loginCodex();if(C(),_.ok||_.state==="ready"){i(_.state);return}u({detail:_.detail,command:_.fallbackCommand}),i(_.state)}catch(_){C(),u({detail:_.message,command:"codex login --device-auth"}),i("not-authenticated")}},R=s.useRef(null);s.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const H=G=>{var _;(_=navigator.clipboard)==null||_.writeText(G).then(()=>{h(!0),R.current&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>h(!1),1600)})},D=e.filter(G=>G.available&&G.id!=="codex-cli"&&!G.localOnly),U=a==="checking"||a==="installing"||a==="signing-in"||a==="repairing",V=a==="not-installed"||a==="installing"?{step:0,label:"Install Codex CLI",verb:a==="installing"?"Installing":"Install",busy:a==="installing",run:j}:a==="not-authenticated"||a==="signing-in"?{step:1,label:"Sign in with ChatGPT",verb:a==="signing-in"?"Waiting for your browser":"Sign in",busy:a==="signing-in",run:P}:a==="env-conflict"||a==="repairing"?{step:2,label:"Ignore that key",verb:a==="repairing"?"Ignoring":"Ignore that key",busy:a==="repairing",run:T}:null,B=a==="not-installed"||a==="installing"||a==="not-authenticated"||a==="signing-in";return o.jsxs(o.Fragment,{children:[o.jsx(WR,{title:"Set up image generation"}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(KR,{engineId:"codex-cli",name:"Codex CLI",state:rte[a],ready:a==="ready",busy:U}),o.jsx("p",{className:"sc-setup-lead",children:ste[a](m)}),a==="no-plan"&&o.jsx("p",{className:"sc-setup-lead",children:"You can use your own key from an image provider instead. You pay that provider directly, per image, and the key stays in your library folder on this computer."})]}),a!=="no-plan"&&o.jsx(ate,{phase:a,act:V}),a==="signing-in"&&o.jsx("p",{className:"sc-setup-note",children:"Finish in the browser tab that just opened. This screen updates itself."}),(a==="env-conflict"||a==="repairing")&&o.jsx("p",{className:"sc-setup-note",children:qee(y)}),a==="ready"&&k.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[Xee(k)," ",o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:M,children:"Use it again"})]}),a==="unverified"&&o.jsx("p",{className:"sc-setup-note",children:"If you just installed Codex, quit and reopen Scenri so it can see the new command."}),a==="update-needed"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:"npm install -g @openai/codex@latest"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H("npm install -g @openai/codex@latest"),children:[f?o.jsx(Gn,{size:14}):o.jsx(gp,{size:14}),f?"Copied":"Copy"]})]}),p==="windows"&&o.jsxs("p",{className:"sc-setup-note",children:["Installed with the standalone installer instead? Update it in PowerShell:"," ",o.jsx("code",{children:"irm https://chatgpt.com/codex/install.ps1 | iex"})]})]}),a==="no-plan"&&D.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[D.map(G=>wl(G.displayName)).join(", ")," is already connected, so you can generate now."]}),l&&o.jsxs("div",{className:"sc-setup-problem",children:[o.jsxs("p",{"data-detail":"",children:[o.jsx(wm,{size:15})," ",l.detail??"That did not work."]}),l.command&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-setup-note",children:["Run this in ",p==="windows"?"PowerShell":"Terminal",", then reopen this window:"]}),o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:l.command}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H(l.command),children:[f?o.jsx(Gn,{size:14}):o.jsx(gp,{size:14}),f?"Copied":"Copy"]})]})]}),l.docsUrl&&o.jsxs("a",{className:"sc-setup-alt",href:l.docsUrl,target:"_blank",rel:"noreferrer",children:["Installation help ",o.jsx(Ac,{size:13})]})]}),a==="ready"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Start creating"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:L,children:[o.jsx(mp,{size:14})," Check again"]})]}),(a==="unverified"||a==="update-needed")&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:L,children:[o.jsx(mp,{size:15})," Check again"]}),a==="unverified"&&o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})]}),a==="no-plan"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>r("openrouter"),children:[o.jsx(XE,{size:15})," Add a provider key"]}),o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>void A(),children:"Back to Codex setup"})]}),B&&o.jsx("div",{className:"sc-setup-acts",children:o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})})]})]})}const rte={checking:"Checking","not-installed":"Not installed",installing:"Installing","not-authenticated":"Not signed in","signing-in":"Waiting for your browser",ready:"Ready","env-conflict":"An old key is in the way",repairing:"Setting that key aside",unverified:"Could not verify","update-needed":"Needs an update","no-plan":"Needs a ChatGPT plan"},ste={checking:()=>"Checking that Codex can actually reach OpenAI from this computer.","not-installed":()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.",installing:()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.","not-authenticated":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.","signing-in":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.",ready:()=>"Codex CLI is ready. Your images run on your own ChatGPT plan, and Scenri adds nothing to the bill.","env-conflict":()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",repairing:()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",unverified:()=>"Scenri could not verify Codex on this computer. Something answered too slowly or not at all, so nothing is assumed to work.","update-needed":e=>`${e??"Codex CLI on this computer is too old for Scenri."} Update it once, then check again.`,"no-plan":()=>"Codex CLI draws on a ChatGPT plan, so without one there is nothing behind it to generate your images."};function KR({engineId:e,name:t,state:n,ready:r,busy:a}){const i=TR(e);return o.jsxs("div",{className:"sc-setup-subject",children:[o.jsx("span",{className:"sc-eng-ic","data-brand":i?"":void 0,style:i?{"--sc-plate":i.plate,"--sc-ink":i.ink}:void 0,children:o.jsx(DR,{engineId:e})}),o.jsxs("span",{className:"sc-setup-say",children:[o.jsx("b",{className:"sc-setup-name",children:t}),o.jsxs("span",{className:"sc-setup-state",children:[a?o.jsx(Pr,{size:"1"}):r?o.jsx("span",{className:"d"}):null,n]})]})]})}function ate({phase:e,act:t}){const{installed:n,signedIn:r,connected:a}=Yee(e),i=[n,r,a],l=["Install Codex CLI","Sign in with ChatGPT","Connect to Scenri"];return o.jsx("ol",{className:"sc-learn-steps sc-setup-steps",children:l.map((u,f)=>{const h=(t==null?void 0:t.step)===f,p=i[f]?"done":h?"active":"todo",g=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:i[f]?o.jsx(Gn,{size:14,weight:"bold"}):f+1}),m=h&&t.busy;return o.jsx("li",{"data-on":i[f]?"":void 0,"data-now":h?"":void 0,children:h?o.jsxs("button",{type:"button",className:"sc-learn-step","data-state":p,"aria-label":t.label,disabled:m,onClick:t.run,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[m?o.jsx(Pr,{size:"1"}):null,t.verb,m?null:o.jsx(xa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":p,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),i[f]&&o.jsx("span",{className:"sc-vh",children:", done"})]})},u)})})}function ote(){const{brands:e}=Mn(),t=GR(e);return t?o.jsx(Pa,{to:To(t),replace:!0}):o.jsx(Pa,{to:"/setup",replace:!0})}function GR(e){const t=ZG();return e.find(n=>n.id===t)??e[0]??null}const ite=48;function lte(e,t,n=ite){let r=null;for(const a of t){if(a.kind==="root")continue;const i=(r??e).findIndex(h=>h.id===a.id),l=a.status==="done"&&a.images.length>0&&!a.archived;if(i>=0){if((r??e)[i]===a)continue;r??(r=[...e]),l?r[i]=a:r.splice(i,1);continue}if(!l)continue;const u=r??e;if(u.length>=n&&Ku(u[u.length-1],a)<0)continue;r??(r=[...e]);let f=0;for(;f<r.length&&Ku(r[f],a)<=0;)f++;r.splice(f,0,a),r.length>n&&(r.length=n)}return r??e}const YR='[data-guide="library.new"]',Od=(e,t)=>({id:"go",voice:"ask",point:`[data-guide="nav.${e}"]`,side:"bottom",soft:!0,...t}),cte='[data-guide="compose"] .sc-attachpanel',ute='[data-guide="compose"] .sc-attachpanel .sc-ap-body',Dp='[data-guide="compose"] .sc-promptcard',dte='[data-guide="compose.add"]',qR='[data-guide="compose"] .sc-brief-line',Hp='[data-guide="compose.send"]',XR='[data-guide="compose.engine"]',id=".sc-pstudio",_4=`${id} .sc-convo-card`,fte=".sc-newdlg-layer",ld=".sc-ovl",En={go:{title:"Shots are made in Create",body:"A shot is built from what you sell, who shows it and where. Open Create, and we'll make your first one together."},intro:{title:"This is Create, where shots are made",body:"A shot is built from three things Scenri keeps for you: what you sell, who shows it, and where it happens. Add them, say how to shoot it, and Scenri makes the picture in about a minute."},engine:{title:"Connect image generation",body:"Scenri needs an image engine before it can make anything. Setting one up takes about a minute."},product:{title:"Choose a product",body:"A product is the thing you are selling. Scenri keeps its real photos, so it looks the same in every shot you make."},presenter:{title:"Choose a person",body:"A person is someone Scenri keeps. Pick one and the same face shows your product in every shot."},scene:{title:"Choose a place",body:"A place is a setting and its light. It decides where the shot happens and how it feels."},make:{title:"Say how to shoot it, then make it",body:"A few words about the moment, the light or the framing. Generate then puts your ingredients and your words together into a picture."},waiting:{title:"Scenri is making it",body:"This takes a moment. Your ingredients are kept, so you can change one thing later without starting over."},result:{title:"Your first shot",body:"The product, the person and the place you chose are kept, so your next shot starts from them. Open it to change one thing."},failed:{title:"That one didn't work",body:"The tile says why. Put the shot together again and Scenri will try it again."},reuseProduct:{title:"Add the product you saved",body:"Yours sits in the shelf with ours. Putting it in again costs nothing: it is the same product, in a new shot."},reuseScene:{title:"Put it somewhere else",body:"A different place and light, so the two shots share the product and little else."},reuseResult:{title:"The same product, twice",body:"Two shots, one thing you added once. Anything Scenri keeps works this way: products, people and places."},refineAsk:{title:"Change one thing",body:"Say what to change, like warmer light or a closer crop. The rest of the shot stays."},refineResult:{title:"Here is the change",body:"The original stays one step back in the history, so nothing is lost."},refineFailed:{title:"That change didn't work",body:"Say the change again and Scenri will try it once more."},refineChoose:{title:"Choose a shot to change",body:"Open one from what you have made. You can also use Refine on its card."},refineGo:{title:"Your shots live in Create",body:"Refining starts from a picture you already have. Open Create to find one."},productGo:{title:"Your products live here",body:"Each one you add is kept, so it looks the same in every shot. Open Products to add yours."},productNew:{title:"Start a new product",body:"Add its real photos, or bring in your catalog from your store. Either way it is yours to reuse."},sceneGo:{title:"Your places live here",body:"A place is a setting and its light, saved to shoot in again. Open Places to make one."},sceneNew:{title:"Start a new place",body:"Describe the place in a sentence, start from pictures of it, or let it guide you."},presenterGo:{title:"Your people live here",body:"A person is someone Scenri keeps, the same face in every shot. Open People to make one."},presenterNew:{title:"Start a new person",body:"Describe someone, or add photos of a real person. The studio takes it from there."},presenterEngine:{title:"Set up image generation",body:"Drawing a face needs an engine. Setting one up takes about a minute, and the answers so far are kept."},presenterStart:{title:"Describe someone, or start from photos",body:"Photos keep a real face. Describing invents one, question by question."},presenterFace:{title:"Decide the face",body:"Every shot with this person uses this face, so take the one you want."},presenterSave:{title:"Save your person",body:"Once saved they are in your ingredients, ready for every shot."},sceneStart:{title:"Describe the place, or start from pictures",body:"A place is the setting and its light around your shot. Pictures are read for you; guided, it asks one thing at a time."},sceneWords:{title:"These words are the place",body:"Every shot made in this place is told exactly this. Draw it to see it, or say what to add."},productMake:{title:"Add your product",body:"Its real photos keep it the same in every shot. Add a few, or bring in your catalog from your store."}},yl=e=>`.sc-feed .sc-cell[data-fb-node="${e}"]`,ly=e=>e.status==="done"&&e.images>0,cy=e=>e.status==="error"||e.status==="cancelled"||e.status==="done"&&e.images===0,V4=e=>e.products+e.presenters+(e.scene?1:0)+e.others,Ak={product:"Products",presenter:"People",scene:"Places"};function QR(e){if(!e.here)return e.heading?Od("create",En.go):null;const t=e.composer,n=e.nodes.find(ly);if(n)return{id:"result",voice:"note",point:yl(n.id),side:"bottom",...En.result,done:!0};const r=e.nodes.find(u=>u.status==="running");if(r)return{id:"waiting",voice:"note",point:yl(r.id),side:"bottom",...En.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||V4(t)>0||t.words,i=e.nodes.find(cy);if(i&&!a)return{id:"failed",voice:"note",point:yl(i.id),side:"bottom",...En.failed};if(t.engine!=="ready")return{id:"engine",voice:"ask",point:XR,side:"top",...En.engine};if(!e.begun&&V4(t)===0&&!t.words)return{id:"intro",voice:"ask",live:[],start:!0,...En.intro};const l=eP(t);return l?Z4(l,t.pickerOpen):{id:"make",voice:"ask",point:Hp,live:[qR,Hp],side:"top",...En.make}}function JR(e){if(!e.here)return e.heading?Od("create",En.go):null;const t=e.composer,n=e.nodes.find(ly);if(n)return{id:"again",voice:"note",point:yl(n.id),side:"bottom",...En.reuseResult,done:!0};const r=e.nodes.find(l=>l.status==="running");if(r)return{id:"waiting",voice:"note",point:yl(r.id),side:"bottom",...En.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||V4(t)>0||t.words,i=e.nodes.find(cy);return i&&!a?{id:"failed",voice:"note",point:yl(i.id),side:"bottom",...En.failed}:t.engine!=="ready"?{id:"engine",voice:"ask",point:XR,side:"top",...En.engine}:t.products===0?Z4("product",t.pickerOpen,En.reuseProduct):t.scene?{id:"make",voice:"ask",point:Hp,live:[qR,Hp],side:"top",...En.make}:Z4("scene",t.pickerOpen,En.reuseScene)}function eP(e){return e.products===0?"product":e.presenters===0?"presenter":e.scene?null:"scene"}function Z4(e,t,n){const r=n??En[e];return t?{id:e,voice:"ask",point:cte,live:[ute],lit:[Dp],beside:!0,side:"right",...r}:{id:e,voice:"ask",point:dte,side:"top",...r}}const tP=`${ld} .sc-promptcard`,hte=`${ld} .sc-stage-img`,Nk=`${ld} .sc-trail`,Mk=".sc-feed";function pte(e){if(e.heading)return Od("create",En.refineGo);if(!e.here)return null;if(!e.open&&!e.armed)return{id:"choose",voice:"ask",point:Mk,live:[Mk],beside:!0,side:"left",...En.refineChoose};const t=e.nodes.find(ly);if(t)return e.open?{id:"refined",voice:"note",shell:ld,point:Nk,side:"top",...En.refineResult,done:!0}:{id:"refined",voice:"note",point:yl(t.id),side:"bottom",...En.refineResult,done:!0};if(e.nodes.some(r=>r.status==="running"))return{id:"refining",voice:"quiet"};const n=e.nodes.find(cy);return n&&!e.asking?e.open?{id:"refine-failed",voice:"note",shell:ld,point:Nk,side:"top",...En.refineFailed}:{id:"refine-failed",voice:"note",point:yl(n.id),side:"bottom",...En.refineFailed}:e.open?{id:"ask",voice:"ask",shell:ld,point:tP,also:[hte],beside:!0,side:"left",...En.refineAsk}:{id:"ask",voice:"ask",point:Dp,live:[Dp],beside:!0,side:"top",...En.refineAsk}}function nP(e){if(e.heading)return Od("presenters",En.presenterGo);const t=e.studio;if(t){const n=`${id} [data-turn="q:${t.open}"]`,r=(a,i,l=[],u)=>({id:a,voice:"ask",shell:id,point:`${n} .sc-convo-ask`,live:[n],also:l,...u?{lit:u}:{},beside:!0,side:"left",...i});switch(t.open){case"source":return r("start",En.presenterStart,[_4]);case"noengine":return r("engine",En.presenterEngine);case"identity":case"revision":return r("face",En.presenterFace,[".sc-pstudio-well",_4],[`${id} [data-turn]:has(+ [data-turn="q:${t.open}"])`]);case"save":return r("save",En.presenterSave);default:return{id:"studio",voice:"quiet"}}}return e.onPage?{id:"new",voice:"ask",point:YR,side:"bottom",...En.presenterNew}:null}function mte(e,t){return{id:e,voice:"ask",shell:fte,point:".sc-newdlg",beside:!0,side:"left",...t}}function rP(e){return{id:"new",voice:"ask",point:YR,side:"bottom",...e}}function gte(e){var n,r;if(e.heading)return Od("scenes",En.sceneGo);const t=e.studio;if(t){const a=`${id} [data-turn="q:${t.open}"]`,i=(l,u)=>({id:l,voice:"ask",shell:id,point:`${a} .sc-convo-ask`,live:[a],also:[_4],beside:!0,side:"left",...u});return t.open==="source"?i("start",En.sceneStart):(n=t.open)!=null&&n.startsWith("agree-")?i("words",En.sceneWords):(r=t.open)!=null&&r.startsWith("decide-")?{id:"use",voice:"quiet"}:{id:"studio",voice:"quiet"}}return e.onPage?rP(En.sceneNew):null}function vte(e){return e.heading?Od("products",En.productGo):e.dialogOpen?mte("product",En.productMake):e.onPage?rP(En.productNew):null}function sP(e,t){if(e==="first-shot"){if(t==="presenter")return"product";if(t==="scene")return"presenter";if(t==="make")return"scene"}if(e==="reuse"){if(t==="scene")return"product";if(t==="make")return"scene"}return null}function wte(e,t,n){return e?sP(e,t)||n&&(t==="new"||t==="choose"||(e==="first-shot"||e==="reuse")&&t==="product")||e==="presenter"&&(t==="start"||t==="face"||t==="save")||(e==="product"||e==="scene")&&t===e?!0:e==="refine"&&t==="ask":!1}function yte(e,t){const n=e.active;return n?n.task==="presenter"?t.presenters>n.baseline.presenters:n.task==="scene"?t.scenes>n.baseline.scenes:n.task==="product"?t.products>n.baseline.products:!1:!1}const bte={"first-shot":"shot",reuse:"shot",refine:"refine",product:"product",presenter:"presenter",scene:"scene"};function Dh(e,t){return!(!t.eligible||t.hidden||t.active&&(t.active.task===e||t.active.task==="first-shot")||t.done[bte[e]]||t.dismissed.includes(e)||e==="refine"&&!t.done.shot)}function xte(e){return e.onMainPage&&e.eligible&&e.welcome===null&&e.ready&&e.visible&&!e.blocked&&!e.busy}const Yu={lede:"Scenri makes product shots for your brand. You choose the product, who shows it and where, and it makes the picture.",take:"Make your first shot",notNow:"Not now",again:"Welcome to Scenri",note:e=>e.engineReady?e.ownsProducts?"We'll make your first one together, a step at a time, with one of your products.":"We'll make your first one together, a step at a time. You can start with one of our products.":"First a short setup for image generation, then your first shot together, a step at a time."};function kte(e){const t=e.filter(a=>a.previewUrl),n=(a,i)=>{var l,u;return(u=(((l=a.brief)==null?void 0:l.tokens)??[]).find(f=>(f==null?void 0:f.t)===i))==null?void 0:u.id},r=new Map;for(const a of t){const i=n(a,"product");i&&r.set(i,[...r.get(i)??[],a])}for(const a of r.values()){const i=new Map;for(const l of a){const u=n(l,"template");u&&!i.has(u)&&i.set(u,l)}if(i.size>=3)return[...i.values()].slice(0,3)}for(const a of r.values())if(a.length>=3)return a.slice(0,3);return t.slice(0,3)}function Ste(e,t,n,r){const a=new Map(e.map(l=>[l.id,l]));let i=!1;for(const l of t){if(l.kind!==r||l.createdAt<n)continue;const u={id:l.id,kind:l.kind,status:l.status,images:Array.isArray(l.images)?l.images.length:0,createdAt:l.createdAt},f=a.get(l.id);f&&f.status===u.status&&f.images===u.images||(a.set(l.id,u),i=!0)}return i?[...a.values()].sort((l,u)=>l.createdAt<u.createdAt?1:l.createdAt>u.createdAt?-1:0):e}const Ete="https://github.com/tonygorb/scenri",Cte="https://scenri.co",jte="https://scenri.co/docs";function Ate(){var S,E;const e=mn(pt.hub),t=mn(pt.set),n=!!e||!!t,r=eu(),a=Wm(),i=!!((S=a.status)!=null&&S.available),l=i&&!a.dismissed||r.unread,u=_l(),f=Vl(),h=oM(),p=GY(),{engines:g}=Mn(),m=!g.some(C=>C.available),{brand:w}=cn(),{pathname:y}=Bn(),b=s.useRef(!1),k=Np(w);return o.jsx("div",{className:"sc-help-float",children:o.jsxs(Cs,{children:[o.jsx(hr,{label:"Help",children:o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-icon-btn sc-help-btn","aria-label":"Help",children:[o.jsx(DF,{size:16}),l&&o.jsx("span",{className:"sc-upd-dot","aria-hidden":"true"})]})})}),o.jsxs(As,{align:"end",side:"top",sideOffset:8,className:"sc-menu sc-help-menu",onCloseAutoFocus:C=>{b.current&&(C.preventDefault(),b.current=!1)},children:[i&&o.jsxs(Wn,{className:"sc-menu-item","data-update":"",onSelect:()=>u("updates"),children:[o.jsx(eE,{size:18,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:["Update available · ",(E=a.status)==null?void 0:E.latest]})]}),o.jsxs(o.Fragment,{children:[o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>{b4.current="help",h()},children:[o.jsx(kF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Learn"})]}),o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>p(),children:[o.jsx(SF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:Yu.again})]})]}),n&&o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>window.dispatchEvent(new Event("scenri:shortcuts")),children:[o.jsx(AF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Keyboard shortcuts"})]}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs(Vn,{to:k,onClick:C=>{!C.metaKey&&!C.ctrlKey&&!C.shiftKey&&!C.altKey&&y!==k&&(b.current=!0)},children:[o.jsx(NF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"What's new"}),r.unread&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-menu-new","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", not read yet"})]})]})}),m&&o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>f(),children:[o.jsx(n1,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up image generation"})]}),o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>u("about"),children:[o.jsx(mm,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"About Scenri"})]}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:jte,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(fF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Docs"})]})}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:Cte,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(xF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"scenri.co"})]})}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:Ete,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(bF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Scenri on GitHub"})]})})]})]})})}function Nte(){return o.jsx(Ate,{})}const Mte={composer:null,overlay:null,studio:null,showing:!1};let ro=Mte;const z4=new Set;function a2(e){ro=e;for(const t of z4)t()}const uy=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function Rk(e){uy(ro.composer,e)||a2({...ro,composer:e})}function Pk(e){uy(ro.overlay,e)||a2({...ro,overlay:e})}function Op(e){uy(ro.studio,e)||a2({...ro,studio:e})}function Lk(e){ro.showing!==e&&a2({...ro,showing:e})}function aP(e){return z4.add(e),()=>z4.delete(e)}function Rte(){return ro}function oP(){return s.useSyncExternalStore(aP,Rte)}function Pte(){return s.useSyncExternalStore(aP,()=>ro.showing)}function Lte({open:e,pictures:t,note:n,onTake:r,onDecline:a}){return o.jsxs(Ws,{open:e,className:"sc-welcome",maxWidth:"440px",described:!0,tone:"guide",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsxs(Ns,{className:"sc-newdlg-title",children:["Welcome to ",o.jsx("span",{className:"sc-accent",children:"Scenri"})]}),o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":Yu.notNow,children:o.jsx(jn,{size:16})})})]}),o.jsx(Hc,{className:"sc-welcome-lede",children:Yu.lede}),t.length>0&&o.jsx("div",{className:"sc-welcome-pics","aria-hidden":"true",children:t.map((i,l)=>o.jsx("img",{src:i,alt:"",style:{animationDelay:`${120+l*60}ms`}},i))}),o.jsxs("div",{className:"sc-newdlg-foot sc-welcome-foot",children:[o.jsx("p",{className:"sc-welcome-note",children:n}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:Yu.notNow}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:r,children:Yu.take})]})]})}const $k=e=>e.t!=="format",ti=()=>[{t:"text",v:""}],Ja=e=>e.t==="product"?`p:${e.id}`:e.t==="template"?`t:${e.id}`:e.t==="ref"?`r:${e.imageHash}`:o2(e);function $te(e,t){const n=new Set,r=l=>{const u=Ja(l);return u?n.has(u)?!1:(n.add(u),!0):!0},a=e.filter($k).filter(r),i=t.filter($k).filter(r);return{own:a,carried:i}}function dy(e){const{own:t,carried:n}=$te(e.tokens??[],e.inherited??[]),r=[...t,...n],a=r.length?r:ti(),i=a.some(l=>l.t==="template");return e.templateId&&!i?[{t:"template",id:e.templateId},...a]:a}const mc="sc-token",of=`.${mc}`,o2=e=>e.t==="template"?`t:${e.id}${e.setup||e.view?`|${e.setup??""}`:""}${e.view?`|${e.view}|${e.viewName??""}`:""}`:e.t==="product"?`p:${e.id}${e.angle?`|${e.angle}`:""}`:e.t==="character"?`h:${e.id}`:e.t==="color"?`c:${e.hex}|${e.name??""}`:e.t==="ref"?`r:${e.imageHash}${e.label?`|${e.label}`:""}`:e.t==="mark"?`m:${e.imageHash}`:"",ks=e=>{const t=e.slice(0,1),n=e.slice(2);if(t==="t"){const[r,a,i,l]=n.split("|");return r?{t:"template",id:r,...a?{setup:a}:{},...i?{view:i,...l?{viewName:l}:{}}:{}}:null}if(t==="p"){const[r,a]=n.split("|");return r?{t:"product",id:r,...a?{angle:a}:{}}:null}if(t==="h")return n?{t:"character",id:n}:null;if(t==="r"){const r=n.indexOf("|"),a=r<0?n:n.slice(0,r),i=r<0?"":n.slice(r+1);return a?{t:"ref",imageHash:a,...i?{label:i}:{}}:null}if(t==="m")return n?{t:"mark",imageHash:n}:null;if(t==="c"){const[r,a]=n.split("|");return r?{t:"color",hex:r,name:a||void 0}:null}return null},hi="\uFEFF",zl=//g,jc=e=>!!e&&e.nodeType===Node.TEXT_NODE&&e.textContent===hi,iP=e=>{var t;return e.length-(((t=e.match(zl))==null?void 0:t.length)??0)};function ko(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return e.contains(n.startContainer)?Fp(e,n.startContainer,n.startOffset):null}function Ga(e,t){if(!e)return;let n=0;for(const r of Array.from(e.childNodes)){const a=kd(r);if(r.nodeType===Node.TEXT_NODE){if(t<=n+a){Ro(e,r,Ip(r,t-n));return}}else if(t<=n+a){const i=r.nextSibling;if((i==null?void 0:i.nodeType)===Node.TEXT_NODE){Ro(e,i,Ip(i,0));return}break}n+=a}gc(e)}function Ip(e,t){const n=e.textContent??"";if(n===hi)return 1;let r=0,a=0;for(;a<n.length&&r<t;)n[a]!==hi&&(r+=1),a+=1;return a}function gc(e){if(!e)return;e.focus({preventScroll:!0});const t=e.lastChild;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE){Ro(e,t,t.length);return}const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),r.collapse(!1),n==null||n.removeAllRanges(),n==null||n.addRange(r)}function Tte(e){if(!e)return!1;const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return!1;const n=t.getRangeAt(0);return e.contains(n.startContainer)&&e.contains(n.endContainer)}function Ro(e,t,n){const r=window.getSelection(),a=document.createRange();a.setStart(t,Math.max(0,Math.min(n,t.length))),a.collapse(!0),r==null||r.removeAllRanges(),r==null||r.addRange(a)}const kd=e=>e.nodeType===Node.TEXT_NODE?iP(e.textContent??""):1;function Fp(e,t,n){if(t===e){let a=0;for(let i=0;i<n&&i<e.childNodes.length;i++)a+=kd(e.childNodes[i]);return a}let r=0;for(const a of Array.from(e.childNodes)){if(a===t)return r+iP((a.textContent??"").slice(0,n));if(a.contains(t))return r+1;r+=kd(a)}return r}function Eo(e){var n,r;if(!e)return;const t=ko(e);e.normalize();for(const a of Array.from(e.childNodes)){if(a.nodeType!==Node.TEXT_NODE)continue;const i=a.textContent??"",l=i.replace(zl,""),u=l.length?l:i.length?hi:"";u!==i&&(a.textContent=u),u||a.remove()}for(const a of Array.from(e.childNodes))jc(a)&&!_s(a.previousSibling)&&!_s(a.nextSibling)&&a.remove();for(const a of Array.from(e.childNodes))_s(a)&&(((n=a.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(hi),a),((r=a.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(hi),a.nextSibling));O0(e)||t!==null&&Ga(e,t)}function Dte(e){var n,r,a;if(!e)return!0;const t=e.childNodes;for(let i=0;i<t.length;i++){const l=t[i];if(_s(l)){if(((n=l.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE||((r=l.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE)return!1;continue}if(l.nodeType!==Node.TEXT_NODE)continue;const u=l.textContent??"";if(!u||((a=t[i+1])==null?void 0:a.nodeType)===Node.TEXT_NODE||u.includes(hi)&&(u!==hi||!_s(l.previousSibling)&&!_s(l.nextSibling)))return!1}return!0}function Hte(e){return e.querySelector(of)?!1:!(e.textContent??"").replace(/[ ]/g,"").trim()}function O0(e){if(!e)return!1;const t=Hte(e);return t&&e.firstChild&&e.replaceChildren(),e.toggleAttribute("data-empty",t),t}const _s=e=>!!e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(mc);function fy(e){if(!e)return null;const t=typeof window>"u"?null:window.getSelection();if(!t||t.rangeCount===0||!t.getRangeAt(0).collapsed)return null;const n=t.getRangeAt(0),r=n.startContainer;return r.nodeType!==Node.TEXT_NODE||r.parentNode!==e?null:{text:r,at:n.startOffset}}function Tk(e){var a;if(!e)return ti();const t=[];let n="";const r=()=>{n&&(t.push({t:"text",v:n}),n="")};for(const i of Array.from(e.childNodes)){if(i.nodeType===Node.TEXT_NODE){n+=(i.textContent??"").replace(zl,"");continue}const l=i,u=(a=l.dataset)==null?void 0:a.tok;if(u){const f=ks(u);if(f){r(),t.push(f);continue}}if(l.tagName==="BR"){n+=`
|
|
99
|
+
`;continue}n+=l.textContent??""}return r(),t.some(i=>i.t==="text")||t.push({t:"text",v:""}),t}function Dk(e,t,n){if(e){e.textContent="";for(const r of Ote(t)){if(r.t==="text"){r.v&&e.appendChild(document.createTextNode(r.v));continue}e.appendChild(n(r))}Eo(e)}}function Ote(e){const t=n=>n>=0&&n<e.length&&e[n].t!=="text";return e.filter((n,r)=>{if(n.t!=="text"||!/^\s+$/.test(n.v))return!0;const a=r===0||t(r-1),i=r===e.length-1||t(r+1);return!(a&&i)})}function V8(e,t){for(const n of Array.from(e.querySelectorAll(of))){const r=ks(n.dataset.tok??"");if(r&&Ja(r)===t)return n}return null}function lP(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return"";const n=t.getRangeAt(0);if(n.startContainer.nodeType!==Node.TEXT_NODE||!e.contains(n.startContainer))return"";let r=(n.startContainer.textContent??"").slice(0,n.startOffset);for(let a=n.startContainer.previousSibling;a&&a.nodeType===Node.TEXT_NODE;a=a.previousSibling)r=(a.textContent??"")+r;return r}function cP(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).cloneRange(),n=t.getBoundingClientRect();if(n.width||n.height)return n;const r=document.createElement("span");r.textContent="",t.insertNode(r);const a=r.getBoundingClientRect(),i=r.parentNode;return r.remove(),i==null||i.normalize(),a}function xc(e,t,n){if(!e||!t)return;const r=n==="after"?t.nextSibling:t.previousSibling;if((r==null?void 0:r.nodeType)!==Node.TEXT_NODE)return;const a=r;Ro(e,a,jc(a)?1:n==="after"?0:a.length)}const _p=9;function uP(e){if(!e.firstChild)return[];const t=document.createRange();return t.selectNodeContents(e),Array.from(t.getClientRects()).filter(n=>n.height>0)}function dP(e,t){let n=null,r=1/0;for(const a of e){const i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=a)}return n}function Hk(e,t,n){if(!e)return!1;const r=uP(e),a=dP(r,n);if(!a)return!1;const i=a.top+a.height/2;for(const u of Array.from(e.querySelectorAll(of))){const f=u.getBoundingClientRect();if(!(f.bottom<a.top||f.top>a.bottom)&&!(t<f.left-_p||t>f.right+_p))return xc(e,u,t<f.left+f.width/2?"before":"after"),!0}if(n>=a.top&&n<=a.bottom)return!1;const l=fP(t,i);return!l||!e.contains(l.node)||l.node.nodeType!==Node.TEXT_NODE?!1:(Ro(e,l.node,l.offset),!0)}function Ite(e,t,n){if(!e)return null;const r=dP(uP(e),n);if(!r)return null;const a=r.top+r.height/2;for(const l of Array.from(e.querySelectorAll(of))){const u=l.getBoundingClientRect();if(!(u.bottom<r.top||u.top>r.bottom)&&!(t<u.left-_p||t>u.right+_p))return{beside:l,side:t<u.left+u.width/2?"before":"after"}}const i=fP(t,a);return!i||!e.contains(i.node)?null:{node:i.node,offset:i.offset}}function fP(e,t){var i,l;const n=document,r=(i=n.caretRangeFromPoint)==null?void 0:i.call(n,e,t);if(r)return{node:r.startContainer,offset:r.startOffset};const a=(l=n.caretPositionFromPoint)==null?void 0:l.call(n,e,t);return a?{node:a.offsetNode,offset:a.offset}:null}function Fte(e,t,n={}){if(!e)return;const r=window.getSelection();let a=null;if(r&&r.rangeCount>0&&e.contains(r.getRangeAt(0).startContainer))a=r.getRangeAt(0);else if(n.fallbackUnits!=null){Ga(e,n.fallbackUnits);const l=window.getSelection();l&&l.rangeCount>0&&e.contains(l.getRangeAt(0).startContainer)&&(a=l.getRangeAt(0))}a||(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),a.deleteContents();const i=a.startContainer;if(i.nodeType===Node.TEXT_NODE&&i.parentNode===e){const l=i,u=l.textContent??"";let f=u.slice(0,a.startOffset);const h=u.slice(a.startOffset);n.eatQuery&&(f=zte(l,f)),l.textContent=f,e.insertBefore(t,l.nextSibling),h&&e.insertBefore(document.createTextNode(h),t.nextSibling)}else{const l=i===e?a.startOffset:e.childNodes.length;e.insertBefore(t,e.childNodes[l]??null)}Eo(e),Ga(e,so(e,t)+1)}const _te=["$","/","@","#"],Vte=e=>_te.includes(e),Vp=e=>e===" "||e===`
|
|
100
|
+
`||e===" "||e===hi;function Zte(e){const t=lP(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(Vp(r))return null;if(Vte(r))return n===0||Vp(t[n-1])?{sigil:r,query:t.slice(n+1)}:null}return null}function zte(e,t){const n=i=>Math.max(i.lastIndexOf("$"),i.lastIndexOf("/"),i.lastIndexOf("@"),i.lastIndexOf("#")),r=n(t);if(r>=0)return t.slice(0,r);const a=[];for(let i=e.previousSibling;i&&i.nodeType===Node.TEXT_NODE;i=i.previousSibling){const l=i.textContent??"",u=n(l);if(u>=0){i.textContent=l.slice(0,u);for(const f of a)f.remove();return""}a.push(i)}return t}function Z8(e,t){if(!e||!t)return;e.normalize();const n=so(e,t);t.remove(),Eo(e),Ga(e,n)}function so(e,t){let n=0;for(const r of Array.from(e.childNodes)){if(r===t)break;n+=kd(r)}return n}function Bte(e,t){var u,f;const n=fy(e);if(!n||!e)return!1;const{text:r,at:a}=n,i=jc(r);if(t==="right"){if(!_s(r.nextSibling)||!i&&a!==r.length)return!1;const h=(u=r.nextSibling)==null?void 0:u.nextSibling;return(h==null?void 0:h.nodeType)!==Node.TEXT_NODE?!1:(Ro(e,h,jc(h)?1:0),!0)}if(!_s(r.previousSibling)||!i&&a!==0)return!1;const l=(f=r.previousSibling)==null?void 0:f.previousSibling;return(l==null?void 0:l.nodeType)!==Node.TEXT_NODE?!1:(Ro(e,l,jc(l)?1:l.length),!0)}function Ok(e,t){const n=fy(e);if(!n)return null;const{text:r,at:a}=n,i=jc(r);return t==="Backspace"?_s(r.previousSibling)&&(i||a===0)?r.previousSibling:null:_s(r.nextSibling)&&(i||a===r.length)?r.nextSibling:null}function Ik(e,t){const n=fy(e);return!n||!jc(n.text)?!1:t==="Backspace"?!n.text.previousSibling:!n.text.nextSibling}function Ute(e,t){const n=ko(e);if(!e||n==null)return null;const r=Array.from(e.childNodes).filter(_s);if(t==="forward")return r.find(a=>so(e,a)>=n)??null;for(let a=r.length-1;a>=0;a--)if(so(e,r[a])<n)return r[a];return null}const cd=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function Wte(e){let t="",n="",r=!1;const a=i=>{var f;if(i.nodeType===Node.TEXT_NODE){const h=(i.textContent??"").replace(zl,"");if(!h)return;t+=h,n+=cd(h),r=!1;return}const l=i,u=(f=l.dataset)==null?void 0:f.tok;if(u){const h=ni(l);t+=(r?" ":"")+h,r=!0,n+=`<span data-sc-tok="${cd(u)}">${cd(h)}</span>`;return}i.childNodes.forEach(a)};return e.cloneContents().childNodes.forEach(a),{text:t,html:`<span data-sc-brief="1">${n}</span>`}}function Kte(e,t){const n=[],r=[];for(const a of e){if(a.t==="text"){const l=a.v.trim();if(!l)continue;n.push(l),r.push(cd(l));continue}const i=t(a);n.push(i),r.push(`<span data-sc-tok="${cd(o2(a))}">${cd(i)}</span>`)}return{text:n.join(" "),html:`<span data-sc-brief="1">${r.join(" ")}</span>`}}function ni(e){var t;return(((t=e.querySelector(".sc-token-label"))==null?void 0:t.textContent)??"").trim()}function Gte(e){if(!e.includes("data-sc-brief")&&!e.includes("data-bt-brief"))return null;const n=new DOMParser().parseFromString(e,"text/html").querySelector("[data-sc-brief], [data-bt-brief]");if(!n)return null;const r=[],a=i=>{var h,p;if(i.nodeType===Node.TEXT_NODE){const g=(i.textContent??"").replace(zl,"");g&&r.push(g);return}const l=i,u=((h=l.dataset)==null?void 0:h.scTok)??((p=l.dataset)==null?void 0:p.btTok);if(u===void 0){i.childNodes.forEach(a);return}const f=ks(u);r.push(f??l.textContent??"")};return n.childNodes.forEach(a),r.length?r:null}function hP(e){const t=new Set([0]);let n=0;for(const i of e){if(i.t!=="text"){t.add(n),n+=1,t.add(n);continue}for(let l=0;l<i.v.length;l++)(i.v[l]===" "||i.v[l]===`
|
|
101
|
+
`)&&t.add(n+l+1);n+=i.v.length}t.add(n);const r=[...t].sort((i,l)=>i-l),a=lf(e);return r.filter((i,l)=>l===r.length-1||!/^[ \n]*$/.test(a.slice(i,r[l+1])))}const lf=e=>e.map(t=>t.t==="text"?t.v:"").join(""),hy=(e,t,n)=>{const r=n<=t?e.slice(n,t):e.slice(t+1,n);return/^[ \n]*$/.test(r)};function Yte(e,t){const n=lf(e);return hP(e).filter(r=>!hy(n,t,r))}function qte(e,t){return e.find(n=>n>=t)??(e.length?e[e.length-1]:null)}function Xte(e,t){let n=null,r=1/0;for(const a of e){const i=Math.abs(a-t);i<r&&(r=i,n=a)}return n}function pP(e,t,n){if(!e||!t.parentNode)return!1;const r=so(e,t);if(hy(lf(i2(e)),r,n))return!1;let a=null,i=0;for(const l of Array.from(e.childNodes)){const u=kd(l);if(n<=i+u){if(l.nodeType===Node.TEXT_NODE){const f=n-i;f<=0?a=l:f>=u?a=l.nextSibling:a=l.splitText(Ip(l,f))}else a=n===i?l:l.nextSibling;break}i+=u}return a===t?!1:(t.remove(),e.insertBefore(t,a),Eo(e),!0)}function Fk(e,t,n){if(!e)return!1;const r=so(e,t),a=Yte(i2(e),r),i=n===-1?[...a].reverse().find(l=>l<r):a.find(l=>l>r+1);return i===void 0?!1:pP(e,t,i)}function Qte(e,t){if(!e)return t;const n=lf(i2(e));let r=t;for(;r>0&&(n[r-1]===" "||n[r-1]===`
|
|
102
|
+
`);)r-=1;return r}function _k(e,t,n,r){if(!e)return null;const a=Ite(e,n,r);if(!a)return null;const i=i2(e),l=so(e,t),u=hP(i),f="beside"in a?so(e,a.beside)+(a.side==="before"?0:1):a.node.nodeType===Node.TEXT_NODE||a.node===e?Fp(e,a.node,a.offset):null;if(f===null)return null;const h="beside"in a&&a.side==="after"?qte(u,f):Xte(u,f);return h===null?null:{units:h,noop:hy(lf(i),l,h)}}function B4(e,t){const n=ni(t)||"the chip",r=Jte(t);if(r)return`Moved ${n} before ${r}.`;const a=ene(t);return a?`Moved ${n} after ${a}.`:so(e,t)===0?`Moved ${n} to the start of the brief.`:`Moved ${n} to the end of the brief.`}const mP=3;function Jte(e){for(let t=e.nextSibling;t;t=t.nextSibling){if(_s(t))return ni(t)||null;const n=(t.textContent??"").replace(zl,"").trim();if(n)return`"${n.split(/\s+/).slice(0,mP).join(" ")}"`}return null}function ene(e){for(let t=e.previousSibling;t;t=t.previousSibling){if(_s(t))return ni(t)||null;const n=(t.textContent??"").replace(zl,"").trim();if(n)return`"${n.split(/\s+/).slice(-mP).join(" ")}"`}return null}function i2(e){const t=[];let n="";for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.TEXT_NODE){n+=(r.textContent??"").replace(zl,"");continue}n&&(t.push({t:"text",v:n}),n=""),t.push({t:"ref",imageHash:""})}return n&&t.push({t:"text",v:n}),t}function U4(e){var n;const t=e.target;(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable=""], [contenteditable="true"]')||e.preventDefault()}const b0=e=>(e==null?void 0:e.querySelector('[data-kind="template"]'))??null,nl=e=>{var t;return((t=e==null?void 0:e.closest)==null?void 0:t.call(e,of))??null};function z8(e,t,n={}){var a;if(!e)return!1;let r=!1;for(let i=0;i<32;i++){const l=nne(e,!!n.commit);if(!l)break;const u={t:"color",hex:l.hex,name:(a=n.nameFor)==null?void 0:a.call(n,l.hex)};ane(e,l.node,l.start,l.end,t(u)),r=!0}return r&&Eo(e),r}function tne(e,t){var i;e.dataset.kind="color",e.dataset.tok=o2(t);const n=t.name??t.hex,r=e.querySelector(".sc-token-swatch");r&&(r.style.background=t.hex);const a=e.querySelector(".sc-token-label");a&&(a.textContent=n),e.getAttribute("role")==="button"&&e.setAttribute("aria-label",`colour: ${n}. Change or remove.`),(i=e.querySelector('[data-role="remove"]'))==null||i.setAttribute("aria-label",`Remove ${n}`)}function nne(e,t){for(let n=e.childNodes.length-1;n>=0;n--){const r=e.childNodes[n];if(r.nodeType!==Node.TEXT_NODE)continue;const a=r,i=sne(a.textContent??"",t,(u,f)=>rne(a,f,u)),l=i[i.length-1];if(l)return{node:a,...l}}return null}function rne(e,t,n){if(n>0)return Vp(t[n-1]);const r=e.previousSibling;if(!r||_s(r))return!0;if(r.nodeType===Node.TEXT_NODE){const a=r.textContent??"";return!a.length||Vp(a[a.length-1]??"")}return!0}function sne(e,t,n){const r=[];for(let a=0;a<e.length;a++){if(e[a]!=="#"||!n(a,e))continue;let i=a+1;for(;i<e.length&&/[0-9A-Fa-f]/.test(e[i]??"");)i++;const l=e.slice(a,i),u=pJ(l);if(!u)continue;if(i-a-1===3){const h=e[i];if(h===void 0?!t:/[0-9A-Za-z]/.test(h))continue}r.push({start:a,end:i,hex:u})}return r}function ane(e,t,n,r,a){const i=t.textContent??"",l=i.slice(0,n),u=i.slice(r),f=typeof window>"u"?null:window.getSelection();let h=null;f&&f.rangeCount>0&&f.getRangeAt(0).startContainer===t&&(h=f.getRangeAt(0).startOffset);const p=t.parentNode;if(p&&(t.textContent=u.length?u:" ",p.insertBefore(a,t),l&&p.insertBefore(document.createTextNode(l),a),h!=null)){if(h<=n){const g=a.previousSibling;(g==null?void 0:g.nodeType)===Node.TEXT_NODE&&Ro(e,g,Math.min(h,(g.textContent??"").length));return}if(h<=r||!u.length){Ro(e,t,t.length);return}Ro(e,t,Math.min(h-r,t.length))}}function ud(e){if(!e||!/^#[0-9a-f]{6}$/i.test(e))return;const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,a=Math.max(t,n,r),i=Math.min(t,n,r),l=a-i;if(l<.02)return;let u;return a===t?u=((n-r)/l+(n<r?6:0))*60%360:a===n?u=((r-t)/l+2)*60:u=((t-n)/l+4)*60,`hsl(${Math.round(u)} 55% 55%)`}function one(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","9"),t.setAttribute("height","9"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2.4");const n=document.createElementNS(e,"path");return n.setAttribute("d","m6 6 12 12M18 6 6 18"),t.appendChild(n),t}const x0="data-sc-coach-inert",ine=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function lne(e=document.body){let t=new Set;const n=a=>{a.hasAttribute("inert")&&!a.hasAttribute(x0)||(a.setAttribute(x0,""),a.setAttribute("inert",""))},r=a=>{a.hasAttribute(x0)&&(a.removeAttribute(x0),a.removeAttribute("inert"))};return{set(a){const i=new Set(a.filter(h=>h.isConnected&&e.contains(h)&&h!==e)),l=new Set;for(const h of i)for(let p=h.parentElement;p&&p!==e;p=p.parentElement)l.add(p);const u=new Set,f=h=>{for(const p of Array.from(h.children))i.has(p)||ine.has(p.tagName)||(l.has(p)?f(p):u.add(p))};f(e);for(const h of t)u.has(h)||r(h);for(const h of u)t.has(h)||n(h);t=new Set([...u].filter(h=>h.hasAttribute(x0)))},release(){for(const a of t)r(a);t=new Set}}}const ip=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),pi=e=>e.right-e.left,Ao=e=>e.bottom-e.top;function gP(e,t){return{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top),right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)}}function k0(e,t){return{left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}}function Vk(e,t=0,n=4,r=14,a=0,i=0,l=0){if(e>=4)return e+n;const u=i===0||a===0||a<=i+16;return t>=4&&u&&l<=1?t+n:r}function vP(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function Zk(e,t){let n=e;for(const r of t)n={left:Math.max(n.left,r.left),top:Math.max(n.top,r.top),right:Math.min(n.right,r.right),bottom:Math.min(n.bottom,r.bottom)};return pi(n)>0&&Ao(n)>0?n:null}function zk(e,t){let{top:n,bottom:r}=e;const a=(e.top+e.bottom)/2;for(const i of t)vP(i,e)&&(i.bottom<=a?n=Math.max(n,i.bottom):r=Math.min(r,i.top));return r>n?{...e,top:n,bottom:r}:null}const cne=e=>e==="top"||e==="bottom";function une(e,t,n){return t?cne(n)?{left:e.left,right:e.right,top:t.top,bottom:t.bottom}:{left:t.left,right:t.right,top:e.top,bottom:e.bottom}:e}const Bk=e=>e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left",Is=e=>Math.round(e*2)/2;function dne(e,t,n){const r=Is(t),a=Is(n),i=e.map(u=>{const f=Math.max(0,Is(pi(u))),h=Math.max(0,Is(Ao(u))),p=Is(Math.max(0,Math.min(u.radius,f/2,h/2)));return`<rect x='${Is(u.left)}' y='${Is(u.top)}' width='${f}' height='${h}' rx='${p}' fill='black'/>`}).join(""),l=`<svg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${a}'><defs><mask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='${r}' height='${a}'><rect width='${r}' height='${a}' fill='white'/>${i}</mask></defs><rect width='${r}' height='${a}' fill='black' mask='url(#m)'/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(l)}")`}function fne(e,t,n,r){const a=Is(t),i=Is(n),l=e.map(p=>{const g=Math.max(0,Is(pi(p))),m=Math.max(0,Is(Ao(p))),w=Is(Math.max(0,Math.min(p.radius,g/2,m/2)));return{x:Is(p.left),y:Is(p.top),ww:g,hh:m,k:w}}),u=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='black'/>`),f=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='none' stroke='${r}' stroke-width='2'/>`),h=`<svg xmlns='http://www.w3.org/2000/svg' width='${a}' height='${i}'><defs><mask id='o' maskUnits='userSpaceOnUse' x='0' y='0' width='${a}' height='${i}'><rect width='${a}' height='${i}' fill='white'/>${u.join("")}</mask></defs><g mask='url(#o)'>${f.join("")}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(h)}")`}function hne(e,t,n){const r={left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(n,e.bottom)};return[{left:0,top:0,right:t,bottom:r.top},{left:0,top:r.bottom,right:t,bottom:n},{left:0,top:r.top,right:r.left,bottom:r.bottom},{left:r.right,top:r.top,right:t,bottom:r.bottom}].filter(a=>pi(a)>0&&Ao(a)>0)}const Uk=0,pne=10,B8=14,S0=4,U8="data-guide-stage",mne="rgba(255,255,255,0.05)",W4="[data-guide-shape]",Wk=[],gne="[data-radix-popper-content-wrapper], .sc-setpop, .sc-morepop, .sc-shotsheet, .sc-note-pop",Kk='input, textarea, [contenteditable]:not([contenteditable="false"])',vne=17,Hh=12,wne=20,yne=450,bne=768,Gk=90,xne=8,Yk=12,kne=2e3,Sne=".sc-topbar, .sc-tabbar, .sc-filterbar, .sc-canvas-dock, .sc-help-float, .sc-pstudio-head, .sc-newdlg-head",Ene=120,Cne="[aria-live], .sc-toasts, .sc-upd-float, .sc-upd-overlay, [data-radix-popper-content-wrapper], .sc-chip-preview, .sc-swap, .sc-shotsheet, .sc-shotsheet-scrim, .sc-cmd",W8=e=>({id:e.id,title:e.title,body:e.body,canBack:e.canBack,action:e.action,count:e.at&&e.of?`${e.at} of ${e.of}`:void 0});function jne(e){const{id:t,voice:n,target:r,live:a,side:i,container:l,onShown:u}=e,f=e.lit??Wk,h=e.also??Wk,p=n==="ask",g=!r,m=!!(e.title||e.body),w=s.useId(),y=s.useId(),b=s.useRef(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),C=s.useRef(null),A=s.useRef(null),L=s.useRef(null),T=s.useRef(null),M=s.useRef(null),j=s.useRef(null),[P,R]=s.useState("moving"),[H]=s.useState(Lne),[D,U]=s.useState(()=>W8(e)),V=s.useRef(e);V.current=e;const B=s.useRef(!1),G=s.useRef(null),_=s.useRef([]),O=P==="shown"&&D.id===t?W8(e):D,I=K8(a),K=K8(h),z=K8(f);s.useEffect(()=>{if(p)return j.current=lne(l),()=>{var Z;(Z=j.current)==null||Z.release(),j.current=null;for(const ee of _.current)ee.removeAttribute(U8);_.current=[]}},[p,l]),s.useLayoutEffect(()=>{var Zt,jt,Ft;const Z=b.current,ee=k.current,he=S.current,ue=E.current,ge=C.current,te=A.current;if(p&&(!he||!ue||!ge||!te)||m&&(!Z||!ee))return;let J=!0,Q=0,ae=0,$e=!1,ie=!1,ke="",ze=0,wt=0,Ke=0,tt=null,De=null,Se=null;const X=window.matchMedia("(prefers-reduced-motion: reduce)").matches,je=a[0]??r??l;let Re="",re=r?Oh(r):null;R("moving");const Y=()=>{var Pt;return(Pt=j.current)==null?void 0:Pt.set([...Z?[Z]:[],...he?[he]:[],...ue?[ue]:[],...ge?[ge]:[],...te?[te]:[],...a,...h,...[...document.querySelectorAll(Cne)].filter(Tt=>![...a,...h].some(xe=>Tt.contains(xe)))])},se=()=>{var Pt,Tt;(Pt=j.current)==null||Pt.release(),ie=!1,R("away"),(Tt=r??a[0])!=null&&Tt.isConnected&&st()};if(p&&j.current&&B.current){Y(),ie=!0;const Pt=a.find(xe=>xe.matches(Kk)),Tt=document.activeElement;Pt&&!a.some(xe=>xe.contains(Tt))&&qk(Pt)}const Ne=async()=>{const Pt=++Q;if(r&&!r.isConnected||a.some(ne=>!ne.isConnected))return se(),V.current.onLost();const Tt=window.innerWidth,xe=window.innerHeight,Je=window.visualViewport,Et=[{left:0,top:0,right:Tt,bottom:xe},...Je?[{left:Je.offsetLeft,top:Je.offsetTop,right:Je.offsetLeft+Je.width,bottom:Je.offsetTop+Je.height}]:[]],Xe=ne=>{const le=ne===r?re:Oh(ne);return le?[...Et,ip(le.getBoundingClientRect())]:Et},rt=Ane(je,l),nt=rt.filter(ne=>pi(ne)>Tt/3),qt=r?Zk(ip(r.getBoundingClientRect()),Xe(r)):null,Yt=qt&&zk(qt,nt);if(r&&!Yt)return!$e&&Ke<Yk&&(Ke++,re=Oh(r),G8(r,re,X).then(()=>J&&Pe())),se();const an=[],Wt=[];for(const ne of[...r?[r]:[],...a,...h,...f,...Xk()]){const le=Qk(ne);Wt.includes(le)||Wt.push(le)}const Rn=new Set([...r?[r]:[],...a,...f,...Xk()].map(Qk));let Bt=null;for(const ne of Wt){const le=Zk(ip(ne.getBoundingClientRect()),Xe(ne)),ce=le&&zk(le,nt);if(!ce)continue;const Ve=lp(ne);an.push(Ve>=4||ne.matches("img, video, canvas")?{...k0(ce,Uk),radius:Ve+Uk}:{...k0(ce,pne),radius:B8}),Rn.has(ne)&&(Bt=Bt?gP(Bt,ce):ce)}if(!g&&!Yt&&!Bt)return se();if(ie&&(a.some(ne=>ne.closest("[inert]"))||Z!=null&&Z.closest("[inert]"))&&(ie=!1),p&&he&&ue&&ge&&te){if(!an.length&&Yt){const ce=r,Ve=Jk(ce);an.push({...k0(Yt,S0),radius:Vk(lp(ce),Ve.radius,S0,B8,Ao(Yt),Ve.height,Ve.count)})}for(const ce of _.current)Wt.includes(ce)||ce.removeAttribute(U8);for(const ce of Wt)ce.setAttribute(U8,"");_.current=Wt;const le=`${an.map(ce=>[ce.left,ce.top,ce.right,ce.bottom,ce.radius].map(Math.round).join(",")).join("|")}@${Tt}x${xe}`;if(le!==Re&&(Re=le,Pne(he,ue,te,an,H)),r&&Yt){const ce=Hne(r),Ve=Jk(r),_e=ce??k0(Yt,S0);Object.assign(ge.style,{left:`${_e.left}px`,top:`${_e.top}px`,width:`${pi(_e)}px`,height:`${Ao(_e)}px`,borderRadius:`${ce?Dne:Vk(lp(r),Ve.radius,S0,B8,Ao(Yt),Ve.height,Ve.count)}px`}),ge.hidden=!1}else ge.hidden=!0}if(Z&&document.documentElement.style.setProperty("--sc-coach-h",`${Math.round(Z.offsetHeight)}px`),Z&&g&&(Z.style.right="",Z.style.left=`${Math.round((Tt-Z.offsetWidth)/2)}px`,Z.style.top=`${Math.round((xe-Z.offsetHeight)/2)}px`,Z.dataset.side="centre",ee&&(ee.hidden=!0)),Z&&ee&&r&&Yt){Z.style.right="";const ne={top:Hh+Nne(rt,xe),bottom:Hh+Mne(rt,xe),left:Hh,right:Hh},le=Tt>=bne;De!==le&&(De!==null&&r&&(re=Oh(r),G8(r,re,X)),tt=null,De=le);const ce=i==="left"||i==="right"?"top":i,Ve=!le&&pi(Yt)>Tt*.6,_e=le?i:Ve?`${ce}-start`:ce,xt=(Te,qe)=>Zj(Rne(Te,r),Z,{strategy:"fixed",placement:tt??_e,middleware:[Fj(vne),Vj({padding:ne,fallbackPlacements:qe}),_j({padding:ne}),Y6({element:ee,padding:wne})]}),yt=!le&&Bt?{...Yt,top:Bt.top,bottom:Bt.bottom}:Yt,kt=(Te,qe)=>vP({left:Te,top:qe,right:Te+Z.offsetWidth,bottom:qe+Z.offsetHeight},k0(yt,S0)),Ae=le&&(i==="left"||i==="right")?[Bk(i),"top","bottom"]:le?void 0:Ve?["bottom-start","top-start"]:["bottom","top"],me=!p&&Ao(Yt)>xe*.6,et=le&&(e.beside||a.length>1),Ct=me?{...Yt,top:Yt.bottom-1}:et?une(Yt,Bt,i):yt;let be=await xt(Ct,me?["top"]:Ae);if(!J||Pt!==Q||!me&&kt(be.x,be.y)&&(be=await xt(yt,void 0),!J||Pt!==Q))return;if(!me&&kt(be.x,be.y))return R("stowed");tt=be.placement;const it=be.placement.split("-")[0];Z.style.left=`${Math.round(be.x)}px`,Z.style.top=`${Math.round(be.y)}px`,Z.dataset.side=it;const vt=be.middlewareData.arrow;ee.dataset.edge=Bk(it),ee.style.left=(vt==null?void 0:vt.x)!=null?`${vt.x}px`:"",ee.style.top=(vt==null?void 0:vt.y)!=null?`${vt.y}px`:"",ee.hidden=!vt||Math.abs(vt.centerOffset)>1}if(p&&!ie&&(Y(),ie=!0),!$e){if(One([...r?[r]:[],...a])&&++wt<Yk){window.setTimeout(Pe,Gk);return}const ne=[...r?[r]:[],...a,...h,...f].map(le=>{const ce=le.getBoundingClientRect();return[ce.left,ce.top,ce.right,ce.bottom].map(Math.round).join(",")}).join("|");if(ne!==ke&&(ke=ne,ze=0),++ze<2&&ze<xne){window.setTimeout(Pe,Gk);return}}R("shown"),$e||($e=!0,Oe(),st())};let Be=0;const st=()=>{const Pt=r??a[0];if(!Pt)return;cancelAnimationFrame(Be);let Tt=Pt.getBoundingClientRect();const xe=performance.now()+kne,Je=()=>{if(!J)return;const Et=Pt.getBoundingClientRect();(Et.top!==Tt.top||Et.left!==Tt.left||Et.height!==Tt.height)&&(Tt=Et,Pe()),performance.now()<xe&&(Be=requestAnimationFrame(Je))};Be=requestAnimationFrame(Je)},Pe=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(()=>void Ne())},Oe=()=>{B.current=!0;let Pt=!1;if(p&&Z){const Tt=Et=>!!Et&&a.some(Xe=>Xe.contains(Et)),xe=document.activeElement,Je=a.find(Et=>Et.matches(Kk))??null;M.current&&Tt(xe)?M.current=null:M.current?(((M.current==="back"?L.current:null)??T.current??Z).focus({preventScroll:!0}),M.current=null):Je&&!Tt(xe)?qk(Je):(!xe||xe===document.body||xe.closest("[inert]"))&&(Z.focus({preventScroll:!0}),Pt=!0)}u(t,Pt)},Ge=B.current&&!X&&m&&G.current!==t?Ene:0;G.current=t,$ne(Ge).then(()=>{if(J)return Br.flushSync(()=>U(W8(V.current))),r?G8(r,re,X):void 0}).then(()=>{J&&(Se=Ij(je,Z??he??je,Pe))});const ft=new ResizeObserver(Pe);for(const Pt of a)ft.observe(Pt);r&&ft.observe(r),Z&&ft.observe(Z);for(const Pt of[...r?[r]:[],...a]){const Tt=(Zt=Pt==null?void 0:Pt.closest)==null?void 0:Zt.call(Pt,W4);Tt&&ft.observe(Tt)}(jt=window.visualViewport)==null||jt.addEventListener("resize",Pe),(Ft=window.visualViewport)==null||Ft.addEventListener("scroll",Pe);let bt=0;const at=p?new MutationObserver(()=>{ie&&(cancelAnimationFrame(bt),bt=requestAnimationFrame(Y))}):null;return at==null||at.observe(l,{childList:!0,subtree:!0}),()=>{var Pt,Tt;J=!1,document.documentElement.style.removeProperty("--sc-coach-h"),cancelAnimationFrame(ae),cancelAnimationFrame(Be),cancelAnimationFrame(bt),at==null||at.disconnect(),Se==null||Se(),ft.disconnect(),(Pt=window.visualViewport)==null||Pt.removeEventListener("resize",Pe),(Tt=window.visualViewport)==null||Tt.removeEventListener("scroll",Pe)}},[t,p,m,r,I,K,z,i,l,u,H]),s.useEffect(()=>{if(!m||!r||!Tne(r))return;const Z=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);if(!Z.includes(y))return r.setAttribute("aria-describedby",[...Z,y].join(" ")),()=>{const ee=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(he=>he&&he!==y);ee.length?r.setAttribute("aria-describedby",ee.join(" ")):r.removeAttribute("aria-describedby")}},[m,r,y]);const{onEscape:q}=e;return s.useEffect(()=>{if(!p)return;const Z=J=>!!J&&a.some(Q=>Q.contains(J)),ee=J=>{var ke;const Q=b.current,ae=J.target instanceof Node?J.target:null,$e=Z(ae),ie=document.activeElement;if(J.key==="Escape"){if(J.defaultPrevented||ie!=null&&ie.closest('[role="dialog"]:not(.sc-coach):not(.sc-attachpanel)')||$e&&(ie!=null&&ie.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="listbox"]')))return;J.preventDefault(),J.stopPropagation(),q(t);return}$e||(!ae||ae===document.body||ae===document.documentElement||Q!=null&&Q.contains(ae)||(ke=E.current)!=null&&ke.contains(ae))&&J.stopPropagation()};let he=0,ue=!1;const ge=J=>{ue=J.target instanceof Node&&Z(J.target)},te=J=>{J.relatedTarget||ue||!b.current||(cancelAnimationFrame(he),he=requestAnimationFrame(()=>{var ae;if(!document.hasFocus())return;const Q=document.activeElement;(!Q||Q===document.body||Q.closest("[inert]"))&&((ae=b.current)==null||ae.focus({preventScroll:!0}))}))};return window.addEventListener("keydown",ee,!0),window.addEventListener("pointerdown",ge,!0),document.addEventListener("focusout",te,!0),()=>{cancelAnimationFrame(he),window.removeEventListener("keydown",ee,!0),window.removeEventListener("pointerdown",ge,!0),document.removeEventListener("focusout",te,!0)}},[t,p,I,q]),Br.createPortal(o.jsxs(o.Fragment,{children:[p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:S,className:"sc-coach-veil","data-veil":H?"mask":"panels","data-soft":e.soft||void 0,"data-state":P,"aria-hidden":"true",children:t9.map(Z=>o.jsx("div",{className:"sc-coach-panel"},Z))}),o.jsx("div",{ref:E,className:"sc-coach-catch","data-guide":"catch","data-state":P,"aria-hidden":"true",onMouseDown:Z=>Z.preventDefault(),children:t9.map(Z=>o.jsx("div",{className:"sc-coach-catch-part"},Z))}),o.jsx("div",{ref:A,className:"sc-coach-rim","data-state":P,"aria-hidden":"true"}),o.jsx("div",{ref:C,className:"sc-coach-ring","data-state":P,"aria-hidden":"true",hidden:!0})]}),m&&o.jsxs("div",{ref:b,className:"sc-coach","data-guide":"card","data-voice":p?"coach":"card","data-beside":e.beside||void 0,...p?{role:"dialog","aria-labelledby":O.title?w:void 0}:{role:"note"},"aria-describedby":y,tabIndex:-1,"data-state":P,children:[o.jsx("div",{ref:k,className:"sc-coach-arrow","aria-hidden":"true",hidden:!0}),o.jsxs("div",{className:"sc-coach-head",children:[O.title?o.jsx("h2",{id:w,className:"sc-coach-title",children:O.title}):o.jsx("p",{id:y,className:"sc-coach-body","data-lead":"",children:O.body}),O.count&&o.jsxs("p",{className:"sc-coach-count",children:[o.jsx("span",{className:"sc-vh",children:"Step "}),O.count]}),o.jsx(hr,{label:e.closeLabel,children:o.jsx("button",{type:"button",className:"sc-coach-x","aria-label":e.closeLabel,onClick:()=>e.onClose(t),children:o.jsx(jn,{size:16})})})]}),O.title&&O.body&&o.jsx("p",{id:y,className:"sc-coach-body",children:O.body}),(O.canBack||O.action)&&o.jsxs("div",{className:"sc-coach-foot",children:[O.canBack&&o.jsx("button",{ref:L,type:"button",className:"sc-coach-back",onClick:()=>{M.current="back",e.onBack(t)},children:"Back"}),O.action&&o.jsx("button",{ref:T,type:"button",className:"sc-btn sc-btn-primary sc-coach-next",onClick:()=>{M.current="action",e.onAction(t)},children:O.action.label})]})]})]}),l)}function qk(e){var t,n;if(e.focus({preventScroll:!0}),!e.isContentEditable){const r=e,a=((t=r.value)==null?void 0:t.length)??0;(n=r.setSelectionRange)==null||n.call(r,a,a);return}gc(e)}function Xk(){return[...document.querySelectorAll(gne)].filter(e=>e.getClientRects().length>0)}function K8(e){const t=s.useRef(e);return(t.current.length!==e.length||t.current.some((n,r)=>n!==e[r]))&&(t.current=e),t.current}function Ane(e,t){const n=[];for(const r of document.querySelectorAll(Sne))t.contains(r)&&(r.contains(e)||e.contains(r)||r.getClientRects().length===0||n.push(ip(r.getBoundingClientRect())));return n}function Nne(e,t){return Math.max(0,...e.filter(n=>n.top<=0&&n.bottom<t/3).map(n=>n.bottom))}function Mne(e,t){return Math.max(0,...e.filter(n=>n.bottom>=t&&n.top>t*2/3).map(n=>t-n.top))}function Rne(e,t){const n={x:e.left,y:e.top,left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:pi(e),height:Ao(e)};return{getBoundingClientRect:()=>n,contextElement:t}}function Pne(e,t,n,r,a){const i=window.innerWidth,l=window.innerHeight,u=r.reduce((h,p)=>h?gP(h,p):p,null),f=u?hne(u,i,l):[];if(a){const h=dne(r,i,l),p=e.style;p.maskImage=h,p.webkitMaskImage=h,n.style.backgroundImage=fne(r,i,l,mne)}else e9(e,f);e9(t,f)}function lp(e){return Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||0}function Qk(e){return e.closest(W4)??e.querySelector(W4)??e}function Jk(e){let t=0,n=0,r=0;for(const a of e.querySelectorAll("button, a[href], .sc-chip, .sc-btn"))a.getClientRects().length&&(r+=1,t=Math.max(t,lp(a)),n=Math.max(n,a.getBoundingClientRect().height));return{radius:t,height:n,count:r}}function e9(e,t){Array.from(e.children).forEach((n,r)=>{const a=t[r],i=n.style;if(!a){i.display="none";return}Object.assign(i,{display:"block",left:`${a.left}px`,top:`${a.top}px`,width:`${pi(a)}px`,height:`${Ao(a)}px`})})}const t9=[0,1,2,3];function Lne(){return typeof CSS>"u"?!1:CSS.supports("mask-image",'url("x.svg")')||CSS.supports("-webkit-mask-image",'url("x.svg")')}function Oh(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const n=getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function G8(e,t,n){if(!t)return Promise.resolve();const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();if(Math.max(0,Math.min(r.bottom,a.bottom,window.innerHeight)-Math.max(r.top,a.top,0))>=Math.min(120,r.height*.4))return Promise.resolve();const u=r.height>a.height*.8?r.top-a.top-16:(r.top+r.bottom)/2-(a.top+a.bottom)/2;return t.scrollBy({top:u,behavior:n?"auto":"smooth"}),n?Promise.resolve():new Promise(f=>{let h=!1;const p=()=>{h||(h=!0,t.removeEventListener("scrollend",p),f())};t.addEventListener("scrollend",p),window.setTimeout(p,yne)})}function $ne(e){return e>0?new Promise(t=>window.setTimeout(t,e)):Promise.resolve()}function Tne(e){return e.matches('button, a[href], input, select, textarea, [tabindex], [contenteditable="true"]')}const Dne=10;function Hne(e){if(!e.matches("a[href], button")||e.getBoundingClientRect().height<=48)return null;const t=document.createRange();t.selectNodeContents(e);const n=t.getBoundingClientRect();return n.width?{left:n.left-12,top:n.top-7,right:n.right+12,bottom:n.bottom+7}:null}function One(e){return document.getAnimations().some(t=>{var r,a;const n=(r=t.effect)==null?void 0:r.target;return!(n instanceof Element)||t.playState!=="running"||((a=t.effect)==null?void 0:a.getTiming().iterations)===Number.POSITIVE_INFINITY?!1:e.some(i=>n.contains(i))})}const ur=e=>e.kind==="question"?`q:${e.question.id}`:`${e.kind}:${e.id}`;function Ine(e){const t=e[e.length-1];return(t==null?void 0:t.kind)!=="question"||t.question.kind!=="confirm"||t.question.quiet||t.question.noEnter||e.some(r=>r.kind==="question"&&r.question.reopened||r.kind==="you"&&r.editing)?null:t.question}const cf=320,py=180,Fne=28,_ne=700;function l2(e){const t=e.split(/(\s+)/).filter(a=>a.length>0),n=t.filter(a=>!/^\s+$/.test(a)).length,r=Math.min(Fne,Math.floor(_ne/Math.max(1,n)));return{words:t,step:r,total:cf+py+r*n+160}}function Y8(e,t){return e.every(n=>!!t[n.id])}function Vne(e,t,n={}){const r=e.trim().toLowerCase();if(!r||r.split(/\s+/).length>6)return null;for(const i of t){const l=i.label.toLowerCase();if(r===l||r===i.id.toLowerCase())return i.id}for(const i of t){const l=n[i.id];if(l!=null&&l.test(r))return i.id}return null}function Zne(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const zne=/^(hi|hello|hey|heya|hiya|yo|hola|shalom|sup|good (morning|afternoon|evening)|thanks|thank you|thx|cheers)\b/i,Bne=/^(ok|okay|k|kk|sure|fine|yes|yeah|yep|yup|no|nope|nah|cool|nice|great|alright|right|hmm+|hm+|uh+|um+|oh|ah|wow|haha+|hehe+|lol|lmao|omg|meh|really|seriously|interesting|whatever)[\s!.,?]*$/i,Une=/^(how|what|what's|whats|who|who's|whos|why|where|when|which|can|could|do|does|did|are|is|will|would|should|may|have|has|am|isn't|aren't|don't|doesn't)\b/i,Wne=/^(start over|start again|restart|reset|cancel|stop|quit|exit|go back|back|undo|never ?mind|forget it|close)\b/i,Kne=/^(skip|next|continue|go|go on|proceed|generate|draw|render|build|show me|show|try|do it|let'?s go|begin|start)\b/i,n9=/^(help|help me|how does this work|what do i do|what should i (write|say|type)|instructions|\?+)[\s!.,?]*$/i,Gne=/\b(presenters?|avatars?|characters?|Scenri|create|creating|generate|generating|images?|pictures?|shoot|campaign|brand|product)\b/i,Yne=/^(test|testing|blah|lorem|ipsum|foo|bar|baz|dummy|sample|placeholder|xxx+|abc|asdf\w*|qwer\w*|zxcv\w*|hjkl|jkl|sdfg?|dfgh?|fghj?|bull\w*|shit\w*|crap|fuck\w*|damn|wtf|stfu|bs|rofl|lol+|lmao+|haha\w*|hehe\w*|meh|idk|nvm)$/i,qne=/^[b-df-hj-np-tv-xz]{3,}$/i,Xne=/(.)\1{3,}/,Qne=/\b(like|as|resembling|resembles|similar to|looks? like|looking like)\s+([A-Z][a-z]+)(?:\s+[A-Z][a-z]+)*\b/,Jne=/^(mediterranean|asian|east|south|southeast|indian|chinese|japanese|korean|african|black|white|nordic|scandinavian|latin|latina|latino|hispanic|arab|arabic|middle|eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipino|filipina|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|west|north|central)$/i;function ai(e,t){const n=e.trim();if(!n)return null;const r=Qne.exec(n);if(r&&!Jne.test(r[2]))return"likeness";if(t(n))return null;if(!new RegExp("\\p{L}","u").test(n))return n9.test(n)?"help":"nonsense";const a=n.split(/\s+/).filter(Boolean),i=a.length;if(n9.test(n))return"help";if(zne.test(n)&&i<=4)return"greeting";if(Bne.test(n))return"ack";const l=u=>u.replace(/[^a-z]/gi,"");return i<=8&&a.some(u=>Yne.test(l(u))||qne.test(l(u))||Xne.test(l(u)||u))?"nonsense":Une.test(n)||/\?\s*$/.test(n)?"question":Wne.test(n)&&i<=4?"nav":Gne.test(n)&&i<=10?"intent":Kne.test(n)&&i<=4?"go":i===1&&/^[A-Z][a-z]+$/.test(n)?null:i<=2?"vague":null}const ere=e=>`aside-said-${e}`,r9=e=>e.startsWith("aside-said-")?e.slice(11):null,Ei=(e,t=!1,n=!1)=>[...n?[]:[{kind:"you",id:ere(e.at),text:e.said,editable:!0,editing:t||void 0}],{kind:"scenri",id:`aside-reply-${e.at}${e.rev?`-${e.rev}`:""}`,text:e.reply}],Zp=e=>(e.kind==="you"||e.kind==="scenri")&&e.id.startsWith("aside-");function wP(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question.id;if(!Zp(n))return null}return null}const zp=()=>new Date().toISOString();function tre({options:e,picked:t,onPick:n}){return o.jsx("div",{className:"sc-convo-grid",children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}function nre({step:e,children:t}){const n=s.useRef(null),[r,a]=s.useState({back:!1,on:!0}),i=s.useCallback(()=>{const h=n.current;if(!h)return;const p=h.scrollWidth-h.clientWidth;a({back:h.scrollLeft>2,on:h.scrollLeft<p-2})},[]);s.useEffect(()=>{const h=n.current;if(!h)return;i(),h.addEventListener("scroll",i,{passive:!0});const p=new ResizeObserver(i);return p.observe(h),()=>{h.removeEventListener("scroll",i),p.disconnect()}},[i]);const l=h=>{const p=n.current;if(!p)return;const g=p.firstElementChild,m=Number.parseFloat(getComputedStyle(p).columnGap)||0,w=g?g.offsetWidth+m:e,y=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;p.scrollBy({left:h*w,behavior:y?"smooth":"auto"})},u=r.back&&r.on?"both":r.back?"back":r.on?"on":void 0,f=r.back||r.on;return o.jsxs("div",{className:"sc-convo-strip","data-fade":u,children:[f&&o.jsx(s9,{dir:-1,live:r.back,onGo:l}),o.jsx("div",{className:"sc-convo-plates",ref:n,children:t}),f&&o.jsx(s9,{dir:1,live:r.on,onGo:l})]})}function s9({dir:e,live:t,onGo:n}){const r=e<0;return o.jsx("button",{type:"button",className:"sc-convo-strip-go","data-dir":r?"back":"on","data-spent":!t||void 0,"aria-label":r?"Show earlier":"Show more","aria-disabled":!t||void 0,tabIndex:-1,onClick:a=>{a.currentTarget.blur(),t&&n(e)},children:r?o.jsx(Ta,{size:14,weight:"bold"}):o.jsx(Nl,{size:14,weight:"bold"})})}const rre=106;function a9({options:e,picked:t,onPick:n}){return o.jsx(nre,{step:rre,children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}const yP=6e4,sre=60*yP,q8=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),are=e=>e.toLocaleDateString([],{day:"numeric",month:"short"});function ore(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((r-n)/864e5)}function ire(e,t=Date.now()){const n=Math.max(0,t-e);if(n<45e3)return"just now";if(n<sre)return`${Math.max(1,Math.round(n/yP))} min ago`;const r=new Date(e),a=ore(r,new Date(t));return a===0?q8(r):a===1?`Yesterday ${q8(r)}`:`${are(r)} ${q8(r)}`}const lre=e=>new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"});function cre({text:e,tone:t,at:n,now:r,reveal:a,eyebrow:i=!0,delay:l=0,leave:u,turnId:f,dim:h,thumb:p,label:g,view:m,current:w,restore:y,onRestore:b,retry:k,onRetry:S,onShow:E}){const[C]=s.useState(l),A=gy(u,C),{playing:L,thinking:T}=EP(a,e,C,A==="true");return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"scenri","data-arrive":L||void 0,"data-leave":A,"data-turn":f,"data-dim":h||void 0,style:L?{...bP(C),"--sc-convo-after":`${l2(e).total}ms`}:void 0,children:[i&&o.jsx(my,{thinking:T,at:n,now:r}),o.jsxs("p",{className:"sc-convo-say","data-tone":t,"data-reveal":L||void 0,children:[T&&o.jsx(kP,{}),o.jsx(SP,{text:e,playing:L})]}),p&&o.jsxs("span",{className:"sc-convo-shot","data-reveal":L||void 0,"data-current":w||void 0,children:[m&&E?o.jsx("button",{type:"button",className:"sc-convo-shot-pick","aria-label":g?`Show ${g} on the stage`:"Show this on the stage",onClick:()=>E(m),children:o.jsx(o9,{thumb:p,label:g,current:w})}):o.jsx(o9,{thumb:p,label:g,current:w}),y&&b?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>b(y.view,y.hash),children:"Put back"}):k&&S?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>S(k),children:"Try again"}):w&&o.jsx("span",{className:"sc-convo-shot-do",children:"Active"})]})]})}const bP=e=>({"--sc-convo-start":`${e}ms`,"--sc-convo-think":`${cf}ms`});function my({thinking:e,at:t,now:n}){return o.jsxs("span",{className:"sc-convo-who","data-thinking":e||void 0,"aria-hidden":"true",children:[o.jsx(UQ,{className:"sc-convo-mark"}),"Scenri",t?o.jsx(xP,{at:t,now:n}):null]})}function xP({at:e,now:t}){return o.jsx("time",{className:"sc-convo-time",dateTime:new Date(e).toISOString(),title:lre(e),children:ire(e,t)})}function ure({what:e="Thinking"}){return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-working":"true",children:[o.jsx(my,{thinking:!0}),o.jsx("p",{className:"sc-convo-say",children:o.jsxs("span",{className:"sc-convo-work",children:[e,o.jsx(dre,{})]})})]})}function dre(){return o.jsxs("span",{className:"sc-convo-ell","aria-hidden":"true",children:[o.jsx("i",{children:"."}),o.jsx("i",{children:"."}),o.jsx("i",{children:"."})]})}function kP(){return o.jsxs("span",{className:"sc-convo-dots","aria-hidden":"true",children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]})}function SP({text:e,playing:t}){const n=s.useRef(t);if(t&&(n.current=!0),!n.current)return o.jsx(o.Fragment,{children:e});const{words:r,step:a}=l2(e);let i=0,l=0;return o.jsx(o.Fragment,{children:r.map(u=>{const f=l;if(l+=u.length,/^\s+$/.test(u))return u;const h=i++;return o.jsx("span",{className:"sc-convo-w",style:{"--sc-convo-word-delay":`${h*a}ms`},children:u},`${f}:${u}`)})})}function EP(e,t,n=0,r=!1){const[a,i]=s.useState(!!e),[l,u]=s.useState(!!e),f=s.useRef(!!e);return s.useEffect(()=>{e&&!f.current&&(i(!0),u(!0)),f.current=!!e},[e]),s.useEffect(()=>{if(!a)return;const h=setTimeout(()=>{u(!1),i(!1)},n+l2(t).total),p=setTimeout(()=>u(!1),n+cf);return()=>{clearTimeout(h),clearTimeout(p)}},[a,t,n]),{playing:a&&!r,thinking:a&&l&&!r}}function gy(e,t,n=cf+py){const r=s.useRef(performance.now());if(e)return performance.now()-r.current<t+n?"early":"true"}function o9({thumb:e,label:t,current:n}){return o.jsx("img",{src:gn(e,"micro"),srcSet:`${gn(e,"micro")} 160w, ${gn(e,"small")} 320w, ${gn(e,"tile")} 640w`,sizes:"(max-width: 767px) 248px, 128px",alt:n&&t?`${t}, active`:t??""})}const fre=300,hre=e=>typeof e=="string"?e:null,pre=e=>Array.isArray(e)?e:[],mre=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};function gre({question:e,reveal:t,busy:n,eyebrow:r=!0,delay:a=0,leave:i,spent:l,turnId:u,dim:f,at:h,now:p,onAnswer:g,onPick:m,onStarter:w,onDescribe:y,onAttachFiles:b,onCancel:k}){var te,J,Q,ae,$e;const[S]=s.useState(a),E=gy(i,S),{playing:C,thinking:A}=EP(t,e.prompt,S,E==="true"),L="given"in e?e.given:void 0,[T,M]=s.useState(()=>mre(L)),[j,P]=s.useState(null),[R,H]=s.useState(()=>new Set(pre(L))),D=!!l||!!n,U=s.useRef(!1);s.useEffect(()=>{U.current&&!D&&P(null),U.current=D},[D]),s.useEffect(()=>{e.attempt&&P(null)},[e.attempt]);const V=(ie,ke)=>{j||(P(ie),m==null||m(e.id,{picked:ie,picks:T}),g(ke))},B=j??hre(L),G=s.useRef(null),_=s.useRef(null),O=s.useRef(()=>{});O.current=()=>{e.kind==="pick"&&e.more&&!e.loading&&g({kind:"pick",action:{type:"more"}})};const I=e.kind==="pick"?e.items.length:0,K=e.kind==="pick"&&!!e.more;s.useEffect(()=>{const ie=_.current,ke=G.current;if(!ie||!ke||!K||typeof IntersectionObserver>"u")return;const ze=new IntersectionObserver(wt=>wt.some(Ke=>Ke.isIntersecting)&&O.current(),{root:ke,rootMargin:"0px 0px 240px 0px"});return ze.observe(ie),()=>ze.disconnect()},[I,K]);const z=I>0;s.useLayoutEffect(()=>{const ie=G.current;if(!ie||!z||typeof ResizeObserver>"u")return;const ke=()=>{const wt=ie.querySelector(".sc-convo-plate");wt&&ie.style.setProperty("--sc-pick-row",`${wt.getBoundingClientRect().height}px`)};ke();const ze=new ResizeObserver(ke);return ze.observe(ie),()=>ze.disconnect()},[z]);const q=e.kind==="pick"?(te=e.search)==null?void 0:te.value:void 0;s.useEffect(()=>{G.current&&(G.current.scrollTop=0)},[q]);const Z=l2(e.prompt),ee=`sc-convo-q-${e.id}`,he=s.useRef(null),ue=e.reopened&&k&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost sc-convo-cancel",onClick:k,children:"Cancel"}),ge="attach"in e&&e.attach&&b&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass",onClick:()=>{var ie;return(ie=he.current)==null?void 0:ie.click()},children:[o.jsx(LF,{size:14,weight:"bold"}),e.attach]}),o.jsx("input",{ref:he,type:"file",accept:"image/*",hidden:!0,"aria-label":e.attach,onChange:ie=>{const ke=Array.from(ie.target.files??[]).filter(ze=>ze.type.startsWith("image/"));ie.target.value="",ke.length&&b(ke)}})]});return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-arrive":C||void 0,"data-leave":E,"data-turn":u,"data-dim":f||void 0,"data-reopened":e.reopened||void 0,style:C?{...bP(S),"--sc-convo-after":`${Z.total}ms`}:void 0,children:[!e.reopened&&r&&o.jsx(my,{thinking:A,at:h,now:p}),!e.reopened&&o.jsxs("p",{className:"sc-convo-say",id:ee,"data-tone":e.tone,"data-reveal":C||void 0,children:[A&&o.jsx(kP,{}),o.jsx(SP,{text:e.prompt,playing:C})]}),e.reopened&&o.jsx("span",{id:ee,hidden:!0,children:e.prompt}),!e.reopened&&e.hint&&o.jsx("p",{className:"sc-convo-hint","data-reveal":C||void 0,children:e.hint}),o.jsxs("fieldset",{className:"sc-convo-q","aria-labelledby":ee,hidden:e.kind==="text"&&!((J=e.starters)!=null&&J.length)&&!e.cost&&!e.note?!0:void 0,tabIndex:-1,"data-kind":e.kind,"data-reveal":C||void 0,"data-picked":!!j||void 0,disabled:n||void 0,children:[e.starters&&e.starters.length>0&&o.jsx("div",{className:"sc-convo-starters",children:e.starters.map(ie=>o.jsx(hr,{label:ie.text,children:o.jsx("button",{type:"button",className:"sc-convo-starter",onClick:()=>w==null?void 0:w(ie.text),children:ie.label})},ie.text))}),e.kind==="choice"&&((Q=e.options)==null?void 0:Q.some(ie=>ie.card))&&o.jsx(a9,{options:e.options,picked:B,onPick:ie=>V(ie,{kind:"choice",id:ie})}),e.kind==="choice"&&e.options&&!e.groups&&!e.options.some(ie=>ie.card)&&o.jsx("div",{className:"sc-convo-choices sc-convo-ask","data-guide-shape":"",children:e.options.map(ie=>o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice","aria-pressed":e.multi?R.has(ie.id):void 0,"data-on":(e.multi?R.has(ie.id):B===ie.id)||void 0,onClick:()=>e.multi?H(ke=>{const ze=new Set(ke);return ze.delete(ie.id)||ze.add(ie.id),ze}):V(ie.id,{kind:"choice",id:ie.id}),children:ie.label},ie.id))}),e.kind==="choice"&&(e.describe||e.attach||e.skip)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&!e.multi&&!e.groups&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>V("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),ge,!e.multi&&ue]}),e.kind==="choice"&&!e.groups&&!e.multi&&!e.describe&&!e.attach&&ue&&o.jsx("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:ue}),e.kind==="choice"&&e.multi&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-on":j==="submit"||void 0,onClick:()=>V("submit",{kind:"choices",picks:Object.fromEntries([...R].map(ie=>[ie,"on"]))}),children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>V("skip",{kind:"skip"}),children:e.skip}),ue]}),e.kind==="choice"&&e.groups&&o.jsxs("div",{className:"sc-convo-groups",children:[e.groups.map(ie=>o.jsxs("div",{className:"sc-convo-group",children:[o.jsx("span",{className:"sc-convo-group-lb",id:`sc-convo-g-${e.id}-${ie.id}`,children:ie.label}),o.jsx(ri,{label:ie.label,value:T[ie.id]??"",ids:ie.options.map(ke=>ke.id),onChange:ke=>M(ze=>({...ze,[ie.id]:ke})),className:"sc-convo-choices",children:ie.options.map(ke=>o.jsx(si,{id:ke.id,on:T[ie.id]===ke.id,label:ke.label,className:"sc-chip sc-convo-choice",onPick:()=>M(ze=>({...ze,[ie.id]:ke.id})),children:ke.label},ke.id))})]},ie.id)),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!Y8(e.groups,T)||void 0,title:Y8(e.groups,T)?void 0:"Pick one in each row, or skip.","data-on":j==="submit"||void 0,onClick:()=>{Y8(e.groups??[],T)&&V("submit",{kind:"choices",picks:T})},children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>V("skip",{kind:"skip"}),children:e.skip}),ue]})]}),e.kind==="swatches"&&o.jsxs("div",{className:"sc-convo-look",children:[e.row.options.some(ie=>ie.card)?e.layout==="grid"?o.jsx(tre,{options:e.row.options,picked:B,onPick:ie=>V(ie,{kind:"swatches",picks:{[e.row.id]:ie}})}):o.jsx(a9,{options:e.row.options,picked:B,onPick:ie=>V(ie,{kind:"swatches",picks:{[e.row.id]:ie}})}):o.jsx("div",{className:"sc-convo-swatches",children:e.row.options.map(ie=>o.jsx(hr,{label:ie.label,children:o.jsx("button",{type:"button",className:ie.color?"sc-convo-swatch":"sc-chip sc-convo-choice",style:ie.color?{"--sc-swatch":ie.color}:void 0,"aria-label":ie.label,"aria-pressed":B===ie.id,"data-on":B===ie.id||void 0,onClick:()=>V(ie.id,{kind:"swatches",picks:{[e.row.id]:ie.id}}),children:ie.color?null:ie.label})},ie.id))}),(e.skip||e.describe||ue)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":j==="skip"||!j&&e.skipped,"data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>V("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),ue]})]}),e.kind==="photos"&&o.jsxs("div",{className:"sc-convo-photos-q",children:[o.jsx(wR,{hashes:e.hashes,max:e.max,label:((ae=e.drop)==null?void 0:ae.label)??"Add a photo of their face",hint:(($e=e.drop)==null?void 0:$e.hint)??"Drop it here, or choose a file",busy:e.busy,onAdd:ie=>g({kind:"photos",action:{type:"add",files:ie}}),onRemove:ie=>g({kind:"photos",action:{type:"remove",hash:ie}}),onReject:()=>g({kind:"photos",action:{type:"reject"}})}),e.instead&&o.jsx("button",{type:"button",className:"sc-convo-other","data-on":j==="instead"||void 0,"data-waiting":e.insteadWaiting||void 0,"aria-hidden":e.insteadWaiting||void 0,tabIndex:e.insteadWaiting?-1:void 0,disabled:e.insteadWaiting||void 0,onClick:()=>V("instead",{kind:"photos",action:{type:"instead"}}),children:e.instead}),e.attest&&o.jsxs("label",{className:"sc-convo-attest",children:[o.jsx("input",{type:"checkbox",checked:e.attest.checked,onChange:ie=>g({kind:"photos",action:{type:"attest",checked:ie.target.checked}})}),o.jsx("span",{children:e.attest.text})]}),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!!X8(e)||void 0,title:X8(e)??void 0,"data-on":j==="submit"||void 0,onClick:()=>{X8(e)||V("submit",{kind:"photos",action:{type:"submit"}})},children:e.submit}),e.back&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="back"||void 0,onClick:()=>V("back",{kind:"photos",action:{type:"back"}}),children:e.back}),ue]})]}),e.kind==="pick"&&o.jsxs("div",{className:"sc-convo-pick",children:[e.search&&o.jsx("input",{type:"search",className:"sc-convo-pick-q",value:e.search.value,placeholder:e.search.label,"aria-label":e.search.label,onChange:ie=>g({kind:"pick",action:{type:"query",text:ie.target.value}}),onKeyDown:ie=>{var ke;ie.key!=="Escape"||!((ke=e.search)!=null&&ke.value)||(ie.preventDefault(),g({kind:"pick",action:{type:"query",text:""}}))}}),o.jsxs("fieldset",{ref:G,className:"sc-convo-pick-scroll","aria-labelledby":ee,"aria-busy":e.loading||void 0,children:[e.items.length===0&&e.loading&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid","aria-hidden":!0,children:Array.from({length:8},(ie,ke)=>o.jsx("span",{className:"sc-convo-plate sc-convo-pick-wait",children:o.jsx("span",{className:"sc-convo-plate-in"})},ke))}),e.items.length>0&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid",children:e.items.map(ie=>o.jsx("button",{type:"button",className:"sc-convo-plate","aria-label":ie.alt,"aria-pressed":B===ie.id,"data-on":B===ie.id||void 0,onClick:()=>V(ie.id,{kind:"pick",action:{type:"pick",id:ie.id}}),children:o.jsx("span",{className:"sc-convo-plate-in",style:{backgroundImage:`url("${gn(ie.hash,"small")}")`}})},ie.id))}),e.items.length===0&&!e.loading&&e.empty&&o.jsx("p",{className:"sc-convo-pick-empty",children:e.empty}),e.more&&o.jsx("div",{ref:_,className:"sc-convo-pick-end","aria-hidden":!0})]}),o.jsx("p",{className:"sc-vh",role:"status",children:e.loading?"":e.status??""}),(e.back||ue)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.back&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":j==="back"||void 0,onClick:()=>V("back",{kind:"pick",action:{type:"back"}}),children:e.back}),ue]})]}),e.kind==="confirm"&&e.quote&&o.jsx(vre,{text:e.quote,label:e.quoteLabel,folded:e.quoteFolded}),e.kind==="confirm"&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[e.options.map((ie,ke)=>o.jsx("button",{type:"button",className:`sc-btn ${ke===0&&!e.quiet?"sc-btn-primary":"sc-btn-ghost"}`,"data-on":j===ie.id||void 0,onClick:()=>V(ie.id,{kind:"confirm",id:ie.id}),children:ie.label},ie.id)),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),ge,ue]}),e.cost&&o.jsx("p",{className:"sc-convo-note","data-cost":!0,children:e.cost}),e.note&&o.jsx("p",{className:"sc-convo-note",children:e.note})]})]})}function vre({text:e,label:t="The brief",folded:n=!1}){const[r,a]=s.useState(!1),[i,l]=s.useState(!n);return s.useEffect(()=>{if(!r)return;const u=setTimeout(()=>a(!1),1600);return()=>clearTimeout(u)},[r]),o.jsxs("figure",{className:"sc-convo-brief",children:[o.jsxs("figcaption",{className:"sc-convo-brief-head",children:[o.jsx("span",{className:"sc-convo-brief-lb",children:t}),o.jsxs("button",{type:"button",className:"sc-convo-brief-copy","data-took":r||void 0,onClick:()=>{var u;(u=navigator.clipboard)==null||u.writeText(e).then(()=>a(!0),()=>{})},children:[r?o.jsx(Gn,{size:13,weight:"bold"}):o.jsx(gp,{size:13,weight:"bold"}),r?"Copied":"Copy"]})]}),o.jsx("p",{className:"sc-convo-brief-text","data-folded":!i||void 0,children:e}),n&&o.jsx("button",{type:"button",className:"sc-convo-brief-more","aria-expanded":i,onClick:()=>l(u=>!u),children:i?"Show less":"Show all"})]})}function X8(e){return e.busy?"Still uploading.":e.hashes.length===0?"Add at least one photo.":e.attest&&!e.attest.checked?"Confirm you have permission to use their likeness.":null}function wre({text:e,photos:t,at:n,now:r,editable:a,editing:i,arrive:l,leave:u,delay:f=0,turnId:h,dim:p,onEdit:g,onSave:m,onCancel:w}){const[y]=s.useState(!!l),[b]=s.useState(f),k=gy(u,y?b:0,y?240:0);return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"you","data-arrive":y||void 0,"data-leave":k,"data-turn":h,"data-dim":p||void 0,style:y?{"--sc-convo-start":`${b}ms`}:void 0,children:[n?o.jsx(xP,{at:n,now:r}):null,i&&m&&w?o.jsx(yre,{text:e,onSave:m,onCancel:w}):o.jsxs("div",{className:"sc-convo-bubble",children:[a&&g&&o.jsx(hr,{label:"Change this answer",children:o.jsx("button",{type:"button",className:"sc-convo-edit","aria-label":"Change this answer",onClick:g,children:o.jsx(Ad,{size:13})})}),o.jsx("p",{children:e}),t&&t.length>0&&o.jsx("div",{className:"sc-convo-photos",children:t.map((S,E)=>o.jsx("img",{src:gn(S,"micro"),alt:`Yours, ${E+1} of ${t.length}`},S))})]})]})}function yre({text:e,onSave:t,onCancel:n}){const[r,a]=s.useState(e),i=s.useRef(null);s.useEffect(()=>{const u=i.current;u&&(u.focus(),u.setSelectionRange(u.value.length,u.value.length))},[]);const l=()=>{const u=r.trim();u&&t(u)};return o.jsxs("div",{className:"sc-convo-bubble","data-editing":"true",children:[o.jsx("textarea",{ref:i,className:"sc-convo-rewrite","aria-label":"Your answer",rows:Math.min(6,Math.max(1,r.split(`
|
|
103
|
+
`).length)),value:r,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),n()),u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l())}}),o.jsxs("div",{className:"sc-convo-rewrite-do",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!r.trim()||void 0,onClick:l,children:"Save"})]})]})}const bre=180,i9=3e3,CP=460,xre="cubic-bezier(0.22, 1, 0.36, 1)",kre=220,Sre=450,Ere=48;function Cre({turns:e,busy:t,working:n,memoryKey:r,resumed:a,onAnswer:i,onEdit:l,onSaveEdit:u,onCancelEdit:f,onStarter:h,onDescribe:p,onAttachFiles:g,onRestore:m,onRetry:w,onShow:y}){var Re;const b=s.useRef(null),k=s.useRef(!0),S=s.useRef(!!a),E=s.useRef(performance.now());S.current&&performance.now()-E.current>i9&&(S.current=!1),s.useEffect(()=>{if(!S.current)return;const re=()=>{S.current=!1},Y=window.setTimeout(re,i9);return window.addEventListener("pointerdown",re,{capture:!0}),window.addEventListener("keydown",re,{capture:!0}),()=>{window.clearTimeout(Y),window.removeEventListener("pointerdown",re,{capture:!0}),window.removeEventListener("keydown",re,{capture:!0})}},[]);const C=Zne(),A=s.useRef(e),L=s.useRef(null),T=s.useRef(null),M=s.useRef(null),j=s.useRef(null),P=s.useRef(null),R=s.useRef([]),[,H]=s.useState(0),D=s.useRef(new Map),U=s.useRef(0),V=performance.now(),B=s.useRef(!1),G=Nre(e);if(G!==L.current){L.current=G,B.current=!0;const re=j.current&&V<j.current.until?j.current:null,Y=re?l9(A.current,re):A.current,se=new Set(e.map(ur)),Ne=u9(e),Be=u9(Y),st=Pe=>Pe.startsWith("you:")&&Ne.has(Ih(Pe))||Pe.startsWith("q:")&&Be.has(Pe)&&se.has(Ih(Pe));if(R.current=Y.map(ur).filter(Pe=>!se.has(Pe)&&!st(Pe)),Ne.size&&!Be.size){const Pe=Ih([...Ne][0]),Oe=Y.find(Ge=>ur(Ge)===Pe);M.current=(Oe==null?void 0:Oe.kind)==="you"?{key:Pe,text:Oe.text}:null}if(Be.size>0&&Ne.size===0){const Pe=M.current;M.current=null;const Oe=Pe?e.find(bt=>ur(bt)===Pe.key):void 0,Ge=!!Pe&&((Oe==null?void 0:Oe.kind)!=="you"||Oe.text!==Pe.text),ft=e[e.length-1];T.current=Ge&&(ft==null?void 0:ft.kind)==="question"?ur(ft):null}if(!C&&R.current.length){const Pe=R.current.some(ft=>!(re!=null&&re.gone.has(ft))),Oe=re!=null&&re.look&&R.current.includes(`q:${re.look.qid}`)?re.look:null,Ge=P.current??Oe;j.current={from:Y,gone:new Set(R.current),look:Ge,until:Pe?V+(P.current?fre:bre):(re==null?void 0:re.until)??V}}else j.current=null;P.current=null,A.current=e}const _=j.current&&V<j.current.until?j.current:null;_||(j.current=null),s.useEffect(()=>{if(!_)return;const re=window.setTimeout(()=>H(Y=>Y+1),Math.max(0,_.until-performance.now()));return()=>window.clearTimeout(re)},[_]);const O=(re,Y)=>{P.current={qid:re,look:Y}},I=_?l9(e,_):e,K=s.useRef(null);if(K.current===null){const re=r?Lre(r):null;K.current=re??new Set(a||e.length>2?e.map(ur):[])}const z=s.useRef(null);z.current===null&&(z.current=(r?Rre(r):null)??new Map);const[q,Z]=s.useState(()=>Date.now()),ee=Math.max(0,...z.current.values()),he=q-ee<36e5;s.useEffect(()=>{if(!he)return;const re=window.setInterval(()=>Z(Date.now()),3e4);return()=>window.clearInterval(re)},[he]),T.current&&(K.current.delete(T.current),T.current=null);const ue=new Set;for(const re of I){const Y=ur(re);re.kind==="question"&&re.question.reopened||K.current.has(Y)||ue.add(Y)}if(a&&S.current&&ue.size){for(const re of ue)K.current.add(re);ue.clear()}const ge=[];let te=Number.POSITIVE_INFINITY;{const re=new Set(I.map(ur));for(const Y of[...D.current.keys()])re.has(Y)||D.current.delete(Y);for(const Y of I){const se=ur(Y);if(!ue.has(se)){ge.push(Y);continue}let Ne=D.current.get(se);if(Ne===void 0){const Be=Y.kind==="you"||Y.kind==="scenri"&&!!Y.quiet;Ne=Math.max(V,Be?0:U.current,(_==null?void 0:_.until)??0),D.current.set(se,Ne),U.current=Math.max(U.current,Ne+(Be?kre:cf+py))}Ne<=V?ge.push(Y):te=Math.min(te,Ne-V)}}s.useEffect(()=>{if(te===Number.POSITIVE_INFINITY)return;const re=window.setTimeout(()=>H(Y=>Y+1),te);return()=>window.clearTimeout(re)},[te]),s.useEffect(()=>{const re=K.current;if(re){for(const Y of R.current)re.delete(Y);for(const Y of ge){if(Y.kind==="question"&&Y.question.reopened)continue;const se=ur(Y);_!=null&&_.gone.has(se)||re.add(se)}r&&$re(r,re),r&&z.current&&Pre(r,z.current)}});const J=s.useRef(null),Q=s.useCallback(()=>{const re=b.current;if(!re)return null;const Y=J.current;return Y!=null&&Y.isConnected&&Y.scrollHeight>Y.clientHeight?Y:(J.current=K4(re),J.current)},[]);s.useEffect(()=>{const re=()=>{const Y=Q();Y&&(k.current=Y.scrollHeight-Y.scrollTop-Y.clientHeight<24)};return document.addEventListener("scroll",re,{passive:!0,capture:!0}),()=>document.removeEventListener("scroll",re,{capture:!0})},[Q]);const ae=(()=>{const re=e.find(se=>se.kind==="question"&&se.question.reopened);if(re)return ur(re);const Y=e.find(se=>se.kind==="you"&&se.editing);return Y?ur(Y):null})();s.useLayoutEffect(()=>{var se;if(!k.current||ae)return;const re=document.activeElement;if(re instanceof HTMLInputElement&&re.type==="search"&&((se=b.current)!=null&&se.contains(re)))return;const Y=Q();Y&&(Y.scrollTop=Y.scrollHeight)});const $e=s.useRef(ae);$e.current=ae;const ie=e.length;s.useEffect(()=>{const re=ie>0&&b.current?Mre(b.current):null;if(!re||typeof ResizeObserver>"u")return;const Y=new ResizeObserver(()=>{!k.current||$e.current||(re.scrollTop=re.scrollHeight)});return Y.observe(re),()=>Y.disconnect()},[ie]);const ke=s.useRef(null);s.useLayoutEffect(()=>{var st,Pe,Oe,Ge;if(ae===ke.current)return;const re=ke.current;ke.current=ae;const Y=b.current;if(!Y)return;const se=document.activeElement;if(!(!se||se===document.body||Y.contains(se)))return;if(ae){if(k.current=!1,ae.startsWith("you:"))return;(Pe=(st=E0(Y,ae))==null?void 0:st.querySelector(".sc-convo-q"))==null||Pe.focus({preventScroll:!0});return}if(!re)return;const Be=re.startsWith("q:")?Ih(re):re;(Ge=(Oe=E0(Y,Be))==null?void 0:Oe.querySelector(".sc-convo-edit"))==null||Ge.focus({preventScroll:!0})}),s.useEffect(()=>{if(!ae)return;const re=window.setTimeout(()=>{const Y=E0(b.current,ae),se=b.current&&K4(b.current);if(!Y||!se)return;const Ne=Y.getBoundingClientRect(),Be=se.getBoundingClientRect();Ne.bottom-Be.bottom>Ere&&c9(Y,C)},CP);return()=>window.clearTimeout(re)},[ae,C]);const ze=e.length&&e[e.length-1].kind==="question"?ur(e[e.length-1]):null,wt=s.useRef(ze);s.useLayoutEffect(()=>{var st,Pe;const re=b.current;if(ae||!re||ze===wt.current)return;const Y=document.activeElement,se=(st=Y==null?void 0:Y.closest(".sc-convo-turn"))==null?void 0:st.getAttribute("data-turn"),Ne=!Y||Y===document.body||Y!==re&&Y.contains(re)||!!se&&se.startsWith("q:")&&se!==ze;if(!ze||!Ne){wt.current=ze;return}const Be=(Pe=E0(re,ze))==null?void 0:Pe.querySelector(".sc-convo-q:not([hidden])");Be&&(wt.current=ze,Be.focus({preventScroll:!0}))});const Ke=s.useRef(ze),tt=s.useRef(null);s.useEffect(()=>{if(ze===Ke.current)return;if(!ze){ae&&(tt.current=Ke.current),Ke.current=null;return}const re=E0(b.current,ze);if(!re)return;Ke.current=ze;const Y=tt.current!==null,se=tt.current===ze;if(tt.current=null,k.current||Y&&se)return;const Ne=()=>{Are(re,b.current)||c9(re,C)};if(!Y){Ne();return}const Be=window.setTimeout(Ne,Sre);return()=>window.clearTimeout(Be)},[ze,ae,C]);const De=s.useRef(new Map);s.useLayoutEffect(()=>{const re=b.current;if(!re)return;const Y=new Map,se=B.current;B.current=!1;for(const Ne of re.querySelectorAll(".sc-convo-turn")){const Be=Ne.dataset.turn??"",st=Ne.offsetTop;Y.set(Be,st);const Pe=De.current.get(Be);!se||C||Pe===void 0||Math.abs(Pe-st)<1||jre(Ne,Pe-st)}De.current=Y});const Se=new Set;if(ae){Se.add(ae);const re=ae.slice(ae.indexOf(":")+1);Se.add(`scenri:asked-${re}`);const Y=ge.findIndex(se=>ur(se)===ae);if(Y>=0){for(let se=Y+1;se<ge.length&&Zp(ge[se]);se++)Se.add(ur(ge[se]));for(let se=Y-1;se>=0&&Zp(ge[se]);se--)Se.add(ur(ge[se]))}}for(const re of ge){const Y=ur(re);z.current.has(Y)||z.current.set(Y,Date.now())}let X=!1;const je=[];for(const re of ge){const Y=ur(re),se=!!ae&&!Se.has(Y),Ne=z.current.get(Y),Be=!!(_!=null&&_.gone.has(Y)),st=Be&&re.kind==="question"&&((Re=_==null?void 0:_.look)==null?void 0:Re.qid)===re.question.id,Pe=re.kind==="scenri"&&!!re.quiet,Oe=!C&&!Be&&ue.has(Y)&&!Pe,Ge=0,ft=X;Be||(X=re.kind==="scenri"||re.kind==="question"&&!re.question.reopened),re.kind==="you"?je.push(o.jsx(wre,{text:re.text,photos:re.photos,editable:re.editable,editing:re.editing,arrive:Oe,leave:Be,delay:Ge,turnId:Y,dim:se,at:Ne,now:q,onEdit:re.editable&&l?()=>l(re.id):void 0,onSave:u?bt=>u(re.id,bt):void 0,onCancel:f},Y)):re.kind==="scenri"?je.push(o.jsx(cre,{text:re.text,tone:re.tone,reveal:Oe,leave:Be,eyebrow:!ft,delay:Ge,turnId:Y,dim:se,at:Ne,now:q,thumb:re.thumb,label:re.label,view:re.view,current:re.current,restore:re.restore,onRestore:m,retry:re.retry,onRetry:w,onShow:y},Y)):je.push(o.jsx(gre,{question:re.question,reveal:Oe,leave:Be&&!st,spent:Be,delay:Ge,turnId:Y,dim:se,busy:t||se,eyebrow:!ft,at:Ne,now:q,onAnswer:bt=>i(re.question.id,bt),onPick:O,onStarter:h,onDescribe:p,onAttachFiles:g,onCancel:f},Y))}return o.jsx("div",{ref:b,className:"sc-convo-log",role:"log","aria-live":"polite","aria-relevant":"additions","data-changing":ae?"true":void 0,children:o.jsxs("div",{className:"sc-convo-turns",children:[je,n&&o.jsx(ure,{what:n===!0?void 0:n})]})})}function l9(e,t){const n=[],r=new Set(e.map(ur));let a=0;for(const i of t.from){const l=ur(i);if(t.gone.has(l)){r.has(l)||n.push(i);continue}for(;a<e.length&&ur(e[a])!==l;)n.push(e[a++]);a<e.length&&n.push(e[a++])}for(;a<e.length;)n.push(e[a++]);return n}function jre(e,t){for(const a of e.getAnimations())a.id==="slide"&&a.cancel();const n=`translateY(${t}px)`;e.style.transform=n;const r=e.animate([{transform:n},{transform:"translateY(0)"}],{duration:CP,easing:xre,fill:"both"});r.id="slide",r.onfinish=()=>{e.style.transform="",r.cancel()}}function Are(e,t){if(!t)return!1;const n=K4(t),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();return r.top>=a.top&&r.top<=a.bottom-24}function c9(e,t){var n;(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest",behavior:t?"auto":"smooth"})}function E0(e,t){if(!e)return null;for(const n of e.querySelectorAll(".sc-convo-turn"))if(n.dataset.turn===t)return n;return null}function Nre(e){const t=[];for(const n of e){const r=ur(n);if(n.kind==="question"){const u=n.question,f="options"in u&&Array.isArray(u.options)?u.options.map(h=>h.id).join(","):"";t.push(`${r}~${u.reopened?1:0}~${u.prompt}~${u.hint??""}~${f}`);continue}const a="photos"in n&&Array.isArray(n.photos)?n.photos.length:0,i="thumb"in n?n.thumb??"":"",l="editing"in n&&n.editing?1:0;t.push(`${r}~${n.text??""}~${i}~${a}~${l}`)}return t.join("")}function u9(e){const t=new Set;for(const n of e)n.kind==="question"&&n.question.reopened&&t.add(ur(n));return t}function Ih(e){return e.startsWith("you:")?`q:${e.slice(4)}`:e.startsWith("q:")?`you:${e.slice(2)}`:""}function K4(e){let t=e;for(;t;){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return e}function Mre(e){for(let t=e;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if(n==="auto"||n==="scroll")return t}return null}const vy=e=>`scenri:convo-said:${e}`;function fl(e){try{sessionStorage.removeItem(vy(e)),sessionStorage.removeItem(wy(e))}catch{}}const wy=e=>`scenri:convo-at:${e}`;function Rre(e){try{const t=sessionStorage.getItem(wy(e));return t?new Map(Object.entries(JSON.parse(t))):null}catch{return null}}function Pre(e,t){try{sessionStorage.setItem(wy(e),JSON.stringify(Object.fromEntries(t)))}catch{}}function Lre(e){try{const t=sessionStorage.getItem(vy(e));return t?new Set(JSON.parse(t)):null}catch{return null}}function $re(e,t){try{sessionStorage.setItem(vy(e),JSON.stringify([...t]))}catch{}}const d9={product:"product",presenter:"person"};function Q8(e){return`${["No","One","Two","Three","Four","Five"][e]??String(e)} picture${e===1?"":"s"}`}function J8(e){const[t,...n]=e,r=[t,...n.map(a=>a.toLowerCase())];return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]??""}const pe={title:"Create place",editTitle:"Edit place",intent:"Create a place",source:"Where are we shooting? Describe the place, or start from pictures of one.",addPictures:"Add pictures",guideMe:"Guide me",photos:"Add one to four pictures of the place. The more they share, the better it reads.",photosDrop:{label:"Add pictures of the place",hint:"Drop them here, or choose files"},fromShot:"Or start from one of your shots",fromShotAnswer:"Start from one of my shots",shot:"Which shot? I'll read the place in it and leave the product and people out.",shotSearch:"Find a shot",shotNone:"No shots to start from yet.",shotNotFound:e=>`No shot matches "${e}".`,shotsFailed:"The shots could not be read just now. Try the search again.",shotCount:(e,t)=>t?`${e} shots so far, more as you scroll`:`${e} ${e===1?"shot":"shots"}`,shotAnswer:"This shot",backToPictures:"Back to pictures",shotOff:"Choose a shot above.",madeIn:e=>`This shot was made in ${e}.`,takeScene:e=>`Use ${e}`,readNew:"Read a new place from it",reuseOff:"Choose above.",anotherShot:"Choose another shot",stopped:"That was stopped. Nothing here was changed.",stoppedRead:"Stopped before the place was read. Read it again, or say it differently.",stoppedDraw:"Stopped. Nothing was drawn.",stoppedChange:"Stopped before the picture changed. The new words are kept: draw them, or put back the last picture.",readThem:"Read them",guideInstead:"Guide me instead",skip:"Skip",describeInstead:"Describe instead",worldHint:"Choose a starting world. You'll personalise it next.",worldLightPrompt:e=>`This world is already lit ${e}. Keep it, or choose another.`,keepWorldLight:"Keep it",keepWorldSurface:"Keep the world's own",suggestOne:"Suggest one",followWorld:"You have the feel of it. What kind of place is it?",followLight:"You have the place. What light is it in?",leaveToReading:"Leave it to the reading",worldIsAStart:"Treat this as a starting direction, not a picture to reproduce: keep the material language and the character of the light, and invent a specific original arrangement.",emptyLead:"The place appears here",emptyHint:"Describe it, or add pictures of it",sourcePlaceholder:"Describe the place, or choose above",nothingSaidPlaceholder:"Tell me where we are, in your own words",rowPlaceholder:e=>`Pick one above, or describe the ${e}`,photosOff:"Add the pictures above, then read them.",addPlaceholder:"Anything to add or leave out?",keepPlaceholder:"Anything to keep or ignore in them?",keepShotPlaceholder:"Anything to keep or ignore in it?",changePlaceholder:"Say what to change. The rest stays.",namePlaceholder:"Its name",nameIt:"Name this place",attachLabel:"Add pictures of the place",send:"Send",lineLabel:"Your answer",change:"Change",reading:"Writing what your shots are told",readingPhotos:"Reading your pictures",changing:"Changing the words",drawing:"Drawing the place",stillReading:"Still writing what your shots are told",readingHead:"What your shots are told",placeLabel:"The place",emptyLabel:"Empty",lightLabel:"Light",cameraLabel:"Camera",figureLabel:"Built around",agree:"Here is the place, in full. Ready to draw?",agreePhotos:"Here is the place I read in your pictures. Ready to draw?",agreeShot:"Here is the place I read in your shot. Ready to draw?",agreeChanged:"Here it is with that. Ready to draw?",drawsTwo:"It draws two pictures: the place, and the place in use.",agreeBlind:"Here is the place, in full. Nothing here can draw yet, so it is saved as words.",noReader:"Reading pictures needs Codex, which is not set up yet.",noReaderOff:"Set up Codex above to read them.",changePictures:"Change pictures",readAgain:"I read the place again.",draw:"Draw the place",saveWords:"Save place",here:"Here is the place.",again:"Here it is again.",changed:"Here it is, changed.",decide:e=>`Here is ${e}. Use it, or change something.`,decideEdit:e=>`Here is ${e}. Save it, or change something.`,decideSaved:"Nothing has changed yet.",use:"Use this place",saveChanges:"Save changes",tryAgain:"Try again",changeSomething:"Change something",name:"While it draws: what should we call it?",editOpen:e=>`Here is ${e}, as it is saved. Change something, or draw it again.`,failed:"That did not work. Nothing standing was touched.",failedFirst:e=>`That did not go through: ${e}. Nothing was drawn.`,failedSaid:e=>`${e} Nothing was drawn.`,failedKept:e=>`That did not go through: ${e}. The picture you had is kept.`,sayDifferently:"Say it differently",lost:"That work is gone: the server restarted while it ran. Try it again.",offline:"Lost touch with Scenri. Still trying.",stopLost:"Stop did not reach Scenri. Press it again.",busyElsewhere:"This place is already being worked on in another window. Try again once that is done.",retry:"Try again",version:e=>`Version ${e}`,saved:"Saved.",savedQuiet:"Saved. Nothing is drawn until you ask.",usedOff:"The place is saved. Choose above.",showInUse:(e,t)=>`Show it in use? ${Q8(t.length)} with a Scenri demo ${d9[e]} in the place: ${J8(t.map(n=>n.toLowerCase()))}.`,staleSet:e=>`${Q8(e)} here show${e===1?"s":""} the place as it was before. Draw ${e===1?"it":"them"} again?`,moreViews:e=>`Add ${Q8(e.length).toLowerCase()} of it in use? ${J8(e)}.`,drawIt:"Draw it",drawThem:"Draw them",drawThemAgain:"Draw them again",inUse:e=>`Saved. Now it is shown in use, with a Scenri demo ${d9[e]}.`,noLibrary:"Saved. Scenri's library has not downloaded yet, so it cannot be shown in use for now.",exampleHere:{hero:"Here is the hero.",close:"Here is a close-up.",hands:"Here it is in hands.",angle:"Here is another angle.",bold:"Here is a bold one."},exampleFailed:(e,t)=>`The ${e.toLowerCase()} did not draw: ${t.replace(/[.\s]+$/,"")}.`,exampleFailedSaid:(e,t)=>`The ${e.toLowerCase()} did not draw. ${t}`,more:e=>`Add ${["no","one","two","three"][e.length]??e.length} more? ${J8(e)}.`,addThem:"Add them",notNow:"Not now",ready:e=>`${e} is ready.`,readyUndrawn:e=>`${e} is ready. It can be shown in use any time, from its page.`,readyMissing:e=>`${e} is ready. Some did not draw.`,openScene:"Open place",useInAShot:"Use in a shot",notAPlace:"That did not read as a place. Try a few words about it, like 'a quiet concrete gallery at dusk'.",greet:"Hello. Describe the place, or choose above.",greetRow:"Pick one above, or say it in a few words.",askHelp:"Describe the place in a few words, or tap one above. Everything can be changed later.",goFirst:"Choose above, or describe the place first.",startOverIsUp:"Start over is at the top of this panel.",notInAScene:"A place holds the setting and its light. Add people and products in Create.",usePutBack:"Step back through the versions on the picture, and Put back the one you want.",sayAChange:"Say what to change about the place, and the rest stays as it is.",renamed:e=>`Called it ${e}.`,changeIt:"Change it",changeTitle:"Change this answer?",changeBody:"The picture was drawn from the answers as they are. Changing one asks again from there, and the pictures so far go. To keep the picture and change one thing, say it in the line instead.",onlyPictures:"Only pictures can show a place.",fourPictures:"Four pictures is the most a place is read from.",heicNotYet:"HEIC pictures cannot be read yet. Export them as JPEG, then add them.",leaveTitle:"Stop making this place?",leaveBody:"Nothing has been read yet, so the answers here go.",leave:"Leave",discardTitle:"Discard the changes?",discardBody:"The place stays as it was saved. What was drawn here is let go.",discard:"Discard changes",startOver:"Start over",startOverTitle:"Start over?",startOverBody:"This conversation begins again from the first question. Nothing here is saved yet."},Tre="part of the place itself, never a separate object that competes with the subject, and leaving the subject a clear place to stand",jP={water:{surface:[{key:"basalt",label:"Wet basalt",words:"a ledge of wet black basalt, glossy where the sea has just left it"},{key:"sand",label:"White sand",words:"rippled white sand under a few centimetres of clear water"},{key:"pebbles",label:"Sea pebbles",words:"a bed of smooth sea-worn pebbles, wet and gleaming"},{key:"awash",label:"Rock awash",words:"a flat rock just awash, a thin sheet of clear water sliding over it"}],light:[{key:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface"},{key:"sunset",label:"Low sun on water",words:"low sun skimming the water, long glittering reflections"},{key:"silver",label:"Silver overcast",words:"soft silver overcast light, the sea flat and pale"},{key:"backlit",label:"Backlit spray",words:"the sun behind the surf, the spray lit up like glass"}],signature:[{key:"wave",label:"Frozen wave",words:"a wave frozen mid-break behind the rock, its crest in glassy detail"},{key:"foam",label:"Foam lace",words:"a lace of sea foam drawn across the wet rock"},{key:"kelp",label:"Kelp ribbons",words:"glossy olive-gold ribbons of kelp draped over the rocks"},{key:"pool",label:"Mirror pool",words:"a still rock pool mirroring the sky"}]},stone:{surface:[{key:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable"},{key:"limestone",label:"Rough limestone",words:"a rough-cut block of warm limestone, chisel marks in its face"},{key:"terracotta",label:"Terracotta tile",words:"sun-baked terracotta floor tiles, worn at the edges"},{key:"marble",label:"Weathered marble",words:"weathered pale marble, its polish worn soft by years of sun"}],light:[{key:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the stone"},{key:"olive",label:"Olive-leaf dapple",words:"sun broken into moving dapples through olive leaves"},{key:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across the stone, long warm shadows"},{key:"shade",label:"Cool shade",words:"the niche in open shade, cool bounced light and a bright sunlit world beyond"}],signature:[{key:"vines",label:"Vines taking over",words:"a vine growing down the stone, claiming its edges"},{key:"basin",label:"Water in the stone",words:"water trickling into a basin carved in the stone, glinting"},{key:"dust",label:"Dust in the sun",words:"fine dust hanging in one bright shaft of sun"},{key:"sphere",label:"A giant stone sphere",words:"one oversized stone sphere resting in the space, impossible in scale"}]},colour:{surface:[{key:"lacquer",label:"Glossy lacquer",words:"a glossy lacquered floor the same colour as the sweep, mirroring it"},{key:"paper",label:"Matte paper",words:"matte coloured paper, its fibres and one soft crease readable"},{key:"acrylic",label:"Frosted acrylic",words:"a sheet of frosted acrylic glowing softly with the colour behind it"},{key:"velvet",label:"Flocked velvet",words:"flocked velvet in the same colour, soaking up the light"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the colour"},{key:"split",label:"Two-colour gels",words:"two coloured gels splitting the light, one warm and one cool edge"},{key:"wrap",label:"Soft studio wrap",words:"soft wrapping studio light, a gentle gradient across the sweep"},{key:"rim",label:"Neon rim",words:"one neon rim tracing the edges, the rest of the colour dimmed"}],signature:[{key:"shapes",label:"Floating shapes",words:"a few simple geometric shapes floating in the colour, frozen in place"},{key:"planes",label:"Cut-paper planes",words:"sharp-angled planes of cut paper converging in the colour"},{key:"block",label:"Colour-block shadow",words:"a hard shadow cut into a block of a second colour"},{key:"giant",label:"Surreal scale",words:"one oversized sphere or arch in the colour, impossible in scale"}]},citrus:{surface:[{key:"halves",label:"Cut citrus",words:"a bed of halved citrus, the flesh glistening with juice"},{key:"tile",label:"Glazed tile",words:"sun-bleached glazed tiles in white and cobalt"},{key:"ice",label:"Crushed ice",words:"crushed ice melting over the fruit"},{key:"cloth",label:"Crisp linen",words:"a crisp white linen cloth spread under the fruit"}],light:[{key:"glow",label:"Sun through fruit",words:"the sun behind the fruit, the flesh glowing like stained glass"},{key:"leaves",label:"Leaf shade",words:"sun broken into dapples through citrus leaves"},{key:"golden",label:"Late golden sun",words:"late golden sun, the sky deepening, long warm shadows"},{key:"flash",label:"Hard flash",words:"hard direct flash against the blue sky, crisp and saturated"}],signature:[{key:"blossom",label:"Blossom and leaves",words:"citrus blossom and glossy leaves threaded through the fruit"},{key:"melting",label:"Ice melting",words:"ice melting over the fruit, beads of water running down"},{key:"peel",label:"Peel spirals",words:"long spirals of peel curling across the mound"},{key:"giant",label:"Giant fruit",words:"one citrus fruit at an impossible, monumental scale on the horizon"}]},volcanic:{surface:[{key:"crust",label:"Lava crust",words:"a crust of cooled black lava, ropey and cracked"},{key:"sand",label:"Black sand",words:"fine black volcanic sand, wind-rippled"},{key:"pumice",label:"Pumice",words:"porous grey pumice, sharp and light"},{key:"obsidian",label:"Obsidian",words:"a slab of glassy black obsidian with conchoidal edges"}],light:[{key:"fissures",label:"Glow from below",words:"incandescent orange fissures lighting the rock from below"},{key:"raking",label:"Sun through haze",words:"a hard low sun raking through the orange haze"},{key:"ember",label:"Ember glow",words:"a deep ember glow, everything else falling into dark"},{key:"moon",label:"Blue moonlight",words:"cold blue moonlight on the black rock, the haze gone silver"}],signature:[{key:"lava",label:"Lava still moving",words:"lava still glowing in the cracks of the crust, cooling as it goes"},{key:"ash",label:"Ash in the air",words:"fine ash drifting through the haze"},{key:"steam",label:"Steam vents",words:"white steam rising from vents in the rock"},{key:"floating",label:"Floating rocks",words:"a few rocks hanging weightless in the haze, impossible and still"}]},dark:{surface:[{key:"mirror",label:"Black mirror",words:"black mirror glass, every reflection crisp"},{key:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain"},{key:"marble",label:"Black marble",words:"polished black marble with thin white veins"},{key:"water",label:"Black water",words:"still black water, one faint ripple"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the dark"},{key:"pool",label:"Pool of light",words:"one pool of light from above, the rest falling to true black"},{key:"neon",label:"Neon edge",words:"one line of coloured neon reflected in the black surface"},{key:"rim",label:"Thin rim",words:"a thin bright rim of light along every edge, nothing else lit"}],signature:[{key:"wax",label:"Wax cascading",words:"dark wax cascading down a wall into the mirror, glossy and still setting"},{key:"ripples",label:"Ripples",words:"slow concentric ripples crossing the black surface"},{key:"smoke",label:"Smoke curl",words:"one curl of smoke drifting through the light"},{key:"sphere",label:"Floating sphere",words:"a perfect sphere floating above the mirror, impossible and still"}]},plaster:{surface:[{key:"limewash",label:"Limewash floor",words:"a limewashed plaster floor, soft and chalky"},{key:"oak",label:"Pale oak",words:"pale oak boards, their grain soft in the light"},{key:"terrazzo",label:"Terrazzo",words:"pale terrazzo with small flecks of stone"},{key:"silk",label:"Silk drape",words:"a length of silk pooling on the floor in soft folds"}],light:[{key:"shadow",label:"Window shadow",words:"hard sun through the tall window, its shape laid long across the room"},{key:"leaves",label:"Leaf shadows",words:"soft moving leaf shadows thrown across the plaster"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the plaster, long warm shadows"},{key:"dusk",label:"Blue dusk",words:"cool blue dusk in the window, the room dim and quiet"}],signature:[{key:"curtain",label:"Curtain in the wind",words:"a sheer curtain lifted into the room by the wind"},{key:"plants",label:"Plants growing in",words:"green plants growing up the plaster walls, claiming the corners"},{key:"arch",label:"Arch shadow",words:"the hard shadow of an arch cut across the wall"},{key:"stair",label:"Surreal stair",words:"a plaster stair rising into the wall and going nowhere"}]},linen:{surface:[{key:"linen",label:"Raw linen",words:"raw undyed linen, its slub weave readable"},{key:"satin",label:"Silk satin",words:"heavy silk satin in deep folds, its sheen catching the light"},{key:"boucle",label:"Wool bouclé",words:"nubbly wool bouclé, soft and textured"},{key:"paper",label:"Crumpled paper",words:"large sheets of crumpled paper folded like cloth"}],light:[{key:"leaves",label:"Leaf dapple",words:"sun broken into soft dapples through leaves"},{key:"slice",label:"Slice of sun",words:"one hard slice of sun across the folds"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the folds, deep warm shadows"},{key:"through",label:"Light through cloth",words:"light glowing through the cloth from behind"}],signature:[{key:"wind",label:"Lifted by wind",words:"the cloth lifted by a gust and frozen mid-billow"},{key:"dried",label:"Dried flowers",words:"a few dried flowers and grasses caught in the folds"},{key:"thread",label:"One red thread",words:"a single red thread running through the folds"},{key:"landscape",label:"Folds as dunes",words:"the folds made vast, like a landscape of dunes"}]}};function yy(e,t){const n=e?jP[e]:void 0;return n?n[t].map((r,a)=>({id:`${e}-${r.key}`,label:r.label,words:r.words,card:`scene-${e}-${t}-${a+1}`})):null}function Dre(e){return Object.keys(jP).flatMap(t=>yy(t,e)??[])}const Hre=["water","stone","colour","citrus","volcanic","dark","plaster","linen"],uf=["world","surface","light","signature"],va=(e,t)=>`scene-${e}-${t}`,El={world:{prompt:"What world?",options:[{id:"water",label:"Rock and water",words:"a shoreline of wet dark rock and shallow turquoise water",light:"in hard midday sun",card:va("world",1),cues:["water","sea","ocean","shore","shoreline","beach","wet","pool","underwater"]},{id:"stone",label:"Sunlit stone",words:"a niche of warm limestone and rough plaster",light:"in hard afternoon sun",card:va("world",2),cues:["stone","limestone","wall","niche","arch","terracotta","mediterranean","sunlit"]},{id:"colour",label:"Colour field",words:"a seamless studio sweep in one saturated colour",light:"in flat hard poster light",card:va("world",3),cues:["studio","sweep","seamless","backdrop","colour","color","paper","poster","graphic","flat"]},{id:"citrus",label:"Fruit and sky",words:"a mound of cut citrus under an open blue sky",light:"in bright direct sun",card:va("world",4),cues:["fruit","citrus","orange","lemon","sky","outdoors","outdoor","summer","juice"]},{id:"volcanic",label:"Volcanic haze",words:"dark volcanic rock in a deep orange haze",light:"with one hard low light raking across it",card:va("world",5),cues:["volcanic","lava","rock","ash","dust","haze","smoke","desert","mars"]},{id:"dark",label:"Dark mirror",words:"a near-black polished surface like a still pool",light:"in low-key light, with one bright edge",card:va("world",6),cues:["mirror","reflection","polished","still pool"]},{id:"plaster",label:"Soft plaster",words:"a bare plaster room with one tall soft window",light:"in soft overcast daylight",card:va("world",7),cues:["plaster","concrete","microcement","minimal","interior","room","window","raw","architectural","overcast"]},{id:"linen",label:"Linen fold",words:"a length of raw undyed linen folded in soft loose drapes",light:"in soft window light",card:va("world",8),cues:["linen","fabric","textile","cloth","drape","fold","woven","cotton","soft fabric"]}]},surface:{prompt:"What is it made of, up close?",options:[{id:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable",cues:["travertine"]},{id:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain",cues:["steel","stainless","brushed metal","aluminium","aluminum"]},{id:"clay",label:"Cracked clay",words:"sun-dried terracotta clay cracked into deep fissures",cues:["clay","terracotta","cracked earth"]},{id:"silk",label:"Silk folds",words:"heavy silk gathered into deep sculptural folds",cues:["silk","satin"]},{id:"sand",label:"Wet sand",words:"rippled wet sand, glossy where the water has just drawn back",cues:["sand","wet sand"]},{id:"moss",label:"Moss and roots",words:"damp moss over exposed roots, dense and living",cues:["moss","mossy","roots"]},{id:"ice",label:"Ice",words:"clear ice with trapped bubbles and a cold blue depth",cues:["ice","icy","glacial"]},{id:"concrete",label:"Raw concrete",words:"raw board-formed concrete with timber grain printed into it",cues:["board-formed","cement"]}]},light:{prompt:"What does the light do?",options:[{id:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the place",cues:["long shadow","skylight","shaft of light","single shadow"]},{id:"dapple",label:"Dappled leaves",words:"sun broken into soft moving dapples through leaves",cues:["dappled","dapple","through leaves","leaf shadows","canopy"]},{id:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface",cues:["caustics","caustic","rippling light","underwater light"]},{id:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the set",cues:["gobo","spotlight","cut light","shaped light"]},{id:"window",label:"Soft window",words:"soft daylight from one large window, falling open and shadowless on the far side",card:va("light",7),cues:["window light","side light","from a window","sidelit","window","soft","daylight","overcast","diffused"]},{id:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across it, long warm shadows",card:va("light",2),cues:["golden","golden hour","sunset","sunrise","dusk","warm"]},{id:"neon",label:"Neon glow",words:"coloured neon streaking its light across glossy surfaces at night",card:va("light",4),cues:["neon","night","nocturnal","after dark"]},{id:"lowkey",label:"Pool of light",words:"one pool of light with a bright edge, the rest falling to true black",card:va("light",6),cues:["low key","lowkey","dramatic","shadowy","chiaroscuro","rim light"]}]},signature:{prompt:"What makes it unforgettable?",options:[{id:"air",label:"Mist, snow or wind",words:"the air of the place alive, such as mist lying low, snow drifting down or wind moving through fabric or grass: one, chosen for this place",cues:["mist","misty","fog","foggy","snow","snowing","wind","windswept","haze"]},{id:"change",label:"Caught mid-change",words:"the place's own material caught mid-change, such as wax cascading down a wall, sugar pulled glassy across the surface or ice melting at its edge: one, chosen for this place",cues:["melting","molten","dripping","wax","resin","mid-change"]},{id:"graphic",label:"Graphic light and shadow",words:"one bold graphic device of light and shadow shaping the set, such as a cut shadow or a hard slice of colour",cues:["graphic","geometric","cut shadow","colour block","color block"]},{id:"nature",label:"Nature taking over",words:"nature growing through the set, such as moss, blooms or roots claiming its edges: one, chosen for this place",cues:["overgrown","blooms","flowers","vines","growing"]},{id:"water",label:"Glass and water",words:"water and reflection in the place, such as a still reflecting pool or rain-beaded glass: one, chosen for this place",cues:["reflection","reflecting","rain","puddle","rain glass"]},{id:"scale",label:"Surreal scale",words:"one surreal touch of scale, an oversized natural or architectural form that makes the place feel impossible",cues:["surreal","giant","oversized","impossible","dreamlike"]}]}},Ore=new Set([...El.world.options.map(e=>e.card),...El.light.options.filter(e=>e.card).map(e=>e.card),...Hre.flatMap(e=>["surface","light","signature"].flatMap(t=>(yy(e,t)??[]).map(n=>n.card)))]);function Ire(e,t){return e==="world"?El.world.options:yy(t,e)??El[e].options}function Fre(e,t){const n=Ire(e,t),r=n.every(a=>!!a.card&&Ore.has(a.card));return{id:e,label:El[e].prompt,options:n.map(a=>({id:a.id,label:a.label,...r?{card:a.card}:{}}))}}const _re={world:"place",surface:"surface",light:"light",signature:"idea"},f9=e=>_re[e],Po=(e,t)=>{if(!t)return;const n=El[e].options.find(r=>r.id===t);return n||e==="world"?n:Dre(e).find(r=>r.id===t)},Vre="one signature idea that makes this place unforgettable, invented for it and never generic";function Zre(e){const t=` ${e.toLowerCase().replace(/[^a-z0-9]+/g," ")} `,n={};for(const r of uf){let a=null;for(const i of El[r].options)for(const l of i.cues??[]){const u=` ${l.replace(/[^a-z0-9]+/g," ")} `;t.includes(u)&&(!a||l.length>a.len)&&(a={id:i.id,len:l.length})}a&&(n[r]=a.id)}return n}const Sd=4e3,AP=8e3,zre=["studio","cyclorama","cyc","seamless","sweep","backdrop","set","room","interior","exterior","beach","shore","shoreline","coast","sea","ocean","lake","river","water","pool","forest","woods","woodland","jungle","garden","park","field","meadow","desert","dune","dunes","mountain","mountains","cliff","cave","canyon","street","city","urban","rooftop","loft","warehouse","gallery","museum","hotel","lobby","kitchen","bathroom","bedroom","living room","cafe","café","bar","restaurant","shop","store","boutique","market","library","courtyard","terrace","balcony","corridor","hallway","tunnel","bridge","station","greenhouse","spa","chapel","ruin","ruins","architecture","landscape","outdoors","indoors","sky"],G4=["stone","rock","rocks","marble","travertine","limestone","granite","basalt","concrete","plaster","terrazzo","tile","tiles","wood","wooden","oak","walnut","linen","fabric","velvet","silk","satin","glass","metal","steel","chrome","brass","mirror","sand","moss","ferns","foliage","flowers","paper","colour field","color field","colour block","color block","pastel","brutalist","minimal","wall","walls","clay","terracotta","ice","aluminium","aluminum","stainless","leather","felt","slate","onyx","salt"],NP=["splash","splashing","mid air","frozen","falling","petals","confetti","smoke","mist","fog","steam","dust","drifting","bubbles","melting","molten","dripping","wax","resin","pouring","overgrown","blooms","flowers","vines","reflection","reflections","reflecting","rain","puddle","ripples","surreal","giant","oversized","levitating","impossible","dreamlike","cut shadow","gobo"],MP=["light","lit","lighting","flash","strobe","strobes","sun","sunny","sunlight","sunlit","sunshine","daylight","golden hour","sunset","sunrise","dusk","dawn","twilight","blue hour","night","neon","moonlight","moonlit","candle","candlelight","candlelit","lamp","lamplight","spotlight","spotlit","softbox","overcast","shadow","shadows","shadowless","backlit","backlight","rim light","glow","glowing","noon","midday","low key","high key","chiaroscuro","hard sun","window light"],RP=["plinth","pedestal","podium","platform","block","cube","table","tabletop","counter","countertop","shelf","ledge","tray","on the floor","on the ground","in hand","in hands","hand","hands","held","holding","resting","rests","floating","floats","suspended","hanging","leaning","propped","nestled","nested","half buried","emerging","balanced","stacked","scattered"],PP=["top down","overhead","flat lay","flatlay","birds eye","bird s eye","aerial","from above","from below","low angle","high angle","eye level","worms eye","close up","closeup","macro","wide angle","wide shot","wide","telephoto","35mm","50mm","85mm","lens","shot from","framed","framing","straight on","profile"],LP={world:[...zre,...G4],surface:G4,light:MP,signature:NP,stage:RP,camera:PP},Bre=e=>` ${e.toLowerCase().replace(/[^a-z0-9é]+/g," ").trim()} `,Ure=(e,t)=>e.includes(` ${t.replace(/[^a-z0-9é]+/g," ")} `);function $P(e){const t=Bre(e),n=r=>r.some(a=>Ure(t,a));return{world:n(LP.world),surface:n(G4),light:n(MP),signature:n(NP),stage:n(RP),camera:n(PP)}}const Wre=e=>Object.keys(LP).filter(t=>e[t]);function Kre(e){const t=["world","surface","light"].filter(r=>!e[r]),n=Wre(e).length>=3?t.filter(r=>r==="world"):t.slice(0,2);return e.signature?n:[...n,"signature"]}const mi="__passed",I0=e=>{var t;return(t=e.source)==null?void 0:t.door},Gre=e=>{var t;return I0(e)==="words"?Kre($P(((t=e.source)==null?void 0:t.text)??"")):[]},c2=[{id:"source",applies:()=>!0},{id:"photos",applies:e=>I0(e)==="photos"},{id:"shot",applies:e=>I0(e)==="shot"},{id:"reuse",applies:e=>{var t;return I0(e)==="shot"&&!!((t=e.shot)!=null&&t.scene)}},...uf.map(e=>({id:e,applies:t=>I0(t)==="guided"||Gre(t).includes(e)}))],cp=c2.map(e=>e.id),Bp=e=>uf.includes(e),h9=e=>cp.includes(e),Yre=e=>{var t;return!!e&&(!!e.pick||!!((t=e.words)!=null&&t.trim()))};function by(e,t){var n;return e==="source"?!!t.source:e==="photos"?!!((n=t.photos)!=null&&n.done)&&t.photos.hashes.length>0:e==="shot"?!!t.shot:e==="reuse"?t.reuse==="read":Yre(t[e])}const qre=e=>c2.filter(t=>t.applies(e)&&by(t.id,e)).map(t=>t.id);function TP(e){var t;return((t=c2.find(n=>n.applies(e)&&!by(n.id,e)))==null?void 0:t.id)??null}const DP=e=>{var t,n,r,a,i;return((t=e.source)==null?void 0:t.door)==="words"?!!((n=e.source.text)!=null&&n.trim()):((r=e.source)==null?void 0:r.door)==="photos"?(((a=e.photos)==null?void 0:a.hashes.length)??0)>0:((i=e.source)==null?void 0:i.door)==="shot"?!!e.shot:uf.some(l=>rl(l,e[l])!==null)},p9=e=>!!e.source&&TP(e)===null&&DP(e),Y4=(e,t)=>JSON.stringify(e)!==JSON.stringify(t);function xy(e,t){const n={...e},r=[];for(const[a,i]of Object.entries(t))Y4(e[a],i)&&(i===void 0?delete n[a]:n[a]=i,r.push(a));if(r.length){const a=Math.min(...r.map(i=>cp.indexOf(i)));for(const i of cp)cp.indexOf(i)<=a||i in t||delete n[i]}for(const a of c2)n[a.id]!==void 0&&!a.applies(n)&&delete n[a.id];return n}function Xre(e,t,n){var r,a;if(e==="source")return t.kind!=="choice"?null:t.id==="photos"?{source:{door:"photos"},photos:{hashes:((r=n.photos)==null?void 0:r.hashes)??[],done:!1}}:t.id==="guided"?{source:{door:"guided"}}:null;if(e==="reuse")return t.kind==="choice"&&t.id==="read"?{reuse:"read"}:null;if(Bp(e)){const i=(a=n[e])==null?void 0:a.words,l=t.kind==="swatches"?t.picks[e]??Object.values(t.picks)[0]:t.kind==="choice"?t.id:void 0;if(l)return{[e]:{pick:l,...i?{words:i}:{}}};if(t.kind==="skip")return{[e]:{pick:mi,...i?{words:i}:{}}}}return null}function m9(e){var t;return(e==null?void 0:e.pick)===mi?[Vre,(t=e.words)==null?void 0:t.trim()].filter(Boolean).join(", "):rl("signature",e)}function rl(e,t){var a,i;if(!t)return null;const n=t.pick&&t.pick!==mi?(a=Po(e,t.pick))==null?void 0:a.words:void 0,r=(i=t.words)==null?void 0:i.trim();return n&&r?`${n}, ${r}`:n??r??null}const g9=e=>e?`, ${Tre}`:"";function Qre(e){var l,u,f,h,p,g,m;if(((l=e.source)==null?void 0:l.door)==="words"){const w=(e.source.text??"").trim(),y=rl("world",e.world),b=rl("light",e.light)??($P(w).light?null:((f=Po("world",(u=e.world)==null?void 0:u.pick))==null?void 0:f.light)??null),k=m9(e.signature),S=[y,rl("surface",e.surface),b,k].filter(Boolean);return S.length?`${w.replace(/[.\s]+$/,"")}, ${S.join(", ")}${g9(k)}.`:w}if(((h=e.source)==null?void 0:h.door)!=="guided")return"";const t=rl("world",e.world),n=rl("light",e.light)??((g=Po("world",(p=e.world)==null?void 0:p.pick))==null?void 0:g.light)??null,r=m9(e.signature),i=`${[t??"a place",rl("surface",e.surface),n,r].filter(Boolean).join(", ").replace(/^./,w=>w.toUpperCase())}${g9(r)}.`;return(m=e.world)!=null&&m.pick?`${i.slice(0,-1)}. ${pe.worldIsAStart}`:i}function Jre(e){var t,n,r;return((t=e.source)==null?void 0:t.door)==="shot"?e.shot?[e.shot.hash]:[]:((n=e.source)==null?void 0:n.door)==="photos"&&((r=e.photos)!=null&&r.done)?e.photos.hashes:[]}const v9=e=>/^image\/hei[cf]/i.test(e.type)||/\.hei[cf]$/i.test(e.name),ese={answers:{},revision:0,editing:null,held:null,asides:[]};function HP(e,t){var n,r;switch(t.type){case"answer":{const a=xy(e.answers,t.patch);return Y4(a,e.answers)?{...e,answers:a,revision:e.revision+1,editing:null,held:null}:{...e,editing:null,held:null}}case"photos":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const a=[...new Set(t.hashes)].slice(0,4),i=e.editing==="photos";return{...e,answers:{...e.answers,photos:{hashes:a,done:i}},revision:e.revision+1}}case"photo":return HP(e,{type:"photos",hashes:[...((r=e.answers.photos)==null?void 0:r.hashes)??[],t.hash]});case"edit":return by(t.id,e.answers)?{...e,editing:t.id,held:e.answers}:e;case"cancel-edit":return!e.held||!Y4(e.held,e.answers)?{...e,editing:null,held:null}:{...e,answers:e.held,revision:e.revision+1,editing:null,held:null};case"aside":return{...e,asides:[...e.asides,t.aside].slice(-40)}}}const tse=e=>({answers:e.held??e.answers,revision:e.revision,asides:e.asides}),nse=/^[a-f0-9]{32}$/,w9=/^[\w.:-]{1,80}$/;function rse(e){const t=e;if(!t||typeof t!="object"||typeof t.answers!="object"||!t.answers)return null;const n={},r=t.answers.source;r&&["photos","shot","guided","words"].includes(r.door)&&(n.source={door:r.door,...typeof r.text=="string"?{text:r.text.slice(0,Sd)}:{}});const a=t.answers.photos;a&&Array.isArray(a.hashes)&&(n.photos={hashes:a.hashes.filter(u=>typeof u=="string").slice(0,4),done:!!a.done});const i=t.answers.shot;if(i&&typeof i.id=="string"&&w9.test(i.id)&&typeof i.hash=="string"&&nse.test(i.hash)){const u=i.scene,f=u&&typeof u.id=="string"&&w9.test(u.id)&&typeof u.name=="string"?{id:u.id,name:u.name.slice(0,120)}:void 0;n.shot={id:i.id,hash:i.hash,...f?{scene:f}:{}}}t.answers.reuse==="read"&&(n.reuse="read");for(const u of uf){const f=t.answers[u];if(!f||typeof f!="object")continue;const h=typeof f.pick=="string"&&(f.pick===mi||Po(u,f.pick))?f.pick:void 0,p=typeof f.words=="string"?f.words.slice(0,Sd):void 0;(h||p)&&(n[u]={...h?{pick:h}:{},...p?{words:p}:{}})}const l=Array.isArray(t.asides)?t.asides.filter(u=>u&&typeof u.said=="string"&&typeof u.reply=="string"&&typeof u.at=="string").map(u=>({said:u.said,reply:u.reply,at:u.at,q:typeof u.q=="string"?u.q:null})):[];return{answers:xy({},n),revision:Number(t.revision)||0,editing:null,held:null,asides:l}}const Up=4,OP=AP,ky=60,IP={place:"",pictures:[],heldPictures:[],inputsRev:0,readRev:null,readTried:null,versions:[],current:-1,name:"",named:!1,job:null,error:null,saved:null,moreDeclined:!1,moreAsked:!1,setDrawn:!1,setDeclined:!1};function sse(e){return{...IP,place:e.place,pictures:e.pictures.slice(0,Up),heldPictures:e.pictures.slice(Up),readRev:0,versions:[{reading:e.reading,hash:e.hash,...e.anchor?{anchor:!0}:{},...e.hash&&e.hero?{hero:e.hero,...e.heroWith?{heroWith:e.heroWith}:{}}:{},coverage:[],how:"read"}],current:0,name:e.name,named:!0}}const $r=e=>e.versions[e.current]??null,y9=e=>e.versions.some(t=>!!t.hash);function ase(e,t){return!t||e.job||e.inputsRev===0||e.readRev!==null&&e.readRev===e.inputsRev||e.readTried===e.inputsRev?null:e.inputsRev}const FP=e=>e.readRev!==null&&e.readRev!==e.inputsRev;function ose(e,t){var n,r,a;switch(t.type){case"inputs":{const i=t.place.slice(0,OP),l=[...new Set(t.pictures)].slice(0,Up);return i===e.place&&l.join()===e.pictures.join()?e:{...e,place:i,pictures:l,inputsRev:e.inputsRev+1}}case"name":return{...e,name:t.text.slice(0,ky),named:!0};case"started":return e.job?e:{...e,job:{id:t.id,kind:t.kind,ask:t.ask,inputsRev:e.inputsRev,pending:null,coverage:[],phase:t.kind==="again"?"drawing":t.kind==="change"?"changing":"reading",since:t.since},readTried:t.kind==="make"?e.inputsRev:e.readTried,error:null};case"stopping":return!e.job||e.job.id!==t.id||e.job.stopping?e:{...e,job:{...e.job,stopping:!0}};case"stop-failed":{if(!e.job||e.job.id!==t.id||!e.job.stopping)return e;const{stopping:i,...l}=e.job;return{...e,job:l}}case"progress":{if(!e.job||e.job.id!==t.job.id)return e;const i={...e.job,pending:t.job.reading??e.job.pending,coverage:t.job.coverage??e.job.coverage,phase:t.job.phase,since:t.job.phaseAt??e.job.since};return i.phase===e.job.phase&&i.since===e.job.since&&i.coverage.join(`
|
|
104
|
+
`)===e.job.coverage.join(`
|
|
105
|
+
`)&&JSON.stringify(i.pending)===JSON.stringify(e.job.pending)?e:b9({...e,job:i},i.pending)}case"finished":{if(!e.job||e.job.id!==t.job.id)return e;const i=e.job,l=t.job,u={...e,job:null};if(i.kind==="make"&&i.inputsRev!==e.inputsRev)return u;const f=l.reading??(i.kind==="again"?((n=$r(e))==null?void 0:n.reading)??null:null),h=l.status==="failed"?l.error??pe.failed:null;if(l.status==="cancelled"){if(!f)return{...u,error:i.kind==="make"?pe.stoppedRead:pe.stopped};if(i.kind==="again"&&!l.hash)return{...u,error:pe.stoppedDraw}}const p=l.status==="cancelled"&&i.kind==="change"&&!l.hash;if(!f||i.kind==="again"&&!l.hash)return{...u,error:h};const g=i.kind==="make"?"read":i.kind==="change"?"change":e.versions.some(S=>S.hash)?"again":"draw",m={reading:f,hash:l.hash,...l.hash&&l.anchor?{anchor:!0}:{},...l.hash&&l.hero?{hero:l.hero,...l.heroWith?{heroWith:l.heroWith}:{}}:{},ask:i.kind==="change"?i.ask:void 0,coverage:(r=l.coverage)!=null&&r.length?l.coverage:i.kind==="again"?((a=$r(e))==null?void 0:a.coverage)??[]:[],how:g},w=$r(e),y=i.kind==="make"&&!l.hash&&w&&!w.hash&&w.how==="read",b=y?e.versions.map((S,E)=>E===e.current?m:S):[...e.versions,m],k={...u,versions:b,current:y?e.current:b.length-1,readRev:i.kind==="make"?i.inputsRev:e.readRev,error:p?pe.stoppedChange:h};return b9(k,f)}case"lost":return!e.job||e.job.id!==t.id?e:{...e,job:null,error:t.error};case"put-back":return e.job||!e.versions[t.index]?e:{...e,current:t.index};case"forget-record":return e.job||!e.versions.length?e:{...e,versions:[],current:-1,error:null};case"edit-words":{const i=$r(e);if(e.job||!i||!t.reading.prompt.trim()||JSON.stringify(t.reading)===JSON.stringify(i.reading))return e;const l=[...e.versions,{reading:t.reading,hash:i.hash,...i.anchor?{anchor:!0}:{},...i.hero?{hero:i.hero,...i.heroWith?{heroWith:i.heroWith}:{}}:{},coverage:i.coverage,how:"edit"}];return{...e,versions:l,current:l.length-1}}case"error":return{...e,error:t.text};case"saved":return{...e,saved:t.id,error:null};case"decline-more":return{...e,moreDeclined:!0};case"ask-more":return{...e,moreAsked:!0};case"set-drawn":return{...e,setDrawn:!0,setDeclined:!1};case"set-declined":return{...e,setDeclined:!0};case"set-failed":return t.more?{...e,moreAsked:!1}:{...e,setDrawn:!1}}}function b9(e,t){return e.named||!(t!=null&&t.name)?e:{...e,name:t.name.slice(0,ky)}}function ise(e){var n;const t=e.job?e.job.phase==="drawing"?e.job.pending:null:((n=$r(e))==null?void 0:n.reading)??null;return t?!e.job&&FP(e)?{can:!1,why:pe.stillReading,words:t}:e.name.trim()?{can:!0,why:null,words:t}:{can:!1,why:pe.nameIt,words:t}:{can:!1,why:e.job?pe.stillReading:null,words:null}}const e6=e=>e.job?e.job.phase==="changing"?pe.changing:e.job.phase==="drawing"?pe.drawing:e.pictures.length?pe.readingPhotos:pe.reading:void 0;function lse(e){var r;const t=new Map;e.versions.forEach((a,i)=>{a.hash&&t.set(a.hash,i)});const n=((r=$r(e))==null?void 0:r.hash)??null;return[...t.entries()].sort((a,i)=>a[1]-i[1]).map(([a],i)=>({n:i+1,hash:a,current:a===n}))}const _P=e=>(e==null?void 0:e.hero)??(e==null?void 0:e.hash)??null,cse=(e,t)=>e.versions.slice(0,t+1).filter(n=>!!n.hash).length,use=(e,t)=>e.versions.map(n=>n.hash).lastIndexOf(t);function dse(e){const t=[{label:pe.placeLabel,text:e.prompt}];return e.lighting&&t.push({label:pe.lightLabel,text:e.lighting}),e.camera&&t.push({label:pe.cameraLabel,text:e.camera}),e.figure&&t.push({label:pe.figureLabel,text:e.figureTreatment?`${x9(e.figure)}, ${x9(e.figureTreatment)}.`:e.figure}),t}const x9=e=>e.replace(/[.\s]+$/,""),fse=/\b(presenters?|models?|influencers?|celebrit(y|ies)|actors?|actress(es)?)\b/i,hse=/\b(my|our|the|a|an)\s+(\w+\s+)?(products?|bottles?|serum|perfume|shoes?|bag|jar|packaging|package|logos?|brand|brand name|wordmark)\b/i,pse=/\b(add|put|place|include|show|feature|with|holding|wearing|sitting|standing)\b/i,mse=/\b(no|without|remove|removing|empty|nobody|none|take out|get rid of|less)\b/i,gse=/^\s*(undo|go back|revert|back to|previous|the (first|last|previous|old|earlier) (one|version))\b/i,vse=/^\s*(hi|hello|hey|thanks|thank you|ok|okay|cool|nice|great|good|wow|yes|no)\b[\s!.]*$/i,wse=/^(?:please\s+)?(?:(?:call|name)\s+(?:it|this|the\s+scene)|rename(?:\s+(?:it|this|the\s+scene))?)\s+(?:to\s+|as\s+)?["'\u201c\u2018]?(.+?)["'\u201d\u2019]?[.!]?$/i,VP=e=>{var t,n;return((n=(t=wse.exec(e.trim()))==null?void 0:t[1])==null?void 0:n.trim())||null};function yse(e){const t=e.trim(),n=VP(t);return n?{kind:"rename",name:n}:gse.test(t)?{kind:"navigate",say:pe.usePutBack}:vse.test(t)||/\?\s*$/.test(t)&&!/\b(make|can you|could you|try)\b/i.test(t)?{kind:"chatter",say:pe.sayAChange}:(fse.test(t)||hse.test(t))&&pse.test(t)&&!mse.test(t)?{kind:"refuse",say:pe.notInAScene}:{kind:"change"}}const bse=(e,t)=>{var n;return!!((n=$r(e))!=null&&n.ask)&&$r(e).ask.trim().toLowerCase()===t.trim().toLowerCase()},ZP=e=>!e.saved&&(e.versions.length>0||!!e.job||!!e.error),k9=(e,t)=>e.saved?!1:t?e.versions.length>t.versions.length||e.current!==t.current||e.place!==t.place||e.pictures.join()!==t.pictures.join()||e.name!==t.name||!!e.job:!!(e.place.trim()||e.pictures.length||e.versions.length||e.job);function xse(e,t){const n={};for(const[r,a]of Object.entries(e))JSON.stringify(a)!==JSON.stringify(t[r])&&(n[r]=a);return"previewHash"in n&&(n.anchor=e.anchor),"heroHash"in n&&e.heroWith&&(n.heroWith=e.heroWith),n}const zP=1;function kse(e){return JSON.stringify({v:zP,...e})}function Sse(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||t.v!==zP)return null;const n=u=>Array.isArray(u)?u.filter(f=>typeof f=="string"):[],r=u=>!!u&&typeof u.prompt=="string"&&typeof u.name=="string",a=Array.isArray(t.versions)?t.versions.filter(u=>u&&r(u.reading)).map(u=>({reading:u.reading,hash:typeof u.hash=="string"?u.hash:null,...u.anchor===!0&&typeof u.hash=="string"?{anchor:!0}:{},...typeof u.hero=="string"&&typeof u.hash=="string"?{hero:u.hero,...u.heroWith&&typeof u.heroWith=="object"?{heroWith:u.heroWith}:{}}:{},ask:typeof u.ask=="string"?u.ask:void 0,coverage:n(u.coverage),how:["read","draw","again","change","edit"].includes(u.how)?u.how:u.hash?"draw":"read"})):[],i=t.job&&typeof t.job.id=="string"&&["make","again","change"].includes(t.job.kind)?{id:t.job.id,kind:t.job.kind,ask:typeof t.job.ask=="string"?t.job.ask:void 0,inputsRev:Number(t.job.inputsRev)||0,pending:r(t.job.pending)?t.job.pending:null,coverage:n(t.job.coverage),phase:["reading","changing","drawing"].includes(t.job.phase)?t.job.phase:null,since:typeof t.job.since=="string"?t.job.since:null,...t.job.stopping===!0?{stopping:!0}:{}}:null,l=Number.isInteger(t.current)&&t.current>=-1&&t.current<a.length?t.current:a.length-1;return{place:typeof t.place=="string"?t.place.slice(0,OP):"",pictures:n(t.pictures).slice(0,Up),heldPictures:n(t.heldPictures).slice(0,4),inputsRev:Number(t.inputsRev)||0,readRev:t.readRev===null||t.readRev===void 0?null:Number(t.readRev),readTried:t.readTried===null||t.readTried===void 0?null:Number(t.readTried),versions:a,current:l,name:typeof t.name=="string"?t.name.slice(0,ky):"",named:!!t.named,job:i,error:typeof t.error=="string"?t.error:null,saved:typeof t.saved=="string"&&t.saved?t.saved:null,moreDeclined:t.moreDeclined===!0,moreAsked:t.moreAsked===!0,setDrawn:t.setDrawn===!0,setDeclined:t.setDeclined===!0}}function Ese(e){if(!e||e.loading)return"";const t=e.items.length;return t?pe.shotCount(t,e.more):e.error?pe.shotsFailed:e.query.trim()?pe.shotNotFound(e.query.trim()):pe.shotNone}function S9(e){var n;const t=(n=e==null?void 0:e.tokens)==null?void 0:n.find(r=>(r==null?void 0:r.t)==="template");return typeof(t==null?void 0:t.id)=="string"&&t.id?t.id:typeof(e==null?void 0:e.templateId)=="string"&&e.templateId?e.templateId:null}function Cse(e){return dse(e).map(t=>t.label===pe.placeLabel?t.text:`${t.label}: ${t.text.replace(/[.\s]+$/,"")}.`).join(" ")}const u2=new Set([pe.stopped,pe.stoppedRead,pe.stoppedDraw,pe.stoppedChange,pe.lost,pe.failed,pe.busyElsewhere]),jse=e=>u2.has(e)?e:f1(e)??pe.failedKept(e.replace(/[.\s]+$/,"")),Ase=new Set([pe.stopped,pe.stoppedRead,pe.stoppedDraw,pe.stoppedChange]),t6=e=>Ase.has(e)?{}:{tone:"alert"},E9=e=>{if(u2.has(e))return e;const t=f1(e);return t?pe.failedSaid(t):pe.failedFirst(e.replace(/[.\s]+$/,""))},BP=e=>e&&!u2.has(e)?co(e).remedy:void 0,q4=e=>{const t=BP(e);return t?[{id:`remedy:${t.opens}`,label:t.label}]:[]};function C9(e){const t=!BP(e)&&!u2.has(e)&&!co(e).retryable;return[...q4(e),...t?[{id:"reword",label:pe.sayDifferently}]:[],{id:"retry",label:pe.retry}]}function j9(e,t,n,r,a){var y,b,k,S,E,C,A,L,T,M,j,P,R,H;const i=t.answers,l=n?{reopened:!0}:{};if(e==="source")return{id:e,kind:"choice",prompt:pe.source,options:[{id:"photos",label:pe.addPictures},{id:"guided",label:pe.guideMe}],given:((y=i.source)==null?void 0:y.door)==="words"?void 0:((b=i.source)==null?void 0:b.door)==="shot"?"photos":(k=i.source)==null?void 0:k.door,note:((S=i.source)==null?void 0:S.door)==="words"?i.source.text:void 0,...l};if(e==="photos")return{id:e,kind:"photos",prompt:pe.photos,hashes:((E=i.photos)==null?void 0:E.hashes)??[],max:4,busy:r>0,submit:pe.readThem,back:pe.guideInstead,drop:pe.photosDrop,...l,...a&&a.any!==!1&&!((C=i.photos)!=null&&C.hashes.length)&&r===0&&!n?{instead:pe.fromShot,...a.any===null?{insteadWaiting:!0}:{}}:{}};if(e==="shot"){const D=(a==null?void 0:a.query.trim())??"";return{id:e,kind:"pick",prompt:pe.shot,items:(a==null?void 0:a.items)??[],given:(A=i.shot)==null?void 0:A.id,search:{label:pe.shotSearch,value:(a==null?void 0:a.query)??""},more:(a==null?void 0:a.more)??!1,loading:(a==null?void 0:a.loading)??!1,empty:a!=null&&a.error?pe.shotsFailed:D?pe.shotNotFound(D):pe.shotNone,status:Ese(a),back:n?void 0:pe.backToPictures,...l}}if(e==="reuse"){const D=((T=(L=i.shot)==null?void 0:L.scene)==null?void 0:T.name)??"";return{id:e,kind:"choice",prompt:pe.madeIn(D),options:[{id:"use",label:pe.takeScene(D)},{id:"read",label:pe.readNew}],given:i.reuse,...l}}const u=i[e],f=e==="light"?(j=Po("world",(M=i.world)==null?void 0:M.pick))==null?void 0:j.light:void 0,h=e==="surface"&&!!Po("world",(P=i.world)==null?void 0:P.pick),p=(u==null?void 0:u.pick)===mi||u==null?void 0:u.pick,g=(u==null?void 0:u.pick)===mi,m=u==null?void 0:u.words,w=((R=i.source)==null?void 0:R.door)==="words";return{id:e,kind:"swatches",prompt:UP(e,i),row:Fre(e,(H=i.world)==null?void 0:H.pick),layout:e==="world"?"grid":void 0,hint:e==="world"&&!w?pe.worldHint:void 0,skip:f?pe.keepWorldLight:h?pe.keepWorldSurface:e==="signature"&&!w?pe.suggestOne:w?pe.leaveToReading:pe.skip,describe:pe.describeInstead,given:p,skipped:g,note:m,...l}}function UP(e,t){var r,a,i;const n=e==="light"?(a=Po("world",(r=t.world)==null?void 0:r.pick))==null?void 0:a.light:void 0;if(n)return pe.worldLightPrompt(n);if(((i=t.source)==null?void 0:i.door)==="words"){if(e==="world")return pe.followWorld;if(e==="light")return pe.followLight}return El[e].prompt}function Nse(e,t){var n,r;return e==="source"?pe.source:e==="photos"?pe.photos:e==="shot"?pe.shot:e==="reuse"?pe.madeIn(((r=(n=t.shot)==null?void 0:n.scene)==null?void 0:r.name)??""):UP(e,t)}function A9(e,t){var f,h,p,g,m,w,y,b,k,S,E;if(e==="source")return((f=t.source)==null?void 0:f.door)==="words"?{text:t.source.text??""}:((h=t.source)==null?void 0:h.door)==="shot"?{text:pe.fromShotAnswer}:{text:((p=t.source)==null?void 0:p.door)==="photos"?pe.addPictures:pe.guideMe};if(e==="shot")return{text:pe.shotAnswer,photos:t.shot?[t.shot.hash]:[]};if(e==="reuse")return{text:pe.readNew};if(e==="photos"){const C=((g=t.photos)==null?void 0:g.hashes.length)??0;return{text:`${C} ${C===1?"picture":"pictures"}`,photos:(m=t.photos)==null?void 0:m.hashes}}const n=t[e],r=e==="light"&&(n==null?void 0:n.pick)===mi&&((y=Po("world",(w=t.world)==null?void 0:w.pick))==null?void 0:y.light),a=e==="surface"&&(n==null?void 0:n.pick)===mi&&!!Po("world",(b=t.world)==null?void 0:b.pick),i=r?pe.keepWorldLight:a?pe.keepWorldSurface:((k=t.source)==null?void 0:k.door)==="words"?pe.leaveToReading:e==="signature"?pe.suggestOne:pe.skip,l=(n==null?void 0:n.pick)===mi?i:(S=Po(e,n==null?void 0:n.pick))==null?void 0:S.label,u=(E=n==null?void 0:n.words)==null?void 0:E.trim();return{text:l&&u?`${l}, ${u}`:u??l??""}}const N9=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,Mse=e=>{const t=$r(e);return t?`${t.hash?"decide":"agree"}-${e.current}`:null};function Rse(e){var w,y,b,k,S,E;const{setup:t,studio:n,edit:r}=e,a=t.answers,i=[],l=new Set,u=C=>{for(const A of t.asides.filter(L=>L.q===C&&!l.has(L)).sort(N9))l.add(A),i.push(...Ei(A))};r?i.push({kind:"scenri",id:"edit-open",text:pe.editOpen(r.name)}):i.push({kind:"you",id:"intent",text:pe.intent});const f=r?null:TP(a);if(!r)for(const C of qre(a)){if(i.push({kind:"scenri",id:`asked-${C}`,text:Nse(C,a),quiet:!0}),u(C),t.editing===C){i.push({kind:"question",question:j9(C,t,!0,e.uploading,e.shots)});continue}const A=A9(C,a);i.push({kind:"you",id:C,text:A.text,photos:A.photos,editable:!n.job&&!n.saved})}const h=n.versions.findIndex(C=>!!C.hash);n.versions.forEach((C,A)=>{if(C.how==="read"&&A>0&&i.push({kind:"scenri",id:`reread-${A}`,text:pe.readAgain}),C.how==="change"&&i.push({kind:"you",id:`ask-${A}`,text:C.ask??""}),C.hash&&(C.how==="draw"&&i.push({kind:"you",id:`draw-${A}`,text:pe.draw}),C.how==="again"&&i.push({kind:"you",id:`again-${A}`,text:pe.tryAgain}),A===h&&!r&&M9(i,e),i.push({kind:"scenri",id:`pic-${A}`,text:C.how==="change"?pe.changed:C.how==="again"?pe.again:pe.here,thumb:_P(C)??C.hash,label:pe.version(cse(n,A)),view:"scene",current:A===n.current,restore:A===n.current||n.saved?void 0:{view:"scene",hash:C.hash}})),A===n.current)for(const[L,T]of C.coverage.entries())i.push({kind:"scenri",id:`cover-${A}-${L}`,text:T});u(`agree-${A}`),u(`decide-${A}`)});const p=n.job;(p==null?void 0:p.kind)==="again"&&i.push({kind:"you",id:`pending-${p.id}`,text:h<0?pe.draw:pe.tryAgain}),(p==null?void 0:p.kind)==="change"&&i.push({kind:"you",id:`pending-${p.id}`,text:p.ask??""}),(p==null?void 0:p.kind)==="again"&&h<0&&!r&&M9(i,e),n.saved&&Pse(i,e);let g=null;const m=!r&&!p&&!n.versions.length&&e.canRead===!1&&((w=a.source)==null?void 0:w.door)===e.noReader?e.noReader:null;if(m==="photos"&&((y=a.photos)!=null&&y.hashes.length)&&i.push({kind:"you",id:"photos",...A9("photos",a)}),m)g={id:"noreader",kind:"confirm",quiet:!0,prompt:pe.noReader,options:[{id:"remedy:setup",label:"Set up"},{id:"unstop",label:m==="photos"?pe.changePictures:pe.anotherShot}]};else if(f)g=j9(f,t,!1,e.uploading,e.shots);else if(p){if(p.kind==="again"&&h<0&&!n.named&&!e.editingName){const C=((k=p.pending??((b=$r(n))==null?void 0:b.reading))==null?void 0:k.name)??n.name;g={id:"name",kind:"text",prompt:pe.name,starters:C?[{label:C,text:C}]:void 0}}}else if(n.saved)g=Lse(e);else{const C=$r(n);if(e.stale&&!r)n.error&&(g={id:"retry",kind:"confirm",...t6(n.error),prompt:E9(n.error),options:C9(n.error)});else if(!C&&n.error)g={id:"retry",kind:"confirm",...t6(n.error),prompt:E9(n.error),options:C9(n.error)};else if(C){n.error&&i.push({kind:"scenri",id:`error-${n.versions.length}`,text:jse(n.error),...t6(n.error)});const A=Cse(C.reading);if(C.hash){const L=!!r&&!r.changed;g={id:`decide-${n.current}`,kind:"confirm",prompt:L?pe.decideSaved:(r?pe.decideEdit:pe.decide)(n.name.trim()||C.reading.name),quote:A,quoteLabel:pe.readingHead,...C.how==="draw"||C.how==="again"?{quoteFolded:!0}:{},options:[...q4(n.error),...L?[]:[{id:"use",label:r?pe.saveChanges:pe.use}],...e.canDraw?[{id:"again",label:pe.tryAgain}]:[]],...L?{quiet:!0}:{},describe:pe.changeSomething}}else{const L=!r&&((S=a.source)==null?void 0:S.door)==="photos",T=!r&&((E=a.source)==null?void 0:E.door)==="shot",M=T?[{id:"another-shot",label:pe.anotherShot}]:[],j=C.how==="change"?pe.agreeChanged:L?pe.agreePhotos:T?pe.agreeShot:pe.agree;g={id:`agree-${n.current}`,kind:"confirm",prompt:e.canDraw?C.reading.hero==="place"?j:`${j} ${pe.drawsTwo}`:pe.agreeBlind,quote:A,quoteLabel:pe.readingHead,options:[...q4(n.error),...e.canDraw?[{id:"draw",label:pe.draw}]:[{id:"use",label:r?pe.saveChanges:pe.saveWords}],...M]}}}}for(const C of t.asides.filter(A=>!l.has(A)).sort(N9))i.push(...Ei(C));return e.note&&i.push({kind:"scenri",id:`note-${e.note.length}-${e.note.slice(0,12)}`,text:e.note}),g&&i.push({kind:"question",question:g}),i}function Pse(e,t){const{studio:n,edit:r,set:a,canDraw:i}=t;if(e.push({kind:"you",id:"use",text:r?pe.saveChanges:i?pe.use:pe.saveWords}),!a)return;const l=WP(t),u=a.tiles.filter(m=>!(m.role==="hero"&&m.hash===l)),f=u.length>0||a.running;e.push({kind:"scenri",id:"saved",text:f?pe.inUse(a.who):a.read&&a.noSubject&&i?pe.noLibrary:a.read&&i&&a.first.length?pe.savedQuiet:pe.saved}),(n.setDrawn||n.setDeclined)&&e.push({kind:"you",id:"set-start",text:n.setDrawn?a.stale?pe.drawThemAgain:l?pe.drawIt:pe.drawThem:pe.notNow});const h=n.moreAsked?pe.addThem:n.moreDeclined?pe.notNow:null;let p=!1;const g=()=>{!h||p||(p=!0,e.push({kind:"you",id:"more",text:h}))};for(const m of u)if(m.role!=="hero"&&m.role!=="close"&&g(),m.state==="shown"&&m.hash)e.push({kind:"scenri",id:`ex-${m.role}-${m.hash}`,text:pe.exampleHere[m.role],thumb:m.hash,label:Qa[m.role],view:m.role,...a.running||n.job?{}:{retry:m.role}});else if(m.state==="failed"){const w=m.error?f1(m.error):null;e.push({kind:"scenri",id:`ex-failed-${m.role}`,text:w?pe.exampleFailedSaid(Qa[m.role],w):pe.exampleFailed(Qa[m.role],m.error??pe.failed),tone:"alert"})}g()}function Lse(e){var u;const{set:t,studio:n}=e,r=n.name.trim()||((u=$r(n))==null?void 0:u.reading.name)||"The place";if(!t||t.running||!t.read)return null;const a=WP(e);if(e.canDraw&&t.first.length&&!n.setDrawn&&!n.setDeclined){const f=t.first.map(h=>Qa[h]);return{id:"set-start",kind:"confirm",prompt:t.stale?pe.staleSet(t.first.length):a?pe.moreViews(f):pe.showInUse(t.who,f),options:[{id:"draw-set",label:t.stale?pe.drawThemAgain:t.first.length===1?pe.drawIt:pe.drawThem},{id:"not-now",label:pe.notNow}]}}const i=t.tiles.some(f=>f.role==="hero"&&f.state==="shown");if(e.canDraw&&i&&t.missing.length&&!n.setDeclined&&!n.moreDeclined&&!n.moreAsked)return{id:"set-more",kind:"confirm",prompt:pe.more(t.missing.map(f=>Qa[f])),options:[{id:"more",label:pe.addThem},{id:"not-now",label:pe.notNow}]};const l=t.tiles.filter(f=>f.state==="failed");return{id:"set-done",kind:"confirm",prompt:l.length?pe.readyMissing(r):t.tiles.length?pe.ready(r):pe.readyUndrawn(r),options:[...l.length&&e.canDraw?[{id:"retry-failed",label:pe.tryAgain}]:[],{id:"done",label:t.finish}]}}function WP(e){var n,r;const t=((n=$r(e.studio))==null?void 0:n.hero)??null;return t&&((r=e.set)!=null&&r.tiles.some(a=>a.role==="hero"&&a.state==="shown"&&a.hash===t))?t:null}function M9(e,t){if(!t.studio.named&&!t.editingName)return;e.push({kind:"scenri",id:"asked-name",text:pe.name,quiet:!0});const n=!t.studio.saved;e.push({kind:"you",id:"name",text:t.studio.name,editable:n,editing:t.editingName||void 0})}function $se(e,t){var l,u,f;const{setup:n,studio:r}=e,a=(h,p=!1)=>({target:{kind:"off",why:h},placeholder:"",label:pe.lineLabel,action:pe.send,working:p,attach:!1});if(r.saved){const h=!!r.job||!!((l=e.set)!=null&&l.running);return a(t&&!h?pe.usedOff:"",h)}const i=n.editing;return i==="source"?Xo({kind:"source"},pe.sourcePlaceholder,!0):i&&Bp(i)?Xo({kind:"row",id:i},pe.rowPlaceholder(f9(i))):i==="photos"?a(pe.photosOff):i==="shot"?a(pe.shotOff):i==="reuse"?a(pe.reuseOff):!t&&!r.job&&n.answers.source&&!DP(n.answers)?Xo({kind:"source"},pe.nothingSaidPlaceholder,!0):t?t.id==="source"?Xo({kind:"source"},pe.sourcePlaceholder,!0):t.id==="photos"?{...a(pe.photosOff),attach:!0}:t.id==="shot"?a(pe.shotOff):t.id==="reuse"?a(pe.reuseOff):t.id==="noreader"?a(pe.noReaderOff):Bp(t.id)?Xo({kind:"row",id:t.id},pe.rowPlaceholder(f9(t.id))):t.id==="name"?Xo({kind:"name"},pe.namePlaceholder):t.id==="retry"?Xo({kind:"source"},pe.nothingSaidPlaceholder,!0):t.id.startsWith("agree-")?e.canDraw?Xo({kind:"add"},e.edit?pe.addPlaceholder:((u=n.answers.source)==null?void 0:u.door)==="photos"?pe.keepPlaceholder:((f=n.answers.source)==null?void 0:f.door)==="shot"?pe.keepShotPlaceholder:pe.addPlaceholder):a(""):t.id.startsWith("decide-")?{...Xo({kind:"change"},pe.changePlaceholder),action:pe.change}:a(""):r.job?a("",!0):a("")}function Xo(e,t,n=!1){return{target:e,placeholder:t,label:t,action:pe.send,working:!1,attach:n}}const Tse=/\b(studio|room|lobby|hall|beach|forest|desert|street|city|kitchen|bathroom|bedroom|office|garden|park|field|mountain|shore|sea|ocean|lake|river|cave|rooftop|roof|terrace|warehouse|loft|gallery|museum|church|hotel|restaurant|caf[eé]|bar|shop|store|market|set|stage|backdrop|wall|floor|marble|concrete|wood|stone|light|dusk|dawn|night|sun|neon|fog|rain|snow|sand|water|glass|metal|plaster|fabric|interior|outdoors?|indoors?|landscape|pool|library|station|tunnel|bridge|corridor|courtyard|balcony|window|sky|cyclorama|cyc|seamless|brutalist|minimal)\b/i,KP=e=>Tse.test(e)||e.trim().split(/\s+/).length>=5&&!/\?\s*$/.test(e);function R9(e,t){switch(e){case"greeting":case"ack":return t==="source"?pe.greet:pe.greetRow;case"question":case"help":return pe.askHelp;case"nav":return pe.startOverIsUp;case"go":return t==="source"?pe.goFirst:pe.greetRow;default:return pe.notAPlace}}function P9(e,t){if(t==="source"){const r=ai(e,KP);return r==="vague"?null:r}const n=ai(e,()=>!1);return n==="vague"||n==="intent"||n==="likeness"?null:n}const GP=2;function Dse(e,t){return JSON.stringify({v:GP,setup:tse(e),studio:kse(t)})}function YP(e){if(!e)return null;try{const t=JSON.parse(e);return(t==null?void 0:t.v)!==GP?null:{setup:rse(t.setup),studio:Sse(typeof t.studio=="string"?t.studio:null)}}catch{return null}}const Sy=e=>`scenri:scene-studio:${e}:`;function Hse(e,t){var f,h,p;if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(n!=null&&n.sceneId)return null;const r=YP(typeof(n==null?void 0:n.session)=="string"?n.session:null),a=r==null?void 0:r.studio;if(!a||!ZP(a))return null;const i=[a.versions[a.current],...[...a.versions].reverse()].find(g=>g==null?void 0:g.hash),l=$r(a),u=a.place.trim().split(/\s+/).slice(0,5).join(" ");return{convo:e,name:a.name.trim()||(l==null?void 0:l.reading.name)||((h=(f=a.job)==null?void 0:f.pending)==null?void 0:h.name)||u,hash:(i==null?void 0:i.hash)??null,drawing:!!a.job,failed:!a.job&&!!a.error,read:a.versions.length>0,jobId:((p=a.job)==null?void 0:p.id)??null,at:Number(n.at)||0}}function Ose(e,t,n=Ise()){const r=new Map(t.filter(l=>l.kind==="scene").map(l=>[l.id.slice(6),l])),a=e.map(l=>{const u=l.jobId?r.get(l.jobId):void 0;return u?l.drawing?{...l,name:l.name||u.name,hash:u.status==="done"&&u.thumb?u.thumb:l.hash,drawing:u.status==="running",failed:u.status==="failed"}:l:{...l,drawing:!1}}),i=new Set([...e.map(l=>l.convo),...n]);for(const l of t)l.kind!=="scene"||l.status!=="running"||!l.conversation||l.sceneId||i.has(l.conversation)||(i.add(l.conversation),a.push({convo:l.conversation,name:l.name,hash:null,drawing:!0,failed:!1,read:!1,jobId:l.id.slice(6),at:Date.parse(l.startedAt)||0}));return a.filter(l=>l.drawing||l.hash||l.failed||l.read).sort((l,u)=>u.at-l.at)}function Ise(){var t;const e=[];for(const n of Cr.keys("scenri:scene-studio:"))try{(t=JSON.parse(Cr.get(n)??"null"))!=null&&t.sceneId&&e.push(n.slice(n.lastIndexOf(":")+1))}catch{}return e}function Fse(e){return e.drawing?"Drawing":e.hash?"Drawn, not used yet":e.failed?"Did not finish":"Not drawn yet"}function up(e){const t=Sy(e);return Cr.keys(t).map(n=>Hse(n.slice(t.length),Cr.get(n))).filter(n=>!!n)}function _se(e,t){Cr.set(e,JSON.stringify({at:Date.now(),sceneId:t,done:!0}))}function Vse(e,t){try{const n=JSON.parse(Cr.get(`${Sy(e)}${t}`)??"null");return(n==null?void 0:n.done)===!0&&typeof n.sceneId=="string"?n.sceneId:null}catch{return null}}function Zse(e,t){const n=`${Sy(e)}${t}`;Cr.del(n),fl(n)}function zse(e,t,n,r){const a=UY(e,n)||e==="presenter"&&!!r;switch(e){case"first-shot":case"reuse":return t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"refine":return t.onShot||t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"presenter":return r||n.some(i=>i==="start"||i==="face"||i==="save")?t.onStudio?{kind:"stay"}:{kind:"studio"}:t.onStudio||t.onPresenters?{kind:"stay"}:a?{kind:"presenters"}:{kind:"head"};case"product":return a&&n.includes("product")?{kind:"dialog",asset:"product"}:t.onProducts?{kind:"stay"}:a?{kind:"products"}:{kind:"head"};case"scene":return a&&n.some(i=>i==="start"||i==="words"||i==="use")?t.onSceneStudio?{kind:"stay"}:{kind:"sceneStudio"}:t.onSceneStudio||t.onScenes?{kind:"stay"}:a?{kind:"scenes"}:{kind:"head"}}}function qP(){const{brand:e,recent:t,products:n}=cn(),r=Un(),a=Zl(),i=!!mn(pt.hub),l=!!mn(pt.hubShot),u=!!mn(pt.products),f=!!mn(pt.scenes),h=!!mn(pt.presenters),p=!!mn(pt.presenterStudio),g=!!mn(pt.sceneStudio);return s.useCallback(async m=>{var C,A;const w=t.find(L=>L.kind!=="root"&&L.status==="done"&&L.images.length>0),y=m==="refine"&&!w?"first-shot":m==="reuse"&&n.length===0?"product":m,b=sp().active;(b==null?void 0:b.task)===y&&b.brandId===e.id&&!b.paused||await fc({start:{task:y,brandId:e.id}});const k=((A=(C=sp().progress)==null?void 0:C[y])==null?void 0:A.reached)??[],S=sp().activeDraftId,E=zse(y,{onHub:i,onShot:l,onProducts:u,onScenes:f,onPresenters:h,onStudio:p,onSceneStudio:g},k,S);switch(E.kind!=="head"&&v4(),E.kind){case"stay":try{window.localStorage.removeItem(g4(e.id,y)),(y==="first-shot"||y==="reuse")&&window.localStorage.removeItem(qN(e.id))}catch{}return(y==="first-shot"||y==="reuse")&&i?r(Sr(e)):void 0;case"head":return XN(e.id,y);case"hub":return r(Sr(e));case"products":return r(td(e));case"scenes":return r(ml(e));case"presenters":return r(ui(e));case"studio":return r(vl(e,S));case"sceneStudio":{const L=up(e.id).sort((T,M)=>M.at-T.at)[0];return r(gl(e,(L==null?void 0:L.convo)??null))}case"dialog":return a(E.asset)}},[e,t,n,r,a,i,l,u,f,h,p,g])}const Bse=Number(window.localStorage.getItem("scenri:welcome-settle-ms")??900),Use='[role="dialog"]:not(.sc-coach):not(.sc-attachpanel):not(.sc-swap), [role="alertdialog"], .sc-lightbox',Wse='[data-guide="compose"] .sc-attachpanel';function Kse(){var _e,xt,yt,kt,ot,ht,Ae;const e=Tw(),t=oP(),n=Mn(),{brand:r,recent:a,subscribeActivity:i,products:l,importing:u}=cn(),{tasks:f,builds:h}=ia(),{push:p}=rr(),g=qP(),m=Un(),[w]=Al(),y=jr("new"),b=!!mn(pt.brand),k=!!mn(pt.hub),S=((_e=mn(pt.hubShot))==null?void 0:_e.params.shotId)??null,E=!!mn(pt.presenterStudio),C=!!mn(pt.sceneStudio),A=!!mn(pt.products),L=!!mn(pt.scenes),T=!!mn(pt.presenters),M=e.active,j=M&&M.brandId===r.id?M.task:null,P=j&&!(M!=null&&M.paused)?j:null,R=P==="first-shot"||P==="reuse"?"generation":P==="refine"?"edit":null,H=e.loaded&&e.eligible&&e.welcome===null,[D,U]=s.useState(e.activeNodes);s.useEffect(()=>U(e.activeNodes),[e.activeNodes]),s.useEffect(()=>{if(!(!R||!M))return i(me=>U(et=>Ste(et,me,M.since,R)))},[R,M,i]);const V=!!((xt=t.composer)!=null&&xt.busy),B=s.useRef(!1),[G,_]=s.useState(!1);s.useEffect(()=>{B.current&&!V&&R&&(_(!0),j8().finally(()=>_(!1))),B.current=V},[V,R]);const[,O]=s.useState(0),I=s.useRef(0),K=s.useCallback(()=>{cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>O(me=>me+1))},[]);s.useEffect(()=>{if(!P&&!H)return;const me=new MutationObserver(K);return me.observe(document.body,{childList:!0,subtree:H}),window.addEventListener("resize",K),()=>{cancelAnimationFrame(I.current),me.disconnect(),window.removeEventListener("resize",K)}},[P,H,K]);const[z,q]=s.useState(()=>!document.hidden);s.useEffect(()=>{const me=()=>q(!document.hidden);return document.addEventListener("visibilitychange",me),()=>document.removeEventListener("visibilitychange",me)},[]);const Z=!!P||H,ee=aM.some(me=>w.has(me)),he=Z&&(ee||[...document.querySelectorAll(Use)].some(me=>!me.closest("[data-radix-popper-content-wrapper], .sc-shotsheet"))),ue=w.get("new"),ge=P?`scenri:guide-begun:${r.id}:${P}`:null,[te,J]=s.useState(!1);s.useEffect(()=>{J(!!ge&&window.localStorage.getItem(ge)==="1")},[ge]);const Q=s.useCallback(()=>{if(ge)try{window.localStorage.setItem(ge,"1")}catch{}J(!0)},[ge]),ae=e.heading,$e=me=>!!me&&(ae==null?void 0:ae.brandId)===r.id&&ae.task===me&&!he,ie=me=>me==="first-shot"||me==="reuse"||me==="refine"?k:me==="product"?A:me==="scene"?L:me==="presenter"?T||E:!1,[ke,ze]=s.useState(!1);s.useEffect(()=>{let me=!1;try{me=!!P&&window.localStorage.getItem(g4(r.id,P))==="1"}catch{}ze(me)},[P,r.id,ae]),s.useEffect(()=>{if(!(!ae||ae.brandId!==r.id)&&ie(ae.task)){try{window.localStorage.setItem(g4(r.id,ae.task),"1")}catch{}ze(!0),(ae.task==="first-shot"||ae.task==="reuse")&&Q(),v4()}},[ae,k,A,L,T,E,r.id,Q]);const wt=s.useRef(null);s.useEffect(()=>{const me=wt.current;!me||ie(me)||(wt.current=null,XN(r.id,me))},[k,A,L,T,E,r.id]),s.useEffect(()=>{e.loaded&&!j&&ae&&v4()},[e.loaded,j,ae]);let Ke=null;if(P==="first-shot"||P==="reuse"){const me=((yt=t.composer)==null?void 0:yt.brandId)===r.id?t.composer:null,et=k&&$e(P),Ct={here:k&&!he,heading:$e(P)&&!k,composer:me&&G?{...me,busy:!0}:me,nodes:D,begun:te||et||D.length>0};Ke=P==="reuse"?JR(Ct):QR(Ct)}else if(P==="refine"){const me=((kt=t.composer)==null?void 0:kt.brandId)===r.id?t.composer:null,et=!!S;Ke=pte({here:et||k&&!he,heading:$e(P)&&!k&&!et,open:et,armed:k&&!!(me!=null&&me.refining),nodes:D,asking:et?!!cc(tP):!!cc(Dp)})}else P==="presenter"?Ke=nP({heading:$e(P)&&!T&&!E,onPage:T&&!E&&!he,studio:E?t.studio:null}):P==="scene"?Ke=gte({heading:$e(P)&&!L&&!C,onPage:L&&!C&&!he,studio:C?t.studio:null}):P==="product"&&(Ke=vte({heading:$e(P)&&!A,onPage:A&&!he&&ue!=="product",dialogOpen:ue==="product"}));const tt=((ot=t.composer)==null?void 0:ot.brandId)===r.id?t.composer:null,De=P==="first-shot"&&tt?eP(tt):P==="reuse"&&tt?tt.products===0?"product":tt.scene?null:"scene":null,Se=!!((ht=t.composer)!=null&&ht.pickerOpen);s.useEffect(()=>{Se&&(P==="first-shot"&&!De?window.dispatchEvent(new Event("scenri:guide-close-picker")):De&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Ak[De]}})))},[P,Se,De]),s.useEffect(()=>{P==="first-shot"&&!De&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:null}}))},[P,De]),s.useEffect(()=>{if(P)return document.documentElement.dataset.guideTask=P,()=>{delete document.documentElement.dataset.guideTask}},[P]);const X=(Ke==null?void 0:Ke.point)===Wse&&window.innerWidth<1024;if(s.useEffect(()=>{if(X)return document.documentElement.dataset.guidePicker="",()=>{delete document.documentElement.dataset.guidePicker}},[X]),P&&Ke&&Ke.voice!=="quiet"){const me=WY(P,Ke.id);me&&(Ke={...Ke,...me})}const je=P&&Ke&&Ke.voice!=="quiet"?Ke.id:null,Re=s.useRef("");s.useEffect(()=>{var et,Ct;if(!P||!je)return;const me=`${P}:${je}`;Re.current!==me&&(Re.current=me,!((Ct=(et=e.progress)==null?void 0:et[P])!=null&&Ct.reached.includes(je))&&fc({reached:{task:P,moment:je}}))},[P,je,e.progress]);const re=Ke,Y=s.useRef(new Set),se=s.useCallback(me=>{Y.current.add(me),fc({finish:me})},[]),Ne=s.useCallback(me=>{fc({dismiss:me}),p({kind:"info",title:"Guide closed",detail:"Continue it any time from Learn."})},[p]);s.useEffect(()=>{P==="first-shot"&&S&&D.some(me=>me.id===S&&me.status==="done"&&me.images>0)&&se("first-shot")},[P,S,D,se]),s.useEffect(()=>{P==="refine"&&S&&j8()},[P,S]);const Be=s.useRef(!1);s.useEffect(()=>{if(P!=="refine"){Be.current=!1;return}S?Be.current=!0:Be.current&&(Be.current=!1,se("refine"))},[P,S,se]);const st=j==="presenter"||j==="scene"||j==="product",Pe=h.filter(me=>!me.finished).length;s.useEffect(()=>{st&&j8()},[st,r,l.length,Pe,u]),s.useEffect(()=>{st&&e.counts&&yte(e,e.counts)&&se(M==null?void 0:M.task)},[st,e,M,se]);const Oe=!!((Ae=t.overlay)!=null&&Ae.engaged);s.useEffect(()=>{if(!e.loaded||!e.eligible)return;const me={eligible:e.eligible,hidden:e.hidden,done:e.done,dismissed:e.dismissed,active:M},Ct=!!S&&Oe&&a.some(be=>be.id===S&&be.status==="done")&&Dh("refine",me)?"refine":C&&Dh("scene",me)?"scene":ue==="product"&&Dh("product",me)?"product":E&&Dh("presenter",me)?"presenter":null;!Ct||Y.current.has(Ct)||(Y.current.add(Ct),fc({start:{task:Ct,brandId:r.id}}))},[e,M,S,Oe,a,ue,E,C,r.id]);const[Ge,ft]=s.useState(""),bt=s.useRef(re);bt.current=re;const at=s.useCallback((me,et)=>{if(ft(""),et)return;const Ct=bt.current,be=Ct?[Ct.title,Ct.body].filter(Boolean).join(". "):"";be&&requestAnimationFrame(()=>ft(be))},[]),[Zt,jt]=s.useState(!1),Ft=jr("welcome"),Pt=Ft.value!==null,Tt=b&&n.showcaseLoaded||k,xe=h.some(me=>!me.finished)||f.some(me=>me.state==="running"&&me.kind!=="catalog"&&me.kind!=="library"),Je=xte({onMainPage:b||k,eligible:e.eligible,welcome:e.welcome,ready:Tt&&!document.querySelector('[data-variant="skeleton"]'),visible:z,blocked:he,busy:xe});s.useEffect(()=>{if(!Je)return;const me=window.setTimeout(()=>jt(!0),Bse);return()=>window.clearTimeout(me)},[Je]);const Et=s.useMemo(()=>kte(n.showcase).map(me=>Gse(me.previewUrl)),[n.showcase]),Xe=n.engines.some(me=>me.available),rt=l.length>0,nt=re&&(re.voice==="ask"||re.voice==="note")?re:null,qt=nt!=null&&nt.shell?cc(nt.shell):document.body,Yt=nt!=null&&nt.point?cc(nt.point):null,an=(nt==null?void 0:nt.live)??(nt!=null&&nt.point?[nt.point]:[]),Wt=an.map(me=>cc(me)).filter(me=>!!me),Rn=((nt==null?void 0:nt.also)??[]).map(me=>cc(me)).filter(me=>!!me),Bt=((nt==null?void 0:nt.lit)??[]).map(me=>cc(me)).filter(me=>!!me),ne=!!nt&&!!qt&&(!nt.point||!!Yt)&&Wt.length===an.length,le=nt&&!ne?nt:null,ce=Zt||ne;s.useEffect(()=>Lk(ce),[ce]),s.useEffect(()=>()=>Lk(!1),[]),s.useEffect(()=>{if(!le)return;const me=(le.shell?document.querySelector(le.shell):null)??document.querySelector(".sc-feed")??document.body,et=new MutationObserver(K);return et.observe(me,{childList:!0,subtree:!0}),()=>et.disconnect()},[le==null?void 0:le.id,le==null?void 0:le.shell,K]);const Ve=me=>{P&&(me.done?se(P):Ne(P))};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:Ge}),nt&&ne&&o.jsx(jne,{id:nt.id,voice:nt.voice,target:Yt,live:Wt,also:Rn,lit:Bt,side:nt.side??"top",beside:nt.beside,soft:nt.soft,container:qt,title:nt.title,body:nt.body,at:nt.at,of:nt.of,canBack:wte(P,nt.id,ke||!!(k&&$e(P))),action:nt.start?{label:"Start"}:nt.done?{label:"Done"}:null,closeLabel:nt.done?"Close":"Close guide",onBack:()=>{const me=P?sP(P,nt.id):null;if(me){window.dispatchEvent(new CustomEvent("scenri:guide-take-back",{detail:{kind:me}})),window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Ak[me]}}));return}if(P==="presenter"&&(nt.id==="start"||nt.id==="face"||nt.id==="save"))return m(ui(r),{replace:!0});if((P==="product"||P==="scene")&&nt.id===P)return y.close();if(P==="refine"&&nt.id==="ask"){if(S)return m(Sr(r),{replace:!0});window.dispatchEvent(new Event("scenri:guide-clear-refine"));return}if(ke&&P&&(nt.id==="new"||nt.id==="choose"||nt.id==="product"))return window.dispatchEvent(new Event("scenri:guide-close-picker")),wt.current=P,m(To(r))},onAction:()=>{if(nt.start)return Q();nt.done&&P&&se(P)},onClose:()=>Ve(nt),onEscape:()=>Ve(nt),onShown:at,onLost:K}),o.jsx(Lte,{open:Zt||Pt,pictures:Et,note:Yu.note({engineReady:Xe,ownsProducts:rt}),onTake:()=>{const me=Zt;jt(!1),Pt&&Ft.close(),me?fc({welcome:"taken"}).then(()=>g("first-shot")):window.setTimeout(()=>void g("first-shot"),0)},onDecline:()=>{const me=Zt;jt(!1),Pt&&Ft.close(),me&&fc({welcome:"declined"})}})]})}function cc(e){for(const t of document.querySelectorAll(e))if(t.getClientRects().length>0)return t;return null}function Gse(e){return`${e}${e.includes("?")?"&":"?"}w=320`}const Yse="lessons";function qse(){var _;const e=jr("learn"),t=e.value!==null,n=VY(e.value),r=Nr(la),a=Tw(),i=oP(),{brand:l,recent:u,products:f}=cn(),h=qP(),[p,g]=s.useState(null);s.useEffect(()=>{t||!p||(g(null),h(p))},[t,p,h]);const m=s.useRef(!1),w=O=>{m.current=!0,g(O),e.close()},y=s.useRef(null);s.useEffect(()=>{t&&(y.current=b4.current,b4.current=null)},[t]);const b=()=>{const O=m.current;if(m.current=!1,O)return;const I=y.current==="help";requestAnimationFrame(()=>{var q;if(document.activeElement!==document.body)return;const K=I?".sc-help-btn":".sc-learn-btn",z=I?".sc-learn-btn":".sc-help-btn";(q=document.querySelector(K)??document.querySelector(z))==null||q.focus()})},k=!!mn(pt.hub),S=!!mn(pt.presenterStudio),E=!!mn(pt.presenters),C=O=>{var I;return((I=a.heading)==null?void 0:I.brandId)===l.id&&a.heading.task===O},A=((_=a.active)==null?void 0:_.brandId)===l.id&&!a.active.paused?a.active.task:null,L=u.some(O=>O.kind!=="root"&&O.status==="done"&&O.images.length>0),T=O=>O.needs==="shot"&&!L||O.needs==="product"&&f.length===0?O.needs??null:null,M=O=>{var Z,ee,he,ue,ge,te;const I=((ee=(Z=a.progress)==null?void 0:Z[O.id])==null?void 0:ee.reached)??[];if(A!==O.id)return H5(O.id,I,null);const K=((he=i.composer)==null?void 0:he.brandId)===l.id?i.composer:null,z={here:k,heading:C(O.id),composer:k?K:null,nodes:a.activeNodes,begun:!0},q=O.id==="first-shot"?((ue=QR(z))==null?void 0:ue.id)??null:O.id==="reuse"?((ge=JR(z))==null?void 0:ge.id)??null:O.id==="presenter"?((te=nP({heading:C("presenter"),onPage:E&&!S,studio:S?i.studio:null}))==null?void 0:te.id)??null:null;return H5(O.id,I,{moment:q,nodes:a.activeNodes,draft:!!a.activeDraftId})},j=O=>zY(O.id,a,l.id,M(O)),P=BY(ol,j),R=n??P??ol[0],H=ol.filter(O=>j(O)==="done").length;s.useEffect(()=>{if(t)for(const O of Object.values(y4))new Image().src=O.wide},[t]);const D=s.useRef(null),U=s.useRef(new Map),V=s.useRef(null),B=s.useRef(!1);s.useEffect(()=>{var K;const O=t&&!B.current;if(B.current=t,!t)return;const I=()=>{var z,q;(z=D.current)==null||z.focus({preventScroll:!0}),(q=D.current)==null||q.scrollIntoView({block:"nearest"})};r&&n?(V.current=n.id,I()):r&&V.current?(K=U.current.get(V.current))==null||K.focus({preventScroll:!0}):O&&I()},[t,r,n]);const G=(O,I)=>o.jsx(Xse,{lesson:O,state:j(O),at:M(O),blocked:T(O),describe:I,actionRef:D,onBegin:()=>w(O.id)});return o.jsx(Ws,{open:t,className:"sc-learn",maxWidth:"880px",described:!0,onDismiss:e.close,onCloseAutoFocus:b,children:r&&n?o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>e.set(Yse),"aria-label":"All lessons",children:o.jsx(Ta,{size:15})}),o.jsx(Ns,{className:"sc-newdlg-title",children:n.title}),o.jsx(L9,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-learn-body",children:G(n,!0)})]},`one-${n.id}`):o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Learn"}),o.jsxs("span",{className:"sc-learn-count",children:[H," of ",ol.length," done"]}),o.jsx(L9,{})]}),o.jsx(Hc,{className:"sc-vh",children:"Each one walks you through one real thing, a step at a time."}),o.jsxs("div",{className:"sc-newdlg-body sc-learn-body",children:[o.jsx("ul",{className:"sc-learn-list",children:ol.map(O=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-learn-row","data-state":j(O),"aria-current":!r&&R.id===O.id?"true":void 0,ref:I=>{I?U.current.set(O.id,I):U.current.delete(O.id)},onClick:()=>e.set(Hw(O.id)),children:[o.jsx("span",{className:"sc-learn-thumb",children:o.jsx("img",{src:y4[O.id].square,alt:"",decoding:"async"})}),o.jsxs("span",{className:"sc-learn-say",children:[o.jsx("span",{className:"sc-learn-name",children:O.title}),o.jsx(XP,{lesson:O,state:j(O),at:M(O),blocked:T(O)})]}),(P==null?void 0:P.id)===O.id&&o.jsx("span",{className:"sc-learn-next",children:"Next"})]})},O.id))}),!r&&G(R,!1)]})]},"all")})}function Xse({lesson:e,state:t,at:n,blocked:r,describe:a,actionRef:i,onBegin:l}){const u=r?w4[r].action:t==="active"?"Continue":t==="done"?"Start again":"Start",f=t==="active"?n:0,h=g=>t==="done"?"done":t==="active"?g<n?"done":g===n?"active":"todo":g===0?"active":"todo",p=a?o.jsx(Hc,{className:"sc-learn-summary",children:e.summary}):o.jsx("p",{className:"sc-learn-summary",children:e.summary});return o.jsxs("section",{className:"sc-learn-lesson","aria-label":e.title,children:[o.jsx("span",{className:"sc-learn-hero",children:o.jsx("img",{src:y4[e.id].wide,alt:"",decoding:"async"})}),o.jsxs("div",{className:"sc-learn-copy",children:[o.jsx("div",{className:"sc-learn-kicker",children:o.jsx(XP,{lesson:e,state:t,at:n,blocked:r})}),o.jsx("h3",{className:"sc-learn-title",children:e.title}),p,o.jsxs("div",{className:"sc-learn-do",children:[o.jsx("ol",{className:"sc-learn-steps",children:rM(e).map((g,m)=>{const w=h(m),y=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:w==="done"?o.jsx(Gn,{size:14,weight:"bold"}):m+1}),b=t==="active"&&m===n?"step":void 0,k=o.jsx("span",{className:"sc-learn-step-name",children:g});return o.jsx("li",{children:m===f?o.jsxs("button",{ref:i,type:"button",className:"sc-learn-step","data-state":w,"data-here":"","aria-current":b,"aria-label":`${u}: ${g}`,onClick:l,children:[y,k,o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[u," ",o.jsx(xa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":w,"aria-current":b,children:[y,k,w==="done"&&o.jsx("span",{className:"sc-vh",children:", done"})]})},g)})}),r&&o.jsx("p",{className:"sc-learn-note",children:w4[r].note})]})]})]})}function XP({lesson:e,state:t,at:n,blocked:r}){const a=rM(e).length;return t==="done"?o.jsxs("span",{className:"sc-learn-status","data-state":"done",children:[o.jsx("span",{className:"sc-learn-tick","aria-hidden":"true",children:o.jsx(Gn,{size:9,weight:"bold"})}),"Done"]}):t==="active"?o.jsxs("span",{className:"sc-learn-status","data-state":"active",children:["Step ",Math.min(n+1,a)," of ",a]}):r?o.jsx("span",{className:"sc-learn-status",children:w4[r].status}):o.jsxs("span",{className:"sc-learn-status",children:[a," step",a===1?"":"s"]})}function L9(){return o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const QP=s.createContext(null),Qse={products:[],productsLoaded:!1,importing:!1,refreshProducts:async()=>{}};function cn(){const e=s.useContext(QP),t=CR()??Qse;if(!e)throw new Error("useBrand must be used inside BrandLayout");return s.useMemo(()=>({...e,...t}),[e,t])}const JP=s.createContext(null);function Jse(){const e=s.useContext(JP);if(!e)throw new Error("useAssetsPanel must be used inside BrandLayout");return e}function eae(){const{brandSlug:e}=aa(),{pathname:t,search:n}=Bn(),r=mn({path:pt.brand,end:!1}),{brands:a,engines:i,refresh:l}=Mn(),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,m]=s.useState([]),[w,y]=s.useState([]),[b,k]=s.useState({}),[S,E]=s.useState(!1),[C,A]=s.useState(0),L=s.useCallback(()=>A(te=>te+1),[]),T=Un(),[M,j]=Ma(qr.assetsOpen,window.innerWidth>=1280),P=s.useCallback(()=>j(te=>!te),[]),R=s.useMemo(()=>({open:M,toggle:P,setOpen:j}),[M,P]);GQ();const H=s.useRef(null),D=a.find(te=>te.slug===e)??a.find(te=>te.id===e)??a.find(te=>te.id===H.current)??null;D&&(H.current=D.id);const U=s.useRef(D==null?void 0:D.id);U.current=D==null?void 0:D.id;const V=s.useCallback(async()=>{if(!D)return;const te=D.id,J=await Ee.workspace(te);U.current===te&&(f(J.project),p(J.root),m(J.recent),y(J.sets),k(J.membership),E(!0))},[D==null?void 0:D.id]),B=s.useRef(new Set),G=s.useCallback(te=>(B.current.add(te),()=>{B.current.delete(te)}),[]),_=s.useCallback(te=>{if(te.length){m(J=>lte(J,te));for(const J of B.current)J(te)}},[]),O=s.useCallback((te,J)=>{!D||te!==D.id||_(J)},[D==null?void 0:D.id,_]),I=s.useCallback(te=>y(J=>J.map(Q=>Q.id===te.id?te:Q)),[]),K=s.useCallback(te=>y(J=>J.filter(Q=>Q.id!==te)),[]),z=s.useCallback(te=>y(J=>J.some(Q=>Q.id===te.id)?J:[te,...J]),[]),q=s.useCallback((te,J)=>k(Q=>({...Q,[te]:J})),[]),Z=s.useMemo(()=>D?{brand:D,workspace:(u==null?void 0:u.brandId)===D.id?u:null,root:h,recent:g,sets:w,membership:b,loaded:S,refresh:V,applySet:I,dropSet:K,insertSet:z,applyMembership:q,applyNodes:_,subscribeActivity:G,shotsEpoch:C,resetShots:L}:null,[D,u,h,g,w,b,S,V,I,K,z,q,_,G,C,L]);s.useEffect(()=>{E(!1),m([]),p(null)},[D==null?void 0:D.id]),s.useEffect(()=>{D&&zG(D.id)},[D==null?void 0:D.id]),s.useEffect(()=>{V()},[V]);const ee=s.useCallback(()=>{l(),V()},[l,V]),he=r?t.slice(r.pathnameBase.length):"",ue=!!D&&e!==D.slug,ge=D?To(D)+he+n:"";if(s.useEffect(()=>{ue&&T(ge,{replace:!0})},[ue,ge,T]),!D){const te=GR(a),J=!!H.current&&!a.some($e=>$e.id===H.current),Q=new URLSearchParams(n);J&&(Q.delete("settings"),Q.delete("new"));const ae=Q.toString();return o.jsx(Pa,{to:te?To(te)+he+(ae?`?${ae}`:""):pt.root,replace:!0})}return o.jsxs(QP.Provider,{value:Z,children:[o.jsx(Eee,{engines:i,brandId:D.id,onSaved:ee}),o.jsx(ete,{engines:i,onSaved:l}),o.jsx(Gee,{}),o.jsx(uX,{brand:D,onActivity:O,children:o.jsxs(YQ,{brand:D,children:[o.jsx(sae,{}),o.jsx(OQ,{children:o.jsxs(JP.Provider,{value:R,children:[o.jsxs("div",{className:"sc-shell",children:[o.jsx(WQ,{}),o.jsx(Zc,{}),o.jsx(CX,{})]}),o.jsx(Kse,{}),o.jsx(qse,{}),o.jsx(Nte,{})]})})]})})]})}const tae=Number(window.localStorage.getItem("scenri:whatsnew-settle-ms")??2500)||2500,eL=s.createContext(null);function eu(){const e=s.useContext(eL);if(!e)throw new Error("useWhatsNew must be used inside WhatsNewProvider");return e}function nae({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState("loading"),[i,l]=s.useState(!1),[u,f]=s.useState([]),h=jr("whatsnew");s.useEffect(()=>{let M=!0;return Ee.releaseNotes().then(j=>{if(M){if(f(j.newFeatures??[]),!Array.isArray(j.recent)){a("failed");return}n({...j,releasesUrl:j.releasesUrl??null,history:j.history??j.recent,unseen:j.unseen??[],lead:j.lead??null}),a("ready")}}).catch(()=>{M&&a("failed")}),()=>{M=!1}},[]);const p=(t==null?void 0:t.recent)??$9,g=p[0]??null,m=s.useMemo(()=>p.find(M=>M.version===(t==null?void 0:t.lead))??null,[p,t==null?void 0:t.lead]),w=h.open,y=(m==null?void 0:m.version)??null,b=s.useCallback(()=>{l(!0),y&&w(y)},[w,y]),k=s.useRef(null),S=s.useCallback(()=>{!t||t.unseen.length===0||k.current===t.version||(k.current=t.version,n({...t,seen:t.version,unseen:[],lead:null}),Ee.releaseSeen(t.version).catch(()=>{}))},[t]),E=(t==null?void 0:t.releasesUrl)??null,C=s.useCallback(M=>E?`${E}/tag/v${M}`:null,[E]),A=s.useCallback(M=>u.includes(M),[u]),L=s.useCallback(M=>{u.includes(M)&&(f(j=>j.filter(P=>P!==M)),Ee.releaseUsed(M).catch(()=>{}))},[u]),T=s.useMemo(()=>({status:r,recent:p,history:(t==null?void 0:t.history)??$9,featured:g,running:t&&t.version!=="0.0.0"?t.version:null,unseen:(t==null?void 0:t.unseen)??rae,lead:m,releasesUrl:E,notesFor:C,unread:((t==null?void 0:t.unseen.length)??0)>0,autoOpenSpent:i,autoOpen:b,markSeen:S,isNew:A,markUsed:L}),[r,t,p,g,m,E,C,i,b,S,A,L]);return o.jsx(eL.Provider,{value:T,children:e})}const $9=[],rae=[];function sae(){var S;const e=eu(),{running:t,builds:n}=ia(),{loaded:r}=cn(),[a]=Al(),i=!!mn(pt.whatsNew),[l,u]=s.useState(()=>!document.hidden),f=s.useRef(!1),h=Tw(),p=Pte(),g=h.eligible&&h.welcome===null,m=g||p||((S=h.active)==null?void 0:S.task)==="first-shot"&&!h.active.paused,w=!h.loaded||m;m&&(f.current=!0);const y=s.useRef(!1),{markSeen:b}=e;s.useEffect(()=>{g?y.current=!0:y.current&&(y.current=!1,b())},[g,b]),s.useEffect(()=>{const E=()=>u(!document.hidden);return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[]);const k=aM.some(E=>a.has(E));return s.useEffect(()=>{if(!Nee({lead:e.lead!==null,spent:f.current||e.autoOpenSpent,loaded:r,visible:l,dialogOpen:k,running:t,builds:n,firstUse:w,onPage:i}))return;const C=window.setTimeout(()=>{f.current=!0,e.autoOpen()},tae);return()=>window.clearTimeout(C)},[e,r,l,k,t,n,w,i]),null}function aae(e,t){return!!e&&e.arriving===t.arriving&&e.installs===t.installs&&(e.landed??0)===(t.landed??0)&&(e.failed??0)===(t.failed??0)&&(e.outcome??null)===(t.outcome??null)}function oae(e,t){return e?e.installs!==t.installs||(e.landed??0)!==(t.landed??0)||(e.outcome??null)!==(t.outcome??null):t.installs>0||(t.landed??0)>0}function iae(e,t){return e?e.arriving||t:!0}const lae=5e3,tL=s.createContext(null);function Mn(){const e=s.useContext(tL);if(!e)throw new Error("useAppData must be used inside AppShell");return e}function cae(){const e=MY(),[t,n]=s.useState(null),[r,a]=s.useState([]),[i,l]=s.useState(null),u=PY(),f=$Y(),h=DY(),p=OY(),[g,m]=s.useState(null),w=s.useCallback(_=>{_&&m(O=>aae(O,_)?O:_)},[]),y=s.useRef(null),[b,k]=s.useState(!1),[S,E]=s.useState(0),{refetch:C}=u,{refetch:A}=f,{refetch:L}=h,{refetch:T}=p;s.useEffect(()=>{if(!g)return;const _=y.current;if(y.current=g,!oae(_,g))return;const O=!g.arriving;O&&k(!0),E(I=>I+1),Promise.all([C,A,L,T].map(I=>I({quiet:!0}))).finally(()=>{O&&k(!1)})},[g,C,A,L,T]);const M=iae(g,b),j=s.useRef(0),P=s.useRef(new Map),R=s.useRef(0),H=s.useRef(!1),D=s.useCallback(_=>{P.current.set(_.id,++j.current),n(O=>O&&lq(O,_))},[]),U=s.useCallback(async()=>{const _=++j.current;R.current=_;const O=await Ee.brands();if(R.current!==_)return;const I=new Set;for(const[K,z]of P.current)z>_&&I.add(K);n(K=>cq(K,O,I))},[]),V=s.useCallback(()=>U().catch(()=>{}),[U]),B=s.useCallback(async()=>{try{await Promise.all([U(),Ee.engines().then(a)]),H.current=!0}catch(_){H.current||l(String(_.message??_))}},[U]);s.useEffect(()=>{B(),vY()},[B]),s.useEffect(()=>{let _=0;const O=()=>{document.hidden||Date.now()-_<lae||(_=Date.now(),V())};return document.addEventListener("visibilitychange",O),window.addEventListener("focus",O),()=>{document.removeEventListener("visibilitychange",O),window.removeEventListener("focus",O)}},[V]);const G=s.useMemo(()=>t===null?null:{brands:t,engines:r,scenes:u.scenes,collections:u.collections,verticals:u.verticals,loaded:u.loaded,error:u.error,refetch:u.refetch,presenters:f.presenters,presenterCategories:f.categories,presenterStyles:f.styles,presentersLoaded:f.loaded,presentersError:f.error,refetchPresenters:f.refetch,demoProducts:h.demoProducts,demoProductCategories:h.categories,demoProductsLoaded:h.loaded,demoProductsError:h.error,showcase:p.showcase,showcaseCategories:p.categories,showcaseLoaded:p.loaded,showcaseError:p.error,refetchShowcase:p.refetch,refresh:B,refreshBrands:V,applyBrand:D,contentArriving:M,libraryTick:S,noteContent:w},[t,r,u.scenes,u.collections,u.verticals,u.loaded,u.error,u.refetch,f.presenters,f.categories,f.styles,f.loaded,f.error,f.refetch,h.demoProducts,h.categories,h.loaded,h.error,p.showcase,p.categories,p.loaded,p.error,p.refetch,B,V,D,M,S,w]);return i?o.jsx(Vs,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Iw,{failure:{kind:"unknown",title:"Scenri could not read your library.",fix:"Check that it is still running, then reload.",raw:i,retryable:!0}})}):t===null?o.jsx(Vs,{align:"center",justify:"center",height:"100vh",children:o.jsx(Pr,{size:"3"})}):o.jsx(tL.Provider,{value:G,children:o.jsx(eM.Provider,{value:e,children:o.jsx(rq,{children:o.jsxs(nae,{children:[o.jsx(KS,{}),o.jsx(Zc,{})]})})})})}function jr(e){const[t,n]=Al(),r=t.get(e),a=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!1})},[e,n]),i=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!0})},[e,n]),l=s.useCallback(()=>{n(u=>{const f=new URLSearchParams(u);return f.delete(e),f},{replace:!0})},[e,n]);return{value:r,open:a,set:i,close:l}}function Fh(e,t=""){const[n,r]=Al(),a=n.get(e)??t,i=s.useCallback(l=>{r(u=>{const f=new URLSearchParams(u);return l===null||l===t?f.delete(e):f.set(e,l),f},{replace:!0})},[e,t,r]);return[a,i]}function T9(e,t){const n=D9(t.name),r=H9(t.url);return!n&&!r?null:e.find(a=>{var i,l,u,f;return!!(r&&H9((l=(i=a.json)==null?void 0:i.meta)==null?void 0:l.website)===r||n&&D9(((f=(u=a.json)==null?void 0:u.meta)==null?void 0:f.name)??a.slug)===n)})??null}const D9=e=>String(e??"").trim().replace(/\s+/g," ").toLowerCase()||null,H9=e=>{const t=String(e??"").trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).hostname.toLowerCase().replace(/^www\./,"")||null}catch{return null}};function uae(e){const t=e.name.source==="hostname"?{key:"name",found:!1,label:"Name",value:`taken from the address (${e.host})`}:{key:"name",found:!0,label:"Name",value:e.name.value},n=e.logo.status==="primary"?{key:"logo",found:!0,label:"Logo",value:"found on the site"}:e.logo.status==="alternate"?{key:"logo",found:!0,label:"Logo",value:"only a small mark, saved as an alternate"}:{key:"logo",found:!1,label:"Logo",value:"none found"},r=e.colors.count>0?{key:"colors",found:!0,label:"Colours",value:`${e.colors.count} taken from the site`}:{key:"colors",found:!1,label:"Colours",value:"none we could trust"};return[t,n,r]}function dae(e){return e.logo.status!=="primary"||e.colors.count===0||e.name.source==="hostname"}const C0=(e,t=!1)=>({key:"products",found:t,label:"Products",value:e});function fae(e){switch(e.kind){case"idle":return null;case"scanning":return C0("looking for a shop");case"timeout":return C0("this site took too long to search");case"error":return C0("the search did not finish");case"result":{const{scan:t}=e;if(t.verdict==="none")return null;if(t.verdict==="found"){const n=t.countSource==="sitemap"&&t.count>20;return C0(`${n?"about ":""}${t.count.toLocaleString()} found`,!0)}return C0("we could not load the catalogue")}}}function hae(e){return e.kind==="timeout"||e.kind==="error"?!0:e.kind==="result"&&(e.scan.verdict==="blocked"||e.scan.verdict==="likely")}function pae(e){var t;return!e||e.verdict!=="found"?!1:e.candidates.length>0||(((t=e.cards)==null?void 0:t.length)??0)>0}function mae(e,t){const n=e.trim();if(n.length<=t)return n;const r=n.slice(0,t),a=r.lastIndexOf(" ");return`${(a>t*.6?r.slice(0,a):r).replace(/[\s,;:.]+$/,"")}...`}function gae(){var te,J,Q,ae,$e,ie;const{brands:e,refresh:t}=Mn(),n=Un(),r=e.length>0,[a,i]=s.useState(""),[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(!1),[m,w]=s.useState(null),[y,b]=s.useState(null),[k,S]=s.useState(!1),[E,C]=s.useState(!1),[A,L]=s.useState(null),[T,M]=s.useState(null),[j,P]=s.useState(null),[R,H]=s.useState(null),D=s.useRef(!1),U=s.useRef(null),V=async(ke,ze)=>{D.current=!0,U.current=null,b(ke),await t(),n(`${To(ke)}${ze?`?settings=${ze}`:""}`,{replace:!0})},B=s.useRef(!1);s.useEffect(()=>{B.current=!1;const ke=()=>{const ze=U.current;!ze||D.current||(U.current=null,fetch(`/api/brands/${ze}`,{method:"DELETE",keepalive:!0}).catch(()=>{}))};return window.addEventListener("pagehide",ke),()=>{B.current=!0,window.removeEventListener("pagehide",ke),ke()}},[]);const G=async(ke=!1)=>{var ze,wt;if(!ke){const Ke=T9(e,{url:a.trim()});if(Ke){H(Ke);return}}g(!0),w(null);try{const Ke=await Ee.brandFromUrl(a);if(B.current){fetch(`/api/brands/${Ke.id}`,{method:"DELETE",keepalive:!0}).catch(()=>{});return}b(Ke),U.current=Ke.id,L(Ke.report),M(((ze=Ke.report)==null?void 0:ze.read)===!1&&((wt=Ke.warnings)==null?void 0:wt.slice(0,2).join(" "))||null),g(!1)}catch(Ke){w(String(Ke.message??Ke)),g(!1)}},_=async(ke=!1)=>{if(!ke){const ze=T9(e,{name:l});if(ze){H(ze);return}}g(!0),w(null);try{await V(await Ee.createBrand({specVersion:"0.1",meta:{name:l.trim()||"Untitled brand"}}))}catch(ze){w(String(ze.message??ze)),g(!1)}},O=()=>n("/",{replace:!0}),{scan:I,scanning:K,outcome:z,retry:q}=gR((y==null?void 0:y.id)??null),Z=fae(z),ee=z.kind==="timeout"||z.kind==="error",he=async ke=>{var ze,wt;if(y){P(null),C(!0);try{await Ee.catalogImport(y.id,String(((wt=(ze=y.json)==null?void 0:ze.meta)==null?void 0:wt.website)??a),ke)}catch{P("That did not start. Check your connection and try again."),C(!1);return}C(!1),S(!1),await V(y)}},ue=y?ra((te=y.json)==null?void 0:te.palette):[],ge=y?Jr((J=mX(y.json))==null?void 0:J.file):null;return o.jsxs("div",{className:"sc-wiz",children:[o.jsxs("div",{className:"sc-wiz-form",children:[o.jsxs("div",{className:"sc-wiz-head",children:[o.jsxs("button",{type:"button",className:"sc-wiz-back",onClick:O,style:r?void 0:{visibility:"hidden"},children:[o.jsx(Ta,{size:11})," Back"]}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("h1",{children:["Your ",o.jsx("em",{children:"brand"})]}),o.jsx("p",{className:"sc-wiz-sub",children:y&&A?o.jsxs(o.Fragment,{children:["Built from ",A.host,". Everything here can be changed later, from Settings."]}):o.jsx(o.Fragment,{children:"Paste a website and the kit builds itself: name, logo, palette. You can also start from nothing and fill it in later from Settings."})}),o.jsxs("div",{className:"sc-wiz-fields",children:[y?o.jsx("div",{style:{textAlign:"center"},children:K?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",disabled:!0,children:[o.jsx(Pr,{size:"1"})," Looking for products"]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void V(y),children:"Skip and add the brand only"})})]}):ee?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:q,children:["Look for products again ",o.jsx(xa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void V(y),children:"Continue without products"})})]}):pae(I)?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>S(!0),children:["Add brand and products ",o.jsx(xa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void V(y),children:"Just the brand"})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>void V(y),children:["Looks right ",o.jsx(xa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void V(y,"brand"),children:A&&dae(A)?"Finish the kit first":"Edit the kit first"})})]})}):f?o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-name",children:"Brand name"}),o.jsx("input",{id:"sc-wiz-name",className:"sc-in",placeholder:"Brand name",value:l,onChange:ke=>{u(ke.target.value),H(null)},onKeyDown:ke=>ke.key==="Enter"&&l.trim()&&!p&&void _()}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!l.trim()||p,onClick:()=>void _(),children:p?o.jsx(Pr,{size:"1"}):o.jsxs(o.Fragment,{children:["Create it ",o.jsx(xa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!1),H(null)},children:"Build from a website instead"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-url",children:"Website"}),o.jsx("input",{id:"sc-wiz-url",className:"sc-in",placeholder:"acme.com",value:a,onChange:ke=>{i(ke.target.value),H(null)},onKeyDown:ke=>ke.key==="Enter"&&a.trim()&&!p&&void G()}),o.jsx("p",{className:"sc-wiz-hint",children:"We only read public pages. Nothing leaves this machine."}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!a.trim()||p,onClick:()=>void G(),children:p?o.jsx(Pr,{size:"1"}):o.jsxs(o.Fragment,{children:["Build the kit ",o.jsx(xa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!0),H(null)},children:"Start from scratch instead"})})]})]}),R&&o.jsxs(o4,{color:"amber",mt:"3",size:"1",children:[o.jsxs(i4,{children:["You already have ",Ca(R),". Creating another makes a second workspace with its own address."]}),o.jsxs("div",{style:{display:"flex",gap:10,marginTop:4,flexWrap:"wrap"},children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>n(To(R)),children:["Open ",Ca(R)," instead"]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{H(null),f?_(!0):G(!0)},children:"Create anyway"})]})]}),m&&o.jsx(o4,{color:"red",mt:"3",size:"1",children:o.jsx(i4,{children:m})})]})]}),o.jsx("div",{className:"sc-wiz-preview",children:o.jsxs("div",{className:"sc-wiz-card",children:[o.jsx("div",{className:"sc-wiz-cap",children:y?"Your kit":p?`Reading ${a||"the site"}`:"Live kit preview"}),o.jsxs("div",{className:"sc-wiz-body",children:[p&&!y&&o.jsxs("div",{className:"sc-scrape-row",children:[o.jsx(Pr,{size:"1"})," Reading the site and building the kit"]}),!p&&!y&&o.jsx("p",{style:{color:"var(--sc-fg3)",fontSize:12.5,margin:0},children:"The kit appears here as it is found."}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:ue.length?16:0},children:[o.jsx("span",{className:"sc-kit-logo",style:{width:44,height:44,padding:7,borderRadius:12},children:ge?o.jsx("img",{src:ge,alt:""}):o.jsx(Da,{size:16,color:"var(--sc-fg3)"})}),o.jsxs("span",{children:[o.jsx("b",{dir:"auto",style:{fontFamily:"var(--sc-font-display)",fontSize:16},children:(ae=(Q=y.json)==null?void 0:Q.meta)==null?void 0:ae.name}),((ie=($e=y.json)==null?void 0:$e.meta)==null?void 0:ie.tagline)&&o.jsx("small",{dir:"auto",style:{display:"block",color:"var(--sc-fg3)",fontSize:11.5},children:mae(String(y.json.meta.tagline),72)})]})]}),ue.length>0&&o.jsx("div",{style:{display:"flex",gap:8},children:ue.slice(0,5).map(ke=>o.jsx("span",{style:{flex:1,height:44,borderRadius:9,border:"1px solid var(--sc-line)",background:ke.hex}},ke.hex))}),A&&o.jsx("ul",{className:"sc-kit-lines",role:"status",children:[...uae(A),...Z?[Z]:[]].map(ke=>o.jsxs("li",{"data-found":ke.found?"":void 0,children:[ke.key==="products"&&K?o.jsx(Pr,{size:"1"}):ke.found?o.jsx(Gn,{size:12,weight:"bold"}):o.jsx(MF,{size:12}),o.jsx("span",{className:"sc-kit-line-label",children:ke.label}),o.jsx("span",{className:"sc-kit-line-value",children:ke.value})]},ke.key))}),T&&o.jsx("p",{className:"sc-kit-note",role:"status",children:T}),!K&&!ee&&hae(z)&&o.jsx("button",{type:"button",className:"sc-wizpick-open",onClick:q,children:"Try the catalogue again"})]})]})]})}),k&&I&&y&&o.jsx(mR,{brandId:y.id,scan:I,busy:E,error:j,onImport:ke=>void he(ke),onImportAll:()=>void he(),onDismiss:()=>S(!1)})]})}const Zu=e=>{const t=(e??"").trim();return t||null};function vae(e){const t=e;return{name:e.name,brand:Zu(t.brand)??Zu(t.vendor),qualifier:Zu(t.format)??Zu(t.subcategory)??Zu(t.variant)}}function wae(e){return!e.brand||e.name.toLowerCase().startsWith(e.brand.toLowerCase())?e.name:`${e.brand} ${e.name}`}function Do(e,t){const n=vae(e);if(t==="chip")return n.name;const r=wae(n);return t==="tooltip"?[r,n.qualifier].filter(Boolean).join(" · "):r}function Cl(e,t){return t==="tooltip"?[e.name,Zu(e.lighting)].filter(Boolean).join(" · "):e.name}function Wp(e){return[e.name,...e.legacyNames??[],...e.keywords??[],e.description,e.lighting,e.subject].concat(e.collections??[],e.verticals??[]).filter(Boolean).join(" ")}function Ey(e){const t=e;return[e.name,...t.legacyNames??[],...t.keywords??[],t.brand,t.vendor,t.format,t.subcategory,t.variant,t.productType,...t.tags??[]].filter(Boolean).join(" ")}function Kp(e){return[e.name,e.descriptor,e.presentation,e.ageRange,e.facial,e.skin,e.hair,e.build,e.wardrobeDefault,...e.suitableCategories,...e.suitableStyles].filter(Boolean).join(" ")}function yae(e,t,n){return[e.title,e.category,n,t.product?Ey(t.product):null,t.presenter?Kp(t.presenter):null,t.scene?Wp(t.scene):null].filter(Boolean).join(" ")}function Cy(){const{brand:e}=cn(),t=Un(),n=Sr(e);return s.useCallback(r=>{t(`${n}?${yd("presenter",r)}&compose=1${Ec()}`)},[n,t])}function d2(){const{brand:e}=cn(),t=Un(),n=Sr(e);return s.useCallback((r,a,i,l)=>{const u=a?`&setup=${encodeURIComponent(a)}`:"",f=i?`&ref=${encodeURIComponent(i)}${l?`&view=${l}`:""}`:"";t(`${n}?${yd("scene",r)}${u}${f}&compose=1${Ec()}`)},[n,t])}function X4(e){return{...e.brief,...e.quality?{quality:e.quality}:{},_at:Date.now()}}function bae(){const{brand:e}=cn(),t=Un(),n=Sr(e);return s.useCallback(r=>{t(`${n}?showcase=${encodeURIComponent(r)}`)},[n,t])}const dp=e=>`sc-favscenes-${e}`,xae=e=>`sc-favlooks-${e}`,kae=e=>`bt-favlooks-${e}`;function nL(e,t){return e==="presenter"?`sc-favpresenters-${t}`:e==="product"?`sc-favproducts-${t}`:dp(t)}function rL(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ci(e){try{const t=localStorage.getItem(dp(e))??u4(xae(e),dp(e))??u4(kae(e),dp(e));return rL(t)}catch{return[]}}function Ed(e,t){try{return e==="scene"?Ci(t):rL(localStorage.getItem(nL(e,t)))}catch{return[]}}function sL(e,t,n){try{localStorage.setItem(nL(e,t),JSON.stringify(n))}catch{}}function f2(e,t,n){const r=Ed(e,t),a=r.includes(n)?r.filter(i=>i!==n):[...r,n];return sL(e,t,a),a}function jy(e,t,n,r){const a=Ed(e,t),i=r?[...a,...n.filter(l=>!a.includes(l))]:a.filter(l=>!n.includes(l));return sL(e,t,i),i}const aL=[{key:"campaign",label:"Product campaign"},{key:"lifestyle",label:"Lifestyle"},{key:"editorial",label:"Fashion & editorial"},{key:"beauty",label:"Beauty"},{key:"food-drink",label:"Food & drink"},{key:"launch",label:"Tech launch"},{key:"social",label:"Social"},{key:"cinematic",label:"Cinematic"},{key:"catalog",label:"Catalog"},{key:"seasonal",label:"Seasonal"}],Sae=new Map(aL.map(e=>[e.key,e]));function n6(e){var t;return e?((t=Sae.get(e))==null?void 0:t.label)??e:null}function Eae(e){const t=new Map(aL.map((n,r)=>[n.key,r]));return[...e].sort((n,r)=>(t.get(n)??99)-(t.get(r)??99)||n.localeCompare(r))}function Cae(e,t){let r=null,a=null,i=null,l=null,u=null,f=null,h=null,p={dx:0,dy:0},g={w:0,h:0},m=0;const w=P=>{P.style.position="fixed",P.style.left="0",P.style.top="0",P.style.margin="0",P.style.zIndex="var(--sc-z-popover)",P.style.pointerEvents="none"},y=()=>{const P=R=>{var H,D;window.removeEventListener("click",P,!0),!((D=(H=R.target).closest)!=null&&D.call(H,'[data-role="remove"]'))&&(R.stopPropagation(),R.preventDefault())};window.addEventListener("click",P,!0),setTimeout(()=>window.removeEventListener("click",P,!0),250)},b=()=>{if(h!==null){try{e.releasePointerCapture(h)}catch{}h=null}i==null||i.remove(),l==null||l.remove(),i=null,l=null,u=null,a==null||a.removeAttribute("data-drag-src"),a=null,r=null,e.removeAttribute("data-chip-drag"),document.documentElement.style.cursor="",cancelAnimationFrame(m)},k=P=>{!e.isConnected||!e.contains(document.activeElement)||(f!==null?Ga(e,f):xc(e,P,"after"))},S=()=>{if(!a)return;const P=a;b(),y(),k(P),t.onCancelled()},E=P=>{if(P.button!==0||P.pointerType==="touch")return;const R=P.target;if(R.closest('[data-role="remove"]'))return;const H=nl(R);H&&(r={chip:H,x:P.clientX,y:P.clientY})},C=P=>{var H,D;if(!r)return;f=ko(e),a=r.chip,t.onDragStart(),(H=window.getSelection())==null||H.removeAllRanges(),e.setAttribute("data-chip-drag","");const R=a.getBoundingClientRect();p={dx:r.x-R.left,dy:r.y-R.top},r=null;try{e.setPointerCapture(P.pointerId),h=P.pointerId}catch{}document.documentElement.style.cursor="grabbing",i=a.cloneNode(!0),(D=i.querySelector('[data-role="remove"]'))==null||D.remove(),i.className=`${a.className} sc-chip-ghost`,i.removeAttribute("data-drag-src"),i.removeAttribute("title"),w(i),i.style.width=`${R.width}px`,i.style.height=`${R.height}px`,i.style.fontSize=getComputedStyle(a).fontSize,g={w:R.width,h:R.height},document.body.appendChild(i),a.setAttribute("data-drag-src",""),l=document.createElement("div"),l.className="sc-drop-caret",w(l),l.style.display="none",document.body.appendChild(l),A(P)},A=P=>{if(!i||!a)return;const R=Math.min(Math.max(4,P.clientX-p.dx),window.innerWidth-g.w-4),H=Math.min(Math.max(4,P.clientY-p.dy),window.innerHeight-g.h-4);i.style.transform=`translate3d(${R}px, ${H}px, 0)`;const D=_k(e,a,P.clientX,P.clientY);if(u=D,!l)return;const U=D&&!D.noop?O9(e,D.units):null;if(!U||!D){l.style.display="none";return}const V=Qte(e,D.units),B=V<D.units?O9(e,V):null,G=!!B&&Math.abs(B.top+B.height/2-(U.top+U.height/2))<U.height/2,_=B&&G?(B.left+U.left)/2:U.left;l.style.display="",l.style.transform=`translate3d(${_-1.5}px, ${U.top-2}px, 0)`,l.style.height=`${U.height+4}px`},L=P=>{if(r){if(Math.hypot(P.clientX-r.x,P.clientY-r.y)<5)return;P.preventDefault(),C(P);return}if(!a)return;P.preventDefault(),cancelAnimationFrame(m);const{clientX:R,clientY:H}=P;m=requestAnimationFrame(()=>A({clientX:R,clientY:H}))},T=P=>{if(r){r=null;return}if(!a)return;const R=a;let H;try{H=_k(e,R,P.clientX,P.clientY)??u}catch{H=u}finally{b()}if(y(),H&&!H.noop&&pP(e,R,H.units)){xc(e,R,"after"),t.onMoved(R,B4(e,R));return}k(R),t.onCancelled()},M=P=>{P.key==="Escape"&&a&&(P.stopPropagation(),S())},j=P=>{nl(P.target)&&P.preventDefault()};return e.addEventListener("pointerdown",E),e.addEventListener("dragstart",j),e.addEventListener("lostpointercapture",S),window.addEventListener("pointermove",L),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",S),window.addEventListener("blur",S),window.addEventListener("keydown",M,!0),()=>{b(),e.removeEventListener("pointerdown",E),e.removeEventListener("dragstart",j),e.removeEventListener("lostpointercapture",S),window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",S),window.removeEventListener("blur",S),window.removeEventListener("keydown",M,!0)}}function O9(e,t){let n=0;const r=Array.from(e.childNodes);for(let l=0;l<r.length;l++){const u=r[l],f=kd(u),h=u.nodeType===Node.TEXT_NODE&&t===n+f&&l<r.length-1;if(t<=n+f&&!h){if(u.nodeType!==Node.TEXT_NODE){const m=u.getBoundingClientRect();return new DOMRect(t===n?m.left:m.right,m.top,0,m.height)}const p=document.createRange();p.setStart(u,Ip(u,Math.max(0,Math.min(t-n,f)))),p.collapse(!0);const g=p.getBoundingClientRect();return g.height?g:null}n+=f}const i=(e.lastElementChild??e).getBoundingClientRect();return new DOMRect(i.right,i.top,0,i.height||18)}function jae({kind:e,label:t,thumb:n,onInspect:r,onMove:a,onRemove:i,onClose:l}){const{sheet:u,grip:f}=Td(()=>l("dismiss")),h=e==="mark"?"brand mark":"reference image";return o.jsx(Rl,{open:!0,onOpenChange:p=>!p&&l("dismiss"),children:o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-shotsheet-scrim"}),o.jsxs($l,{ref:u,className:"sc-shotsheet sc-swapsheet","data-kind":e,"aria-describedby":void 0,onOpenAutoFocus:p=>{var g;p.preventDefault(),(g=u.current)==null||g.focus({preventScroll:!0})},onCloseAutoFocus:p=>p.preventDefault(),onEscapeKeyDown:p=>{p.preventDefault(),l("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...f,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(Tl,{className:"sc-vh",children:["Move or remove ",h]})]}),o.jsxs("div",{className:"sc-movesheet-head",children:[n&&o.jsx("button",{type:"button",className:"sc-movesheet-face",onClick:r,"aria-label":`Open ${h}`,children:o.jsx("img",{src:n,alt:"",onError:p=>p.currentTarget.remove()})}),o.jsxs("span",{className:"sc-movesheet-txt",children:[o.jsx("b",{dir:"auto",children:t||h}),o.jsx("span",{children:h})]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(-1),children:[o.jsx(Lv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(1),children:["Move later ",o.jsx(xa,{size:13})]})]}),i&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:i,children:[o.jsx(Ml,{size:13}),"Remove ",e==="mark"?"mark":"reference"]})]})]})]})})}const Aae=440,Nae=460,Mae=600,I9=156,oL=8,fp=14,r6=20,xr=12,iL=200,Rae=240,lL=204;function Pae(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min(n==null?void 0:n.width,t.width-xr*2),i=e.right+fp+r+xr<=t.width?e.right+fp:Math.max(xr,e.left-fp-r),l=Math.max(xr,Math.min(e.top,t.height-xr-lL));return{left:i,top:l,width:r,maxHeight:Math.max(iL,t.height-l-xr),side:"beside"}}function Lae(e,t){const n=(r,a)=>Math.min(Math.max(r,r6),Math.max(r6,a-r6));return t.side==="beside"?{edge:t.left>=e.right?"left":"right",x:0,y:n((e.top+e.bottom)/2-t.top,lL)}:{edge:t.side==="above"?"bottom":"top",x:n((e.left+e.right)/2-t.left,t.width),y:0}}function $ae(e,t,n,r){if(e.bottom<0||e.top>t.height)return null;const a=oL,i=Math.min(n.width,t.width-xr*2),l=n.height,u=Math.min(Math.max(e.left+(e.right-e.left)/2-i/2,xr),Math.max(xr,t.width-i-xr)),h=e.top-a-xr>=l?e.top-a-l:Math.min(e.bottom+a,Math.max(xr,t.height-l-xr));return{left:u,top:h}}function Ay(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min((n==null?void 0:n.width)??Aae,t.width-xr*2),a=(n==null?void 0:n.gap)??oL,i=e.top-a-xr,l=t.height-e.bottom-a-xr,u=i>=Rae||i>=l?"above":"below",f=u==="above"?i:l,h=Math.max(iL,Math.min((n==null?void 0:n.maxHeight)??Nae,f)),p=Math.min(Math.max(e.left,xr),Math.max(xr,t.width-r-xr)),g=u==="above"?Math.max(xr,e.top-a-h):e.bottom+a;return u==="above"?{left:p,top:g,width:r,maxHeight:h,side:u,bottomEdge:e.top-a}:{left:p,top:g,width:r,maxHeight:h,side:u}}function cL(e){return e.side==="above"&&e.bottomEdge!==void 0?{left:e.left,width:e.width,maxHeight:e.maxHeight,top:"auto",bottom:window.innerHeight-e.bottomEdge}:{left:e.left,width:e.width,maxHeight:e.maxHeight,top:e.top}}const Tae=["ref","mark","product","presenter","scene","shot"],hp=e=>Tae.includes(e),uL={ref:"Reference image",mark:"Brand mark",product:"Product",presenter:"Person",scene:"Place",shot:"Shot"};function Dae(e){return e.side==="below"||e.side==="beside"?{top:Math.round(e.top)}:{bottom:Math.round(window.innerHeight-(e.top+e.maxHeight))}}function Id({anchor:e,kind:t,src:n,label:r,warning:a,note:i,noun:l,side:u="auto",onOpen:f,onHoverIn:h,onHoverOut:p,onClose:g}){const[m,w]=s.useState(null),[y,b]=s.useState(!1);if(s.useEffect(()=>b(!1),[n]),s.useLayoutEffect(()=>{var E,C;const S=()=>{const A=window.visualViewport,L=e.getBoundingClientRect(),T={width:(A==null?void 0:A.width)??window.innerWidth,height:(A==null?void 0:A.height)??window.innerHeight},M=u==="beside"?Pae(L,T,{width:I9}):Ay(L,T,{width:I9,gap:fp});if(!M){g();return}w({...M,tail:Lae(L,M)})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),(E=window.visualViewport)==null||E.addEventListener("resize",S),(C=window.visualViewport)==null||C.addEventListener("scroll",S),()=>{var A,L;window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0),(A=window.visualViewport)==null||A.removeEventListener("resize",S),(L=window.visualViewport)==null||L.removeEventListener("scroll",S)}},[e,u,g]),s.useEffect(()=>{const S=E=>{E.key==="Escape"&&g()};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[g]),!m)return null;const k=l??uL[t];return Br.createPortal(o.jsxs("div",{className:"sc-chip-preview","data-kind":t,"data-side":m.side,"aria-hidden":"true",style:{left:Math.round(m.left),...Dae(m),maxWidth:m.width,maxHeight:m.maxHeight},onPointerEnter:h,onPointerLeave:p,children:[o.jsx("span",{className:"sc-chip-preview-tail","data-edge":m.tail.edge,style:m.tail.edge==="left"||m.tail.edge==="right"?{top:Math.round(m.tail.y)}:{left:Math.round(m.tail.x)}}),o.jsxs("button",{type:"button",className:"sc-chip-preview-hit",tabIndex:-1,onClick:f,children:[y?o.jsxs("span",{className:"sc-chip-preview-plate sc-chip-preview-blank",children:[o.jsx(Da,{size:20}),"Image unavailable"]}):o.jsx("img",{className:"sc-chip-preview-plate",src:n,alt:"",decoding:"async",onError:()=>b(!0)}),r&&o.jsx("b",{dir:"auto",children:r}),k&&o.jsx("span",{children:k})]}),i&&o.jsx("p",{className:"sc-chip-preview-note",children:i}),a&&o.jsx("p",{className:"sc-swap-warn",children:a})]}),document.body)}const Hae=160,Oae=120;function Fd(){const[e,t]=s.useState(null),n=s.useRef(null),r=s.useRef(!1);r.current=e!==null;const a=s.useCallback(()=>{n.current&&clearTimeout(n.current),n.current=null},[]),i=s.useCallback(f=>{if(a(),r.current){t(f);return}n.current=setTimeout(()=>t(f),Hae)},[a]),l=s.useCallback(()=>{a(),n.current=setTimeout(()=>t(null),Oae)},[a]),u=s.useCallback(()=>{a(),t(null)},[a]);return s.useEffect(()=>a,[a]),{shown:e,open:i,keep:a,close:l,closeNow:u}}const F0="sc-insert-menu";function Iae(e){var t;return!!(((t=e.nativeEvent)==null?void 0:t.isComposing)??e.isComposing)||e.keyCode===229}function Fae(e){return e==="/"?"Places":e==="@"?"People":e==="#"?"Colors":"Products"}function _ae(e){return e==="/"?"No matching places":e==="#"?"No matching colours":e==="@"?"No matching people":"No matching products"}function Vae({menuOpen:e,handled:t}){return!e&&!t}function Zae(e,t){return t||!e?{open:!1}:{open:!0,sigil:e.sigil,query:e.query}}function zae(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return[{text:e,hit:!1}];const r=e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase());if(r<0)return[{text:e,hit:!1}];const a=r+n.length;return[...r>0?[{text:e.slice(0,r),hit:!1}]:[],{text:e.slice(r,a),hit:!0},...a<e.length?[{text:e.slice(a),hit:!1}]:[]]}function Bae(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.right-e.left,h:e.bottom-e.top}}function Uae(e,t){return{left:e.left+t.x,top:e.top+t.y,right:e.left+t.x+t.w,bottom:e.top+t.y+t.h}}function Wae(e,t,n){return n?t:e||t}function Kae(e,t){return!t||e==null?!0:e===t?!1:!t.contains(e)}function s6(e,t){return e===t?!0:!e||!t?!1:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.maxHeight===t.maxHeight&&e.side===t.side&&e.shell===t.shell}function Gae(e,t,n){return Math.min(n,Math.max(0,e)+Math.max(0,t))}function Yae(e,t,n){return n>0&&t>0&&e!==t}function qae(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.bottom>r.bottom?e.scrollTop+=n.bottom-r.bottom:n.top<r.top&&(e.scrollTop-=r.top-n.top)}const dL=320,Gp=320,Xae=280,vc=8,hc=12,Qae=8,F9=80,Jae=120,fL=48;function hL(e,t){return!(!e||e.top===0&&e.left===0&&e.right===0&&e.bottom===0||e.bottom<0||e.top>t.height||e.right-e.left>fL)}function eoe(e){return{top:e.top,bottom:Math.min(e.bottom,e.top+22),left:e.left,right:e.left+2}}function pL(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n.width-t-r))}function Q4(e,t,n,r){const a=n?Qae:hc,i=n?Math.max(0,e.right-e.left):Math.min(dL,t.width-a*2),l=n?e.left:pL(e.left,i,t,a),u=n?Math.min(Xae,Math.floor(t.height*.4)):Gp,f=Math.min(u,r??u),h=e.top-vc-a,p=Math.max(0,Math.min(f,h)),g=Math.max(a,e.top-vc-p);return{left:l,top:g,width:i,maxHeight:p,side:"above",shell:"dock"}}function _9(e,t,n,r){const a=Math.min(dL,n.width-hc*2),i=pL(e.left,a,n,hc),l=e.top-vc-hc,u=n.height-e.bottom-vc-hc,f=l>=Jae||l>=u?"above":"below",h=Math.min(Gp,r??Gp),p=f==="above"?l:u,g=Math.min(h,r==null?Math.max(F9,p):p);if(f==="above"){const w=Math.max(hc,e.top-vc-Math.min(h,l)),y=Math.min(h,e.top-vc-w);return r==null&&y<F9?Q4(t,n,!1):{left:i,top:w,width:a,maxHeight:y,side:f,shell:"caret"}}const m=e.bottom+vc;return m+Math.min(g,u)>n.height-hc?Q4(t,n,!1,r):{left:i,top:m,width:a,maxHeight:Math.min(h,u),side:f,shell:"caret"}}function toe(e,t,n,r={}){if(r.phone)return Q4(t,n,!0,r.height);const a=r.line??t;if(hL(e,n)&&e)return _9(e,t,n,r.height);const i=e&&e.right-e.left>fL?e:a;return _9(eoe(i),t,n,r.height)}function noe({anchor:e,composer:t,line:n,query:r,options:a,remaining:i=0,total:l=0,sigil:u,onMore:f,onActiveId:h,onClose:p}){const g=Nr(la),[m,w]=s.useState(0),[y,b]=s.useState(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),C=s.useRef(null),A=`${u??""}\0${r}`,L=s.useRef({}),T=s.useRef(f);T.current=f;const M=s.useRef(i);M.current=i;const j=s.useRef(0),P=s.useCallback(()=>{var V;Yae(j.current,a.length,M.current)&&(j.current=a.length,(V=T.current)==null||V.call(T))},[a.length]);s.useEffect(()=>{w(0),j.current=0},[r]),s.useEffect(()=>{w(V=>Math.min(V,Math.max(0,a.length-1)))},[a.length]),s.useEffect(()=>{C.current=null,L.current={}},[u]);const R=s.useCallback(V=>{var ee;const B=t==null?void 0:t.getBoundingClientRect();if(!B)return null;const G=(n==null?void 0:n.getBoundingClientRect())??B,_=window.visualViewport,O={width:(_==null?void 0:_.width)??window.innerWidth,height:(_==null?void 0:_.height)??window.innerHeight},I=!!((ee=k.current)!=null&&ee.contains(document.activeElement)),K=I?null:cP(),z=K&&hL(K,O)?K:null;z&&(C.current=Bae(z,G));const q=C.current?Uae(G,C.current):null,Z=Wae(z,q,I)??(I?null:(e==null?void 0:e.getBoundingClientRect())??null);return toe(Z,B,O,{phone:g,line:G,height:V})},[e,t,n,g]);s.useLayoutEffect(()=>{var _,O;L.current.sigil!==u&&(L.current={sigil:u});const V=()=>{const I=M.current>0?void 0:L.current.height,K=R(I);b(z=>s6(z,K)?z:K)},B=I=>{Kae(I.target,k.current)&&V()};V();const G=requestAnimationFrame(V);return window.addEventListener("resize",V),window.addEventListener("scroll",B,!0),(_=window.visualViewport)==null||_.addEventListener("resize",V),(O=window.visualViewport)==null||O.addEventListener("scroll",V),()=>{var I,K;cancelAnimationFrame(G),window.removeEventListener("resize",V),window.removeEventListener("scroll",B,!0),(I=window.visualViewport)==null||I.removeEventListener("resize",V),(K=window.visualViewport)==null||K.removeEventListener("scroll",V)}},[e,t,n,g,u,R]),s.useLayoutEffect(()=>{if(!y||!k.current)return;if(i>0){if(L.current.height==null&&L.current.sigil===(u??""))return;L.current={sigil:u??""};const I=R();I&&!s6(y,I)&&b(I);return}const V=k.current,B=S.current,G=B?V.offsetHeight-B.clientHeight:V.offsetHeight,_=Gae(G,(B==null?void 0:B.scrollHeight)??0,Gp);if(!(_>0)||L.current.height===_&&L.current.sigil===(u??""))return;L.current={sigil:u??"",height:_};const O=R(_);!O||s6(y,O)||b(O)},[y,A,R,i,a.length,u]),s.useLayoutEffect(()=>{const V=B=>{B.isComposing||B.keyCode===229||(B.key==="ArrowDown"?(B.preventDefault(),m>=a.length-1?P():w(G=>G+1)):B.key==="ArrowUp"?(B.preventDefault(),w(G=>Math.max(0,G-1))):(B.key==="Enter"||B.key==="Tab")&&a[m]?(B.preventDefault(),a[m].run()):B.key==="Escape"&&(B.preventDefault(),p()))};return window.addEventListener("keydown",V,!0),()=>window.removeEventListener("keydown",V,!0)},[a,m,p,P]),s.useEffect(()=>{const V=S.current,B=V==null?void 0:V.querySelector('[data-active="true"]');V&&B&&qae(V,B)},[m]),s.useEffect(()=>{const V=E.current,B=S.current;if(!V||!B)return;const G=new IntersectionObserver(_=>{B.scrollTop<=0||_.some(O=>O.isIntersecting)&&P()},{root:B,rootMargin:"0px 0px 8px 0px"});return G.observe(V),()=>G.disconnect()},[y,A,P]);const H=a[m]?`${F0}-opt-${m}`:null;if(s.useEffect(()=>(h==null||h(H),()=>h==null?void 0:h(null)),[H,h]),s.useEffect(()=>{const V=B=>{B.target.closest(".sc-cmd")||(U4(B),p())};return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[p]),!y)return null;const D=`${F0}-list`,U=Fae(u);return Br.createPortal(o.jsx("div",{className:"sc-cmd",id:F0,"data-shell":y.shell,style:{left:y.left,top:y.top,width:y.width,maxHeight:y.maxHeight,height:y.side==="above"&&i>0?y.maxHeight:void 0},ref:k,children:o.jsxs("div",{className:"sc-cmd-list",ref:S,role:"listbox","aria-label":U,id:D,children:[a.length?a.map((V,B)=>{var _;const G=B===0||V.group!==((_=a[B-1])==null?void 0:_.group);return o.jsxs("div",{children:[G&&o.jsx(V9,{name:V.group,total:l}),o.jsxs("button",{type:"button",id:`${F0}-opt-${B}`,className:"sc-cmd-row",role:"option","aria-selected":B===m,"data-active":B===m,onMouseEnter:()=>w(B),onMouseDown:O=>U4(O),onClick:()=>V.run(),children:[V.thumb?o.jsx("img",{src:V.thumb,alt:"","data-crop":V.crop}):V.swatch?o.jsx("span",{className:"sc-cmd-swatch",style:{background:V.swatch}}):null,o.jsx(roe,{text:V.label,query:r}),V.hint&&o.jsx("span",{className:"sc-cmd-hint",children:V.hint})]})]},V.key)}):o.jsxs(o.Fragment,{children:[o.jsx(V9,{name:U,total:l}),o.jsx("div",{className:"sc-cmd-empty",children:_ae(u)})]}),i>0&&a.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-cmd-count","aria-live":"polite",children:[a.length," of ",l]}),o.jsx("div",{ref:E,className:"sc-cmd-sentinel","aria-hidden":!0})]})]})}),document.body)}function V9({name:e,total:t}){return o.jsxs("div",{className:"sc-cmd-group",children:[e," ",o.jsx("span",{className:"sc-cmd-n",children:t})]})}function roe({text:e,query:t}){return o.jsx("span",{className:"sc-cmd-label",children:zae(e,t).map(n=>n.hit?o.jsx("b",{children:n.text},`h:${n.text}`):o.jsx("span",{children:n.text},`t:${n.text}`))})}const soe={fragrance:["Fragrance"],footwear:["Footwear"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]},aoe={fragrance:["Fragrance"],footwear:["Footwear","Apparel"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]};function ooe(e,t){if(!t)return!1;const n=soe[t];return!!n&&n.some(r=>e.verticals.includes(r))}function ioe(e,t){if(!t)return!1;const n=aoe[t];return!!n&&n.some(r=>e.suitableCategories.includes(r))}function Z9(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[\u200e\u200f\u061c\u202a-\u202e\u2066-\u2069]/g,"").toLowerCase()}const loe=4;function Ho(e,t){const n=Z9(t).trim().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=Z9(e);return n.every(a=>r.includes(a)||a.length>=loe&&a.endsWith("s")&&r.includes(a.slice(0,-1)))}function Ny(e,t){return{visible:e.slice(0,t),remaining:Math.max(0,e.length-t)}}function mL(e,t){return[...e].sort((n,r)=>Number(t(r))-Number(t(n)))}function gL(e,t){if(e.t==="product"){const n=t.products.find(a=>a.id===e.id)??null,r=n?null:t.demoProducts.find(a=>a.id===e.id)??null;return{kind:"product",product:n,demo:r}}if(e.t==="character"){const n=t.cast.find(a=>a.id===e.id)??null,r=n?null:t.presenters.find(a=>a.id===e.id)??null;return{kind:"presenter",character:n,presenter:r}}if(e.t==="template"){const n=t.scenes.find(r=>r.id===e.id)??null;return{kind:"scene",scene:n,custom:!!n&&"custom"in n&&!!n.custom}}return null}const df={product:"product",presenter:"person",scene:"place"},coe={product:"products",presenter:"people",scene:"places"},hl=48;function uoe(e){return e?e.t==="product"?"product":e.t==="character"?"presenter":e.t==="template"?"scene":null:null}function zu(e){const t=uoe(e);return t||((e==null?void 0:e.t)==="color"?"color":null)}function doe(e){const t=zu(e);return t||((e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.t:null)}function a6(e){return(e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.imageHash:null}const Y0=e=>{const t=(e??"").trim();return t||void 0},z9=e=>(e==null?void 0:e.custom)===!0;function pl(e,t){return e==="product"?[...(t.libraryProducts.length?t.libraryProducts:t.brandProducts).map(r=>{var a,i;return B9(r,"brand",Zm((i=(a=r.shots)==null?void 0:a[0])==null?void 0:i.file,"tile"))}),...t.demoProducts.map(r=>B9(r,"catalog",r.previewUrl??null))]:e==="presenter"?[...t.presenters.map(n=>{const r=ki(n);return{kind:"presenter",id:n.id,label:n.name,full:[n.name,Y0(n.descriptor)].filter(Boolean).join(" · "),sub:Y0(n.descriptor),search:Kp(n),thumb:$n(r.src,"tile"),crop:r.crop,source:z9(n)?"brand":"catalog",recommended:ioe(n,t.productCategory),token:{t:"character",id:n.id}}}),...t.cast.map(n=>{const r=Xw(n);return{kind:"presenter",id:n.id,label:n.name,full:n.name,search:n.name,thumb:$n(r.src,"tile"),crop:r.crop,source:"brand",token:{t:"character",id:n.id}}})]:t.scenes.map(n=>({kind:"scene",id:n.id,label:Cl(n,"card"),full:Cl(n,"tooltip"),sub:Y0(n.lighting),search:Wp(n),thumb:$n(n.previewUrl??null,"tile"),tint:ud(n.previewColor),source:z9(n)?"brand":"catalog",recommended:ooe(n,t.productCategory),token:{t:"template",id:n.id}}))}function B9(e,t,n){return{kind:"product",id:e.id,label:Do(e,"chip"),full:Do(e,"tooltip"),sub:foe(e),search:Ey(e),thumb:n,source:t,token:{t:"product",id:e.id}}}function foe(e){const t=e;return Y0(t.brand)??Y0(t.vendor)}function dd(e,t){const n=t.trim();return n?e.filter(r=>Ho(r.search,n)):e}function U9(e,t,n){return t.source==="brand"?0:e==="scene"?n.has(t.id)?1:t.recommended?2:3:e==="presenter"?t.recommended?1:2:1}function h2(e,t,n){const r=n.currentId?t.find(h=>h.id===n.currentId)??null:null,a=r?t.filter(h=>h.id!==r.id):t,l=[...dd(a,n.query)].sort((h,p)=>U9(e,h,n.bookmarked)-U9(e,p,n.bookmarked)).map(h=>n.bookmarked.has(h.id)?{...h,bookmarked:!0}:h),{visible:u,remaining:f}=Ny(l,n.shown??hl);return{current:r,items:u,remaining:f,total:l.length}}const hoe={$:"product","/":"scene","@":"presenter"},vL={Products:8,People:8,Colors:16,Places:8},wL={$:"Products","/":"Places","@":"People","#":"Colors"};function j0(e){return vL[wL[e??"$"]]}function yL(e){return{key:`${e.kind}:${e.id}`,group:e.kind==="presenter"?"People":e.kind==="scene"?"Places":"Products",label:e.label,hint:e.sub,search:e.search,thumb:e.thumb??void 0,crop:e.crop,token:e.token}}function poe(e,t,n){return h2(e,t,{currentId:null,query:"",bookmarked:n,shown:t.length}).items.map(yL)}function W9(e,t){const{visible:n,remaining:r}=Ny(e,t);return{items:n,remaining:r,total:e.length}}function moe(e,t,n={query:""}){const r=n.query.trim(),a=n.bookmarked??new Set,i=n.shown??vL[wL[e]];if(e==="#"){const h=(t.colors??[]).map(goe),p=r?h.filter(g=>Ho(g.search??g.label,r)):h;return W9(p,i)}const l=hoe[e],u=l==="product"?t.products:l==="presenter"?t.presenters:t.scenes??[],f=r?dd(u,r).map(yL):poe(l,u,a);return W9(f,i)}function goe(e){return{key:`color:${e.hex}`,group:"Colors",label:e.name,hint:e.hex,search:`${e.name} ${e.hex}`,swatch:e.hex,token:{t:"color",hex:e.hex,name:e.name||void 0}}}const voe="(pointer: coarse)";function woe(e){return Nr(la)?o.jsx(Eoe,{...e}):o.jsx(Soe,{...e,onMove:void 0})}function yoe(){return!Nr(voe)}const boe=e=>`Remove ${df[e]}`;function K9(e,t,n){const r={slug:t};return e==="product"?Ea(r,n):e==="presenter"?Ra(r,n):zr(r,n)}function bL({kind:e,currentId:t,candidates:n,brandId:r,brandSlug:a,warning:i,note:l,onPick:u,onRemove:f,onClose:h,onAttachRequest:p,onMove:g,views:m,autoFocusSearch:w}){const[y,b]=s.useState(""),[k,S]=s.useState(!1),E=async O=>{if(!(!m||k)){S(!0);try{await m.onPick(O)}finally{S(!1)}}},[C,A]=s.useState(hl),L=s.useRef(null),T=s.useRef(null),[M,j]=s.useState(0),P=s.useMemo(()=>e==="scene"?new Set(Ci(r)):new Set,[e,r]);s.useEffect(()=>{A(hl),j(0)},[y]);const R=s.useMemo(()=>h2(e,n,{currentId:t,query:y,bookmarked:P,shown:C}),[e,n,t,y,P,C]);s.useLayoutEffect(()=>{var O;w&&((O=L.current)==null||O.focus({preventScroll:!0}))},[w]),s.useEffect(()=>{j(O=>Math.max(0,Math.min(O,R.items.length-1)))},[R.items.length]);const H=s.useCallback(O=>{var K;const I=(K=T.current)==null?void 0:K.querySelectorAll("[data-nav]")[O];I&&(j(O),I.focus({preventScroll:!0}),I.scrollIntoView({block:"nearest"}))},[]),D=s.useCallback(()=>{const O=T.current;return O?Math.max(1,getComputedStyle(O).gridTemplateColumns.split(" ").filter(Boolean).length):1},[]),U=O=>{var q;if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),h("escape");return}const I=O.target===L.current;if(I&&O.key==="ArrowDown"){O.preventDefault(),H(0);return}if(I&&O.key==="Enter"){O.preventDefault(),R.items[0]&&u(R.items[0]);return}if(I)return;const K=D(),z=O.key==="ArrowRight"?1:O.key==="ArrowLeft"?-1:O.key==="ArrowDown"?K:O.key==="ArrowUp"?-K:0;if(z){O.preventDefault();const Z=M+z;Z<0&&z===-K?(q=L.current)==null||q.focus():Z>=0&&Z<R.items.length&&H(Z);return}O.key==="Home"?(O.preventDefault(),H(0)):O.key==="End"&&(O.preventDefault(),H(R.items.length-1))},V=df[e],B=coe[e],G=e==="product",_=!!R.current&&!!m&&m.options.length>1&&!y.trim();return o.jsxs("div",{className:"sc-swap-inner","data-sections":_||void 0,onKeyDown:U,children:[o.jsx("div",{className:"sc-swap-head",children:o.jsxs("span",{className:"sc-swap-search",children:[o.jsx(hd,{size:13}),o.jsx("input",{ref:L,type:"text",value:y,onChange:O=>b(O.target.value),placeholder:`Search ${B}`,"aria-label":`Search ${B}`,autoComplete:"off",spellCheck:!1})]})}),R.current&&!_&&o.jsxs("div",{className:"sc-swap-cur",title:R.current.full,children:[o.jsx(G9,{src:R.current.thumb,tinted:!!R.current.tint,crop:R.current.crop}),o.jsxs("span",{className:"sc-swap-curtext",children:[o.jsx("b",{dir:"auto",children:R.current.label}),R.current.sub&&o.jsx("span",{dir:"auto",children:R.current.sub})]}),o.jsx("a",{className:"sc-swap-open",href:K9(e,a,R.current.id),target:"_blank",rel:"noreferrer",title:`Open this ${V} in a new tab`,"aria-label":`Open ${R.current.label} in a new tab`,children:o.jsx(Ac,{size:14})}),o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]}),o.jsxs("div",{className:"sc-swap-body",children:[_&&R.current&&m&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsx("span",{className:"sc-ap-sec-title",dir:"auto",children:R.current.label}),o.jsxs("a",{className:"sc-ap-sec-act sc-swap-sec-open",href:K9(e,a,R.current.id),target:"_blank",rel:"noreferrer","aria-label":`Open ${R.current.label} in a new tab`,children:["Open",o.jsx(Ac,{size:12})]})]}),o.jsxs("fieldset",{className:"sc-swap-this","aria-label":`${R.current.label}: the picture a shot follows`,"aria-busy":k||void 0,children:[o.jsx(xoe,{views:m.options,on:!m.picked,disabled:k,onPress:()=>void E(null)}),m.options.map(O=>o.jsx(koe,{option:O,on:m.picked===O.view,disabled:k,onPress:()=>void E(m.picked===O.view?null:O)},O.view))]}),o.jsx("div",{className:"sc-ap-sec sc-swap-sec-others",children:o.jsxs("span",{className:"sc-ap-sec-title",children:["Other ",B,o.jsx("span",{className:"sc-ap-sec-n",children:R.total})]})})]}),R.items.length===0&&o.jsx("p",{className:"sc-swap-empty",children:y.trim()?`Nothing matches “${y.trim()}”.`:`No other ${B}.`}),o.jsx("div",{className:"sc-swap-grid",ref:T,role:"listbox","aria-label":`Choose a ${V}`,children:R.items.map((O,I)=>o.jsxs("div",{className:"sc-swap-card",role:"option","aria-selected":!1,"data-nav":I,tabIndex:I===M?0:-1,title:O.full,style:O.tint?{"--tint":O.tint}:void 0,onFocus:()=>j(I),onClick:()=>u(O),onKeyDown:K=>{K.key!=="Enter"&&K.key!==" "||(K.preventDefault(),u(O))},children:[o.jsx(G9,{src:O.thumb,tinted:!!O.tint,crop:O.crop}),o.jsxs("b",{dir:"auto",children:[O.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(eo,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),O.label]}),G&&O.sub&&o.jsx("span",{dir:"auto",children:O.sub}),e==="scene"&&o.jsx(My,{})]},O.id))}),R.remaining>0&&o.jsxs("button",{type:"button",className:"sc-swap-more",onClick:()=>A(O=>O+hl),children:["Show ",Math.min(hl,R.remaining)," more of ",R.total]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[t&&!R.current&&o.jsxs("p",{className:"sc-swap-warn",children:["This ",V," is no longer available."]}),l&&o.jsx("p",{className:"sc-chip-preview-note",children:l}),i&&o.jsx("p",{className:"sc-swap-warn",children:i}),i&&p&&e==="scene"&&o.jsxs("div",{className:"sc-swap-attach",children:[i.includes("product")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Products"),children:"Attach a product"}),i.includes("person")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("People"),children:"Attach a person"})]}),g&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(-1),children:[o.jsx(Lv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(1),children:["Move later ",o.jsx(xa,{size:13})]})]}),f&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:f,children:[o.jsx(Ml,{size:13}),boe(e)]})]})]})}function My(){return o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(mr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Gn,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(jn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]})}function xoe({views:e,on:t,disabled:n,onPress:r}){const a=e.slice(0,4),i=e.length-3;return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"data-whole":"","aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb sc-swap-mosaic","data-count":a.length,children:a.map((l,u)=>o.jsxs("span",{className:"sc-swap-cut","data-more":u===3&&i>0?"":void 0,children:[o.jsx("img",{src:$n(l.thumb,"micro"),alt:"",loading:"lazy"}),u===3&&i>0&&o.jsxs("span",{className:"sc-swap-cut-more",children:["+",i]})]},l.view))}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Whole place"})}),o.jsx(My,{})]})}function koe({option:e,on:t,disabled:n,onPress:r}){return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx("img",{src:$n(e.thumb,"small"),alt:"",loading:"lazy"})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:e.name})}),o.jsx(My,{})]})}function G9({src:e,tinted:t,crop:n}){const[r,a]=s.useState(!1);return s.useEffect(()=>a(!1),[e]),!e||r?o.jsx("span",{className:"sc-swap-thumb sc-swap-thumb-empty",children:o.jsx(Da,{size:18})}):o.jsx("img",{className:"sc-swap-thumb","data-tinted":t||void 0,"data-crop":n,src:e,alt:"",loading:"lazy",onError:()=>a(!0)})}function Soe(e){const{anchor:t,kind:n,onClose:r}=e,a=yoe(),[i,l]=s.useState(null),u=s.useRef(null);return s.useLayoutEffect(()=>{var h,p;const f=()=>{const g=window.visualViewport,m=Ay(t.getBoundingClientRect(),{width:(g==null?void 0:g.width)??window.innerWidth,height:(g==null?void 0:g.height)??window.innerHeight},n==="scene"?{maxHeight:Mae}:void 0);if(!m){r("outside");return}l(m)};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),(h=window.visualViewport)==null||h.addEventListener("resize",f),(p=window.visualViewport)==null||p.addEventListener("scroll",f),()=>{var g,m;window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),(g=window.visualViewport)==null||g.removeEventListener("resize",f),(m=window.visualViewport)==null||m.removeEventListener("scroll",f)}},[t,r]),s.useEffect(()=>{const f=h=>{var g;const p=h.target;(g=u.current)!=null&&g.contains(p)||t.contains(p)||r("outside")};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r,t]),i?Br.createPortal(o.jsx("div",{ref:u,className:"sc-swap","data-kind":n,"data-side":i.side,role:"dialog","aria-label":`Change ${df[n]}`,style:cL(i),children:o.jsx(bL,{...e,autoFocusSearch:a})}),document.body):null}function Eoe(e){const{kind:t,onClose:n}=e,{sheet:r,grip:a}=Td(()=>n("dismiss"));return o.jsx(Rl,{open:!0,onOpenChange:i=>!i&&n("dismiss"),children:o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-shotsheet-scrim"}),o.jsxs($l,{ref:r,className:"sc-shotsheet sc-swapsheet","data-kind":t,"aria-describedby":void 0,onOpenAutoFocus:i=>{var l;i.preventDefault(),(l=r.current)==null||l.focus({preventScroll:!0})},onCloseAutoFocus:i=>i.preventDefault(),onEscapeKeyDown:i=>{i.preventDefault(),n("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...a,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(Tl,{className:"sc-vh",children:["Change ",df[t]]})]}),o.jsx(bL,{...e,autoFocusSearch:!1})]})]})})}const Coe=260;function joe(e){return Nr(la)?o.jsx(Noe,{...e}):o.jsx(Aoe,{...e,onMove:void 0})}function Pu(e,t){const n=e?dr(e):null,r=t?dr(t):null;return!!n&&n===r}function xL({currentHex:e,currentName:t,palette:n,onPick:r,onRemove:a,onClose:i,onMove:l}){const u=s.useMemo(()=>{const S=new Set,E=[],C=L=>{const T=dr(L.hex);!T||S.has(T)||(S.add(T),E.push({...L,hex:T}))},A=e?dr(e):null;A&&!n.some(L=>Pu(L.hex,A))&&C({hex:A,name:t||A,slot:"accent"});for(const L of n)C(L);return E},[n,e,t]),f=s.useRef(null),[h,p]=s.useState(()=>Math.max(0,u.findIndex(S=>Pu(S.hex,e))));s.useEffect(()=>{p(S=>Math.max(0,Math.min(S,Math.max(0,u.length-1))))},[u.length]),s.useLayoutEffect(()=>{var E,C;const S=Math.max(0,u.findIndex(A=>Pu(A.hex,e)));(C=(E=f.current)==null?void 0:E.querySelectorAll("[data-nav]")[S])==null||C.focus({preventScroll:!0})},[]);const g=s.useCallback(S=>{var C;const E=(C=f.current)==null?void 0:C.querySelectorAll("[data-nav]")[S];E&&(p(S),E.focus({preventScroll:!0}))},[]),m=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),i("escape");return}if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const E=h+(S.key==="ArrowDown"?1:-1);E>=0&&E<u.length&&g(E)}},w=S=>r({t:"color",hex:S.hex,name:S.name||void 0}),y=(S,E)=>{const C=u.find(A=>Pu(A.hex,S));r({t:"color",hex:S,name:(C==null?void 0:C.name)||void 0},{live:!0})},b=e?dr(e):null,k=!!b&&!n.some(S=>Pu(S.hex,b));return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:m,children:[o.jsx("div",{className:"sc-swap-body",children:u.length===0?o.jsx("p",{className:"sc-swap-empty",children:"No brand colours yet."}):o.jsx("div",{className:"sc-swap-swatches",ref:f,role:"listbox","aria-label":"Choose a colour",children:u.map((S,E)=>{const C=Pu(S.hex,e),A=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-swap-dot",style:{background:S.hex},"aria-hidden":!0}),o.jsx("b",{dir:"auto",children:S.name}),o.jsx("span",{children:S.hex}),C&&o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]});return k&&C?o.jsx(xd,{className:"sc-swap-swatch",triggerStyle:{background:"none"},value:S.hex,presets:n.map(L=>L.hex),commitMode:"live",align:"start",label:`Edit ${S.name}`,triggerProps:{role:"option","aria-selected":!0,"data-on":"","data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E)},onChange:L=>y(L),children:A},"current-custom"):o.jsx("div",{className:"sc-swap-swatch",role:"option","aria-selected":C,"data-on":C||void 0,"data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E),onClick:()=>w(S),onKeyDown:L=>{L.key!=="Enter"&&L.key!==" "||(L.preventDefault(),w(S))},children:A},S.hex)})})}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs(xd,{className:"sc-swap-swatch sc-swap-custom",triggerStyle:{background:"none"},value:e??r2(n),presets:n.map(S=>S.hex),commitMode:"live",align:"start",label:"Custom colour",onChange:S=>y(S),children:[o.jsx(mr,{size:12}),o.jsx("b",{children:"Custom colour"})]}),l&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(-1),children:[o.jsx(Lv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(1),children:["Move later ",o.jsx(xa,{size:13})]})]}),a&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:a,children:[o.jsx(Ml,{size:13}),"Remove colour"]})]})]})}function Aoe(e){const{anchor:t,onClose:n}=e,[r,a]=s.useState(null),i=s.useRef(null);return s.useLayoutEffect(()=>{var u,f;const l=()=>{const h=window.visualViewport,p=Ay(t.getBoundingClientRect(),{width:(h==null?void 0:h.width)??window.innerWidth,height:(h==null?void 0:h.height)??window.innerHeight},{width:Coe});if(!p){n("outside");return}a(p)};return l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),(u=window.visualViewport)==null||u.addEventListener("resize",l),(f=window.visualViewport)==null||f.addEventListener("scroll",l),()=>{var h,p;window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),(h=window.visualViewport)==null||h.removeEventListener("resize",l),(p=window.visualViewport)==null||p.removeEventListener("scroll",l)}},[t,n]),s.useEffect(()=>{const l=u=>{var h,p;const f=u.target;(h=i.current)!=null&&h.contains(f)||t.contains(f)||(p=f.closest)!=null&&p.call(f,".sc-cp")||n("outside")};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n,t]),r?Br.createPortal(o.jsx("div",{ref:i,className:"sc-swap","data-kind":"color","data-side":r.side,role:"dialog","aria-label":"Change colour",style:cL(r),children:o.jsx(xL,{...e})}),document.body):null}function Noe(e){const{onClose:t}=e,{sheet:n,grip:r}=Td(()=>t("dismiss"));return o.jsx(Rl,{open:!0,onOpenChange:a=>!a&&t("dismiss"),children:o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-shotsheet-scrim"}),o.jsxs($l,{ref:n,className:"sc-shotsheet sc-swapsheet","data-kind":"color","aria-describedby":void 0,onOpenAutoFocus:a=>{var i;a.preventDefault(),(i=n.current)==null||i.focus({preventScroll:!0})},onCloseAutoFocus:a=>a.preventDefault(),onEscapeKeyDown:a=>{a.preventDefault(),t("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...r,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(Tl,{className:"sc-vh",children:"Change colour"})]}),o.jsx(xL,{...e})]})]})})}function ff(e){const{brand:t,products:n}=cn(),{scenes:r,presenters:a,demoProducts:i}=Mn(),l=s.useMemo(()=>Tp(Qc(t),r),[t,r]),u=s.useMemo(()=>Tp(sf(t),a),[t,a]),f=s.useMemo(()=>{var p;return(((p=t==null?void 0:t.json)==null?void 0:p.characters)??[]).filter(g=>(g==null?void 0:g.origin)!=="custom")},[t]),h=s.useMemo(()=>{var p;return p1(((p=t==null?void 0:t.json)==null?void 0:p.products)??[])},[t]);return s.useMemo(()=>({libraryProducts:iR(n),brandProducts:h,demoProducts:i,presenters:u,cast:f,scenes:l,productCategory:e??null}),[n,h,i,u,f,l,e])}const A0=new Map,Moe=64;function kL(e){let t=A0.get(e);if(!t)for(t=Poe(e).then(n=>n?Loe(n.data,4):null).catch(()=>null),A0.set(e,t);A0.size>Moe;)A0.delete(A0.keys().next().value);return t}function Roe(e,t){kL(t).then(n=>{const r=ud(n??void 0);!r||!e.isConnected||(e.dataset.tinted="true",e.style.setProperty("--tint",r))})}async function Poe(e){const t=new Image;t.decoding="async",t.src=e;try{await t.decode()}catch{return null}const n=Math.min(1,48/Math.max(t.naturalWidth,t.naturalHeight,1)),r=Math.max(1,Math.round(t.naturalWidth*n)),a=Math.max(1,Math.round(t.naturalHeight*n)),i=document.createElement("canvas");i.width=r,i.height=a;const l=i.getContext("2d",{willReadFrequently:!0});if(!l)return null;l.drawImage(t,0,0,r,a);try{return l.getImageData(0,0,r,a)}catch{return null}}function Loe(e,t){const n=Array.from({length:24},()=>({score:0,r:0,g:0,b:0}));for(let a=0;a+t-1<e.length;a+=t){if(e[a+3]<128)continue;const i=e[a],l=e[a+1],u=e[a+2],{h:f,s:h,l:p}=$oe(i,l,u);if(h<.18||p<.12||p>.92)continue;const g=h*(1-Math.abs(p-.5)*1.2),m=n[Math.min(23,Math.floor(f/360*24))];m.score+=g,m.r+=i*g,m.g+=l*g,m.b+=u*g}const r=n.reduce((a,i)=>i.score>a.score?i:a,n[0]);return r.score<=0?null:Toe(r.r/r.score,r.g/r.score,r.b/r.score)}function $oe(e,t,n){const r=e/255,a=t/255,i=n/255,l=Math.max(r,a,i),u=Math.min(r,a,i),f=(l+u)/2;if(l===u)return{h:0,s:0,l:f};const h=l-u,p=f>.5?h/(2-l-u):h/(l+u);let g;return l===r?g=((a-i)/h+(a<i?6:0))*60:l===a?g=((i-r)/h+2)*60:g=((r-a)/h+4)*60,{h:g,s:p,l:f}}function Toe(e,t,n){const r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function p2(e){const{libraryTick:t}=Mn(),n=s.useRef(t),r=s.useRef(e);r.current=e,s.useEffect(()=>{t!==n.current&&(n.current=t,r.current())},[t])}const Y9=["hero","place","close","hands","angle","bold"],q9=e=>[...e].sort((t,n)=>Y9.indexOf(t.view)-Y9.indexOf(n.view));function Doe(e){const t=e&&e.custom?e:null,n=e&&!t?e.id:null,[r,a]=s.useState(null);if(s.useEffect(()=>{if(!n)return;let i=!0;return Ee.sceneFrames(n).then(l=>{if(!i)return;const u=l.views.map(f=>({view:f.view,name:dl[f.view],thumb:f.url,hash:null}));a({id:n,views:u})}).catch(()=>{}),()=>{i=!1}},[n]),p2(()=>{if(!n)return;const i=n;Ee.sceneFrames(i).then(l=>{const u=l.views.map(f=>({view:f.view,name:dl[f.view],thumb:f.url,hash:null}));a(f=>f&&f.id!==i?f:xi(f,{id:i,views:u}))}).catch(()=>{})}),t){const i=[];t.placeUrl&&t.previewHash&&i.push({view:"place",name:dl.place,thumb:t.placeUrl,hash:t.previewHash});for(const l of t.examples??[])i.push({view:l.role,name:dl[l.role],thumb:l.url,hash:l.hash});return q9(i)}return r&&r.id===n?q9(r.views):[]}function Hoe(e){return!e||e.cap==null||e.cap<=0?null:e.cap}function Ooe(e){const t=new Set;if(!e||e.cap==null||e.cap<=0)return t;const n=new Set(e.attachments.map(r=>wc(r.role,r.id??r.hash)));for(const r of e.dropped){const a=wc(r.role,r.id??r.hash);r.reason!=="missing"&&!n.has(a)&&t.add(a)}return t}const wc=(e,t)=>`${e}:${t}`,_0=new Set(["product","character","ref","mark","template"]),Yp=12,J4=`Shot is full: ${Yp} identities. Remove one to add another.`,Yr=[{id:"square",label:"Square",hint:"1:1",w:1024,h:1024},{id:"portrait",label:"Portrait",hint:"4:5",w:1024,h:1280},{id:"story",label:"Story",hint:"9:16",w:1080,h:1920},{id:"landscape",label:"Landscape",hint:"16:9",w:1600,h:900}];function gi(e){const t=Yr.find(n=>n.id===e);return t?t.w/t.h:1}function Ioe(e,t=0){var i,l;const n=Yr.find(u=>u.id===(e==null?void 0:e.format));if(n)return n.id;const r=(l=(i=e==null?void 0:e.rendered)==null?void 0:i.sizes)==null?void 0:l[t];if(!r||!(r[0]>0)||!(r[1]>0))return;const a=Math.log(r[0]/r[1]);return Yr.reduce((u,f)=>Math.abs(Math.log(f.w/f.h)-a)<Math.abs(Math.log(u.w/u.h)-a)?f:u).id}const _h=6,Foe=s.forwardRef(function({initialTokens:t,onChange:n,brand:r,templates:a,presenters:i,demoProducts:l,onTemplatePick:u,scenesSitOut:f,placeholder:h,placeholderSm:p,label:g="Brief",flag:m,described:w,describedNote:y,onInspect:b,activeProductCategory:k,onAttachRequest:S,onSubmit:E,onDropFiles:C},A){var Lt,Ut,Nt,_t,Me,Ze,Qe;const L=s.useRef(null),T=s.useRef(null),M=s.useId(),[j,P]=s.useState(""),R=s.useCallback(F=>{P(""),requestAnimationFrame(()=>P(F))},[]),H=s.useRef(null),[D,U]=s.useState(null),[V,B]=s.useState(null),G=Fd(),{shown:_,closeNow:O}=G,I=s.useRef(V);s.useEffect(()=>{I.current=V},[V]);const K=s.useRef(m);s.useEffect(()=>{K.current=m},[m]);const[z,q]=s.useState(""),[Z,ee]=s.useState(j0("$")),[he,ue]=s.useState(null),ge=s.useRef(!1),te=s.useRef(0),[J,Q]=s.useState(!1),ae=s.useRef(0),{products:$e}=cn(),ie=$e.length?$e:((Lt=r.json)==null?void 0:Lt.products)??[],ke=((Ut=r.json)==null?void 0:Ut.characters)??[],ze=s.useMemo(()=>rf(r.json),[r]),wt=s.useCallback((F,de)=>{var Qn,un,gr;const we=document.createElement("span");we.className=mc,we.contentEditable="false",we.dir="ltr",we.dataset.kind=F.t,we.dataset.tok=o2(F),we.dataset.uid=de??`u${te.current++}`;let We="",Le=null,ct,Ot=null;const zt=gL(F,{products:ie,demoProducts:l,cast:ke,presenters:i,scenes:a});if((zt==null?void 0:zt.kind)==="scene"){const Kt=zt.scene;We=Kt?Cl(Kt,"chip"):"missing place",Le=$n((Kt==null?void 0:Kt.previewUrl)??null,"micro"),Kt&&F.t==="template"&&F.view&&(Le=gn(F.view,"micro"),F.viewName&&(We=`${We} · ${C4(F.viewName)}`));const wr=ud(Kt==null?void 0:Kt.previewColor);wr&&(we.dataset.tinted="true",we.style.setProperty("--tint",wr)),!wr&&Le&&zt.custom&&Roe(we,Le)}else if((zt==null?void 0:zt.kind)==="product"){const Kt=zt.product??zt.demo;We=Kt?Do(Kt,"chip"):"missing product",Le=zt.product?Zm((un=(Qn=zt.product.shots)==null?void 0:Qn[0])==null?void 0:un.file,"micro"):$n(((gr=zt.demo)==null?void 0:gr.previewUrl)??null,"micro")}else if((zt==null?void 0:zt.kind)==="presenter"){const{character:Kt,presenter:wr}=zt;We=(Kt==null?void 0:Kt.name)??(wr==null?void 0:wr.name)??"missing person";const Hr=Kt?Xw(Kt):wr?ki(wr):{src:null};Le=$n(Hr.src,"micro"),ct=Hr.crop}else if(F.t==="color")We=F.name??F.hex,Ot=F.hex;else if(F.t==="ref")We=F.label??"Image",Le=gn(F.imageHash,"micro");else if(F.t==="mark"){const Kt=ze.find(wr=>wr.hash===F.imageHash);We=Kt?Xm(r.json,Kt):"missing mark",Le=gn(F.imageHash,"micro")}if(We.startsWith("missing ")&&(we.dataset.missing=""),Le){const Kt=document.createElement("img");Kt.src=Le,Kt.alt="",ct&&(Kt.dataset.crop=ct),Kt.onerror=()=>Kt.remove(),we.appendChild(Kt)}else if(Ot){const Kt=document.createElement("span");Kt.className="sc-token-swatch",Kt.style.background=Ot,we.appendChild(Kt)}const Rt=document.createElement("span");Rt.className="sc-token-label",Rt.dir="auto",Rt.textContent=We,we.appendChild(Rt);const kn=(m==null?void 0:m(F))??null;kn&&(we.title=kn,F.t!=="template"&&(we.dataset.warn="1")),w!=null&&w(F)&&(we.dataset.described="1");const Jt=zu(F);if(Jt){const Kt=Jt==="color"?"colour":df[Jt];we.tabIndex=-1,we.setAttribute("role","button"),we.setAttribute("aria-haspopup","dialog"),we.setAttribute("aria-expanded","false"),we.setAttribute("aria-label",`${Kt}: ${We}. Change or remove.`)}else we.tabIndex=-1,we.setAttribute("role","button"),we.setAttribute("aria-haspopup","dialog"),we.setAttribute("aria-expanded","false"),we.setAttribute("aria-label",`${F.t==="mark"?"brand mark":"reference image"}: ${We}. Open, remove or move.`);we.setAttribute("aria-keyshortcuts","Alt+ArrowLeft Alt+ArrowRight"),we.setAttribute("aria-describedby",M),we.setAttribute("draggable","false");const Sn=document.createElement("button");return Sn.type="button",Sn.tabIndex=-1,Sn.setAttribute("aria-hidden","true"),Sn.dataset.role="remove",Sn.appendChild(one()),we.appendChild(Sn),we},[a,ie,ke,i,l,ze,r,m,w,M]),Ke=s.useCallback(()=>{const F=L.current;F&&n(Tk(F))},[n]);s.useEffect(()=>{const F=L.current;F&&(Dk(F,t!=null&&t.length?t:ti(),de=>wt(de)),O0(F))},[]);const tt=s.useCallback((F,de)=>{var Le;const we=L.current,We=we==null?void 0:we.querySelector(`[data-uid="${CSS.escape(F)}"]`);if(we&&We&&Fk(we,We,de)){xc(we,We,"after");const ct=ko(we);ct!==null&&(H.current=ct,((Le=I.current)==null?void 0:Le.uid)===F&&(I.current={...I.current,caret:ct}),B(Ot=>Ot&&Ot.uid===F?{...Ot,caret:ct}:Ot)),Ke(),R(B4(we,We))}},[Ke,R]);s.useEffect(()=>{const F=L.current;if(F)return Cae(F,{onDragStart:()=>{U(null),q(""),O()},onMoved:(de,we)=>{Ke(),R(we)},onCancelled:()=>R("Reorder cancelled.")})},[Ke,R,O]),s.useEffect(()=>{const F=L.current;if(F)for(const de of F.querySelectorAll(`.${mc}`)){const we=ks(de.dataset.tok??"");if(!we)continue;const We=(m==null?void 0:m(we))??null;We&&we.t!=="template"?de.dataset.warn="1":delete de.dataset.warn,w!=null&&w(we)?de.dataset.described="1":delete de.dataset.described,We&&!("open"in de.dataset)?de.title=We:de.removeAttribute("title")}},[m,w]),s.useEffect(()=>{const F=()=>{const de=ko(L.current);de!==null&&(H.current=de)};return document.addEventListener("selectionchange",F),()=>document.removeEventListener("selectionchange",F)},[]);const De=s.useCallback(F=>{const de=L.current;if(!de)return;if(F.t==="template"){const ct=b0(de);if(ct){ct.replaceWith(wt(F,ct.dataset.uid)),Eo(de),Ke(),U(null),q("");return}}const we=Ja(F);if(we){const ct=V8(de,we);if(ct){U(null),q(""),R(`${ni(ct)||"That"} is already in the brief.`);return}}if(_0.has(F.t)&&!(F.t==="template"&&b0(de))&&Array.from(de.querySelectorAll(`.${mc}`)).filter(Ot=>_0.has(Ot.dataset.kind??"")).length>=Yp){U(null),q(""),R(J4);return}Fte(de,wt(F),{eatQuery:!!D,fallbackUnits:H.current});const Le=ko(de);Le!==null&&(H.current=Le),Ke(),U(null),q("")},[D,wt,Ke,R]),Se=s.useRef(De);s.useEffect(()=>{Se.current=De},[De]);const X=s.useCallback((F,de)=>{const we=L.current,We=we==null?void 0:we.querySelector(`[data-uid="${CSS.escape(F)}"]`);return!we||!We?!1:(We.replaceWith(wt(de,F)),Eo(we),Ke(),!0)},[wt,Ke]),je=s.useCallback(F=>{const de=L.current,we=de==null?void 0:de.querySelector(`[data-uid="${CSS.escape(F)}"]`);if(!de||!we)return null;const We=so(de,we);return Z8(de,we),Ke(),We},[Ke]),Re=()=>{var F;return document.documentElement.dataset.guideTask==="first-shot"&&!!((F=L.current)!=null&&F.closest('[data-guide="compose"]'))},re=(F,de)=>{var ct;const we=[...F.querySelectorAll(".sc-token")];if(!we.length)return!1;const[We]=((ct=de.getTargetRanges)==null?void 0:ct.call(de))??[];if(!We)return!1;const Le=document.createRange();return Le.setStart(We.startContainer,We.startOffset),Le.setEnd(We.endContainer,We.endOffset),we.some(Ot=>Le.intersectsNode(Ot))},Y=s.useRef(je);s.useEffect(()=>{Y.current=je},[je]),s.useEffect(()=>{const F=L.current;if(!F)return;const de=we=>{if(we.inputType.startsWith("delete")&&Re()&&re(F,we))return we.preventDefault();const We=we.inputType==="deleteContentBackward"?"Backspace":we.inputType==="deleteContentForward"?"Delete":null;if(!We)return;const Le=Ok(F,We);if(!(Le!=null&&Le.dataset.uid)){Ik(F,We)&&we.preventDefault();return}we.preventDefault();const ct=Y.current(Le.dataset.uid);ct!=null&&Ga(F,ct)};return F.addEventListener("beforeinput",de),()=>F.removeEventListener("beforeinput",de)},[]);const se=s.useCallback(F=>{const de=ks(F.dataset.tok??"");if(!de||de.t!=="ref"&&de.t!=="mark")return!1;const we=L.current,We=we?ko(we):null;return We!=null&&(H.current=We),O(),b==null||b({src:Tr(de.imageHash),kind:de.t,label:de.t==="mark"?ni(F):null}),!0},[b,O]),Ne=s.useCallback((F,de,we,We)=>{const Le=F.dataset.uid;Le&&(O(),F.dataset.open="",F.hasAttribute("aria-haspopup")&&F.setAttribute("aria-expanded","true"),F.removeAttribute("title"),U(null),q(""),B({uid:Le,kind:de,anchor:F,caret:we,touch:We}))},[O]),Be=s.useCallback((F,de)=>{var Ot;const we=I.current;if(I.current=null,B(null),!we)return;const We=L.current,Le=We==null?void 0:We.querySelector(`[data-uid="${CSS.escape(we.uid)}"]`);if(Le){delete Le.dataset.open,Le.hasAttribute("aria-haspopup")&&Le.setAttribute("aria-expanded","false");const zt=ks(Le.dataset.tok??""),Rt=zt?((Ot=K.current)==null?void 0:Ot.call(K,zt))??null:null;Rt&&(Le.title=Rt)}const ct=de!==void 0?de:we.caret;if(we.touch){ct!=null&&(H.current=ct);return}We&&(We.focus({preventScroll:!0}),ct!=null?Ga(We,ct):gc(We))},[]);s.useEffect(()=>{if(!V)return;const F=L.current;F!=null&&F.querySelector(`[data-uid="${CSS.escape(V.uid)}"]`)||Be("outside")},[V,Be]),s.useEffect(()=>{var F;_&&((F=L.current)!=null&&F.contains(_.anchor)||O())},[_,O]),s.useEffect(()=>{const F=_==null?void 0:_.anchor;if(!F)return;F.dataset.open="";const de=F.getAttribute("title");return de&&F.removeAttribute("title"),()=>{delete F.dataset.open,de&&F.setAttribute("title",de)}},[_]),s.useImperativeHandle(A,()=>({insert:F=>Se.current(F),setTokens:F=>{const de=L.current;de&&(Dk(de,F.length?F:ti(),we=>wt(we)),O0(de),n(Tk(de)))},removeTemplate:()=>{const F=L.current,de=F?b0(F):null;!F||!de||(Z8(F,de),Ke())},remove:F=>{const de=L.current;if(!de)return;const we=V8(de,Ja(F));we&&(Z8(de,we),Ke())},openMenu:F=>{q(""),ee(j0("$")),U({anchor:F})},focus:()=>gc(L.current),restoreCaret:()=>{const F=L.current;if(!F)return;F.focus({preventScroll:!0});const de=H.current;de!=null?Ga(F,de):gc(F)}}));const st=ff(k),Pe=s.useCallback(F=>pl(F,st),[st]),Oe=s.useMemo(()=>new Set(Ci(r.id)),[r.id]),Ge=s.useMemo(()=>{var F;return D?moe(D.sigil??"$",{products:pl("product",st),presenters:pl("presenter",st),scenes:f?[]:pl("scene",st),colors:ra((F=r.json)==null?void 0:F.palette)},{query:z,bookmarked:Oe,shown:Z}):{items:[],remaining:0,total:0}},[D,st,z,Oe,Z,f,(Nt=r.json)==null?void 0:Nt.palette]),ft=s.useMemo(()=>Ge.items.map(F=>({...F,run:()=>F.token.t==="template"?u(F.token.id):Se.current(F.token)})),[Ge.items,u]),bt=s.useCallback(()=>{Ge.remaining<=0||ee(F=>F+j0(D==null?void 0:D.sigil))},[Ge.remaining,D==null?void 0:D.sigil]),at=F=>{const de=L.current,we=F.target;if(we.closest('[data-role="remove"]')){if(F.preventDefault(),Re())return;const Rt=nl(we);V&&(Rt==null?void 0:Rt.dataset.uid)===V.uid&&Be("remove"),Rt!=null&&Rt.dataset.uid&&je(Rt.dataset.uid),U(null);return}const We=nl(we),Le=We==null?void 0:We.getBoundingClientRect();if(!(!!We&&!!Le&&F.clientX-Le.left>_h&&Le.right-F.clientX>_h)){if(Tte(de))return;Hk(de,F.clientX,F.clientY);return}Hk(de,F.clientX,F.clientY);const Ot=We.dataset.uid??null;if(Ot&&(V==null?void 0:V.uid)===Ot){F.detail!==0&&Be("outside");return}const zt=zu(ks(We.dataset.tok??""));if(!zt){se(We);return}Ne(We,zt,ko(de),!1)},Zt=F=>{if(F.pointerType!=="mouse")return;const de=L.current;if(V||D||de&&"chipDrag"in de.dataset)return;const we=nl(F.target),We=we==null?void 0:we.dataset.uid;if(!we||!We||!jt(we)){G.close();return}if((_==null?void 0:_.uid)===We){G.keep();return}G.open({uid:We,anchor:we})},jt=F=>{const de=ks(F.dataset.tok??"");if(a6(de))return!0;const we=zu(de);return!!(we&&we!=="color"&&hp(we)&&F.querySelector("img"))},Ft=F=>{const de=nl(F.target),we=de==null?void 0:de.dataset.uid;!de||!we||V||D||jt(de)&&Qm(de)&&G.open({uid:we,anchor:de})},Pt=F=>{if(F.pointerType==="mouse")return;const de=F.target;if(de.closest('[data-role="remove"]'))return;const we=nl(de);if(!we)return;const We=we.getBoundingClientRect();if(F.clientX-We.left<=_h||We.right-F.clientX<=_h)return;const Le=doe(ks(we.dataset.tok??""));if(!Le||we.dataset.uid&&(V==null?void 0:V.uid)===we.dataset.uid)return;F.preventDefault();const ct=L.current,Ot=document.activeElement===ct,zt=Ot?ko(ct):H.current;Ot&&(ct==null||ct.blur()),Ne(we,Le,zt,!0)},Tt=F=>{const de=L.current,we=nl(F.target);if(we&&!V){const We=()=>{xc(de,we,"after"),de==null||de.focus({preventScroll:!0})};if(F.altKey&&(F.key==="ArrowLeft"||F.key==="ArrowRight")){F.preventDefault(),de&&Fk(de,we,F.key==="ArrowLeft"?-1:1)&&(we.focus({preventScroll:!0}),Ke(),R(B4(de,we)));return}if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.preventDefault(),xc(de,we,F.key==="ArrowLeft"?"before":"after"),de==null||de.focus({preventScroll:!0});return}if(F.key==="Tab"){F.preventDefault(),xc(de,we,F.shiftKey?"before":"after"),de==null||de.focus({preventScroll:!0});return}if(F.key==="Enter"||F.key===" "){F.preventDefault();const Le=zu(ks(we.dataset.tok??""));Le&&de?Ne(we,Le,so(de,we)+1,!1):se(we);return}if(F.key==="Backspace"||F.key==="Delete"){if(F.preventDefault(),Re())return;const Le=we.dataset.uid?je(we.dataset.uid):null;de==null||de.focus({preventScroll:!0}),Le!=null&&Ga(de,Le);return}if(F.key==="Escape"){F.preventDefault(),We();return}}if(F.key==="Escape"&&D){F.preventDefault(),U(null),q("");return}if(F.key==="Enter"&&!F.shiftKey){const We=F.defaultPrevented;F.preventDefault(),Vae({menuOpen:!!D,handled:We})&&E();return}if(!(D||V)&&!Iae(F)){if(F.key==="Tab"&&!F.altKey&&!F.metaKey&&!F.ctrlKey){const We=Ute(de,F.shiftKey?"back":"forward");We&&(F.preventDefault(),We.focus({preventScroll:!0}));return}if(!F.shiftKey&&!F.altKey&&!F.metaKey&&!F.ctrlKey){if(F.key==="ArrowLeft"||F.key==="ArrowRight"){Bte(de,F.key==="ArrowLeft"?"left":"right")&&F.preventDefault();return}if(F.key==="Backspace"||F.key==="Delete"){const We=Ok(de,F.key);if(We!=null&&We.dataset.uid){if(F.preventDefault(),Re())return;const Le=je(We.dataset.uid);Le!=null&&Ga(de,Le);return}if(Ik(de,F.key)){F.preventDefault();return}}}if((F.key==="$"||F.key==="/"||F.key==="@"||F.key==="#")&&!Re()){const We=L.current,Le=lP(We),ct=Le.slice(-1);if(Le.length&&!/[\s\u00a0]/.test(ct))return;q(""),ee(j0(F.key)),U({anchor:{getBoundingClientRect:()=>cP()??(We==null?void 0:We.getBoundingClientRect())??new DOMRect},sigil:F.key})}}},xe=s.useCallback(F=>{var de,we;return(we=ra((de=r.json)==null?void 0:de.palette).find(We=>We.hex===F))==null?void 0:we.name},[(_t=r.json)==null?void 0:_t.palette]),Je=s.useCallback(()=>{requestAnimationFrame(()=>{const F=T.current;if(!F)return;F.scrollHeight-F.scrollTop-F.clientHeight>1?F.dataset.more="":delete F.dataset.more})},[]);s.useEffect(()=>{const F=T.current;if(!F)return;Je();const de=new ResizeObserver(Je);de.observe(F);for(const we of F.children)de.observe(we);return()=>de.disconnect()},[Je]);const Et=F=>{Je();const de=L.current,we=F==null?void 0:F.nativeEvent;if(we!=null&&we.isComposing)return;Dte(de)||Eo(de),O0(de)&&gc(de);const We=ge.current;ge.current=!1;const Le=z8(de,Ot=>wt(Ot),{commit:We,nameFor:xe});Le&&(U(null),q(""));const ct=Le?{open:!1}:Zae(Zte(de),We);ct.open?D&&(ct.query!==z&&ee(j0(ct.sigil)),q(ct.query)):D&&(U(null),q("")),Ke()},Xe=F=>{const de=window.getSelection();if(!de||de.rangeCount===0||de.isCollapsed)return null;const we=de.getRangeAt(0),{text:We,html:Le}=Wte(we);return We?(F.clipboardData.setData("text/plain",We),F.clipboardData.setData("text/html",Le),F.preventDefault(),we):null},rt=F=>{Xe(F)},nt=F=>{const de=Xe(F);de&&(de.deleteContents(),Eo(L.current),Ke())},qt=s.useCallback(F=>F.t==="template"?a.some(de=>de.id===F.id):F.t==="product"?ie.some(de=>de.id===F.id)||l.some(de=>de.id===F.id):F.t==="character"?ke.some(de=>de.id===F.id)||i.some(de=>de.id===F.id):F.t==="mark"?ze.some(de=>de.hash===F.imageHash):!0,[a,ie,ke,i,l,ze]);s.useEffect(()=>{const F=L.current;if(F)for(const de of F.querySelectorAll(`.${mc}[data-missing]`)){const we=ks(de.dataset.tok??"");we&&qt(we)&&de.replaceWith(wt(we,de.dataset.uid))}},[qt,wt]);const Yt=F=>{Array.from(F.dataTransfer.types).includes("Files")&&(F.preventDefault(),ae.current++,Q(!0))},an=F=>F.preventDefault(),Wt=()=>{ae.current=Math.max(0,ae.current-1),ae.current===0&&Q(!1)},Rn=F=>{F.preventDefault(),ae.current=0,Q(!1),F.dataTransfer.files.length&&(C==null||C(F.dataTransfer.files))},Bt=F=>{F.preventDefault();const de=F.clipboardData.files;if(de.length&&Array.from(de).some(Le=>Le.type.startsWith("image/"))){C==null||C(de);return}ge.current=!0;const we=Gte(F.clipboardData.getData("text/html"));if(we&&ne(we)){const Le=L.current;z8(Le,ct=>wt(ct),{commit:!0,nameFor:xe})&&Ke();return}const We=F.clipboardData.getData("text/plain");We&&document.execCommand("insertText",!1,We)},ne=F=>{const de=L.current,we=window.getSelection();if(!de||!we||we.rangeCount===0||!de.contains(we.getRangeAt(0).startContainer))return!1;const We=we.getRangeAt(0);We.deleteContents();let Le=!1,ct=Array.from(de.querySelectorAll(`.${mc}`)).filter(un=>_0.has(un.dataset.kind??"")).length,Ot=!1;const zt=new Set,Rt=[];for(const un of F){if(typeof un=="string"){Rt.push(un);continue}if(!qt(un)){Rt.push(Zoe(un,a,ie));continue}if(un.t==="template"){if(Le)continue;Le=!0}const gr=Ja(un);if(gr){if(zt.has(gr)||V8(de,gr))continue;zt.add(gr)}if(_0.has(un.t)&&!(un.t==="template"&&b0(de))){if(ct>=Yp){Ot=!0;continue}ct+=1}Rt.push(un)}Ot&&R(J4);const kn=Le?b0(de):null,Jt=document.createDocumentFragment();for(const un of Rt)Jt.appendChild(typeof un=="string"?document.createTextNode(un):wt(un));const Sn=Jt.lastChild;We.insertNode(Jt),kn&&kn.remove();const Qn=Sn?Sn.nodeType===Node.TEXT_NODE?Fp(de,Sn,Sn.length):Fp(de,de,Array.from(de.childNodes).indexOf(Sn)+1):ko(de)??0;return Eo(de),Ga(de,Qn),Ke(),!0},le=s.useCallback(()=>{requestAnimationFrame(()=>{const F=L.current;F&&document.activeElement===F&&O0(F)&&gc(F)})},[]),ce=V?ks(V.anchor.dataset.tok??""):null,Ve=a6(ce),_e=(V==null?void 0:V.kind)==="scene"&&(ce==null?void 0:ce.t)==="template"?a.find(F=>F.id===ce.id)??null:null,xt=Doe(_e),yt=(ce==null?void 0:ce.t)==="template"&&ce.view?((Me=xt.find(F=>F.hash===ce.view)??xt.find(F=>!!ce.viewName&&F.name===C4(ce.viewName)))==null?void 0:Me.view)??null:null,kt=async F=>{if(!V||(ce==null?void 0:ce.t)!=="template")return;const{uid:de}=V,{id:we,setup:We}=ce;let Le=(F==null?void 0:F.hash)??null;if(F&&!Le)try{Le=(await Ee.pickSceneView(we,F.view)).hash}catch{return}X(de,{t:"template",id:we,...We?{setup:We}:{},...F&&Le?{view:Le,viewName:F.name}:{}}),Be("pick")},ot=ce?(m==null?void 0:m(ce))??null:null,ht=ce&&(w!=null&&w(ce))?y??null:null,Ae=_?ks(_.anchor.dataset.tok??""):null,me=a6(Ae),et=((Ze=_==null?void 0:_.anchor.querySelector("img"))==null?void 0:Ze.getAttribute("src"))??null,Ct=me?gn(me,"tile"):$n(et,"tile"),be=zu(Ae),it=Ae&&hp(Ae.t)?Ae.t:be&&be!=="color"&&hp(be)?be:null,vt=Ae?(m==null?void 0:m(Ae))??null:null,Te=Ae&&(w!=null&&w(Ae))?y??null:null,qe=Re()?void 0:()=>{if(!V)return;const F=je(V.uid);Be("remove",F)};return o.jsxs("div",{className:"sc-brief",ref:T,onScroll:Je,"data-drag-over":J||void 0,children:[o.jsx("span",{id:M,className:"sc-vh",children:"Press Enter to open, Delete to remove, Alt plus arrow keys to move."}),o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:j}),o.jsx("div",{ref:L,className:"sc-brief-line",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-autocomplete":"list","aria-expanded":D?!0:void 0,"aria-controls":D?F0:void 0,"aria-activedescendant":D?he??void 0:void 0,"aria-label":g,"aria-placeholder":h,tabIndex:0,dir:"auto","data-ph":h,...p?{"data-ph-sm":p}:{},onClick:at,onPointerDown:Pt,onPointerOver:Zt,onPointerLeave:F=>F.pointerType==="mouse"&&G.close(),onFocusCapture:Ft,onKeyDown:Tt,onInput:Et,onCopy:rt,onCut:nt,onPaste:Bt,onDragEnter:Yt,onDragOver:an,onDragLeave:Wt,onDrop:Rn,onFocus:le,onBlur:()=>{const F=L.current;z8(F,de=>wt(de),{commit:!0,nameFor:xe})&&(U(null),q("")),Ke()}}),D&&o.jsx(noe,{anchor:D.anchor,composer:{getBoundingClientRect:()=>{var F,de,we;return((de=(F=L.current)==null?void 0:F.closest(".sc-promptcard"))==null?void 0:de.getBoundingClientRect())??((we=L.current)==null?void 0:we.getBoundingClientRect())??new DOMRect}},line:{getBoundingClientRect:()=>{var F;return((F=L.current)==null?void 0:F.getBoundingClientRect())??new DOMRect}},query:z,options:ft,remaining:Ge.remaining,total:Ge.total,sigil:D.sigil,onMore:bt,onActiveId:ue,onClose:()=>{U(null),q("")}}),_&&Ct&&it&&o.jsx(Id,{anchor:_.anchor,kind:it,src:Ct,label:ni(_.anchor),warning:vt,note:Te,onOpen:()=>{const F=_.anchor;if(me){se(F);return}O(),b==null||b({src:Ct,kind:it,label:ni(F)})},onHoverIn:G.keep,onHoverOut:G.close,onClose:O},_.uid),(V==null?void 0:V.kind)==="ref"||(V==null?void 0:V.kind)==="mark"?o.jsx(jae,{kind:V.kind,label:ni(V.anchor),thumb:Ve?gn(Ve,"micro"):null,onInspect:()=>se(V.anchor),onMove:F=>tt(V.uid,F),onRemove:qe,onClose:Be},V.uid):(V==null?void 0:V.kind)==="color"?o.jsx(joe,{anchor:V.anchor,currentHex:Vh(V.anchor),currentName:_oe(V.anchor),palette:ra((Qe=r.json)==null?void 0:Qe.palette),onPick:(F,de)=>{var We;const we=V.uid;if(de!=null&&de.live){const Le=(We=L.current)==null?void 0:We.querySelector(`[data-uid="${CSS.escape(we)}"]`);Le&&tne(Le,F),Ke();return}if(Voe(F.hex,Vh(V.anchor))){Be("pick");return}X(we,F),Be("pick")},onRemove:qe,onMove:F=>tt(V.uid,F),onClose:Be},V.uid):V?o.jsx(woe,{kind:V.kind,anchor:V.anchor,currentId:Vh(V.anchor),candidates:Pe(V.kind),brandId:r.id,brandSlug:r.slug,warning:ot,note:ht,onAttachRequest:S?F=>{Be("outside"),S(F)}:void 0,onPick:F=>{const de=V.uid;if(F.id===Vh(V.anchor)){Be("pick");return}F.kind==="scene"?u(F.id):X(de,F.token),Be("pick")},onRemove:qe,onMove:F=>tt(V.uid,F),onClose:Be,views:V.kind==="scene"?{options:xt,picked:yt,onPick:kt}:void 0},V.uid):null]})});function Vh(e){const t=ks(e.dataset.tok??"");return t?t.t==="color"?t.hex:"id"in t?t.id:null:null}function _oe(e){const t=ks(e.dataset.tok??"");return(t==null?void 0:t.t)==="color"?t.name:void 0}function Voe(e,t){const n=e?dr(e):null,r=t?dr(t):null;return!!n&&n===r}function Zoe(e,t,n){var r,a;if(e.t==="template"){const i=((r=t.find(l=>l.id===e.id))==null?void 0:r.name)??"template";return e.view&&e.viewName?`${i} · ${C4(e.viewName)}`:i}return e.t==="product"?((a=n.find(i=>i.id===e.id))==null?void 0:a.name)??"product":e.t==="character"?"someone":e.t==="color"?e.name??e.hex:e.t==="mark"?"brand mark":e.t==="ref"?e.label??"Image":"reference"}function Zh(e,t){return t===null?e===null:e===t}function zoe(e){const t=e.closest(".sc-filterbar, .sc-toolbar"),n=t==null?void 0:t.closest("[data-page-scroll]");if(!t||!n)return;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().height===0;)r=r.nextElementSibling;if(!r)return;const i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-Number.parseFloat(getComputedStyle(t).marginBottom)-t.offsetHeight;if(n.scrollTop<=i+1)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;n.scrollTo({top:i,behavior:l?"auto":"smooth"})}function Ry({"aria-label":e,activeKey:t,items:n,onSelect:r}){const a=s.useRef(null),i=s.useRef(null),l=n.map(p=>`${p.value??""}:${p.count??""}`).join("|");s.useLayoutEffect(()=>{const p=a.current,g=i.current;if(!p||!g)return;let m=0;const w=()=>{const A=g.querySelector(":scope > button[data-on]");if(!A)return g.style.setProperty("--sc-ink-x","0px"),g.style.setProperty("--sc-ink-w","0px"),null;const L=A.querySelector(".sc-vlabel")??A;return g.style.setProperty("--sc-ink-x",`${A.offsetLeft+L.offsetLeft}px`),g.style.setProperty("--sc-ink-w",`${L.offsetWidth}px`),A},y=()=>{const A=g.scrollWidth-g.clientWidth;if(A<=1){delete p.dataset.overflowLeft,delete p.dataset.overflowRight;return}g.scrollLeft>2?p.dataset.overflowLeft="":delete p.dataset.overflowLeft,g.scrollLeft<A-2?p.dataset.overflowRight="":delete p.dataset.overflowRight},b=A=>{const L=g.scrollWidth-g.clientWidth;if(L<=0)return;const T=[...g.querySelectorAll(":scope > button")],M=T.indexOf(A);if(M<0)return;const j=72,P=g.scrollLeft,R=P+g.clientWidth,H=T[M-1],D=T[M+1],U=D?D.offsetLeft+Math.min(j,D.offsetWidth):A.offsetLeft+A.offsetWidth+8,V=H?Math.max(0,H.offsetLeft+H.offsetWidth-j):Math.max(0,A.offsetLeft-8);let B=P;if(U>R)B=Math.min(L,U-g.clientWidth);else if(V<P)B=V;else return;if(Math.abs(B-P)<1)return;const G=window.matchMedia("(prefers-reduced-motion: reduce)").matches;g.scrollTo({left:B,behavior:G?"auto":"smooth"})},k=w();k&&b(k),y(),g.dataset.inkReady||requestAnimationFrame(()=>{g.dataset.inkReady=""});const S=()=>{m||(m=requestAnimationFrame(()=>{m=0,y()}))},E=A=>{if(g.scrollWidth<=g.clientWidth+1||Math.abs(A.deltaX)>Math.abs(A.deltaY)||A.deltaY===0)return;const L=g.scrollWidth-g.clientWidth,T=Math.max(0,Math.min(L,g.scrollLeft+A.deltaY));T!==g.scrollLeft&&(A.preventDefault(),g.scrollLeft=T,y())},C=new ResizeObserver(()=>{w(),y()});C.observe(g);for(const A of g.querySelectorAll(":scope > button"))C.observe(A);return g.addEventListener("scroll",S,{passive:!0}),g.addEventListener("wheel",E,{passive:!1}),()=>{m&&cancelAnimationFrame(m),C.disconnect(),g.removeEventListener("scroll",S),g.removeEventListener("wheel",E)}},[t,l]);const u=p=>{Zh(t,p)||(a.current&&zoe(a.current),r(p))},f=p=>{var y;if(p.key!=="ArrowLeft"&&p.key!=="ArrowRight"&&p.key!=="Home"&&p.key!=="End"||n.length===0)return;p.preventDefault();const g=Math.max(0,n.findIndex(b=>Zh(t,b.value)));let m=g;if(p.key==="ArrowRight"?m=Math.min(n.length-1,g+1):p.key==="ArrowLeft"?m=Math.max(0,g-1):p.key==="Home"?m=0:p.key==="End"&&(m=n.length-1),m===g)return;u(n[m].value);const w=(y=i.current)==null?void 0:y.querySelectorAll(":scope > button")[m];w==null||w.focus()},h=n.findIndex(p=>Zh(t,p.value));return o.jsx("div",{ref:a,className:"sc-verticals-shell",children:o.jsxs("div",{ref:i,className:"sc-verticals",role:"tablist","aria-label":e,onKeyDown:f,children:[o.jsx("span",{className:"sc-verticals-ink","aria-hidden":!0}),n.map((p,g)=>{const m=Zh(t,p.value);return o.jsxs("button",{type:"button",role:"tab","aria-selected":m,"data-on":m?"":void 0,tabIndex:m||h<0&&g===0?0:-1,onClick:()=>u(p.value),children:[o.jsx("span",{className:"sc-vlabel",children:p.label}),p.count!==void 0&&o.jsx("span",{className:"sc-vcount",children:p.count})]},p.value??"__all__")})]})})}function _d({value:e,onChange:t,noun:n,total:r,shortcut:a=!0}){const i=s.useRef(null),[l,u]=s.useState(e.trim().length>0),f=s.useCallback(()=>{var p;Br.flushSync(()=>u(!0)),(p=i.current)==null||p.focus()},[]);s.useEffect(()=>{e.trim().length>0&&u(!0)},[e]),s.useEffect(()=>{if(!a)return;const p=g=>{if(g.key!=="/"||g.metaKey||g.ctrlKey||g.altKey)return;const m=g.target;m!=null&&m.isContentEditable||m&&/^(input|textarea|select)$/i.test(m.tagName)||(g.preventDefault(),f())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[f,a]);const h=p=>{var g;p.key==="Escape"&&(p.stopPropagation(),e?t(""):(u(!1),(g=i.current)==null||g.blur()))};return o.jsxs("div",{className:"sc-libsearch","data-open":l?"":void 0,children:[o.jsx("button",{type:"button",className:"sc-libsearch-toggle","aria-label":`Search ${n}`,"aria-expanded":l,tabIndex:l?-1:0,onClick:f,children:o.jsx(hd,{size:16})}),o.jsxs("div",{className:"sc-libsearch-field",children:[o.jsx(hd,{size:15,"aria-hidden":!0}),o.jsx("input",{ref:i,type:"search",value:e,placeholder:r==null?`Search ${n}`:`Search ${r} ${n}`,"aria-label":`Search ${n}`,autoComplete:"off",autoCorrect:"off",spellCheck:!1,tabIndex:l?0:-1,onChange:p=>t(p.target.value),onKeyDown:h,onBlur:()=>{e.trim()||u(!1)}}),o.jsx("button",{type:"button",className:"sc-libsearch-clear","aria-label":"Clear search",hidden:!e,tabIndex:e?0:-1,onMouseDown:p=>p.preventDefault(),onClick:()=>{var p;t(""),(p=i.current)==null||p.focus()},children:o.jsx(jn,{size:12,weight:"bold"})})]})]})}function SL({why:e,children:t}){return e?o.jsx($w,{content:e,className:"sc-tip",maxWidth:"220px",children:rR(t)}):t}const Boe=["All","Products","People","Places","Colors","Brand","Shots"],qp=Boe.filter(e=>e!=="All"),X9={Products:"Products",People:"People",Places:"Places",Colors:"Brand colors",Brand:"Brand marks",Shots:"Shots"},Uoe={Products:"Product",People:"Person",Places:"Place",Colors:"Brand color",Brand:"Brand mark",Shots:"Reference shot"},ev={Products:"products",People:"people",Places:"places",Colors:"brand colors",Brand:"brand marks",Shots:"shots"},Woe={Products:"square",People:"square",Places:"square",Colors:"swatch",Brand:"square",Shots:"square"},EL={Products:132,People:132,Places:132,Colors:132,Brand:132,Shots:132},tv={Products:96,People:96,Places:96,Colors:96,Brand:96,Shots:96},Q9=10;function Koe(e,t,n){const r=(n?tv:EL)[e];return r<=0||t<=0?1:Math.max(1,Math.floor((t+Q9)/(r+Q9)))}const Goe={product:"Products",presenter:"People",scene:"Places"};function Yoe(e){const t=Goe[e.kind];return{key:Ja(e.token),group:t,shape:Woe[t],label:e.label,sub:e.kind==="product"?e.sub:void 0,full:e.recommended?`${e.full} · Recommended`:e.full,search:e.search,thumb:$n(e.thumb??null,"small"),crop:e.crop,recommended:e.recommended,bookmarked:e.bookmarked,token:e.token}}function qoe(e){const t=rf(e).map(r=>{const a=r.hash,i=Xm(e,r);return{key:`m:${a}`,group:"Brand",shape:"square",label:i,full:`${i} · the mark itself`,search:i,thumb:gn(a,"micro"),token:{t:"mark",imageHash:a}}}),n=ra(e==null?void 0:e.palette).map(r=>{const a={t:"color",hex:r.hex,name:r.name};return{key:Ja(a),group:"Colors",shape:"swatch",label:r.name,full:`${r.name} · ${r.hex}`,search:`${r.name} ${r.hex}`,swatch:r.hex,token:a}});return[...t,...n]}function Xoe(e,t){return e.map((n,r)=>{const a=`Shot ${Math.max(1,t-r)}`;return{key:`r:${n.images[0]}`,group:"Shots",shape:"square",label:a,full:`${a} · joins the shot as a reference image`,search:a,thumb:gn(n.images[0],"micro"),token:{t:"ref",imageHash:n.images[0],label:"Shot"}}})}const J9=(e,t)=>Ho(`${e.label} ${e.sub??""} ${e.search}`,t),CL=`
|
|
106
|
+
`;function Qoe(e){return e.map(Ja).filter(t=>t.length>0).join(CL)}function Joe(e){return new Set(e?e.split(CL):[])}const eie=new Set(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"]);function tie(e,t,n,r){const a=r.length?r[r.length-1].end+1:0;if(a===0)return t==="ArrowUp"?"search":null;const i=Math.max(1,n),l=r.findIndex(p=>e>=p.start&&e<=p.end),u=r[l]??{start:0,end:a-1},f=(e-u.start)%i,h=p=>p.start+Math.floor((p.end-p.start)/i)*i;switch(t){case"ArrowRight":return e+1<a?e+1:null;case"ArrowLeft":return e>0?e-1:null;case"Home":return 0;case"End":return a-1;case"ArrowDown":{if(e+i<=u.end)return e+i;if(e<h(u))return u.end;const p=r[l+1];return p?p.start+Math.min(f,p.end-p.start):null}case"ArrowUp":{if(e-i>=u.start)return e-i;const p=r[l-1];return p?Math.min(p.end,h(p)+f):"search"}}}function nie(e,t){const n=t.trim();return e==="All"?n?`Nothing matches “${n}”.`:"Nothing to add yet.":n?`No matching ${ev[e]}.`:e==="Shots"?"No finished shots yet.":`No ${ev[e]} yet.`}function rie(e){return[{value:null,label:"All",count:qp.reduce((n,r)=>n+e[r],0)},...qp.map(n=>({value:n,label:n,count:e[n]}))]}const sie=s.memo(function({card:t,index:n,active:r,ticked:a,why:i,onPick:l,onFocus:u}){const f=g=>{(g.key==="Enter"||g.key===" ")&&g.stopPropagation()},h=i&&!a?i:null,p=o.jsxs("button",{type:"button",className:"sc-ap-card","data-shape":t.shape,"data-group":t.group,"data-nav":n,"data-on":a?"":void 0,tabIndex:r?0:-1,"aria-disabled":h?!0:void 0,"aria-pressed":a,title:h??(a?`${t.label} is in the shot. Press to remove it.`:t.full),onClick:h?void 0:()=>l(n),onFocus:()=>u(n),onKeyDown:f,children:[t.shape==="swatch"?o.jsx("span",{className:"sc-ap-thumb sc-ap-swatch",style:{background:t.swatch},"aria-hidden":!0}):o.jsx(aie,{src:t.thumb,crop:t.crop}),o.jsxs("span",{className:"sc-ap-cap",children:[o.jsxs("span",{className:"sc-vh",children:[Uoe[t.group],": "]}),o.jsx("b",{dir:"auto",children:t.label}),t.sub&&o.jsx("span",{dir:"auto",children:t.sub})]}),(a||!i)&&o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(mr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Gn,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(jn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]}),a&&o.jsx("span",{className:"sc-vh",children:" In the shot."})]});return o.jsx(SL,{why:h,children:p})});function aie({src:e,crop:t}){const[n,r]=s.useState(!1);return s.useEffect(()=>r(!1),[e]),o.jsx("span",{className:"sc-ap-thumb","data-empty":!e||n?"":void 0,children:!e||n?o.jsx(Da,{size:16}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async","data-crop":t,onError:()=>r(!0)})})}function e7({onClick:e}){return o.jsxs("button",{type:"button",className:"sc-ap-card sc-ap-add sc-ap-upload-tile",title:"Add an image from your phone. It joins the shot as a reference.",onClick:e,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx(Ov,{size:22,"aria-hidden":!0})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Upload image"})})]})}const oie=48,iie={items:[],total:0,hasMore:!1,loading:!1,settled:!1,error:null,loadMore:()=>{}};function Py(e,t,n=!0){const r=t.trim(),{shotsEpoch:a,subscribeActivity:i}=cn(),l=`${e}|${r}|${a}`,[u,f]=s.useState({key:"",items:[],next:null,total:0}),[h,p]=s.useState(!1),[g,m]=s.useState(null),w=s.useRef(null),y=s.useCallback(async S=>{var C;(C=w.current)==null||C.abort();const E=new AbortController;w.current=E,p(!0),m(null);try{const A=await Ee.feed(e,{lens:"all",sort:"newest",q:r,limit:oie,cursor:S??void 0},E.signal);if(E.signal.aborted)return;f(L=>{var M;const T=S===null||L.key!==l;return{key:l,items:T?A.items:[...L.items,...A.items],next:A.next,total:((M=A.counts)==null?void 0:M.all)??(T?A.items.length:L.total)}})}catch(A){if(E.signal.aborted)return;m(String(A.message??A))}finally{E.signal.aborted||p(!1)}},[e,r,l]);s.useEffect(()=>{if(!n)return;const S=u.key===""?0:150,E=setTimeout(()=>void y(null),S);return()=>clearTimeout(E)},[y,n]),s.useEffect(()=>()=>{var S;return(S=w.current)==null?void 0:S.abort()},[]),s.useEffect(()=>i(S=>{const E=new Map(S.map(C=>[C.id,C]));f(C=>{if(!C.items.some(L=>E.has(L.id)))return C;const A=C.items.flatMap(L=>{const T=E.get(L.id);return T?T.archived?[]:[{...L,...T}]:[L]});return{...C,items:A,total:Math.max(0,C.total-(C.items.length-A.length))}})}),[i]);const b=u.key===l?u:null,k=s.useCallback(()=>{b!=null&&b.next&&y(b.next)},[b==null?void 0:b.next,y]);return b?{items:b.items.filter(S=>S.status==="done"&&S.images.length>0),total:b.total,hasMore:b.next!==null,loading:h,settled:!0,error:g,loadMore:k}:{...iie,loading:h,error:g,loadMore:k}}const o6={Products:"product",People:"presenter",Places:"scene"};function lie({brand:e,tab:t,onTab:n,only:r,activeProductCategory:a,refining:i,full:l,attached:u,phone:f,touch:h,onPick:p,onRemove:g,onUpload:m,onFiles:w,onClose:y}){const b=s.useRef(a).current,k=ff(b),S=s.useMemo(()=>new Set(Ci(e.id)),[e.id]),E=Zl(),{applyBrand:C}=Mn(),{push:A}=rr(),[L,T]=s.useState(!1),[M,j]=s.useState(""),P=s.useDeferredValue(M),[R,H]=s.useState(hl),[D,U]=s.useState(0),[V,B]=s.useState(f?347:696),G=s.useRef(null),_=s.useRef(null);s.useEffect(()=>{H(hl),U(0)},[t,P]),s.useLayoutEffect(()=>{const De=_.current;if(!De)return;const Se=()=>B(De.clientWidth-2*uie(De));Se();const X=new ResizeObserver(Se);return X.observe(De),()=>X.disconnect()},[]);const O=s.useMemo(()=>({product:pl("product",k),presenter:pl("presenter",k),scene:pl("scene",k)}),[k]),I=s.useMemo(()=>qoe(e.json),[e.json]),K=Py(e.id,P),z=s.useMemo(()=>Xoe(K.items,K.total),[K.items,K.total]),q=s.useMemo(()=>{const De={};for(const Se of qp){const X=o6[Se];De[Se]=Se==="Shots"?K.total:X?dd(O[X],P).length:I.filter(je=>je.group===Se&&J9(je,P)).length}return De},[O,I,P,K.total]),Z=s.useCallback((De,Se)=>{const X=o6[De];if(X){const Re=h2(X,O[X],{currentId:null,query:P,bookmarked:S,shown:Se});return{group:De,items:Re.items.map(Yoe),total:Re.total,remaining:Re.remaining}}if(De==="Shots"){const Re=z.slice(0,Se),re=K.hasMore?Math.max(1,K.total-z.length):Math.max(0,z.length-Se);return{group:De,items:Re,total:K.total,remaining:re}}const je=I.filter(Re=>Re.group===De&&J9(Re,P));return{group:De,items:je.slice(0,Se),total:je.length,remaining:Math.max(0,je.length-Se)}},[O,I,P,S,z,K.hasMore,K.total]),ee=s.useMemo(()=>{if(t==="All"){const De=[];for(const Se of qp){const X=Koe(Se,V,f),je=Z(Se,f&&De.length===0?Math.max(1,X-1):X);je.items.length>0&&De.push(je)}return De}return[Z(t,t==="Shots"?Number.MAX_SAFE_INTEGER:R)]},[t,Z,R,V,f]),{flat:he,navGroups:ue}=s.useMemo(()=>{const De=[],Se=[];for(const X of ee)X.items.length&&(Se.push({start:De.length,end:De.length+X.items.length-1}),De.push(...X.items));return{flat:De,navGroups:Se}},[ee]);s.useEffect(()=>{U(De=>Math.max(0,Math.min(De,he.length-1)))},[he.length]);const ge=s.useCallback(De=>{var X;const Se=(X=_.current)==null?void 0:X.querySelector(`[data-nav="${De}"]`);Se&&(U(De),Se.focus({preventScroll:!0}),Se.scrollIntoView({block:"nearest"}))},[]),te=s.useRef(null),J=s.useRef(()=>{});J.current=()=>{const De=ee[0];!De||t==="All"||De.remaining<=0||(De.group==="Shots"?K.loading||K.loadMore():H(Se=>Se+hl))},s.useEffect(()=>{const De=te.current,Se=_.current;if(!De||!Se)return;const X=new IntersectionObserver(je=>{je.some(Re=>Re.isIntersecting)&&J.current()},{root:Se,rootMargin:"0px 0px 240px 0px"});return X.observe(De),()=>X.disconnect()},[t,ee]);const Q=s.useCallback(De=>{var X,je;const Se=he[De];Se&&(u.has(Se.key)?g(Se):p(Se),h&&((je=(X=document.activeElement)==null?void 0:X.blur)==null||je.call(X)))},[he,u,h,p,g]),ae=De=>{const Se=De.clipboardData.files;!Se.length||!Array.from(Se).some(X=>X.type.startsWith("image/"))||(De.preventDefault(),w(Se))},$e=De=>{var re,Y;const Se=De.target,X=Se instanceof HTMLInputElement&&!!((re=G.current)!=null&&re.contains(Se));if(De.key==="Escape"){if(X)return;De.preventDefault(),De.stopPropagation(),y();return}if(X){De.key==="ArrowDown"?(De.preventDefault(),De.stopPropagation(),ge(0)):De.key==="Enter"&&(De.preventDefault(),De.stopPropagation(),Q(0));return}if(!eie.has(De.key)||(De.stopPropagation(),Se.closest('[role="tablist"]')))return;const je=Se.closest("[data-nav]");if(!je)return;De.preventDefault();const Re=tie(D,De.key,cie(je.closest(".sc-ap-grid")),ue);if(Re==="search"){const se=G.current;(Y=(se==null?void 0:se.querySelector(".sc-libsearch[data-open] input"))??(se==null?void 0:se.querySelector(".sc-libsearch-toggle")))==null||Y.focus()}else Re!=null&&ge(Re)},ie=async De=>{T(!0);try{const Se=await ZN(e.id,De);C(Se);const X=Se.logoHash;X&&p({key:`m:${X}`,group:"Brand",shape:"square",label:"Logo",full:"Logo",search:"",token:{t:"mark",imageHash:X}});const je=Se.logoEdge;je&&je<512&&A({kind:"warning",title:"Logo added, but it is small",detail:`Only ${je}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`})}catch(Se){A(ln(Se,"Could not upload that logo"))}finally{T(!1)}},ke=De=>E(De,{onCreated:Se=>{if(Se.kind===De){if(Se.kind==="product"){const X={t:"product",id:Se.id};p({key:Ja(X),group:"Products",shape:"square",label:"Product",full:"",search:"",token:X});return}if(Se.kind==="presenter"){const X={t:"character",id:Se.id};p({key:Ja(X),group:"People",shape:"square",label:"Person",full:Se.name,search:Se.name,token:X});return}n("Places")}}}),ze=async De=>{var je;const Se=jR((je=e.json)==null?void 0:je.palette,De);if(!Se.swatch)return;if(Se.added)try{const Re=await Ee.updateBrand(e.id,{...e.json??{},palette:Se.palette},e.json);C(Re)}catch(Re){A(ln(Re,"Could not save the brand"));return}const X={t:"color",hex:Se.swatch.hex,name:Se.swatch.name};p({key:Ja(X),group:"Colors",shape:"swatch",label:Se.swatch.name,full:"",search:"",swatch:Se.swatch.hex,token:X})},wt=De=>i&&De==="Places"?"Places set up a new shot. Press X on Refining to use one.":l&&De!=="Colors"?l:null,Ke=he.length===0;let tt=0;return o.jsxs("div",{className:"sc-ap-inner",onKeyDown:$e,onPaste:ae,children:[o.jsxs("div",{className:"sc-ap-head",ref:G,children:[o.jsx("div",{className:"sc-ap-tabs",children:o.jsx(Ry,{"aria-label":"What to add",activeKey:t==="All"?null:t,items:rie(q),onSelect:De=>n(De??"All")})}),o.jsxs("div",{className:"sc-ap-actions",children:[o.jsxs("div",{className:"sc-ap-actions-add",children:[o.jsx(_d,{value:M,onChange:j,noun:t==="All"?"everything":ev[t],total:t==="All"?void 0:q[t],shortcut:!1}),!f&&o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-ap-upload",onClick:m,title:"Add an image from your computer. It joins the shot as a reference.",children:[o.jsx(Ov,{size:14,"aria-hidden":!0}),o.jsx("span",{children:"Upload image"})]})]}),!f&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-ap-close",onClick:y,"aria-label":"Close",children:o.jsx(jn,{size:14})})]})]}),o.jsxs("div",{className:"sc-ap-body",ref:_,children:[i&&t==="Places"&&o.jsx("p",{className:"sc-ap-hint",children:"Places set up a new shot, so they sit out while you are refining. Press X on Refining to use one."}),ee.map((De,Se)=>{var se,Ne,Be;const X=wt(De.group),je=tt;tt+=De.items.length;const Re=o6[De.group],Y={"--ap-min":`${(f?tv:EL)[De.group]}px`,"--ap-lines":Re==="product"?2:1};return o.jsxs("section",{className:"sc-ap-group","aria-label":X9[De.group],children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsxs("span",{className:"sc-ap-sec-title",children:[X9[De.group],o.jsx("span",{className:"sc-ap-sec-n",children:De.total})]}),t==="All"&&De.total>De.items.length&&o.jsxs("button",{type:"button",className:"sc-ap-sec-act",onClick:()=>n(De.group),children:["Show all ",De.total]}),t==="Products"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ke("product"),children:"Add product"}),t==="People"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ke("presenter"),children:"Create person"}),t==="Places"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ke("scene"),children:"Create place"}),t==="Colors"&&o.jsx(xd,{className:"sc-ap-sec-act sc-ap-add",triggerStyle:{background:"none"},value:r2(ra((se=e.json)==null?void 0:se.palette)),presets:ra((Ne=e.json)==null?void 0:Ne.palette).map(st=>st.hex),commitMode:"close",align:"end",label:"Add color",onChange:st=>void ze(st),children:"Add color"}),t==="Brand"&&o.jsxs("label",{className:"sc-ap-sec-act sc-ap-add",title:"Add your logo to the brand kit","data-busy":L||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",className:"sc-vh",disabled:L,onChange:st=>{var Oe;const Pe=(Oe=st.target.files)==null?void 0:Oe[0];st.target.value="",Pe&&ie(Pe)}}),"Add logo"]})]}),o.jsxs("div",{className:"sc-ap-grid","data-shape":((Be=De.items[0])==null?void 0:Be.shape)??"square",style:Y,children:[f&&Se===0&&!r&&o.jsx(e7,{onClick:m}),De.items.map((st,Pe)=>o.jsx(sie,{card:st,index:je+Pe,active:je+Pe===D,ticked:u.has(st.key),why:X,onPick:Q,onFocus:U},st.key))]}),t!=="All"&&De.remaining>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:te,className:"sc-ap-sentinel","aria-hidden":!0}),o.jsxs("p",{className:"sc-ap-foot","aria-live":"polite",children:[De.items.length," of ",De.total]})]})]},De.group)}),t==="Shots"&&K.error&&o.jsxs("p",{className:"sc-ap-empty",children:["Could not load the shots. ",K.error]}),Ke&&f&&o.jsx("div",{className:"sc-ap-grid",style:{"--ap-min":`${tv.Products}px`},children:o.jsx(e7,{onClick:m})}),Ke&&!(t==="Shots"&&(!K.settled||K.loading||K.error))&&o.jsx("p",{className:"sc-ap-empty",children:nie(t,M)})]})]})}function cie(e){return e?Math.max(1,getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length):1}function uie(e){return Number.parseFloat(getComputedStyle(e).paddingLeft)||0}const die="(pointer: coarse)";function fie(e){const t=Nr(la),n=Nr(die),[r,a]=s.useState(e.initialTab??"All");s.useEffect(()=>{a(e.initialTab??"All")},[e.initialTab,e.tabNonce]);const[i]=Al(),l=i.get("new")!==null;return o.jsx(hie,{id:e.id,phone:t,touch:n,creating:l,onClose:e.onClose,children:o.jsx(lie,{brand:e.brand,tab:e.only??r,onTab:a,only:e.only,activeProductCategory:e.activeProductCategory,refining:e.refining,full:e.full,attached:e.attached,phone:t,touch:n,onPick:e.onPick,onRemove:e.onRemove,onUpload:e.onUpload,onFiles:e.onFiles,onClose:()=>e.onClose({restore:!n})})})}function hie({id:e,phone:t,touch:n,creating:r,onClose:a,children:i}){const l=s.useRef(null),u=()=>{var p;return a({restore:!n&&!!((p=l.current)!=null&&p.contains(document.activeElement))})},f=s.useRef(u);f.current=u,s.useEffect(()=>{var p,g;n&&((g=(p=document.activeElement)==null?void 0:p.blur)==null||g.call(p))},[n]),s.useLayoutEffect(()=>{var y,b;const p=l.current,g=p==null?void 0:p.parentElement;if(!t||!p||!g)return;const m=()=>{const k=p.closest(".sc-shell")??document.documentElement,S=Number.parseFloat(getComputedStyle(k).getPropertyValue("--sc-topbar-h"))||0,E=g.getBoundingClientRect().top-S-16;p.style.setProperty("--ap-avail",`${Math.max(160,Math.round(E))}px`)};m();const w=new ResizeObserver(m);return w.observe(g),window.addEventListener("resize",m),(y=window.visualViewport)==null||y.addEventListener("resize",m),(b=window.visualViewport)==null||b.addEventListener("scroll",m),()=>{var k,S;w.disconnect(),window.removeEventListener("resize",m),(k=window.visualViewport)==null||k.removeEventListener("resize",m),(S=window.visualViewport)==null||S.removeEventListener("scroll",m)}},[t]),s.useEffect(()=>{const p=g=>{var w;if(g.key!=="Escape"||r)return;const m=document.activeElement;m instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(m))||(g.preventDefault(),g.stopPropagation(),f.current())};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[r]);const h=p=>{var w;const g=document.activeElement,m=p.target;g instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(g))&&!m.closest("input")&&g.blur(),U4(p)};return s.useEffect(()=>{const p=g=>{if(r)return;const m=g.target;m.closest('[data-guide="catch"], [data-guide="card"], [data-guide="inline"]')||document.querySelector('[data-guide="catch"]')||m.closest(".sc-attachpanel, .sc-attach-toggle, [data-attach-opener]")||f.current()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]),o.jsx("div",{ref:l,className:"sc-attachpanel","data-guide-shape":"",role:"dialog",id:e,"aria-label":"Add to shot",onMouseDownCapture:h,children:i})}function pie({target:e,onOpenImage:t,onClear:n}){var f;const r=Fd(),a=e.images[0],l=(((f=e.brief)==null?void 0:f.tokens)??[]).filter(h=>h.t==="text"&&typeof h.v=="string").map(h=>h.v.trim()).join(" ").trim()||Dr(e),u=s.useCallback(()=>{a&&(r.closeNow(),t())},[a,r.closeNow,t]);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-token sc-target-chip",children:[o.jsxs("button",{type:"button",className:"sc-target-open","aria-haspopup":"dialog","aria-label":`Version being refined: ${l}. Open the image.`,onPointerEnter:h=>{h.pointerType==="mouse"&&a&&r.open({anchor:h.currentTarget})},onPointerLeave:h=>h.pointerType==="mouse"&&r.close(),onClick:u,children:[a?o.jsx("img",{src:gn(a,"micro"),alt:""}):o.jsx("span",{className:"sc-target-thumb",children:o.jsx(La,{})}),"Refining"]}),n&&o.jsx("button",{type:"button",className:"sc-target-x","aria-label":"Make a new shot instead",onClick:h=>{h.stopPropagation(),r.closeNow(),n()},children:o.jsx(jn,{size:12})})]}),r.shown&&a&&o.jsx(Id,{anchor:r.shown.anchor,kind:"shot",src:gn(a,"tile"),label:l,noun:"Refining this shot",onOpen:u,onHoverIn:r.keep,onHoverOut:r.close,onClose:r.closeNow})]})}function Cd({src:e,kind:t,label:n,noun:r,actions:a,onRestoreFocus:i,onClose:l}){const[u,f]=s.useState(!1),h=r??uL[t],p=s.useRef(null);return o.jsxs(Ws,{className:"sc-lightbox",maxWidth:"min(880px, 92vw)",onOpenAutoFocus:()=>{p.current=document.activeElement},onCloseAutoFocus:g=>{var m;if(g.preventDefault(),i)return i();(m=p.current)!=null&&m.isConnected&&p.current.focus()},onDismiss:l,children:[o.jsx("div",{className:"sc-newdlg-head sc-lightbox-head",children:o.jsx(Ms,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}),o.jsx("div",{className:"sc-lightbox-frame","data-kind":t,children:u?o.jsxs("span",{className:"sc-lightbox-blank",children:[o.jsx(Da,{size:28}),"Image unavailable"]}):o.jsx("img",{src:e,alt:n?`${n}, ${h.toLowerCase()}`:h,onError:()=>f(!0)})}),o.jsxs("p",{className:"sc-lightbox-cap",children:[n&&o.jsx("b",{dir:"auto",children:n}),o.jsx("span",{children:h})]}),a&&o.jsx("div",{className:"sc-lightbox-acts",children:a})]})}const mie={"codex-cli":{sizing:"advisory"},openrouter:{sizing:"ratio"},replicate:{sizing:"ratio"},fal:{sizing:"exact"},demo:{sizing:"exact"}},gie={sizing:"exact"},jL=e=>mie[e]??gie;function vie(e,t){const n=jL(e).formats;return!n||n.includes(t)}const Ly=e=>jL(e).sizing,wie="portrait",yie=1,bie="standard",oi=[{id:"draft",label:"Draft",edge:768,note:"quick checks"},{id:"standard",label:"Standard",edge:1024,note:"everyday shots"},{id:"high",label:"High",edge:1536,note:"hero and print"}],Xp=[1,2,3,4],AL=e=>Yr.filter(t=>!vie(e,t.id)).map(t=>t.id),nv=(e,t)=>t.length===0?void 0:`${e} cannot make ${Yr.filter(n=>t.includes(n.id)).map(n=>n.hint).join(" or ")}.`,$y=e=>{var n;e.preventDefault();const t=e.currentTarget??e.target;(n=t==null?void 0:t.querySelector('[role="radiogroup"]'))==null||n.focus()};function i6({aria:e,width:t,trigger:n,open:r,onOpenChange:a,children:i,onCloseAutoFocus:l,guide:u}){const f=s.useRef(null);return s.useEffect(()=>{var p;const h=(p=f.current)==null?void 0:p.parentElement;h&&(h.style.pointerEvents=r?"":"none")},[r]),o.jsxs(gd,{open:r,onOpenChange:a,children:[o.jsx(vd,{children:o.jsx("button",{type:"button",className:"sc-var","aria-label":e,"data-guide":u,children:n})}),o.jsx(wd,{ref:f,className:"sc-setpop",align:"end",sideOffset:8,width:t,onOpenAutoFocus:$y,onCloseAutoFocus:l,onInteractOutside:h=>{var p;(p=h.target)!=null&&p.closest(".sc-prompt-pills")&&h.preventDefault()},children:i(()=>a(!1))})]})}function xie({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,onCloseAutoFocus:h,guided:p=!1,onSettle:g}){const m=Yr.find(T=>T.id===r)??Yr[0],w=oi.find(T=>T.id===u)??oi[1],y=AL(t),b=Ly(t),[k,S]=s.useState(null),E=s.useRef(null);E.current=k;const C=T=>{T.preventDefault(),E.current===null&&(h==null||h(T))},A={aspect:"shape",variants:"count",resolution:"quality"},L=T=>({open:k===T,onCloseAutoFocus:C,guide:p?`compose.${A[T]}`:void 0,onOpenChange:M=>{!M&&E.current===T&&(g==null||g(A[T])),S(j=>M?T:j===T?null:j)}});return o.jsxs("div",{className:"sc-prompt-pills","data-guide":p?"compose.settings-row":void 0,children:[o.jsx(i6,{...L("aspect"),aria:`Aspect ${m.label}, ${m.hint}`,width:"178px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(H4,{w:m.w,h:m.h,slot:15,box:13}),m.label]}),children:T=>o.jsxs(o.Fragment,{children:[o.jsx(ri,{label:"Aspect ratio",className:"sc-setpop-list",value:r,ids:Yr.map(M=>M.id),unavailable:y,onChange:a,children:Yr.map(M=>o.jsxs(si,{id:M.id,className:"sc-setrow",on:M.id===r,unavailable:y.includes(M.id),label:`${M.label}, ${M.hint}`,onPick:()=>{a(M.id),T()},children:[o.jsx(H4,{w:M.w,h:M.h,slot:20,box:17}),o.jsx("span",{className:"sc-setrow-n",children:M.label}),o.jsx("span",{className:"sc-setrow-v",children:M.hint}),o.jsx(fk,{})]},M.id))}),nv(n,y)&&o.jsx(JQ,{children:nv(n,y)})]})}),e==="generation"&&o.jsx(i6,{...L("variants"),aria:`${i} shot${i===1?"":"s"}`,width:"156px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(vC,{size:14}),i]}),children:T=>o.jsx(o.Fragment,{children:o.jsx(ri,{label:"Shots",className:"sc-seg",value:String(i),ids:Xp.map(String),onChange:M=>l(Number(M)),children:Xp.map(M=>o.jsx(si,{id:String(M),className:"sc-seg-o",on:M===i,label:`${M} shot${M===1?"":"s"}`,onPick:()=>{l(M),T()},children:M},M))})})}),e==="generation"&&b!=="ratio"&&o.jsx(i6,{...L("resolution"),aria:`Resolution ${w.label}, ${w.edge} px`,width:"192px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(DE,{size:14}),w.label]}),children:T=>o.jsx(o.Fragment,{children:o.jsx(ri,{label:"Resolution",className:"sc-setpop-list",value:u,ids:oi.map(M=>M.id),onChange:M=>f(M),children:oi.map(M=>o.jsxs(si,{id:M.id,className:"sc-setrow",on:M.id===u,label:`${M.label}, ${M.edge} px, ${M.note}`,onPick:()=>{f(M.id),T()},children:[o.jsx("span",{className:"sc-setrow-n",children:M.label}),o.jsxs("span",{className:"sc-setrow-v",children:[M.edge," px"]}),o.jsx(fk,{})]},M.id))})})})]})}function NL({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,engineChoices:h,onEngine:p}){const g=AL(t),m=Ly(t);return o.jsxs(o.Fragment,{children:[h&&p&&h.length>1&&o.jsx(zh,{label:"Engine",children:o.jsx(ri,{label:"Engine",className:"sc-seg",value:t,ids:h.map(w=>w.id),onChange:p,children:h.map(w=>o.jsx(si,{id:w.id,className:"sc-seg-o",on:w.id===t,label:w.displayName,onPick:()=>p(w.id),children:w.displayName},w.id))})}),o.jsx(zh,{label:"Aspect ratio",note:nv(n,g),children:o.jsx(ri,{label:"Aspect ratio",className:"sc-seg",value:r,ids:Yr.map(w=>w.id),unavailable:g,onChange:a,children:Yr.map(w=>o.jsxs(si,{id:w.id,className:"sc-seg-o sc-seg-ratio",on:w.id===r,unavailable:g.includes(w.id),label:`${w.label}, ${w.hint}`,onPick:()=>a(w.id),children:[o.jsx(H4,{w:w.w,h:w.h,slot:17,box:14}),w.hint]},w.id))})}),e==="generation"&&o.jsx(zh,{label:"Shots",children:o.jsx(ri,{label:"Shots",className:"sc-seg",value:String(i),ids:Xp.map(String),onChange:w=>l(Number(w)),children:Xp.map(w=>o.jsx(si,{id:String(w),className:"sc-seg-o",on:w===i,label:`${w} shot${w===1?"":"s"}`,onPick:()=>l(w),children:w},w))})}),e==="generation"&&m!=="ratio"&&o.jsx(zh,{label:"Resolution",note:m==="advisory"?"This engine renders at its own size, so this is a request rather than a guarantee.":void 0,children:o.jsx(ri,{label:"Resolution",className:"sc-seg",value:u,ids:oi.map(w=>w.id),onChange:w=>f(w),children:oi.map(w=>o.jsx(si,{id:w.id,className:"sc-seg-o",on:w.id===u,label:m==="advisory"?`${w.label}, asks for ${w.edge} px, ${w.note}`:`${w.label}, ${w.edge} px, ${w.note}`,onPick:()=>f(w.id),children:w.label},w.id))})})]})}function zh({label:e,note:t,children:n}){return o.jsxs("div",{className:"sc-shotfield",children:[o.jsx("span",{className:"sc-shotfield-lb",children:e}),n,t&&o.jsx("p",{className:"sc-shotfield-note",children:t})]})}function kie({guide:e,onSettle:t,...n}){const[r,a]=s.useState(!1),i=f=>{!f&&r&&(t==null||t()),a(f)},{sheet:l,grip:u}=Td(()=>i(!1));return o.jsxs(Rl,{open:r,onOpenChange:i,children:[o.jsx(Wv,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-var sc-shotset","aria-label":"Shot settings",title:"Shot settings","data-guide":e,children:o.jsx(Hv,{size:16})})}),o.jsxs(Pl,{children:[o.jsx(Ll,{className:"sc-shotsheet-scrim"}),o.jsxs($l,{ref:l,className:"sc-shotsheet","aria-describedby":void 0,onOpenAutoFocus:$y,onCloseAutoFocus:f=>f.preventDefault(),children:[o.jsxs("div",{className:"sc-shotsheet-grip",...u,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(Tl,{className:"sc-vh",children:"Shot settings"})]}),o.jsx(NL,{...n})]})]})]})}const ML=e=>e.t==="template"&&typeof e.view=="string"&&Object.hasOwn(dl,e.view);async function Sie(e){return Promise.all(e.map(async t=>{if(t.t!=="template"||!ML(t))return t;const{view:n,viewName:r,...a}=t,i=await Ee.pickSceneView(t.id,n).then(l=>l.hash,()=>null);return i?{...a,view:i,...r?{viewName:r}:{}}:a}))}function t7(e,t,n,r,a){if(e===t)return{changed:!1,toast:null};const i=!!r;return e===null&&!i?{changed:!0,toast:null}:{changed:!0,toast:{title:i?`Switched to ${n}. This starts a new shot instead of refining ${a??"that shot"}.`:`Switched to ${n}.`,prevSceneId:e,branchWasCleared:i}}}function Eie(e,t){return e>0&&t>0&&Math.abs(Math.log(t))<Math.abs(Math.log(e))-.01?"crop":"extend"}const l6=2,Cie=.15;function jie(e,t){if(Eie(e,t)==="crop")return"crop";if(!(e>0&&t>0))return"extend";const n=t>e?t/e:e/t;return(n>l6?Math.max(l6,n*(1-Cie)):n)>l6+1e-9?"crop":"extend"}const rv=4,Qp=24,q0=24,RL={product:[],presenter:[],scene:null,ref:[],color:[]};function Aie(e){const t=[],n=[],r=[],a=[];let i=null;const l=(u,f)=>{u.includes(f)||u.push(f)};for(const u of e)u.t==="product"?l(t,u.id):u.t==="character"?l(n,u.id):u.t==="template"?i=u.id:u.t==="ref"?l(r,u.imageHash):u.t==="color"&&l(a,u.hex.toLowerCase());return{product:t,presenter:n,scene:i,ref:r,color:a}}function Nie(e){return`${e.product.join(",")}|${e.presenter.join(",")}|${e.scene??""}|${e.ref.join(",")}|${e.color.join(",")}`}function Mie(e,t,n){const r=e.slice(0,n);return{visible:r,more:Math.max(0,e.length-r.length)}}const Ty=s.forwardRef(function({projectId:t,brand:n,engines:r,parentId:a,initialBrief:i,suppressDraftRestore:l,startScene:u,startSetup:f,startPresenter:h,startProduct:p,startRef:g,startView:m,startFresh:w,onSeedsSpent:y,openAttachTab:b,onQueued:k,onSending:S,onAttached:E,onCeiling:C,target:A,holdFor:L,onClearTarget:T,sourceImage:M,onRestoreBranchId:j,setSlug:P,persistDraft:R=!0,variant:H="dock",guided:D=!1},U){var Zd,bf;const{products:V,productsLoaded:B}=cn(),{demoProducts:G,demoProductsLoaded:_,loaded:O}=Mn(),I=ff(),K=I.scenes,z=I.presenters,q=_l(),Z=Vl(),{push:ee}=rr(),he=r.filter(ve=>ve.available),[ue,ge]=Ma(qr.engine,y1);s.useEffect(()=>{const ve=DJ(he,ue);ve!==ue&&ge(ve)},[he,ue,ge]);const te=he.length===0&&r.some(ve=>ve.code==="not-installed"||ve.code==="not-authenticated"),J=he.length===0,Q=J?te?{icon:o.jsx(PR,{}),title:"Image generation is not set up yet",detail:"About a minute, using the ChatGPT account you already have.",action:"Set up",onAct:()=>Z(),info:!0}:{icon:o.jsx(n1,{size:15}),title:"No image provider connected",detail:"Add a provider key and this prompt is ready to run.",action:"Open settings",onAct:()=>q("engines"),info:!1}:null,[ae,$e]=s.useState(ti()),[ie,ke]=s.useState(void 0),[ze,wt,Ke,tt]=S8(qr.format,wie),[De,Se]=s.useState({}),X=A&&A.kind!=="root"?A:null,je=X?Ioe(X.brief):void 0,Re=X?De[X.id]??je??ze:ze,re=ve=>{X?Se(mt=>({...mt,[X.id]:ve})):wt(ve)},[Y,se]=s.useState({}),[Ne,Be,st,Pe]=S8(qr.count,yie),[Oe,Ge]=s.useState(!1),[ft,bt]=s.useState(null),[at,Zt]=s.useState(null),[jt,Ft]=s.useState(!1),[Pt,Tt]=s.useState("All"),[xe,Je]=s.useState(0),[Et,Xe]=s.useState(null),[rt,nt,qt,Yt]=S8(qr.quality,bie),[an,Wt]=s.useState(!1),[Rn,Bt]=s.useState(!1),ne=ve=>Bt(ve);Nr("(hover: hover) and (min-width: 1024px)");const le=Nr("(max-width: 767px)"),ce=s.useRef(null),Ve=s.useRef(null),_e=s.useRef(null),xt=s.useId(),yt={...tt?{format:tt}:{},...Pe?{count:Pe}:{},...Yt?{quality:Yt}:{}},kt=s.useRef({tokens:ae,tplFields:Y,branchId:(A==null?void 0:A.id)??null,lent:yt});kt.current={tokens:ae,tplFields:Y,branchId:(A==null?void 0:A.id)??null,lent:yt};const ot=s.useRef(null),ht=s.useRef(null),Ae=s.useRef(null),me=s.useRef(void 0),et=s.useRef(void 0),Ct=s.useRef(void 0),be=s.useRef(void 0),it=s.useCallback(ve=>{if(Ae.current&&(clearTimeout(Ae.current),Ae.current=null),!R)return;const mt=kt.current;if(mt.branchId)return;const tn=ot.current??mt.tokens;L8(tn,mt.tplFields)?_w(ve,{tokens:tn,tplFields:mt.tplFields,setSlug:P,lent:mt.lent}):V5(ve)},[P,R]);s.useEffect(()=>{b&&(Tt(b),Ft(!0))},[b]);const vt=s.useCallback(ve=>{if(!ve.some(ML)){ot.current=null,ke(ve);return}ot.current=ve,Sie(ve).then(mt=>{ot.current===ve&&(ot.current=null,ke(mt))})},[]),Te=ve=>{Ke(ve.format&&Yr.some(mt=>mt.id===ve.format)?ve.format:null),st(ve.count??null),qt(ve.quality&&oi.some(mt=>mt.id===ve.quality)?ve.quality:null)};s.useEffect(()=>{if(!i)return;const ve=(i.tokens??[]).find(mt=>mt.t==="format");ve&&Ke(ve.id),st(i.variants??null),i.quality&&qt(i.quality),se(i.templateFields??{}),vt(dy(i))},[i]),s.useEffect(()=>{var xf;const ve=ht.current,mt=!!ve&&ve!==n.id;mt&&it(ve);const tn=!R||!mt&&(!!i||!!l),pn=ve!==n.id;let rn=null,Nn=null,Wr=null;if(!tn&&pn){const Dn=_5(n.id);Dn&&L8(Dn.tokens,Dn.tplFields)?(rn=op(n,Dn.tokens),Nn=Dn.tplFields,Wr=Dn.lent??null):mt&&(rn=ti(),Nn={})}mt&&(Ke(null),st(null),qt(null),Se({}));const On=!!u&&u!==me.current||!!h&&h!==et.current||!!p&&p!==Ct.current||!!g&&!u&&g!==be.current;let sr=null;if(w&&On){const Dn=pn?null:kt.current,ts=rn??(Dn?ot.current??Dn.tokens:null),ws=Nn??(Dn==null?void 0:Dn.tplFields)??{};ts&&L8(ts,ws)&&(sr={tokens:ts,tplFields:ws,lent:Wr??(Dn==null?void 0:Dn.lent)??null}),rn=ti(),Nn={},Wr=null,Ke(null),st(null),qt(null)}const ir=()=>pn?ti():kt.current.tokens;let Ia=!1;if(u&&u!==me.current){me.current=u,Ia=!0;const Dn=rn??ir(),ts=Dn.find(Fa=>Fa.t==="template"),ws=(ts==null?void 0:ts.id)??null,N2=((xf=K.find(Fa=>Fa.id===u))==null?void 0:xf.name)??"this place",zd=t7(ws,u,N2,null,null),au=g&&/^[a-f0-9]{32}$/.test(g)?g:null,kf=m&&m in dl?dl[m]:void 0;if((zd.changed||au)&&(rn=[{t:"template",id:u,...f?{setup:f}:{},...au?{view:au,...kf?{viewName:kf}:{}}:{}},...Dn.filter(Fa=>Fa.t!=="template")],zd.toast)){const Fa=zd.toast;ee({kind:"info",title:Fa.title,action:{label:"Undo",onClick:()=>{var Sf,Ef;Fa.prevSceneId?(Sf=ce.current)==null||Sf.insert({t:"template",id:Fa.prevSceneId}):(Ef=ce.current)==null||Ef.removeTemplate()}}})}}if(h&&h!==et.current){et.current=h,Ia=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="character"&&ws.id===h)||(rn=[...Dn,{t:"character",id:h}])}if(p&&p!==Ct.current){Ct.current=p,Ia=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="product"&&ws.id===p)||(rn=[...Dn,{t:"product",id:p}])}if(g&&!u&&/^[a-f0-9]{32}$/.test(g)&&g!==be.current){be.current=g,Ia=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="ref"&&ws.imageHash===g)||(rn=[...Dn,{t:"ref",imageHash:g,label:"Place view"}])}if(rn&&(vt(rn),Nn&&se(Nn)),Wr&&Te(Wr),sr){const Dn=sr,ts=n.id;ee({kind:"info",title:"Started a new shot",action:{label:"Undo",onClick:()=>vq(ts,{tokens:Dn.tokens,tplFields:Dn.tplFields,setSlug:P,lent:Dn.lent??void 0})}})}Ia&&(y==null||y()),ht.current=n.id},[n.id,u,h,p,g]),s.useEffect(()=>{var ve;ie&&((ve=ce.current)==null||ve.setTokens(ie),ke(void 0))},[ie]);const qe=s.useMemo(()=>{var rn;const ve=Yr.find(Nn=>Nn.id===Re)??Yr[0],tn=(((rn=oi.find(Nn=>Nn.id===rt))==null?void 0:rn.edge)??1024)/Math.max(ve.w,ve.h),pn=Nn=>Math.max(256,Math.round(Nn*tn/8)*8);return{t:"format",id:ve.id,w:pn(ve.w),h:pn(ve.h)}},[Re,rt]),Lt=s.useMemo(()=>[qe,...ae],[qe,ae]),Ut=s.useMemo(()=>({tokens:Lt,templateFields:Y,variants:Ne,quality:rt,format:Re}),[Lt,Y,Ne,rt,Re]),Nt=ae.some(ve=>ve.t==="text"?!!ve.v.trim():!0),_t=s.useMemo(()=>{const ve=ae.find(mt=>mt.t==="template");return ve?K.find(mt=>mt.id===ve.id)??null:null},[ae,K]),Me=s.useMemo(()=>{const ve=ae.find(mt=>mt.t==="template");return(ve==null?void 0:ve.id)??null},[ae]),Ze=s.useCallback(ve=>{var Nn,Wr;const mt=(_t==null?void 0:_t.id)??null,tn=(A==null?void 0:A.id)??null,pn=((Nn=K.find(On=>On.id===ve))==null?void 0:Nn.name)??"this place",rn=t7(mt,ve,pn,tn,A?Dr(A):null);if(rn.changed&&((Wr=ce.current)==null||Wr.insert({t:"template",id:ve}),rn.toast)){const On=rn.toast;ee({kind:"info",title:On.title,action:{label:"Undo",onClick:()=>{var sr,ir;On.prevSceneId?(sr=ce.current)==null||sr.insert({t:"template",id:On.prevSceneId}):(ir=ce.current)==null||ir.removeTemplate(),On.branchWasCleared&&tn&&(j==null||j(tn))}}})}},[_t,A,K,ee,j]);s.useImperativeHandle(U,()=>({insertToken:ve=>{var mt;return(mt=ce.current)==null?void 0:mt.insert(ve)},removeToken:ve=>{var mt;return(mt=ce.current)==null?void 0:mt.remove(ve)},applyScene:ve=>Ze(ve),removeTemplate:()=>{var ve;return(ve=ce.current)==null?void 0:ve.removeTemplate()},openAttach:ve=>uo(ve),showAttach:()=>{oe.current||uo("All")},focus:()=>{var ve;return(ve=ce.current)==null?void 0:ve.focus()},submit:()=>{ho()}}));const Qe=s.useMemo(()=>Aie(ae),[ae]),F=Nie(Qe),de=Qoe(ae),we=s.useMemo(()=>Joe(de),[de]),We=s.useRef(Qe);We.current=Qe,s.useEffect(()=>{E==null||E(We.current)},[F,E]),s.useEffect(()=>{var ve;!O||!Me||_t||((ve=ce.current)==null||ve.removeTemplate(),ee({kind:"warning",title:"That place is no longer available",detail:"Removed from the brief."}))},[O,Me,_t,ee]);const Le=s.useRef(null);s.useEffect(()=>(Ae.current&&clearTimeout(Ae.current),Ae.current=setTimeout(()=>it(ht.current??n.id),500),()=>{Ae.current&&clearTimeout(Ae.current)}),[ae,Y,tt,Pe,Yt,A==null?void 0:A.id,n.id,it]),s.useEffect(()=>R?pq():void 0,[R]),s.useEffect(()=>{if(!R)return;const ve=mt=>{const tn=mt.detail;if(tn!==(ht.current??n.id))return;const pn=_5(tn);pn&&(vt(op(n,pn.tokens)),se(pn.tplFields),Te(pn.lent??{}))};return window.addEventListener(S4,ve),()=>window.removeEventListener(S4,ve)},[R,n,vt]),s.useEffect(()=>()=>it(ht.current??n.id),[it]),s.useEffect(()=>{const ve=()=>it(ht.current??n.id);return window.addEventListener("beforeunload",ve),()=>window.removeEventListener("beforeunload",ve)},[it,n.id]);const ct=r.find(ve=>ve.id===ue),Ot=ct?wl(ct.displayName):"This engine",zt=!!A&&A.kind!=="root"&&A.status==="running",Rt=A&&A.kind!=="root"&&A.status==="done"&&A.images.length>0||zt,kn=!!(ct!=null&&ct.supportsEdit),Sn=!!X&&!!je&&je!==Re&&Rt&&!_t,Qn=Sn?jie(gi(je),gi(Re)):null,un=Qn==="crop",gr=Qn==="extend"&&kn,Kt=Yr.find(ve=>ve.id===Re),wr=Kt?`${Kt.label} ${Kt.hint}`:Re,[Hr,wn]=s.useState(null),_o=()=>{A!=null&&A.images[0]&&wn({src:Tr(A.images[0]),kind:"shot",label:Dr(A),noun:"Refining this shot"})},An=Rt&&!_t&&(kn||un||gr)?"edit":"generation",Ks=An==="edit"&&!!A&&H!=="overlay",Ps=Rt?_t?"A place starts a new shot.":un||gr||kn?null:`${(ct==null?void 0:ct.displayName)??"This engine"} cannot edit. This makes a new shot.`:null,on=s.useMemo(()=>{const ve=Yr.find(Nn=>Nn.id===Re)??Yr[0],mt=`Aspect ${ve.label} ${ve.hint}`;if(An==="edit")return mt;const tn=oi.find(Nn=>Nn.id===rt),pn=Ly(ue),rn=pn==="ratio"||!tn?null:pn==="advisory"?`${tn.label}, asking for ${tn.edge} px`:`${tn.label} ${tn.edge} px`;return[mt,`${Ne} shot${Ne===1?"":"s"}`,rn&&`resolution ${rn}`].filter(Boolean).join(", ")},[An,Re,Ne,rt,ue]),yn=s.useRef(void 0),Kn=s.useRef(void 0);s.useEffect(()=>{var pn;const ve=Rt?(A==null?void 0:A.id)??null:null,mt=ve!==yn.current&&yn.current!==void 0;yn.current=ve;const tn=Me!==Kn.current;Kn.current=Me,!(!_t||!Rt)&&(mt&&!tn&&ve?(pn=ce.current)==null||pn.removeTemplate():T==null||T())},[_t,Me,Rt,A,T]);const Ur=(at==null?void 0:at.warnings.filter(ve=>ve.includes("built around a product")))??[],Jn=Sn&&!Nt,Fn=un&&Nt,es=z.length>0&&ae.some(ve=>ve.t==="character"&&!z.some(mt=>mt.id===ve.id)),ca=!Oe&&(Nt||Jn)&&!Fn&&!es&&!!t&&!zt&&!L&&(un||!J),Vo=J&&!un?"Image generation is not set up yet":Oe?"Working on the last one":t?zt?"Wait for this version to finish, or press X to start a new shot":L?"Wait for this refinement to finish":Fn?"This shape is reached by cropping, and a crop uses no words. Clear the prompt, or keep the current shape.":es?"Remove the person who is no longer in your roster":!Nt&&!Jn?"Write a prompt first":null:"Still opening this brand";s.useEffect(()=>{const ve=An==="edit"&&!!A;if(un||!Nt&&!ve){Zt(null);return}Le.current&&clearTimeout(Le.current);const mt=Ut;return Le.current=setTimeout(()=>{Ee.previewBrief(Ut,ue,n.id,ve?A.id:void 0).then(tn=>Zt({...tn,forBrief:mt})).catch(()=>Zt(null))},280),()=>{Le.current&&clearTimeout(Le.current)}},[Ut,ue,n.id,Nt,An,A,un]);const ms=ve=>{var mt;re(ve),(mt=ce.current)==null||mt.focus()},Gs=ve=>{var mt;nt(ve),(mt=ce.current)==null||mt.focus()},Zo=ve=>{var mt;Be(ve),(mt=ce.current)==null||mt.focus()},Ys=ve=>{var mt;ve.preventDefault(),(mt=ce.current)==null||mt.focus()},uo=ve=>{Tt(ve),Je(mt=>mt+1),Ft(!0)},oe=s.useRef(!1);oe.current=jt;const Ie=s.useRef(uo);Ie.current=uo;const lt=s.useCallback(({restore:ve})=>{var mt;oe.current&&(oe.current=!1,Ft(!1),ve&&((mt=ce.current)==null||mt.restoreCaret()))},[]),en=s.useRef(Ze);en.current=Ze;const nn=s.useRef(ae);nn.current=ae;const Zn=s.useCallback(ve=>{var tn;const mt=ve.token;mt.t==="template"?en.current(mt.id):(tn=ce.current)==null||tn.insert(mt)},[]),Tn=s.useCallback(ve=>{var tn,pn;const mt=ve.token;mt.t==="template"?(tn=ce.current)==null||tn.removeTemplate():(pn=ce.current)==null||pn.remove(mt)},[]),Pn=async ve=>{var tn;if(!(ve!=null&&ve.length))return;const mt=Array.from(ve).filter(pn=>pn.type.startsWith("image/"));if(!mt.length){ee({kind:"warning",title:"Only images can be attached here"});return}Wt(!0),bt(null);try{for(const pn of mt.slice(0,4)){const rn=await d1(pn);(tn=ce.current)==null||tn.insert({t:"ref",imageHash:rn,label:Rie(pn.name)})}mt.length>4&&ee({kind:"warning",title:"Only the first 4 images were attached",detail:`${mt.length-4} more ${mt.length-4===1?"was":"were"} skipped. Attach ${mt.length-4===1?"it":"them"} in another pick.`})}catch(pn){bt(String(pn.message??pn)),ee(ln(pn,"Could not attach that image"))}finally{Wt(!1),_e.current&&(_e.current.value="")}},dn=at&&at.forBrief===Ut?at:null,or=s.useMemo(()=>ae.filter(ve=>_0.has(ve.t)).length,[ae]),ua=s.useRef(null),Or=s.useMemo(()=>or===0?(ua.current=null,null):(dn&&(ua.current={cap:Hoe(dn),described:Ooe(dn),preview:dn}),ua.current),[dn,or]),tu=(Or==null?void 0:Or.cap)??null,gs=(Or==null?void 0:Or.preview)??null,fo=(ct==null?void 0:ct.displayName)??"This engine",Bl=or>=Yp?J4:null;s.useEffect(()=>{C==null||C(Bl)},[Bl,C]);const nu=ve=>{const mt=Or==null?void 0:Or.described;return!mt||mt.size===0?!1:ve.t==="product"?mt.has(wc("product",ve.id)):ve.t==="character"?mt.has(wc("character",ve.id)):ve.t==="template"?mt.has(wc("scene",ve.id)):ve.t==="ref"?mt.has(wc("reference",ve.imageHash)):ve.t==="mark"?mt.has(wc("brand",ve.imageHash)):!1},vf=tu!=null?`Described in words: ${fo} pictures ${tu} per shot, products and people first. Drag it earlier to picture it.`:null,Li=_t?Ur.length>0?"This place builds around a product. Attach one.":(gs==null?void 0:gs.warnings.some(ve=>ve.includes("built around a person")))??!1?"This place builds around a person. Without one, only the setting renders.":null:null,ru=ve=>{var Nn,Wr;if(ve.t==="template")return Li;if(ve.t==="product"&&B&&_&&!((V.length?V:((Nn=n.json)==null?void 0:Nn.products)??[]).some(ir=>ir.id===ve.id)||G.some(ir=>ir.id===ve.id)))return"This product is no longer in your library. Remove it from the brief.";if(ve.t==="mark"&&!rf(n.json).some(On=>On.hash===ve.imageHash))return"This mark is no longer in your brand kit. Remove it from the brief.";if(!gs)return null;const mt=(ct==null?void 0:ct.displayName)??"this engine",tn=gs.cap,pn=On=>`${On} won't reach ${mt} this time.`,rn=(On,sr)=>{var ir;return((ir=gs.dropped)==null?void 0:ir.some(Ia=>Ia.role===On&&Ia.id===sr&&Ia.reason==="missing"))??!1};if(ve.t==="ref"&&!gs.attachments.some(On=>On.hash===ve.imageHash))return tn===0?`This reference won't reach ${mt}. Choose an engine that reads images, or remove it.`:tn==null?pn("This reference"):null;if(ve.t==="mark"&&!gs.attachments.some(On=>On.role==="brand"&&On.hash===ve.imageHash))return tn===0?`The brand mark won't reach ${mt}, so the logo can't be drawn from it. Choose an engine that reads images.`:tn==null?`${pn("The brand mark")} The logo can't be drawn from it.`:null;if(ve.t==="mark"){const On=gs.warnings.find(sr=>sr.includes("px across"));if(On)return On}if(ve.t==="product"){const sr=(V.length?V:((Wr=n.json)==null?void 0:Wr.products)??[]).find(ir=>ir.id===ve.id)??G.find(ir=>ir.id===ve.id);if(sr&&!gs.attachments.some(ir=>ir.role==="product"&&ir.id===sr.id))return rn("product",sr.id)?`${sr.name} has no usable photo. Re-add one, or remove this.`:null}if(ve.t==="character"){const On=z.find(sr=>sr.id===ve.id);if(!On&&z.length>0)return"This person is no longer in your roster. Remove them from the brief.";if(On&&!gs.attachments.some(sr=>sr.role==="character"&&sr.id===On.id))return rn("character",On.id)?`${On.name} has no usable photo. Re-add one, or remove this.`:null}return null},wf=s.useCallback(ru,[gs,ct==null?void 0:ct.displayName,Li,V,B,n.json,G,_,z]),vs=s.useCallback(nu,[Or]),ho=async()=>{var mt,tn,pn;if(!ca)return;Ge(!0),bt(null);const ve=ae.flatMap(rn=>rn.t==="text"?[rn.v]:[]).join(" ").replace(/\s+/g," ").trim();S==null||S({said:ve||"Your shot",count:An==="generation"?Ne:1,format:Re});try{if(!t)throw new Error("the workspace is still loading");const rn=await Ee.addNode({projectId:t,parentId:An==="edit"&&A?A.id:a,kind:An,engineId:ue,count:Ne,brief:{...Ut,tokens:op(n,Ut.tokens)},...An==="edit"&&M?{sourceImage:M}:{},...An==="edit"&&Qn?{reshape:Qn}:{}}),Nn=rn.warnings??[];Nn.length===1?ee({kind:"warning",title:"Sent, with one thing to know",detail:Nn[0]}):Nn.length>1&&ee({kind:"warning",title:`Sent, with ${Nn.length} things to know`,detail:Nn.join(" ")}),ot.current=null,(mt=ce.current)==null||mt.setTokens(ti()),se({}),Ke(null),Se({}),st(null),qt(null),R&&V5(n.id),k(rn.id,An,(tn=rn.siblings)==null?void 0:tn.map(Wr=>Wr.id),(pn=rn.siblings)!=null&&pn.length?rn.siblings:[rn])}catch(rn){const Nn=String(rn.message??rn);bt(Nn),ee(ln(rn,"That did not send",ct==null?void 0:ct.displayName)),S==null||S(null)}finally{Ge(!1)}},$i=(Zd=ae.find(ve=>ve.t==="product"))==null?void 0:Zd.id,Ti=$i?V.find(ve=>ve.id===$i)??(((bf=n.json)==null?void 0:bf.products)??[]).find(ve=>ve.id===$i)??G.find(ve=>ve.id===$i)??null:null,yf=Ti?ry(Ti):null,su=D?{brandId:n.id,products:ae.filter(ve=>ve.t==="product").length,presenters:ae.filter(ve=>ve.t==="character").length,scene:!!_t,others:ae.filter(ve=>ve.t==="color"||ve.t==="ref"||ve.t==="mark").length,words:ae.some(ve=>ve.t==="text"&&!!ve.v.trim()),busy:Oe,pickerOpen:jt,refining:An==="edit"&&!!A,engine:J?te?"setup":"settings":"ready"}:null;s.useEffect(()=>{su&&Rk(su)}),s.useEffect(()=>{if(D)return()=>Rk(null)},[D]),s.useEffect(()=>{if(!D||!jt)return;const ve=()=>lt({restore:!0});return window.addEventListener("scenri:guide-close-picker",ve),()=>window.removeEventListener("scenri:guide-close-picker",ve)},[D,jt,lt]),s.useEffect(()=>{if(!D)return;const ve=mt=>{var Nn;const{kind:tn}=mt.detail,pn=tn==="presenter"?"character":tn==="scene"?"template":"product",rn=[...nn.current].reverse().find(Wr=>Wr.t===pn);rn&&((Nn=ce.current)==null||Nn.remove(rn))};return window.addEventListener("scenri:guide-take-back",ve),()=>window.removeEventListener("scenri:guide-take-back",ve)},[D]),s.useEffect(()=>{if(!T)return;const ve=()=>T();return window.addEventListener("scenri:guide-clear-refine",ve),()=>window.removeEventListener("scenri:guide-clear-refine",ve)},[T]),s.useEffect(()=>{if(!D)return;const ve=mt=>{const{tab:tn}=mt.detail;Xe(tn??null),tn&&Ie.current(tn)};return window.addEventListener("scenri:guide-picker",ve),()=>{window.removeEventListener("scenri:guide-picker",ve),Xe(null)}},[D]);const[Ul,Di]=s.useState(!1),Wl=H==="overlay"&&(Ul||ae.some(ve=>ve.t==="text"&&!!ve.v.trim()));return s.useEffect(()=>{H==="overlay"&&Pk({engaged:Wl})},[H,Wl]),s.useEffect(()=>{if(H==="overlay")return()=>Pk(null)},[H]),o.jsxs("div",{className:"sc-composer","data-guide":D?"compose":void 0,onPointerDownCapture:H==="overlay"&&!Ul?()=>Di(!0):void 0,onKeyDownCapture:H==="overlay"&&!Ul?()=>Di(!0):void 0,children:[o.jsx("input",{ref:_e,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ve=>void Pn(ve.target.files)}),Hr&&o.jsx(Cd,{src:Hr.src,kind:Hr.kind,label:Hr.label,noun:Hr.noun,onRestoreFocus:()=>{var ve;return(ve=ce.current)==null?void 0:ve.restoreCaret()},onClose:()=>wn(null)}),jt&&o.jsx(fie,{brand:n,activeProductCategory:yf,refining:Ks,full:Bl,initialTab:Pt,tabNonce:xe,only:Et,id:xt,attached:we,onUpload:()=>{var ve;return(ve=_e.current)==null?void 0:ve.click()},onFiles:ve=>void Pn(ve),onPick:Zn,onRemove:Tn,onClose:lt}),Q&&o.jsx("div",{className:"sc-notes","data-guide-shape":D?"":void 0,children:Q&&o.jsxs("div",{className:"sc-banner","data-tone":"action",children:[o.jsx("span",{className:"sc-banner-ic",children:Q.icon}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:Q.title}),o.jsxs("small",{children:[Q.detail,Q.info&&o.jsxs(gd,{children:[o.jsx(vd,{children:o.jsx("button",{type:"button",className:"sc-note-info","aria-label":"What a ChatGPT account has to do with this",children:o.jsx(mm,{size:13})})}),o.jsxs(wd,{className:"sc-note-pop",align:"start",sideOffset:8,width:"300px",children:[o.jsx("p",{children:"Codex CLI signs in with your ChatGPT account and makes the images there. Every plan includes some Codex usage, so how many images you get depends on the plan you are on."}),o.jsx("p",{children:"No ChatGPT account, or run out for now? Use your own key from an image provider instead."}),o.jsx("p",{className:"sc-note-pop-fine",children:"Scenri never sees your password or token. The sign-in happens in your browser and stays with Codex."}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>q("engines"),children:"Use a provider key instead"})]})]})]})]}),o.jsx("button",{type:"button",className:"sc-banner-act","data-primary":"","data-guide":D?"compose.engine":void 0,onClick:Q.onAct,children:Q.action})]})}),o.jsxs("div",{className:"sc-promptcard","data-guide-shape":D?"":void 0,children:[Rt&&(T||H==="overlay"&&An==="edit")&&o.jsxs("div",{className:"sc-target","data-note":Ps?"":void 0,children:[o.jsx(pie,{target:A,onOpenImage:_o,onClear:T}),Ps&&o.jsx("small",{className:"sc-target-note",children:Ps})]}),Rt&&!T&&Ps&&!(H==="overlay"&&An==="edit")&&o.jsx("small",{className:"sc-target-note sc-target-note-alone",children:Ps}),Sn&&(un||gr)&&o.jsxs("small",{className:"sc-reshape-hint","aria-live":"polite",children:[un?"Will crop to":"Will extend to"," ",wr]}),o.jsx(Foe,{ref:ce,onChange:$e,brand:n,templates:K,presenters:z,demoProducts:G,onTemplatePick:Ze,scenesSitOut:Ks,flag:wf,described:vs,describedNote:vf,onInspect:ve=>wn(ve),onAttachRequest:ve=>uo(ve),activeProductCategory:yf,placeholder:_t?"Add art direction, or run it as written":An==="edit"?"Say what to change about this shot":"What should we shoot? (use $ / @ #)",placeholderSm:_t||An==="edit"?void 0:"What should we shoot? ($ / @ #)",label:_t?"Art direction":An==="edit"?"What to change":"Shot brief",onSubmit:()=>void ho(),onDropFiles:ve=>void Pn(ve)}),o.jsxs("div",{className:"sc-prompt-row",children:[o.jsxs("div",{className:"sc-prompt-left",children:[o.jsx("button",{type:"button",ref:Ve,className:"sc-icon-btn sc-attach-toggle","data-guide":D?"compose.add":void 0,"aria-expanded":jt,"aria-controls":jt?xt:void 0,"aria-label":"Add to shot",title:"Add a product, a person, a place, a colour or an image",onClick:()=>jt?lt({restore:!1}):uo("All"),children:an?o.jsx(Pr,{size:"1"}):o.jsx(mr,{size:16})}),he.length>1&&o.jsxs(TN,{value:ue,onValueChange:ge,children:[o.jsxs(DN,{variant:"ghost",className:"sc-mini-sel",children:[o.jsx(n1,{size:14}),o.jsx("span",{className:"sc-mini-sel-t",children:ct?wl(ct.displayName):"Demo"})]}),o.jsx(HN,{children:he.map(ve=>o.jsx(ON,{value:ve.id,children:wl(ve.displayName)},ve.id))})]})]}),o.jsxs("div",{className:"sc-prompt-right",children:[o.jsx(xie,{mode:An,engineId:ue,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:Zo,quality:rt,onQuality:Gs,onCloseAutoFocus:Ys,guided:D}),o.jsxs(gd,{open:Rn,onOpenChange:ne,children:[o.jsx(vd,{children:o.jsxs("button",{type:"button",className:"sc-var sc-more","aria-label":`Shot settings. ${on}`,"data-guide":D&&!le?"compose.settings":void 0,children:[o.jsx(Hv,{size:14}),"More"]})}),o.jsx(wd,{className:"sc-morepop",align:"end",sideOffset:8,width:"300px",onOpenAutoFocus:$y,onCloseAutoFocus:Ys,children:o.jsx(NL,{mode:An,engineId:ue,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:Zo,quality:rt,onQuality:Gs})})]}),o.jsx(kie,{guide:D&&le?"compose.settings":void 0,mode:An,engineId:ue,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:Zo,quality:rt,onQuality:Gs}),o.jsxs("button",{type:"button",className:"sc-send","data-refine":An==="edit"?"":void 0,"data-guide":D?"compose.send":void 0,"aria-disabled":!ca||void 0,onClick:()=>void ho(),"aria-label":An==="edit"?"Refine":"Generate",title:ft??Li??Vo??`${An==="edit"?"Refine":"Generate"} (enter)`,children:[o.jsx("span",{className:"sc-send-ico",children:Oe?o.jsx(Pr,{size:"1"}):o.jsx(cE,{size:17,weight:"bold"})}),o.jsx("span",{className:"sc-send-lb",children:An==="edit"?"Refine":"Generate"})]})]})]})]})]})});function Rie(e){return e.replace(/\.[a-z0-9]{2,5}$/i,"").trim()||"Image"}function Dy(e,t){s.useLayoutEffect(()=>{if(!e||typeof ResizeObserver>"u")return;const n=document.documentElement,r=()=>n.style.setProperty(t,`${Math.round(e.offsetHeight)}px`);r();const a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect(),n.style.removeProperty(t)}},[e,t])}function PL({full:e=!0,children:t}){const[n,r]=s.useState(null);return Dy(n,"--sc-dock-h"),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-dock-fade","data-full":e,"aria-hidden":!0}),o.jsx("div",{className:"sc-canvas-dock","data-full":e,ref:r,children:t})]})}function Hy(){const{brand:e}=cn(),{tasks:t}=ia(),[n,r]=s.useState(null),[a,i]=s.useState(null),[l,u]=s.useState(()=>Date.now()),f=s.useRef({id:"",pct:0}),h=t.find(y=>y.kind==="catalog"&&y.state==="running");if(s.useEffect(()=>{if(!h)return;const y=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(y)},[h]),!h&&!a)return null;const p=h!=null&&h.id.startsWith("catalog:")?h.id.slice(8):null,g=h!=null&&n===h.id,m=gX(e.json),w=Jr(m==null?void 0:m.file);return h&&(f.current.id!==h.id&&(f.current={id:h.id,pct:0}),f.current.pct=Math.max(f.current.pct,h.percent??0)),o.jsxs(o.Fragment,{children:[h&&o.jsxs("div",{className:"sc-impbar",role:"status",style:{"--sc-impbar-p":`${f.current.pct}%`},children:[o.jsx("span",{className:"sc-impbar-fill","aria-hidden":!0}),o.jsxs("button",{type:"button",className:"sc-impbar-open",onClick:()=>p&&i(p),disabled:!p,"aria-label":"Show import details",children:[o.jsx("span",{className:"sc-impbar-mark","aria-hidden":!0,children:w?o.jsx("img",{src:w,alt:"",className:(m==null?void 0:m.role)==="mark"?"sc-impbar-badge":void 0}):o.jsx(bC,{size:13,weight:"regular"})}),o.jsx("span",{className:"sc-impbar-count",children:h.subtitle}),o.jsx("span",{className:"sc-impbar-clock",children:Dc(h.startedAt,l)})]}),p&&o.jsxs("button",{type:"button",className:"sc-impbar-stop",disabled:g,"aria-label":"Stop importing",onClick:()=>{r(h.id),Ee.cancelCatalogJob(e.id,p).catch(()=>r(null))},children:[o.jsx(jn,{size:12,weight:"bold"}),g?"Stopping":"Stop"]})]}),a&&o.jsx(P4,{brandId:e.id,jobId:a,onDismiss:()=>i(null)})]})}const Pie={presenter:"Person",product:"Product",scene:"Place"};function LL({entry:e,productName:t,productPreviewUrl:n,productId:r,presenterName:a,presenterPreviewUrl:i,presenterId:l,sceneName:u,scenePreviewUrl:f,sceneId:h,onOpen:p,productHref:g,presenterHref:m,sceneHref:w,active:y,hideRecipe:b,decorative:k,size:S="grid"}){const{contentArriving:E}=Mn(),C=[t,a,u].filter(Boolean).join(" · "),A=a?{key:"presenter",name:a,previewUrl:i,linked:!!(m&&l),href:m&&l?m(l):void 0}:null,L=n&&t?{key:"product",name:t,previewUrl:n,linked:!!(g&&r),href:g&&r?g(r):void 0}:null,T=f&&u?{key:"scene",name:u,previewUrl:f,linked:!!(w&&h),href:w&&h?w(h):void 0}:null;return o.jsxs("div",{className:"sc-showcase-tile","data-active":y||void 0,"aria-hidden":k||void 0,...k?{inert:""}:{},children:[o.jsx(Dd,{id:e.id,previewUrl:e.previewUrl,pending:!e.previewUrl&&E,title:e.title,primary:e.title,secondary:b?"":C,useLabel:"Recreate this",variant:"use",onOpen:p,onUse:p,size:S}),(A||L||T)&&o.jsx($ie,{presenter:A,product:L,scene:T})]})}function Lie(e){return o.jsx(n2,{...e,caption:!1})}function $ie({presenter:e,product:t,scene:n}){const[r,a]=s.useState(null),i=[t,n].filter(Boolean),l=i.length+(e?1:0)+Math.max(0,i.length-1);let u=0;const f=()=>({"--i":u++});return o.jsxs("div",{className:"sc-showcase-chips",onMouseLeave:()=>a(null),children:[e&&o.jsx(n7,{credit:e,open:r==="presenter",onEnter:()=>a("presenter"),children:Die(e)}),i.length>0&&o.jsxs("div",{className:"sc-showcase-recipe",style:{"--n":l},children:[e&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),i.map((h,p)=>o.jsxs(s.Fragment,{children:[p>0&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),o.jsx(n7,{credit:h,open:r===h.key,onEnter:()=>a(h.key),style:f(),children:Tie({credit:h,step:p===0?1:2})})]},h.key))]})]})}function n7({credit:e,open:t,onEnter:n,children:r,style:a}){const i=s.useRef(null),l=s.useRef(null),[u,f]=s.useState(null),h=fR(),p=h==="large"?144:88,g=h==="large"?168:112;if(s.useLayoutEffect(()=>{var S,E;if(!t||!e.previewUrl){f(null);return}const w=()=>{const C=i.current;if(!C)return;const A=C.getBoundingClientRect(),L=l.current,T=(L==null?void 0:L.offsetWidth)||p,M=(L==null?void 0:L.offsetHeight)||g,j=window.visualViewport,P=$ae(A,{width:(j==null?void 0:j.width)??window.innerWidth,height:(j==null?void 0:j.height)??window.innerHeight},{width:T,height:M});if(!P){f(null);return}f({left:Math.round(P.left),top:Math.round(P.top)})};w();const y=requestAnimationFrame(w),b=i.current,k=b?new ResizeObserver(w):null;return b&&k&&k.observe(b),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),(S=window.visualViewport)==null||S.addEventListener("resize",w),(E=window.visualViewport)==null||E.addEventListener("scroll",w),()=>{var C,A;cancelAnimationFrame(y),k==null||k.disconnect(),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),(C=window.visualViewport)==null||C.removeEventListener("resize",w),(A=window.visualViewport)==null||A.removeEventListener("scroll",w)}},[t,e.previewUrl,e.key,p,g]),!e.previewUrl)return o.jsx("span",{ref:i,className:"sc-credit-tip",onPointerEnter:n,style:a,children:r});const m=Pie[e.key];return o.jsxs("span",{ref:i,className:"sc-credit-tip","data-open":t||void 0,onPointerEnter:n,style:a,children:[r,t&&Br.createPortal(o.jsx("span",{ref:l,className:"sc-credit-tip-pop","data-size":h,style:u?{left:u.left,top:u.top}:{left:-9999,top:0},role:"tooltip","aria-label":`${m}: ${e.name}`,children:o.jsxs("span",{className:"sc-credit-tip-card",children:[o.jsx("img",{src:$n(e.previewUrl,"small"),alt:""}),o.jsx("span",{className:"sc-credit-tip-name",children:e.name}),o.jsx("span",{className:"sc-credit-tip-role",children:m})]})}),document.body)]})}function Tie({credit:e,step:t}){const{name:n,previewUrl:r,linked:a,href:i}=e;return a&&i?o.jsx(Vn,{className:"sc-showcase-chip",to:i,"data-link":!0,"data-step":t,"aria-label":`See ${n}`,onClick:l=>l.stopPropagation(),children:r?o.jsx("img",{src:$n(r,"micro"),alt:""}):null}):o.jsx("span",{className:"sc-showcase-chip","data-step":t,children:r?o.jsx("img",{src:$n(r,"micro"),alt:n}):o.jsx("span",{className:"sc-vh",children:n})})}function Die(e){const{name:t,previewUrl:n,linked:r,href:a}=e;return r&&a?o.jsxs(Vn,{className:"sc-showcase-badge",to:a,"data-link":!0,"aria-label":`See ${t}`,onClick:i=>i.stopPropagation(),children:[n?o.jsx("img",{src:$n(n,"micro"),alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]}):o.jsxs("span",{className:"sc-showcase-badge","aria-hidden":!0,children:[n?o.jsx("img",{src:$n(n,"micro"),alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]})}function r7(e){return{key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(e,"_blank")}}function s7(e){return{key:"select",icon:"select",label:"Select",onSelect:e}}function jl(e){if(e.only)return[{key:"only",icon:"use",label:e.only.label,onSelect:e.only.run}];if(e.draft){const n=[{key:"continue",icon:"continue",label:"Continue",onSelect:e.draft.onContinue}];return e.draft.href&&n.push(r7(e.draft.href)),e.select&&n.push(s7(e.select.run)),n.push({key:"discard",icon:"discard",label:"Discard",onSelect:e.draft.onDiscard,danger:!0,separated:!0}),n}const t=[];return e.onOpen&&t.push({key:"open",icon:"open",label:"Open",onSelect:e.onOpen}),e.href&&t.push(r7(e.href)),e.use&&t.push({key:"use",icon:"use",label:e.use.label,onSelect:e.use.run}),e.select&&t.push(s7(e.select.run)),e.keep&&t.push({key:"keep",icon:e.keep.on?"kept":"keep",label:e.keep.on?"Remove from Keepers":"Add to Keepers",onSelect:e.keep.run}),e.onRename&&t.push({key:"rename",icon:"rename",label:"Rename",onSelect:e.onRename}),e.onDuplicate&&t.push({key:"duplicate",icon:"duplicate",label:"Duplicate person",onSelect:e.onDuplicate}),e.onEdit&&t.push({key:"edit",icon:"edit",label:"Edit person",onSelect:e.onEdit}),e.remove&&t.push({key:"delete",icon:"delete",label:e.remove.label,onSelect:e.remove.run,danger:!0,separated:!0}),t}function cs(e,t){if(e==="draft")return{tool:"Discard",menu:t>1?`Discard ${t} drafts`:"Discard",icon:"discard",danger:!0};const n=e==="presenter"?"Delete person":e==="product"?"Delete product":"Delete place",r=e==="presenter"?"people":e==="product"?"products":"places";return{tool:"Delete",menu:t>1?`Delete ${t} ${r}`:n,icon:"delete",danger:!0}}function ji(e,t){const n=t>1;return e==="owned-scene"?n?"Shots already made here keep their images. Their recipe will say these places are gone, and building from one again will miss them.":"Shots already made here keep their images. Their recipe will say this place is gone, and building from one again will miss it.":e==="product"?n?"Shots already made with them keep their images. Their recipe loses these products, and building from one again will miss them.":"Shots already made with it keep their images. Their recipe loses this product, and building from one again will miss it.":n?"Shots already made with them keep their images. Their recipe loses these people, and building from one again will miss them.":"Shots already made with them keep their images. Their recipe loses this person, and building from one again will miss them."}const a7={scenes:"places",presenters:"people",products:"products"};function m2(e,t,n){return{tool:t?"Remove from keepers":"Keep",menu:e>1?t?`Remove ${e} ${a7[n]} from Keepers`:`Add ${e} ${a7[n]} to Keepers`:t?"Remove from Keepers":"Add to Keepers",icon:t?"kept":"keep"}}function g2({kind:e,count:t,openLabel:n,onOpen:r,href:a,onDeselect:i,onAct:l,onKeep:u,allKept:f}){const h=cs(e,t),p=[{key:"open",icon:n==="Continue"?"continue":"open",label:n,onSelect:r}];if(a&&p.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(a,"_blank")}),p.push({key:"deselect",icon:"select",label:t>1?"Deselect this":"Deselect",onSelect:i}),u&&e!=="draft"){const m=m2(t,!!f,e==="presenter"?"presenters":e==="product"?"products":"scenes");p.push({key:"keep",icon:m.icon,label:m.menu,onSelect:u})}return p.push({key:e==="draft"?"discard":"delete",icon:h.icon,label:h.menu,onSelect:l,danger:h.danger||void 0,separated:!0}),p}async function Jp(e,t){const n=[];let r;for(const a of e)try{await t(a)}catch(i){if((i==null?void 0:i.status)===404)continue;n.push(a),r??(r=i)}return{failed:n,error:r}}function sv({presenter:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDuplicate:u,onEdit:f,onDelete:h,onRename:p,bookmarked:g,onBookmark:m,fresh:w,chosen:y,batching:b,onPick:k,batch:S,size:E="grid"}){const A=S?g2({kind:"presenter",count:S.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>k==null?void 0:k(e.id),onAct:S.onAct,onKeep:S.onKeep,allKept:S.allKept}):jl(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:k?{run:()=>k(e.id)}:void 0,keep:m?{on:!!g,run:()=>m(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,onDuplicate:u?()=>u(e.id):void 0,onEdit:f?()=>f(e.id):void 0,remove:h?{label:"Delete person",run:()=>h(e.id)}:void 0});return o.jsx(Dd,{id:e.id,previewUrl:e.previewUrl,title:e.descriptor||e.name,primary:e.name,secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:A,bookmarked:g,onBookmark:m,fresh:w,chosen:y,batching:b,onPick:k,size:E})}function $L(e){return o.jsx(n2,{...e})}function x1({scene:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,onDelete:h,onRename:p,chosen:g,batching:m,onPick:w,batch:y,size:b="grid"}){const S=y&&h?g2({kind:"owned-scene",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):jl(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,remove:h?{label:"Delete place",run:()=>h(e.id)}:void 0});return o.jsx(Dd,{id:e.id,previewUrl:e.previewUrl,title:e.description||Cl(e,"tooltip"),primary:Cl(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,menu:S,chosen:g,batching:m,onPick:w,size:b})}function TL(e){return o.jsx(n2,{...e})}const Bu=new Map,Hie=50;function Oie(e,t){for(Bu.delete(e),Bu.set(e,t);Bu.size>Hie;)Bu.delete(Bu.keys().next().value)}function Iie(e){return Bu.get(e)}const Fie=1e3;function ds({className:e="sc-home",children:t}){const n=s.useRef(null),{key:r}=Bn(),a=s.useRef(!1);return s.useLayoutEffect(()=>{const i=n.current,l=Iie(r);if(!i||!l)return;let u=!1;const f=()=>{u||(u=!0,a.current=!1,p.disconnect(),clearTimeout(g),i.removeEventListener("wheel",f),i.removeEventListener("touchstart",f))},h=()=>{u||(i.scrollTop=l,Math.abs(i.scrollTop-l)<1&&f())};a.current=!0;const p=new ResizeObserver(h),g=setTimeout(f,Fie);return i.addEventListener("wheel",f,{passive:!0}),i.addEventListener("touchstart",f,{passive:!0}),h(),p.observe(i),i.firstElementChild&&p.observe(i.firstElementChild),f},[r]),s.useEffect(()=>{const i=n.current;if(!i)return;const l=()=>{a.current||Oie(r,i.scrollTop)};return i.addEventListener("scroll",l,{passive:!0}),()=>i.removeEventListener("scroll",l)},[r]),o.jsx("div",{ref:n,className:e,"data-page-scroll":"",children:t})}function v2({title:e,filters:t,active:n,summary:r,onClear:a,density:i,search:l,action:u}){return o.jsxs("div",{className:"sc-filterbar",children:[e?o.jsx("h1",{className:"sc-vh",children:e}):null,t,o.jsxs("div",{className:"sc-filterbar-actions",children:[n&&o.jsxs("span",{className:"sc-lib-count",children:[r,a&&o.jsx("button",{type:"button",className:"sc-lib-clear",onClick:a,children:"Clear"})]}),l,i,u?o.jsx("span",{className:"sc-filterbar-cta",children:u}):null]})]})}function w2({mode:e,group:t}){if(e==="none"||!t)return null;const n=[{value:null,label:t.everyLabel,count:t.everyCount},...t.options.map(r=>({value:r.value,label:r.label,count:r.count}))];return o.jsx(Ry,{"aria-label":t.label,activeKey:t.selected,items:n,onSelect:t.onSelect})}const Oy=o.jsx(eo,{size:21,weight:"regular"});function No({shape:e,title:t,body:n,action:r,mark:a,onRetry:i}){return e==="error"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:t??"Couldn't load this library"}),o.jsx("p",{className:"sc-lookpage-lede",children:n}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:i,children:"Retry"})})]}):e==="cold"?o.jsxs("div",{className:"sc-canvas-empty",children:[t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r&&o.jsx("div",{className:"sc-lookpage-acts",children:r})]}):o.jsxs("div",{className:"sc-lib-zero",children:[a&&o.jsx("span",{className:"sc-lib-zero-mark","aria-hidden":!0,children:a}),t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r]})}function y2({noun:e,q:t,facet:n,onClearSearch:r,onClearAll:a}){const i=t.trim(),l=i?o.jsxs(o.Fragment,{children:["No ",e," found for ",o.jsxs("em",{children:["“",i,"”"]}),n?` in ${n}`:""]}):o.jsxs(o.Fragment,{children:["No ",e," in ",n]});return o.jsx(No,{shape:"zero",body:l,action:o.jsxs("span",{className:"sc-lib-zero-acts",children:[i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:r,children:"Clear search"}),i&&n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear all"}),!i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear filter"})]})})}const _ie=150;function hf(e){const[t,n]=Al(),r=t.get("q")??"",a=e.join(","),i=s.useMemo(()=>{const E={};for(const C of a.split(",").filter(Boolean))E[C]=t.get(C)||null;return E},[t,a]),l=s.useCallback(E=>{n(C=>{const A=new URLSearchParams(C);for(const[L,T]of Object.entries(E))T===null||T===""?A.delete(L):A.set(L,T);return A},{replace:!0})},[n]),[u,f]=s.useState(r),h=s.useRef(r),p=s.useRef(null),g=s.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]);s.useEffect(()=>{r!==h.current&&(h.current=r,g(),f(r))},[r,g]),s.useEffect(()=>g,[g]);const m=s.useCallback(E=>{f(E),g(),p.current=setTimeout(()=>{p.current=null,h.current=E,l({q:E||null})},_ie)},[l,g]),w=s.useCallback((E,C)=>l({[E]:C}),[l]),y=l,b=u.trim().length>0||Object.values(i).some(Boolean),k=s.useCallback(()=>{g(),f(""),h.current="",l({q:null})},[l,g]),S=s.useCallback(()=>{g(),f(""),h.current="";const E={q:null};for(const C of a.split(",").filter(Boolean))E[C]=null;l(E)},[l,g,a]);return{q:u,setQ:m,facets:i,setFacet:w,setFacets:y,active:b,clearSearch:k,clear:S}}const Vie=6,il=new Map;function o7(e){return il.get(e)??null}function Zie(e){if(e.key)for(il.delete(e.key),il.set(e.key,e);il.size>Vie;)il.delete(il.keys().next().value)}function zie(e){for(const[t,n]of il)n.brandId===e&&il.delete(t)}const Bie=8;function Uie(){var je;const{engines:e,scenes:t,loaded:n,presenters:r,presentersLoaded:a,demoProducts:i,showcase:l,showcaseCategories:u,showcaseLoaded:f,showcaseError:h,refetchShowcase:p}=Mn(),{brand:g,workspace:m,root:w,products:y,applyNodes:b}=cn(),k=t,{poke:S}=ia(),E=Zl(),C=Un(),{push:A}=rr(),L=Cy(),T=d2(),M=bae(),j=Nr(la),{q:P,setQ:R,facets:H,setFacet:D,clearSearch:U,clear:V}=hf(["category"]),B=H.category,G=Re=>D("category",Re),_=P.trim().length>0,[O,I]=Ma(qr.wallDensity,bd),K=Jc(O),z=Re=>I(Re),q=t2(K),Z=Jm(K),ee=fQ[K],he=Re=>{const re=new URLSearchParams(Re??{}).toString();C(`${Sr(g)}${re?`?${re}`:""}`)},ue=y.length?y:((je=g.json)==null?void 0:je.products)??[],ge=Re=>{var Ne,Be,st;const re=(Ne=Re.brief.tokens.find(Pe=>Pe.t==="product"))==null?void 0:Ne.id,Y=(Be=Re.brief.tokens.find(Pe=>Pe.t==="character"))==null?void 0:Be.id,se=(st=Re.brief.tokens.find(Pe=>Pe.t==="template"))==null?void 0:st.id;return{product:re?i.find(Pe=>Pe.id===re):void 0,presenter:Y?r.find(Pe=>Pe.id===Y):void 0,scene:se?k.find(Pe=>Pe.id===se):void 0}},te=s.useMemo(()=>{const Re=new Map;for(const re of l){const{product:Y,presenter:se,scene:Ne}=ge(re);Re.set(re.id,yae(re,{product:Y,presenter:se,scene:Ne},n6(re.category)))}return Re},[l,i,r,k]),J=s.useMemo(()=>(B?l.filter(re=>re.category===B):l).filter(re=>Ho(te.get(re.id)??re.title,P)),[l,B,P,te]),Q=s.useMemo(()=>{const Re=Eae(u);return{key:"category",label:"Categories",everyLabel:"All examples",everyCount:l.length,selected:B,onSelect:G,options:Re.map(re=>({value:re,label:n6(re)??re,count:l.filter(Y=>Y.category===re).length}))}},[l,u,B,G]),ae=Re=>{const{product:re,presenter:Y,scene:se}=ge(Re);return{productName:re?Do(re,"chip"):null,productPreviewUrl:(re==null?void 0:re.previewUrl)??null,productId:(re==null?void 0:re.id)??null,presenterName:(Y==null?void 0:Y.name)??null,presenterPreviewUrl:Y?ki(Y).src:null,presenterId:(Y==null?void 0:Y.id)??null,sceneName:se?Cl(se,"chip"):null,scenePreviewUrl:(se==null?void 0:se.previewUrl)??null,sceneId:(se==null?void 0:se.id)??null}},[$e,ie]=s.useState(null),ze=j?M:Re=>{const re=l.find(Y=>Y.id===Re);re&&(ie(X4(re)),A({kind:"info",title:`Starting from "${re.title}"`}))},wt=()=>{const re=[...Ci(g.id)].reverse().find(Y=>k.some(se=>se.id===Y));he(re?{place:re,attach:"products",compose:"1"}:{attach:"products",compose:"1"})},Ke=s.useMemo(()=>Tp(sf(g),r),[g,r]),tt=Ke.slice(0,ee),De=s.useMemo(()=>{const Re=Ci(g.id);return Tp(Qc(g),mL(k,re=>Re.includes(re.id)))},[k,g]),Se=De.slice(0,ee),X=s.useMemo(()=>{var st,Pe,Oe,Ge,ft;const Re=new Set,re=bt=>!bt||Re.has(bt)?null:(Re.add(bt),$n(bt,"tile")),Y=bt=>{for(const at of bt){const Zt=l.find(Ft=>Ft.id===at&&Ft.previewUrl),jt=re(Zt==null?void 0:Zt.previewUrl);if(jt)return jt}return null},se=bt=>{for(const at of bt){const Zt=k.find(Ft=>Ft.id===at&&Ft.previewUrl),jt=re(Zt==null?void 0:Zt.previewUrl);if(jt)return jt}return null},Ne=bt=>{for(const at of l)if(!(!at.previewUrl||Re.has(at.previewUrl))&&!(bt&&!at.brief.tokens.some(Zt=>Zt.t===bt)))return re(at.previewUrl);return null},Be=ue.find(bt=>{var at,Zt;return Jr((Zt=(at=bt==null?void 0:bt.shots)==null?void 0:at[0])==null?void 0:Zt.file)});return{compose:re(Be?Jr((Pe=(st=Be.shots)==null?void 0:st[0])==null?void 0:Pe.file):null)??Y(["c15-orange-pool","orris-waterline","hoops-painted-canvas"])??re((Oe=i.find(bt=>bt.id==="calder-vane-c15-serum"))==null?void 0:Oe.previewUrl)??re((Ge=i.find(bt=>bt.previewUrl))==null?void 0:Ge.previewUrl)??Ne("product"),product:Y(["ridgeline-tyre-top","ridgeline-boulder-gap","yuzu-ice-burst"])??re((ft=i.find(bt=>bt.id==="voss-rowe-ridgeline-trail"))==null?void 0:ft.previewUrl)??Ne("product"),presenter:re(ki(r.find(bt=>bt.id==="odette")??r.find(bt=>bt.avatarUrl)??r[0]??{}).src)??Ne("character"),scene:se(["travertine-window-light","palm-shade-garden","lantern-room","cobalt-container","sunlit-color-field"])??Y(["lounge-chair-travertine","lounge-chair-snowfall","capsule-model-village"])??Ne("template")}},[k,r,ue,i,l]);return o.jsx(af.Provider,{value:Z,children:o.jsxs(ds,{children:[o.jsxs("main",{className:"sc-main",id:"main","data-no-dock":j||void 0,children:[o.jsxs("h1",{className:"sc-greet",children:["Compose a shot ",o.jsx("em",{children:"on brand"})]}),o.jsxs("div",{className:"sc-create-grid",children:[o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":"compose","data-main":"",onClick:wt,children:[o.jsx(DL,{thumbUrl:X.compose,fallback:o.jsx(XS,{size:22,weight:"fill"})}),o.jsx("b",{children:"Create an image"})]}),o.jsx(c6,{tone:"product",title:"Add a product",count:ue.length,thumbUrl:X.product,icon:o.jsx(gm,{size:22,weight:"fill"}),onClick:()=>E("product")}),o.jsx(c6,{tone:"presenter",title:"Create a person",thumbUrl:X.presenter,icon:o.jsx(OF,{size:22,weight:"fill"}),onClick:()=>E("presenter")}),o.jsx(c6,{tone:"scene",title:"Create a place",thumbUrl:X.scene,icon:o.jsx(RF,{size:22,weight:"fill"}),onClick:()=>E("scene")})]}),(!f||h||l.length>0)&&o.jsxs("section",{children:[!f&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Z,style:q,"aria-hidden":!0,children:o.jsx(Lie,{size:"grid",count:8})}),f&&h&&o.jsxs("p",{className:"sc-feed-empty",children:["Couldn't load the showcase gallery."," ",o.jsx("button",{type:"button",className:"sc-sec-more",onClick:()=>p(),children:"Retry"})]}),f&&!h&&l.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(v2,{filters:o.jsx(w2,{mode:"tabs",group:Q}),search:l.length>=Bie&&o.jsx(_d,{value:P,onChange:R,noun:"examples",total:l.length}),density:o.jsx(e2,{value:K,onChange:z})}),J.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":Z,style:q,children:J.map(Re=>o.jsx(LL,{entry:Re,size:"grid",hideRecipe:!0,onOpen:ze,productHref:re=>Ea(g,re),presenterHref:re=>Ra(g,re),sceneHref:re=>zr(g,re),...ae(Re)},Re.id))}),J.length===0&&(_?o.jsx(y2,{noun:"examples",q:P,facet:B?n6(B):null,onClearSearch:U,onClearAll:V}):o.jsx("p",{className:"sc-looks-empty",children:"No example carries that category yet."}))]})]}),(!a||tt.length>0)&&o.jsxs("section",{children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"People"})}),a?o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Z,style:q,children:tt.map(Re=>o.jsx(sv,{presenter:Re,variant:"navigate",size:"grid",onOpen:L},Re.id))}):o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Z,style:q,"aria-hidden":!0,children:o.jsx($L,{size:"grid",count:ee})}),(!a||Ke.length>tt.length)&&o.jsx("div",{className:"sc-lib-more",children:o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:ui(g),children:a?`Show all ${Ke.length} people`:"Show all people"})})]}),(!n||Se.length>0)&&o.jsxs("section",{children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Places"})}),n?o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Z,style:q,children:Se.map(Re=>o.jsx(x1,{scene:Re,variant:"navigate",size:"grid",onOpen:T},Re.id))}):o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Z,style:q,"aria-hidden":!0,children:o.jsx(TL,{size:"grid",count:ee})}),(!n||De.length>Se.length)&&o.jsx("div",{className:"sc-lib-more",children:o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:ml(g),children:n?`Show all ${De.length} places`:"Show all places"})})]})]}),!j&&o.jsxs(PL,{children:[o.jsx(Hy,{}),o.jsx(Ty,{projectId:(m==null?void 0:m.id)||null,brand:g,engines:e,parentId:w,initialBrief:$e,onQueued:(Re,re,Y,se)=>{se!=null&&se.length&&b(se),S(),zie(g.id),C(Sr(g))}})]})]})})}function c6({tone:e,title:t,icon:n,count:r,thumbUrl:a,onClick:i}){return o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":e,onClick:i,children:[o.jsx(DL,{thumbUrl:a,fallback:n}),o.jsxs("b",{children:[t,r?o.jsx(kN,{variant:"soft",radius:"full",size:"1",children:r}):null]})]})}function DL({thumbUrl:e,fallback:t}){return o.jsx("span",{className:"sc-glyph","data-photo":e?"":void 0,"aria-hidden":!0,children:e?o.jsx("span",{className:"sc-glyph-shot",children:o.jsx("img",{src:e,alt:"",loading:"lazy"})}):t})}function HL({id:e,name:t,hash:n,drawing:r,state:a,href:i,blank:l,onDiscard:u,chosen:f,batching:h,onPick:p,batch:g}){const m=Un(),w=qw(),y=g?g2({kind:"draft",count:g.count,openLabel:"Continue",onOpen:()=>m(i),href:i,onDeselect:()=>p==null?void 0:p(e),onAct:g.onAct}):jl(u?{draft:{onContinue:()=>m(i),href:i,onDiscard:()=>u(e)},select:p?{run:()=>p(e)}:void 0}:{onOpen:()=>m(i),href:i}),b=o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":!0,"data-building":r||void 0,"data-picked":f||void 0,"data-batching":h||void 0,children:[o.jsxs(Vn,{className:"sc-lookcard-media",to:i,"aria-label":h?`${f?"Deselect":"Select"} ${t}`:`Continue ${t}`,onClick:k=>{h&&p&&(k.preventDefault(),p(e))},children:[n?o.jsx("img",{src:gn(n,"tile"),alt:""}):o.jsx("span",{className:"sc-lookcard-blank",children:l}),r&&o.jsx(La,{}),o.jsx("span",{className:"sc-draftmark",children:"Draft"})]}),p&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":f||void 0,"aria-pressed":!!f,"aria-label":f?`Deselect ${t}`:`Select ${t}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),p(e)},children:o.jsx(Gn,{size:13,weight:"bold"})}),u&&!h&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Discard ${t}`,onClick:()=>u(e),children:o.jsx(jn,{size:13})}),o.jsxs("span",{className:"sc-lookcard-cap",children:[o.jsx("b",{dir:"auto",children:t}),o.jsx("span",{children:a})]})]});return w?b:o.jsxs(X1,{children:[o.jsx(Q1,{children:b}),o.jsx(J1,{children:y.map(k=>o.jsxs("span",{style:{display:"contents"},children:[k.separated&&o.jsx(Vm,{}),o.jsxs(ef,{color:k.danger?"red":void 0,onSelect:k.onSelect,children:[o.jsx(ad,{name:k.icon}),k.label]})]},k.key))})]})}function Iy({title:e,name:t,maxLength:n,busy:r,error:a,onConfirm:i,onDismiss:l}){const[u,f]=s.useState(t),h=s.useRef(null),p=s.useRef(!1),g=u.trim(),m=g.length>0,w=b=>{b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)};s.useEffect(()=>{p.current=!1,w(h.current)},[t]),s.useEffect(()=>{r||(p.current=!1)},[r]);const y=()=>{if(!(!m||r||p.current)){if(g===t.trim())return l();p.current=!0,i(g)}};return o.jsxs(Ws,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:l,onOpenAutoFocus:b=>{b.preventDefault();const k=h.current;k&&(k.focus(),k.select(),w(k))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:e}),o.jsx(Ms,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("textarea",{ref:h,className:"sc-pdetails-field",value:u,dir:"auto",rows:1,maxLength:n,"aria-label":"Name",onChange:b=>{f(b.target.value),w(b.currentTarget)},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),y())}})]}),a&&o.jsx("p",{className:"sc-assetform-err",children:a})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:l,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!m||r,"data-busy":r||void 0,onClick:y,children:r?"Saving":"Save"})]})]})}function OL({since:e}){const[t,n]=s.useState(Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[]),o.jsx("span",{className:"sc-cell-tag",role:"timer","aria-label":`${Uw(e,t)}, ${Dc(e,t)}`,children:Dc(e,t)})}function Wie({build:e,onCancel:t,onRetry:n,onDismiss:r}){const a=e.stage==="failed",i=a?co(e.error):null;return o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":a||void 0,"data-building":!a||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[o.jsx("span",{className:"sc-lookcard-blank"}),!a&&o.jsxs(o.Fragment,{children:[o.jsx(La,{since:e.startedAt}),o.jsx(OL,{since:e.startedAt})]}),!a&&t&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Stop building ${e.name}`,onClick:()=>t(e.id),children:o.jsx(jn,{size:13})}),a&&r&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Dismiss ${e.name}`,onClick:()=>r(e.id),children:o.jsx(jn,{size:13})}),a&&n&&o.jsxs("button",{type:"button",className:"sc-lookcard-use",onClick:()=>n(e),children:[o.jsx(nE,{size:12})," Try again"]})]}),i?o.jsxs("span",{className:"sc-lookcard-cap",title:i.raw,children:[o.jsx("b",{dir:"auto",children:e.name}),o.jsx("span",{children:i.title})]}):null]})}function Fy({count:e,loaded:t,tool:n,icon:r,danger:a,onAct:i,keep:l,onClear:u,onSelectAll:f}){return o.jsxs("div",{className:"sc-picked",role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),t>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<t?f:u,children:e<t?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsxs("span",{className:"sc-picked-tools",children:[l&&o.jsx(u6,{label:l.label,onClick:l.onAct,children:o.jsx(eo,{size:17,weight:l.filled?"fill":"regular"})}),o.jsx(u6,{label:n,tone:a?"danger":void 0,onClick:i,children:o.jsx(Kie,{name:r})})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(u6,{label:"Done",onClick:u,children:o.jsx(jn,{size:16,weight:"bold"})})})]})}function Kie(e){return o.jsx(Ml,{size:17})}function u6({label:e,tone:t,onClick:n,children:r}){return o.jsx(hr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}const N0=()=>({kind:null,ids:new Set});function _y(e){const[t,n]=s.useState(N0),r=s.useCallback(()=>n(N0()),[]);s.useEffect(()=>{r()},[e,r]),s.useEffect(()=>{if(t.ids.size===0)return;const p=g=>{g.defaultPrevented||g.key!=="Escape"||r()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t.ids.size,r]);const a=s.useCallback((p,g)=>{n(m=>{if(m.kind&&m.kind!==p)return m;const w=new Set(m.ids);return w.has(g)?w.delete(g):w.add(g),w.size?{kind:m.kind??p,ids:w}:N0()})},[]),i=s.useCallback((p,g)=>{n({kind:p,ids:new Set(g)})},[]),l=s.useCallback(p=>{const g=new Set(p);n(m=>{const w=new Set([...m.ids].filter(y=>g.has(y)));return w.size?{kind:m.kind,ids:w}:N0()})},[]),u=s.useCallback(p=>{n(g=>{if(!g.ids.has(p))return g;const m=new Set(g.ids);return m.delete(p),m.size?{kind:g.kind,ids:m}:N0()})},[]),f=s.useCallback(p=>{t.ids.size===0||p.target.closest(".sc-lookcard, .sc-picked, button, a, input, select, textarea, label, [role], [contenteditable]")||r()},[t.ids.size,r]),h=s.useCallback(p=>t.kind===null||t.kind===p,[t.kind]);return{kind:t.kind,ids:t.ids,toggle:a,selectAll:i,clear:r,retain:l,forget:u,onBlank:f,picking:h,batching:t.kind}}function Vy({label:e}){return o.jsx("div",{className:"sc-starter-rule",children:o.jsx("span",{children:e})})}const d6=60;function k1(e,t){const[n,r]=s.useState(d6);s.useEffect(()=>{r(d6)},[t]);const{visible:a,remaining:i}=Ny(e,n),l=s.useCallback(()=>r(u=>u+d6),[]);return{visible:a,remaining:i,showMore:l}}const Gie=24,Yie=8,f6="__bookmarked";function qie(){const{scenes:e,collections:t,verticals:n,loaded:r,error:a,refetch:i,applyBrand:l,refreshBrands:u}=Mn(),{brand:f}=cn(),h=e,{push:p}=rr(),g=Un(),[m,w]=s.useState(()=>Ci(f.id)),y=Ae=>w(f2("scene",f.id,Ae)),b=d2(),{builds:k,poke:S,studio:E}=ia(),C=Zl(),A=s.useMemo(()=>Qc(f),[f]),L=k.filter(Ae=>Ae.kind==="scene"&&(!Ae.finished||Ae.stage==="failed")),T=!!mn({path:pt.sceneStudio}),[M,j]=s.useState(()=>up(f.id)),P=E.filter(Ae=>Ae.kind==="scene").map(Ae=>`${Ae.id}:${Ae.status}`).join("|");s.useEffect(()=>{T||j(up(f.id))},[T,f.id,P]);const R=s.useMemo(()=>Ose(M,E),[M,E]),[H,D]=s.useState(null),U=Ae=>{Ae.drawing&&Ae.jobId&&Ee.cancelSceneStudioJob(f.id,Ae.jobId).catch(()=>{}),Zse(f.id,Ae.convo),j(up(f.id))},V=Ae=>{const me=R.find(et=>et.convo===Ae);me&&(me.hash||me.drawing?D(me):U(me))},{q:B,setQ:G,facets:_,setFacets:O,clearSearch:I,clear:K}=hf(["vertical","bookmarked"]),z=_.vertical,q=_.bookmarked==="1",Z=_y(`${f.id}|${B}|${z??""}|${q?"1":""}`),ee=B.trim().length>0,[he,ue]=Ma(qr.wallDensity,bd),ge=Jc(he),te=Ae=>ue(Ae),J=t2(ge),Q=Jm(ge),ae=Ae=>g(zr(f,Ae)),[$e,ie]=s.useState(null),[ke,ze]=s.useState(!1),[wt,Ke]=s.useState(null),[tt,De]=s.useState(!1),[Se,X]=s.useState(null),[je,Re]=s.useState(!1),re=s.useCallback(Ae=>{const me=A.find(et=>et.id===Ae);me&&ie(me)},[A]),Y=s.useCallback(Ae=>{const me=A.find(et=>et.id===Ae);me&&(X(null),Ke(me))},[A]),se=async Ae=>{if(!(!wt||tt)){De(!0),X(null);try{l((await Ee.updateScene(f.id,wt.id,{name:Ae})).brand),Ke(null)}catch(me){const et=ln(me,"Could not rename this place");X([et.title,et.detail].filter(Boolean).join(" "))}finally{De(!1)}}},Ne=async()=>{if(!(!$e||ke)){ze(!0);try{l((await Ee.deleteScene(f.id,$e.id)).brand),Z.forget($e.id),ie(null)}catch(Ae){(Ae==null?void 0:Ae.status)===404?(await u(),Z.forget($e.id),ie(null)):p(ln(Ae,"Could not delete this place"))}finally{ze(!1)}}},Be=s.useMemo(()=>q?h.filter(Ae=>m.includes(Ae.id)):z?h.filter(Ae=>Ae.verticals.includes(z)):h,[h,z,q,m]),Pe=!(A.length>0||L.length>0||R.length>0),Oe=[...h,...A].reduce((Ae,me)=>Ae+(m.includes(me.id)?1:0),0),Ge=q&&Oe===0,ft=Ge&&Pe,bt=Ge&&!Pe,at=ee||q&&!ft,Zt=s.useMemo(()=>ft?h:Be,[ft,h,Be]),jt=s.useMemo(()=>Zt.filter(Ae=>Ho(Wp(Ae),B)),[Zt,B]),[Ft,Pt]=s.useState(()=>new Set),{visible:Tt,remaining:xe,showMore:Je}=k1(jt,`${z??""}|${q?"bookmarked":""}|${ft?"browse":""}|${B}`),Et=Ae=>[...A,...h].filter(me=>!me.verticals.length||me.verticals.includes(Ae)).length,Xe=[{value:f6,label:"Keepers",count:Oe},...n.map(Ae=>({value:Ae,label:Ae,count:Et(Ae)}))],rt=h.length>0?"tabs":"none",nt={key:"vertical",label:"Vertical",everyLabel:"All places",everyCount:h.length+A.length,selected:q?f6:z,onSelect:Ae=>O(Ae===f6?{bookmarked:"1",vertical:null}:{bookmarked:null,vertical:Ae}),options:Xe},qt=s.useMemo(()=>A.filter(Ae=>z?!Ae.verticals.length||Ae.verticals.includes(z):!0).filter(Ae=>Ho(Wp(Ae),B)).filter(Ae=>q?m.includes(Ae.id):!0),[A,z,B,q,m]),Yt=q?qt.length>0:R.length>0||L.length>0||qt.length>0,{visible:an,remaining:Wt,showMore:Rn}=k1(qt,`${f.id}|${z??""}|${q?"bookmarked":""}|${B}`),[Bt,ne]=s.useState(null);s.useEffect(()=>{if(!Bt||Wt<=0)return;const Ae=new IntersectionObserver(me=>{me.some(et=>et.isIntersecting)&&Rn()},{root:Bt.closest(".sc-home"),rootMargin:"200% 0px"});return Ae.observe(Bt),()=>Ae.disconnect()},[Bt,Wt,Rn]);const le=()=>{Z.ids.size===1?re([...Z.ids][0]):Re(!0)},ce=[...Z.ids],Ve=ce.length>0&&ce.every(Ae=>m.includes(Ae)),_e=()=>w(jy("scene",f.id,ce,!Ve)),xt=m2(Z.ids.size,Ve,"scenes"),yt=async()=>{if(ke)return;const Ae=[...Z.ids];ze(!0);try{const{failed:me,error:et}=await Jp(Ae,Ct=>Ee.deleteScene(f.id,Ct));await u(),Z.retain(me),Re(!1),et&&p(ln(et,"Could not delete these places"))}finally{ze(!1)}},kt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>C("scene"),children:[o.jsx(mr,{size:12})," Create place"]}),ot=(Ae,me=!1)=>o.jsx("div",{className:"sc-masonry","data-wall":me||void 0,"data-density":!0,"data-density-size":Q,style:J,children:Ae.map(et=>o.jsx(x1,{scene:et,variant:"use",size:"grid",onOpen:ae,href:zr(f,et.id),onUse:b,bookmarked:m.includes(et.id),onBookmark:y},et.id))}),ht=o.jsx(v2,{title:"Places",filters:o.jsx(w2,{mode:rt,group:nt}),density:o.jsx(e2,{value:ge,onChange:te}),search:h.length>=Yie&&o.jsx(_d,{value:B,onChange:G,noun:"places",total:h.length})});return o.jsxs(af.Provider,{value:Q,children:[o.jsx(ds,{children:o.jsxs("main",{className:"sc-looks sc-scenes",id:"main","data-hero":Pe||void 0,onClick:Z.onBlank,children:[!Pe&&ht,Yt&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your places"})}),o.jsxs("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":Q,style:J,children:[!q&&R.map(Ae=>o.jsx(HL,{id:Ae.convo,name:Ae.name||"Untitled place",hash:Ae.hash,drawing:Ae.drawing,state:Fse(Ae),href:gl(f,Ae.convo),blank:o.jsx(kC,{size:44,weight:"thin"}),onDiscard:V},Ae.convo)),H&&o.jsx(Xn,{label:"Discard",title:`Discard ${H.name||"this unfinished place"}?`,body:H.drawing?"The picture being drawn is stopped, and what was drawn here is thrown away. Nothing was saved to the library.":"What was drawn here is thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:Ae=>{Ae||D(null)},onConfirm:()=>{U(H),D(null)}}),!q&&L.map(Ae=>o.jsx(Wie,{build:Ae,onCancel:me=>void Ee.cancelAssetBuild(f.id,me).then(S),onDismiss:me=>void Ee.deleteAssetBuild(f.id,me).then(S),onRetry:()=>C("scene")},Ae.id)),an.map(Ae=>o.jsx(x1,{scene:Ae,variant:"use",size:"grid",onOpen:ae,href:zr(f,Ae.id),onUse:b,bookmarked:m.includes(Ae.id),onBookmark:y,onDelete:re,onRename:Y,chosen:Z.ids.has(Ae.id),batching:Z.batching==="owned-scene",onPick:Z.picking("owned-scene")?me=>Z.toggle("owned-scene",me):void 0,batch:Z.kind==="owned-scene"&&Z.ids.has(Ae.id)?{count:Z.ids.size,onAct:le,onKeep:_e,allKept:Ve}:null},Ae.id))]}),Wt>0&&o.jsx("div",{ref:ne,"aria-hidden":!0}),Wt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Rn,children:["Show ",Math.min(Wt,60)," more"]})}),wt&&o.jsx(Iy,{title:"Rename place",name:wt.name,maxLength:60,busy:tt,error:Se,onConfirm:Ae=>void se(Ae),onDismiss:()=>{tt||Ke(null)}}),$e&&o.jsx(Xn,{label:"Delete place",title:`Delete ${$e.name}?`,body:ji("owned-scene",1),open:!0,busy:ke,onOpenChange:Ae=>{!Ae&&!ke&&ie(null)},onConfirm:()=>void Ne()}),je&&o.jsx(Xn,{label:cs("owned-scene",Z.ids.size).menu,title:`${cs("owned-scene",Z.ids.size).menu}?`,body:ji("owned-scene",Z.ids.size),open:!0,busy:ke,onOpenChange:Ae=>{!Ae&&!ke&&Re(!1)},onConfirm:()=>void yt()})]}),Pe&&r&&!a&&h.length>0&&o.jsx(No,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Build your own ",o.jsx("em",{children:"place"})]}),body:"Upload a few pictures of a location, or describe one, and its light and materials carry into every image you make.",action:kt}),Yt&&r&&!a&&Be.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri places"})}),Pe&&r&&!a&&h.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Vy,{label:"Or start from one of ours"}),ht]}),!r&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":Q,style:J,"aria-hidden":!0,children:o.jsx(TL,{size:"grid",count:8})}),r&&a&&o.jsx(No,{shape:"error",title:"Couldn't load this library",body:"Something went wrong reaching the catalog.",onRetry:()=>i()}),r&&!a&&!at&&t.map(Ae=>{const me=Zt.filter(be=>be.collections.includes(Ae));if(!me.length)return null;const Ct=Ft.has(Ae)?me:me.slice(0,Gie);return o.jsxs("section",{className:"sc-coll",children:[o.jsx("h2",{children:Ae}),ot(Ct),Ct.length<me.length&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>Pt(be=>new Set(be).add(Ae)),children:["Show all ",me.length]})})]},Ae)}),r&&!a&&at&&Tt.length>0&&ot(Tt,!0),r&&!a&&bt&&o.jsx(No,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a place from its card and it stays here.",mark:Oy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>O({bookmarked:null}),children:"Browse every place"})}),r&&!a&&h.length>0&&!bt&&jt.length===0&&qt.length===0&&o.jsx(y2,{noun:"places",q:B,facet:ft?null:q?"Keepers":z,onClearSearch:I,onClearAll:K}),at&&xe>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Je,children:["Show ",Math.min(xe,60)," more"]})})]})}),o.jsx(Zc,{}),Z.kind==="owned-scene"&&Z.ids.size>0&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Fy,{count:Z.ids.size,loaded:an.length,tool:cs("owned-scene",Z.ids.size).tool,icon:cs("owned-scene",Z.ids.size).icon,danger:!0,onAct:le,keep:{label:xt.tool,filled:Ve,onAct:_e},onClear:Z.clear,onSelectAll:()=>Z.selectAll("owned-scene",an.map(Ae=>Ae.id))})})]})}function Zy(e,t,n=12){const r=t.filter(Boolean).join(","),[a,i]=s.useState({key:"",items:[]});return s.useEffect(()=>{if(!r)return;const l=new AbortController;return Ee.feed(e,{token:r,limit:n},l.signal).then(u=>{l.signal.aborted||i({key:r,items:u.items.filter(f=>f.status==="done"&&f.images.length>0)})}).catch(()=>{}),()=>l.abort()},[e,r,n]),a.key===r?a.items:[]}const av=[{id:"top-down",label:"Top down",camera:"Directly overhead, looking straight down, the subject centred, deep focus"},{id:"eye-level",label:"Eye level",camera:"Eye level, the subject at a natural three-quarter angle, medium depth"},{id:"ground",label:"Ground level",camera:"Ground level, camera low, the subject close and large in frame, the place rising behind it"},{id:"wide",label:"Wide",camera:"A wide view, the subject small in the frame, the place around it doing the talking"},{id:"close",label:"Close",camera:"Close in on the subject, its surface, edge and material filling the frame"}],IL=4;function Xie(e,t=""){var u,f;const n=[],r=((u=e.refs)==null?void 0:u.length)??0;r>0&&n.push(`read from ${r} ${r===1?"photograph":"photographs"}`);const a=((f=e.setups)==null?void 0:f.length)??0;a>0&&n.push(`${a} ${a===1?"way":"ways"} to shoot it`);const i=n.join(" · "),l=i?`${i.charAt(0).toUpperCase()}${i.slice(1)}.`:"";return[t.trim(),l].filter(Boolean).join(" ")}function zy({to:e,wall:t,where:n}){return o.jsxs("div",{className:"sc-lookpage-crumb",children:[o.jsx(Vn,{to:e,children:t}),o.jsx("span",{children:"/"}),o.jsx("span",{children:n})]})}function By({kind:e,brandId:t,id:n}){const[r,a]=s.useState(()=>Ed(e,t).includes(n));s.useEffect(()=>{a(Ed(e,t).includes(n))},[e,t,n]);const i=r?"Remove from Keepers":"Add to Keepers";return o.jsx(hr,{label:i,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-lookpage-keep","data-kept":r||void 0,"aria-pressed":r,"aria-label":i,onClick:()=>a(f2(e,t,n).includes(n)),children:o.jsx(eo,{size:15,weight:r?"fill":"regular"})})})}function Qie({items:e,placeholder:t,open:n,hit:r,onRemove:a,onOpen:i}){return o.jsxs("div",{className:"sc-chipfield","data-state":n?"open":void 0,children:[r,o.jsxs("span",{className:"sc-chipfield-row",children:[e.length===0&&t?o.jsx("span",{className:"sc-chipfield-ph",children:t}):null,e.map(l=>o.jsxs("span",{className:"sc-chipfield-chip",onClick:()=>i==null?void 0:i(),children:[l,a&&o.jsx("button",{type:"button","data-role":"remove","aria-label":`Remove ${l}`,onPointerDown:u=>u.stopPropagation(),onClick:u=>{u.preventDefault(),u.stopPropagation(),a(l)},children:o.jsx(jn,{size:10,weight:"bold"})})]},l))]}),o.jsx(xl,{size:13,className:"sc-chipfield-caret","aria-hidden":!0})]})}function Jie({value:e,onChange:t,options:n,label:r,placeholder:a="Any",findPlaceholder:i="Find or add",emptyNote:l="Nothing by that name.",max:u=12,maxLength:f=40}){const[h,p]=s.useState(!1),[g,m]=s.useState(""),w=s.useRef(null),y=[...n,...e.filter(L=>!n.some(T=>Lu(T,L)))],b=g.trim(),k=b?y.filter(L=>L.toLowerCase().includes(b.toLowerCase())):y,S=e.length>=u,E=b.length>0&&!y.some(L=>Lu(L,b))&&!S,C=L=>{const T=e.some(M=>Lu(M,L));!T&&S||t(T?e.filter(M=>!Lu(M,L)):[...e,L])},A=()=>{var L;E&&(t([...e,b.slice(0,f)]),m(""),(L=w.current)==null||L.focus())};return s.useEffect(()=>{if(!h)return;const L=setTimeout(()=>{var T;return(T=w.current)==null?void 0:T.focus()},0);return()=>clearTimeout(L)},[h]),o.jsxs(Cs,{open:h,onOpenChange:L=>{p(L),L||m("")},children:[o.jsx(Qie,{items:e,placeholder:a,open:h,onOpen:()=>p(!0),onRemove:L=>t(e.filter(T=>!Lu(T,L))),hit:o.jsx(js,{children:o.jsx("button",{type:"button",className:"sc-chipfield-hit","aria-label":r})})}),o.jsxs(As,{align:"start",sideOffset:6,className:"sc-menu sc-chippick-menu",children:[o.jsx("input",{ref:w,className:"sc-chippick-find",type:"text",value:g,maxLength:f,placeholder:i,"aria-label":i,onChange:L=>m(L.target.value),onKeyDown:L=>{L.stopPropagation(),L.key==="Enter"?(L.preventDefault(),E?A():k.length===1&&C(k[0])):L.key==="Escape"&&p(!1)}}),o.jsxs("div",{className:"sc-chippick-list",children:[k.map(L=>{const T=e.some(M=>Lu(M,L));return o.jsxs(Wn,{className:"sc-menu-item","data-on":T||void 0,"data-off":!T&&S?"":void 0,onSelect:M=>{M.preventDefault(),C(L)},children:[o.jsx("span",{className:"sc-menu-lb",children:L}),T&&o.jsx(Gn,{size:14,className:"sc-menu-check","aria-hidden":"true"})]},L)}),!k.length&&!E&&o.jsx("p",{className:"sc-chippick-none",children:l})]}),E&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(Wn,{className:"sc-menu-item",onSelect:L=>{L.preventDefault(),A()},children:[o.jsx(mr,{size:16,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:['Add "',b,'"']})]})]}),S&&o.jsx("p",{className:"sc-chippick-none",children:"That is as many as this holds."})]})]})}const Lu=(e,t)=>e.trim().toLowerCase()===t.trim().toLowerCase();function FL({name:e,categories:t,known:n,hint:r,ways:a,wayChoices:i,wayMax:l,busy:u,error:f,onSave:h,onDismiss:p}){const[g,m]=s.useState(e),[w,y]=s.useState(t),[b,k]=s.useState(()=>[...a??[]]),S=g.trim(),E=S.length>0,C=M=>M.map(j=>j.id).join(" "),A=S!==e.trim()||w.join(" ")!==t.join(" ")||!!a&&C(b)!==C(a),L=b.length>=(l??Number.POSITIVE_INFINITY)?[]:(i??[]).filter(M=>!b.some(j=>j.id===M.id)),T=()=>{if(!(!E||u)){if(!A)return p();h({name:S,categories:w,...a?{ways:b}:{}})}};return o.jsxs(Ws,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:p,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ms,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{className:"sc-pdetails-field",value:g,dir:"auto",onChange:M=>m(M.target.value),onKeyDown:M=>M.key==="Enter"&&T()})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Categories"}),o.jsx(Jie,{value:w,onChange:y,options:n,label:"Categories",placeholder:"Any",findPlaceholder:"Find or add a category",emptyNote:"Nothing by that name.",maxLength:30}),o.jsx("span",{className:"sc-pdetails-hint",children:r})]}),a&&o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Ways to shoot it"}),o.jsxs("div",{className:"sc-pdetails-ways",children:[b.map(M=>o.jsxs("div",{className:"sc-pdetails-way",children:[o.jsx("span",{className:"sc-pdetails-way-lb",children:M.label}),o.jsx("span",{className:"sc-pdetails-way-sub",children:M.camera}),o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":`Remove ${M.label}`,onClick:()=>k(b.filter(j=>j.id!==M.id)),children:o.jsx(jn,{size:13,weight:"bold","aria-hidden":!0})})]},M.id)),L.length>0&&o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-label":"Add a way to shoot it",children:[o.jsx(mr,{size:12,weight:"bold","aria-hidden":!0}),o.jsx("span",{children:"Add a way"})]})}),o.jsx(As,{children:L.map(M=>o.jsx(Wn,{onSelect:()=>k([...b,M]),children:M.label},M.id))})]})]}),o.jsxs("span",{className:"sc-pdetails-hint",children:["A way moves the camera and leaves the world alone.",l?` ${l} at most.`:""]})]}),f&&o.jsx("p",{className:"sc-assetform-err",children:f})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:p,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!E,"data-busy":u||void 0,onClick:T,children:u?"Saving":"Save"})]})]})}function _L(e){const t=s.useRef(null),n=s.useRef(null);s.useLayoutEffect(()=>{const a=t.current,i=n.current;if(!a||!i)return;let l=0;const u=()=>{const p=i.scrollWidth-i.clientWidth;if(p<=1){delete a.dataset.overflowLeft,delete a.dataset.overflowRight;return}i.scrollLeft>2?a.dataset.overflowLeft="":delete a.dataset.overflowLeft,i.scrollLeft<p-2?a.dataset.overflowRight="":delete a.dataset.overflowRight},f=()=>{l||(l=requestAnimationFrame(()=>{l=0,u()}))};u();const h=new ResizeObserver(()=>u());h.observe(i);for(const p of i.children)h.observe(p);return i.addEventListener("scroll",f,{passive:!0}),()=>{l&&cancelAnimationFrame(l),h.disconnect(),i.removeEventListener("scroll",f)}},[e]);const r=s.useCallback(a=>{const i=n.current;if(!(i!=null&&i.firstElementChild))return;const l=i.firstElementChild.getBoundingClientRect().width,u=Number.parseFloat(getComputedStyle(i).columnGap)||0,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;i.scrollBy({left:a*(l+u),behavior:f?"auto":"smooth"})},[]);return{shellRef:t,railRef:n,page:r}}function S1({count:e,label:t,className:n,trackClassName:r,style:a,children:i}){const{shellRef:l,railRef:u,page:f}=_L(e);return o.jsxs("div",{className:n?`sc-rail ${n}`:"sc-rail",ref:l,style:{"--sc-rail-count":e},children:[o.jsx("button",{type:"button",className:"sc-rail-arrow prev","aria-label":`${t}, earlier`,onClick:()=>f(-1),children:o.jsx(Ta,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-rail-arrow next","aria-label":`${t}, later`,onClick:()=>f(1),children:o.jsx(Nl,{size:13,weight:"bold"})}),o.jsx("ol",{className:r?`sc-rail-track ${r}`:"sc-rail-track","aria-label":t,ref:u,style:a,children:i})]})}function b2(){const e=s.useRef(!1);return s.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),s.useCallback(()=>{const t=window.location.pathname;return()=>e.current&&window.location.pathname===t},[])}function qu({variant:e,label:t,isCover:n,onOpen:r,onUse:a,onCover:i,busy:l=!1}){const u=!n&&!!i;return e==="sheet"?o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:l,onClick:a,children:"Use this view"}),u&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:l,onClick:i,children:"Set as cover"})]}):o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-lookcard-use","aria-label":`Use this view: ${t}`,disabled:l,onClick:a,children:"Use this view"}),(r||a||u)&&o.jsx("div",{className:"sc-corner",children:o.jsxs(Cs,{children:[o.jsx(hr,{label:"More",children:o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${t}`,children:[o.jsx(Tv,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx($v,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})}),o.jsxs(As,{side:"bottom",align:"end",sideOffset:4,collisionPadding:12,children:[r&&o.jsxs(Wn,{onSelect:r,children:[o.jsx(ad,{name:"open"}),"Open"]}),a&&o.jsxs(Wn,{disabled:l,onSelect:a,children:[o.jsx(ad,{name:"use"}),"Use this view"]}),u&&o.jsxs(Wn,{disabled:l,onSelect:i,children:[o.jsx(ad,{name:"cover"}),"Set as cover"]})]})]})})]})}function em({label:e,isCover:t}){return o.jsxs("span",{className:"sc-refset-lb","data-cover":t||void 0,"aria-hidden":!0,children:[e,t&&o.jsx("span",{className:"sc-sceneview-cover",children:" · Cover"})]})}const i7=1500;function VL(e,t,n){const{refreshBrands:r}=Mn(),[a,i]=s.useState(null),[l,u]=s.useState([]),[f,h]=s.useState([]),[p,g]=s.useState(!1),[m,w]=s.useState(0),[y,b]=s.useState(!1),k=s.useRef(void 0),S=s.useRef(r);S.current=r,s.useEffect(()=>{if(!t)return;let C=!0,A=null;const L=async()=>{var T;try{const M=await Ee.sceneExamples(e,t);if(!C)return;const j=M.job?`${M.job.id}:${M.job.status}`:null;if(M.job&&M.job.status!=="running"&&k.current!==void 0&&j!==k.current&&await S.current(),!C)return;k.current=j,i(M.job),u(M.first),h(M.more),g(!0),b(!1),((T=M.job)==null?void 0:T.status)==="running"&&(A=setTimeout(L,i7))}catch(M){C&&(M==null?void 0:M.status)!==404&&(A=setTimeout(L,i7*2))}};return L(),()=>{C=!1,A&&clearTimeout(A)}},[e,t,n,m]);const E=s.useCallback(()=>{b(!0),w(C=>C+1)},[]);return{job:a,first:l,more:f,read:p,waiting:y,again:E}}const ele=["no","one","two","three","four","five"];function tle({brandId:e,scene:t,onError:n}){var O;const{applyBrand:r}=Mn(),a=d2(),i=b2(),{job:l,first:u,again:f}=VL(e,t.id,t.placeUrl??null),[h,p]=s.useState(!1),[g,m]=s.useState(!1),[w,y]=s.useState(!1),[b,k]=s.useState(null),S=LM(t.examples,l),E=(l==null?void 0:l.status)==="running",C=Zq(t.examples),A=async()=>{if(g||!u.length)return;const I=i();m(!0),n(null);try{await Ee.drawSceneExamples(e,t.id,{first:!0}),f()}catch(K){I()&&n(String((K==null?void 0:K.message)??K))}finally{I()&&m(!1)}},L=u.length&&(l==null?void 0:l.status)!=="running"?o.jsx("p",{className:"sc-scenepage-examples-ask",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:g,onClick:()=>void A(),children:[C.length?"Draw them again":"Draw it in use",`, ${ele[u.length]??u.length} picture${u.length===1?"":"s"}`]})}):null,T=async I=>{const K=av.find(q=>q.id===I);if(!K||h)return;const z=i();p(!0),n(null);try{const q=t.setups??[];if(!q.some(Z=>Z.id===K.id)){const Z=await Ee.updateScene(e,t.id,{setups:[...q,K]});r(Z.brand)}if(!z())return;a(t.id,K.id)}catch(q){z()&&n(String((q==null?void 0:q.message)??q))}finally{z()&&p(!1)}},M=async I=>{const K=i();y(!0),n(null);try{const z=await Ee.updateScene(e,t.id,{cover:I});r(z.brand)}catch(z){K()&&n(String((z==null?void 0:z.message)??z))}finally{K()&&y(!1)}},j=iQ(t),P=(I,K)=>I?()=>a(t.id,void 0,I,K):void 0,R=t.placeUrl?{src:t.placeUrl,label:pe.emptyLabel,view:"place",...t.previewHash?{hash:t.previewHash}:{}}:null,H=I=>o.jsx(qu,{variant:"sheet",label:I.label,isCover:I.view===j,onUse:P(I.hash,I.view),onCover:()=>void M(I.view),busy:w});if(!S.length&&!R)return o.jsx(ey,{});if(!S.length&&R)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-scenepage-place sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${R.label}, open`,onClick:()=>k(R),children:o.jsx(ja,{src:$n(R.src,"tile"),srcSet:bc(R.src)})}),o.jsx(qu,{variant:"tile",label:R.label,isCover:!0,onOpen:()=>k(R),onUse:P(R.hash,"place")})]}),L,b&&o.jsx(Cd,{src:b.src,kind:"scene",label:b.label,noun:t.name,onClose:()=>k(null),actions:H(b)})]});const D=b==null?void 0:b.tile,U=D!=null&&D.setup?av.find(I=>I.id===D.setup):void 0,V=!!U&&((t.setups??[]).some(I=>I.id===U.id)||(t.setups??[]).length<IL),B=E&&l?Bw({status:l.status,step:l.current,done:l.done.length,total:l.roles.length,error:l.error}):C.length>0?`${C.length===1?`The ${Qa[C[0]].toLowerCase()} shows`:"These show"} an earlier picture of this place.`:null,G=((O=S[0])==null?void 0:O.role)==="hero",_=R?o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame","data-cover":j==="place"||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`The place${j==="place"?", the cover":""}, open`,onClick:()=>k(R),children:o.jsx(ja,{src:$n(R.src,"tile"),srcSet:bc(R.src)})}),o.jsx(qu,{variant:"tile",label:R.label,isCover:j==="place",onOpen:()=>k(R),onUse:P(R.hash,"place"),onCover:()=>void M("place"),busy:w})]}),o.jsx(em,{label:pe.emptyLabel,isCover:j==="place"})]},"place"):null;return o.jsxs(o.Fragment,{children:[o.jsxs(S1,{count:S.length+(R?1:0),label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:[!G&&_,S.map((I,K)=>{const z=Qa[I.role],q=()=>k({src:I.url,label:z,view:I.role,tile:I,...I.hash?{hash:I.hash}:{}});return o.jsxs(s.Fragment,{children:[o.jsxs("li",{children:[I.state==="drawing"?o.jsxs("span",{className:"sc-refset-tile","data-state":"drawing",role:"img","aria-label":`${z}, drawing`,children:[I.url&&o.jsx(ja,{src:$n(I.url,"tile"),srcSet:bc(I.url)}),o.jsx(La,{})]}):I.state==="failed"?o.jsxs("span",{className:"sc-refset-tile","data-state":"failed",role:"img","aria-label":`${z} did not draw`,title:I.error?f1(I.error)??I.error:void 0,children:[o.jsx(zc,{size:20,"aria-hidden":!0}),o.jsx("span",{children:"Did not draw"}),I.error&&o.jsx("small",{className:"sc-refset-why",children:f1(I.error)??I.error})]}):o.jsxs("span",{className:"sc-sceneview-frame","data-cover":j===I.role||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${z}${j===I.role?", the cover":""}, open`,onClick:q,children:o.jsx(ja,{src:$n(I.url,"tile"),srcSet:bc(I.url)})}),o.jsx(qu,{variant:"tile",label:z,isCover:j===I.role,onOpen:q,onUse:P(I.hash,I.role),onCover:()=>void M(I.role),busy:w})]}),o.jsx(em,{label:z,isCover:j===I.role})]}),G&&K===0&&_]},I.role)})]}),B&&o.jsx("p",{className:"sc-scenepage-examples-state","aria-live":"polite",children:B}),L,b&&o.jsx(Cd,{src:b.src,kind:"scene",label:b.label,noun:t.name,onClose:()=>k(null),actions:U&&V?o.jsxs(o.Fragment,{children:[H(b),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:h,onClick:()=>void T(U.id),children:"Shoot it this way"})]}):H(b)})]})}const l7=["hero","place","close","hands","angle","bold"],c7=3;function nle(){var Ke,tt,De,Se,X;const{sceneId:e}=aa(),{scenes:t,loaded:n,error:r,refetch:a,applyBrand:i,refreshBrands:l}=Mn(),{brand:u}=cn(),f=t,h=Un(),p=d2(),g=u.id,[m,w]=s.useState([]),[y,b]=s.useState([]),[k,S]=s.useState(null),[E,C]=s.useState(!1),[A,L]=s.useState(null),T=je=>h(zr(u,je)),M=m1(u,e??""),j=M??f.find(je=>je.id===e);qc(j==null?void 0:j.name);const P=!!M;s.useEffect(()=>{let je=!0;if(w([]),b([]),!P)return Ee.sceneFrames(e??"").then(Re=>{je&&(w(Re.frames),b(Re.views??[]),S(e??""))}).catch(()=>{je&&(w([]),S(e??""))}),()=>{je=!1}},[e,P]);const R=s.useRef(e);R.current=e,p2(()=>{if(P)return;const je=e??"";Ee.sceneFrames(je).then(Re=>{R.current===e&&(w(re=>xi(re,Re.frames)),b(re=>xi(re,Re.views??[])))}).catch(()=>{})});const H=Zy(u.id,[e??""]),D=s.useMemo(()=>{if(!j||P)return[];return f.filter(re=>re.id!==j.id).sort((re,Y)=>Re(Y)-Re(re)).slice(0,8);function Re(re){const Y=re.lighting.split(/[ ,]+/).some(Ne=>Ne.length>3&&j.lighting.toLowerCase().includes(Ne.toLowerCase())),se=re.collections.some(Ne=>j.collections.includes(Ne));return(Y?2:0)+(se?1:0)}},[f,j,P]),U=s.useMemo(()=>{if(j||!n||r)return[];const je=Ci(g);return mL(f,Re=>je.includes(Re.id)).slice(0,6)},[j,n,r,f,g]),[V,B]=s.useState(null),[G,_]=s.useState(!1),[O,I]=s.useState(!1),[K,z]=s.useState(!1),q=s.useRef(!1),Z=b2(),ee=s.useMemo(()=>[...new Set([...f.flatMap(je=>je.verticals),...Qc(u).flatMap(je=>je.verticals)])].sort((je,Re)=>je.localeCompare(Re)),[f,u]),he=async je=>{if(M){I(!0),B(null);try{const Re=await Ee.updateScene(u.id,M.id,{name:je.name,verticals:je.categories,...je.ways?{setups:je.ways}:{}});i(Re.brand),z(!1)}catch(Re){B(String(Re.message??Re))}finally{I(!1)}}},ue=async()=>{if(!M||q.current)return;q.current=!0;const je=Z(),Re=ml(u);_(!0);try{const re=await Ee.deleteScene(u.id,M.id);i(re.brand)}catch(re){if((re==null?void 0:re.status)!==404){q.current=!1,je()&&(B(String(re.message??re)),_(!1));return}await l()}je()&&h(Re,{replace:!0})};if(!n&&!M)return o.jsx(ds,{children:o.jsx("main",{className:"sc-lookpage sc-scenepage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!M)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this place"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!j)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"This place isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed from the catalog, or the link is out of date."}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx(Vn,{className:"sc-btn sc-btn-primary",to:`${Sr(u)}?compose=1`,children:"Start from scratch"}),o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:ml(u),children:"Browse all places"})]}),U.length>0&&o.jsx(od,{label:"You might like",children:U.map(je=>o.jsx(x1,{scene:je,variant:"navigate",size:"slider",onOpen:T,href:zr(u,je.id)},je.id))})]})});const ge=y.length?[...y].sort((je,Re)=>l7.indexOf(je.view)-l7.indexOf(Re.view)).map(je=>({src:je.url,label:je.view==="place"?pe.emptyLabel:Qa[je.view],view:je.view})):m.length?m.map((je,Re)=>({src:je,label:`Example ${Re+1}`})):j.previewUrl?[{src:j.previewUrl,label:j.cover&&j.cover!=="place"?Qa[j.cover]:pe.emptyLabel}]:[],te=async je=>{if(E)return;const Re=Z();C(!0),B(null);try{const{hash:re}=await Ee.pickSceneView(j.id,je);if(!Re())return;p(j.id,void 0,re,je)}catch(re){B(String((re==null?void 0:re.message)??re))}finally{C(!1)}},J=(M==null?void 0:M.setups)??[],Q=((M==null?void 0:M.refs)??[]).filter(je=>je!==(M==null?void 0:M.placeUrl)),ae=((tt=(Ke=M==null?void 0:M.examples)==null?void 0:Ke.find(je=>!je.earlier))==null?void 0:tt.with)??((Se=(De=M==null?void 0:M.examples)==null?void 0:De[0])==null?void 0:Se.with),$e=ae&&(ae==="presenter"?"person":"product"),ie=!!M&&(M.anchor===!0||!!(M.figure&&M.figureTreatment)),ke=M!=null&&M.previewHash||(X=M==null?void 0:M.examples)!=null&&X.length?" Use a view to shoot like it.":"",ze=M?M.figure&&ie?`The person in it is a stand-in: with a person attached, the picture goes with the shot and they take the role.${ke}`:ie?`${$e?`Shown in use with a Scenri demo ${$e}. `:""}Shots are given its picture as their world and find their own frame in it.${ke}`:$e?`Shown in use with a Scenri demo ${$e}. Shots are told the words.${ke}`:M.placeUrl?`Shots are told the words.${ke}`:"":"",wt=M?Xie({refs:Q,setups:M.setups},ze):"";return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx(zy,{to:ml(u),wall:"Places",where:M?"Yours":"Scenri library"}),o.jsx("h1",{children:j.name}),j.verticals.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:j.verticals.map(je=>o.jsx("li",{className:"sc-chip","data-static":!0,children:je},je))}),o.jsx("p",{className:"sc-lookpage-lede",children:j.description}),o.jsxs("div",{className:"sc-lookpage-acts",children:[J.length>0?o.jsxs("span",{className:"sc-splitbtn",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-go",onClick:()=>void p(j.id),children:"Use in a shot"}),o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-more","aria-label":"Use it a way",children:o.jsx(xl,{size:12,weight:"bold","aria-hidden":!0})})}),o.jsx(As,{children:J.map(je=>o.jsx(Wn,{onSelect:()=>void p(j.id,je.id),children:je.label},je.id))})]})]}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void p(j.id),children:"Use in a shot"}),M&&o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:Dw(u,M.id),children:"Edit place"}),o.jsx(By,{kind:"scene",brandId:g,id:j.id}),M&&o.jsx(hr,{label:"Edit name, filing and ways",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name, filing and ways","aria-haspopup":"dialog",onClick:()=>z(!0),children:o.jsx(Ad,{size:17})})})]}),V&&o.jsx("p",{className:"sc-assetform-err",children:V}),M?o.jsx(tle,{brandId:u.id,scene:M,onError:B},M.id):k!==(e??"")?o.jsx(S1,{count:c7,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:Array.from({length:c7},(je,Re)=>o.jsxs("li",{"aria-hidden":!0,children:[o.jsx("span",{className:"sc-sceneview-frame",children:o.jsx("span",{className:"sc-refset-tile","data-state":"loading",children:o.jsx("span",{className:"sc-placeholder"})})}),o.jsx(em,{label:"",isCover:!1})]},Re))}):ge.length>1?o.jsx(S1,{count:ge.length,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:ge.map(je=>o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${je.label}, open`,onClick:()=>L(je),children:o.jsx(ja,{src:$n(je.src,"tile"),srcSet:bc(je.src)})}),je.view&&o.jsx(qu,{variant:"tile",label:je.label,isCover:!1,onOpen:()=>L(je),onUse:()=>void te(je.view),busy:E})]}),o.jsx(em,{label:je.label,isCover:!1})]},je.src))}):ge.length===1?o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${ge[0].label}, open`,onClick:()=>L(ge[0]),children:o.jsx(ja,{src:$n(ge[0].src,"tile"),srcSet:bc(ge[0].src)})})}):o.jsx(ey,{}),M&&o.jsxs("section",{className:"sc-scenepage-told",children:[o.jsxs("dl",{className:"sc-lookpage-told",children:[o.jsxs("div",{children:[o.jsx("dt",{children:pe.lightLabel}),o.jsx("dd",{dir:"auto",children:M.lighting})]}),M.camera&&o.jsxs("div",{children:[o.jsx("dt",{children:pe.cameraLabel}),o.jsx("dd",{dir:"auto",children:M.camera})]}),M.figure&&o.jsxs("div",{children:[o.jsx("dt",{children:pe.figureLabel}),o.jsx("dd",{dir:"auto",children:M.figure})]})]}),o.jsx("p",{className:"sc-lookpage-note",children:"Every shot made here is told this. Anything you write in the shot wins."})]}),Q.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"What it was read from"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:Q.map((je,Re)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${Re+1}, open`,onClick:()=>L({src:je,label:`Source photo ${Re+1}`}),children:o.jsx(ja,{src:$n(je,"micro")})},je))})]}),M&&o.jsxs("div",{className:"sc-prec",children:[wt&&o.jsx("p",{className:"sc-prec-note",children:wt}),o.jsx(Xn,{label:"Delete place",title:`Delete ${M.name}?`,body:ji("owned-scene",1),busy:G,onConfirm:()=>void ue()})]}),H.length>0&&o.jsx(od,{label:`Shots made in ${j.name}`,children:H.map(je=>o.jsx(ty,{node:je,to:Bm(u,null,je.id)},je.id))}),D.length>0&&o.jsx(od,{label:"Other places, similar light",children:D.map(je=>o.jsx(x1,{scene:je,variant:"navigate",size:"slider",onOpen:T,href:zr(u,je.id)},je.id))}),K&&M&&o.jsx(FL,{name:M.name,categories:M.verticals,known:ee,hint:"The verticals this place suits, so it surfaces where you work.",ways:J,wayChoices:av,wayMax:IL,busy:O,error:V,onSave:je=>void he(je),onDismiss:()=>z(!1)}),A&&o.jsx(Cd,{src:A.src,kind:"scene",label:A.label,noun:j.name,onClose:()=>L(null),actions:A.view?o.jsx(qu,{variant:"sheet",label:A.label,isCover:!1,onUse:()=>void te(A.view),busy:E}):void 0})]})})}function rle({draft:e,href:t,onDiscard:n,chosen:r,batching:a,onPick:i,batch:l}){return o.jsx(HL,{id:e.id,name:e.name.trim()||"Untitled person",hash:e.hash,drawing:!!e.drawing,state:sle(e),href:t,blank:o.jsx(IF,{size:44,weight:"thin"}),onDiscard:n,chosen:r,batching:a,onPick:i,batch:l})}function sle(e){return e.drawing?"Drawing":e.approved?e.approved===1?"Face ready":e.approved>=e.of?"Ready to save":`${e.approved} of ${e.of} views ready`:e.hash?"A face to decide":e.source==="photos"?"Photos added":"Not drawn yet"}function ale({suggested:e,busy:t,error:n,onConfirm:r,onDismiss:a}){const[i,l]=s.useState(e),u=s.useRef(null),f=s.useRef(!1),h=i.trim(),p=h.length>0;s.useEffect(()=>{f.current=!1},[e]),s.useEffect(()=>{t||(f.current=!1)},[t]);const g=()=>{!p||t||f.current||(f.current=!0,r(h))};return o.jsxs(Ws,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:a,onOpenAutoFocus:m=>{m.preventDefault();const w=u.current;w&&(w.focus(),w.select())},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Duplicate person"}),o.jsx(Ms,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{ref:u,className:"sc-pdetails-field",value:i,dir:"auto",maxLength:60,onChange:m=>l(m.target.value),onKeyDown:m=>m.key==="Enter"&&g()})]}),n&&o.jsx("p",{className:"sc-assetform-err",children:n})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!p||t,"data-busy":t||void 0,onClick:g,children:t?"Duplicating":"Duplicate"})]})]})}const ole=60;function ile(e,t,n=ole){var l;const r=e.trim(),a=(((l=r.match(/^(.*?)(?: copy(?: \d+)?)?$/i))==null?void 0:l[1])??r).trim()||r,i=new Set(t.map(u=>u.trim().toLowerCase()).filter(Boolean));for(let u=1;u<1e4;u++){const f=u===1?" copy":` copy ${u}`,h=Math.max(1,n-f.length),p=`${a.slice(0,h).trimEnd()}${f}`;if(!i.has(p.toLowerCase()))return p}return`${a.slice(0,Math.max(1,n-5)).trimEnd()} copy`}const lle=8,h6="__bookmarked";function cle(){const{presenters:e,presenterCategories:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l}=Mn(),{brand:u}=cn(),f=Un(),h=Cy(),{push:p}=rr(),{q:g,setQ:m,facets:w,setFacets:y,clearSearch:b,clear:k}=hf(["category","bookmarked"]),S=w.category,E=w.bookmarked==="1",[C,A]=s.useState(()=>Ed("presenter",u.id)),L=be=>A(f2("presenter",u.id,be)),T=_y(`${u.id}|${g}|${S??""}|${E?"1":""}`),M=Zl(),j=s.useMemo(()=>sf(u),[u]),[P,R]=Ma(qr.wallDensity,bd),H=Jc(P),D=be=>R(be),U=t2(H),V=Jm(H),B=be=>f(Ra(u,be)),G=be=>f(zm(u,be)),_=s.useMemo(()=>S?e.filter(be=>be.suitableCategories.includes(S)):e,[e,S]),O=s.useMemo(()=>_.filter(be=>Ho(Kp(be),g)),[_,g]),I=s.useRef(null),K=s.useRef(null),z=o.jsxs("button",{ref:K,type:"button",className:"sc-btn sc-btn-primary",onClick:()=>M("presenter"),children:[o.jsx(mr,{size:12})," Create person"]}),[q,Z]=s.useState([]),ee=s.useRef(0),he=s.useCallback(()=>{const be=++ee.current;return Ee.presenterDrafts(u.id).then(it=>{be===ee.current&&Z(it.drafts.filter(vt=>!vt.presenterId))}).catch(()=>{}),()=>{be===ee.current&&ee.current++}},[u.id]),ue=!!mn({path:pt.presenterStudio}),{tasks:ge}=ia(),te=ge.filter(be=>be.id.startsWith("presenter:")).map(be=>`${be.id}:${be.state}:${be.percent??""}`).join("|");s.useEffect(()=>{if(!ue)return he()},[ue,he,te]);const J=s.useCallback(be=>{const it=Math.max(0,q.findIndex(vt=>vt.id===be));Q.current=it,T.forget(be),Z(vt=>vt.filter(Te=>Te.id!==be)),Ee.deletePresenterDraft(u.id,be).finally(()=>he())},[u.id,q,he,T.forget]),Q=s.useRef(null);s.useEffect(()=>{var Te;const be=Q.current;if(be===null)return;Q.current=null;const it=(Te=I.current)==null?void 0:Te.querySelectorAll("[data-build] .sc-cardpuck"),vt=it!=null&&it.length?it[Math.min(be,it.length-1)]:K.current??document.querySelector(".sc-new-go");vt==null||vt.focus()},[q]);const[ae,$e]=s.useState(null),[ie,ke]=s.useState(!1),[ze,wt]=s.useState(!1),Ke=s.useCallback(be=>{const it=q.find(vt=>vt.id===be);it!=null&&it.drawn?$e(it):J(be)},[q,J]),[tt,De]=s.useState(null),[Se,X]=s.useState(null),[je,Re]=s.useState(null),[re,Y]=s.useState(!1),[se,Ne]=s.useState(null),[Be,st]=s.useState(null),Pe=s.useCallback(be=>{const it=j.find(vt=>vt.id===be);it&&(Ne(null),De(it))},[j]),Oe=s.useCallback(be=>{const it=j.find(vt=>vt.id===be);it&&(Ne(null),X(it))},[j]),Ge=async be=>{if(!(!Se||re)){Y(!0),Ne(null);try{i((await Ee.updatePresenter(u.id,Se.id,{name:be})).brand),X(null)}catch(it){const vt=ln(it,"Could not rename this person");Ne([vt.title,vt.detail].filter(Boolean).join(" "))}finally{Y(!1)}}},ft=s.useCallback(be=>{const it=j.find(vt=>vt.id===be);it&&Re(it)},[j]),bt=s.useRef(null);s.useEffect(()=>{var Te;const be=bt.current;if(be===null)return;bt.current=null;const it=(Te=I.current)==null?void 0:Te.querySelectorAll(".sc-lookcard:not([data-build]) .sc-lookcard-more"),vt=it!=null&&it.length?it[Math.min(be,it.length-1)]:K.current??document.querySelector(".sc-new-go");vt==null||vt.focus()},[e,u]);const at=async be=>{if(!(!tt||re)){Y(!0),Ne(null);try{const it=await Ee.duplicatePresenter(u.id,tt.id,be);i(it.brand),De(null),st(it.presenter.id)}catch(it){const vt=ln(it,"Could not duplicate this person");Ne([vt.title,vt.detail].filter(Boolean).join(" "))}finally{Y(!1)}}},Zt=async()=>{if(!(!je||re)){bt.current=Math.max(0,jt.findIndex(be=>be.id===je.id)),Y(!0);try{const be=await Ee.deletePresenter(u.id,je.id);i(be.brand),T.forget(je.id),Re(null)}catch(be){(be==null?void 0:be.status)===404?(await l(),T.forget(je.id),Re(null)):p(ln(be,"Could not delete this person"))}finally{Y(!1)}}};s.useEffect(()=>{var it,vt;if(!Be)return;(vt=(it=I.current)==null?void 0:it.querySelector(".sc-lookcard[data-just-added]"))==null||vt.scrollIntoView({block:"nearest"});const be=window.setTimeout(()=>st(null),1800);return()=>window.clearTimeout(be)},[Be]);const jt=s.useMemo(()=>j.filter(be=>S?!be.suitableCategories.length||be.suitableCategories.includes(S):!0).filter(be=>Ho(Kp(be),g)).filter(be=>E?C.includes(be.id):!0),[j,S,g,E,C]),Pt=!(j.length>0||q.length>0),Tt=[...j,...e].reduce((be,it)=>be+(C.includes(it.id)?1:0),0),xe=E&&Tt===0,Je=xe&&Pt,Et=xe&&!Pt,Xe=!E||Je,rt=jt.filter(be=>!E||Je||C.includes(be.id)),nt=Xe&&q.length>0||rt.length>0,{visible:qt,remaining:Yt,showMore:an}=k1(rt,`${u.id}|${S??""}|${E?"keepers":""}|${Je?"browse":""}|${g}`),[Wt,Rn]=s.useState(null);s.useEffect(()=>{if(!Wt||Yt<=0)return;const be=new IntersectionObserver(it=>{it.some(vt=>vt.isIntersecting)&&an()},{root:Wt.closest(".sc-home"),rootMargin:"200% 0px"});return be.observe(Wt),()=>be.disconnect()},[Wt,Yt,an]);const Bt=s.useMemo(()=>!E||Je?O:O.filter(be=>C.includes(be.id)),[O,E,Je,C]),{visible:ne,remaining:le,showMore:ce}=k1(Bt,`${S??""}|${E?"keepers":""}|${Je?"browse":""}|${g}`),Ve=e.length+j.length>0?"tabs":"none",_e=s.useCallback(async be=>{const{failed:it,error:vt}=await Jp(be,Te=>Ee.deletePresenterDraft(u.id,Te));Z(Te=>Te.filter(qe=>it.includes(qe.id)||!be.includes(qe.id))),T.retain(it),he(),vt&&p(ln(vt,"Could not discard these drafts"))},[u.id,he,T.retain,p]),xt=()=>{const be=q.filter(it=>T.ids.has(it.id));be.some(it=>it.drawn)?be.length===1?$e(be[0]):ke(!0):_e(be.map(it=>it.id))},yt=()=>{const be=[...T.ids];be.length===1?ft(be[0]):wt(!0)},kt=[...T.ids],ot=T.kind==="presenter"&&kt.length>0&&kt.every(be=>C.includes(be)),ht=()=>A(jy("presenter",u.id,kt,!ot)),Ae=m2(T.ids.size,ot,"presenters"),me=async()=>{if(re)return;const be=[...T.ids];Y(!0);try{const{failed:it,error:vt}=await Jp(be,Te=>Ee.deletePresenter(u.id,Te));await l(),T.retain(it),wt(!1),vt&&p(ln(vt,"Could not delete these people"))}finally{Y(!1)}},et={key:"category",label:"Category",everyLabel:"All people",everyCount:e.length+j.length,selected:E?h6:S,onSelect:be=>y(be===h6?{bookmarked:"1",category:null}:{bookmarked:null,category:be}),options:[{value:h6,label:"Keepers",count:Tt},...t.map(be=>({value:be,label:be,count:[...j,...e].filter(it=>!it.suitableCategories.length||it.suitableCategories.includes(be)).length}))]},Ct=o.jsx(v2,{title:"People",filters:o.jsx(w2,{mode:Ve,group:et}),density:o.jsx(e2,{value:H,onChange:D}),search:e.length>=lle&&o.jsx(_d,{value:g,onChange:m,noun:"people",total:e.length})});return o.jsxs(af.Provider,{value:V,children:[o.jsx(ds,{children:o.jsxs("main",{className:"sc-looks sc-presenters",id:"main","data-hero":Pt||void 0,onClick:T.onBlank,children:[!Pt&&Ct,nt&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your people"})}),o.jsxs("div",{ref:I,className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":V,style:U,children:[Xe&&q.map(be=>o.jsx(rle,{draft:be,href:vl(u,be.id),onDiscard:Ke,chosen:T.ids.has(be.id),batching:T.batching==="draft",onPick:T.picking("draft")?it=>T.toggle("draft",it):void 0,batch:T.kind==="draft"&&T.ids.has(be.id)?{count:T.ids.size,onAct:xt}:null},be.id)),ae&&o.jsx(Xn,{label:"Discard",title:`Discard ${ae.name.trim()||"this unfinished person"}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:be=>{be||$e(null)},onConfirm:()=>{J(ae.id),$e(null)}}),qt.map(be=>o.jsx(sv,{presenter:be,variant:"use",size:"grid",onOpen:B,href:Ra(u,be.id),onUse:h,onDuplicate:Pe,onEdit:G,onDelete:ft,onRename:Oe,bookmarked:C.includes(be.id),onBookmark:L,fresh:be.id===Be,chosen:T.ids.has(be.id),batching:T.batching==="presenter",onPick:T.picking("presenter")?it=>T.toggle("presenter",it):void 0,batch:T.kind==="presenter"&&T.ids.has(be.id)?{count:T.ids.size,onAct:yt,onKeep:ht,allKept:ot}:null},be.id)),Se&&o.jsx(Iy,{title:"Rename person",name:Se.name,maxLength:60,busy:re,error:se,onConfirm:be=>void Ge(be),onDismiss:()=>{re||X(null)}}),tt&&o.jsx(ale,{suggested:ile(tt.name,j.map(be=>be.name)),busy:re,error:se,onConfirm:be=>void at(be),onDismiss:()=>{re||De(null)}}),je&&o.jsx(Xn,{label:"Delete person",title:`Delete ${je.name}?`,body:ji("presenter",1),open:!0,busy:re,onOpenChange:be=>{!be&&!re&&Re(null)},onConfirm:()=>void Zt()}),ze&&o.jsx(Xn,{label:cs("presenter",T.ids.size).menu,title:`${cs("presenter",T.ids.size).menu}?`,body:ji("presenter",T.ids.size),open:!0,busy:re,onOpenChange:be=>{!be&&!re&&wt(!1)},onConfirm:()=>void me()}),ie&&o.jsx(Xn,{label:cs("draft",T.ids.size).menu,title:`${cs("draft",T.ids.size).menu}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:be=>{be||ke(!1)},onConfirm:()=>{const be=[...T.ids];ke(!1),_e(be)}})]}),Yt>0&&o.jsx("div",{ref:Rn,"aria-hidden":!0}),Yt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:an,children:["Show ",Math.min(Yt,60)," more"]})})]}),Pt&&n&&!r&&e.length>0&&o.jsx(No,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Create your own ",o.jsx("em",{children:"person"})]}),body:"Describe someone new, or add photos of a real person. They stay the same person in every image you make.",action:z}),nt&&n&&!r&&ne.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri people"})}),!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":V,style:U,"aria-hidden":!0,children:o.jsx($L,{size:"grid",count:8})}),n&&r&&o.jsx(No,{shape:"error",title:"Couldn't load Scenri people",body:"Something went wrong reaching the catalog.",onRetry:()=>a()}),Pt&&n&&!r&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Vy,{label:"Or cast someone from ours"}),Ct]}),n&&!r&&ne.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":V,style:U,children:ne.map(be=>o.jsx(sv,{presenter:be,variant:"use",size:"grid",onOpen:B,href:Ra(u,be.id),onUse:h,bookmarked:C.includes(be.id),onBookmark:L},be.id))}),n&&!r&&Et&&o.jsx(No,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a person from their card and they stay here.",mark:Oy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>y({bookmarked:null}),children:"Browse everyone"})}),n&&!r&&!Et&&!Bt.length&&e.length>0&&o.jsx(y2,{noun:"people",q:g,facet:E?"Keepers":S,onClearSearch:b,onClearAll:k}),n&&!r&&!e.length&&o.jsx(No,{shape:"zero",body:"Scenri people are still being cast. Check back soon."}),le>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:ce,children:["Show ",Math.min(le,60)," more"]})})]})}),T.ids.size>0&&(T.kind==="draft"||T.kind==="presenter")&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Fy,{count:T.ids.size,loaded:T.kind==="draft"?q.length:qt.length,tool:cs(T.kind,T.ids.size).tool,icon:cs(T.kind,T.ids.size).icon,danger:cs(T.kind,T.ids.size).danger,onAct:T.kind==="draft"?xt:yt,keep:T.kind==="presenter"?{label:Ae.tool,filled:ot,onAct:ht}:null,onClear:T.clear,onSelectAll:()=>T.selectAll(T.kind==="draft"?"draft":"presenter",(T.kind==="draft"?q:qt).map(be=>be.id))})}),o.jsx(Zc,{})]})}const u7={portrait:"Face",identity:"Face",front:"Full body","three-quarter":"Three-quarter",back:"Back",left:"Left",right:"Right","left-profile":"Left","right-profile":"Right"},d7=3;function ule(){var ge;const{presenterId:e=""}=aa(),{presenters:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l,presenterCategories:u}=Mn(),{brand:f}=cn(),h=Un(),p=b2(),g=s.useRef(!1),m=Cy(),[w,y]=s.useState([]),[b,k]=s.useState(null),[S,E]=s.useState(null),C=sQ(f,e),A=C??t.find(te=>te.id===e);qc(A==null?void 0:A.name);const L=!!C,[T,M]=s.useState(null);s.useEffect(()=>{let te=!0;if(y([]),!L)return Ee.presenterFrames(e).then(J=>{te&&(y(J.frames),M(e))}).catch(()=>{te&&(y([]),M(e))}),()=>{te=!1}},[e,L]);const j=s.useRef(e);j.current=e,p2(()=>{if(L)return;const te=e;Ee.presenterFrames(te).then(J=>{j.current===te&&y(Q=>xi(Q,J.frames))}).catch(()=>{})});const P=!!mn({path:pt.presenterEdit});s.useEffect(()=>{let te=!0;if(E(null),!(!L||P))return Ee.presenterDrafts(f.id).then(J=>{if(!te)return;const Q=J.drafts.find(ae=>ae.presenterId===e);E((Q==null?void 0:Q.id)??null)}).catch(()=>{}),()=>{te=!1}},[f.id,e,L,P]);const R=((ge=f.json)==null?void 0:ge.characters)??[],H=R.find(te=>te.presenterId===e),D=R.find(te=>te.id===e),U=Zy(f.id,[e??"",(H==null?void 0:H.id)??""]),[V,B]=s.useState(null),[G,_]=s.useState(!1),[O,I]=s.useState(!1),K=async te=>{if(C){_(!0),B(null);try{const J=await Ee.updatePresenter(f.id,C.id,te);i(J.brand),I(!1)}catch(J){B(String(J.message??J))}finally{_(!1)}}},z=async()=>{if(!C||g.current)return;g.current=!0;const te=p(),J=ui(f);_(!0);try{const Q=await Ee.deletePresenter(f.id,C.id);i(Q.brand)}catch(Q){if((Q==null?void 0:Q.status)!==404){g.current=!1,te()&&(B(String(Q.message??Q)),_(!1));return}await l()}te()&&h(J,{replace:!0})},q=Jw(f,e);if(q!==e)return o.jsx(Pa,{to:Ra(f,q),replace:!0});if(!n&&!C)return o.jsx(ds,{children:o.jsx("main",{className:"sc-lookpage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!C)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this person"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!A)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This person isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"They may have been removed from the catalog, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Vn,{className:"sc-btn sc-btn-primary",to:ui(f),children:"Browse people"})})]})});const Z=C?(Array.isArray(D==null?void 0:D.shots)?D.shots:[]).map((te,J)=>({src:Jr(te==null?void 0:te.file),label:u7[(te==null?void 0:te.angle)??""]??`Reference ${J+1}`,angle:typeof(te==null?void 0:te.angle)=="string"?te.angle:void 0})).filter(te=>!!te.src):w.length?w.map((te,J)=>({src:te.url,label:u7[te.angle]??`Reference ${J+1}`,angle:te.angle})):A.previewUrl?[{src:A.previewUrl,label:"Preview"}]:[],ee=zm(f,e),he=ki(C??A),ue=[...new Set([...u,...sf(f).flatMap(te=>te.suitableCategories??[])])].sort((te,J)=>te.localeCompare(J));return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-presenterpage",id:"main",children:[o.jsx(zy,{to:ui(f),wall:"People",where:C?"Yours":"Scenri library"}),he.src&&o.jsx("div",{className:"sc-presenterpage-avatar",children:o.jsx(ja,{src:$n(he.src,"small"),crop:he.crop})}),o.jsx("h1",{children:A.name}),A.suitableCategories.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:A.suitableCategories.map(te=>o.jsx("li",{className:"sc-chip","data-static":!0,children:te},te))}),A.descriptor&&o.jsx("p",{className:"sc-lookpage-lede",children:A.descriptor}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>m(e),children:"Use in a shot"}),C&&o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:ee,children:S?"Continue editing":"Edit person"}),o.jsx(By,{kind:"presenter",brandId:f.id,id:e}),C&&o.jsx(hr,{label:"Edit name and details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name and details","aria-haspopup":"dialog",onClick:()=>I(!0),children:o.jsx(Ad,{size:17})})})]}),V&&o.jsx("p",{className:"sc-assetform-err",children:V}),!C&&T!==e?o.jsx(S1,{count:d7,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:Array.from({length:d7},(te,J)=>o.jsxs("li",{"aria-hidden":!0,children:[o.jsx("span",{className:"sc-refset-tile","data-state":"loading",children:o.jsx("span",{className:"sc-placeholder"})}),o.jsx("span",{className:"sc-refset-lb"})]},J))}):Z.length>0?o.jsx(S1,{count:Z.length,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:Z.map(te=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","data-role":te.angle,"aria-label":`${te.label}, open`,onClick:()=>k(te),children:o.jsx(ja,{src:$n(te.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:te.label})]},te.label))}):o.jsx(ey,{}),C&&C.sourceRefs.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"From your photos"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:C.sourceRefs.map((te,J)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${J+1}, open`,onClick:()=>k({src:te,label:`Source photo ${J+1}`}),children:o.jsx(ja,{src:$n(te,"micro")})},te))})]}),C&&o.jsxs("div",{className:"sc-prec",children:[o.jsxs("p",{className:"sc-prec-note",children:[A.ageRange?`${A.ageRange} · `:"",C.source==="synthetic"?"Created in Scenri. Not a real person.":C.source==="photos"?"Built from your photographs.":"Saved in Scenri.",C.likeness?` Likeness confirmed ${new Date(C.likeness.attestedAt).toLocaleDateString()}.`:""]}),o.jsx(Xn,{label:"Delete person",title:`Delete ${C.name}?`,body:ji("presenter",1),busy:G,onConfirm:()=>void z()})]}),U.length>0&&o.jsx(od,{label:`Shots featuring ${A.name}`,children:U.map(te=>o.jsx(ty,{node:te,to:Bm(f,null,te.id)},te.id))}),O&&C&&o.jsx(FL,{name:C.name,categories:A.suitableCategories,known:ue,hint:"The verticals they suit, so they surface where you work.",busy:G,error:V,onSave:te=>void K({name:te.name,suitableCategories:te.categories}),onDismiss:()=>I(!1)}),b&&o.jsx(Cd,{src:b.src,kind:"presenter",label:b.label,noun:A.name,onClose:()=>k(null)})]})})}function dle({placeholder:e,label:t,action:n="Send",scope:r,hint:a,value:i,onValue:l,allowEmpty:u,disabled:f,why:h,quiet:p,working:g,error:m,focusKey:w,onStop:y,stopping:b,onAttach:k,onAttachFiles:S,attachLabel:E,colour:C,refs:A,onSend:L}){const T=s.useRef(null),M=s.useRef(null),[j,P]=s.useState(void 0);s.useLayoutEffect(()=>{const z=T.current;if(!z)return;z.style.height="auto";const q=Number.parseFloat(getComputedStyle(z).maxHeight)||Number.POSITIVE_INFINITY;z.style.height=`${Math.min(z.scrollHeight,q)}px`,z.style.overflowY=z.scrollHeight>q?"auto":"hidden"},[i]);const[R,H]=s.useState(!1),D=Nr(la);s.useEffect(()=>{if(!w||w===j||f||(P(w),D))return;const z=T.current;if(z==null||z.focus({preventScroll:!0}),z!=null&&z.value){z.select(),H(!0);const q=setTimeout(()=>H(!1),700);return()=>clearTimeout(q)}},[w,j,f,D]);const U=f||g,V=!!(C!=null&&C.hex)||!!(A!=null&&A.some(z=>!z.busy)),B=!i.trim()&&!u&&!V,G=()=>{U||B||L(i)},_=m?{text:m,tone:"alert"}:{text:(r==null?void 0:r.hint)??a??"",tone:r==null?void 0:r.tone},O=!!y&&(g||!i.trim()&&!V),I=g||O?null:f&&h?h:B&&!f?"Nothing typed yet.":null,K=o.jsxs("button",{type:"button",className:"sc-convo-send","aria-disabled":(O?!!b:g||U||B)||void 0,"aria-busy":g||O||void 0,"data-stop":O||void 0,onClick:O?b?void 0:y:g?void 0:G,children:[o.jsx("span",{className:"sc-convo-send-ico",children:g||O?o.jsx("span",{className:"sc-convo-spin","aria-hidden":"true"}):o.jsx(cE,{size:17,weight:"bold"})}),O?b?"Stopping":"Stop":g?"Working":n]});return o.jsxs("div",{className:"sc-convo-composer",children:[o.jsxs("div",{className:"sc-convo-card","data-quiet":p||void 0,"data-flash":R||void 0,children:[(r==null?void 0:r.chip)&&o.jsx("div",{className:"sc-convo-scope-row",children:o.jsxs("span",{className:"sc-convo-scope",children:[r.chip.thumb?o.jsx("img",{src:r.chip.thumb,alt:""}):null,r.chip.label]})}),o.jsxs("div",{className:"sc-convo-field",children:[A==null?void 0:A.map(z=>o.jsxs("span",{className:"sc-token","data-kind":"image","data-busy":z.busy||void 0,dir:"ltr",children:[o.jsx("img",{src:z.src,alt:""}),o.jsx("span",{className:"sc-token-label",children:z.label}),o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":`Remove ${z.label}`,onClick:z.onRemove,children:o.jsx(jn,{size:11,weight:"bold"})})]},z.key)),C&&o.jsxs("span",{className:"sc-token","data-kind":"color","data-empty":C.hex?void 0:"",dir:"ltr",children:[o.jsxs(xd,{className:"sc-convo-chip",triggerStyle:{background:"none"},value:C.hex??C.seed??"#808080",commitMode:"live",align:"start",label:C.hex?`${C.label}. Change the colour.`:"Pick a colour",onChange:C.onPick,children:[o.jsx("span",{className:"sc-token-swatch",style:C.hex?{background:C.hex}:void 0}),o.jsx("span",{className:"sc-token-label",children:C.label})]}),C.hex&&o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":"Remove colour",onClick:C.onClear,children:o.jsx(jn,{size:11,weight:"bold"})})]}),o.jsx("textarea",{ref:T,className:"sc-in",rows:1,maxLength:Sd,"aria-label":t,placeholder:C!=null&&C.hex&&!i?"":f&&h?h:e,value:i,disabled:f,onChange:z=>l(z.target.value),onKeyDown:z=>{z.key!=="Enter"||z.shiftKey||(z.preventDefault(),G())}})]}),o.jsxs("div",{className:"sc-convo-row",children:[(k||S)&&o.jsxs(o.Fragment,{children:[o.jsx(hr,{label:U&&h?h:E??"Add photos",children:o.jsx("button",{type:"button",className:"sc-convo-attach","aria-label":E??"Add photos","aria-disabled":U||void 0,onClick:U?void 0:S?()=>{var z;return(z=M.current)==null?void 0:z.click()}:k,children:o.jsx(mr,{size:16,weight:"bold"})})}),S&&o.jsx("input",{ref:M,type:"file",accept:"image/*",hidden:!0,"aria-label":E??"Add a picture",onChange:z=>{const q=Array.from(z.target.files??[]).filter(Z=>Z.type.startsWith("image/"));z.target.value="",q.length&&S(q)}})]}),I?o.jsx(hr,{label:I,children:K}):K]})]}),_.text?o.jsx("small",{className:"sc-convo-line",role:_.tone==="alert"?"alert":void 0,"data-tone":_.tone,children:_.text}):null]})}function ZL({glyph:e,lead:t,hint:n}){return o.jsxs("div",{className:"sc-pstudio-empty",children:[o.jsxs("span",{className:"sc-pstudio-empty-mark","aria-hidden":!0,children:[o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"far"}),o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"near"}),e]}),t&&o.jsxs("span",{className:"sc-pstudio-empty-say",children:[o.jsx("span",{children:t}),n&&o.jsx("span",{children:n})]})]})}const f7=500,zL=400,BL=760,$u=e=>Math.min(BL,Math.max(zL,Math.round(e)));function fle({title:e,headAction:t,stage:n,body:r,bodyProps:a,foot:i,overlay:l,kind:u,resizeLabel:f,onPaste:h,onDropFiles:p,onClose:g}){const m=s.useRef(null),[w,y]=s.useState(null);Dy(w,"--sc-pstudio-dock-h"),s.useEffect(()=>{const A=L=>{L.key!=="Escape"||L.defaultPrevented||(L.preventDefault(),g())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[g]);const[b,k]=Ma(qr.pstudioRailW,f7),S=s.useRef(0),E=s.useRef(0),C=s.useRef(null);return Br.createPortal(o.jsx(Md,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:A=>{var L;C.current=document.activeElement instanceof HTMLElement?document.activeElement:null,A.preventDefault(),(L=m.current)==null||L.focus({preventScroll:!0})},onUnmountAutoFocus:A=>{var L,T;(L=C.current)!=null&&L.isConnected||(A.preventDefault(),(T=document.querySelector(".sc-new-go")??document.getElementById("main"))==null||T.focus())},children:o.jsxs("div",{ref:m,tabIndex:-1,className:"sc-pstudio","data-kind":u,style:{"--sc-pstudio-rail-set":`${$u(b)}px`},role:"dialog","aria-modal":"true","aria-labelledby":"sc-pstudio-title",onDragOver:A=>{p&&Array.from(A.dataTransfer.types).includes("Files")&&A.preventDefault()},onDrop:A=>{var T;if(!p||A.defaultPrevented)return;const L=Array.from(((T=A.dataTransfer)==null?void 0:T.files)??[]);L.length&&(A.preventDefault(),p(L))},onPaste:A=>{var T;if(!h)return;const L=Array.from(((T=A.clipboardData)==null?void 0:T.files)??[]).filter(M=>M.type.startsWith("image/"));L.length&&(A.preventDefault(),h(L))},children:[o.jsxs("div",{className:"sc-pstudio-grid",children:[o.jsx(hr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-pstudio-close",onClick:g,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),o.jsxs("div",{className:"sc-pstudio-head sc-newdlg-head",children:[o.jsx("h2",{id:"sc-pstudio-title",className:"sc-newdlg-title",children:e}),t,o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close",onClick:g,"aria-label":"Close",children:o.jsx(jn,{size:16})})]}),o.jsxs("div",{className:"sc-pstudio-scroll",children:[n,o.jsx("div",{className:"sc-pstudio-body",...a,children:r})]}),o.jsx("div",{className:"sc-pstudio-foot sc-dock",ref:y,children:i}),o.jsx("div",{className:"sc-pstudio-resize",role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuemin":zL,"aria-valuemax":BL,"aria-valuenow":$u(b),tabIndex:0,onPointerDown:A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),A.currentTarget.setPointerCapture(A.pointerId))},onPointerMove:A=>{if(!A.currentTarget.hasPointerCapture(A.pointerId))return;const L=A.currentTarget.closest(".sc-pstudio");S.current=A.clientX,!E.current&&(E.current=requestAnimationFrame(()=>{E.current=0,L==null||L.style.setProperty("--sc-pstudio-rail-set",`${$u(window.innerWidth-S.current)}px`)}))},onPointerUp:A=>{A.currentTarget.releasePointerCapture(A.pointerId),E.current&&(cancelAnimationFrame(E.current),E.current=0),k($u(window.innerWidth-A.clientX))},onDoubleClick:()=>k(f7),onKeyDown:A=>{if(A.key==="ArrowLeft")k(L=>$u(L+16));else if(A.key==="ArrowRight")k(L=>$u(L-16));else return;A.preventDefault()}})]}),l]})}),document.body)}function hle({hash:e,alt:t,drawing:n,since:r,items:a,onPick:i,compare:l,doing:u,takes:f,onTake:h,empty:p,glyph:g}){const m=ple(n),[w,y]=s.useState(null),b=f??[],k=Math.max(0,b.findIndex(R=>w?R.hash===w:R.current)),S=b[k];s.useEffect(()=>y(null),[e]);const E=mle(w&&b.some(R=>R.hash===w)?w:e),[C,A]=s.useState(void 0);s.useEffect(()=>{E||A(void 0)},[E]);const L=R=>{const H=b[k+R];H&&y(H.hash)},T=s.useRef(null),[M,j]=s.useState(!1);s.useLayoutEffect(()=>{const R=T.current,H=!!(R!=null&&R.complete&&R.naturalWidth);j(!H),H&&(R!=null&&R.naturalHeight)&&A(R.naturalWidth/R.naturalHeight)},[E]);const P=!!e&&!E;return o.jsxs("div",{className:"sc-pstudio-stage",children:[o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsxs("div",{className:"sc-pstudio-well","data-drawing":n||void 0,"data-empty":!e||void 0,style:C?{"--sc-well-ar":C}:void 0,children:[e&&E?o.jsx("img",{ref:T,src:Tr(E),srcSet:`${gn(E,"tile")} 640w, ${Tr(E)} 1024w`,sizes:"(max-width: 767px) 92vw, 44vw",alt:t,decoding:"async","data-waiting":M||void 0,onLoad:R=>{const H=R.currentTarget;j(!1),H.naturalWidth&&H.naturalHeight&&A(H.naturalWidth/H.naturalHeight)}}):o.jsx("span",{className:"sc-pstudio-well-blank",children:!n&&!e&&o.jsx(ZL,{glyph:g,lead:p==null?void 0:p.lead,hint:p==null?void 0:p.hint})}),(n&&!e||P)&&o.jsx(La,{}),n&&o.jsxs("span",{className:"sc-pstudio-doing",children:[o.jsx("span",{children:u??"Drawing"}),r&&o.jsx("time",{"aria-hidden":"true",children:Dc(r,m)})]}),b.length>1&&!n&&!(l!=null&&l.on)&&o.jsxs("div",{className:"sc-pstudio-vers",children:[o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version before","aria-disabled":k===0||void 0,onClick:()=>k>0&&L(-1),children:o.jsx(Ta,{size:13,weight:"bold"})}),o.jsxs("span",{className:"sc-pstudio-vers-n","aria-live":"polite",children:["Version ",(S==null?void 0:S.n)??1," of ",b.length]}),o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version after","aria-disabled":k===b.length-1||void 0,onClick:()=>k<b.length-1&&L(1),children:o.jsx(Nl,{size:13,weight:"bold"})}),S&&!S.current&&h&&o.jsx("button",{type:"button",className:"sc-pstudio-vers-put",onClick:()=>h(S.hash),children:"Put back"}),(S==null?void 0:S.current)&&o.jsx("span",{className:"sc-pstudio-vers-on",children:"Active"})]}),l&&!n&&o.jsx("button",{type:"button",className:"sc-pstudio-compare","aria-pressed":l.on,onClick:l.toggle,children:l.on?"Showing current":"Compare"})]})}),a.length>0&&o.jsx("ol",{className:"sc-pstudio-strip","aria-label":"Views",children:a.map(R=>{const H=R.label+(R.approved?", used":R.state==="stale"?", to be drawn again":"")+(R.photo?", your photo":"")+(R.drawing?", drawing":"")+(R.error?", failed":"");return o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-pstudio-slot","data-state":R.state,"data-view":R.view,"aria-current":R.state==="current"?"step":void 0,"aria-label":H,disabled:!i,onClick:()=>i==null?void 0:i(R.view),children:o.jsxs("span",{className:"sc-pstudio-slot-inner",children:[R.hash?o.jsx("img",{src:gn(R.hash,"micro"),alt:""}):null,R.drawing?o.jsx(La,{}):null,R.approved&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})}):null,R.error&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","data-tone":"alert","aria-hidden":!0,children:o.jsx(wm,{size:11,weight:"bold"})}):null]})}),o.jsx("span",{className:"sc-pstudio-slot-lb","data-on":R.state==="current"||void 0,"aria-hidden":!0,children:R.label})]},R.view)})})]})}function ple(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}function mle(e){const[t,n]=s.useState(e);return s.useEffect(()=>{if(!e||e===t){e||n(void 0);return}let r=!0;const a=()=>{r&&n(e)},i=new Image;i.srcset=`${gn(e,"tile")} 640w, ${Tr(e)} 1024w`,i.sizes="(max-width: 767px) 92vw, 44vw",i.src=Tr(e),i.decode?i.decode().then(a,a):(i.onload=a,i.onerror=a);const l=window.setTimeout(a,3e3);return()=>{r=!1,window.clearTimeout(l)}},[e,t]),t}function Uy({surface:e,onClose:t}){var h,p,g;const n=Nr(la),r=e,a=(h=r.stage)==null?void 0:h.onPick,i=a?m=>a(m):void 0,l=Ine(r.turns);s.useEffect(()=>{if(!l||r.busy)return;let m=!1;const w=y=>{var k,S;if(y.key!=="Enter"||y.shiftKey||y.defaultPrevented||m)return;const b=y.target;!((k=b==null?void 0:b.matches)!=null&&k.call(b,".sc-convo-q"))||((S=b.closest(".sc-convo-turn"))==null?void 0:S.getAttribute("data-turn"))!==`q:${l.id}`||(y.preventDefault(),m=!0,r.onAnswer(l.id,{kind:"confirm",id:l.options[0].id}))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[l,r.busy,r.onAnswer]);const u=r.glyph??o.jsx(FF,{size:32}),f=n?null:r.stage?o.jsx(hle,{hash:r.stage.hash,alt:r.stage.alt,drawing:r.stage.drawing,since:r.stage.since,doing:r.stage.doing,takes:r.stage.takes,onTake:r.stage.onTake,items:r.stage.items,onPick:r.stage.onPick,compare:r.stage.compare,empty:r.stageEmpty,glyph:u}):o.jsx("div",{className:"sc-pstudio-stage","data-reserve":!0,children:o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsx("div",{className:"sc-pstudio-well","data-empty":!0,children:o.jsx("span",{className:"sc-pstudio-well-blank",children:o.jsx(ZL,{glyph:u,lead:(p=r.stageEmpty)==null?void 0:p.lead,hint:(g=r.stageEmpty)==null?void 0:g.hint})})})})});return o.jsx(fle,{kind:r.kind??"presenter",title:r.title,headAction:r.headAction,resizeLabel:"Resize the conversation",onPaste:r.onPaste,onClose:t,overlay:r.overlay,stage:f,bodyProps:{"data-convo":!0},body:o.jsx(Cre,{turns:r.turns,busy:r.busy,working:r.working,memoryKey:r.memoryKey,resumed:r.resumed,onAnswer:r.onAnswer,onEdit:r.onEdit,onSaveEdit:r.onSaveEdit,onCancelEdit:r.onCancelEdit,onRestore:r.onRestore,onRetry:r.onRetry,onShow:i,onStarter:m=>(r.onStarter??r.onText)(m),onDescribe:r.onDescribe,onAttachFiles:r.onAttachRef}),foot:o.jsxs(o.Fragment,{children:[r.dock,r.composer&&o.jsx(dle,{quiet:!!r.composer.disabled&&!r.composer.working,placeholder:r.composer.placeholder,label:r.composer.label,action:r.composer.action,scope:r.composer.scope,hint:r.composer.hint,value:r.text,onValue:r.onText,allowEmpty:r.composer.allowEmpty,disabled:r.composer.disabled,why:r.composer.why,working:r.composer.working,error:r.composer.error,focusKey:r.composer.focusKey,onAttach:r.composer.onAttach,onAttachFiles:r.composer.onAttachFiles,attachLabel:r.composer.attachLabel,colour:r.composer.colour,refs:r.composer.refs,onStop:r.composer.onStop,stopping:r.composer.stopping,onSend:r.onSend})]})})}const Vd=[{id:"glasses",label:"Glasses",ask:"What glasses do they wear?",options:[{id:"thin black rectangular metal frames",label:"Thin black",card:"glasses-1"},{id:"round thin gold metal frames",label:"Round metal",card:"glasses-2"},{id:"clear transparent acetate frames",label:"Clear acetate",card:"glasses-3"},{id:"bold thick black rectangular acetate frames",label:"Bold rectangular",card:"glasses-4"},{id:"tortoiseshell acetate frames",label:"Tortoiseshell",card:"glasses-5"},{id:"rimless frames with thin temples",label:"Rimless",card:"glasses-6"}],saying:"Describe the glasses",refHint:"A clear front or three-quarter view of the frames."},{id:"freckles",label:"Freckles or marks",ask:"What marks their skin?",options:[{id:"light freckles across the nose and cheeks",label:"Light freckles",card:"freckles-1"},{id:"dense freckles across the whole face",label:"Dense freckles",card:"freckles-2"},{id:"freckles across the face and shoulders",label:"Face and shoulders",card:"freckles-3"},{id:"a small birthmark on one cheek",label:"Birthmark",card:"freckles-4"},{id:"a beauty mark above the lip",label:"Beauty mark",card:"freckles-5"}],saying:"Describe it",refHint:"A clear, close photograph of it."},{id:"makeup",label:"Makeup",ask:"What makeup do they wear?",options:[{id:"natural, barely-there makeup",label:"Natural",card:"makeup-1"},{id:"black winged eyeliner",label:"Winged liner",card:"makeup-2"},{id:"a soft smoky eye",label:"Smoky eye",card:"makeup-3"},{id:"a bold red lip",label:"Bold red lip",card:"makeup-4"},{id:"soft glamorous makeup with a warm shimmer",label:"Soft glam",card:"makeup-5"},{id:"strong defined brows and a nude lip",label:"Strong brows",card:"makeup-6"}],saying:"Describe the makeup",refHint:"A clear face photograph showing the look."},{id:"scar",label:"Scar",ask:"What scar do they have?",options:[{id:"a thin pale scar through one eyebrow",label:"Through an eyebrow",card:"scar-1"},{id:"a small pale scar on one cheek",label:"On a cheek",card:"scar-2"},{id:"a small scar on the chin",label:"On the chin",card:"scar-3"},{id:"a fine scar along the jaw",label:"Along the jaw",card:"scar-4"},{id:"a small scar beside one eye",label:"Beside an eye",card:"scar-5"},{id:"a faded scar across the bridge of the nose",label:"Across the nose",card:"scar-6"}],saying:"Describe the scar",refHint:"A clear, close photograph of it."},{id:"piercing",label:"Piercing",ask:"What piercing do they wear?",options:[{id:"a small silver nose stud",label:"Nose stud",card:"piercing-1"},{id:"a silver septum ring",label:"Septum ring",card:"piercing-2"},{id:"a small silver hoop through one eyebrow",label:"Eyebrow hoop",card:"piercing-3"},{id:"several small silver hoops in one ear",label:"Ear hoops",card:"piercing-4"},{id:"a small silver lip ring",label:"Lip ring",card:"piercing-5"},{id:"a row of small silver studs up one ear",label:"Ear studs",card:"piercing-6"}],saying:"Describe the piercing",refHint:"A clear photograph of the jewellery."},{id:"tattoo",label:"Tattoo",ask:"What is their tattoo?",options:[{id:"a fine-line botanical tattoo",label:"Fine line",card:"tattoo-1"},{id:"a small geometric line tattoo",label:"Geometric",card:"tattoo-2"},{id:"a floral tattoo in soft grey shading",label:"Floral",card:"tattoo-3"},{id:"a bold traditional red rose tattoo with heavy black linework",label:"Traditional",card:"tattoo-4"},{id:"a solid blackwork snake tattoo in heavy black ink",label:"Blackwork",card:"tattoo-5"},{id:"a small script tattoo in thin lettering",label:"Script",card:"tattoo-6"}],saying:"Describe the tattoo",refHint:"A clear photograph of the design itself.",where:{ask:"And where is it?",options:[{id:"on their right forearm",label:"Right forearm"},{id:"on their left forearm",label:"Left forearm"},{id:"on their right upper arm",label:"Right upper arm"},{id:"on their left upper arm",label:"Left upper arm"},{id:"on one shoulder",label:"Shoulder"},{id:"on the side of their neck",label:"Neck"},{id:"on their hand",label:"Hand"},{id:"on their back",label:"Back"}]}},{id:"prosthetic",label:"Prosthetic limb",ask:"What does their limb look like?",options:[{id:"a matte black mechanical prosthetic limb with dark articulated joints",label:"Matte black",card:"prosthetic-1"},{id:"a brushed steel mechanical prosthetic limb with dark articulated joints",label:"Brushed steel",card:"prosthetic-2"},{id:"a woven carbon fibre mechanical prosthetic limb with dark articulated joints",label:"Carbon fibre",card:"prosthetic-3"},{id:"a skin-tone mechanical prosthetic limb with dark articulated joints",label:"Skin tone",card:"prosthetic-4"},{id:"a glossy bright red mechanical prosthetic limb with dark articulated joints",label:"Red",card:"prosthetic-5"},{id:"a matte white mechanical prosthetic limb with dark articulated joints",label:"Matte white",card:"prosthetic-6"}],saying:"Describe it",refHint:"A clear photograph showing its shape and finish.",where:{ask:"And which limb?",options:[{id:"in place of their left arm",label:"Left arm"},{id:"in place of their right arm",label:"Right arm"},{id:"in place of their left leg",label:"Left leg"},{id:"in place of their right leg",label:"Right leg"},{id:"in place of their left hand",label:"Left hand"},{id:"in place of their right hand",label:"Right hand"}]}}],Oa=e=>Vd.find(t=>t.id===e),gle=/\b(forearm|upper arm|arm|shoulder|neck|throat|hand|wrist|back|chest|ribs|thigh|leg|calf|ankle|foot|cheek|eyebrow|brow|chin|lip|nose|ear|temple|jaw|collarbone)\b/i;function UL(e){return gle.test(e??"")}function vle(e,t){var a,i,l;const n=((a=t.words)==null?void 0:a.trim())??"",r=((i=t.where)==null?void 0:i.trim())??"";return n?r&&!UL(n)?`${n} ${r}`:n:r?`${((l=Oa(e))==null?void 0:l.label.toLowerCase())??e} ${r}`:""}function h7(e,t){const n=(t??[]).filter(r=>/\b(left|right)\b/i.test(r.words)&&(e==="front"||!wle.has(r.id)));if(n.length)return`Check the side: ${n.map(r=>r.words).join("; ")}. Facing you, their right is on your left.`}const wle=new Set(["tattoo","prosthetic"]),x2=["who","age","heritage","skin","hair","length","facial","eyes","build","height"],Oc="either",Ic=e=>{var t,n;return[(e==null?void 0:e.pick)===Oc?"":(t=e==null?void 0:e.pick)==null?void 0:t.trim(),(n=e==null?void 0:e.words)==null?void 0:n.trim()].filter(Boolean).join(", ")},WL=e=>{var t;return!!(e!=null&&e.pick||(t=e==null?void 0:e.words)!=null&&t.trim())},k2=e=>{var t;return((t=e.source)==null?void 0:t.door)==="scratch"},ov=e=>{var t;return k2(e)&&((t=e.source)==null?void 0:t.via)==="taps"},S2=e=>{var t;return k2(e)&&((t=e.source)==null?void 0:t.via)!=="taps"},E2=e=>{var t;return((t=e.source)==null?void 0:t.door)==="photos"},yle=/\b(slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size)\b/i;function Wy(e){const t=e.trim(),n=t.split(/\s+/).filter(Boolean).length,r=[];return Mp.test(t)||r.push("who"),Zw.test(t)||r.push("age"),r.length&&!yle.test(t)&&n<8&&r.push("build"),r}const ble=(e,t)=>x2.every(n=>!JL(`look-${n}`,e,t)||e[`look-${n}`]!==void 0),KL=e=>S2(e)&&e.describe!==void 0&&Wy(e.describe).length>0,xle=e=>S2(e)&&e.describe!==void 0&&(!KL(e)||e.gaps!==void 0),kle=(e,t)=>{var n;return E2(e)&&!!t.draft&&t.draft.source==="photos"&&t.canGenerate&&t.draft.stage!=="analyzing"&&(e.traits!==void 0||!((n=t.draft.keep)!=null&&n.trim()))},GL=(e,t)=>ov(e)?ble(e,t):S2(e)?xle(e):kle(e,t),Sle=(e,t)=>k2(e)||E2(e)&&!!t.draft,YL=e=>t=>{var n;return!!((n=t.traits)!=null&&n.includes(e))},qL=e=>t=>WL(t[`trait-${e}`]),XL=e=>t=>{var n;return YL(e)(t)&&qL(e)(t)&&!!((n=Oa(e))!=null&&n.where)&&!UL(Ic(t[`trait-${e}`]))},Bh=(e,t)=>Array.isArray(e)&&e.includes(t),Ele=(e,t)=>{var n;return GL(e,t)&&(((n=e.traits)==null?void 0:n.every(r=>qL(r)(e)&&(!XL(r)(e)||e[`trait-${r}-where`]!==void 0)))??!1)},Cle=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),jle=(e,t)=>{var r;if(!E2(e)||!t.draft||t.draft.stage==="analyzing"||t.draft.views.portrait.status!=="empty")return!1;const n=((r=t.draft.analysis)==null?void 0:r.photos)??[];return n.length>0&&n.every(a=>a.usable===!1)},vi=[{id:"source",applies:()=>!0},{id:"photos",applies:E2},{id:"weakphotos",applies:jle},...x2.map(e=>({id:`look-${e}`,applies:e==="facial"?t=>{var n;return ov(t)&&((n=t["look-who"])==null?void 0:n.pick)!=="woman"}:ov})),{id:"describe",applies:S2},{id:"gaps",applies:KL,dependsOn:[{on:"describe"}]},{id:"traits",applies:Sle,ready:GL},...Vd.flatMap(e=>[{id:`trait-${e.id}`,applies:YL(e.id),dependsOn:[{on:"traits",changed:(t,n)=>Bh(t,e.id)!==Bh(n,e.id)}]},{id:`trait-${e.id}-where`,applies:XL(e.id),dependsOn:[{on:`trait-${e.id}`,changed:(t,n)=>Ic(t)!==Ic(n)},{on:"traits",changed:(t,n)=>Bh(t,e.id)!==Bh(n,e.id)}]}]),{id:"keep",applies:k2,ready:Ele,optional:!0,sticky:!0}],QL=new Map(vi.map(e=>[e.id,e])),Ale=vi.map(e=>e.id),E1=e=>{const t=vi.findIndex(n=>n.id===e);return t<0?vi.length:t},Nle=e=>QL.get(e);function JL(e,t,n){return Nle(e).applies(t,n)}function e$(e,t,n){if(e==="photos")return!!n.draft&&n.draft.source==="photos";const r=t[e];return r===void 0?!1:fr(e)||Rle(e)?WL(r):!0}function t$(e,t){return vi.filter(n=>n.applies(e,t)&&e$(n.id,e,t)).map(n=>n.id)}function C2(e,t){var n;return((n=vi.find(r=>{var a;return!r.optional&&r.applies(e,t)&&(((a=r.ready)==null?void 0:a.call(r,e,t))??!0)&&!e$(r.id,e,t)}))==null?void 0:n.id)??null}function p7(e,t,n){const r={...e},a=new Set,i=new Set(Object.keys(t));for(const[u,f]of Object.entries(t))Cle(e[u],f)&&(f===void 0?delete r[u]:r[u]=f,a.add(u));if(a.size){const u=vi.map(g=>g.id),f=Math.min(...[...a].map(g=>u.indexOf(g))),h=new Set(a),p=g=>(g.dependsOn??[]).some(m=>h.has(m.on));for(const g of vi)u.indexOf(g.id)<=f||i.has(g.id)||r[g.id]===void 0||g.sticky||p(g)||(delete r[g.id],a.add(g.id))}let l=!0;for(;l;){l=!1;for(const u of vi){if(r[u.id]===void 0)continue;(!i.has(u.id)&&(u.dependsOn??[]).some(h=>a.has(h.on)&&(h.changed?h.changed(e[h.on],r[h.on]):!0))||!u.applies(r,n))&&(delete r[u.id],a.add(u.id),l=!0)}}return r}function Mle(e){const t={};for(const n of e.traits??[]){const r=e[`trait-${n}`];r&&(t[n]={words:Ic(r)||void 0,where:Ic(e[`trait-${n}-where`])||void 0,refs:r.refs.length?r.refs:void 0})}return t}function n$(e){const t={};for(const n of x2){const r=e[`look-${n}`];r!==void 0&&(t[n]=r)}return t}const r$=e=>Vd.map(t=>t.id).filter(t=>e.includes(t)),fr=e=>e.startsWith("look-"),Rle=e=>e.startsWith("trait-"),na=e=>QL.has(e);function fs(e){if(!e.startsWith("trait-"))return null;const t=e.endsWith("-where"),n=t?e.slice(6,-6):e.slice(6);return Oa(n)?{id:n,part:t?"where":"what"}:null}const Ple=[{to:8,name:"red"},{to:16,name:"scarlet"},{to:30,name:"orange"},{to:36,name:"amber"},{to:46,name:"gold"},{to:64,name:"yellow"},{to:80,name:"lime"},{to:95,name:"yellow-green"},{to:158,name:"green"},{to:172,name:"sea green"},{to:183,name:"teal"},{to:196,name:"cyan"},{to:205,name:"sky blue"},{to:215,name:"azure"},{to:240,name:"blue"},{to:252,name:"indigo"},{to:268,name:"violet"},{to:285,name:"purple"},{to:300,name:"orchid"},{to:318,name:"magenta"},{to:330,name:"fuchsia"},{to:342,name:"pink"},{to:352,name:"rose"},{to:360,name:"red"}],Lle=[{to:.05,name:"black"},{to:.16,name:"charcoal"},{to:.32,name:"dark grey"},{to:.62,name:"grey"},{to:.76,name:"light grey"},{to:.88,name:"silver"},{to:.96,name:"off-white"},{to:1.01,name:"white"}],$le=new Set(["black","charcoal","dark grey","grey","light grey","silver","off-white","white","dark brown","brown","chestnut","auburn","copper","tan","beige","cream","amber","gold","blonde"]),Tle=e=>{const t=String(e??"").replace("#","").trim();return(t.length===3?t.split("").map(r=>r+r):[t.slice(0,2),t.slice(2,4),t.slice(4,6)]).map(r=>{const a=Number.parseInt(r,16);return Number.isFinite(a)?a:0})};function Dle(e){const[t,n,r]=Tle(e),a=t/255,i=n/255,l=r/255,u=Math.max(a,i,l),f=Math.min(a,i,l),h=(u+f)/2,p=u-f;if(p===0)return{h:0,s:0,l:h};const g=p/(1-Math.abs(2*h-1));return{h:((u===a?60*((i-l)/p%6):u===i?60*((l-a)/p+2):60*((a-i)/p+4))+360)%360,s:g,l:h}}const Hle=e=>{var t;return((t=Ple.find(n=>e<n.to))==null?void 0:t.name)??"red"};function Ole(e,t,n){return e==="orange"||e==="amber"||e==="scarlet"?n<.2?"dark brown":n<.32?e==="scarlet"?"chestnut":"brown":n>=.86&&t<.6?"cream":n>=.72&&t<.6?"beige":n<.44&&t<.7?"brown":n<.62&&t<.55?"tan":null:(e==="gold"||e==="yellow")&&n<.42?"olive":(e==="indigo"||e==="violet"||e==="purple")&&n>=.72&&t<.7?"lavender":(e==="blue"||e==="azure"||e==="indigo")&&n<.22?"navy":e==="red"&&n<.34?t<.55?"burgundy":"maroon":e==="rose"&&n<.34?"burgundy":null}function Ile(e){return e<.18?"deep":e<.34?"dark":e>=.88?"pale":e>=.74?"light":""}function s$(e){var u;const{h:t,s:n,l:r}=Dle(e);if(n<.09){const f=((u=Lle.find(h=>r<h.to))==null?void 0:u.name)??"grey";return{name:f,family:f,h:t,s:n,l:r}}const a=Hle(t),i=Ole(a,n,r);if(i){const f=r<.12?"deep":r>=.93?"pale":"";return{name:f?`${f} ${i}`:i,family:i,h:t,s:n,l:r}}const l=Ile(r);return l?{name:`${l} ${a}`,family:a,h:t,s:n,l:r}:n<.22?{name:`muted ${a}`,family:a,h:t,s:n,l:r}:n>.85&&r>.4&&r<.65?{name:`vivid ${a}`,family:a,h:t,s:n,l:r}:{name:a,family:a,h:t,s:n,l:r}}function Fle(e){const{family:t,h:n,s:r,l:a}=s$(e);return $le.has(t)?!0:n>=16&&n<=60&&a>=.7&&r<.7||r<.09}const Ky=[{id:"black",label:"Black",color:"#15120f"},{id:"dark brown",label:"Dark brown",color:"#3b2418"},{id:"brown",label:"Brown",color:"#6b4630"},{id:"auburn",label:"Auburn",color:"#8c3b26"},{id:"ginger",label:"Ginger",color:"#c2622a"},{id:"blonde",label:"Blonde",color:"#d8ac63"},{id:"platinum blonde",label:"Platinum",color:"#e9e1d0"},{id:"grey",label:"Grey",color:"#9b9b99"},{id:"white",label:"White",color:"#f0efed"}],a$=[{id:"buzzed",label:"Buzzed",card:"length-1"},{id:"cropped",label:"Cropped",card:"length-2"},{id:"short",label:"Short",card:"length-3"},{id:"chin-length",label:"Chin",card:"length-4"},{id:"shoulder-length",label:"Shoulder",card:"length-5"},{id:"long",label:"Long",card:"length-6"}],Gy=[{id:"porcelain",label:"Porcelain",color:"#f4e0d4"},{id:"fair",label:"Fair",color:"#edcdb6"},{id:"light olive",label:"Light olive",color:"#ddb894"},{id:"olive",label:"Olive",color:"#c2935f"},{id:"tan",label:"Tan",color:"#a9713f"},{id:"brown",label:"Brown",color:"#7c4f2c"},{id:"deep brown",label:"Deep brown",color:"#57351d"},{id:"deep",label:"Deep",color:"#3a2114"}],o$=[{id:"slight",label:"Slight",card:"build-1"},{id:"lean",label:"Lean",card:"build-2"},{id:"average",label:"Average",card:"build-3"},{id:"solid",label:"Solid",card:"build-4"},{id:"full",label:"Full",card:"build-5"}],_le=[{id:"East Asian",label:"East Asian"},{id:"South Asian",label:"South Asian"},{id:"Southeast Asian",label:"Southeast Asian"},{id:"Middle Eastern",label:"Middle Eastern"},{id:"Mediterranean",label:"Mediterranean"},{id:"North African",label:"North African"},{id:"West African",label:"West African"},{id:"East African",label:"East African"},{id:"Northern European",label:"Northern European"},{id:"Eastern European",label:"Eastern European"},{id:"Latin American",label:"Latin American"},{id:"Caribbean",label:"Caribbean"},{id:"mixed heritage",label:"Mixed"}],Yy=[{id:"dark brown",label:"Dark brown",color:"#3b2a1d"},{id:"brown",label:"Brown",color:"#6b4423"},{id:"hazel",label:"Hazel",color:"#8a7340"},{id:"amber",label:"Amber",color:"#b07d1a"},{id:"green",label:"Green",color:"#5b7a4b"},{id:"blue",label:"Blue",color:"#4a7ba7"},{id:"grey",label:"Grey",color:"#8b949c"}],i$=[{id:"clean-shaven",label:"Clean shaven",card:"facial-1"},{id:"light stubble",label:"Stubble",card:"facial-2"},{id:"a moustache",label:"Moustache",card:"facial-3"},{id:"a goatee",label:"Goatee",card:"facial-4"},{id:"a short beard",label:"Short beard",card:"facial-5"},{id:"a full beard",label:"Full beard",card:"facial-6"}],l$=[{id:"very short",label:"Very short",card:"height-1"},{id:"short",label:"Short",card:"height-2"},{id:"average height",label:"Average",card:"height-3"},{id:"tall",label:"Tall",card:"height-4"},{id:"very tall",label:"Very tall",card:"height-5"}],Vle={},c$=[{id:"woman",label:"Woman"},{id:"man",label:"Man"},{id:"androgynous",label:"Androgynous"}],u$=["20s","30s","40s","50s","60+"].map(e=>({id:e,label:e})),pf={who:{row:{id:"who",label:"Who",options:c$},prompt:"Who are they?"},age:{row:{id:"age",label:"Age",options:u$},prompt:"Roughly how old?"},heritage:{row:{id:"heritage",label:"Heritage",options:_le},prompt:"Where are they from?"},skin:{row:{id:"skin",label:"Skin",options:Gy},prompt:"And their skin?"},eyes:{row:{id:"eyes",label:"Eyes",options:Yy},prompt:"What colour are their eyes?"},facial:{row:{id:"facial",label:"Facial hair",options:i$},prompt:"Any facial hair?"},hair:{row:{id:"hair",label:"Hair",options:Ky},prompt:"What colour is their hair?"},length:{row:{id:"length",label:"Length",options:a$},prompt:"And the length?"},build:{row:{id:"build",label:"Build",options:o$},prompt:"And their build?"},height:{row:{id:"height",label:"Height",options:l$},prompt:"And how tall?"}};x2.map(e=>pf[e]);const m7=new Set(["hair","skin","eyes"]),Zle={who:"Who they are, in your words",age:"Their age, in words or a number",heritage:"Where they are from, in your words",hair:"Their hair colour, in words or a swatch",length:"Their cut, in your words",facial:"Their facial hair, in your words",eyes:"Their eye colour, in words or a swatch",skin:"Their skin, in words or a swatch",build:"Their build, in your words",height:"How tall they are, in your words"},zle=e=>e==="man"?"man":e==="woman"?"woman":"androgynous",Ble=new Set(["length","height","build"]),Ule=900;function qy(e,t,n){const r=Wle(e,t);if(r.far<Ule)return r.id;const a=s$(e).name;return n==="hair"&&!Fle(e)?`dyed ${a}`:a}function Wle(e,t,n){const r=h=>{const p=h.replace("#","");return(p.length===3?p.split("").map(m=>m+m):[p.slice(0,2),p.slice(2,4),p.slice(4,6)]).map(m=>Number.parseInt(m,16)||0)},[a,i,l]=r(e);let u=t[0],f=Number.POSITIVE_INFINITY;for(const h of t){if(!h.color)continue;const[p,g,m]=r(h.color),w=(a-p)**2+(i-g)**2+(l-m)**2;w<f&&(f=w,u=h)}return{id:u.id,far:f}}const g7=e=>e==="skin"?Gy:e==="eyes"?Yy:Ky,pp=e=>e.charAt(0).toUpperCase()+e.slice(1);function d$(e){const t=H=>H!=null&&H.pick&&H.pick!==Oc?H.pick:"",n=(H,D,U)=>{var B;const V=t(H);return V?V.startsWith("#")?qy(V,D,U):V:((B=H==null?void 0:H.words)==null?void 0:B.trim())??""},r=H=>{var D;return t(H)?((D=H==null?void 0:H.words)==null?void 0:D.trim())??"":""},a=(H,...D)=>[H,...D.filter(Boolean)].join(" "),i=(H,D,U)=>n(H,D,U).toLowerCase(),l={androgynous:"androgynous person",man:"man",woman:"woman"},u=i(e.who,[]),f=l[u]??u,p=[n(e.heritage,[]),f].filter(Boolean).join(" "),m=[p?/^(a|an|the)\s/i.test(p)?p:`${/^[aeiou]/i.test(p)?"an":"a"} ${p}`:"a person"],w=i(e.age,[]),y=w==="60+"?"in their 60s or older":/^\d{1,3}$/.test(w)?`aged ${w}`:`in their ${w}`;w&&m.push(a(y,r(e.age)));const b=[],k=i(e.length,a$),S=i(e.hair,Ky,"hair"),E=[k,S].filter(Boolean).join(" ");E&&b.push(a(`${E} hair`,r(e.length),r(e.hair)));const C=i(e.facial,i$);C&&b.push(a(C,r(e.facial)));const A=i(e.eyes,Yy);A&&b.push(a(`${A} eyes`,r(e.eyes)));const L=i(e.skin,Gy,"skin");L&&b.push(a(`${L} skin`,r(e.skin)));const T=i(e.height,l$),M=i(e.build,o$),j=T?a(Vle[T]??T,r(e.height)):"",P=M?a(`${/^[aeiou]/.test(M)?"an":"a"} ${M} build`,r(e.build)):"",R=[j,P&&(j?`with ${P}`:P)].filter(Boolean).join(" ");return R&&b.push(R),b.length&&m.push(`with ${b.join(", ")}`),a(m.join(" "),r(e.who))}function Kle(e,t){var i,l;const n=t.pick,r=n===Oc?"Either way":n!=null&&n.startsWith("#")?pp(qy(n,e.options,e.id)):n?((i=e.options.find(u=>u.id===n))==null?void 0:i.label)??pp(n):"",a=((l=t.words)==null?void 0:l.trim())??"";return r?a?`${r}, ${a}`:r:pp(a)}function Gle(e){return pp(d$(e))}const C1=e=>typeof e=="string"&&e.startsWith("aside:"),Yle=e=>e.slice(6),tm={answers:{},revision:0,editing:null,saying:null,says:0,text:"",colour:null,composing:null,asides:[],unsure:null,extrasDeclined:!1,held:!1,uploading:0},qle="That did not read as a description of someone.",f$=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Xle(e){if(!e||e==="name")return null;if(e==="keep")return"keep";const t=fs(e);return t&&t.part==="what"?`trait-${t.id}`:null}function v7(e,t){var r;const n=Xle(t);return n?{id:n,refs:((r=e.answers[n])==null?void 0:r.refs)??[]}:null}function p6(e){const t=e.composing;if(!t)return e.answers;const n=e.answers[t.id];if(!n||f$(n.refs,t.refs))return e.answers;if(!Ic(n)&&!t.refs.length){const r={...e.answers};return delete r[t.id],r}return{...e.answers,[t.id]:{...n,refs:t.refs}}}function Qle(e,t){var r;if(!fr(t)&&!fs(t))return;const n=e.answers[t];if(n)return{saying:t,text:n.words??"",colour:(r=n.pick)!=null&&r.startsWith("#")?{step:t,hex:n.pick}:null}}function iv(e,t,n,r){return e.filter(a=>!a.q||!na(a.q)?!0:!JL(a.q,t,n)||a.edit&&t[a.q]!==void 0?!1:r===void 0||E1(a.q)<=r)}function Jle(e){const t=Object.keys(e).filter(n=>na(n));return t.length?Math.min(...t.map(E1)):void 0}function h$(e,t){if(!e.some(r=>r.at===t.at))return t;let n=1;for(;e.some(r=>r.at===`${t.at}#${n}`);)n+=1;return{...t,at:`${t.at}#${n}`}}function m6(e,t){const n=e.unsure;if(!n)return e;const r=C2(e.answers,t),a=u=>u&&(u===r||na(u)&&e.answers[u]!==void 0)?u:null,i=e.asides.map(u=>u.q==="unsure"?{...u,q:a(n.q)}:u),l=h$(i,{said:n.said,reply:qle,q:a(n.q),at:n.at});return{...e,unsure:null,asides:iv([...i,l],e.answers,t)}}function ece(e,t){var n,r,a;switch(t.type){case"answer":{const i=p7(e.answers,t.patch,t.ctx),l=!f$(i,e.answers),u=m6(e,t.ctx);return{...u,answers:i,revision:l?e.revision+1:e.revision,asides:iv(u.asides,i,t.ctx,Jle(t.patch)),editing:null,saying:null,colour:null,composing:null,text:""}}case"edit":{const i=C1(t.id)||t.id==="name"?void 0:Qle(e,t.id);return{...e,answers:p6(e),composing:C1(t.id)?null:v7(e,t.id),editing:t.id,saying:(i==null?void 0:i.saying)??null,says:i?e.says+1:e.says,colour:(i==null?void 0:i.colour)??null,text:(i==null?void 0:i.text)??""}}case"amend-aside":{const i=e.asides.find(h=>h.at===t.at),l=i!=null&&i.q&&na(i.q)?i.q:null,u=l&&e.answers[l]!==void 0?p7(e.answers,{[l]:void 0},t.ctx):e.answers,f=iv(e.asides.filter(h=>h.at<=t.at),u,t.ctx,l?E1(l):void 0);return{...e,answers:u,revision:u===e.answers?e.revision:e.revision+1,editing:null,asides:f.map(h=>h.at===t.at?{...h,said:t.said,reply:t.reply,kind:t.kind,rev:(h.rev??0)+1}:h)}}case"drop-aside":return{...e,editing:null,asides:e.asides.filter(i=>i.at<t.at)};case"cancel-edit":return{...e,answers:p6(e),composing:null,editing:null,saying:null,colour:null,text:""};case"say":{const i=e.saying===t.id?null:t.id;return{...e,answers:p6(e),composing:v7(e,i),saying:i,says:e.says+1,colour:null,text:""}}case"text":return e.text===t.text?e:{...e,text:t.text};case"colour":return t.hex?t.step&&t.step!=="keep"?{...e,colour:{step:t.step,hex:t.hex}}:e:{...e,colour:null};case"aside":{if(!t.aside.said.trim()||!t.aside.reply.trim())return{...e,text:""};const l=!!t.aside.q&&na(t.aside.q)&&e.answers[t.aside.q]!==void 0?{...t.aside,after:!0}:t.aside;return{...e,asides:[...e.asides,h$(e.asides,l)],text:""}}case"unsure":return{...m6(e,t.ctx),unsure:t.unsure,text:""};case"settle-unsure":return m6(e,t.ctx);case"upload-begin":return{...e,uploading:e.uploading+1};case"upload-end":return{...e,uploading:Math.max(0,e.uploading-1)};case"uploaded":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.hashes.includes(t.hash)||i.hashes.length>=t.max?e:{...e,answers:{...e.answers,photos:{...i,hashes:[...i.hashes,t.hash]}},revision:e.revision+1}}case"remove-photo":{const i=e.answers.photos;if(!(i!=null&&i.hashes.includes(t.hash)))return e;const l=i.hashes.filter(u=>u!==t.hash);return{...e,answers:{...e.answers,photos:{hashes:l,attested:l.length?i.attested:!1}},revision:e.revision+1}}case"attest":{if(((r=e.answers.source)==null?void 0:r.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.attested===t.checked?e:{...e,answers:{...e.answers,photos:{...i,attested:t.checked}},revision:e.revision+1}}case"ref":{if(t.id!=="keep"){const u=t.id.slice(6);if(!((a=e.answers.traits)!=null&&a.includes(u)))return e}const i=e.answers[t.id]??{refs:[]},l=t.remove?i.refs.filter(u=>u!==t.hash):t.id==="keep"?[...i.refs.filter(u=>u!==t.hash),t.hash].slice(-4):[t.hash];return l.join()===i.refs.join()?e:{...e,answers:{...e.answers,[t.id]:{...i,refs:l}},revision:e.revision+1}}case"extras-declined":return{...e,extrasDeclined:!0};case"hold":return e.held===t.held?e:{...e,held:t.held};case"start-over":return{...tm,revision:e.revision+1,text:t.text??""};case"restore":return{...tm,answers:t.answers,revision:t.revision,asides:t.asides??[],extrasDeclined:!!t.extrasDeclined,held:!!t.held}}}function lv(e,t){return C2(e.answers,t)===null&&!e.editing&&!e.saying}const p$=5,m$=40;function tce(e){return JSON.stringify({v:p$,answers:e.answers,revision:e.revision,asides:e.asides.slice(-m$),...e.extrasDeclined?{extrasDeclined:!0}:{},...e.held?{held:!0}:{}})}function nce(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.said!="string"||typeof t.reply!="string"||typeof t.at!="string"||!t.said.trim()||!t.reply.trim())return null;const n=typeof t.q=="string"?t.q:null,r=typeof t.rev=="number"&&t.rev>0?t.rev:void 0,a=typeof t.kind=="string"?t.kind:void 0,i=t.after===!0?!0:void 0,l=t.edit===!0?!0:void 0;return{said:t.said,reply:t.reply,q:n,at:t.at,...r?{rev:r}:{},...a?{kind:a}:{},...i?{after:i}:{},...l?{edit:l}:{}}}function rce(e){var r;if(fr(e))return pf[e.slice(5)].row.options;const t=fs(e),n=t&&Oa(t.id);return n?t.part==="where"?((r=n.where)==null?void 0:r.options)??[]:n.options:[]}function w7(e,t){return t===Oc||/^#[0-9a-f]{6}$/i.test(t)?{pick:t}:rce(e).some(n=>n.id===t)?{pick:t}:{words:t}}function sce(e,t){if(e==="keep")return typeof t=="string"?{words:t,refs:[]}:t;if(typeof t=="string"&&(fr(e)||fs(e)))return w7(e,t);const n=fs(e);if((n==null?void 0:n.part)==="what"&&t&&typeof t=="object"){const r=t,a=Array.isArray(r.refs)?r.refs:[];return r.pick!==void 0||typeof r.words!="string"?{...r,refs:a}:{...w7(e,r.words),refs:a}}return t}function nm(e){if(!e)return null;try{const t=JSON.parse(e);if(t.v!==p$&&t.v!==4&&t.v!==3&&t.v!==2||!t.answers||typeof t.answers!="object")return null;const n={};for(const[a,i]of Object.entries(t.answers))na(a)&&(n[a]=sce(a,i));const r=(Array.isArray(t.asides)?t.asides:[]).map(nce).filter(a=>a!==null).slice(-m$);return{answers:n,revision:typeof t.revision=="number"?t.revision:0,asides:r,...t.extrasDeclined===!0?{extrasDeclined:!0}:{},...t.held===!0?{held:!0}:{}}}catch{return null}}const qn={source:"Who are we making? Describe someone new, or add photos of a real person.",describe:"Describe them. Age, hair, build, skin and presence all help; one or two sentences is enough.",lookHint:"Skip anything you would rather leave to us.",photos:"Add one clear photo of their face. Up to three more angles hold the likeness better.",weakPhotos:"I cannot read a face in any of those photos, so anything I draw now would be a stranger rather than them.",name:"What should we call them?",traits:"Anything else that is always true of them?",traitsPhotos:"Anything in these photos that is always true of them?",keep:"Anything else about them?",agree:"Here is the person, in full. Ready to draw?",noEngine:"Drawing a person needs image generation, which is not set up yet.",identity:e=>`Here is ${e==="them"?"the face":e}. Use this person to draw the rest from this face, or change something.`,change:"What should change?",landed:e=>`Here is the ${e}. Use it, or try again.`,extras:"Add back and profile views? Three more pictures, for shots from behind or in profile."},g$=e=>e==="photos"?"the photos":"the face",v$=[{id:"photos",label:"Add photos"},{id:"scratch",label:"Describe someone"}],ace={photos:/\b(photos?|pictures?|pics?|upload|images?|selfies?)\b/,scratch:/\b(scratch|describe|description|invent|make (someone|one|them) up|imagine|new person)\b/},oce=[{label:"Late 30s, warm",text:"A woman in her late 30s, Mediterranean, olive skin, dark shoulder-length hair, slim build, warm and composed."},{label:"Early 20s, bright",text:"A man in his early 20s, fair skin with freckles, short blond hair, athletic build, bright and easygoing."},{label:"Mid 40s, quiet",text:"A man in his mid 40s, East Asian, close-cropped black hair, lean build, quietly confident."},{label:"Late 20s, easy",text:"A woman in her late 20s, deep brown skin, natural curls, tall and graceful, with an easy laugh."},{label:"Sixties, calm",text:"A woman in her early sixties, light skin, silver hair in a soft bob, broad build, calm and assured."}];function w$(e){const t=(e??"").replace(/\s*\(BYOK\)\s*$/i,"").trim();return`I have permission to use this person's likeness, and to send these photos ${t?/^codex/i.test(t)?"to OpenAI, through Codex, to draw them":`to ${t} to draw them`:"to the engine that draws them"}.`}w$(null);function ice(e){const t=[];return e.over>0&&t.push(e.over===1?`That is one more than ${e.max} photos, so the last one was not added.`:`That is ${e.over} more than ${e.max} photos, so the last ${e.over} were not added.`),e.same>0&&t.push(e.same===1?"One of those is already here.":`${e.same} of those are already here.`),e.failed.length&&t.push(e.failed.join(" ")),t.length?t.join(" "):null}const lce=(e,t)=>`${e} is larger than ${Math.round(t/1024/1024)}MB. Choose a smaller copy of it.`,cce=e=>/\.hei[cf]$/i.test(e)?`${e} is a HEIC photo, which Scenri cannot read yet. Export it as JPEG and add that.`:`${e} could not be read as a photograph. JPEG, PNG and WebP all work.`,uce="First portrait appears here",dce=(e,t)=>!e||e==="portrait"||!t?uce:`The ${t} appears here`;function fce(e,t=0){return e==="agree"?"Ready when you are":e==="source"?"Describe them, or add photos":e==="photos"?t?"Continue when the photos are in":"Add their photos":e==="retry"?"Try again from the conversation":e==="noengine"?"Set up image generation to draw them":"Keep describing your person"}const y$=e=>e===1?"One thing I cannot tell yet.":e===2?"Two things I cannot tell yet.":"A few things I cannot tell yet.";function hce(e){return e===1?"One photo":`${e} photos`}function pce(e,t){return e===0?"The same person, face clear. Add the clearest one first.":e===1?"One photo works. Two to four, from different angles, hold the likeness better.":e<t?`${e} photos. More angles hold the likeness better.`:"Four angles. The reference set comes from these, the first one leading."}const mce="That does not read as a description yet. Draw from it anyway, or describe them: age, hair, build, skin, presence.",gce=e=>e===0?void 0:e===1?"Changing this asks the one after it again.":`Changing this asks the ${e} after it again.`,vce="Change this answer?",wce="The face is drawn again from the change, and the views built on it follow. Nothing already saved changes.",yce="The views drawn from the photos are drawn again with the change. The photos themselves stay as they are.",bce={source:"describe them in a sentence, or pick one",describe:"a few words about them is enough: age, hair, build, skin, presence",look:"tap one, or say it in your own words",name:"a name, so the rest of the conversation can use it",refine:"say what should change: hair, age or build change the person; anything else changes the view on the stage",detail:"tap one, or say what it looks like"},xce={who:{thing:"a person",how:"tap who they are"},age:{thing:"an age",how:"tap an age, or type one: Scenri draws adults"},hair:{thing:"a hair colour",how:"tap a colour, or say it: dark auburn, salt and pepper"},length:{thing:"a length",how:"tap a length, or say it: a chin-length bob"},skin:{thing:"a skin tone",how:"tap a tone, or say it: warm olive"},build:{thing:"a build",how:"tap a build, or say it: lean and tall"}},xs=e=>e.charAt(0).toUpperCase()+e.slice(1);function uc(e,t,n,r="",a,i=!1){const l=t==="look"?xce[a??""]??null:null,u=(l==null?void 0:l.how)??bce[t],f=i?"":` ${xs(u)}.`;if(n>=2&&e!=="likeness"){const h=t==="look"||t==="detail"?"Or Skip it and we will choose.":"";return i?h||`${xs(u)}.`:`${xs(u)}.${h?` ${h}`:""}`}switch(e){case"likeness":return"Describe them by looks. Scenri does not draw a named person.";case"help":return l?`${xs(u)}.`:t==="refine"?"Select a view and say what is wrong with it, or say what should change about them: hair, age, build, skin.":t==="name"?"Any name will do; it can be changed later.":t==="detail"?`${xs(u)}.`:"Describe the person in a sentence: age, hair, build, skin, presence. Or add photos of a real person.";case"question":return l?`This step asks for ${l.thing}: ${u}.`:t==="refine"?`This is where the picture is changed: ${u}.`:t==="name"?`This is where they get a name: ${u}.`:t==="detail"?`This asks what the detail looks like: ${u}.`:`This is where the person is described: ${u}.`;case"nav":return"To begin again, use Start over at the top. Close keeps the draft where it is.";case"go":return t==="refine"?"Try again redraws it as it is; a sentence says what should change.":`Nothing to draw yet. ${xs(u)}.`;case"intent":return l?`${xs(u)}.`:t==="refine"?`Nothing changes until it is said what: ${u}.`:`That is what we are here for. Who are they? ${xs(u)}.`;case"nonsense":return l?`That is not ${l.thing}.${f}`:t==="name"?`That is not a name. ${xs(u)}.`:t==="refine"?`That does not say what should change. ${xs(u)}.`:t==="detail"?`That does not say what it looks like. ${xs(u)}.`:`That does not describe anyone. ${xs(u)}.`;case"greeting":return n?`Still here.${f}`:/^(hi|hello|hey|heya|hiya|yo|hola|shalom|good)\b/i.test(r.trim())?`Hi.${f}`:`${xs(u)}.`;case"ack":return n?`Still here.${f}`:i?"Go ahead.":`Go ahead: ${u}.`;case"vague":return n?`Still here. ${xs(u)}.`:`${xs(u)}.`}}const kce=e=>e.trim().replace(/[.\s]+$/,""),Xy=e=>e?e==="portrait"?"Everything else you had is kept.":"The face and everything else you had are kept.":"Everything you had is kept.";function j2(e,t,n=Xy(null)){const r=co(t);if(r.kind==="unknown")return{text:`${e}: ${kce(t)}. ${n}`};const a=r.remedy??(r.retryable?void 0:{label:"Providers",opens:"engines"});return{text:`${e}. ${r.fix?`${r.title} ${r.fix}`:r.title}`,remedy:a}}const cv=e=>e&&bM.includes(e)?[{id:"skip-extras",label:"Not now"}]:[];function b$(e,t=[]){return{id:"retry",kind:"confirm",tone:"alert",prompt:e.text,options:[...e.remedy?[{id:`remedy:${e.remedy.opens}`,label:e.remedy.label}]:[],{id:"retry",label:"Retry"},...t]}}function Uh(e,t){const n=e==="portrait"?"face":xn[e];return t==="cancelled"?{id:"retry",kind:"confirm",quiet:!0,prompt:`Stopped drawing the ${n}. Nothing finished was touched.`,options:[{id:"retry",label:"Draw it again"},...cv(e)]}:b$(j2(`The ${n} could not be drawn`,t,Xy(e)),cv(e))}function Sce(e){var r;const t=(((r=e.analysis)==null?void 0:r.suitableCategories)??[]).filter(Boolean);return t.length?` Filed under ${t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}; that can change on their page.`:""}function Ece(e){if(!e)return"";const t=[...e.asks??[],...e.results??[],...e.decisions??[]].map(n=>n.at);return t.length?t.reduce((n,r)=>r>n?r:n):""}const Cce=e=>e.charAt(0).toUpperCase()+e.slice(1);function jce({draft:e,ui:t,afterCoverage:n,asides:r,openId:a,placed:i}){var te;const l=[],u=(J,Q,ae)=>l.push({kind:"scenri",id:J,text:Q,tone:ae}),f=J=>l.push({kind:"question",question:J}),h=((te=e.name)==null?void 0:te.trim())??"",p=h||"them",g=()=>{h&&(l.push({kind:"scenri",id:"asked-name",text:qn.name,quiet:!0}),l.push({kind:"you",id:"name",text:h,editable:!0,editing:t.editingName||void 0}))},m=()=>f({id:"name",kind:"text",prompt:qn.name}),w=(J,Q=[])=>t.failedView?Uh(t.failedView,J):b$(j2("That did not go through",J),Q),y=()=>{h||m()};if(e.stage==="analyzing")return u("reading",`Reading ${g$(e.source)}.`),h?g():m(),l;const b=Iq(e);b&&u("coverage",b.text,b.tone),l.push(...n);const k=e.views.portrait,S=e.activeView,E=e.asks??[],C=E[E.length-1],A=C?e.views[C.view]:null,L=!!C&&!!A&&(A.status==="generating"&&e.activeView===C.view||A.status==="candidate"&&A.adjustment===C.text||!!A.error),T=J=>J==="portrait"&&!fi(e)?qn.identity(p):qn.change,M=(e.results??[]).filter(J=>J.how!=="restored"),j=e.decisions??[],P=!e.activeView&&e.stage==="idle",R=new Map,H=new Map,D=new Map;for(const J of M){const Q=`${J.view}:${J.hash}`;if(D.set(Q,J),R.has(Q))continue;const ae=(H.get(J.view)??0)+1;H.set(J.view,ae),R.set(Q,ae)}const U=J=>R.get(`${J.view}:${J.hash}`)??1,V=(J,Q)=>{const ae=U(J),$e=e.views[J.view].hash===J.hash,ie=(H.get(J.view)??0)>1;return{kind:"scenri",id:Q,text:`Here is ${xn[J.view]} ${ae}.`,thumb:J.hash,view:J.view,label:`${$c[J.view]} ${ae}`,current:ie&&$e&&D.get(`${J.view}:${J.hash}`)===J,restore:P&&!$e&&!zw(e,J.view)?{view:J.view,hash:J.hash}:void 0}},B=new Set,G=new Map(E.map(J=>{const Q=M.find(ae=>!B.has(ae)&&ae.how==="drawn"&&ae.view===J.view&&ae.ask===J.text&&ae.at>=J.at);return Q&&B.add(Q),[J,Q]})),_=new Map;for(const J of j)J.what==="use"&&!_.has(J.view)&&_.set(J.view,J);const O=J=>J==="portrait"?`Here is ${p} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${xn[J]}. Use it, or keep the previous one.`,I=J=>{const Q=J===_.get(J.view),ae=J.view==="portrait"&&Q,$e=J.what==="again"?"Try again":J.what==="keep"?"Keep previous":ae?"Use this person":J.view==="portrait"?"Use this":"Use it";return[{kind:"scenri",id:`asked-decided-${J.at}`,text:ae?qn.identity(p):Q?qn.landed(xn[J.view]):O(J.view),quiet:!0},{kind:"you",id:`decided-${J.at}`,text:$e,editable:!1}]},K=()=>{const J=L?E.slice(0,-1):E,Q=Ece(e),ae=r.filter(ke=>!i.has(ke)&&(ke.q!==a||ke.at<=Q));for(const ke of ae)i.add(ke);const $e=M.find(ke=>bM.includes(ke.view)),ie=[...J.map(ke=>{const ze=G.get(ke);return{at:ke.at,turns:[{kind:"scenri",id:`asked-ask-${ke.at}`,text:T(ke.view),quiet:!0},{kind:"you",id:`ask-${ke.at}`,text:ke.text,editable:!1},...ze?[V(ze,`redrew-${ke.at}`)]:[]]}}),...M.filter(ke=>!B.has(ke)).map(ke=>({at:ke.at,turns:[V(ke,`result-${ke.at}`)]})),...j.map(ke=>({at:ke.at,turns:I(ke)})),...ae.map(ke=>({at:ke.at,turns:Ei(ke)})),...fi(e)&&(e.extras||t.extrasDeclined)?[{at:$e?$e.at.slice(0,-1):"~",turns:[{kind:"scenri",id:"asked-extras",text:qn.extras,quiet:!0},{kind:"you",id:"extras",text:e.extras?"Add them":"Not now",editable:!1}]}]:[]];ie.sort((ke,ze)=>ke.at<ze.at?-1:ke.at>ze.at?1:0);for(const ke of ie)l.push(...ke.turns)},z=()=>{!L||!C||(l.push({kind:"scenri",id:`asked-ask-${C.at}`,text:T(C.view),quiet:!0}),l.push({kind:"you",id:`ask-${C.at}`,text:C.text,editable:!1}))};if(!fi(e)){const J=k.status==="generating"||S==="portrait"&&k.status!=="candidate";return J&&!E.length?(u("drawing-face","Drawing their face."),h?g():m(),l):(g(),K(),J?(z(),u("drawing-face",L?"Adjusting the face. Everything else stays.":"Drawing their face."),h||m(),l):t.failed?(y(),f(w(t.failed)),l):k.error?(y(),z(),f(Uh("portrait",k.error)),l):(k.status==="candidate"&&(y(),z(),f({id:"identity",kind:"confirm",prompt:L?"Adjusted. Use this person, or try again.":qn.identity(p),hint:h7("portrait",e.keepItems),options:[{id:"use",label:"Use this person"},{id:"again",label:"Try again"}],describe:"Change something"})),l))}g(),K();const q=Object.keys(e.views),Z=di(e),ee=[...Z].reverse().find(J=>E4.has(J)),he=Z.find(J=>!E4.has(J)),ue=q.find(J=>e.views[J].status==="candidate"),ge=Z.find(J=>!!e.views[J].error);if(t.failed&&!S)return y(),f(w(t.failed,cv(Gm(e)))),l;if(S)return z(),u(`drawing-${S}`,L&&(C==null?void 0:C.view)===S?`Redrawing the ${xn[S]}.`:S===ee&&!e.views[S].hash?`Drawing the ${xn[S]} from this face.`:S===he&&!e.views[S].hash&&ee?`Building the rest of the set from the ${xn[ee]}.`:`Drawing the ${xn[S]}.`),h||m(),l;if(ue){y(),z();const J=e.views[ue],Q=!!J.prior,ae=ie=>ie?R.get(`${ue}:${ie}`)??0:0,$e=!!J.hash&&!!J.prior&&ae(J.hash)<ae(J.prior);if(J.error){const ie=Uh(ue,J.error);u(`failed-${ue}`,ie.prompt,J.error==="cancelled"?void 0:"alert")}return J.hash&&l.push({kind:"scenri",id:`candidate-${ue}-${J.hash}`,text:$e?`Here is ${xn[ue]} ${ae(J.hash)} again.`:J.error?`Here is the ${xn[ue]} as it is.`:Q?ue==="portrait"?`Here is ${p} with the change.`:`Redrew the ${xn[ue]}.`:`Here is the ${xn[ue]}.`,thumb:J.hash,label:$c[ue],view:ue,current:!0}),f({id:ue==="portrait"?"revision":"view-revision",kind:"confirm",prompt:Q?ue==="portrait"?`Use this, or keep the previous one.${Fq(e,ue)?" Using it redraws the views built on the face.":""}`:"Use it, or keep the previous one.":"Use it, or try again.",hint:ue==="portrait"||ue==="front"?h7(ue,e.keepItems):void 0,options:[{id:"use",label:ue==="portrait"?"Use this":"Use it"},...Q?[{id:"keep",label:"Keep previous"}]:[],{id:"again",label:"Try again"}]}),l}return ge?(y(),z(),f(Uh(ge,e.views[ge].error??"")),l):xq(e)?!e.extras&&!t.extrasDeclined?(y(),u("set-ready","The set is ready. Select a view and say what is wrong to redraw it."),f({id:"extras",kind:"confirm",prompt:qn.extras,noEnter:!0,options:[{id:"add",label:"Add them"},{id:"save",label:"Not now"}]}),l):h?(f({id:"save",kind:"confirm",prompt:`${Cce(p)} is ready.${Sce(e)}`,options:[{id:"save",label:"Save person"}]}),l):(m(),l):(h||m(),l)}const Ace={who:{label:"Who",options:c$},age:{label:"Age",options:u$},build:{label:"Build",options:["slender","average","athletic","fuller"].map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}},rm=e=>e.charAt(0).toUpperCase()+e.slice(1);function Nce(e){return!e||e==="skipped"?"Draw as is":Object.values(e).map(t=>rm(t)).join(", ")}function Mce(e){const t=e.map(n=>{var r;return((r=Oa(n))==null?void 0:r.label)??n});return t.length?t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`:"Nothing distinctive"}const Rce=e=>Vne(e,v$,ace),x$=(e,t)=>e.trim().slice(0,t).trimEnd(),Pce=AP;function mf(e){return x$(Lce(e),Pce)}function Lce(e){var a;if(((a=e.source)==null?void 0:a.via)==="taps"){const i=n$(e),l=Ic(i.who);return d$(l&&!ya(l)?{...i,who:void 0}:i)}const t=(e.describe??"").trim(),n=e.gaps&&e.gaps!=="skipped"?e.gaps:{},r=n.build?`${t.replace(/[.\s]+$/,"")}, ${n.build} build`:t;return Tq({steer:n.who??null,age:n.age??null},r)}function $ce(e){return A2(e).map(t=>t.words)}const Tce=Sd,Dce=12;function A2(e){var i,l;const t=Mle(e),n=(u,f,h)=>({id:u,words:x$(f,Tce),...h!=null&&h.length?{refs:h.slice(0,4)}:{}}),r=[];for(const u of r$(e.traits??[])){const f=t[u],h=f?vle(u,f):"";h&&r.push(n(u,h,f==null?void 0:f.refs))}const a=(((i=e.keep)==null?void 0:i.words)??"").trim();return a&&r.push(n("said",a,(l=e.keep)==null?void 0:l.refs)),r.slice(0,Dce)}function y7(e){const t=$ce(e);return t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Hce(e){const t=e.trim().replace(/[.\s]+$/,""),n=t.replace(/^(?:but|and|also|plus|though|although|however)\b[\s,]*/i,"");return n.replace(/^(?:he|she|they|it)\s+(?:has|have|had|has got|have got|is|are|wears?|carries)\s+/i,"")||n||t}function Oce(e,t,n,r){const a=r.toLowerCase().split(/[^a-z0-9]+/).filter(l=>l.length>2);if(!a.length)return!0;const i=mf({...e,[t]:n}).toLowerCase();return a.every(l=>i.includes(l))}function Ice(e){const t=nm(e.setup??null);return t&&Object.keys(t.answers).length?{answers:t.answers,asides:t.asides,...t.extrasDeclined?{extrasDeclined:t.extrasDeclined}:{}}:{answers:Fce(e),asides:[]}}function Fce(e){const t=nm(e.setup??null);return t&&Object.keys(t.answers).length?t.answers:e.source==="photos"?{source:{door:"photos",via:"taps"},photos:{hashes:e.sources??[],attested:!0},...b7(e)}:{source:{door:"scratch",via:"typed"},describe:e.direction??"",gaps:"skipped",traits:[],...b7(e)}}function b7(e){const t=e.keepItems??[];if(!t.length)return{};const n={},r=[];let a;for(const i of t){const l=Vd.find(u=>u.id===i.id);if(l){r.push(l.id),n[`trait-${l.id}`]={words:i.words,refs:i.refs??[]};continue}a={words:[a==null?void 0:a.words,i.words].filter(Boolean).join(", "),refs:[...(a==null?void 0:a.refs)??[],...i.refs??[]]}}return n.traits=r,a&&(n.keep=a),n}const k$=(e,t,n)=>({draft:e?{source:e.source,stage:e.stage,keep:e.keep,views:{portrait:{status:e.views.portrait.status}},analysis:e.analysis?{photos:e.analysis.photos}:void 0}:null,canGenerate:t,...n?{engine:n}:{}});function _ce(e,t,n){var a,i;if(e==="source")return t.kind==="choice"?{source:{door:t.id,via:"taps"}}:null;if(fr(e)){const l=(a=n[e])==null?void 0:a.words,u=l?{words:l}:{};return t.kind==="swatches"?{[e]:{pick:t.picks[e.slice(5)]??Object.values(t.picks)[0],...u}}:t.kind==="skip"?{[e]:{pick:Oc,...u}}:null}if(e==="gaps")return t.kind==="choices"?{gaps:t.picks}:t.kind==="skip"?{gaps:"skipped"}:null;if(e==="traits")return t.kind==="choices"?{traits:Vd.map(l=>l.id).filter(l=>t.picks[l])}:t.kind==="skip"?{traits:[]}:null;const r=fs(e);if(r&&t.kind==="choice"){if(r.part==="where"){const u=(i=n[e])==null?void 0:i.words;return{[e]:{pick:t.id,...u?{words:u}:{}}}}const l=n[`trait-${r.id}`];return{[e]:{pick:t.id,...l!=null&&l.words?{words:l.words}:{},refs:(l==null?void 0:l.refs)??[]}}}return null}function Vce(e,t){var r;return`the ${((r=Oa(e))==null?void 0:r.label.toLowerCase())??"detail"} in the attached ${t===1?"picture":"pictures"}`}const x7="A scar, a ring, anything we missed",Zce=new Set(["describe","keep"]),zce=new Set(["likeness","help","question","greeting","ack","nav","intent","go","nonsense"]);function k7(e,t){const n=(t==null?void 0:t.trim())??"";return e?n?`${e}, ${n}`:e:rm(n)}const Bce=/^(?:but|and|though|although|only|just|except(?: that)?|with|without|plus)\s+/i,S7=e=>Bce.test(e.trim());function g6(e){return e.trim().replace(/[.\s]+$/,"").replace(/^(?:but|and|though|although|only|just|except(?: that)?)\s+/i,"").trim()}function j1(e,t){if(!e)return!1;if(Zce.has(e))return!0;if(!fr(e)&&!fs(e))return!1;const n=t[e];return!!n&&!n.pick&&!!n.words}function Wh(e,t,n){const r=t.trim();return r?e==="look-age"&&Nq(r)?null:e!=="look-who"&&(fr(e)||e.startsWith("trait-"))&&Cq(r)?"nonsense":fr(e)||e.startsWith("trait-")||e==="keep"?Wce(r,n):e==="describe"||e==="source"?ai(r,n):null:"vague"}function v6(e,t,n){if(e&&fr(e))return"look";if(e==="keep"||e!=null&&e.startsWith("trait-"))return"detail";const r=e??t;if(r&&fr(r))return"look";if(r!=null&&r.startsWith("trait-"))return"detail";switch(r){case"source":return"source";case"describe":case"gaps":return"describe";case"name":return"name";case"traits":return"detail";default:return n?"refine":"describe"}}const E7=new Set(["who","age","hair","colour","color","length","cut","skin","build","body","name","look","style","face","person","presenter","glasses","scar","scars","tattoo","piercing","makeup","freckles","prosthetic"]),Uce=/^[a-z]{1,10}\d+$/i,Wce=(e,t)=>{const n=e.trim(),r=n.toLowerCase().replace(/[^a-z ]/g,"");if(E7.has(r)||E7.has(r.replace(/^(the|their|its|his|her)\s+/,"")))return"nonsense";const a=n.split(/\s+/).filter(Boolean);if(a.length<=2&&a.some(l=>Uce.test(l)))return"nonsense";const i=ai(e,t);return i&&zce.has(i)?i:null};function Kce(e,t){return e==="name"?"metadata":t?e==="source"||e==="photos"?"start-over":"redraw":"plain"}function C7(e,t,n,r){var f,h,p,g,m,w,y,b,k;const a=t.answers,i=r?{reopened:!0,cost:gce(t$(a,n).filter(S=>S!=="keep"&&E1(S)>E1(e)).length)}:{};switch(e){case"source":return{id:e,kind:"choice",prompt:qn.source,options:v$,given:(f=a.source)==null?void 0:f.door,...i};case"weakphotos":return{id:e,kind:"confirm",prompt:qn.weakPhotos,noEnter:!0,options:[{id:"again",label:"Use different photos"},{id:"anyway",label:"Draw from these anyway"}]};case"photos":{const S=a.photos??{hashes:[],attested:!1};return{id:e,kind:"photos",prompt:qn.photos,hint:pce(S.hashes.length,U0),hashes:S.hashes,max:U0,busy:t.uploading>0,attest:{text:w$(n.engine),checked:S.attested},submit:"Continue",back:"Describe someone instead"}}case"describe":return{id:e,kind:"text",prompt:qn.describe,starters:oce};case"gaps":{const S=Wy(a.describe??"");return{id:e,kind:"choice",prompt:y$(S.length),groups:S.map(E=>({id:E,...Ace[E]})),submit:"Continue",skip:"Skip, draw as is",given:a.gaps&&a.gaps!=="skipped"?a.gaps:void 0,...i}}case"traits":{const S=((h=a.source)==null?void 0:h.door)==="photos";return{id:e,kind:"choice",prompt:S?qn.traitsPhotos:qn.traits,multi:!0,options:Vd.map(E=>({id:E.id,label:E.label})),submit:"Continue",skip:S?"Nothing to add":"Nothing else",given:a.traits,...i}}case"keep":return{id:e,kind:"text",prompt:qn.keep}}if(fr(e)){const S=e.slice(5),{row:E,prompt:C}=pf[S],A=zle((p=a["look-who"])==null?void 0:p.pick),L=Ble.has(S)?{...E,options:E.options.map(T=>T.card?{...T,card:`${T.card}-${A}`}:T)}:E;return{id:e,kind:"swatches",prompt:C,hint:S==="who"?qn.lookHint:void 0,row:L,skip:"Skip",describe:S==="who"?"Describe them instead":void 0,saying:t.saying===e,given:((g=a[e])==null?void 0:g.pick)===Oc||(m=a[e])==null?void 0:m.pick,skipped:((w=a[e])==null?void 0:w.pick)===Oc,note:(y=a[e])==null?void 0:y.words,...i}}const l=fs(e),u=l?Oa(l.id):void 0;if(l&&u&&l.part==="where"&&u.where)return{id:e,kind:"choice",prompt:u.where.ask,options:u.where.options.map(S=>({id:S.id,label:S.label})),saying:t.saying===e,given:(b=a[e])==null?void 0:b.pick,note:(k=a[e])==null?void 0:k.words,...i};if(l&&u){const S=a[`trait-${l.id}`];return{id:e,kind:"choice",prompt:u.ask,hint:u.hint,options:u.options.map(E=>({id:E.id,label:E.label,card:E.card})),attach:S!=null&&S.refs.length?"Replace the reference":"Add a reference",saying:t.saying===e,given:S==null?void 0:S.pick,note:S==null?void 0:S.words,...i}}return{id:e,kind:"text",prompt:""}}function w6(e,t){var a,i,l;switch(e){case"source":return qn.source;case"photos":return qn.photos;case"describe":return((a=t.source)==null?void 0:a.via)==="typed"?qn.source:qn.describe;case"gaps":return y$(Wy(t.describe??"").length);case"traits":return((i=t.source)==null?void 0:i.door)==="photos"?qn.traitsPhotos:qn.traits;case"keep":return qn.keep}if(fr(e))return pf[e.slice(5)].prompt;const n=fs(e),r=n?Oa(n.id):void 0;return!n||!r?"":n.part==="where"?((l=r.where)==null?void 0:l.ask)??"":r.ask}function j7(e,t,n){var u,f,h,p,g,m,w;switch(e){case"source":return{text:((u=t.source)==null?void 0:u.door)==="photos"?"Add photos":"Describe someone"};case"photos":{const y=(n==null?void 0:n.sources)??((f=t.photos)==null?void 0:f.hashes)??[];return{text:hce(y.length),photos:y}}case"describe":return{text:(t.describe??"").trim()};case"gaps":return{text:Nce(t.gaps)};case"traits":return{text:Mce(r$(t.traits??[]))};case"keep":return{text:(((h=t.keep)==null?void 0:h.words)??"").trim(),photos:(p=t.keep)==null?void 0:p.refs}}if(fr(e)){const y=e.slice(5);return{text:Kle(pf[y].row,t[e]??{})}}const r=fs(e),a=r?Oa(r.id):void 0;if(!r||!a)return{text:""};if(r.part==="where"){const y=t[e]??{},b=y.pick?((m=(g=a.where)==null?void 0:g.options.find(k=>k.id===y.pick))==null?void 0:m.label)??rm(y.pick):"";return{text:k7(b,y.words)}}const i=t[`trait-${r.id}`],l=i!=null&&i.pick?((w=a.options.find(y=>y.id===i.pick))==null?void 0:w.label)??rm(i.pick):"";return{text:k7(l,i==null?void 0:i.words),photos:i!=null&&i.refs.length?i.refs:void 0}}function Gce(e){const t=e.state.asides,n=t.length?wP(A7(e,[],null)):null;return A7(e,t,n)}const S$=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,sm=(e,t)=>C1(e.editing)&&Yle(e.editing)===t.at;function A7(e,t,n){const r=new Set,a=Yce(e,t,n,r),i=a.length&&a[a.length-1].kind==="question"?a.pop():null,l=t.filter(f=>!r.has(f)).sort(S$),u=e.state.unsure;for(const f of l)(!u||f.at<u.at)&&a.push(...Ei(f,sm(e.state,f)));if(i&&a.push(i),u){a.push({kind:"you",id:`unsure-${u.at}`,text:u.said,editable:!1}),a.push({kind:"question",question:{id:"unsure",kind:"confirm",quiet:!0,prompt:mce,options:[{id:"use",label:"Use it anyway"}]}});for(const f of l)f.at>=u.at&&a.push(...Ei(f,sm(e.state,f)))}return a}function Yce({state:e,draft:t,canGenerate:n,engine:r,failed:a,failedView:i,awaiting:l},u,f,h){var P,R,H,D,U,V;const p=k$(t,n,r),g=e.answers,m=[{kind:"you",id:"intent",text:"Create a person"}],w=[],y=((P=g.source)==null?void 0:P.door)==="photos",b=(B,G,_=!1)=>{const O=u.filter(I=>!h.has(I)&&!!I.q&&I.q!==f&&G.includes(I.q)&&!!I.after===_).sort(S$);for(const I of O)h.add(I),B.push(...Ei(I,sm(e,I)))},k=B=>u.find(G=>G.edit&&G.q===B&&!h.has(G)),S=(B,G,_=!0)=>{var I;if(B.push({kind:"scenri",id:`asked-${G}`,text:w6(G,g),quiet:!0}),b(B,G==="describe"&&((I=g.source)==null?void 0:I.via)==="typed"?["source","describe"]:[G]),!_){const K=k(G);K&&(h.add(K),B.push({kind:"you",id:G,text:K.said}),B.push(...Ei(K,sm(e,K),!0))),b(B,[G],!0);return}const O=j7(G,g,t);B.push({kind:"you",id:G,text:O.text,photos:O.photos,editable:!0,editing:e.editing===G&&j1(G,g)||void 0}),b(B,[G],!0)},E=new Set(t$(g,p)),C=Ale.filter(B=>E.has(B)||u.some(G=>G.edit&&G.q===B));for(const B of C){const G=y&&t&&B!=="source"&&B!=="photos"?w:m;if(e.editing===B&&!j1(B,g)){G.push({kind:"scenri",id:`asked-${B}`,text:w6(B,g),quiet:!0}),b(G,[B]),G.push({kind:"question",question:C7(B,e,p,!0)}),b(G,[B],!0);continue}B==="source"&&((R=g.source)==null?void 0:R.via)==="typed"||S(G,B,E.has(B))}let A=null;const L=((H=g.source)==null?void 0:H.door)==="photos"&&e.held&&!t,T=!n&&(t?!!Vw(t):((D=g.source)==null?void 0:D.door)==="scratch"||L)&&!(t&&e.editing);if(L&&!n&&((U=g.photos)!=null&&U.hashes.length)&&(m.push({kind:"scenri",id:"asked-photos",text:w6("photos",g),quiet:!0}),m.push({kind:"you",id:"photos",...j7("photos",g,null)})),T)A={id:"noengine",kind:"confirm",quiet:!0,prompt:qn.noEngine,options:[{id:"setup",label:"Set up"},...L?[{id:"change",label:"Change photos"}]:[]]};else{const B=C2(g,p);B?A=C7(B,e,p,!1):!t&&((V=g.source)==null?void 0:V.door)==="scratch"&&(g.source.via==="taps"||e.held?A={id:"agree",kind:"confirm",prompt:qn.agree,quote:g.source.via==="taps"?`${Gle(n$(g))}${y7(g)?`, and always ${y7(g)}`:""}.`:mf(g),options:[{id:"draw",label:"Draw the person"}]}:a&&(A={id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${a}. Nothing was drawn.`,options:[{id:"retry",label:"Retry"}]}))}if(l&&(A=null),!t)return A&&m.push({kind:"question",question:A}),m;const M=jce({draft:t,ui:{extrasDeclined:e.extrasDeclined,failed:a,failedView:i,editingName:e.editing==="name"},afterCoverage:w,asides:u,openId:f,placed:h}),j=[...m,...A?M.filter(B=>B.kind!=="question"):M];return A&&j.push({kind:"question",question:A}),j}function E$(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question;if(!Zp(n))return null}return null}function qce(e,t,n){return e.some(r=>r.kind==="scenri"&&(r.id==="reading"||r.id.startsWith("drawing-")))?!1:(t==null?void 0:t.stage)==="analyzing"?`Reading ${g$(t.source)}`:t!=null&&t.activeView?"Drawing":n}const Qo={placeholder:"Nothing to type yet",label:"Message",action:"Send"},N7=(e,t)=>({placeholder:t?Zle[e]??"In your words":m7.has(e)?"Tap a swatch above, or say the colour":"Pick one above, or describe it",label:"Describe it",action:"Send",color:m7.has(e)});function M7(e,t){const n=fs(e),r=n?Oa(n.id):void 0,a=(n==null?void 0:n.part)==="where"?"Where it is, in your words":(r==null?void 0:r.saying)??"What it looks like",i=(n==null?void 0:n.part)==="where"?"Pick one above, or say where it is":`Pick one above, or ${((r==null?void 0:r.saying)??"describe it").toLowerCase()}`;return{placeholder:t?a:i,label:(r==null?void 0:r.saying)??"Describe it",action:"Send"}}function C$(e,t,n){var a;const r=e.trim();return!!t&&!((a=t.name)!=null&&a.trim())&&n!=="name"&&/^[A-Z][a-z]+(?:\s[A-Z][a-z]+)?$/.test(r)&&!ya(r)}function Xce(e,t,n,r){const a=Qce(e,t,n,r);return a.action==="Refine"&&!a.off&&C$(t.text,n,(e==null?void 0:e.id)??null)?{...a,label:"Their name",action:"Send"}:a}function Qce(e,t,n,r){if(t.editing!==null&&(t.editing==="name"||C1(t.editing)||j1(t.editing,t.answers)))return{...Qo,off:"Finish the change above."};if(t.saying==="keep")return{placeholder:x7,label:"What should stay the same about them",action:"Send"};if(t.saying&&fr(t.saying))return N7(t.saying.slice(5),!0);if(t.saying)return M7(t.saying,!0);if(t.editing!==null)return{...Qo,off:"Finish the change above."};if(e){if(fr(e.id))return N7(e.id.slice(5),!1);if(e.id.startsWith("trait-"))return M7(e.id,!1);switch(e.id){case"source":return{placeholder:"Describe them, or choose above",label:"Describe them",action:"Send"};case"describe":case"unsure":return{placeholder:"Describe them",label:"Describe them",action:"Send"};case"name":return{placeholder:"Their name",label:"Their name",action:"Send"};case"identity":return{placeholder:"What should change? Shorter hair, older",label:"What should change",action:"Refine"};case"agree":return{placeholder:x7,label:"Anything else that is always true of them",action:"Send"};case"traits":return{placeholder:"Tap any above, or say it in your own words",label:"Anything else that is always true of them",action:"Send"};case"gaps":return{placeholder:"Pick one above, or say it in your own words",label:"Fill in what is missing",action:"Send"};case"photos":return{...Qo,off:"Add their photos above."};case"noengine":return{...Qo,off:"Set up image generation above."};case"retry":return{...Qo,off:"Retry above."}}}return n?n.stage==="analyzing"?{...Qo,off:`Reading ${n.source==="photos"?"the photos":"the face"}.`}:Tc(n)?fi(n)?{placeholder:R7(r,n),label:"What should change",action:"Refine",off:""}:{...Qo,off:""}:fi(n)?{placeholder:R7(r,n),label:"What should change",action:"Refine"}:{...Qo,off:"The face comes first."}:{...Qo,off:"Starting the draft."}}function R7(e,t){var r;const n=((r=t.name)==null?void 0:r.trim())||"them";return e==="portrait"?`What should change about ${n}?`:`Change this view: ${xn[e]}`}function P7(e,t){return e.saying?e.saying:t&&na(t.id)&&(t.id==="source"||t.id==="describe")||t&&na(t.id)&&(fr(t.id)||t.id.startsWith("trait-"))?t.id:(t==null?void 0:t.id)==="agree"?"keep":(t==null?void 0:t.id)==="name"?"name":null}const Jce=/\b(here|in this (view|one|picture|image|frame)|this (view|one|picture|image|frame))\b/i,eue=/\b(looks? like|doesn'?t look|does not look|not (her|him|them)|drift(s|ed|ing)?|wrong|\boff\b|different person|someone else|regenerate|redraw|again)\b/i,tue=/\b(dress|gown|outfit|wearing|wear|jacket|coat|suit|shirt|t-shirt|tee|hoodie|jeans|trousers|skirt|shoes|heels|sneakers|boots|hat|cap|sunglasses|jewell?ery|necklace|earrings|watch|holding|holds?|product|bottle|perfume|bag|handbag|phone|laptop|scene|beach|paris|london|tokyo|street|rooftop|office|kitchen|cafe|city|forest|desert|snow|rain|sunset|sunrise|golden hour|background|backdrop|lighting|campaign|shoot)\b/i,nue=/\b(simpler|plainer|plain|neutral|cleaner|tidier)\b/i,rue=/\b(outfit|clothes|clothing|top|wardrobe|wearing)\b/i;function j$(e,t,n){const r=e.trim();if(!r)return{blocked:"Say what should change."};if(tue.test(r)&&!(nue.test(r)&&rue.test(r)))return{scope:"out-of-scope"};const a=CM.test(r),i=eue.test(r),l=Jce.test(r),u=n.source==="photos";if(t==="portrait")return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};if(a&&i&&!l)return u?{scope:"view",view:t}:{scope:"ambiguous"};if(a&&!l)return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};const f=n.views[t];return f.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:f.status!=="approved"&&f.status!=="candidate"?{blocked:`Nothing drawn for the ${xn[t]} yet.`}:{scope:"view",view:t}}const A$=e=>`Use Create for wardrobe, products and places. Edits here change who ${e} is.`;function sue(e,t,n,r){const a=e.trim(),i=t==="portrait"?"Describe a change to who they are.":"Say what is wrong with this view, or describe a change to who they are.";if(!a){const u=n.views[t];return t!=="portrait"&&u.origin==="photo"?{chip:null,hint:"Your photo stands as it is. Pick a drawn view to change."}:{chip:null,hint:i}}const l=j$(a,t,n);return"blocked"in l?{chip:null,hint:l.blocked,tone:"alert"}:l.scope==="out-of-scope"?{chip:null,hint:A$(r),tone:"alert"}:l.scope==="ambiguous"?{chip:null,hint:"This reads as the view or the person. Send it and I will ask which."}:l.scope==="identity"?{chip:{view:"portrait",label:"Changing the person"},hint:"Changes the person. The other views are redrawn after you use it."}:{chip:{view:l.view,label:`Refining the ${xn[l.view]}`},hint:"Changes this view only. Hair, skin, age or build change the person."}}const aue=e=>e.replace(/^asset:/,"");function Qy(e,t){if((e.identityEdits??[]).join(`
|
|
107
|
+
`)!==(t.identityEdits??[]).join(`
|
|
108
|
+
`))return!0;const r=t.shots.some(i=>i.angle==="portrait"&&i.file),a=new Map(t.shots.map((i,l)=>[!r&&l===0?"portrait":i.angle??"",aue(i.file)]));for(const i of di(e)){const l=e.views[i];if(l.status==="candidate"||l.status==="stale"||l.prior)return!0;const u=a.get(i);if(l.status==="approved"&&l.hash&&l.hash!==u||l.status==="empty"&&u)return!0}return!1}function L7(e,t){var n,r;return!Qy(e,t)&&!e.activeView&&e.stage==="idle"&&!((n=e.asks)!=null&&n.length)&&(e.results??[]).every(a=>{var i;return((i=e.views[a.view])==null?void 0:i.hash)===a.hash})&&!((r=e.decisions)!=null&&r.length)}const $7=(e,t)=>t==="cancelled"?{text:`Stopped drawing the ${xn[e]}. Nothing finished was touched.`,stopped:!0}:{...j2(`The ${xn[e]} could not be drawn`,t,Xy(e)),stopped:!1},oue=e=>bq.filter(t=>e.views[t].status==="empty"&&t!=="portrait"),iue=e=>e.length<=2?e.map(t=>xn[t]).join(" and "):`${e.slice(0,-1).map(t=>xn[t]).join(", ")} and ${xn[e[e.length-1]]}`,lue={building:!1,buildDeclined:!1,scopeAsk:null,failed:null,conflict:null},cue="Say what should change: hair, age or build change the person; anything else changes the view on the stage.",uue="Still here. Select a view and say what is wrong with it, or say what should change about them.";function due(e,t,n){const r=`select a view and say what is wrong with it, or say what should change about ${t}`;switch(e){case"likeness":return"Describe the change by looks. Scenri does not draw a named person.";case"help":case"question":return`This is where ${t} is changed: ${r}.`;case"nav":return"Discard changes is at the top, and Save changes keeps what you did.";case"go":case"intent":return`Nothing changes until it is said what: ${r}.`;case"nonsense":return`That does not say what should change. ${r.charAt(0).toUpperCase()}${r.slice(1)}.`;default:return n?uue:cue}}const pc={opening:e=>`What would you like to change about ${e}? Select a view to work on it, or describe a change to who they are.`,scope:"Apply this to:",change:"What should change?",saved:"Save changes when you are done."};function fue(e){const t=e.ui.asides??[],n=t.length?wP(T7(e,[],null)):null;return T7(e,t,n)}function T7({draft:e,base:t,name:n,selected:r,canGenerate:a,ui:i},l,u){var J;const f=[{kind:"scenri",id:"opening",text:pc.opening(n)}],h=new Set,p=()=>{for(const Q of l)h.has(Q)||f.push(...Ei(Q));return f},g=(Q,ae,$e)=>{$e&&f.push({kind:"scenri",id:`asked-${Q}`,text:$e}),f.push({kind:"you",id:Q,text:ae,editable:!1})},m=(Q,ae,$e)=>f.push({kind:"scenri",id:Q,text:ae,tone:$e}),w=Q=>f.push({kind:"question",question:Q});if(!e)return p();const y=oue(e),b=e.source!=="synthetic"||!!((J=e.direction)!=null&&J.trim()),k=di(e).some(Q=>e.views[Q].status==="candidate");if(y.length&&b&&!k&&!i.building&&!i.buildDeclined&&!Tc(e)&&a){const Q=di(e).filter(ae=>e.views[ae].status==="approved").length;return w({id:"legacy",kind:"confirm",prompt:`${n} has ${Q===1?"one reference":`${Q} references`}. Build the ${iue(y)} from it?`,options:[{id:"build",label:"Build them"},{id:"not",label:"Not now"}]}),p()}const S=di(e),E=e.activeView,C=S.find(Q=>e.views[Q].status==="candidate"),A=S.find(Q=>!!e.views[Q].error),L=(t==null?void 0:t.identityEdits)??[];(e.identityEdits??[]).filter(Q=>!L.includes(Q)).forEach((Q,ae)=>{g(`edit-${ae}`,Q,pc.change),m(`changed-${ae}`,`Changed ${n}. The views built on the face were redrawn.`)});const M=e.asks??[],j=M[M.length-1],P=j?e.views[j.view]:null,R=!!j&&!!P&&(P.status==="generating"&&e.activeView===j.view||P.status==="candidate"&&P.adjustment===j.text||!!P.error),H=new Set((e.identityEdits??[]).map(Q=>Q.toLowerCase())),D=(R?M.slice(0,-1):M).filter(Q=>!(Q.view==="portrait"&&H.has(Q.text.replace(/\s+/g," ").toLowerCase()))),U=[...M,...e.results??[],...e.decisions??[]].map(Q=>Q.at).reduce((Q,ae)=>ae>Q?ae:Q,""),V=l.filter(Q=>!h.has(Q)&&(Q.q!==u||Q.at<=U));for(const Q of V)h.add(Q);const B=(e.results??[]).filter(Q=>Q.how!=="restored"),G=!e.activeView&&e.stage==="idle",_=new Map,O=new Map,I=new Map;for(const Q of B){const ae=`${Q.view}:${Q.hash}`;if(I.set(ae,Q),_.has(ae))continue;const $e=(O.get(Q.view)??0)+1;O.set(Q.view,$e),_.set(ae,$e)}const K=Q=>_.get(`${Q.view}:${Q.hash}`)??1,z=(Q,ae)=>{const $e=K(Q),ie=e.views[Q.view].hash===Q.hash,ke=(O.get(Q.view)??0)>1;return{kind:"scenri",id:ae,text:`Here is ${xn[Q.view]} ${$e}.`,thumb:Q.hash,view:Q.view,label:`${$c[Q.view]} ${$e}`,current:ke&&ie&&I.get(`${Q.view}:${Q.hash}`)===Q,restore:G&&!ie?{view:Q.view,hash:Q.hash}:void 0}},q=new Set,Z=new Map(M.map(Q=>{const ae=B.find($e=>!q.has($e)&&$e.how==="drawn"&&$e.view===Q.view&&$e.ask===Q.text&&$e.at>=Q.at);return ae&&q.add(ae),[Q,ae]})),ee=(e.decisions??[]).filter(Q=>!(Q.view==="portrait"&&Q.what==="use")),he=Q=>[{kind:"scenri",id:`asked-decided-${Q.at}`,text:Q.view==="portrait"?`Here is ${n} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${xn[Q.view]}. Use it, or keep the previous one.`},{kind:"you",id:`decided-${Q.at}`,text:Q.what==="again"?"Try again":Q.what==="keep"?"Keep previous":"Use it",editable:!1}],ue=[...D.map(Q=>{const ae=Z.get(Q);return{at:Q.at,turns:[{kind:"scenri",id:`asked-ask-${Q.at}`,text:pc.change},{kind:"you",id:`ask-${Q.at}`,text:Q.text,editable:!1},...ae?[z(ae,`redrew-${Q.at}`)]:[]]}}),...B.filter(Q=>!q.has(Q)).map(Q=>({at:Q.at,turns:[z(Q,`result-${Q.at}`)]})),...ee.map(Q=>({at:Q.at,turns:he(Q)})),...V.map(Q=>({at:Q.at,turns:Ei(Q)}))];ue.sort((Q,ae)=>Q.at<ae.at?-1:Q.at>ae.at?1:0);for(const Q of ue)f.push(...Q.turns);if(i.scopeAsk)return g("scope-ask",i.scopeAsk.said),w({id:"scope",kind:"choice",prompt:pc.scope,options:[{id:"view",label:`This view (the ${xn[r]})`},{id:"identity",label:"The person"}]}),p();const ge=()=>{R&&j&&g(`ask-${j.at}`,j.text,pc.change)};if(E){const Q=e.views[E];return ge(),m(`drawing-${E}`,R&&(j==null?void 0:j.view)===E?E==="portrait"?`Changing ${n}. Everything else stays.`:`Redrawing the ${xn[E]}.`:Q.status==="stale"||S.some(ae=>e.views[ae].status==="stale")?`Redrawing the views built on the face. The ${xn[E]} first.`:`Drawing the ${xn[E]}.`),p()}if(C){ge();const Q=e.views[C];if(Q.error){const ae=$7(C,Q.error);m(`failed-${C}`,ae.text,ae.stopped?void 0:"alert")}return Q.hash&&f.push({kind:"scenri",id:`candidate-${C}-${Q.hash}`,text:Q.error?`Here is the ${xn[C]} as it is.`:C==="portrait"?`Here is ${n} with the change.`:`Redrew the ${xn[C]}.`,thumb:Q.hash,label:$c[C],view:C,current:!0}),w({id:C==="portrait"?"revision":"view-revision",kind:"confirm",prompt:C==="portrait"?"Use this, or keep the previous one. Using it redraws the views built on the face.":"Use it, or keep the previous one.",options:[{id:"use",label:C==="portrait"?"Use this":"Use it"},{id:"keep",label:"Keep previous"},{id:"again",label:"Try again"}]}),p()}if(i.failed||A){ge();const Q=A?$7(A,e.views[A].error??""):{...j2("That did not go through",i.failed??""),stopped:!1};return w({id:"retry",kind:"confirm",...Q.stopped?{quiet:!0}:{tone:"alert"},prompt:Q.text,options:[...Q.remedy?[{id:`remedy:${Q.remedy.opens}`,label:Q.remedy.label}]:[],{id:"retry",label:Q.stopped?"Draw it again":"Retry"}]}),p()}if(i.conflict)return w({id:"conflict",kind:"confirm",tone:"alert",prompt:`${n} changed in another tab. Reload to continue.`,options:[{id:"reload",label:"Reload"}]}),p();const te=S.find(Q=>e.views[Q].status==="stale");return te?(m(`drawing-${te}`,`Redrawing the views built on the face. The ${xn[te]} first.`),p()):(t&&Qy(e,t)&&w({id:"save",kind:"confirm",prompt:`The set is coherent. ${pc.saved}`,options:[{id:"save",label:"Save changes"}]}),p())}function hue(e,t,n){return!(!n||t.id!==n||e&&e.id===t.id&&t.updatedAt<e.updatedAt)}function N$(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(null),[f,h]=s.useState(null),[p,g]=s.useState(!1),{poke:m}=ia(),w=s.useRef(!0);s.useEffect(()=>(w.current=!0,()=>{w.current=!1}),[]);const y=s.useRef(t);y.current=t;const b=s.useCallback(G=>{w.current&&r(_=>hue(_,G,y.current)?G:_)},[]),k=s.useRef(!1);s.useEffect(()=>{r(null),i(!1),u(null),k.current=!1,g(!1)},[t]);const S=s.useCallback(async()=>{if(!t)return;const G=t;try{b(await Ee.presenterDraft(e,G)),k.current&&w.current&&y.current===G&&(k.current=!1,u(null))}catch(_){if(!w.current||y.current!==G)return;/HTTP 404|not found/i.test(String((_==null?void 0:_.message)??_))?i(!0):(k.current=!0,h(null),u(String((_==null?void 0:_.message)??_)))}},[e,t,b]);s.useEffect(()=>{S()},[S]);const E=!!n&&(n.stage!=="idle"||!!n.activeView);s.useEffect(()=>{if(!E)return;const G=setInterval(()=>void S(),1500);return()=>clearInterval(G)},[E,S]);const C=s.useCallback(async(G,_=null)=>{const O=y.current;g(!0),u(null),k.current=!1;try{return b(await G()),m(),!0}catch(I){return!w.current||y.current!==O?!1:(I==null?void 0:I.status)===409?(S(),!1):(k.current=!1,h(_),u(String((I==null?void 0:I.message)??I)),!1)}finally{w.current&&g(!1)}},[b,S,m]),A=s.useCallback((G,_,O)=>C(async()=>(await Ee.generateDraftView(e,t??"",G,{..._?{adjustment:_}:{},...O?{decide:O}:{}})).draft,G),[C,e,t]),L=s.useCallback(G=>C(()=>Ee.approveDraftView(e,t??"",G)),[C,e,t]),T=s.useCallback(G=>C(()=>Ee.redoDraftView(e,t??"",G)),[C,e,t]),M=s.useRef(!1),j=s.useCallback(async G=>{if(M.current)return!1;M.current=!0;try{return await C(G)}finally{M.current=!1}},[C]),P=s.useCallback(G=>j(()=>Ee.revertDraftView(e,t??"",G)),[j,e,t]),[R,H]=s.useState(!1),D=s.useCallback(async()=>{H(!0);try{return await C(()=>Ee.stopDraft(e,t??""))}finally{w.current&&H(!1)}},[C,e,t]),U=s.useCallback((G,_)=>j(()=>Ee.restoreDraftView(e,t??"",G,_)),[j,e,t]),V=s.useCallback(G=>C(()=>Ee.updatePresenterDraft(e,t??"",G)),[C,e,t]),B=s.useCallback(()=>{k.current=!1,u(null)},[]);return{draft:n,gone:a,err:l,errView:f,busy:p,drawing:E,reload:S,generate:A,approve:L,redo:T,revert:P,stop:D,stopping:R,restore:U,update:V,clearErr:B}}function pue({presenterId:e,onLeave:t,caps:n}){var Re,re;const{brand:r}=cn(),{applyBrand:a,refreshBrands:i}=Mn(),l=Vl(),u=_l(),f=jr("setup").value,h=jr("settings").value,p=!!f||!!h,g=!!(n!=null&&n.canGenerate),[m,w]=s.useState(null),[y,b]=s.useState(null),[k,S]=s.useState(lue),[E,C]=s.useState(""),[A,L]=s.useState(null),[T,M]=s.useState(!1),[j,P]=s.useState(null),[R,H]=s.useState(!1),[D,U]=s.useState(!1),V=s.useRef(new Set),B=(((Re=r.json)==null?void 0:Re.characters)??[]).find(Y=>Y.id===e),G=((re=B==null?void 0:B.name)==null?void 0:re.trim())||"them",_=B?{shots:B.shots??[],identityEdits:B.identityEdits??[]}:null;s.useEffect(()=>{let Y=!0;return w(null),b(null),Ee.editPresenter(r.id,e).then(se=>{Y&&w(se.id)}).catch(se=>{Y&&b(String((se==null?void 0:se.message)??se))}),()=>{Y=!1}},[r.id,e]);const O=N$(r.id,m),I=O.draft,K=I?`presenter-edit:${r.id}:${e}:${I.id}`:void 0,z=!0;s.useEffect(()=>{if(!I||O.busy||!g||O.err)return;const Y=Vw(I);if(!Y||I.views[Y].status==="empty"&&!k.building)return;const se=`${Y}:${I.views[Y].attempts}:${I.generations}:${I.views[Y].status}`;V.current.has(se)||(V.current.add(se),O.generate(Y,void 0,ei(Y)))},[I,O.busy,O.generate,g,O.err,k.building]);const q=I?kM(I,A):"portrait",Z=I?I.views[q]:null,ee=!!I&&(I.activeView===q||I.stage==="analyzing"),he=!!I&&!I.activeView&&I.stage==="idle",ue=O.err&&I&&!I.activeView?O.err:null,ge=s.useMemo(()=>fue({draft:I,base:_,name:G,selected:q,canGenerate:g,ui:{...k,failed:ue}}),[I,_,G,q,g,k,ue]),te=E$(ge),J=!!I&&!!_&&Qy(I,_),Q=!!I&&!!_&&L7(I,_),ae=s.useCallback(Y=>{K&&fl(K),t(Y)},[K,t]),$e=s.useCallback(async()=>{if(!(!I||R)){H(!0),P(null);try{const Y=await Ee.savePresenterDraft(r.id,I.id);ae(Y.presenter.id),a(Y.brand)}catch(Y){H(!1);const se=String((Y==null?void 0:Y.message)??Y);/changed elsewhere|HTTP 409/i.test(se)?S(Ne=>({...Ne,conflict:se})):P(se)}}},[I,R,r.id,a,ae]),ie=s.useCallback(async()=>{U(!0);try{I&&await Ee.deletePresenterDraft(r.id,I.id)}catch{}ae(e)},[I,r.id,e,ae]),ke=s.useCallback(async()=>{if(!(!I||!_)){U(!0);try{L7(await Ee.presenterDraft(r.id,I.id),_)&&await Ee.deletePresenterDraft(r.id,I.id)}catch{}ae(e)}},[I,_,r.id,e,ae]),ze=s.useCallback(async()=>{U(!0);try{const Y=await Ee.revertPresenter(r.id,e);I&&await Ee.deletePresenterDraft(r.id,I.id).catch(()=>{}),ae(Y.presenter.id),a(Y.brand)}catch(Y){U(!1),P(String((Y==null?void 0:Y.message)??Y))}},[r.id,e,I,a,ae]),wt=s.useCallback((Y,se)=>{var Ne;if(P(null),!!I)switch(Y){case"legacy":if(se.kind!=="confirm")return;S(Be=>({...Be,building:se.id==="build",buildDeclined:se.id!=="build"}));return;case"scope":{if(se.kind!=="choice")return;const Be=((Ne=k.scopeAsk)==null?void 0:Ne.said)??"";S(st=>({...st,scopeAsk:null})),se.id==="identity"?O.generate("portrait",Be):O.generate(q,Be,ei(q)),L(se.id==="identity"?"portrait":q);return}case"revision":case"view-revision":{if(se.kind!=="confirm")return;const Be=Object.keys(I.views).find(st=>I.views[st].status==="candidate")??q;se.id==="use"&&O.approve(Be),se.id==="keep"&&O.revert(Be),se.id==="again"&&O.generate(Be,I.views[Be].adjustment,ei(Be)),M(!1);return}case"retry":{if(se.kind==="confirm"&&se.id.startsWith("remedy:")){const st=se.id.slice(7);st==="setup"?l():u(st);return}if(O.err){O.clearErr(),V.current=new Set;return}const Be=Object.keys(I.views).find(st=>!!I.views[st].error);Be&&O.generate(Be,I.views[Be].adjustment,ei(Be));return}case"conflict":S(Be=>({...Be,conflict:null})),U(!0),Promise.all([i(),Ee.deletePresenterDraft(r.id,I.id).catch(()=>{})]).finally(()=>ae(e));return;case"save":$e();return}},[I,k.scopeAsk,O,q,$e,i,ae,e,r.id,l,u]),Ke=s.useCallback(Y=>{const se=Y.trim();if(!se||!I)return!1;P(null);const Ne=(te==null?void 0:te.id)??null,Be=zp(),st=(ft,bt)=>({...ft,asides:[...ft.asides??[],{said:se,reply:bt,q:Ne,at:Be}]}),Pe=ft=>ft.scopeAsk?{...ft,scopeAsk:null,asides:[...ft.asides??[],{said:ft.scopeAsk.said,reply:pc.scope,q:"scope",at:ft.scopeAsk.at}]}:ft,Oe=ai(se,ya);if(Oe&&Oe!=="vague")return S(ft=>st(ft,due(Oe,G,(ft.asides??[]).some(bt=>bt.q===Ne)))),C(""),!0;if(!g)return P("Image generation is not set up, so nothing can be redrawn yet."),!1;const Ge=j$(se,q,I);return"blocked"in Ge?(P(Ge.blocked),!1):Ge.scope==="out-of-scope"?(S(ft=>st(Pe(ft),A$(G))),C(""),!0):Ge.scope==="ambiguous"?(S(ft=>({...Pe(ft),scopeAsk:{said:se,at:Be}})),C(""),!0):(S(ft=>Pe(ft)),L(Ge.view),M(!1),O.generate(Ge.view,se,Ge.scope==="view"?ei(Ge.view):void 0),C(""),!0)},[I,g,q,O,te==null?void 0:te.id,G]),tt=I?sue(E,q,I,G):null,De=tt?{chip:tt.chip?{label:tt.chip.label,thumb:I!=null&&I.views[tt.chip.view].hash?gn(I.views[tt.chip.view].hash,"micro"):void 0}:null,hint:tt.hint,tone:tt.tone}:null,Se=T&&(Z!=null&&Z.prior)?Z.prior:Z==null?void 0:Z.hash,X=I?(te==null?void 0:te.id)==="legacy"?"Decide above.":(te==null?void 0:te.id)==="conflict"?"Reload to continue.":(te==null?void 0:te.id)==="scope"?"Pick above.":(te==null?void 0:te.id)==="retry"?"Retry above.":I.stage==="analyzing"?"Reading the photos.":I.activeView?"":null:null,je=!!I;return{d:I,record:B,name:G,view:q,slot:Z,dirty:J,saving:R,leaving:D,openErr:y,canRevert:!!(B!=null&&B.revisionOf),discard:ie,revert:ze,closeUntouched:Q?()=>void ke():null,keepPrevious:Z&&Z.status==="approved"&&Z.prior&&!ee&&!(I!=null&&I.activeView)&&(I==null?void 0:I.stage)==="idle"?()=>void O.revert(q):null,surface:{title:"Edit person",memoryKey:K,resumed:z,turns:ge,busy:O.busy||R||D||p,stage:I?{hash:Se,alt:`${$c[q]}${(Z==null?void 0:Z.status)==="candidate"?", candidate":""}`,drawing:ee,since:AM(I),doing:NM(I),takes:zw(I,q)?[]:RM(I,q),onTake:he?Y=>{O.busy||O.restore(q,Y)}:void 0,items:SM(I,q),onPick:Y=>{L(Y),M(!1)},compare:Z&&Z.status==="candidate"&&Z.prior?{on:T,toggle:()=>M(Y=>!Y)}:void 0}:null,composer:je?{placeholder:q==="portrait"?`What should change about ${G}?`:`Change this view: ${xn[q]}`,label:"What should change",action:"Refine",scope:X?null:De,hint:null,why:X??void 0,error:j,disabled:O.busy||R||D||!!X,working:!!(I!=null&&I.activeView),onStop:I!=null&&I.activeView?()=>void O.stop():void 0,stopping:O.stopping,focusKey:`${(te==null?void 0:te.id)??"open"}:${(I==null?void 0:I.id)??""}`}:null,text:E,onText:C,onSend:Ke,onAnswer:wt,onRestore:(Y,se)=>{O.busy||(L(Y),O.restore(Y,se))}},setupNeeded:g?null:l}}function mue({onClose:e,...t}){const n=pue(t),r=o.jsxs(o.Fragment,{children:[n.canRevert&&o.jsx(Xn,{label:"Revert last change",tone:"quiet",title:"Revert the last saved change?",body:`${n.name} goes back to the pictures and the person before the last save. Shots already made keep what they were made with.`,busy:n.leaving,onConfirm:()=>void n.revert()}),n.dirty&&o.jsx(Xn,{label:"Discard changes",tone:"quiet",title:"Discard the changes?",body:"The views redrawn in this session are thrown away. The saved person stays as they were.",busy:n.leaving,onConfirm:()=>void n.discard()})]}),a=n.keepPrevious?o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,disabled:n.surface.busy,children:"Keep previous"})]}):n.openErr?o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n.openErr}):null;return o.jsx(Uy,{surface:{...n.surface,headAction:r,dock:a},onClose:n.closeUntouched??e})}function gue(){const{presenterId:e=""}=aa(),{brand:t}=cn(),n=Un(),{caps:r}=sy();qc("Edit person");const a=s.useRef(!1);s.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]);const[i]=s.useState(()=>Jw(t,e)),l=s.useCallback(f=>{a.current&&n(Ra(t,f),{replace:!0})},[n,t]),u=s.useCallback(()=>n(Ra(t,e),{replace:!0}),[n,t,e]);return i!==e?o.jsx(Pa,{to:zm(t,i),replace:!0}):o.jsx(mue,{presenterId:e,onLeave:l,onClose:u,caps:r})}function vue(e,t){return(t.source!=="synthetic"||(t.direction??"")===mf(e.answers))&&wue(t.keepItems,A2(e.answers))}function wue(e,t){const n=e??[];return n.length!==t.length?!1:t.every((r,a)=>{const i=n[a];return!i||i.id!==r.id||i.words!==r.words?!1:(i.refs??[]).every(l=>(r.refs??[]).includes(l))})}function yue(e,t){return{...t.source==="synthetic"?{direction:mf(e.answers)}:{},keepItems:A2(e.answers)}}const bue=e=>e.source==="photos"?e.views.front.hash?"front":null:e.views.portrait.hash?"portrait":null;function M$(e){if(!e.draftId)return!1;const t=e.draft;return t?e.seededFor!==t.id&&(!e.state.answers.source||!lv(e.state,e.ctx)):!0}function xue(e){const{state:t,draft:n,ctx:r}=e;if(e.busy||e.err)return[];if(n){if(M$(e))return[{kind:"seed",...Ice(n)}];if(!lv(t,r))return[];const i=[];vue(t,n)||i.push({kind:"sync",patch:yue(t,n),redo:bue(n)});const l=e.canDraw?Vw(n):null;return l&&i.push({kind:"draw",view:l,decide:ei(l)}),i}if(e.draftId)return[];if(!e.canDraw||!lv(t,r))return[];const a=t.answers.source;return(a==null?void 0:a.door)==="scratch"&&a.via!=="taps"&&!t.held?[{kind:"start"}]:[]}function kue(e){for(const t of xue(e))if(!e.done.has(R$(t,e)))return t;return null}function R$(e,t){const n=t.draft;switch(e.kind){case"seed":return`seed:${n==null?void 0:n.id}`;case"start":return`start:${t.state.revision}`;case"sync":return`sync:${n==null?void 0:n.id}:${JSON.stringify(e.patch)}`;case"draw":{const r=n==null?void 0:n.views[e.view];return`draw:${n==null?void 0:n.id}:${e.view}:${(r==null?void 0:r.attempts)??0}:${(n==null?void 0:n.generations)??0}:${(r==null?void 0:r.status)??""}`}}}const Tu=(e,t)=>`scenri:presenter-setup:${e}:${t}`,sl={read(e){try{return sessionStorage.getItem(e)}catch{return null}},write(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};function D7(e,t){let n=sl.read("scenri:tab");return n||(n=[...crypto.getRandomValues(new Uint8Array(6))].map(r=>r.toString(16).padStart(2,"0")).join(""),sl.write("scenri:tab",n)),`${n}:${e}:${t}`}function Sue(e,t){var r,a,i;const n=t==="keep"?"detail":((a=Oa(((r=fs(t))==null?void 0:r.id)??"glasses"))==null?void 0:a.label.toLowerCase())??"detail";return`${(i=e.answers[t])!=null&&i.refs.length?"Replace":"Add"} the picture of the ${n}`}function H7(e,t,n){const r=e.editing&&e.editing!=="name"?e.editing:e.saying??C2(e.answers,t);if(r==="keep"||!r&&n==="agree")return"keep";if(!r)return null;const a=fs(r);return a&&a.part==="what"?`trait-${a.id}`:null}function Eue({draftId:e,convoKey:t,onOpenDraft:n,onLeaveDraft:r,onStarted:a,caps:i}){var Lt,Ut,Nt,_t;const{brand:l}=cn(),{presenterCategories:u,applyBrand:f}=Mn(),h=Vl(),p=_l(),g=jr("setup").value,m=jr("settings").value,w=!!g||!!m,[y,b]=s.useState(!1);s.useEffect(()=>b(!1),[i]);const k=!!(i!=null&&i.canGenerate)&&!y,[S,E]=s.useReducer(ece,{brandId:l.id,convoKey:t},Me=>{const Ze=nm(sl.read(Tu(Me.brandId,Me.convoKey)));return Ze?{...tm,answers:Ze.answers,revision:Ze.revision,asides:Ze.asides,extrasDeclined:!!Ze.extrasDeclined,held:!!Ze.held}:tm}),C=s.useRef(S);C.current=S;const A=tce(S),L=Object.keys(S.answers).length>0||S.asides.length>0,T=s.useRef(t);s.useEffect(()=>{L?sl.write(Tu(l.id,t),A):sl.remove(Tu(l.id,t));const Me=T.current;T.current=t,Me!==t&&e&&t===e&&(sl.remove(Tu(l.id,Me)),fl(`presenter-create:${l.id}:${Me}`))},[l.id,t,e,A,L]);const M=s.useRef(null);s.useEffect(()=>{if(!e||M.current===A)return;const Me=setTimeout(()=>{M.current=A,Ee.updatePresenterDraft(l.id,e,{setup:A}).catch(()=>{M.current=null})},800);return()=>clearTimeout(Me)},[l.id,e,A]);const[j,P]=s.useState(null),[R,H]=s.useState(!1),[D,U]=s.useState(null),[V,B]=s.useState([]),[G,_]=s.useState(!1),[O,I]=s.useState(null),[K,z]=s.useState(!1),[q,Z]=s.useState(null),[ee,he]=s.useState(null),[ue,ge]=s.useState(0),[te,J]=s.useState([]),Q=s.useRef(new Map),[ae]=s.useState(()=>!!e||!!nm(sl.read(Tu(l.id,t))));s.useEffect(()=>()=>{for(const Me of Q.current.values())URL.revokeObjectURL(Me)},[]);const $e=s.useRef(!1),ie=s.useRef(new Set),ke=s.useRef(!1),ze=s.useRef(null),wt=s.useRef(!1),Ke=s.useRef(!0);s.useEffect(()=>(Ke.current=!0,()=>{Ke.current=!1}),[]);const tt=s.useRef(new Set),De=s.useRef(0),Se=N$(l.id,e),X=Se.draft,je=(i==null?void 0:i.engineName)??null,Re=s.useMemo(()=>k$(X,k,je),[X,k,je]);s.useEffect(()=>{ie.current=new Set,$e.current=!1,B([]),M.current=null,e||(wt.current=!1)},[e]),s.useEffect(()=>{if($e.current||!X)return;const Me=Dq(X,V);Me&&($e.current=!0,B(Me))},[X,V]),s.useEffect(()=>{Se.gone&&r()},[Se.gone,r]);const re=s.useCallback(()=>{sl.remove(Tu(l.id,t)),fl(`presenter-create:${l.id}:${t}`)},[l.id,t]),Y=s.useCallback(Me=>n(Me,!0),[n]),se=s.useCallback(Me=>{if(!vM.test(Me)){U(Me);return}b(!0),E({type:"hold",held:!0})},[]),Ne=s.useCallback(async()=>{const Me=C.current;if(!k||K)return;const Ze=Me.revision;E({type:"hold",held:!1}),z(!0),U(null);try{const Qe=A2(Me.answers),F=await Ee.createPresenterDraft(l.id,{source:"synthetic",direction:mf(Me.answers),...Qe.length?{keepItems:Qe}:{},clientKey:D7(t,Ze)});if(C.current.revision!==Ze||!Ke.current){Ee.deletePresenterDraft(l.id,F.id).catch(()=>{});return}Y(F.id)}catch(Qe){se(String((Qe==null?void 0:Qe.message)??Qe))}finally{z(!1)}},[l.id,k,K,Y,t,se]),Be=s.useCallback(async()=>{const Me=C.current,Ze=Me.answers.photos;if(!(Ze!=null&&Ze.hashes.length)||!Ze.attested||K)return;if(!k){E({type:"hold",held:!0});return}E({type:"hold",held:!1});const Qe=Me.revision;z(!0),U(null);try{const F=await Ee.createPresenterDraft(l.id,{source:"photos",imageHashes:Ze.hashes,attestation:!0,clientKey:D7(t,Qe)});if(C.current.revision!==Qe||!Ke.current){Ee.deletePresenterDraft(l.id,F.id).catch(()=>{});return}Y(F.id)}catch(F){se(String((F==null?void 0:F.message)??F))}finally{z(!1)}},[l.id,k,K,Y,t,se]),st=s.useCallback(async Me=>{U(null);const Ze=()=>{var We;return((We=C.current.answers.photos)==null?void 0:We.hashes)??[]},Qe=Me.slice(0,Math.max(0,U0-Ze().length-De.current));De.current+=Qe.length;const F=[];let de=0;E({type:"upload-begin"});try{for(const We of Qe){if(We.size>Z5){F.push(lce(We.name,Z5));continue}try{const Le=await d1(We);Ze().includes(Le)&&(de+=1),E({type:"uploaded",hash:Le,max:U0})}catch{F.push(cce(We.name))}}}finally{De.current-=Qe.length,E({type:"upload-end"})}const we=ice({over:Me.length-Qe.length,same:de,failed:F,max:U0});we&&U(we)},[]),Pe=s.useCallback(Me=>{E({type:"answer",patch:Me,ctx:Re}),!k&&Me.describe!==void 0&&E({type:"hold",held:!0})},[Re,k]),Oe=s.useCallback(async Me=>{const Ze=Me??X;if(!Ze||G)return;const Qe=Hq(Ze,Ze.name);if(Qe){I(Qe);return}_(!0),I(null);try{await Ee.updatePresenterDraft(l.id,Ze.id,{facets:V});const F=await Ee.savePresenterDraft(l.id,Ze.id);f(F.brand),re(),E({type:"start-over"}),a({kind:"presenter",id:F.presenter.id,name:F.presenter.name})}catch(F){_(!1),I(String((F==null?void 0:F.message)??F))}},[X,G,k,l.id,V,re,a,f]),Ge=s.useCallback(async()=>{const Ze=C.current.answers.describe||(X==null?void 0:X.direction)||"";wt.current=!!e,re(),E({type:"start-over",text:Ze}),U(null),Z(null),he(null),ie.current=new Set,X&&!EM(X)&&await Ee.deletePresenterDraft(l.id,X.id).catch(()=>{}),r()},[X,e,l.id,re,r]),ft=X?Se.err&&!Tc(X)?Se.err:null:D,bt=s.useMemo(()=>Gce({state:S,draft:X,canGenerate:k,engine:je,failed:ft,failedView:Se.errView,awaiting:M$({state:S,draft:X,ctx:Re,draftId:e,seededFor:ze.current})}),[S,X,k,je,ft,Se.errView,e,Re]),at=E$(bt),Zt=s.useRef(null);Zt.current=(at==null?void 0:at.id)??null;const jt=X?kM(X,j):"portrait",Ft=X?X.views[jt]:null,Pt=!!X&&(X.activeView===jt||X.stage==="analyzing"),Tt=!!X&&!X.activeView&&X.stage==="idle",xe={state:S,draft:X,ctx:Re,canDraw:k,busy:Se.busy||K||ke.current||wt.current||(X?Tc(X):!1),err:!!Se.err||!X&&!!D,draftId:e,seededFor:ze.current,done:ie.current},Je=kue(xe),Et=s.useRef(Je);Et.current=Je;const Xe=Je?R$(Je,xe):"";s.useEffect(()=>{var Ze;X&&ze.current!==X.id&&!xe.busy&&!xe.err&&((Ze=Et.current)==null?void 0:Ze.kind)!=="seed"&&(ze.current=X.id);const Me=Et.current;if(!(!Me||ie.current.has(Xe)))switch(ie.current.add(Xe),Me.kind){case"seed":ze.current=(X==null?void 0:X.id)??null,E({type:"restore",answers:Me.answers,revision:C.current.revision+1,asides:Me.asides,extrasDeclined:Me.extrasDeclined});return;case"start":Ne();return;case"sync":ke.current=!0,(async()=>{if(!(await Se.update(Me.patch)||await Se.update(Me.patch))){ie.current.delete(Xe);return}Me.redo&&await Se.redo(Me.redo)})().finally(()=>{ke.current=!1});return;case"draw":Se.generate(Me.view,void 0,Me.decide);return}},[Xe,X,Ne,Se.update,Se.redo,Se.generate]);const rt=s.useCallback((Me,Ze,Qe,F,de=!1)=>{E({type:"aside",aside:{said:Me,reply:Ze,q:Qe,at:zp(),kind:F,...de?{edit:!0}:{}}})},[]),nt=s.useCallback((Me,Ze)=>{U(null);const Qe=C.current;if(na(Me)){if(Me==="weakphotos"&&Ze.kind==="confirm"){Ze.id==="again"&&Ge(),Ze.id==="anyway"&&Pe({weakphotos:{pick:"anyway"}});return}const F=_ce(Me,Ze,Qe.answers);if(F){const de=Qe.text.trim(),we=F[Me],We=(fr(Me)||!!fs(Me))&&we&&typeof we=="object"&&!we.words;Pe(We&&de?{...F,[Me]:{...we,words:g6(de)}}:F);return}if(Me==="photos"&&Ze.kind==="photos"){const de=Ze.action;de.type==="add"&&st(de.files),de.type==="remove"&&E({type:"remove-photo",hash:de.hash}),de.type==="attest"&&E({type:"attest",checked:de.checked}),de.type==="reject"&&U("That was not an image. Drop a photo, or choose a file."),de.type==="submit"&&Be(),de.type==="back"&&Pe({source:{door:"scratch",via:"taps"}})}return}switch(Me){case"unsure":{if(Ze.kind!=="confirm"||Ze.id!=="use"||!Qe.unsure)return;const F=Qe.unsure.said,de=Qe.unsure.q==="describe"?"describe":"source";E({type:"settle-unsure",ctx:Re}),Pe(de==="describe"?{describe:F}:{source:{door:"scratch",via:"typed"},describe:F});return}case"noengine":Ze.kind==="confirm"&&Ze.id==="setup"&&h(),Ze.kind==="confirm"&&Ze.id==="change"&&E({type:"hold",held:!1});return;case"agree":{if(Ze.kind!=="confirm")return;Ze.id==="draw"&&Ne();return}case"identity":if(Ze.kind!=="confirm"||!X)return;Ze.id==="use"&&(Se.approve("portrait"),P(null)),Ze.id==="again"&&Se.generate("portrait");return;case"revision":case"view-revision":{if(Ze.kind!=="confirm"||!X)return;const F=Me==="revision"?"portrait":Object.keys(X.views).find(de=>X.views[de].status==="candidate")??jt;Ze.id==="use"&&Se.approve(F),Ze.id==="keep"&&Se.revert(F),Ze.id==="again"&&Se.generate(F,X.views[F].adjustment,ei(F)),H(!1);return}case"retry":{if(Ze.kind==="confirm"&&Ze.id.startsWith("remedy:")){const de=Ze.id.slice(7);de==="setup"?h():p(de);return}if(Ze.kind==="confirm"&&Ze.id==="skip-extras"){Se.clearErr(),Se.update({extras:!1}),E({type:"extras-declined"});return}if(!X){ie.current=new Set,U(null);return}if(Se.err){Se.clearErr(),ie.current=new Set([...ie.current].filter(de=>de.startsWith("sync:")));return}const F=Object.keys(X.views).find(de=>!!X.views[de].error);F&&Se.generate(F,X.views[F].adjustment,ei(F));return}case"extras":if(Ze.kind!=="confirm")return;Ze.id==="add"&&Se.update({extras:!0}),Ze.id==="save"&&E({type:"extras-declined"});return;case"save":Oe();return}},[Pe,st,Be,Ne,h,p,X,Se,jt,Oe]),qt=s.useCallback(Me=>{var gr,Kt,wr,Hr,wn,_o,An,Ks,Ps;const Ze=Me.trim(),Qe=C.current,F=P7(Qe,at),de=F&&((gr=Qe.colour)==null?void 0:gr.step)===F?Qe.colour.hex:null,we=F&&fr(F)?F.slice(5):null,We=F==="keep"?(((Kt=Qe.answers.keep)==null?void 0:Kt.refs)??[]).length:F!=null&&F.startsWith("trait-")?(((wr=Qe.answers[F])==null?void 0:wr.refs)??[]).length:0,Le=Ze||de||"";if(!Le&&!We)return!1;if(U(null),F==="name"){const on=Le.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||Le;return X&&Se.update({name:on.slice(0,60)}),E({type:"text",text:""}),!0}const ct=(on,yn)=>Qe.asides.filter(Kn=>Kn.q===on&&Kn.kind===yn).length,Ot=(on,yn=null)=>v6(on,yn,!!(X!=null&&X.views.portrait.hash)),zt=(on,yn,Kn,Ur)=>{const Jn=Kn!==null&&Qe.editing===Kn;Jn&&Pe({[Kn]:void 0}),rt(on,yn,Kn,Ur,Jn)};if(F&&F!=="keep"&&F.startsWith("trait-")){const on=fs(F);if(!on)return!1;const yn=on.part==="what"?((Hr=Qe.answers[F])==null?void 0:Hr.refs)??[]:[];if(!Ze&&yn.length)return Pe({[F]:{pick:(wn=Qe.answers[F])==null?void 0:wn.pick,words:Vce(on.id,yn.length),refs:yn}}),!0;const Kn=Wh(F,Ze,ya);if(!Ze||Kn)return zt(Ze,uc(Kn??"vague",Ot(F),ct(F,Kn??"vague"),Ze,void 0,!0),F,Kn??"vague"),!0;const Ur=S7(Ze),Jn=Ur?g6(Ze):Ze;if(on.part==="where"){const Fn=Qe.answers[F];Pe({[F]:{pick:Ur?Fn==null?void 0:Fn.pick:void 0,words:Jn}})}else{const Fn=Qe.answers[F];Pe({[F]:{pick:Ur?Fn==null?void 0:Fn.pick:void 0,words:Jn,refs:(Fn==null?void 0:Fn.refs)??[]}})}return!0}if(F==="keep"){const on=Qe.answers.keep,yn=(on==null?void 0:on.refs)??[],Kn=Ze||(yn.length&&!(on!=null&&on.words)?"the detail in the attached picture":"");return Kn?(Pe({keep:{words:[(_o=on==null?void 0:on.words)==null?void 0:_o.trim(),Kn].filter(Boolean).join(", "),refs:yn}}),!0):!1}if(F&&fr(F)&&we){const on=Ze&&!/^#[0-9a-f]{6}$/i.test(Ze)?Wh(F,Ze,ya):null;if(on)return zt(Ze,uc(on,Ot(F),ct(F,on),Ze,we,!0),F,on),!0;const yn=Qe.answers[F],Kn=!Ze||S7(Ze),Ur=de??(Kn?yn==null?void 0:yn.pick:void 0),Jn={pick:Ur,words:Ze?Kn?g6(Ze):Ze:yn==null?void 0:yn.words};if(Ze&&!Ur&&!Oce(Qe.answers,F,Jn,Ze)){const Fn=Qe.answers.keep;return Pe({keep:{words:[(An=Fn==null?void 0:Fn.words)==null?void 0:An.trim(),Hce(Ze)].filter(Boolean).join(", "),refs:(Fn==null?void 0:Fn.refs)??[]}}),!0}return Pe({[F]:Jn}),!0}const Rt=(at==null?void 0:at.id)??null,kn=Rt==="unsure"?((Ks=Qe.unsure)==null?void 0:Ks.q)??"source":Rt;if(Rt==="traits"){const on=ai(Le,ya);if(on)return rt(Le,uc(on,Ot(null,Rt),ct(Rt,on),Le),Rt,on),!0;const yn=Qe.answers.keep;return Pe({traits:[],keep:{words:[(Ps=yn==null?void 0:yn.words)==null?void 0:Ps.trim(),Le].filter(Boolean).join(", "),refs:(yn==null?void 0:yn.refs)??[]}}),!0}if(Rt==="gaps"){const on=ai(Le,ya);if(on)return rt(Le,uc(on,Ot(null,Rt),ct(Rt,on),Le),Rt,on),!0;const yn=(Qe.answers.describe??"").trim().replace(/[.\s]+$/,"");return Pe({describe:yn?`${yn}, ${Le}`:Le}),!0}const Jt=Ot(null,kn),Sn=kn==="source"?Rce(Le):null,Qn=Sn?null:ai(Le,ya);if(Qn&&(Jt==="source"||Jt==="describe"||Qn!=="vague"))return rt(Le,uc(Qn,Jt,ct(Rt,Qn),Le),Rt,Qn),!0;if((kn==="source"||kn==="describe")&&!Sn&&!ya(Le))return E({type:"unsure",unsure:{said:Le,q:Rt,at:zp()},ctx:Re}),!0;if((kn==="source"||kn==="describe")&&E({type:"settle-unsure",ctx:Re}),kn==="source")return Sn?(Pe({source:{door:Sn,via:"taps"}}),!0):(Pe({source:{door:"scratch",via:"typed"},describe:Le}),!0);if(kn==="describe")return Pe({describe:Le}),!0;if(C$(Le,X,kn))return Se.update({name:Le.slice(0,60)}),E({type:"text",text:""}),!0;if(kn==="name"){const on=Le.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||Le;return X&&Se.update({name:on.slice(0,60)}),E({type:"text",text:""}),!0}if(!X)return!1;if(kn==="identity")return Se.generate("portrait",Le),E({type:"text",text:""}),!0;const un=jM(Le,jt,X);return"blocked"in un?(U(un.blocked),!1):(P(un.view),H(!1),Se.generate(un.view,Le,un.scope==="view"?ei(un.view):void 0),E({type:"text",text:""}),!0)},[at,Pe,rt,X,Se,jt]),Yt=s.useCallback(Me=>{if(Me==="name"){E({type:"edit",id:"name"});return}const Ze=r9(Me);if(Ze){E({type:"edit",id:`aside:${Ze}`});return}if(!na(Me))return;const Qe=Kce(Me,X);if(Qe==="start-over"){Z("start-over");return}if(Qe==="redraw"){he(Me),Z("redraw");return}E({type:"edit",id:Me})},[X]),an=s.useCallback(()=>{Z(null),ee&&E({type:"edit",id:ee}),he(null)},[ee]),Wt=s.useCallback((Me,Ze)=>{const Qe=C.current.answers;if(Me==="keep"||Me.startsWith("trait-")&&!Me.endsWith("-where")){const F=Qe[Me];Pe({[Me]:{pick:Me==="keep"||F==null?void 0:F.pick,words:Ze,refs:(F==null?void 0:F.refs)??[]}});return}if(fr(Me)||Me.startsWith("trait-")){const F=Qe[Me];Pe({[Me]:{pick:F==null?void 0:F.pick,words:Ze}});return}Pe({[Me]:Ze})},[Pe]),Rn=s.useCallback((Me,Ze)=>{const Qe=Ze.trim();if(!Qe)return;if(Me==="name"){E({type:"cancel-edit"}),X&&Se.update({name:Qe.slice(0,60)});return}const F=r9(Me);if(F){const we=C.current,We=we.asides.find(Jt=>Jt.at===F);if(!We)return;const Le=We.q&&na(We.q)?We.q:null,ct=Le?Wh(Le,Qe,ya):ai(Qe,ya);if(!ct&&Le){E({type:"drop-aside",at:F}),Wt(Le,Qe);return}const Ot=v6(Le,We.q,!!(X!=null&&X.views.portrait.hash)),zt=Le&&fr(Le)?Le.slice(5):void 0,Rt=ct??"vague",kn=we.asides.filter(Jt=>Jt.q===We.q&&Jt.at<We.at&&Jt.kind===Rt).length;E({type:"amend-aside",at:F,said:Qe,reply:uc(Rt,Ot,kn,Qe,zt),kind:Rt,ctx:Re});return}if(!na(Me)||!j1(Me,C.current.answers))return;const de=Wh(Me,Qe,ya);if(de){const we=C.current,We=v6(Me,Me,!!(X!=null&&X.views.portrait.hash)),Le=fr(Me)?Me.slice(5):void 0,ct=we.asides.filter(Ot=>Ot.q===Me&&Ot.kind===de).length;Pe({[Me]:void 0}),rt(Qe,uc(de,We,ct,Qe,Le),Me,de);return}Wt(Me,Qe)},[X,Se.update,Pe,Wt,qt,at,Re]),Bt=s.useCallback(()=>E({type:"cancel-edit"}),[]),ne=s.useCallback(()=>{const Me=C.current,Ze=Me.editing&&Me.editing!=="name"&&!C1(Me.editing)?Me.editing:null,Qe=Ze&&!j1(Ze,Me.answers)?Ze:at==null?void 0:at.id;if(Qe==="agree"){E({type:"say",id:"keep"});return}if(Qe==="identity"){ge(F=>F+1);return}if(!(!Qe||!na(Qe))){if(Qe==="look-who"){Pe({source:{door:"scratch",via:"words"}});return}E({type:"say",id:Qe})}},[at==null?void 0:at.id,Pe]),le=s.useCallback(()=>H7(C.current,Re,Zt.current),[Re]),ce=s.useCallback(Me=>{const Ze=le();if(Ze){U(null),C.current.saying!==Ze&&E({type:"say",id:Ze});for(const Qe of Me.slice(0,1)){const F=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,de=URL.createObjectURL(Qe);J(we=>[...we,{key:F,id:Ze,url:de}]),d1(Qe).then(we=>{if(tt.current.delete(F)){URL.revokeObjectURL(de);return}Q.current.has(we)?URL.revokeObjectURL(de):Q.current.set(we,de),E({type:"ref",id:Ze,hash:we}),J(We=>We.filter(Le=>Le.key!==F))}).catch(we=>{tt.current.delete(F)||U(String((we==null?void 0:we.message)??we)),J(We=>We.filter(Le=>Le.key!==F)),URL.revokeObjectURL(de)})}}},[le]),Ve=(Me,Ze,Qe)=>{const F=qy(Me,Ze,Qe);return F.charAt(0).toUpperCase()+F.slice(1)},_e=Me=>g7(Me).flatMap(Ze=>{const Qe=Ze.color?dr(Ze.color):null;return Qe?[{hex:Qe,name:Ze.label,slot:"accent"}]:[]}),xt=H7(S,Re,(at==null?void 0:at.id)??null),yt=(()=>{var ct,Ot,zt;if(!xt)return;const Me=((ct=S.answers[xt])==null?void 0:ct.refs)??[],Ze=xt==="keep"?Me.slice(((Ot=S.composing)==null?void 0:Ot.id)==="keep"?S.composing.refs.length:Me.length):Me,Qe=te.filter(Rt=>Rt.id===xt);if(!Ze.length&&!Qe.length)return;const F=xt==="keep"?null:fs(xt),de=F&&((zt=Oa(F.id))==null?void 0:zt.label)||"Detail",we=Ze.length+Qe.length>1;let We=0;const Le=()=>we?`${de} ${++We}`:de;return[...Ze.map(Rt=>({key:Rt,src:Q.current.get(Rt)??gn(Rt,"micro"),label:Le(),onRemove:()=>E({type:"ref",id:xt,hash:Rt,remove:!0})})),...Qe.map(Rt=>({key:Rt.key,src:Rt.url,label:Le(),busy:!0,onRemove:()=>{tt.current.add(Rt.key),J(kn=>kn.filter(Jt=>Jt.key!==Rt.key))}}))]})(),kt=Xce(at,S,X,jt),ot=Se.busy||K||!!kt.off,ht=xt,Ae=P7(S,at),me=Ae==="name"?null:Ae,et=me&&fr(me)?me.slice(5):null,Ct=kt.color&&et?_e(et):null,be=me&&((Lt=S.colour)==null?void 0:Lt.step)===me?S.colour.hex:null,it=X&&fi(X)&&!kt.off&&!(at!=null&&at.id.match(/^(name|describe)$/))?(()=>{const Me=Oq(S.text,jt,X),Ze=Me.chip?X.views[Me.chip.view].hash:void 0;return{chip:Me.chip?{label:Me.chip.label,thumb:Ze?gn(Ze,"micro"):void 0}:null,hint:Me.hint,tone:Me.tone}})():null,vt=X?SM(X,jt):[],Te=(Ft==null?void 0:Ft.hash)??((X==null?void 0:X.stage)==="analyzing"?X.sources[0]:void 0),qe=R&&(Ft!=null&&Ft.prior)?Ft.prior:Te;return{d:X,view:jt,slot:Ft,facets:V,setFacets:B,presenterCategories:u,saving:G,saveErr:O,confirming:q,setConfirming:Z,confirmEdit:an,pendingEdit:ee,startOver:Ge,begun:Object.keys(S.answers).length>0||!!X,unsaved:!e&&!X&&Object.keys(S.answers).length>0,leave:()=>{re(),E({type:"start-over"})},revision:S.revision,open:(at==null?void 0:at.id)??null,keepPrevious:Ft&&Ft.status==="approved"&&Ft.prior&&!Pt&&!(X!=null&&X.activeView)&&(X==null?void 0:X.stage)==="idle"?()=>void Se.revert(jt):null,surface:{title:"Create person",memoryKey:`presenter-create:${l.id}:${t}`,resumed:ae,turns:bt,busy:Se.busy||K||w,working:qce(bt,X,K||Se.busy),stageEmpty:{lead:dce(X?jt:void 0,xn[jt]),hint:fce((at==null?void 0:at.id)??null,((Ut=S.answers.photos)==null?void 0:Ut.hashes.length)??0)},stage:X?{hash:qe,alt:`${$c[jt]}${(Ft==null?void 0:Ft.status)==="candidate"?", candidate":""}`,drawing:Pt,since:AM(X),doing:NM(X),takes:zw(X,jt)?[]:RM(X,jt),onTake:Tt?Me=>void Se.restore(jt,Me):void 0,items:vt,onPick:Me=>{P(Me),H(!1)},compare:Ft&&Ft.status==="candidate"&&Ft.prior?{on:R,toggle:()=>H(Me=>!Me)}:void 0}:null,composer:{placeholder:kt.placeholder,label:kt.label,action:kt.action,scope:it,hint:null,why:kt.off??void 0,error:D??O,disabled:ot,working:!!X&&!!X.activeView&&(at==null?void 0:at.id)!=="name",onStop:X!=null&&X.activeView?()=>void Se.stop():void 0,stopping:Se.stopping,focusKey:at&&!(at.id==="agree"&&!S.saying)?`${at.id}:${(X==null?void 0:X.id)??"setup"}:${ue}:${S.saying??""}:${S.says}`:void 0,onAttach:!ht&&!X&&(at==null?void 0:at.id)==="source"?()=>Pe({source:{door:"photos",via:"taps"}}):void 0,onAttachFiles:ht?ce:void 0,attachLabel:ht?Sue(S,ht):"Add photos",refs:yt,colour:Ct&&et?{hex:be,label:be?Ve(be,g7(et),et):"Pick a colour",seed:(Nt=Ct[Math.floor(Ct.length/2)])==null?void 0:Nt.hex,onPick:Me=>E({type:"colour",hex:Me,step:me}),onClear:()=>E({type:"colour",hex:null,step:me})}:null},text:S.text,onText:Me=>E({type:"text",text:Me}),onSend:qt,onAnswer:nt,onRestore:(Me,Ze)=>{P(Me),Se.restore(Me,Ze)},onEdit:Yt,onSaveEdit:Rn,onCancelEdit:Bt,onDescribe:ne,onAttachRef:ce,onStarter:Me=>{(at==null?void 0:at.id)==="agree"&&E({type:"say",id:"keep"}),E({type:"text",text:Me})},onPaste:!X&&((_t=S.answers.source)==null?void 0:_t.door)==="photos"?Me=>void st(Me):void 0}}}function Cue({onClose:e,...t}){const n=Eue(t),r=n.d,{push:a}=rr();s.useEffect(()=>Op({open:n.open}),[n.open]),s.useEffect(()=>()=>Op(null),[]);const[i,l]=s.useState(!1);s.useEffect(()=>{i&&!n.unsaved&&l(!1)},[i,n.unsaved]);const u=()=>{if(n.unsaved){l(!0);return}r&&!n.saving&&a({kind:"info",title:"Kept on People",detail:"Continue it from its card."}),e()},f=n.begun?r?o.jsx(Xn,{label:"Start over",tone:"quiet",title:"Start over?",body:`This conversation begins again from the first question. ${EM(r)?"The views drawn so far are kept: the unfinished person stays on your wall.":"Nothing has been drawn yet, so nothing is kept."}`,open:n.confirming==="start-over"||void 0,busy:!1,onOpenChange:m=>{m||n.setConfirming(null)},onConfirm:()=>void n.startOver()}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void n.startOver(),children:"Start over"}):null,h=o.jsx(o.Fragment,{children:n.keepPrevious&&n.slot&&o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]})}),p=o.jsx(Xn,{label:"Change it",title:vce,body:(r==null?void 0:r.source)==="photos"?yce:wce,busy:!1,open:n.confirming==="redraw",onOpenChange:m=>{m||n.setConfirming(null)},onConfirm:n.confirmEdit}),g=o.jsxs(o.Fragment,{children:[p,o.jsx(Xn,{label:"Leave",title:"Leave without drawing them?",body:"Nothing has been drawn yet, so the answers are not kept. Starting again starts from the first question.",busy:!1,open:i,onOpenChange:m=>{m||l(!1)},onConfirm:()=>{l(!1),n.leave(),e()}})]});return o.jsx(Uy,{surface:{...n.surface,headAction:f,dock:h,overlay:g},onClose:u})}function jue(){const{draftId:e=null}=aa(),{key:t}=Bn(),{brand:n}=cn(),r=Un(),{announce:a,caps:i}=sy();qc("Create person");const l=s.useRef(!1);s.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const u=s.useRef(e),f=s.useRef(0);e!==u.current&&(u.current=e,f.current+=1);const h=s.useCallback((m,w=!1)=>{l.current&&(w&&(u.current=m),r(vl(n,m),{replace:w}))},[r,n]),p=s.useCallback(()=>{l.current&&(u.current=null,r(vl(n),{replace:!0}))},[r,n]),g=s.useCallback(()=>r(ui(n),{replace:!0}),[r,n]);return o.jsx(Cue,{draftId:e,convoKey:e??t,onOpenDraft:h,onLeaveDraft:p,onClose:g,onStarted:m=>{a(m,{quiet:l.current&&m.kind==="presenter"}),l.current&&r(m.kind==="presenter"?Ra(n,m.id):ui(n),{replace:!0})},caps:i},f.current)}const O7=1e3,Aue=3,Nue=1e3;function I7(e,t,n){return{name:e.name.trim()||t.name,prompt:t.prompt,lighting:t.lighting,description:t.description,subject:t.subject,camera:t.camera??"",figure:t.figure??"",figureTreatment:t.figureTreatment??"",keywords:t.keywords??[],collections:t.collections??[],verticals:t.verticals??[],...t.promptName?{promptName:t.promptName}:{},instruction:e.place.trim(),refHashes:[...e.pictures,...e.heldPictures],...n!=null&&n.hash?{previewHash:n.hash,anchor:n.anchor===!0}:{},...n!=null&&n.hash&&n.hero?{heroHash:n.hero,...n.heroWith?{heroWith:n.heroWith}:{}}:{}}}function Mue(e){var H,D;const{s:t,dispatch:n,brandId:r,sceneId:a,conversation:i,applyBrand:l}=e,[u,f]=s.useState(!1),[h,p]=s.useState(!1),[g,m]=s.useState(!1),[w,y]=s.useState(0),b=s.useRef(t);b.current=t;const k=s.useRef(e.seed);k.current=e.seed;const S=s.useRef(!1),E=s.useRef(e.onSaved);E.current=e.onSaved;const{poke:C}=ia(),A=s.useCallback(async(U,V={})=>{if(!(S.current||b.current.job)){S.current=!0,m(!0);try{const B=b.current,G=$r(B),_=U==="make"?{kind:U,instruction:B.place,imageHashes:B.pictures,draw:V.draw??!1,...V.shot?{shot:!0}:{}}:U==="again"?{kind:U,reading:G==null?void 0:G.reading,imageHashes:B.pictures}:{kind:U,reading:G==null?void 0:G.reading,ask:V.ask,from:(G==null?void 0:G.hash)??void 0,...G!=null&&G.hash&&G.anchor?{fromAnchor:!0}:{},...G!=null&&G.hash&&G.hero?{fromHero:G.hero,...G.heroWith?{heroWith:G.heroWith}:{}}:{},imageHashes:B.pictures,draw:V.draw},O=B.name.trim()||(G==null?void 0:G.reading.name)||void 0,{jobId:I,job:K,existing:z}=await Ee.startSceneStudioJob(r,{..._,conversation:i,...a?{sceneId:a}:{},...O?{label:O}:{}});if(z&&K.kind!==U){n({type:"error",text:pe.busyElsewhere});return}n({type:"started",id:I,kind:K.kind,ask:K.kind===U?V.ask:void 0,since:K.phaseAt}),C()}catch(B){n({type:"error",text:String((B==null?void 0:B.message)??B)}),y(G=>G+1)}finally{S.current=!1,m(!1)}}},[r,n,C]);s.useEffect(()=>{const U=b.current;if(U.job||!U.versions.length&&!U.inputsRev)return;let V=!0;return Ee.activity(r).then(B=>{var _;const G=(_=B.studio)==null?void 0:_.find(O=>O.kind==="scene"&&O.conversation===i&&O.status==="running"&&!!O.job);!V||!(G!=null&&G.job)||b.current.job||S.current||n({type:"started",id:G.id.slice(6),kind:G.job,since:G.startedAt})}).catch(()=>{}),()=>{V=!1}},[r,i,n]);const L=t.named?t.name.trim():"",T=((H=t.job)==null?void 0:H.id)??null;s.useEffect(()=>{!T||!L||Ee.labelSceneStudioJob(r,T,L).catch(()=>{})},[T,L,r]);const M=((D=t.job)==null?void 0:D.id)??null;s.useEffect(()=>{if(!M)return;let U=!0,V=0,B=!0,G;const _=async()=>{var O;try{const I=await Ee.sceneStudioJob(r,M);if(!U)return;V=0,f(!1),B&&I.status==="running"&&((O=b.current.job)!=null&&O.stopping)&&Ee.cancelSceneStudioJob(r,M).catch(()=>{}),B=!1,I.status==="running"?(n({type:"progress",job:I}),G=setTimeout(_,O7)):n({type:"finished",job:I})}catch(I){if(!U)return;if((I==null?void 0:I.status)===404){f(!1),n({type:"lost",id:M,error:pe.lost});return}V++,V>=Aue&&f(!0),G=setTimeout(_,Math.min(O7*2**Math.min(V,3),8e3))}};return _(),()=>{U=!1,clearTimeout(G)}},[M,r,n]);const j=s.useCallback(()=>{const U=b.current.job;if(!U||U.stopping)return Promise.resolve(!0);n({type:"stopping",id:U.id});const V=()=>Ee.cancelSceneStudioJob(r,U.id);return V().catch(()=>new Promise(B=>setTimeout(B,Nue)).then(V)).then(()=>!0,()=>(n({type:"stop-failed",id:U.id}),!1))},[r,n]),P=s.useCallback(U=>{const V=use(b.current,U);V>=0&&n({type:"put-back",index:V})},[n]),R=s.useCallback(async(U={})=>{var O,I,K,z;const V=b.current,B=((O=$r(V))==null?void 0:O.reading.name)||((K=(I=V.job)==null?void 0:I.pending)==null?void 0:K.name)||"",G={...V,name:V.name.trim()||B},_=ise(G);if(!(!_.can||!_.words||S.current)){S.current=!0,p(!0);try{const q=((z=V.job)==null?void 0:z.phase)==="drawing"?V.job.id:null,Z=I7(G,_.words,q?null:$r(V)??null),ee=k.current,he=ee?$r(ee):null,ue=a&&!U.asNew?await Ee.updateScene(r,a,ee&&he?xse(Z,I7(ee,he.reading,he)):Z):await Ee.createScene(r,{...Z,conversation:i});l(ue.brand);const ge=ue.scene;if(q){const te=await Ee.attachSceneStudioJob(r,q,ge.id).catch(()=>null);(te==null?void 0:te.state)==="landed"&&l(te.brand)}n({type:"saved",id:ge.id}),E.current({id:ge.id,name:ge.name,verticals:ge.verticals??[]},!!U.asNew)}catch(q){n({type:"error",text:String((q==null?void 0:q.message)??q)})}finally{S.current=!1,p(!1)}}},[r,a,i,l,n]);return{offline:u,saving:h,starting:g,failed:w,start:A,stop:j,putBack:P,use:R}}const Rue="scenri:scene-studio:",Pue=10080*60*1e3;function P$(e){const t=Cr.get(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Lue(e){const t=P$(e);return YP(typeof(t==null?void 0:t.session)=="string"?t.session:null)}function $ue(e,t,n){Cr.set(e,JSON.stringify({at:Date.now(),sceneId:n,session:t}))}function Tue(e){const t=e.trim();if(!t)return"A shot";if(t.length<=60)return t;const n=t.slice(0,60);return`${n.slice(0,Math.max(n.lastIndexOf(" "),40)).trim()}…`}function F7(e){Cr.del(e)}function Due(e=Date.now()){var t;for(const n of Cr.keys(Rue)){let r=0;try{r=Number((t=JSON.parse(Cr.get(n)??"null"))==null?void 0:t.at)||0}catch{}e-r>Pue&&Cr.del(n)}}function Hue(e){var me,et,Ct,be,it,vt;const{brand:t,applyBrand:n,sceneId:r,seed:a,conversation:i,storageKey:l,caps:u}=e,f=r&&a?{name:a.name}:null,[h]=s.useState(()=>{Due();const Te=Lue(l);return Te||fl(l),Te}),[p,g]=s.useReducer(HP,null,()=>(h==null?void 0:h.setup)??ese),[m,w]=s.useReducer(ose,null,()=>(h==null?void 0:h.studio)??a??IP),[y,b]=s.useState(0),[k,S]=s.useState(""),E=s.useRef(null),[C,A]=s.useState(!1),[L,T]=s.useState(void 0),[M,j]=s.useState(null),P=s.useRef(!1),R=s.useRef(p);R.current=p;const H=s.useRef(m);H.current=m;const[D,U]=s.useState(null),V=s.useRef(e.onSaved);V.current=e.onSaved;const B=Mue({s:m,dispatch:w,brandId:t.id,sceneId:r,conversation:i,seed:a,applyBrand:n,onSaved:(Te,qe)=>V.current(Te,r&&!qe?"updated":"created")}),G=s.useRef(!1);s.useEffect(()=>{if(P.current)return;const Te=P$(l);if((Te==null?void 0:Te.done)===!0||G.current&&!Te){P.current=!0;return}const qe=typeof(Te==null?void 0:Te.sceneId)=="string"?Te.sceneId:null;$ue(l,Dse(p,m),r??m.saved??qe),G.current=!0},[p,m,l,r]);const _=m.saved,O=_?m1(t,_):void 0,I=VL(t.id,_,(O==null?void 0:O.placeUrl)??null),K=((me=I.job)==null?void 0:me.status)==="running",[z,q]=s.useState(!1),[Z,ee]=s.useState(0),[he,ue]=s.useState(!1);s.useEffect(()=>{K||ue(!1)},[K]);const ge=s.useMemo(()=>LM(O==null?void 0:O.examples,I.job),[O==null?void 0:O.examples,I.job]),te=s.useRef(e.onDone);te.current=e.onDone;const J=s.useMemo(()=>{var qe,Lt;if(!_)return;const Te=(O==null?void 0:O.examples)??[];return{tiles:ge,running:K||z||I.waiting,read:I.read,who:((qe=Te[0])==null?void 0:qe.with)??((Lt=I.job)==null?void 0:Lt.subject.kind)??((O==null?void 0:O.subject)==="person"||O!=null&&O.figure?"presenter":"product"),noSubject:I.read&&!I.job&&!Te.length&&I.more.length===0,missing:Vq(I.more,Te,I.job),first:I.first,stale:I.first.length>0&&Te.some(Ut=>Ut.earlier),finish:e.finish}},[_,O,ge,K,z,I.waiting,I.read,I.job,I.first,I.more,e.finish]),Q=s.useCallback(Te=>{_&&(j(null),q(!0),Ee.drawSceneExamples(t.id,_,Te).then(()=>{q(!1),I.again()}).catch(qe=>{q(!1),ee(Lt=>Lt+1),"roles"in Te||w({type:"set-failed",more:"more"in Te}),j(String((qe==null?void 0:qe.message)??qe))}))},[t.id,_,I.again]),ae=s.useCallback(()=>{_&&(P.current=!0,_se(l,_),fl(l),te.current(_))},[_,l]),[$e,ie]=s.useState(null);s.useEffect(()=>ie(null),[m.current]),s.useEffect(()=>{f||p.editing||!p9(p.answers)||w({type:"inputs",place:Qre(p.answers),pictures:Jre(p.answers)})},[p.answers,p.editing,f]);const ke=s.useRef(new Set),ze=ase(m,!f&&p9(p.answers));s.useEffect(()=>{var Te;ze===null||B.starting||ke.current.has(ze)||(ke.current.add(ze),B.start("make",{draw:!1,shot:((Te=R.current.answers.source)==null?void 0:Te.door)==="shot"}))},[ze,B.starting,B.start]);const[wt,Ke]=s.useState(""),tt=Py(t.id,wt,!f),De=s.useRef(tt);De.current=tt;const Se=s.useRef([]);tt.settled&&!tt.error&&(Se.current=tt.items);const X=tt.settled?tt.items:Se.current,je=!tt.error&&(!tt.settled||tt.loading),{recent:Re,loaded:re}=cn(),[Y,se]=s.useState(null);s.useEffect(()=>{!wt.trim()&&tt.settled&&!tt.error&&se(tt.items.length>0)},[wt,tt.settled,tt.error,tt.items.length]);const Ne=Y??(Re.length>0?!0:re?!1:null),Be=s.useMemo(()=>({any:Ne,items:X.map(Te=>({id:Te.id,hash:Te.images[0],alt:Tue(Te.promptHead)})),query:wt,more:tt.settled&&tt.hasMore,loading:je,error:tt.error}),[Ne,X,wt,tt.settled,tt.hasMore,je,tt.error]),st=Mn().scenes,Pe=(u==null?void 0:u.canRead)??!0,[Oe,Ge]=s.useState(null),ft=s.useCallback(async Te=>{var _t,Me,Ze;const qe=Se.current.find(Qe=>Qe.id===Te)??tt.items.find(Qe=>Qe.id===Te);if(!(qe!=null&&qe.images[0]))return;const Lt=R.current.revision;let Ut=S9(qe.brief);if(!Ut&&qe.kind==="edit"){const Qe=await Ee.lineage(qe.id).catch(()=>null);if(Ut=S9((_t=Qe==null?void 0:Qe.ancestors.find(F=>F.kind==="generation"))==null?void 0:_t.brief),R.current.revision!==Lt)return}const Nt=Ut?((Me=m1(t,Ut))==null?void 0:Me.name)??((Ze=st.find(Qe=>Qe.id===Ut))==null?void 0:Ze.name):void 0;if(!Pe&&!(Ut&&Nt)){Ge("shot");return}Ge(null),Et({shot:{id:qe.id,hash:qe.images[0],...Ut&&Nt?{scene:{id:Ut,name:Nt}}:{}},reuse:void 0})},[t,st,tt.items,Pe]),bt=s.useCallback(()=>{var qe;const Te=(qe=R.current.answers.shot)==null?void 0:qe.scene;Te&&(P.current=!0,F7(l),fl(l),te.current(Te.id,{existing:!0}))},[l]),at=(u==null?void 0:u.canDraw)??!0,Zt=B.offline?pe.offline:M,jt={setup:p,studio:m,canDraw:at,canRead:Pe,noReader:Oe,uploading:y,edit:f&&{...f,changed:k9(m,a)},editingName:C,note:Zt,stale:FP(m),shots:Be,set:J},Ft=B.failed+Z,Pt=s.useMemo(()=>Rse(jt).map(Te=>Te.kind==="question"&&Ft?{...Te,question:{...Te.question,attempt:Ft}}:Te),[p,m,at,Pe,Oe,y,C,Zt,f,Be,J,Ft]),Tt=(()=>{const Te=Pt[Pt.length-1];return(Te==null?void 0:Te.kind)==="question"?Te.question:null})(),xe=$se(jt,Tt),Je=(Te,qe,Lt)=>g({type:"aside",aside:{said:Te,reply:qe,q:Lt,at:zp()}}),Et=s.useCallback(Te=>{const qe=R.current,Lt=qe.held??qe.answers;qe.editing&&y9(H.current)&&JSON.stringify(xy(Lt,Te))!==JSON.stringify(Lt)&&w({type:"forget-record"}),g({type:"answer",patch:Te})},[]),Xe=s.useRef(0),rt=s.useCallback(async Te=>{var Me,Ze;const qe=Te.some(v9),Lt=Te.filter(Qe=>Qe.type.startsWith("image/")&&!v9(Qe));if(!Lt.length){j(qe?pe.heicNotYet:pe.onlyPictures);return}((Me=R.current.answers.source)==null?void 0:Me.door)!=="photos"&&Et({source:{door:"photos"}});const Nt=4-(((Ze=R.current.answers.photos)==null?void 0:Ze.hashes)??[]).length-Xe.current;if(Nt<=0){j(pe.fourPictures);return}const _t=Lt.slice(0,Nt);j(Lt.length>Nt?pe.fourPictures:qe?pe.heicNotYet:null),Xe.current+=_t.length,b(Qe=>Qe+1);try{for(const Qe of _t)try{g({type:"photo",hash:await d1(Qe)})}catch(F){j(`${Qe.name} could not be added: ${String((F==null?void 0:F.message)??F)}`)}finally{Xe.current-=1}}finally{b(Qe=>Qe-1)}},[Et]),nt=s.useRef(ge);nt.current=ge;const qt=_l(),Yt=Vl(),an=s.useCallback((Te,qe)=>{var Lt,Ut;if(j(null),qe.kind==="confirm"&&qe.id.startsWith("remedy:")){const Nt=qe.id.slice(7);Nt==="setup"?Yt():(Nt==="engines"||Nt==="budget")&&qt(Nt);return}if(qe.kind==="confirm"&&qe.id==="reword"){T(String(Date.now()));return}if(Te==="photos"&&qe.kind==="photos"){const Nt=qe.action,_t=((Lt=R.current.answers.photos)==null?void 0:Lt.hashes)??[];Nt.type==="add"?rt(Nt.files):Nt.type==="instead"?Et({source:{door:"shot"}}):Nt.type==="remove"?g({type:"photos",hashes:_t.filter(Me=>Me!==Nt.hash)}):Nt.type==="reject"?j(pe.onlyPictures):Nt.type==="submit"&&_t.length?Pe?(Ge(null),Et({photos:{hashes:_t,done:!0}})):Ge("photos"):Nt.type==="back"&&Et({source:{door:"guided"}});return}if(Te==="shot"&&qe.kind==="pick"){const Nt=qe.action;Nt.type==="pick"?ft(Nt.id):Nt.type==="query"?Ke(Nt.text):Nt.type==="more"?De.current.loading||De.current.loadMore():Nt.type==="back"&&(Ke(""),Et({source:{door:"photos"},photos:{hashes:[],done:!1}}));return}if(Te==="reuse"&&qe.kind==="choice"&&qe.id==="use"){bt();return}if(Te==="reuse"&&!Pe){Ge("shot");return}if(Te==="noreader"){qe.kind==="confirm"&&qe.id==="unstop"&&Ge(null);return}if(h9(Te)){const Nt=Xre(Te,qe,R.current.answers);Nt&&Et(Nt);return}if(Te==="retry"){B.start("make",{draw:!1,shot:((Ut=R.current.answers.source)==null?void 0:Ut.door)==="shot"});return}if(qe.kind==="confirm"){if(Te==="set-start"){qe.id==="draw-set"?(w({type:"set-drawn"}),Q({first:!0})):w({type:"set-declined"});return}if(Te==="set-more"){qe.id==="more"?(w({type:"ask-more"}),Q({more:!0})):w({type:"decline-more"});return}if(Te==="set-done"){qe.id==="retry-failed"?Q({roles:nt.current.filter(Nt=>Nt.state==="failed").map(Nt=>Nt.role)}):ae();return}qe.id==="draw"||qe.id==="again"?B.start("again"):qe.id==="use"?B.use():qe.id==="another-shot"&&le.current("shot")}},[rt,Et,B.start,B.use,Q,ae,ft,bt,qt,Yt,Pe]),Wt=Te=>{Te.trim()?!E.current&&xe.target.kind!=="off"&&(E.current=xe.target):E.current=null,S(Te)},Rn=Te=>{const qe=Bt(Te);return qe&&(E.current=null,S("")),qe};function Bt(Te){var qe;{const Lt=Te.trim();if(!Lt)return!1;j(null);const Ut=E.current??xe.target;if(Ut.kind==="source"){if(KP(Lt))return Et({source:{door:"words",text:Lt.slice(0,Sd)}}),!0;const Nt=Zre(Lt),_t=Object.keys(Nt);return _t.length>0?(Et({source:{door:"guided"},...Object.fromEntries(_t.map(Me=>[Me,{pick:Nt[Me]}]))}),!0):(Je(Lt,R9(P9(Lt,"source")??"vague","source"),"source"),!0)}if(Ut.kind==="row"&&Bp(Ut.id)){const Nt=P9(Lt,"row");if(Nt)return Je(Lt,R9(Nt,"row"),Ut.id),!0;const _t=(qe=R.current.answers[Ut.id])==null?void 0:qe.pick;return Et({[Ut.id]:{..._t?{pick:_t}:{},words:Lt.slice(0,Sd)}}),!0}if(Ut.kind==="name")return w({type:"name",text:VP(Lt)??Lt}),!0;if(Ut.kind==="add"||Ut.kind==="change"){if(m.job||B.starting)return!1;const Nt=yse(Lt),_t=Mse(m);return Nt.kind==="rename"?(w({type:"name",text:Nt.name}),Je(Lt,pe.renamed(Nt.name),_t),!0):Nt.kind!=="change"?(Je(Lt,Nt.say,_t),Nt.kind!=="refuse"):(Ut.kind==="add"?B.start("change",{ask:Lt,draw:!1}):bse(m,Lt)?B.start("again"):B.start("change",{ask:Lt}),!0)}return!1}}const ne=s.useCallback(Te=>{m.job||(Te==="name"?A(!0):h9(Te)&&(Te==="shot"&&Ke(""),y9(m)?U(Te):g({type:"edit",id:Te})))},[m]),le=s.useRef(ne);le.current=ne;const ce=s.useCallback((Te,qe)=>{Te==="name"&&(qe.trim()&&w({type:"name",text:qe.trim()}),A(!1))},[]),Ve=s.useCallback(()=>{A(!1),g({type:"cancel-edit"})},[]),_e=$r(m),xt=K&&I.job?Bw({status:I.job.status,step:I.job.current,done:I.job.done.length,total:I.job.roles.length,error:I.job.error}):void 0,yt=m.job?e6(m):B.saving?"Saving":xt,kt=[];let ot=null;const ht=Te=>({view:"place",label:pe.emptyLabel,state:Te==="place"?"current":"approved",hash:(_e==null?void 0:_e.hash)??void 0,photo:!1,drawing:!1,approved:!0,error:!1});if(_){const Te=K?(et=I.job)==null?void 0:et.current:null,qe=((Ct=[...ge].reverse().find(_t=>_t.state==="shown"))==null?void 0:Ct.role)??null,Lt=$e??Te??qe??"place",Ut=((be=ge[0])==null?void 0:be.role)==="hero"&&ge[0].state==="shown";Ut||kt.push(ht(Lt));for(const[_t,Me]of ge.entries())kt.push({view:Me.role,label:Qa[Me.role],state:Lt===Me.role?"current":Me.state==="shown"?"approved":"todo",hash:Me.hash,photo:!1,drawing:Me.state==="drawing",approved:Me.state==="shown",error:Me.state==="failed"}),Ut&&_t===0&&kt.push(ht(Lt));const Nt=kt.find(_t=>_t.view===Lt)??kt[0];ot={hash:Nt.hash,drawing:Nt.drawing}}else if(_e!=null&&_e.hash&&_e.hero){const Te=$e==="place"?"place":"hero";kt.push({view:"hero",label:Qa.hero,state:Te==="hero"?"current":"approved",hash:_e.hero,photo:!1,drawing:!1,approved:!0,error:!1},ht(Te))}const Ae=!f&&(!!p.answers.source||m.versions.length>0);return{title:f?pe.editTitle:pe.title,turns:Pt,working:yt,busy:B.saving,resumed:!!h,memoryKey:l,stage:ot?{hash:ot.hash,alt:`${m.name.trim()||(_e==null?void 0:_e.reading.name)||"The place"}, in use`,drawing:ot.drawing||!!m.job&&m.job.phase==="drawing",doing:xt??e6(m),items:kt,onPick:Te=>ie(Te)}:{hash:($e==="place"?_e==null?void 0:_e.hash:_P(_e))??void 0,alt:`Preview of ${m.name.trim()||(_e==null?void 0:_e.reading.name)||"the place"}`,drawing:!!m.job&&m.job.phase==="drawing",since:((it=m.job)==null?void 0:it.since)??void 0,doing:e6(m),takes:m.job?void 0:lse(m),onTake:B.putBack,items:kt,onPick:Te=>ie(Te)},composer:{placeholder:xe.placeholder,label:xe.label,action:xe.action,disabled:xe.target.kind==="off",why:xe.target.kind==="off"&&xe.target.why||null,working:xe.working,onStop:m.job?()=>{j(null),B.stop().then(Te=>{Te||j(pe.stopLost)})}:K&&_?()=>{ue(!0),Ee.stopSceneExamples(t.id,_).then(()=>I.again()).catch(()=>{ue(!1),j(pe.stopLost)})}:void 0,stopping:!!((vt=m.job)!=null&&vt.stopping)||he,focusKey:L,onAttachFiles:xe.attach?Te=>void rt(Te):void 0,attachLabel:pe.attachLabel},text:k,onText:Wt,onSend:Rn,onAnswer:an,onEdit:ne,onSaveEdit:ce,onCancelEdit:Ve,confirmingEdit:D!==null,confirmEdit:()=>{D&&g({type:"edit",id:D}),U(null)},cancelConfirm:()=>U(null),onRestore:(Te,qe)=>B.putBack(qe),onRetry:Te=>Q({roles:[Te]}),onDescribe:()=>T(String(Date.now())),onStarter:Te=>{Wt(Te),T(String(Date.now()))},onPaste:(Tt==null?void 0:Tt.id)==="source"||(Tt==null?void 0:Tt.id)==="photos"?Te=>void rt(Te):void 0,canDraw:at,begun:Ae,unsaved:m.saved?!1:f?k9(m,a):Ae,running:!!m.job||K,saved:!!_,finish:ae,keptAsDraft:!f&&ZP(m),leave:()=>{B.stop(),P.current=!0,F7(l),fl(l)}}}function Oue({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onClose:u,onStartOver:f,onSaved:h,onDone:p,finish:g}){const m=Hue({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onSaved:h,onDone:p,finish:g}),[w,y]=s.useState(!1),[b,k]=s.useState(!1),S=m.turns[m.turns.length-1],E=(S==null?void 0:S.kind)==="question"?S.question.id:null;s.useEffect(()=>Op({open:E}),[E]),s.useEffect(()=>()=>Op(null),[]);const C=!!n,A=()=>{if(m.busy){k(!0);return}if(m.saved){m.finish();return}if(m.running||m.keptAsDraft){u();return}if(m.unsaved){y(!0);return}m.leave(),u()};s.useEffect(()=>{!b||m.busy||(k(!1),A())},[b,m.busy]);const L=!C&&m.begun&&!m.saved?o.jsx(Xn,{label:pe.startOver,tone:"quiet",title:pe.startOverTitle,body:pe.startOverBody,busy:!1,onConfirm:()=>{m.leave(),f()}}):null;return o.jsx(Uy,{onClose:A,surface:{kind:"scene",glyph:o.jsx(kC,{size:32}),title:m.title,turns:m.turns,busy:m.busy,working:m.working,memoryKey:m.memoryKey,resumed:m.resumed,stage:m.stage,stageEmpty:{lead:pe.emptyLead,hint:pe.emptyHint},composer:m.composer,text:m.text,onText:m.onText,onSend:m.onSend,onAnswer:m.onAnswer,onEdit:m.onEdit,onSaveEdit:m.onSaveEdit,onCancelEdit:m.onCancelEdit,onRestore:m.onRestore,onRetry:m.onRetry,onDescribe:m.onDescribe,onStarter:m.onStarter,onPaste:m.onPaste,headAction:L,overlay:o.jsxs(o.Fragment,{children:[o.jsx(Xn,{label:pe.changeIt,title:pe.changeTitle,body:pe.changeBody,busy:!1,open:m.confirmingEdit,onOpenChange:T=>{T||m.cancelConfirm()},onConfirm:m.confirmEdit}),o.jsx(Xn,{label:C?pe.discard:pe.leave,title:C?pe.discardTitle:pe.leaveTitle,body:C?pe.discardBody:pe.leaveBody,busy:!1,open:w,onOpenChange:T=>{T||y(!1)},onConfirm:()=>{y(!1),m.leave(),u()}})]})}})}const uv=e=>{const t=/^asset:([a-f0-9]{32})$/.exec(String(e??""));return t?t[1]:null};function Iue(e,t){var l;const r=(((l=e.json)==null?void 0:l.scenes)??[]).find(u=>(u==null?void 0:u.id)===t);if(!r)return null;const a={name:String(r.name??""),prompt:String(r.prompt??""),lighting:String(r.lighting??""),subject:r.subject==="product"||r.subject==="person"?r.subject:"either",description:String(r.description??""),...r.promptName?{promptName:String(r.promptName)}:{},...r.camera?{camera:String(r.camera)}:{},...r.figure?{figure:String(r.figure)}:{},...r.figure&&r.figureTreatment?{figureTreatment:String(r.figureTreatment)}:{},...Array.isArray(r.keywords)?{keywords:r.keywords.map(String)}:{},...Array.isArray(r.collections)?{collections:r.collections.map(String)}:{},...Array.isArray(r.verticals)?{verticals:r.verticals.map(String)}:{}},i=(Array.isArray(r.refs)?r.refs:[]).map(u=>uv(u==null?void 0:u.file)).filter(Boolean);return sse({place:String(r.instruction??""),pictures:i,reading:a,hash:uv(r.preview)??null,anchor:r.anchor===!0,...Fue(r),name:a.name})}function Fue(e){const t=(Array.isArray(e.examples)?e.examples:[]).find(a=>(a==null?void 0:a.role)==="hero"&&(a==null?void 0:a.from)===e.preview),n=uv(t==null?void 0:t.file);if(!n)return{};const r={...t.product?{product:String(t.product)}:{},...t.presenter?{presenter:String(t.presenter)}:{}};return{hero:n,heroWith:r}}function _ue(){return[...crypto.getRandomValues(new Uint8Array(6))].map(t=>t.toString(16).padStart(2,"0")).join("")}function _7(){const{sceneId:e=null,convoId:t=null}=aa(),{key:n,state:r}=Bn(),{brand:a}=cn(),{applyBrand:i}=Mn(),l=Un(),{announce:u,caps:f}=sy();qc(e?"Edit place":"Create place");const[h]=s.useState(()=>e?Iue(a,e):null),p=typeof(r==null?void 0:r.from)=="string"?r.from:null,g=p&&(bl(pt.hub,p.split("?")[0])||bl(pt.set,p.split("?")[0])),m=s.useCallback(()=>{var k;p&&(((k=window.history.state)==null?void 0:k.idx)??0)>0?l(-1):l(p??(e?zr(a,e):ml(a)),{replace:!0})},[l,p,e,a]),w=s.useMemo(()=>t??_ue(),[t,n]);s.useEffect(()=>{t||e&&!h||l(e?Dw(a,e,w):gl(a,w),{replace:!0,state:r})},[t,w,e,h,a,l,r]);const y=s.useRef(null),b=s.useMemo(()=>t?Vse(a.id,t):null,[a.id,t]);return e&&!h?o.jsx(Pa,{to:zr(a,e),replace:!0}):b?o.jsx(Pa,{to:zr(a,b),replace:!0}):o.jsx(Oue,{brand:a,applyBrand:i,sceneId:e,seed:h,conversation:w,storageKey:`scenri:scene-studio:${a.id}:${w}`,caps:f?{canRead:f.canAnalyze,canDraw:f.canGenerate}:null,onClose:m,onStartOver:()=>l(gl(a),{replace:!0,state:r}),onSaved:(k,S)=>{y.current={made:k,how:S}},finish:g?pe.useInAShot:pe.openScene,onDone:(k,S)=>{var E,C;if(!(S!=null&&S.existing)&&!m1(a,k)){l(ml(a),{replace:!0});return}if(!(S!=null&&S.existing)){const A=m1(a,k),L=((E=y.current)==null?void 0:E.made.id)===k?y.current.made:null;u({kind:"scene",id:k,name:(L==null?void 0:L.name)??(A==null?void 0:A.name)??"",verticals:(L==null?void 0:L.verticals)??(A==null?void 0:A.verticals)??[],how:((C=y.current)==null?void 0:C.how)??(e===k?"updated":"created")},{quiet:!(g&&p)})}g&&p?l(`${p.split("?")[0]}?${yd("scene",k)}&compose=1`,{replace:!0}):l(zr(a,k),{replace:!0})}},w)}function L$(){const{brand:e}=cn(),t=Un(),n=Sr(e);return s.useCallback(r=>{t(`${n}?product=${encodeURIComponent(r)}&compose=1${Ec()}`)},[n,t])}function Vue({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDelete:u,onRename:f,bookmarked:h,onBookmark:p,chosen:g,batching:m,onPick:w,batch:y,size:b="grid"}){var S,E;const k=s.useMemo(()=>y?g2({kind:"product",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):jl({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:p?{on:!!h,run:()=>p(e.id)}:void 0,onRename:f?()=>f(e.id):void 0,remove:u?{label:"Delete product",run:()=>u(e.id)}:void 0}),[n,r,u,f,w,p,h,a,e.id,y]);return o.jsx(Dd,{id:e.id,previewUrl:Jr((E=(S=e.shots)==null?void 0:S[0])==null?void 0:E.file),title:Do(e,"tooltip"),primary:Do(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:k,bookmarked:h,onBookmark:p,chosen:g,batching:m,onPick:w,size:b})}function Zue(e){return o.jsx(n2,{...e})}const $$=s.memo(Vue);function zue({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,size:h="grid"}){const p=v1(e.category)??e.category,{contentArriving:g}=Mn(),m=s.useMemo(()=>jl({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0}),[n,r,f,u,a,e.id]);return o.jsx(Dd,{id:e.id,previewUrl:e.previewUrl,pending:!e.previewUrl&&g,title:`${Do(e,"tooltip")} · ${p}`,primary:Do(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:m,bookmarked:u,onBookmark:f,size:h})}const T$=s.memo(zue),Bue=8,y6="__bookmarked";function Uue(){var Et;const{brand:e,products:t,productsLoaded:n,refreshProducts:r}=cn(),a=((Et=CR())==null?void 0:Et.importing)??!1,{demoProducts:i,applyBrand:l,refreshBrands:u}=Mn(),{push:f}=rr(),h=n&&t.length===0,p=Un(),g=L$(),m=Zl(),{q:w,setQ:y,facets:b,setFacets:k,clearSearch:S,clear:E}=hf(["category","bookmarked"]),C=b.category,A=b.bookmarked==="1",[L,T]=s.useState(()=>Ed("product",e.id)),M=Xe=>T(f2("product",e.id,Xe)),j=_y(`${e.id}|${w}|${C??""}|${A?"1":""}`),[P,R]=Ma(qr.wallDensity,bd),H=Jc(P),D=s.useCallback(Xe=>R(Xe),[R]),U=s.useMemo(()=>t2(H),[H]),V=Jm(H),B=s.useMemo(()=>{const Xe=a?t.filter(rt=>{var nt;return(((nt=rt.shots)==null?void 0:nt.length)??0)>0}):t;return iR(Xe).map(rt=>({product:rt,category:ry(rt),own:!0}))},[t,a]),G=s.useMemo(()=>i.map(Xe=>({product:Xe,category:Xe.category,own:!1})),[i]),_=s.useMemo(()=>[...B,...G],[B,G]),O=s.useMemo(()=>_.reduce((Xe,rt)=>Xe+(L.includes(rt.product.id)?1:0),0),[_,L]),I=A&&O===0,K=I&&h,z=I&&!h,q=s.useMemo(()=>{const Xe=new Map;for(const{category:rt}of _)rt&&Xe.set(rt,(Xe.get(rt)??0)+1);return Xe},[_]),Z=s.useMemo(()=>g1.filter(Xe=>q.has(Xe.key)),[q]),ee=_.length>0?"tabs":"none",he=s.useCallback(Xe=>p(Ea(e,Xe)),[p,e]),[ue,ge]=s.useState(null),[te,J]=s.useState(!1),[Q,ae]=s.useState(null),[$e,ie]=s.useState(!1),[ke,ze]=s.useState(null),[wt,Ke]=s.useState(!1),tt=s.useCallback(Xe=>{const rt=t.find(nt=>nt.id===Xe);rt&&ge(rt)},[t]),De=Xe=>Xe.origin==="catalog"||Xe.id.startsWith("cat-"),Se=s.useCallback(Xe=>{const rt=t.find(nt=>nt.id===Xe);!rt||De(rt)||(ze(null),ae(rt))},[t]),X=async Xe=>{if(!(!Q||$e)){ie(!0),ze(null);try{l(await Ee.updateProduct(e.id,Q.id,{name:Xe})),ae(null)}catch(rt){const nt=ln(rt,"Could not rename this product");ze([nt.title,nt.detail].filter(Boolean).join(" "))}finally{ie(!1)}}},je=async()=>{if(!ue||te)return;J(!0);const Xe=ue.origin==="catalog"||ue.id.startsWith("cat-");try{Xe?(await Ee.deleteCatalogProduct(e.id,ue.id),await r()):l(await f4(e.id,ue.id)),j.forget(ue.id),ge(null)}catch(rt){(rt==null?void 0:rt.status)===404?(await Promise.all([u(),r()]),j.forget(ue.id),ge(null)):f(ln(rt,"Could not delete this product"))}finally{J(!1)}},Re=s.useCallback(Xe=>Xe.filter(({product:rt})=>K||!A||L.includes(rt.id)).filter(({category:rt})=>!C||rt===C).filter(({product:rt,category:nt})=>Ho([Ey(rt),v1(nt)].filter(Boolean).join(" "),w)).map(({product:rt})=>rt),[C,w,A,L,K]),re=s.useMemo(()=>Re(B),[Re,B]),Y=s.useMemo(()=>Re(G),[Re,G]),{visible:se,remaining:Ne,showMore:Be}=k1(re,`${C??""}|${A?"keepers":""}|${w}`),[st,Pe]=s.useState(null);s.useEffect(()=>{if(!st||Ne<=0)return;const Xe=st.closest(".sc-home"),rt=new IntersectionObserver(nt=>{nt.some(qt=>qt.isIntersecting)&&Be()},{root:Xe,rootMargin:"200% 0px"});return rt.observe(st),()=>rt.disconnect()},[st,Ne,Be]);const Oe={key:"category",label:"Category",everyLabel:"All products",everyCount:_.length,selected:A?y6:C,onSelect:Xe=>k(Xe===y6?{bookmarked:"1",category:null}:{bookmarked:null,category:Xe}),options:[{value:y6,label:"Keepers",count:O},...Z.map(Xe=>({value:Xe.key,label:Xe.label,count:q.get(Xe.key)??0}))]},Ge=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>m("product"),children:[o.jsx(mr,{size:12})," Add product"]}),ft=h,bt=t.length>0,at=o.jsx(v2,{title:"Products",filters:o.jsx(w2,{mode:ee,group:Oe}),density:o.jsx(e2,{value:H,onChange:D}),search:_.length>=Bue&&o.jsx(_d,{value:w,onChange:y,noun:"products",total:_.length})}),Zt=Xe=>{const rt=t.find(qt=>qt.id===Xe);return rt&&rt.origin==="catalog"||Xe.startsWith("cat-")?Ee.deleteCatalogProduct(e.id,Xe):f4(e.id,Xe)},jt=()=>{const Xe=[...j.ids];Xe.length===1?tt(Xe[0]):Ke(!0)},Ft=[...j.ids],Pt=Ft.length>0&&Ft.every(Xe=>L.includes(Xe)),Tt=()=>T(jy("product",e.id,Ft,!Pt)),xe=m2(j.ids.size,Pt,"products"),Je=async()=>{if(te)return;const Xe=[...j.ids];J(!0);try{const{failed:rt,error:nt}=await Jp(Xe,Zt);await Promise.all([u(),r()]),j.retain(rt),Ke(!1),nt&&f(ln(nt,"Could not delete these products"))}finally{J(!1)}};return o.jsx(af.Provider,{value:V,children:o.jsxs(ds,{children:[o.jsxs("main",{className:"sc-looks sc-products",id:"main","data-hero":ft||void 0,onClick:j.onBlank,children:[n&&!ft&&at,!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":V,style:U,"aria-hidden":!0,children:o.jsx(Zue,{size:"grid",count:8})}),bt&&se.length>0&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your products"})}),o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":V,style:U,children:se.map(Xe=>o.jsx($$,{product:Xe,variant:"use",size:"grid",onOpen:he,href:Ea(e,Xe.id),onUse:g,bookmarked:L.includes(Xe.id),onBookmark:M,onDelete:tt,onRename:De(Xe)?void 0:Se,chosen:j.ids.has(Xe.id),batching:j.batching==="product",onPick:j.picking("product")?rt=>j.toggle("product",rt):void 0,batch:j.kind==="product"&&j.ids.has(Xe.id)?{count:j.ids.size,onAct:jt,onKeep:Tt,allKept:Pt}:null},Xe.id))}),Ne>0&&o.jsx("div",{ref:Pe,"aria-hidden":!0}),Ne>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Be,children:["Show ",Math.min(Ne,60)," more"]})}),Q&&o.jsx(Iy,{title:"Rename product",name:Q.name,maxLength:500,busy:$e,error:ke,onConfirm:Xe=>void X(Xe),onDismiss:()=>{$e||ae(null)}}),ue&&o.jsx(Xn,{label:"Delete product",title:`Delete ${ue.name}?`,body:ji("product",1),open:!0,busy:te,onOpenChange:Xe=>{!Xe&&!te&&ge(null)},onConfirm:()=>void je()}),wt&&o.jsx(Xn,{label:cs("product",j.ids.size).menu,title:`${cs("product",j.ids.size).menu}?`,body:ji("product",j.ids.size),open:!0,busy:te,onOpenChange:Xe=>{!Xe&&!te&&Ke(!1)},onConfirm:()=>void Je()})]}),ft&&o.jsx(No,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Bring in a ",o.jsx("em",{children:"product"})]}),body:"Upload a few clean shots, or import your store, and it stays exact in every image you make.",action:Ge}),bt&&se.length>0&&Y.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri products"})}),ft&&G.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Vy,{label:"Or borrow one of ours"}),at]}),n&&Y.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":V,style:U,children:Y.map(Xe=>o.jsx(T$,{product:Xe,variant:"use",size:"grid",onUse:g,onOpen:he,href:Ea(e,Xe.id),bookmarked:L.includes(Xe.id),onBookmark:M},Xe.id))}),n&&z&&o.jsx(No,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a product from its card and it stays here.",mark:Oy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>k({bookmarked:null}),children:"Browse every product"})}),n&&!z&&re.length===0&&Y.length===0&&o.jsx(y2,{noun:"products",q:w,facet:A?"Keepers":C?v1(C):null,onClearSearch:S,onClearAll:E})]}),o.jsxs("div",{className:"sc-wall-dock",children:[j.kind==="product"&&j.ids.size>0&&o.jsx(Fy,{count:j.ids.size,loaded:se.length,tool:cs("product",j.ids.size).tool,icon:cs("product",j.ids.size).icon,danger:!0,onAct:jt,keep:{label:xe.tool,filled:Pt,onAct:Tt},onClear:j.clear,onSelectAll:()=>j.selectAll("product",se.map(Xe=>Xe.id))}),o.jsx(Hy,{})]})]})})}function Wue({refs:e,cap:t,note:n,addLabel:r,busy:a,onAdd:i,onPromote:l,onRemove:u}){const[f,h]=s.useState(null),p=s.useMemo(()=>e.find(A=>A.file===f)??e[0],[e,f]);s.useEffect(()=>{var A;e.length&&!e.some(L=>L.file===f)&&h(((A=e[0])==null?void 0:A.file)??null)},[e,f]);const g=p?e.findIndex(A=>A.file===p.file):-1,m=!!l&&g>0,w=!!u&&!!p&&e.length>1,y=!!(r&&i&&e.length>0),b=e.length>1||y,{shellRef:k,railRef:S,page:E}=_L(e.length),C=A=>{const L=A==null?void 0:A[0];L&&(i==null||i(L))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-refstage",children:p?o.jsx("div",{className:"sc-refstage-frame",children:o.jsx("img",{src:p.url,alt:""})}):i?o.jsxs("label",{className:"sc-refstage-blank sc-refstage-drop","data-busy":a||void 0,onDragOver:A=>{A.preventDefault(),A.dataTransfer.dropEffect="copy"},onDrop:A=>{A.preventDefault(),C(A.dataTransfer.files)},children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:A=>{C(A.target.files),A.target.value=""}}),a?o.jsx(Pr,{size:"2"}):o.jsx(mr,{size:22,weight:"bold"}),o.jsx("span",{children:"Add a reference"})]}):o.jsx("span",{className:"sc-refstage-blank",children:o.jsx(Da,{size:22})})}),b&&o.jsxs("div",{className:"sc-refrail-shell",ref:k,children:[o.jsxs("div",{className:"sc-refrail-track",children:[o.jsx("button",{type:"button",className:"sc-refrail-arrow prev","aria-label":"Previous references",onClick:()=>E(-1),children:o.jsx(Ta,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-refrail-arrow next","aria-label":"Next references",onClick:()=>E(1),children:o.jsx(Nl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-refrail",ref:S,children:e.map((A,L)=>o.jsx("button",{type:"button",className:"sc-refrail-item","data-on":(p==null?void 0:p.file)===A.file?"":void 0,"data-spare":L>=t?"":void 0,"aria-label":`Reference ${L+1}`,"aria-pressed":(p==null?void 0:p.file)===A.file,onClick:()=>h(A.file),children:o.jsx("img",{src:A.url,alt:"",loading:"lazy"})},A.file))})]}),y&&o.jsxs("label",{className:"sc-refrail-item sc-refrail-add","data-busy":a||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:A=>{C(A.target.files),A.target.value=""}}),a?o.jsx(Pr,{size:"1"}):o.jsx(mr,{size:16,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:r})]})]}),(m||w)&&o.jsx("div",{className:"sc-refacts",children:o.jsxs("span",{className:"sc-refacts-pair",children:[m&&o.jsxs("button",{type:"button",className:"sc-refact sc-refact-lead",onClick:()=>l==null?void 0:l(p.file),children:[o.jsx(cF,{size:14,weight:"bold"}),"Use first"]}),w&&o.jsx("button",{type:"button",className:"sc-refact sc-refact-aside",onClick:()=>u==null?void 0:u(p.file),children:"Remove"})]})}),o.jsx("p",{className:"sc-lookpage-note",children:n})]})}function Kue({value:e,onChange:t,onBlur:n,label:r,placeholder:a,className:i="sc-lookpage-titleedit"}){const l=s.useRef(null),u=f=>{f&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)};return s.useEffect(()=>u(l.current),[e]),o.jsx("textarea",{ref:l,className:i,rows:1,dir:"auto","aria-label":r,placeholder:a,value:e,onChange:f=>{u(f.currentTarget),t(f.target.value)},onBlur:n,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),f.currentTarget.blur())}})}function Gue({value:e,onChange:t}){const n=v1(e)??"Other",r=e&&g1.some(a=>a.key===e)?e:"other";return o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-pdetails-field sc-catpick","aria-label":`Category: ${n}`,children:[n,o.jsx(xl,{size:11,weight:"bold"})]})}),o.jsx(As,{align:"center",sideOffset:8,children:o.jsx(Cp,{value:r,children:g1.map(a=>o.jsx(Wu,{value:a.key,onSelect:()=>t(a.key),children:a.label},a.key))})})]})}const b6='mm|cm|inches|inch|in|m|"';function V7(e){if(!e)return;const t=e.toLowerCase();return t==='"'||t==="inch"||t==="inches"?"in":t==="mm"||t==="cm"||t==="m"||t==="in"?t:void 0}function A1(e){const t=Number(e.trim().replace(",","."));return e.trim()&&Number.isFinite(t)&&t>0?String(t):""}const gf=["height","width","depth"],dv={height:"Height",width:"Width",depth:"Depth"};function D$(e){var f,h,p,g,m,w;const t={unit:"cm",height:"",width:"",depth:""},n=e.trim();if(!n||!new RegExp(b6,"i").test(n))return t;const r={},a=(y,b)=>{if(r[b])return;const k=n.match(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${b6})?\\s*(?:${y})\\b`,"i"));if(!k)return;const S=A1(k[1]);S&&(r[b]={value:S,unit:V7(k[2])})};a("tall|high","height"),a("across|wide","width"),a("long","width"),a("deep","depth");const i=gf.filter(y=>r[y]);if(i.length){const y=new Set(i.map(b=>{var k;return(k=r[b])==null?void 0:k.unit}).filter(b=>!!b));return y.size>1?t:{unit:[...y][0]??"cm",height:((f=r.height)==null?void 0:f.value)??"",width:((h=r.width)==null?void 0:h.value)??"",depth:((p=r.depth)==null?void 0:p.value)??""}}const l=[];for(const y of n.matchAll(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${b6})?`,"gi"))){const b=A1(y[1]);b&&l.push({value:b,unit:V7(y[2])})}if(!l.length)return t;const u=l.map(y=>y.unit).filter(y=>!!y);return!u.length||new Set(u).size>1?t:{unit:u[u.length-1],height:((g=l[0])==null?void 0:g.value)??"",width:((m=l[1])==null?void 0:m.value)??"",depth:((w=l[2])==null?void 0:w.value)??""}}function Yue(e){const t=D$(e),n=gf.flatMap(i=>t[i]?[`${dv[i]} ${t[i]} ${t.unit}`]:[]);if(n.length)return n;const r=e.trim();if(!r)return[];const a=r.replace(/^about\s+/i,"");return[a.charAt(0).toUpperCase()+a.slice(1)]}const que={height:"tall",width:"across",depth:"deep"};function Xue(e){return gf.map(t=>{const n=A1(e[t]);return n?`${n} ${e.unit} ${que[t]}`:""}).filter(Boolean).join(" and ")}function Que(e,t){return gf.every(n=>A1(e[n])===A1(t[n]))}function Jue({size:e,category:t,busy:n,error:r,onSave:a,onDismiss:i}){const l=t??"other",u=(e==null?void 0:e.text)??"",[f]=s.useState(()=>D$(u)),[h,p]=s.useState(f),[g,m]=s.useState(l),w=(S,E)=>S.trim().toLowerCase()===E.trim().toLowerCase(),y=Que(h,f)?u:Xue(h),b=()=>{if(!n){if(w(y,u)&&g===l)return i();a({size:y,category:g})}},k=(e==null?void 0:e.by)==="person"?"Yours. Clear it to go back to the size read from its photo.":(e==null?void 0:e.by)==="record"?"From your store's listing.":e?"Read from its photo.":"Not read yet.";return o.jsxs(Ws,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:i,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(Ns,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ms,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Category"}),o.jsx(Gue,{value:g,onChange:m}),o.jsx("span",{className:"sc-pdetails-hint",children:"Where it is filed, so it surfaces with that kind of product."})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Size"}),o.jsx("div",{className:"sc-size",children:gf.map(S=>o.jsxs("label",{className:"sc-size-dim",children:[o.jsx("span",{className:"sc-size-name",children:dv[S]}),o.jsxs("span",{className:"sc-size-box",children:[o.jsx("input",{className:"sc-pdetails-field",inputMode:"decimal","aria-label":dv[S],value:h[S],onChange:E=>p({...h,[S]:E.target.value}),onKeyDown:E=>E.key==="Enter"&&b()}),o.jsx("span",{className:"sc-size-unit","aria-hidden":!0,children:h.unit})]})]},S))}),o.jsx("span",{className:"sc-pdetails-hint",children:k})]}),r&&o.jsx("p",{className:"sc-assetform-err",children:r})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:i,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-busy":n||void 0,onClick:b,children:n?"Saving":"Save"})]})]})}const ede=3;function tde(e){const t=e,n=(t.brand??t.vendor??"").trim();return!n||e.name.toLowerCase().startsWith(n.toLowerCase())?null:n}function nde(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim()}function rde(e,t){if(e.length<=t)return e;const n=e.slice(0,t+1).search(/[.!?](\s|$)/);if(n>40)return e.slice(0,n+1);const r=e.lastIndexOf(" ",t);return`${e.slice(0,r>40?r:t).trimEnd()}…`}function sde(){var Pe;const{productId:e=""}=aa(),{brand:t,products:n,productsLoaded:r,refreshProducts:a}=cn(),{demoProducts:i,demoProductsLoaded:l,applyBrand:u,refreshBrands:f}=Mn(),h=Un(),p=L$(),{push:g}=rr(),[m,w]=s.useState(!1),[y,b]=s.useState(!1),[k,S]=s.useState(null),E=s.useRef(null),C=s.useRef({}),A=s.useRef(!1),L=b2(),T=n.find(Oe=>Oe.id===e),[M,j]=s.useState(null);s.useEffect(()=>{if((T==null?void 0:T.origin)!=="catalog"){j(null);return}let Oe=!0;return Ee.libraryProduct(t.id,T.id).then(Ge=>{Oe&&j(Ge.product)}).catch(()=>{}),()=>{Oe=!1}},[t.id,T]);const P=M&&T&&M.id===T.id?{...M,...T,shots:M.shots}:T,R=s.useMemo(()=>P?void 0:i.find(Oe=>Oe.id===e),[P,i,e]);qc((Pe=P??R)==null?void 0:Pe.name);const[H,D]=s.useState([]);s.useEffect(()=>{if(!R){D([]);return}let Oe=!0;return Ee.demoProductFrames(R.id).then(Ge=>{Oe&&D(Ge.frames)}).catch(()=>{Oe&&D([])}),()=>{Oe=!1}},[R==null?void 0:R.id]);const U=s.useRef(R==null?void 0:R.id);U.current=R==null?void 0:R.id,p2(()=>{const Oe=R==null?void 0:R.id;Oe&&Ee.demoProductFrames(Oe).then(Ge=>{U.current===Oe&&D(ft=>xi(ft,Ge.frames))}).catch(()=>{})});const[V,B]=s.useState((P==null?void 0:P.name)??"");s.useEffect(()=>{B((P==null?void 0:P.name)??"")},[P==null?void 0:P.id]);const G=Zy(t.id,[e??""]),[_,O]=s.useState(null),[I,K]=s.useState(!1),[z,q]=s.useState(!1),[Z,ee]=s.useState(null),he=!!(P??R);s.useEffect(()=>{if(O(null),!he||!e)return;let Oe=!0;return Ee.productSize(t.id,e).then(Ge=>{Oe&&O(Ge.size)}).catch(()=>{}),()=>{Oe=!1}},[t.id,e,he]);const ue=async Oe=>{if(!e)return!1;const Ge=L();q(!0),ee(null);try{const ft=await Ee.setProductSize(t.id,e,Oe);return Ge()&&(O(ft.size),K(!1)),!0}catch(ft){return ee(String(ft.message??ft)),!1}finally{q(!1)}},ge=((P==null?void 0:P.origin)??"manual")==="manual",te=async(Oe,Ge)=>{Ge&&Oe&&typeof Oe=="object"&&"json"in Oe?u(Oe):await a()},J=Oe=>{if(!P||A.current)return;C.current={...C.current,...Oe},E.current&&clearTimeout(E.current);const Ge=t.id,ft=P.id,bt=ge;E.current=setTimeout(()=>{E.current=null;const at=C.current;C.current={},(bt?Ee.updateProduct(Ge,ft,at):Ee.updateCatalogProduct(Ge,ft,at)).then(jt=>te(jt,bt)).catch(jt=>S(String(jt.message??jt)))},500)},Q=async Oe=>{const Ge=(_==null?void 0:_.text)??"",ft=Oe.size.trim().toLowerCase()!==Ge.trim().toLowerCase();ft&&!await ue(Oe.size)||(Oe.category!==(wt??"other")&&J({category:Oe.category}),ft||K(!1))},ae=async Oe=>{const Ge=ge;w(!0),S(null);try{await te(await Oe,Ge)}catch(ft){S(String(ft.message??ft))}finally{w(!1)}},$e=async()=>{if(!P||A.current)return;A.current=!0,E.current&&clearTimeout(E.current),E.current=null,C.current={};const Oe=L(),Ge=td(t),ft=P.origin==="catalog"||P.id.startsWith("cat-");b(!0),S(null);try{ft?(await Ee.deleteCatalogProduct(t.id,P.id),await a()):u(await f4(t.id,P.id))}catch(bt){if((bt==null?void 0:bt.status)!==404){A.current=!1,Oe()&&(S(String(bt.message??bt)),b(!1));return}await Promise.all([f(),a()])}Oe()&&h(Ge,{replace:!0})};if(!P&&!R&&(!l||!r))return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-refskeleton sc-wait-late","aria-hidden":!0,children:[o.jsx("span",{className:"sc-refskeleton-title"}),o.jsx("span",{className:"sc-refskeleton-stage"}),o.jsxs("span",{className:"sc-refskeleton-rail",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]})]}),o.jsx("p",{className:"sc-vh",role:"status",children:"Loading this product"})]})});if(!P&&!R)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This product isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Vn,{className:"sc-btn sc-btn-primary",to:td(t),children:"Browse products"})})]})});const ie=R?"none":ge?"full":"fields",ke=P??R,ze=(P==null?void 0:P.id)??R.id,wt=P?ry(P):(R==null?void 0:R.category)??null,Ke=tde(ke),tt=Oe=>{const Ge=Jr(Oe.file);return Ge?[{file:Oe.file,url:Ge,angle:Oe.angle}]:[]},De=R?H.map(Oe=>({file:Oe.angle,url:Oe.url,angle:Oe.angle})):((P==null?void 0:P.shots)??[]).flatMap(tt),Se=Oe=>{const Ge=De.map(bt=>bt.file),ft=Ge.indexOf(Oe)+1;ae(Ee.setProductShots(t.id,ze,Ge.filter(bt=>bt!==Oe))).then(()=>g({kind:"success",title:"Reference removed",detail:`Reference ${ft} of ${Ge.length}`,action:{label:"Undo",onClick:()=>void ae(Ee.setProductShots(t.id,ze,Ge))}}))},X=R?"Our reference set. Yours replaces it.":De.length===0?ge?"No reference yet.":"No reference yet. Images from your store are still arriving.":De.length===1?"One angle. A shot has to guess at every side it can't see.":De.length===2?"Two angles. A third pins the shape.":"The first three build every shot. Remove any that show a different colour or version.",je=ie==="none"?null:"Add image",Re=P!=null&&P.descriptionHtml?rde(nde(P.descriptionHtml),200):"",re=(R==null?void 0:R.description)||Re||null,Y=Yue((_==null?void 0:_.text)??""),se=R?[R.subcategory]:[P==null?void 0:P.variant,P==null?void 0:P.material,Y.length?null:P==null?void 0:P.dimensions],Ne=v1(wt),Be=se.filter(Boolean),st=R?i.filter(Oe=>Oe.id!==ze).slice(0,8):n.filter(Oe=>Oe.id!==ze).slice(0,8);return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsx(zy,{to:td(t),wall:"Products",where:R?"Scenri library":ge?"Yours":"From your store"}),Ke&&o.jsx("p",{className:"sc-lookpage-house",children:o.jsx("em",{className:"sc-accent",children:Ke})}),ie==="full"?o.jsx(Kue,{label:"Product name",value:V,onChange:Oe=>{B(Oe),J({name:Oe})}}):o.jsx("h1",{dir:"auto",children:ke.name}),(Ne||Y.length>0)&&o.jsxs("div",{className:"sc-lookpage-marks",children:[Ne&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:o.jsx("li",{className:"sc-chip","data-static":!0,children:Ne})}),Y.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Size",children:Y.map(Oe=>o.jsx("li",{className:"sc-chip","data-static":!0,children:Oe},Oe))})]}),re&&o.jsx("p",{className:"sc-lookpage-lede",children:re}),Be.length>0&&o.jsx("p",{className:"sc-lookpage-facts",children:Be.join(" · ")}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>p(ze),children:"Use in a shot"}),o.jsx(By,{kind:"product",brandId:t.id,id:ze}),ie!=="none"&&o.jsx(hr,{label:"Edit details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit details","aria-haspopup":"dialog",onClick:()=>{ee(null),K(!0)},children:o.jsx(Ad,{size:17})})})]}),k&&o.jsx("p",{className:"sc-assetform-err",children:k}),o.jsx(Wue,{refs:De,cap:ede,note:X,addLabel:je,busy:m,onAdd:ie==="none"?void 0:Oe=>void ae(sY(t.id,ze,Oe)),onPromote:ie==="none"?void 0:Oe=>void ae(Ee.setProductShots(t.id,ze,[Oe,...De.map(Ge=>Ge.file).filter(Ge=>Ge!==Oe)])),onRemove:ie==="none"?void 0:Se}),G.length>0&&o.jsx(od,{label:`Shots featuring ${ke.name}`,children:G.map(Oe=>o.jsx(ty,{node:Oe,to:Bm(t,null,Oe.id)},Oe.id))}),st.length>0&&o.jsx(od,{label:R?"Other products in the library":"Other products",children:st.map(Oe=>R?o.jsx(T$,{product:Oe,variant:"navigate",size:"slider",onOpen:Ge=>h(Ea(t,Ge)),href:Ea(t,Oe.id)},Oe.id):o.jsx($$,{product:Oe,variant:"navigate",size:"slider",onOpen:Ge=>h(Ea(t,Ge)),href:Ea(t,Oe.id)},Oe.id))}),I&&o.jsx(Jue,{size:_,category:wt,busy:z,error:Z,onSave:Oe=>void Q(Oe),onDismiss:()=>K(!1)}),P&&o.jsx("div",{className:"sc-ownedbits",children:o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Xn,{label:"Delete product",title:`Delete ${P.name}?`,body:ji("product",1),busy:y,onConfirm:()=>void $e()})})})]})})}function ade(e,t){const n=new Map(e);let r=0,a=0,i=0;const l=[];for(const f of t){n.set(f.id,f.status);const h=e.get(f.id);if(h!==f.status){if(h===void 0){f.status==="running"&&(r+=1);continue}f.status==="done"?a+=1:f.status==="error"?l.push(f.error):f.status==="cancelled"&&(i+=1)}}const u=[];return r&&u.push(r===1?"Generating shot.":`Generating ${r} shots.`),a&&u.push(a===1?"Shot ready.":`${a} shots ready.`),l.length===1?u.push(`Shot failed${l[0]?`: ${l[0]}`:"."}`):l.length&&u.push(`${l.length} shots failed.`),i&&u.push(i===1?"Shot cancelled.":`${i} shots cancelled.`),{messages:u,next:n}}const ode=[{label:"Generate",keys:["cmd","enter"]},{label:"Jump to the prompt",keys:["/"]},{label:"Product menu",keys:["$"]},{label:"Place menu",keys:["/"]},{label:"Person menu",keys:["@"]},{label:"Colour menu",keys:["#"]},{label:"Previous or next shot",keys:["←","→"]},{label:"Previous or next in the history",keys:["↑","↓"]},{label:"Refine this shot",keys:["b"]},{label:"Keep or unkeep",keys:["k"]},{label:"Open the shot",keys:["enter"]},{label:"Close, or stop refining",keys:["esc"]},{label:"Assets panel",keys:["."]},{label:"This list",keys:["?"]}];function ide({open:e,onOpenChange:t}){return o.jsx(Nw,{open:e,onOpenChange:t,children:o.jsxs(Mw,{maxWidth:"360px","aria-describedby":void 0,children:[o.jsx(Rw,{children:"Shortcuts"}),o.jsx("div",{className:"sc-keys",children:ode.map(n=>o.jsxs("div",{className:"sc-krow",children:[o.jsx("span",{children:n.label}),o.jsx("span",{className:"sc-ksp"}),n.keys.map(r=>o.jsx("kbd",{children:r},r))]},n.label))})]})})}function Jy({img:e,ready:t,index:n=0,since:r,onDone:a}){const i=s.useRef(null),[l,u]=s.useState(!1);return s.useLayoutEffect(()=>{const f=i.current;if(!f||t)return;const h=R4(f,W0(f),n,null),p=f.getBoundingClientRect();h.size(p.width,p.height),h.draw(performance.now()/1e3);const g=m=>h.draw(m);return WM(g),()=>KM(g)},[t]),s.useLayoutEffect(()=>{const f=i.current,h=e.current;if(!f||!h||!t)return;const p=f.getBoundingClientRect(),g=performance.now(),m=r??g,w=OX(f,h,W0(f),n,p.width,p.height,m/1e3);let y=Math.min(w.ms,g-m);w.draw(y/w.ms);let b=g,k=requestAnimationFrame(function S(E){y+=Math.min(50,Math.max(0,E-b)),b=E;const C=Math.min(1,y/w.ms);w.draw(C),C<1?k=requestAnimationFrame(S):u(!0)});return()=>cancelAnimationFrame(k)},[t]),s.useEffect(()=>{l&&a()},[l,a]),o.jsx("canvas",{ref:i,className:"sc-arrival","aria-hidden":!0})}const x6=T4,lde=D4;function cde({src:e,fallback:t,alt:n="",aspect:r,guess:a=!0,arrival:i,index:l=0}){const[u,f]=s.useState(!1),h=u&&t?t:e,[p,g]=s.useState(!1),[m,w]=s.useState(!1),[y,b]=s.useState(()=>x6(h)),[k,S]=s.useState(h);h!==k&&(S(h),g(!1),w(!1),b(x6(h)));const E=s.useRef(null),C=s.useCallback(()=>{lde(h),g(!0)},[h]),A=s.useCallback(j=>{E.current=j,j!=null&&j.complete&&j.naturalWidth&&C()},[C]);s.useLayoutEffect(()=>{const j=E.current;j!=null&&j.complete&&j.naturalWidth&&C()},[C]);const[L,T]=s.useState(()=>!i||h1()?null:x6(h)?Z7(h)!==void 0?"run":null:"hold");L==="hold"&&p&&(H$.set(h,performance.now()),T("run"));const M=s.useCallback(()=>T(null),[]);return o.jsx("span",{className:"sc-cellimg","data-loaded":p||void 0,"data-cached":y||void 0,"data-guess":a||void 0,"data-broken":m||void 0,style:r?{"--sc-cell-ar":r}:void 0,children:m?o.jsx(Da,{className:"sc-cellimg-broken",size:24,weight:"regular","aria-hidden":!0}):o.jsxs(o.Fragment,{children:[!p&&!y&&L!=="hold"&&o.jsx("span",{className:"sc-placeholder"}),o.jsx("img",{ref:A,src:h,alt:n,loading:y?"eager":"lazy",decoding:y?"sync":"async",onLoad:()=>C(),onError:()=>{t&&!u?f(!0):w(!0)}}),L&&o.jsx(Jy,{img:E,ready:L==="run",index:l,since:Z7(h),onDone:M})]})})}const H$=new Map,Z7=e=>{const t=H$.get(e);return t!==void 0&&performance.now()-t<2e3?t:void 0};function O$({name:e}){return o.jsx(ad,{name:e})}function ude({node:e,chosen:t,picking:n,batching:r,armed:a,menu:i,onPick:l,onBranch:u,onToggleKeep:f,onArchive:h,onDelete:p}){const g=Dr(e),m=qw(),w=(b,k)=>nR(b,k,m),y=()=>{const b=e.images[0];if(!b)return;const k=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",S=document.createElement("a");S.href=Tr(b),S.download=`${k}.png`,S.click()};return o.jsxs(o.Fragment,{children:[!r&&o.jsx("span",{className:"sc-cell-veil","aria-hidden":!0}),n&&w(t?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-pick","data-on":t||void 0,"aria-pressed":t,"aria-label":t?"Deselect shot":"Select shot",onClick:()=>l==null?void 0:l(e.id),children:o.jsx(Gn,{size:13,weight:"bold"})})),a&&!n&&o.jsxs("span",{className:"sc-cell-ctl sc-cell-pick","data-on":!0,title:"Being refined",children:[o.jsx(Gn,{size:13,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:"Being refined"})]}),o.jsx("div",{className:"sc-shot-tools",children:f&&o.jsxs("div",{className:"sc-corner",children:[i.length>0&&o.jsxs(Cs,{children:[w("More",o.jsx(js,{children:o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-more","aria-label":`More for ${g}`,children:o.jsx(Tv,{size:16,weight:"bold"})})})),o.jsx(As,{align:"end",sideOffset:4,collisionPadding:12,children:i.map(b=>o.jsxs("span",{style:{display:"contents"},children:[b.separated&&o.jsx(kc,{}),o.jsxs(Wn,{color:b.danger?"red":void 0,onSelect:b.onSelect,children:[o.jsx(O$,{name:b.icon}),b.label]})]},b.key))})]}),u&&!r&&w("Refine",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-branch","data-on":a||void 0,"aria-label":`Refine ${g}`,onClick:()=>u(e.id),children:o.jsx(GE,{size:15,weight:"bold"})})),e.images[0]&&w("Download",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Download ${g}`,onClick:y,children:o.jsx(ME,{size:15})})),e.archived?p&&w("Delete permanently",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Delete ${g} permanently`,onClick:()=>p(e),children:o.jsx(Ml,{size:15})})):h&&w("Archive",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Archive ${g}`,onClick:()=>h(e),children:o.jsx(fm,{size:15})})),w(e.kept?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:`sc-cell-ctl sc-cell-keep${e.kept?" sc-cell-star":""}`,"data-on":e.kept||void 0,"aria-pressed":e.kept,"aria-label":e.kept?`Remove ${g} from Keepers`:`Add ${g} to Keepers`,onClick:()=>f(e),children:o.jsx(eo,{size:15,weight:e.kept?"fill":"regular"})}))]})})]})}function I$(e,t){return e>1?`Remove ${e} shots from ${t}`:`Remove from ${t}`}function Kh(e,t,n){return e>1?n(e):t}function dde(e,{chosen:t,batching:n,versions:r,onOpen:a,onBranch:i,onPick:l,onVersions:u,onToggleKeep:f,onArchive:h,onDeletePermanently:p,shotHref:g,inSet:m,filedIn:w,onRemoveFromSet:y,batch:b}){const k=[{key:"open",icon:"open",label:"Open",onSelect:()=>a(e.id)}];g&&k.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(g(e.id),"_blank")}),i&&!n&&k.push({key:"branch",icon:"refine",label:"Refine",onSelect:()=>i(e.id)});const S=!!(n&&t&&b&&b.count>0),E=!!(S&&b&&b.count>1);l&&k.push({key:"pick",icon:"select",label:t?E?"Deselect this shot":"Deselect":"Select",onSelect:()=>l(e.id)});const C=M=>M?"Remove from Keepers":"Add to Keepers",A=(M,j)=>M?`Remove ${j} shots from Keepers`:`Add ${j} shots to Keepers`;S&&b?k.push({key:"keep",icon:b.allKept?"kept":"keep",label:Kh(b.count,C(b.allKept),M=>A(b.allKept,M)),onSelect:b.onKeep,separated:E}):f&&k.push({key:"keep",icon:e.kept?"kept":"keep",label:C(e.kept),onSelect:()=>f(e)});const L=S?b==null?void 0:b.onRemoveFromSet:y,T=S?m?[m]:[]:m?[m]:w??[];if(L)for(const M of T)k.push({key:`unset-${M.id}`,icon:"unset",label:I$(S&&b?b.count:1,M.name),onSelect:()=>L(M)});return r>0&&u&&!n&&k.push({key:"versions",icon:"versions",label:`Show ${r} version${r===1?"":"s"}`,onSelect:()=>u(e.id)}),S&&b?(k.push({key:"archive",icon:b.archived?"restore":"archive",label:b.archived?Kh(b.count,"Restore",M=>`Restore ${M} shots`):Kh(b.count,"Archive",M=>`Archive ${M} shots`),onSelect:b.archived?b.onRestore:b.onArchive,danger:!b.archived,separated:!0}),b.archived&&k.push({key:"delete",icon:"delete",label:Kh(b.count,"Delete permanently",M=>`Delete ${M} shots permanently`),onSelect:b.onDelete,danger:!0,separated:!0})):(h&&k.push({key:"archive",icon:e.archived?"restore":"archive",label:e.archived?"Restore":"Archive",onSelect:()=>h(e),danger:!e.archived,separated:!0}),p&&e.archived&&k.push({key:"delete",icon:"delete",label:"Delete permanently",onSelect:()=>p(e),danger:!0,separated:!0})),k}function F$(e,t){var r,a,i,l;const n=(i=(a=(r=e.brief)==null?void 0:r.rendered)==null?void 0:a.sizes)==null?void 0:i[t];return n&&n[0]>0&&n[1]>0?{aspect:n[0]/n[1],guess:!1}:{aspect:gi((l=e.brief)==null?void 0:l.format),guess:!0}}const fde=s.memo(function({node:t,selected:n,armed:r,chosen:a,picking:i,batching:l,versions:u,handlers:f,inSet:h,filedIn:p,pickedMeta:g}){const m=dde(t,{chosen:a,batching:l,versions:u,onOpen:f.onOpen,shotHref:f.shotHref,onBranch:f.onBranch,onPick:f.onPick,onVersions:f.onVersions,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDeletePermanently:f.onDeleteAsk,inSet:h,filedIn:p,onRemoveFromSet:f.onRemoveFromSet?w=>{var y;return(y=f.onRemoveFromSet)==null?void 0:y.call(f,t,w)}:void 0,batch:l&&a&&g&&f.onKeepPicked?{...g,onKeep:f.onKeepPicked,onArchive:f.onArchivePicked??(()=>{}),onRestore:f.onRestorePicked??(()=>{}),onDelete:f.onDeletePickedAsk??(()=>{}),onRemoveFromSet:f.onRemovePickedFromSet}:null});return o.jsxs(X1,{children:[o.jsx(Q1,{children:o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-selected":n,"data-armed":r||void 0,"data-batching":l||void 0,"data-picked":a||void 0,children:[o.jsx(Vn,{className:"sc-cell-open",to:f.shotHref(t.id),"aria-label":l?`${a?"Deselect":"Select"} ${Dr(t)}`:`Open ${Dr(t)}`,onClick:w=>{var y;l&&(w.preventDefault(),(y=f.onPick)==null||y.call(f,t.id))},children:o.jsx(cde,{src:gn(t.images[0],"tile"),fallback:Tr(t.images[0]),arrival:hde(t),index:t.batchIndex,...F$(t,0)})}),o.jsx(ude,{node:t,chosen:a,picking:i,batching:l,armed:r,menu:m,onPick:f.onPick,onBranch:f.onBranch,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDelete:f.onDeleteAsk})]})}),o.jsx(J1,{children:m.map(w=>o.jsxs("span",{style:{display:"contents"},children:[w.separated&&o.jsx(Vm,{}),o.jsxs(ef,{color:w.danger?"red":void 0,onSelect:w.onSelect,children:[o.jsx(O$,{name:w.icon}),w.label]})]},w.key))})]})});function hde(e){const t=Ya(qa(e));return Number.isFinite(t)&&Date.now()-(t+(e.durationMs??0))<9e4}const pde=s.memo(function({node:t,selected:n,shotHref:r,onCancel:a}){var i;return o.jsxs("div",{className:"sc-cell","data-running":"true","data-fb-node":t.id,"data-selected":n,style:{"--sc-cell-ar":gi((i=t.brief)==null?void 0:i.format)},children:[o.jsxs(Vn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Dr(t)}, still rendering`,children:[o.jsx(La,{index:t.batchIndex,since:qa(t)}),o.jsx(OL,{since:qa(t)})]}),a&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-cancel",onClick:()=>a(t),children:"Cancel"})]})}),mde=s.memo(function({node:t,selected:n,shotHref:r,engineName:a,onRetry:i,onArchive:l}){var h;const u=t.status==="cancelled",f=u?wM():co(t.error,a==null?void 0:a(t.engineId));return o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-cancelled":u||void 0,"data-failed":!u||void 0,"data-selected":n,style:(h=t.brief)!=null&&h.format?{"--sc-cell-ar":gi(t.brief.format)}:void 0,children:[o.jsx(Vn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Dr(t)}`}),o.jsx("span",{className:"sc-cell-failed",children:o.jsx(lM,{failure:f,density:"tile",onRetry:()=>i(t),dismiss:l?{label:t.archived?"Restore":"Dismiss",onClick:()=>l(t)}:void 0})})]})}),gde=40,vde=1,z7=64,wde=e=>e>gde,yde=e=>Math.floor(e/z7)*z7,bde=112;function Gh(e,t,n){const r=Math.max(0,n-2),a=t&&t>0?t:4/5,i=Math.round(r/a)+2;return(e==="failed"&&n<=200?Math.max(i,bde):i)+sd}function B7(e){const t=new Array(e.length+1);let n=0;for(let r=0;r<e.length;r++)t[r]=n,n+=e[r];return t[e.length]=n,t}function xde(e,t,n){const r=e.length-1;if(r<=0||n<=t)return[0,0];let a=0,i=r;for(;a<i;){const u=a+i>>1;e[u+1]<=t?a=u+1:i=u}const l=a;for(a=l,i=r;a<i;){const u=a+i>>1;e[u]<n?a=u+1:i=u}return[l,a]}function U7(e,t){const n=Array.from({length:Math.max(1,t)},()=>[]);for(let r=0;r<e;r++)n[r%n.length].push(r);return n}function kde(e,t){const n=t*vde;return[e-n,e+t+n]}function eb(e){const t=e.getBoundingClientRect().top,n=e.querySelector(".sc-toolbar");return n?Math.max(t,n.getBoundingClientRect().bottom):t}function Sde(e,t){const[n,r]=s.useState(()=>({top:0,height:typeof window>"u"?0:window.innerHeight})),a=s.useRef(null),i=s.useRef(null),l=s.useRef((h,p=0)=>{i.current=h?{anchor:h,until:p}:null}).current,u=s.useRef(()=>{}),f=s.useRef(()=>u.current()).current;return s.useLayoutEffect(()=>{if(!e)return;const h=e.closest(".sc-canvas");if(!h)return;let p=0,g=0;const m=()=>{var S;const k=i.current;if(k&&performance.now()<k.until){a.current=k.anchor;return}i.current=null,a.current=h.scrollTop>0?Ede(e,eb(h),(S=a.current)==null?void 0:S.id):null},w=()=>{if(p=0,t){const k=e.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop,S={top:yde(h.scrollTop-k),height:h.clientHeight};r(E=>E.top===S.top&&E.height===S.height?E:S)}m(),cancelAnimationFrame(g),g=requestAnimationFrame(m)},y=()=>{p||(p=requestAnimationFrame(w))};u.current=w,w(),h.addEventListener("scroll",y,{passive:!0});const b=new ResizeObserver(y);return b.observe(h),b.observe(e),()=>{cancelAnimationFrame(p),cancelAnimationFrame(g),u.current=()=>{},h.removeEventListener("scroll",y),b.disconnect()}},[e,t]),{...n,anchor:a,resync:f,hold:l}}function Ede(e,t,n){let r=null,a=null;for(const l of e.querySelectorAll(".sc-cell[data-fb-node]")){const u=l.getBoundingClientRect();if(u.bottom<=t||u.height===0)continue;const f=l.getAttribute("data-fb-node");if(!f)continue;const h={id:f,top:u.top,left:u.left};if(u.top>=t-1){const p=!!r&&Math.abs(u.top-r.top)<=1;(!r||u.top<r.top-1||p&&r.id!==n&&(f===n||u.left<r.left))&&(r=h)}else(!a||u.left<a.left)&&(a=h)}const i=r??a;return i?{id:i.id,offset:i.top-t}:null}function Cde(e,t,n){const r=s.useRef(new Map),[,a]=s.useState(0),i=s.useRef(null),l=s.useRef(new Set);return s.useLayoutEffect(()=>{if(!t)return;let u=0;const f=new ResizeObserver(h=>{let p=!1;for(const g of h){const m=g.target.getAttribute("data-fb-node");if(!m)continue;const w=g.target;if(w.offsetHeight<=2||w.offsetWidth<=2)continue;const y=(w.offsetHeight-2)/(w.offsetWidth-2),b=r.current.get(m);(b===void 0||Math.abs(b-y)>.004)&&(r.current.set(m,y),p=!0)}p&&!u&&(u=requestAnimationFrame(()=>{u=0,a(g=>g+1)}))});return i.current=f,()=>{cancelAnimationFrame(u),f.disconnect(),i.current=null,l.current=new Set}},[t]),s.useLayoutEffect(()=>{const u=i.current;if(!(!t||!u||!e)){for(const f of l.current)f.isConnected||(u.unobserve(f),l.current.delete(f));for(const f of e.querySelectorAll(".sc-cell[data-fb-node]"))l.current.has(f)||(l.current.add(f),u.observe(f))}}),s.useCallback(u=>{const f=r.current.get(u);return f===void 0?void 0:Math.round(f*Math.max(0,n-2))+2+sd},[n])}function jde({nodes:e,selectedId:t,onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onDeletePermanently:f,picked:h,onPick:p,empty:g,sending:m,onBranch:w,branchingFrom:y,onVersions:b,engineName:k,tile:S,pending:E,onNearEnd:C,inSet:A,setsFor:L,onRemoveFromSet:T,onKeepPicked:M,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H}){const D=e.filter(Y=>Y.kind!=="root"),U=!!p,V=U&&((h==null?void 0:h.size)??0)>0,B=s.useMemo(()=>{if(!h||h.size===0)return null;let Y=0,se=0,Ne=0;for(const Be of e)!h.has(Be.id)||Be.kind==="root"||(Y+=1,Be.kept&&(se+=1),Be.archived&&(Ne+=1));return{count:h.size,allKept:Y>0&&se===Y,archived:Y>0&&Ne===Y}},[e,h]),[G,_]=s.useState(null),[O,I]=s.useState(!1),[K,z]=s.useState(null),{tile:q,cols:Z}=mQ(hQ(K),S,pQ()<uQ),[ee,he]=s.useState(null);s.useEffect(()=>{if(!ee||!C)return;const Y=ee.closest(".sc-canvas"),se=new IntersectionObserver(Ne=>{Ne.some(Be=>Be.isIntersecting)&&C()},{root:Y,rootMargin:"200% 0px"});return se.observe(ee),()=>se.disconnect()},[ee,C]);const ue=s.useRef({onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:k,onRemoveFromSet:T,onKeepPicked:M,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H});ue.current={onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:k,onRemoveFromSet:T,onKeepPicked:M,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H};const ge=!!f,te=!!R,J=s.useMemo(()=>({onOpen:Y=>ue.current.onOpen(Y),shotHref:Y=>ue.current.shotHref(Y),onRetry:Y=>ue.current.onRetry(Y),onCancel:i?Y=>{var se,Ne;return(Ne=(se=ue.current).onCancel)==null?void 0:Ne.call(se,Y)}:void 0,onToggleKeep:l?Y=>{var se,Ne;return(Ne=(se=ue.current).onToggleKeep)==null?void 0:Ne.call(se,Y)}:void 0,onArchive:u?Y=>{var se,Ne;return(Ne=(se=ue.current).onArchive)==null?void 0:Ne.call(se,Y)}:void 0,onBranch:w?Y=>{var se,Ne;return(Ne=(se=ue.current).onBranch)==null?void 0:Ne.call(se,Y)}:void 0,onPick:p?Y=>{var se,Ne;return(Ne=(se=ue.current).onPick)==null?void 0:Ne.call(se,Y)}:void 0,onVersions:b?Y=>{var se,Ne;return(Ne=(se=ue.current).onVersions)==null?void 0:Ne.call(se,Y)}:void 0,onDeleteAsk:ge?Y=>_(Y):void 0,engineName:k?Y=>{var se,Ne;return(Ne=(se=ue.current).engineName)==null?void 0:Ne.call(se,Y)}:void 0,onRemoveFromSet:T?(Y,se)=>{var Ne,Be;return(Be=(Ne=ue.current).onRemoveFromSet)==null?void 0:Be.call(Ne,Y,se)}:void 0,onKeepPicked:M?()=>{var Y,se;return(se=(Y=ue.current).onKeepPicked)==null?void 0:se.call(Y)}:void 0,onArchivePicked:j?()=>{var Y,se;return(se=(Y=ue.current).onArchivePicked)==null?void 0:se.call(Y)}:void 0,onRestorePicked:P?()=>{var Y,se;return(se=(Y=ue.current).onRestorePicked)==null?void 0:se.call(Y)}:void 0,onDeletePickedAsk:te?()=>I(!0):void 0,onRemovePickedFromSet:H?Y=>{var se,Ne;return(Ne=(se=ue.current).onRemovePickedFromSet)==null?void 0:Ne.call(se,Y)}:void 0}),[!!i,!!l,!!u,!!w,!!p,!!b,ge,te,!!k,!!T,!!M,!!j,!!P,!!H]),Q=[...m?Array.from({length:Math.max(1,m.count)},(Y,se)=>({key:`sending-${se}`,node:null,said:m.said,slot:se})):[],...D.map(Y=>({key:Y.id,node:Y}))],ae=Y=>Y.status==="cancelled"||Y.status==="error"||Y.images.length===0,$e=Y=>{const se=Y.node;return se?se.status==="running"?o.jsx(pde,{node:se,selected:se.id===t,shotHref:J.shotHref,onCancel:J.onCancel},se.id):ae(se)?o.jsx(mde,{node:se,selected:se.id===t,shotHref:J.shotHref,engineName:J.engineName,onRetry:J.onRetry,onArchive:J.onArchive},se.id):o.jsx(fde,{node:se,selected:se.id===t,armed:se.id===y,chosen:(h==null?void 0:h.has(se.id))??!1,picking:U,batching:V,versions:se.childCount,handlers:J,inSet:A,filedIn:L==null?void 0:L(se.id),pickedMeta:B},se.id):o.jsxs("div",{className:"sc-cell","data-running":"true","data-sending":"true",style:m!=null&&m.format?{"--sc-cell-ar":gi(m.format)}:void 0,children:[o.jsx(La,{index:Y.slot,appear:!0}),o.jsx("span",{className:"sc-cell-tag",children:"sending"}),o.jsx("span",{className:"sc-cell-said",dir:"auto",children:Y.said})]},Y.key)},ie=Y=>{var Ne,Be;const se=Y.node;return se?se.status==="running"?Gh("running",gi((Ne=se.brief)==null?void 0:Ne.format),q):ae(se)?Gh("failed",(Be=se.brief)!=null&&Be.format?gi(se.brief.format):3/2,q):Gh("done",F$(se,0).aspect,q):Gh("sending",void 0,q)},ke=wde(Q.length),ze=Sde(K,ke),wt=Cde(K,ke,q),Ke=ok(Z),tt=`${Ke}:${q}`,De=s.useRef(tt),Se=s.useRef({items:Q,heightOf:wt,estimate:ie});Se.current={items:Q,heightOf:wt,estimate:ie};const X=s.useRef(null);if(s.useLayoutEffect(()=>{const Y=De.current;De.current=tt;const se=ze.anchor.current,Ne=K==null?void 0:K.closest(".sc-canvas");if(!(Y===tt||!se||!K||!Ne)){if(X.current={anchor:se,until:performance.now()+Ade},ze.hold(se,X.current.until),!W7(K,Ne,se)){const{items:Be,heightOf:st,estimate:Pe}=Se.current,Oe=Be.findIndex(at=>{var Zt;return((Zt=at.node)==null?void 0:Zt.id)===se.id});if(Oe<0)return;const Ge=U7(Be.length,Ke)[Oe%Ke],ft=B7(Ge.map(at=>(Be[at].node&&st(Be[at].node.id))??Pe(Be[at]))),bt=K.getBoundingClientRect().top+ft[Math.floor(Oe/Ke)];Ne.scrollTop+=bt-eb(Ne)-se.offset}ze.resync()}},[tt,Ke,K,ze.anchor,ze.resync,ze.hold]),s.useLayoutEffect(()=>{const Y=X.current,se=K==null?void 0:K.closest(".sc-canvas");if(!(!Y||!K||!se)){if(performance.now()>Y.until){X.current=null;return}W7(K,se,Y.anchor)}}),s.useEffect(()=>{const Y=K==null?void 0:K.closest(".sc-canvas");if(!Y)return;const se=()=>{X.current=null,ze.hold(null)},Ne=["wheel","touchstart","keydown","pointerdown"];for(const Be of Ne)Y.addEventListener(Be,se,{passive:!0});return()=>{for(const Be of Ne)Y.removeEventListener(Be,se)}},[K,ze.hold]),E&&M5(D)&&!m){const Y=Math.max(1,Math.min(Z,8));return o.jsx("div",{className:"sc-feed","aria-busy":"true",ref:z,style:{"--sc-tile":`${q}px`,"--sc-cols":Y},children:Array.from({length:Y},(se,Ne)=>o.jsx("div",{className:"sc-feed-col",children:Array.from({length:2},(Be,st)=>o.jsx("div",{className:"sc-cell sc-wait-late","data-placeholder":"true",children:o.jsx("span",{className:"sc-placeholder"})},`pending-${Ne}-${st}`))},`col-${Y}-${Ne}`))})}if(M5(D)&&!m)return o.jsx(o.Fragment,{children:g??o.jsx("p",{className:"sc-feed-empty",children:"Nothing here yet."})});const je=ok(Z),Re=U7(Q.length,je),re=ke?kde(ze.top,ze.height):null;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-feed",ref:z,style:{"--sc-tile":`${q}px`,"--sc-cols":je},children:Re.map((Y,se)=>{const Ne=`col-${je}-${se}`;if(!re)return o.jsx("div",{className:"sc-feed-col",children:Y.map(Ge=>$e(Q[Ge]))},Ne);const Be=Y.map(Ge=>(Q[Ge].node&&wt(Q[Ge].node.id))??ie(Q[Ge])),st=B7(Be),[Pe,Oe]=xde(st,re[0],re[1]);return o.jsxs("div",{className:"sc-feed-col",children:[Pe>0&&o.jsx("div",{className:"sc-feed-pad",style:{height:st[Pe]},"aria-hidden":!0}),Y.slice(Pe,Oe).map(Ge=>$e(Q[Ge])),Oe<Y.length&&o.jsx("div",{className:"sc-feed-pad",style:{height:st[Y.length]-st[Oe]},"aria-hidden":!0})]},Ne)})}),C&&o.jsx("div",{className:"sc-feed-end",ref:he,"aria-hidden":!0}),o.jsx(B1,{open:!!G||O,onOpenChange:Y=>{Y||(_(null),I(!1))},children:o.jsxs(U1,{maxWidth:"420px",children:[o.jsx(W1,{children:O?`Delete ${(B==null?void 0:B.count)??0} shot${((B==null?void 0:B.count)??0)===1?"":"s"} permanently?`:"Delete this shot permanently?"}),o.jsx(K1,{size:"2",children:"This cannot be undone."}),o.jsxs(Vs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Y1,{children:o.jsx(Sa,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(G1,{children:o.jsx(Sa,{color:"red",onClick:()=>{O?R==null||R():G&&(f==null||f(G)),_(null),I(!1)},children:"Delete permanently"})})]})]})})]})}const Ade=800;function W7(e,t,n){const r=e.querySelector(`.sc-cell[data-fb-node="${CSS.escape(n.id)}"]`);if(!r)return!1;const a=r.getBoundingClientRect().top-eb(t)-n.offset;return Math.abs(a)>=1&&(t.scrollTop+=a),!0}function Nde(e){return e==="open"||e==="result"?"open":"compact"}function fv({name:e,kind:t,count:n,mode:r,onToggle:a,action:i,children:l}){const u=Nde(r);return o.jsxs("div",{className:"sc-agroup","data-mode":r,"data-kind":t,children:[o.jsxs("div",{className:"sc-agroup-h",children:[o.jsxs("button",{type:"button",className:"sc-agroup-t","aria-expanded":r==="open",onClick:a,children:[o.jsx("b",{children:e}),n!==void 0&&n>0&&o.jsx("span",{className:"sc-agroup-n",children:n}),o.jsx(xl,{size:11,className:"sc-agroup-caret","aria-hidden":"true"})]}),i]}),o.jsx("div",{className:"sc-agroup-body",children:o.jsx("div",{className:"sc-agroup-content",children:o.jsx("div",{className:"sc-agroup-layer",children:l(u)},u)})})]})}function _$({candidate:e,on:t,named:n,disabled:r,title:a,onClick:i}){const l=o.jsxs("button",{type:"button",className:"sc-acard","data-on":t||void 0,"aria-label":e.full,"aria-pressed":t,"aria-disabled":r||void 0,title:r?void 0:e.full,onClick:r?void 0:i,children:[o.jsxs("span",{className:"sc-acard-thumb",children:[e.thumb?o.jsx("img",{src:e.thumb,alt:"",loading:"lazy","data-crop":e.crop}):o.jsx("span",{className:"sc-aswatch",style:{display:"grid",placeItems:"center"},children:o.jsx(Da,{size:14})}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:10,weight:"bold"})})]}),n&&o.jsxs("span",{className:"sc-acard-label",children:[e.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(eo,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),e.label]})]});return o.jsx(SL,{why:r?a:null,children:l})}function k6({kind:e,title:t,items:n,attached:r,mode:a,onToggle:i,onPick:l,onUnpick:u,full:f,moreLabel:h,createLabel:p,onCreate:g}){const m=s.useMemo(()=>new Set(r),[r]),[w,y]=s.useState(Qp);return s.useEffect(()=>{a!=="open"&&y(Qp)},[a]),a==="result"&&n.length===0?null:o.jsx(fv,{name:t,kind:e,count:n.length,mode:a,onToggle:()=>i(e),action:o.jsx("button",{type:"button",className:"sc-aadd",title:p,"aria-label":p,onClick:g,children:o.jsx(mr,{size:10})}),children:b=>{const{visible:k,more:S}=Mie(n,m,b==="open"?w:rv);return o.jsxs("div",{className:b==="open"?"sc-acard-grid":"sc-arow",children:[k.map(E=>o.jsx(_$,{candidate:E,on:m.has(E.id),named:b==="open",disabled:!!f&&!m.has(E.id),title:f??void 0,onClick:()=>m.has(E.id)?u(E.id):l(E.id)},E.id)),b==="open"&&S>0&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:()=>y(E=>E+q0),"aria-label":`Show ${Math.min(S,q0)} more ${h}`,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",S]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})}})}const K7=220,G7="cubic-bezier(0.32, 0.72, 0, 1)";function S6(e){const t=[];for(const n of e.querySelectorAll(".sc-agroup")){const r=n.querySelector(":scope > .sc-agroup-body");r&&t.push({group:n,body:r,height:r.getBoundingClientRect().height,marginBottom:Number.parseFloat(getComputedStyle(n).marginBottom)||0})}return t}function Mde(e,t){const n=s.useRef(null),r=()=>{const a=e.current;if(!(!a||window.matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of S6(a))for(const l of[...i.body.getAnimations(),...i.group.getAnimations()])l.finish();n.current=S6(a)}};return s.useLayoutEffect(()=>{const a=n.current;n.current=null;const i=e.current;if(!(!a||!i))for(const l of S6(i)){const u=a.find(f=>f.group===l.group);if(u){if(Math.abs(u.height-l.height)>.5){const{body:f}=l;f.style.overflow="hidden";const h=f.animate([{height:`${u.height}px`},{height:`${l.height}px`}],{duration:K7,easing:G7}),p=()=>{f.style.overflow=""};h.onfinish=p,h.oncancel=p}Math.abs(u.marginBottom-l.marginBottom)>.5&&l.group.animate([{marginBottom:`${u.marginBottom}px`},{marginBottom:`${l.marginBottom}px`}],{duration:K7,easing:G7})}}},[t]),r}function Rde({brand:e,shots:t,shotsTotal:n,attached:r=RL,full:a,onToken:i,offToken:l,onTemplate:u,offTemplate:f,onClose:h}){const p=ff(),g=Zl(),{applyBrand:m}=Mn(),{push:w}=rr(),[y,b]=VG(qr.assetsExpanded,null),k=s.useRef(null),S=Mde(k,y),E=Z=>{S(),b(ee=>ee===Z?null:Z)},[C,A]=s.useState(""),L=C.trim().length>0,T=Z=>{S(),A(""),b(Z)},M=Z=>L?"result":y===null?"idle":y===Z?"open":"collapsed",j=s.useMemo(()=>new Set(Ci(e.id)),[e.id]),P=s.useMemo(()=>{const Z=ee=>{const he=pl(ee,p);return h2(ee,he,{currentId:null,query:"",bookmarked:j,shown:he.length}).items};return{product:Z("product"),presenter:Z("presenter"),scene:Z("scene")}},[p,j]),R=s.useMemo(()=>({product:dd(P.product,C),presenter:dd(P.presenter,C),scene:dd(P.scene,C)}),[P,C]),H=s.useMemo(()=>{var Z;return ra((Z=e.json)==null?void 0:Z.palette)},[e]),D=s.useMemo(()=>L?H.filter(Z=>Ho(`${Z.name} ${Z.hex}`,C)):H,[H,C,L]),U=Z=>{(async()=>{var he;const ee=jR((he=e.json)==null?void 0:he.palette,Z);if(ee.swatch){if(ee.added)try{const ue=await Ee.updateBrand(e.id,{...e.json??{},palette:ee.palette},e.json);m(ue)}catch(ue){w(ln(ue,"Could not save the brand"));return}T("colors")}})()},V=Z=>{(async()=>{var he;const ee=mJ((he=e.json)==null?void 0:he.palette,Z);if(ee.removed)try{const ue=await Ee.updateBrand(e.id,{...e.json??{},palette:ee.palette},e.json);m(ue)}catch(ue){w(ln(ue,"Could not save the brand"))}})()},B=M("shots")==="open",G=Py(e.id,"",B),_=s.useMemo(()=>{const Z=new Set,ee=[];for(const he of[...t,...G.items])he.status!=="done"||he.images.length===0||Z.has(he.id)||(Z.add(he.id),ee.push(he));return ee},[t,G.items]),O=Math.max(n??0,G.total,_.length),[I,K]=s.useState(Qp);s.useEffect(()=>{B||K(Qp)},[B]);const z=()=>{K(Z=>Z+q0),G.hasMore&&_.length<I+2*q0&&G.loadMore()},q=L&&!R.product.length&&!R.presenter.length&&!R.scene.length&&!D.length;return o.jsxs("aside",{ref:k,className:"sc-assets","aria-label":"Assets",children:[o.jsxs("div",{className:"sc-assets-head",children:[o.jsx("b",{children:"Assets"}),o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:h,"aria-label":"Close assets",style:{width:28,height:28},children:o.jsx(jn,{size:12})})]}),o.jsx("div",{className:"sc-assets-searchbar",children:o.jsxs("div",{className:"sc-assets-search",children:[o.jsx(hd,{size:12}),o.jsx("input",{value:C,onChange:Z=>A(Z.target.value),onKeyDown:Z=>{Z.key==="Escape"&&C&&(Z.stopPropagation(),A(""))},placeholder:"Search assets","aria-label":"Search assets in this panel"}),L&&o.jsx("button",{type:"button",className:"sc-assets-clear",onClick:()=>A(""),"aria-label":"Clear search",children:o.jsx(jn,{size:11})})]})}),q&&o.jsxs("p",{className:"sc-assets-zero",children:["Nothing here matches “",C.trim(),"”."]}),o.jsx(k6,{kind:"product",title:"Products",items:R.product,attached:r.product,mode:M("product"),onToggle:E,onPick:Z=>i({t:"product",id:Z}),onUnpick:Z=>l({t:"product",id:Z}),full:a,moreLabel:"products",createLabel:"Add product",onCreate:()=>g("product",{onCreated:Z=>{Z.kind==="product"&&(T("product"),i({t:"product",id:Z.id}))}})}),o.jsx(k6,{kind:"presenter",title:"People",items:R.presenter,attached:r.presenter,mode:M("presenter"),onToggle:E,onPick:Z=>i({t:"character",id:Z}),onUnpick:Z=>l({t:"character",id:Z}),full:a,moreLabel:"people",createLabel:"Create person",onCreate:()=>g("presenter",{onCreated:()=>T("presenter")})}),o.jsx(k6,{kind:"scene",title:"Places",items:R.scene,attached:r.scene?[r.scene]:[],mode:M("scene"),onToggle:E,onPick:u,onUnpick:()=>f(),full:a,moreLabel:"places",createLabel:"Create place",onCreate:()=>g("scene",{onCreated:Z=>{Z.kind==="scene"&&T("scene")}})}),!(L&&D.length===0)&&o.jsx(fv,{name:"Brand colors",count:D.length,mode:M("colors"),onToggle:()=>E("colors"),action:o.jsx(xd,{className:"sc-aadd",triggerStyle:{background:"none"},value:r2(H),presets:H.map(Z=>Z.hex),commitMode:"close",align:"end",label:"Add colour",onChange:U,children:o.jsx(mr,{size:10})}),children:Z=>o.jsx("div",{className:"sc-arow",children:(Z==="open"?D:D.slice(0,rv)).map(ee=>{const he=r.color.includes(ee.hex.toLowerCase());return o.jsxs("div",{className:"sc-aswatch-tile","data-on":he||void 0,children:[o.jsxs("button",{type:"button",title:`${ee.name} ${ee.hex}`,"aria-pressed":he,onClick:()=>he?l({t:"color",hex:ee.hex,name:ee.name}):i({t:"color",hex:ee.hex,name:ee.name}),children:[o.jsx("span",{className:"sc-aswatch",style:{background:ee.hex}}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:10,weight:"bold"})})]}),Z==="open"&&o.jsx("button",{type:"button",className:"sc-aswatch-x","aria-label":`Remove ${ee.name}`,title:"Remove",onClick:()=>V(ee.hex),children:o.jsx(jn,{size:10,weight:"bold"})})]},ee.hex)})})}),_.length>0&&!L&&o.jsx(fv,{name:"Recent shots",count:O,mode:M("shots"),onToggle:()=>E("shots"),children:Z=>o.jsxs("div",{className:Z==="open"?"sc-acard-grid":"sc-arow",children:[_.slice(0,Z==="open"?I:rv).map((ee,he)=>{const ue=ee.images[0],ge=r.ref.includes(ue);return o.jsx(_$,{candidate:{label:`Shot ${O-he}`,full:`Shot ${O-he} · as reference`,thumb:gn(ue,"micro")},on:ge,named:Z==="open",disabled:!!a&&!ge,title:a??void 0,onClick:()=>ge?l({t:"ref",imageHash:ue}):i({t:"ref",imageHash:ue,label:"Shot"})},ee.id)}),Z==="open"&&(_.length>I||G.hasMore)&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:z,"aria-label":`Show ${q0} more shots`,"aria-busy":G.loading||void 0,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",Math.max(1,O-Math.min(_.length,I))]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})})]})}function Pde({sets:e,active:t,ungrouped:n,ungroupedCount:r,onPlaceAll:a,onPlaceUngrouped:i,onOpenSet:l,onNewSet:u,onResetNewSet:f,onRenameSet:h,onDeleteSet:p,askCreate:g,lens:m,lensCounts:w,onLens:y,q:b,onQ:k,searchTotal:S,sort:E,onSort:C,tile:A,onTile:L,assets:T,onAssets:M,showAssets:j}){const P=t?t.id:n?"__ungrouped__":"__all__",R=t?t.name:n?"Not in a set":"All shots",H=!!t||n,D=Nr(la),[U,V]=s.useState(!1),[B,G]=s.useState(!1),[_,O]=s.useState(!1),[I,K]=s.useState(""),z=s.useRef(null),q=s.useRef(!1),Z=()=>{q.current=!0,G(!0),K(""),V(!0)},ee=()=>{t&&(q.current=!1,G(!1),K(t.name),V(!0))};s.useEffect(()=>{g&&Z()},[g]);const he=()=>{const ae=I.trim();if(!ae)return;const $e=q.current;q.current=!1,G(!1),V(!1),$e?u(ae):h==null||h(ae)},ue=ae=>{if(ae){V(!0);return}const $e=q.current;q.current=!1,G(!1),V(!1),$e&&(f==null||f())},ge=KN.map(ae=>({value:ae.id==="all"?null:ae.id,label:ae.label,count:w==null?void 0:w[ae.id]})),te=o.jsxs(o.Fragment,{children:[o.jsxs(Cp,{value:P,children:[o.jsx(Wu,{value:"__all__",onSelect:a,children:"All shots"}),o.jsxs(Wu,{value:"__ungrouped__",onSelect:i,children:["Not in a set",r>0?` · ${r}`:""]}),e.length>0&&o.jsx(kc,{}),e.map(ae=>o.jsx(Wu,{value:ae.id,onSelect:()=>l(ae),children:ae.name},ae.id))]}),o.jsx(kc,{}),o.jsx(Wn,{onSelect:()=>{f==null||f(),Z()},children:"New set"}),t&&h&&o.jsx(Wn,{onSelect:ee,children:"Rename"}),t&&p&&o.jsx(Wn,{color:"red",onSelect:()=>O(!0),children:"Delete set"})]}),J=o.jsx(Cp,{value:E,onValueChange:ae=>C(ae),children:WN.map(ae=>o.jsx(Wu,{value:ae.id,children:ae.label},ae.id))}),Q=H||E!=="newest";return o.jsxs("div",{className:"sc-toolbar",children:[o.jsxs("div",{className:"sc-toolbar-scope",children:[!D&&o.jsxs("div",{className:"sc-toolbar-where",children:[H&&o.jsx("button",{type:"button",className:"sc-toolbar-back","aria-label":"All shots",onClick:a,children:o.jsx(Ta,{size:16})}),o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-place","data-on":H||void 0,"aria-label":R,children:[o.jsx(Dv,{className:"sc-toolbar-place-ic",size:16}),o.jsx("span",{className:"sc-toolbar-place-t",children:R}),o.jsx(xl,{size:10,className:"sc-caret"})]})}),o.jsx(As,{align:"start",children:te})]})]}),o.jsx(Nw,{open:U,onOpenChange:ue,children:o.jsxs(Mw,{maxWidth:"360px","aria-describedby":void 0,onOpenAutoFocus:ae=>{ae.preventDefault();const $e=z.current;$e&&($e.focus(),$e.select())},children:[o.jsx(Rw,{children:B?"Name this set":"Rename set"}),o.jsx("input",{ref:z,className:"sc-in",style:{width:"100%",marginTop:8},value:I,"aria-label":"Set name",onChange:ae=>K(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&he()}}),o.jsxs(Vs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Sa,{variant:"soft",color:"gray",onClick:()=>ue(!1),children:"Cancel"}),o.jsx(Sa,{onClick:he,disabled:!I.trim(),children:"Save"})]})]})}),o.jsx(B1,{open:_,onOpenChange:O,children:o.jsxs(U1,{maxWidth:"420px",children:[o.jsx(W1,{children:"Delete this set?"}),o.jsx(K1,{size:"2",children:"Shots stay in the library. Only the set goes."}),o.jsxs(Vs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Y1,{children:o.jsx(Sa,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(G1,{children:o.jsx(Sa,{color:"red",onClick:()=>{p==null||p(),O(!1)},children:"Delete set"})})]})]})}),o.jsx(Ry,{"aria-label":"Shot lenses",activeKey:m==="all"?null:m,items:ge,onSelect:ae=>y(ae??"all")})]}),o.jsxs("div",{className:"sc-toolbar-actions",children:[o.jsx(_d,{value:b,onChange:k,noun:"shots",total:S}),D?o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn sc-toolbar-view","data-on":Q||void 0,"aria-label":`Set and sort: ${R}`,children:[o.jsx(Hv,{size:15}),Q&&o.jsx("span",{className:"sc-toolbar-view-dot","aria-hidden":!0})]})}),o.jsxs(As,{align:"end",children:[o.jsx(l4,{children:"Set"}),te,o.jsx(kc,{}),o.jsx(l4,{children:"Sort"}),J]})]}):o.jsxs(Cs,{children:[o.jsx(js,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn","aria-label":"Sort shots",children:[o.jsx(uF,{size:14}),o.jsx("span",{className:"sc-toolbar-btn-t",children:"Sort"}),o.jsx(xl,{size:10})]})}),o.jsx(As,{align:"end",children:J})]}),o.jsx(wQ,{value:A,onChange:L}),j&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-toolbar-assets","data-on":T||void 0,onClick:M,"aria-label":"Assets panel","aria-pressed":T,title:"Assets panel (.)",children:o.jsx(HF,{size:15,mirrored:!0})})]})]})}function Lde(e){const{push:t}=rr(),n=s.useCallback(l=>Ee.archiveNode(l.id,!0).then(u=>(e(u),t({kind:"success",title:"Archived",detail:Dr(l),action:{label:"Undo",onClick:()=>void Ee.archiveNode(l.id,!1).then(e)}}),!0)).catch(u=>(t(ln(u,"Could not archive this shot")),!1)),[e,t]),r=s.useCallback(l=>Ee.archiveNode(l.id,!1).then(u=>(e(u),!0)).catch(u=>(t(ln(u,"Could not restore this shot")),!1)),[e,t]),a=s.useCallback(l=>Promise.all(l.map(u=>Ee.archiveNode(u,!0))).then(u=>{for(const f of u)e(f);return t({kind:"success",title:`Archived ${u.length} shot${u.length===1?"":"s"}`,action:{label:"Undo",onClick:()=>{Promise.all(u.map(f=>Ee.archiveNode(f.id,!1))).then(f=>{for(const h of f)e(h)})}}}),!0}).catch(u=>(t(ln(u,"Could not archive these shots")),!1)),[e,t]),i=s.useCallback(l=>Promise.all(l.map(u=>Ee.archiveNode(u,!1))).then(u=>{for(const f of u)e(f);return!0}).catch(u=>(t(ln(u,"Could not restore these shots")),!1)),[e,t]);return{archive:n,archiveBatch:a,unarchive:r,unarchiveBatch:i}}function $de(e){const{push:t}=rr(),n=s.useCallback(a=>Ee.deleteNode(a.id).then(()=>e([a.id])).catch(i=>t(ln(i,"Could not delete this shot"))),[e,t]),r=s.useCallback(a=>Ee.deleteNodesBatch(a).then(()=>e(a)).catch(i=>t(ln(i,"Could not delete these shots"))),[e,t]);return{remove:n,removeBatch:r}}function Tde(e,{demoProducts:t,presenters:n,scenes:r}){var f,h,p,g;const a=((f=e.brief)==null?void 0:f.tokens)??[],i=(h=a.find(m=>(m==null?void 0:m.t)==="product"))==null?void 0:h.id,l=(p=a.find(m=>(m==null?void 0:m.t)==="character"))==null?void 0:p.id,u=(g=a.find(m=>(m==null?void 0:m.t)==="template"))==null?void 0:g.id;return{product:i?t.find(m=>m.id===i):void 0,presenter:l?n.find(m=>m.id===l):void 0,scene:u?r.find(m=>m.id===u):void 0}}function Dde(e,t){const{product:n,presenter:r,scene:a}=Tde(e,t);return{productName:n?Do(n,"chip"):null,productPreviewUrl:(n==null?void 0:n.previewUrl)??null,productId:(n==null?void 0:n.id)??null,presenterName:(r==null?void 0:r.name)??null,presenterPreviewUrl:r?ki(r).src:null,presenterId:(r==null?void 0:r.id)??null,sceneName:a?Cl(a,"chip"):null,scenePreviewUrl:(a==null?void 0:a.previewUrl)??null,sceneId:(a==null?void 0:a.id)??null}}function Hde(e){const t=s.useRef(null),n=s.useRef(0),r=s.useRef(null),a=s.useRef(0),i=s.useCallback(()=>{const h=t.current;h&&(n.current=h.scrollWidth/3)},[]);s.useEffect(()=>{const h=t.current;if(!h||!e)return;i(),h.scrollLeft=n.current;const p=new ResizeObserver(()=>{const g=n.current;i(),g<=0&&n.current>0&&(h.scrollLeft=n.current)});p.observe(h);for(const g of h.children)p.observe(g);return()=>p.disconnect()},[e,i]);const l=s.useCallback(()=>{const h=t.current,p=n.current;!h||p<=0||(h.scrollLeft<p*.5?(h.scrollLeft+=p,r.current!==null&&(r.current+=p)):h.scrollLeft>p*1.5&&(h.scrollLeft-=p,r.current!==null&&(r.current-=p)))},[]),u=s.useCallback(()=>{r.current=null,cancelAnimationFrame(a.current)},[]);s.useEffect(()=>{const h=t.current;if(!h)return;let p=0;const g=()=>{p||(p=requestAnimationFrame(()=>{p=0,l()}))},m=y=>{Math.abs(y.deltaY)<=Math.abs(y.deltaX)||(y.preventDefault(),u(),h.scrollLeft+=y.deltaY)},w=y=>{y.target.closest(".sc-shelf-arrow")||u()};return h.addEventListener("scroll",g,{passive:!0}),h.addEventListener("wheel",m,{passive:!1}),h.addEventListener("pointerdown",w),()=>{p&&cancelAnimationFrame(p),u(),h.removeEventListener("scroll",g),h.removeEventListener("wheel",m),h.removeEventListener("pointerdown",w)}},[u,l]);const f=s.useCallback(h=>{const p=t.current,g=p==null?void 0:p.firstElementChild;if(!p||!g)return;const m=g.offsetWidth||232,w=Number.parseFloat(getComputedStyle(p).columnGap)||0,y=m+w,b=r.current??p.scrollLeft;r.current=b+y*h;const k=()=>{u()};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p.scrollLeft=r.current,k(),l();return}cancelAnimationFrame(a.current);let S=0;const E=()=>{const C=r.current;if(C===null)return;const A=C-p.scrollLeft;if(S+=1,Math.abs(A)<.5||S>45){p.scrollLeft=C,k(),l();return}p.scrollLeft+=A*.16,a.current=requestAnimationFrame(E)};a.current=requestAnimationFrame(E)},[u,l]);return{ref:t,page:f}}function Ode(e){const t=[...e];for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function Ide({entries:e,catalogs:t,stagedId:n,onUse:r,productHref:a,presenterHref:i,sceneHref:l}){const u=s.useMemo(()=>Ode(e).slice(0,10),[e]),{ref:f,page:h}=Hde(u.length);return o.jsxs("div",{className:"sc-canvas-empty",children:[o.jsxs("h3",{children:["Your first ",o.jsx("em",{children:"shot"})]}),o.jsx("p",{children:"Describe what you want in the prompt below, or open one of these."}),u.length>0&&o.jsxs("div",{className:"sc-shelf",children:[o.jsx("button",{type:"button",className:"sc-shelf-arrow prev","aria-label":"Previous examples",onClick:()=>h(-1),children:o.jsx(Ta,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-shelf-arrow next","aria-label":"More examples",onClick:()=>h(1),children:o.jsx(Nl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-shelf-row",ref:f,children:[0,1,2].map(p=>u.map(g=>o.jsx(LL,{entry:g,size:"grid",hideRecipe:!0,decorative:p!==1,active:n===g.id,onOpen:()=>r(g),productHref:a,presenterHref:i,sceneHref:l,...Dde(g,t)},`${p}-${g.id}`)))})]})]})}function M0({text:e,onAll:t,actionLabel:n="Show all shots"}){return o.jsxs("div",{className:"sc-feed-empty",children:[o.jsx("p",{children:e}),t&&o.jsx("button",{type:"button",className:"sc-btn",onClick:t,children:n})]})}function Fde({count:e,sets:t,activeSet:n,onAdd:r,onRemove:a,onNew:i,onClear:l,onKeep:u,onArchiveBatch:f,allKept:h,archivedLens:p,pickedIds:g,onRestoreBatch:m,onDeleteBatch:w,loaded:y,onSelectAll:b}){const[k,S]=s.useState(!1);return o.jsxs("div",{className:"sc-picked","data-lens":p?"archived":void 0,role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),y>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<y?b:l,children:e<y?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-tools",children:p?o.jsxs(o.Fragment,{children:[o.jsx(Du,{label:"Restore",onClick:()=>m(g),children:o.jsx(t1,{size:17})}),o.jsx(Du,{label:`Delete ${e} permanently`,tone:"danger",onClick:()=>S(!0),children:o.jsx(Ml,{size:17})})]}):o.jsxs(o.Fragment,{children:[o.jsx(Du,{label:h?"Remove from keepers":"Keep",onClick:u,children:o.jsx(eo,{size:17,weight:h?"fill":"regular"})}),o.jsxs(Cs,{children:[o.jsx(hr,{label:"Add to set",children:o.jsx(js,{children:o.jsx("button",{type:"button",className:"sc-picked-tool","aria-label":"Add to set",children:o.jsx(Dv,{size:17})})})}),o.jsxs(As,{children:[t.filter(E=>E.id!==(n==null?void 0:n.id)).map(E=>o.jsx(Wn,{onSelect:()=>r(E),children:E.name},E.id)),t.some(E=>E.id!==(n==null?void 0:n.id))&&o.jsx(kc,{}),o.jsx(Wn,{onSelect:i,children:"New set…"})]})]}),n&&a&&o.jsx(Du,{label:I$(e,n.name),onClick:a,children:o.jsx($E,{size:17})}),o.jsx(Du,{label:"Archive",tone:"danger",onClick:()=>f(g),children:o.jsx(fm,{size:17})})]})}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(Du,{label:"Done",onClick:l,children:o.jsx(jn,{size:16,weight:"bold"})})}),p&&o.jsx(Xn,{label:`Delete ${e} permanently`,title:`Delete ${e} shot${e===1?"":"s"} permanently?`,body:"This cannot be undone.",busy:!1,open:k,onOpenChange:S,onConfirm:()=>w(g)})]})}function Du({label:e,tone:t,onClick:n,children:r}){return o.jsx(hr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}function _de(e,t){return[e,t.lens??"all",t.set??"",t.ungrouped?"ungrouped":"",t.lineage??"",t.token??"",(t.q??"").trim(),t.sort??"newest",t.limit??""].join("|")}function Vde(e){switch(e){case"oldest":return(t,n)=>Ku(n,t);case"cost":return(t,n)=>n.costUsd-t.costUsd||Ku(t,n);case"keepers":return(t,n)=>Number(n.kept)-Number(t.kept)||Ku(t,n);default:return Ku}}function V$(e,t,n){return e.kind==="root"?!1:t.lineage?n.inLineage?n.inLineage(e):!1:t.set?n.inSet?n.inSet(e.id):!1:t.ungrouped?n.inAnySet?!n.inAnySet(e.id):!1:!0}function Zde(e,t){return t==="archived"?e.archived:t==="keepers"?!e.archived&&e.kept:!e.archived}function Y7(e,t,n){var r;return(r=t.q)!=null&&r.trim()?null:V$(e,t,n)&&Zde(e,t.lens)}function q7(e){return!e||e.kind==="root"?{all:0,keepers:0,archived:0}:{all:e.archived?0:1,keepers:!e.archived&&e.kept?1:0,archived:e.archived?1:0}}function E6(e,t,n,r){if(!r)return e;const a=q7(t),i=q7(n),l={...e,all:e.all+i.all-a.all,keepers:e.keepers+i.keepers-a.keepers,archived:e.archived+i.archived-a.archived};return l.all===e.all&&l.keepers===e.keepers&&l.archived===e.archived?e:l}function zde(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}function hv(e,t){const n=e.findIndex(a=>a.id===t.id);if(n===-1||zde(e[n],t))return e;const r=[...e];return r[n]=t,r}function X7(e,t){const n=new Set(t);return e.some(r=>n.has(r.id))?e.filter(r=>!n.has(r.id)):e}function Bde(e,t,n,r){if(e.some(u=>u.id===t.id))return hv(e,t);const a=Vde(n);let i=0;for(;i<e.length&&a(e[i],t)<=0;)i++;if(i===e.length&&!r)return e;const l=[...e];return l.splice(i,0,t),l}function Ude(e,t){const n=new Set(e.map(a=>a.id)),r=t.filter(a=>!n.has(a.id));return r.length?[...e,...r]:e}function Wde(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Z$(e,t){const n=new Set(t.map(a=>a.id)),r=[];for(const a of e)a.status==="running"&&!n.has(a.id)&&r.push(a.id);return r}function Kde(e,t){const n=t,r={...e};for(const a of Object.keys(e))a in n&&(r[a]=n[a]);return r}const C6=60;function Gde(e,t,n){const{shotsEpoch:r}=cn(),a=`${_de(e,t)}#${r}`,[i,l]=s.useState(()=>{const M=o7(a);return M?{...M,error:null}:{brandId:e,key:"",items:[],next:null,counts:null,error:null}}),[u,f]=s.useState(0),[h,p]=s.useState(!1),g=s.useRef(i);g.current=i;const m=s.useRef(t);m.current=t;const w=s.useRef(n);w.current=n;const y=s.useRef(!1);s.useEffect(()=>{const M=new AbortController;p(!0);const j=o7(a);return j&&g.current.key!==a&&l({...j,error:null}),Ee.feed(e,{...m.current,limit:C6},M.signal).then(P=>{M.signal.aborted||l({brandId:e,key:a,items:P.items,next:P.next,counts:P.counts??null,error:null})}).catch(P=>{if(M.signal.aborted)return;const R=String((P==null?void 0:P.message)??P);l(H=>H.key===a?{...H,error:R}:{brandId:e,key:a,items:[],next:null,counts:null,error:R})}).finally(()=>{M.signal.aborted||p(!1)}),()=>M.abort()},[e,a,u]),s.useEffect(()=>{i.key&&!i.error&&Zie(i)},[i]);const b=s.useCallback(()=>f(M=>M+1),[]),k=s.useCallback(()=>{const M=g.current;if(M.key!==a||!M.next||y.current)return;y.current=!0,p(!0);const j=M.next;Ee.feed(e,{...m.current,limit:C6,cursor:j}).then(P=>{l(R=>R.key!==a?R:{...R,items:Ude(R.items,P.items),next:P.next,counts:P.counts??R.counts})}).catch(()=>{}).finally(()=>{y.current=!1,p(!1)})},[e,a]),S=s.useCallback(async()=>{const M=await Ee.feed(e,{...m.current,limit:C6});l(j=>j.key!==a?j:{...j,items:Wde(j.items,M.items),next:j.items.length?j.next:M.next,counts:M.counts??j.counts,error:null})},[e,a]),E=s.useCallback(M=>{l(j=>{const P=j.items.find(V=>V.id===M.id);if(!P)return j;const R=m.current,D=Y7(M,R,w.current)===!1?X7(j.items,[M.id]):hv(j.items,M),U=j.counts?E6(j.counts,P,M,!0):j.counts;return D===j.items&&U===j.counts?j:{...j,items:D,counts:U}})},[]),C=s.useCallback((M,j)=>{let P=!1;l(R=>{let H=R.items,D=R.counts;const U=m.current;for(const V of M){if(H.some(O=>O.id===V.id)){H=hv(H,V);continue}const B=Y7(V,U,w.current);if(B===null){P=!0;continue}const G=V$(V,U,w.current);B&&(H=Bde(H,V,U.sort,R.next===null));const _=(j==null?void 0:j.get(V.id))??null;D&&(D=E6(D,_,V,G))}return H===R.items&&D===R.counts?R:{...R,items:H,counts:D}}),P&&S().catch(()=>{})},[S]),A=s.useCallback(M=>{l(j=>{const P=j.items.filter(H=>M.includes(H.id));if(!P.length)return j;let R=j.counts;if(R)for(const H of P)R=E6(R,H,null,!0);return{...j,items:X7(j.items,M),counts:R}})},[]),L=i.brandId===e?i.items:[],T=s.useMemo(()=>new Map(L.map(M=>[M.id,M])),[L]);return{items:L,byId:T,counts:i.brandId===e?i.counts:null,ready:i.key===a&&!i.error,loading:h,complete:i.key===a&&i.next===null,error:i.key===a?i.error:null,loadMore:k,patch:E,insert:C,drop:A,refresh:S,retry:b}}function Yde(){const e=mn(pt.hubShot),t=mn(pt.setShot);return(e==null?void 0:e.params.shotId)??(t==null?void 0:t.params.shotId)??null}function Q7(e,t){const n=e?t.get(e)??null:null,[r,a]=s.useState(null);return s.useEffect(()=>{if(!e||n)return;let i=!0;return Ee.node(e).then(l=>i&&a({id:e,node:l})).catch(()=>i&&a({id:e,node:null})),()=>{i=!1}},[e,n]),e?n?{node:n,missing:!1}:(r==null?void 0:r.id)===e?{node:r.node,missing:r.node===null}:{node:null,missing:!1}:{node:null,missing:!1}}function z$({set:e}){const{engines:t,scenes:n,presenters:r,demoProducts:a,showcase:i,showcaseLoaded:l}=Mn(),{brand:u,workspace:f,root:h,recent:p,sets:g,membership:m,loaded:w,refresh:y,applySet:b,dropSet:k,insertSet:S,applyMembership:E,applyNodes:C,subscribeActivity:A,products:L}=cn(),T=n,M=ff(),j=Un(),[P,R]=Al(),H=Yde(),[D,U]=s.useState(null),[V,B]=s.useState(!1);s.useEffect(()=>{const oe=()=>B(!0);return window.addEventListener("scenri:shortcuts",oe),()=>window.removeEventListener("scenri:shortcuts",oe)},[]);const{open:G,toggle:_,setOpen:O}=Jse(),I=Nr("(min-width: 1280px)"),K=I&&G,[z,q]=s.useState(null),[Z,ee]=s.useState(RL),[he,ue]=s.useState(null),[ge,te]=s.useState(null),J=s.useRef(!1);s.useEffect(()=>{if(!J.current||H)return;J.current=!1;const oe=requestAnimationFrame(()=>{var Ie;return(Ie=Oe.current)==null?void 0:Ie.focus()});return()=>cancelAnimationFrame(oe)},[H,ge]);const[Q,ae]=s.useState(null),[$e,ie]=s.useState(new Set),[ke,ze]=Fh("tab","all"),[wt,Ke]=Fh("in",""),[tt,De]=Fh("branch",""),[Se,X]=Fh("lineage",""),[je,Re]=Ma(qr.tileSize,uR),re=dR(je),{q:Y,setQ:se,clearSearch:Ne}=hf([]),[Be,st]=Ma(qr.feedSort,"newest"),Pe=uY(Be)?Be:"newest",Oe=s.useRef(null),{push:Ge}=rr(),{poke:ft}=ia(),[bt,at]=s.useState(null),Zt=(f==null?void 0:f.id)??"",jt=e?$0(u,e):Sr(u),Ft=s.useCallback(oe=>{const Ie=P.toString();return`${jt}/shots/${oe}${Ie?`?${Ie}`:""}`},[jt,P]),Pt=s.useCallback((oe,Ie=!1)=>j(Ft(oe),{replace:Ie}),[j,Ft]),Tt=s.useCallback(()=>{const oe=new URLSearchParams(P);oe.delete("panel");const Ie=oe.toString();j(`${jt}${Ie?`?${Ie}`:""}`,{replace:!0})},[jt,j,P]),xe=dY(ke)?ke:"all",Je=!e&&wt==="ungrouped";s.useEffect(()=>{ke==="ungrouped"&&(ze(null),Ke("ungrouped"))},[ke,ze,Ke]);const Et=s.useMemo(()=>{const oe=new Map;for(const Ie of g)for(const lt of m[Ie.id]??[])oe.has(lt)||oe.set(lt,[]),oe.get(lt).push(Ie);return oe},[g,m]),Xe=s.useMemo(()=>({lens:xe,set:e==null?void 0:e.id,ungrouped:Je||void 0,lineage:Se||void 0,q:Y.trim()||void 0,sort:Pe}),[xe,e==null?void 0:e.id,Je,Se,Y,Pe]),rt=s.useRef(m);rt.current=m;const nt=s.useRef(Et);nt.current=Et;const qt=s.useRef(new Set),Yt=s.useMemo(()=>({inSet:oe=>e?(rt.current[e.id]??[]).includes(oe):!1,inAnySet:oe=>nt.current.has(oe),inLineage:oe=>oe.id===Se||oe.parentId!==null&&qt.current.has(oe.parentId)}),[e==null?void 0:e.id,Se]),an=Gde(u.id,Xe,Yt),{items:Wt,byId:Rn,counts:Bt}=an,ne=s.useRef(an);ne.current=an,qt.current=s.useMemo(()=>new Set(Wt.map(oe=>oe.id)),[Wt]);const le=s.useRef(new Map);s.useEffect(()=>{for(const oe of Wt)le.current.set(oe.id,oe)},[Wt]);const ce=s.useRef(new Set),Ve=s.useRef(null),[_e,xt]=s.useState("");s.useEffect(()=>A(oe=>{const{messages:Ie,next:lt}=ade(Ve.current??new Map,oe),en=Ve.current===null;if(Ve.current=lt,!en&&Ie.length){const dn=Ie.join(" ");xt(or=>or===dn?`${dn} `:dn)}const nn=ne.current;let Zn=!1;const Tn=[],Pn=new Map;for(const dn of oe){if(nn.byId.has(dn.id))nn.patch(dn);else if(le.current.has(dn.id)){const or=le.current.get(dn.id);or&&Pn.set(dn.id,or),Tn.push(dn)}else dn.kind!=="root"&&(Zn=!0);le.current.set(dn.id,dn)}Tn.length&&nn.insert(Tn,Pn),Zn&&nn.ready&&nn.refresh().catch(()=>{});for(const dn of Z$(nn.byId.values(),oe))ce.current.has(dn)||(ce.current.add(dn),Ee.node(dn).then(or=>{const ua=ne.current.byId.get(dn);ua&&ne.current.patch(Kde(ua,or))}).catch(or=>{(or==null?void 0:or.status)===404&&ne.current.drop([dn])}).finally(()=>ce.current.delete(dn)))}),[A]);const yt=w&&an.ready,kt=Q7(Se||null,Rn);s.useEffect(()=>{!Se||!kt.missing||(X(null),Ge({kind:"info",title:"That shot is no longer available",detail:"Showing everything instead."}))},[Se,kt.missing,X,Ge]);const ot=s.useMemo(()=>{var en,nn;const oe=L.length?L:((en=u.json)==null?void 0:en.products)??[],Ie=((nn=u.json)==null?void 0:nn.characters)??[],lt=M.scenes;return{product:Zn=>{const Tn=oe.find(Pn=>Pn.id===Zn)??a.find(Pn=>Pn.id===Zn);return Tn?Do(Tn,"chip"):null},person:Zn=>{var Tn,Pn;return((Tn=Ie.find(dn=>dn.id===Zn))==null?void 0:Tn.name)??((Pn=r.find(dn=>dn.id===Zn))==null?void 0:Pn.name)??null},scene:Zn=>{const Tn=lt.find(Pn=>Pn.id===Zn);return Tn?Cl(Tn,"chip"):null}}},[L,a,u,r,M.scenes]),ht=s.useMemo(()=>{const oe=D?Rn.get(D):void 0;return oe||(Wt.find(Ie=>Ie.status!=="error")??Wt[0]??null)},[Rn,Wt,D]),Ae=Q7(tt||null,Rn),me=s.useMemo(()=>{const oe=Ae.node;return!oe||oe.kind==="root"?null:oe.status==="running"||oe.status==="done"&&oe.images.length>0?oe:null},[Ae.node]),et=(me==null?void 0:me.images[0])??null,Ct=s.useCallback(()=>De(null),[De]),be=s.useRef(null),it=s.useCallback((...oe)=>{if(be.current){for(const lt of oe)be.current.add(lt);return}const Ie=new Set(oe);be.current=Ie,queueMicrotask(()=>{be.current=null,R(lt=>{const en=new URLSearchParams(lt);for(const nn of Ie)en.delete(nn);return en},{replace:!0})})},[R]),vt=s.useCallback(()=>it(...$5,"setup","product","ref","view","fresh"),[it]);s.useEffect(()=>{!tt||!yt||(Ae.node&&!me?(Ct(),Ge({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})):Ae.missing&&(Ct(),Ge({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})))},[tt,Ae.node,Ae.missing,me,yt,Ct,Ge]);const Te=s.useCallback(oe=>{var Ie;De(oe),(Ie=Oe.current)==null||Ie.focus()},[De]),qe=oe=>U(oe),Lt=oe=>H||/\/shots\//.test(window.location.pathname)?Pt(oe,!0):qe(oe),Ut=s.useCallback(oe=>{for(const Ie of oe)le.current.set(Ie.id,Ie);ne.current.insert(oe),C(oe),ft()},[C,ft]),Nt=s.useCallback(async()=>{try{await y(),await ne.current.refresh(),q(null)}catch(oe){q(String(oe.message??oe))}},[y]),_t=s.useCallback(oe=>C([oe]),[C]),{archive:Me,archiveBatch:Ze,unarchive:Qe,unarchiveBatch:F}=Lde(_t),de=s.useCallback(oe=>ne.current.drop(oe),[]),{remove:we,removeBatch:We}=$de(de);s.useEffect(()=>{H&&U(H)},[H]);const Le=s.useRef(new Set),ct=async oe=>{var Ie,lt;if(oe.status==="running")return oe.id;if(Le.current.has(oe.id))return null;if(oe.status==="error"||oe.status==="cancelled"){Le.current.add(oe.id);try{const en=await Ee.retryNode(oe.id);return C([en]),ft(),en.id}catch(en){return Ge(ln(en,"Could not run this again")),null}finally{Le.current.delete(oe.id)}}Le.current.add(oe.id);try{const en=await Ee.node(oe.id),nn=await Ee.addNode({projectId:Zt,parentId:oe.parentId,kind:oe.kind==="edit"?"edit":"generation",prompt:en.prompt,engineId:oe.engineId,count:1,brief:oe.brief,...oe.kind==="edit"&&((Ie=oe.brief)!=null&&Ie.sourceImage)?{sourceImage:oe.brief.sourceImage}:{}});return Ut((lt=nn.siblings)!=null&<.length?nn.siblings:[nn]),(nn==null?void 0:nn.id)??null}catch(en){return Ge(ln(en,"Could not run this again")),null}finally{Le.current.delete(oe.id)}},Ot=async oe=>{try{await Ee.cancelNode(oe.id),C([{...oe,status:"cancelled"}]),ft()}catch(Ie){Ge(ln(Ie,"Could not cancel this shot"))}},zt=s.useCallback(oe=>{var Ie,lt,en;oe!=null&&oe.scene&&((Ie=Oe.current)==null||Ie.applyScene(oe.scene)),oe!=null&&oe.scenesPanel&&((lt=Oe.current)==null||lt.openAttach("Places")),(en=Oe.current)==null||en.focus()},[]);s.useEffect(()=>{var Ie;if(P.get("compose")===null)return;const oe=P.get("attach")==="all";zt(),oe&&((Ie=Oe.current)==null||Ie.showAttach()),it("compose",...oe?["attach"]:[])},[P,zt,it]);const Rt=P.get("showcase"),kn=s.useRef(null);s.useEffect(()=>{if(!Rt||!l||kn.current===Rt)return;kn.current=Rt;const oe=i.find(Ie=>Ie.id===Rt);oe?(te(X4(oe)),Ge({kind:"info",title:`Starting from "${oe.title}"`})):Ge({kind:"info",title:"That example is no longer available",detail:"Starting from scratch instead."}),R(Ie=>{const lt=new URLSearchParams(Ie);return lt.delete("showcase"),lt},{replace:!0})},[Rt,l,i,R,Ge]);const Jt=async(oe,Ie=!oe.kept)=>{C([{...oe,kept:Ie}]);try{C([await Ee.keep(oe.id,Ie)])}catch(lt){C([oe]),Ge(ln(lt,"Could not update keeper status"))}},Sn=s.useMemo(()=>[...$e].map(oe=>Rn.get(oe)).filter(oe=>!!oe),[Rn,$e]),Qn=async()=>{const oe=!(Sn.length>0&&Sn.every(lt=>lt.kept)),Ie=Sn.filter(lt=>lt.kept!==oe);C(Ie.map(lt=>({...lt,kept:oe})));try{C(await Promise.all(Ie.map(lt=>Ee.keep(lt.id,oe))))}catch(lt){C(Ie),Ge(ln(lt,"Could not update keeper status"))}},un=oe=>{const Ie=oe.map(lt=>Rn.get(lt)).filter(lt=>!!lt&&!lt.archived);Ie.length&&C(Ie.map(lt=>({...lt,archived:!0}))),ie(new Set),Ze(oe).then(lt=>{lt||C(Ie)})},gr=oe=>{const Ie=oe.map(lt=>Rn.get(lt)).filter(lt=>!!lt&<.archived);Ie.length&&C(Ie.map(lt=>({...lt,archived:!1}))),ie(new Set),F(oe).then(lt=>{lt||C(Ie)})},Kt=s.useCallback((oe,Ie)=>{rt.current={...rt.current,[oe]:Ie},E(oe,Ie)},[E]),wr=async oe=>{try{const Ie=await Ee.addToSet(oe.id,[...$e]);Kt(oe.id,Ie.nodeIds),ie(new Set),(e||Je)&&ne.current.refresh()}catch(Ie){Ge(ln(Ie,"Could not add to the set"))}},Hr=async(oe,Ie)=>{const lt=rt.current[oe.id]??[],en=lt.filter(nn=>!Ie.includes(nn));Kt(oe.id,en),ie(nn=>{if(!Ie.some(Tn=>nn.has(Tn)))return nn;const Zn=new Set(nn);for(const Tn of Ie)Zn.delete(Tn);return Zn}),(e==null?void 0:e.id)===oe.id&&ne.current.drop(Ie);try{const nn=await Ee.removeFromSet(oe.id,Ie);Kt(oe.id,nn.nodeIds),Je&&ne.current.refresh()}catch(nn){Kt(oe.id,lt),((e==null?void 0:e.id)===oe.id||Je)&&ne.current.refresh(),Ge(ln(nn,"Could not remove from the set"))}},wn=oe=>Hr(oe,[...$e]),_o=(oe,Ie)=>Hr(Ie,[oe.id]),An=s.useRef([]),[Ks,Ps]=s.useState(!1);s.useEffect(()=>{Ks&&Ps(!1)},[Ks]);const on=async(oe,Ie)=>{const lt=Ie.trim();if(lt)try{const en=await Ee.createSet(u.id,lt);if(S(en),oe.length>0){const nn=await Ee.addToSet(en.id,oe);Kt(en.id,nn.nodeIds)}ie(new Set),j($0(u,en))}catch(en){Ge(ln(en,"Could not create the set"))}},yn=()=>{const oe=An.current;return An.current=[],oe},Kn=async oe=>{if(!e)return;const Ie=oe.trim();if(!(!Ie||Ie===e.name))try{const lt=await Ee.renameSet(e.id,Ie);b(lt),j($0(u,lt),{replace:!0}),y()}catch(lt){Ge(ln(lt,"Could not rename the set"))}},Ur=async()=>{if(e)try{await Ee.deleteSet(e.id),k(e.id),j(Sr(u),{replace:!0}),y()}catch(oe){Ge(ln(oe,"Could not delete the set"))}},Jn=async oe=>{var dn;const Ie=((dn=/\/shots\/([^/?#]+)/.exec(window.location.pathname))==null?void 0:dn[1])??null,lt=Ie?Rn.get(Ie)??null:ht;if(!lt)return;if(oe==="left"||oe==="right"){const{prev:or,next:ua}=h4(Wt,lt.id),Or=oe==="left"?or:ua;Or&&Lt(Or.id);return}const en=await Ee.lineage(lt.id).catch(()=>null);if(!en)return;const nn=en.history??[...en.ancestors,lt,...en.children.slice(0,1)],{prev:Zn,next:Tn}=h4(nn.filter(or=>or.id===lt.id||or.images[0]),lt.id),Pn=oe==="up"?Zn:Tn;Pn&&Lt(Pn.id)};s.useEffect(()=>{const oe=Ie=>{var Tn,Pn;if(Ie.defaultPrevented)return;const lt=document.activeElement,en=((lt==null?void 0:lt.tagName)??"").toUpperCase(),nn=en==="INPUT"||en==="TEXTAREA"||en==="SELECT"||!!(lt!=null&<.closest('[contenteditable="true"]'))||!!(lt!=null&<.closest('[role="separator"]')),Zn=!!(lt!=null&<.closest('button, a[href], [role="button"], [role="tab"], [role="menuitem"]'));if(Ie.key==="Enter"&&(Ie.metaKey||Ie.ctrlKey)){if(H||qde(lt))return;(Tn=Oe.current)==null||Tn.submit(),Ie.preventDefault();return}if(!nn){if(Ie.key==="?"){B(!0),Ie.preventDefault();return}if(Ie.key==="/"&&!H){(Pn=Oe.current)==null||Pn.focus(),Ie.preventDefault();return}if(Ie.key==="Escape"&&V){B(!1),Ie.preventDefault();return}if(Ie.key==="Escape"&&H){Tt(),Ie.preventDefault();return}if(Ie.key==="Escape"&&$e.size>0){ie(new Set),Ie.preventDefault();return}if(Ie.key==="Escape"&&tt){Ct(),Ie.preventDefault();return}if(ht){if(Ie.key==="b"&&ht.kind!=="root"&&ht.status==="done"&&ht.images.length>0){Te(ht.id),Ie.preventDefault();return}if(Ie.key==="k"&&ht.kind!=="root"&&ht.status==="done"){Jt(ht),Ie.preventDefault();return}Ie.key==="ArrowLeft"?(Jn("left"),Ie.preventDefault()):Ie.key==="ArrowRight"?(Jn("right"),Ie.preventDefault()):Ie.key==="ArrowUp"?(Jn("up"),Ie.preventDefault()):Ie.key==="ArrowDown"?(Jn("down"),Ie.preventDefault()):Ie.key==="Enter"&&!H&&ht.kind!=="root"&&!Zn?Pt(ht.id):Ie.key==="."&&!H&&I&&_()}}};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[ht,H,V,$e.size,tt,Te,De,h,I]);const Fn=oe=>ie(Ie=>{const lt=new Set(Ie);return lt.delete(oe)||lt.add(oe),lt}),es=yt&&Bt!==null&&Bt.total===0,ca=K||es&&I,Vo=es?o.jsx(Ide,{entries:i,catalogs:{demoProducts:a,presenters:r,scenes:T},stagedId:Q,productHref:oe=>Ea(u,oe),presenterHref:oe=>Ra(u,oe),sceneHref:oe=>zr(u,oe),onUse:oe=>{ae(oe.id),te(X4(oe))}}):Y.trim()?o.jsx(M0,{text:`No shots match “${Y.trim()}”.`,onAll:Ne,actionLabel:"Clear search"}):xe==="keepers"?o.jsx(M0,{text:"No keepers yet. Star a shot and it lands here.",onAll:()=>ze(null)}):xe==="archived"?o.jsx(M0,{text:"Nothing archived.",onAll:()=>ze(null)}):e?o.jsx(M0,{text:"Nothing in this set yet. Pick shots on All, then add them here."}):Je?o.jsx(M0,{text:"Every shot is already in a set.",onAll:()=>Ke(null)}):null,ms=s.useRef(0);!Y.trim()&&Bt&&(ms.current=Bt[xe]);const[Gs,Zo]=Ma(qr.feedCounts,null);s.useEffect(()=>{if(!Bt)return;const oe={brandId:u.id,all:Bt.all,keepers:Bt.keepers,archived:Bt.archived};Zo(Ie=>Ie&&Ie.brandId===oe.brandId&&Ie.all===oe.all&&Ie.keepers===oe.keepers&&Ie.archived===oe.archived?Ie:oe)},[u.id,Bt,Zo]);const Ys=s.useMemo(()=>Bt?{all:Bt.all,keepers:Bt.keepers,archived:Bt.archived}:(Gs==null?void 0:Gs.brandId)===u.id?{all:Gs.all,keepers:Gs.keepers,archived:Gs.archived}:null,[Bt,Gs,u.id]),uo={byId:Rn,items:Wt,loadMore:an.loadMore,complete:an.complete,rootId:h,recent:p,loaded:yt,setsFor:oe=>Et.get(oe)??[],brand:u,engines:t,projectId:Zt,close:Tt,select:Lt,retry:oe=>{ct(oe).then(Ie=>{Ie&&Lt(Ie)})},cancel:oe=>void Ot(oe),keep:oe=>void Jt(oe),reload:Nt,remix:oe=>{var Zn;const Ie=(Zn=oe.brief)==null?void 0:Zn.tokens,lt=oe.prompt??oe.promptHead,en=Ie!=null&&Ie.length||!lt?oe.brief:{...oe.brief,tokens:[{t:"text",v:lt}]},nn=en!=null&&en.tokens?{...en,tokens:op(u,en.tokens)}:en;te({...nn,_at:Date.now()}),nn&&_w(u.id,{tokens:dy(nn),tplFields:nn.templateFields??{}}),Tt(),Ge({kind:"info",title:"Starting from this shot",detail:"Its prompt, chips and settings are in the composer. Change anything, then Generate."}),J.current=!0},branch:oe=>{Te(oe.id),Tt()},archive:oe=>Me(oe).then(Ie=>{Ie&&Tt()}),unarchive:oe=>Qe(oe).then(()=>{}),delete:oe=>void we(oe).then(()=>Tt()),landed:Ut,refined:(oe,Ie)=>{Ie==="edit"&&De(oe)},subscribeActivity:A,tokenNames:ot};return o.jsxs("div",{className:"sc-work","data-assets":ca,children:[o.jsxs("main",{className:"sc-canvas",id:"main","data-page-scroll":"","data-firstrun":es||void 0,onClick:oe=>{if($e.size===0&&!D)return;const Ie=oe.target;Ie.closest(".sc-cell")||Ie.closest("button, a, input, select, textarea, label, [role], [contenteditable]")||(ie(new Set),U(null))},children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:_e}),(z||an.error)&&o.jsx("div",{className:"sc-canvas-alert",children:o.jsx(Iw,{failure:co(z??an.error??""),action:an.error&&!z?o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:an.retry,children:"Try again"}):void 0})}),(!es||e)&&o.jsx(Pde,{sets:g,active:e,ungrouped:Je,ungroupedCount:(Bt==null?void 0:Bt.ungrouped)??0,onPlaceAll:()=>e?j(Sr(u)):Ke(null),onPlaceUngrouped:()=>e?j(`${Sr(u)}?in=ungrouped`):Ke("ungrouped"),onOpenSet:oe=>j($0(u,oe)),onNewSet:oe=>void on(yn(),oe),onResetNewSet:()=>{An.current=[]},onRenameSet:oe=>void Kn(oe),onDeleteSet:()=>void Ur(),askCreate:Ks,lens:xe,lensCounts:Ys,onLens:oe=>ze(oe==="all"?null:oe),q:Y,onQ:se,searchTotal:Y.trim()?ms.current:(Bt==null?void 0:Bt[xe])??0,sort:Pe,onSort:st,tile:re,onTile:Re,assets:K,onAssets:_,showAssets:I}),Se&&kt.node&&o.jsxs("div",{className:"sc-lineage-bar",children:[o.jsx("button",{type:"button",className:"sc-crumb-back",onClick:()=>X(null),children:"All shots"}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("b",{dir:"auto",children:Dr(kt.node)}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("span",{className:"sc-crumb-here",children:"versions"})]}),o.jsx(jde,{nodes:Wt,selectedId:D,onOpen:Pt,shotHref:Ft,onRetry:oe=>void ct(oe),onCancel:oe=>void Ot(oe),onToggleKeep:oe=>void Jt(oe),onArchive:oe=>oe.archived?Qe(oe):Me(oe),onDeletePermanently:we,engineName:oe=>{var Ie;return(Ie=t.find(lt=>lt.id===oe))==null?void 0:Ie.displayName},picked:$e,onPick:Fn,sending:bt,onBranch:Te,branchingFrom:(me==null?void 0:me.id)??null,onVersions:X,tile:re,empty:yt?Vo:null,pending:!yt&&!an.error,onNearEnd:an.complete?void 0:an.loadMore,inSet:e,setsFor:oe=>Et.get(oe)??[],onRemoveFromSet:(oe,Ie)=>void _o(oe,Ie),onKeepPicked:()=>void Qn(),onArchivePicked:()=>un([...$e]),onRestorePicked:()=>gr([...$e]),onDeletePicked:()=>void We([...$e]).then(()=>ie(new Set)),onRemovePickedFromSet:oe=>void wn(oe)})]}),ca&&o.jsx("div",{className:"sc-assets-backdrop",onClick:()=>O(!1),"aria-hidden":!0}),o.jsx(ide,{open:V,onOpenChange:B}),I&&o.jsx(Rde,{brand:u,shots:p,shotsTotal:(Ys==null?void 0:Ys.all)??0,attached:Z,full:he,onToken:oe=>{var Ie;return(Ie=Oe.current)==null?void 0:Ie.insertToken(oe)},offToken:oe=>{var Ie;return(Ie=Oe.current)==null?void 0:Ie.removeToken(oe)},onTemplate:oe=>{var Ie;return(Ie=Oe.current)==null?void 0:Ie.applyScene(oe)},offTemplate:()=>{var oe;return(oe=Oe.current)==null?void 0:oe.removeTemplate()},onClose:()=>O(!1)}),o.jsxs(PL,{full:!ca,children:[o.jsx(Hy,{}),$e.size>0&&o.jsx(Fde,{count:$e.size,sets:g,activeSet:e,onAdd:oe=>void wr(oe),onRemove:e?()=>void wn(e):void 0,onNew:()=>{An.current=[...$e],Ps(!0)},onClear:()=>ie(new Set),onKeep:()=>void Qn(),onArchiveBatch:oe=>un(oe),allKept:Sn.length>0&&Sn.every(oe=>oe.kept),archivedLens:xe==="archived",pickedIds:[...$e],onRestoreBatch:oe=>gr(oe),onDeleteBatch:oe=>void We(oe).then(()=>ie(new Set)),loaded:Wt.length,onSelectAll:()=>ie(new Set(Wt.map(oe=>oe.id)))}),o.jsx(Ty,{ref:Oe,projectId:Zt||null,brand:u,engines:t,parentId:h,initialBrief:ge,suppressDraftRestore:Rt!==null,startScene:L5(P,"scene")??void 0,startSetup:P.get("setup")??void 0,startPresenter:L5(P,"presenter")??void 0,startProduct:P.get("product")??void 0,startRef:P.get("ref")??void 0,startView:P.get("view")??void 0,startFresh:P.get("fresh")==="1",onSeedsSpent:vt,openAttachTab:kY(P.get("attach")),target:me,onClearTarget:Ct,onRestoreBranchId:De,guided:!0,setSlug:(e==null?void 0:e.slug)??null,onSending:at,onAttached:ee,onCeiling:ue,sourceImage:et??void 0,onQueued:(oe,Ie,lt,en)=>{te(null),R(Pn=>{const dn=new URLSearchParams(Pn);for(const or of $5)dn.delete(or);return dn.delete("attach"),dn.delete("product"),dn},{replace:!0});const nn=()=>at(null),Zn=()=>{Ie!=="edit"||!oe||R(Pn=>{const dn=new URLSearchParams(Pn);return dn.set("branch",oe),dn},{replace:!0})},Tn=()=>{Ut(en??[]),Zn(),nn()};e&&oe?Ee.addToSet(e.id,lt!=null&<.length?lt:[oe]).then(Pn=>Kt(e.id,Pn.nodeIds)).catch(Pn=>Ge(ln(Pn,"Could not add to the set"))).finally(Tn):Tn()}})]}),o.jsx(Zc,{context:uo})]})}const J7='[aria-modal="true"], [role="alertdialog"], .rt-BaseDialogContent, .sc-newdlg-layer';function qde(e){return e!=null&&e.closest(J7)?!0:!!(e!=null&&e.closest("[data-radix-popper-content-wrapper]"))&&!!document.querySelector(J7)}const pv=new Map,Xde=4e3;function Qde(e){pv.set(e,performance.now())}function Jde(e){const t=pv.get(e);if(t!==void 0&&performance.now()-t<Xde)return t;pv.delete(e)}function e0e(e){var t;return gi((t=e.brief)==null?void 0:t.format)}function t0e(e){var n,r,a;const t=(a=(r=(n=e.brief)==null?void 0:n.rendered)==null?void 0:r.sizes)==null?void 0:a[0];return t&&t[0]>0&&t[1]>0?t:null}const n0e=e=>({"--sc-pic-ar":e[0]/e[1],"--sc-pic-w":`${e[0]}px`});function r0e({node:e,onRetry:t,onCancel:n,engineName:r,menu:a}){const[i,l]=s.useState(null),[,u]=s.useState(0);s.useEffect(()=>{if(e.status!=="running")return;const S=setInterval(()=>u(E=>E+1),1e3);return()=>clearInterval(S)},[e.status]),e.status==="running"&&j6.add(e.id);const[,f]=s.useState(0),h=s.useRef(null),[p,g]=s.useState(null),m=s.useCallback(()=>{j6.delete(e.id),f(S=>S+1)},[e.id]);if(s.useEffect(()=>{e.status!=="done"&&(X0=null)},[e.status]),s.useEffect(()=>()=>{X0=null},[]),e.kind==="root")return o.jsx(z0,{className:"sc-frame",p:"8",children:o.jsxs(Vs,{direction:"column",align:"center",gap:"2",py:"6",children:[o.jsx(Lc,{className:"sc-display",size:"7",align:"center",children:"Blank canvas, full brand."}),o.jsx(Lc,{color:"gray",size:"2",align:"center",children:"Pick a Template below (engineered briefs, your product attached) or describe a visual."})]})});if(e.status==="running")return o.jsxs("div",{className:"sc-stage-wait",style:{"--sc-wait-ar":e0e(e)},children:[o.jsx(La,{since:qa(e),from:s0e(e.id)}),o.jsxs("div",{className:"sc-stage-wait-say",children:[o.jsx("span",{className:"sc-stage-wait-t",role:"timer","aria-label":`${Uw(qa(e))}, ${Ym(qa(e))} seconds`,children:Dc(qa(e))}),n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"})]})]});if(e.status==="cancelled"||e.status==="error"){const E=e.status==="cancelled"?wM():co(e.error,r);return o.jsx(lM,{failure:E,density:"stage",onRetry:t})}const w=e.status==="done"?e.images[0]:void 0,y=w?t0e(e)??(i==null?void 0:i.size)??null:null,b=!!w&&!!y&&e.status==="done"&&j6.has(e.id)&&!h1(),k=w?o.jsxs(z0,{className:y?"sc-frame sc-stage-pic":"sc-frame sc-stage-free",style:y?n0e(y):void 0,"data-arriving":b||void 0,children:[o.jsx(a0e,{hash:w,alt:e.promptHead,imgRef:h,bare:b,onPainted:(S,E,C)=>{l({hash:S,size:[E,C]}),g(S),X0=S}}),b&&o.jsx(Jy,{img:h,ready:p===w,onDone:m})]}):o.jsx(Vs,{justify:"center",children:o.jsx(z0,{className:"sc-frame",style:{display:"inline-block",maxWidth:"100%"}})});return a?o.jsxs(X1,{children:[o.jsx(Q1,{children:k}),a]}):k}const j6=new Set;let X0=null;function s0e(e){const t=Jde(e);return t!==void 0&&X0?{src:Tr(X0),at:t}:void 0}function a0e({hash:e,alt:t,onPainted:n,imgRef:r,bare:a}){const[i,l]=s.useState(null),u=s.useRef(null),f=i===e,h=g=>{!(g!=null&&g.complete)||!g.naturalWidth||g.src!==new URL(Tr(e),location.href).href||u.current!==e&&(u.current=e,l(e),n==null||n(e,g.naturalWidth,g.naturalHeight))},p=u.current&&u.current!==e?Tr(u.current):gn(e,"tile");return o.jsxs(z0,{position:"relative",style:{lineHeight:0},children:[!f&&!a&&o.jsx("img",{className:"sc-stage-under",src:p,alt:"","aria-hidden":!0,decoding:"async"}),o.jsx("img",{ref:g=>{r&&(r.current=g),h(g)},src:Tr(e),alt:t,className:"sc-stage-img","data-ready":f||void 0,onLoad:g=>h(g.currentTarget)})]})}const o0e=e=>((e==null?void 0:e.tokens)??[]).filter(t=>t&&typeof t.t=="string");function B$(e,t){return o0e(e.brief).map(r=>{var a;switch(r.t){case"text":return typeof r.v=="string"?r.v:"";case"product":return t.product(String(r.id))??"a product";case"character":return t.person(String(r.id))??"a person";case"template":return t.scene(String(r.id))??"a place";case"color":return String(r.name??r.hex??"");case"ref":return"the attached reference";case"mark":return((a=t.mark)==null?void 0:a.call(t,String(r.imageHash)))??"the brand mark";default:return""}}).join(" ").replace(/\s+/g," ").replace(/\s+([.,!?;:])/g,"$1").trim()||e.prompt||e.promptHead||""}const mv=new Set;function U$({id:e}){return mv.add(e),null}function W$({id:e,src:t,active:n}){const r=s.useRef(null),[a,i]=s.useState(!1),[,l]=s.useState(0),u=s.useCallback(()=>{mv.delete(e),l(f=>f+1)},[e]);return!mv.has(e)||h1()?o.jsx("img",{src:t,alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":n,width:52,height:52}):o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":n,children:[o.jsx("img",{ref:f=>{r.current=f,f!=null&&f.complete&&f.naturalWidth&&!a&&i(!0)},src:t,alt:"",className:"sc-thumb-landing",decoding:"async",onLoad:()=>i(!0)}),o.jsx(Jy,{img:r,ready:a,onDone:u})]})}const i0e=e=>e===0?"Original":`Refinement ${e}`,l0e=e=>e===0?"the original":`Refinement ${e}`,c0e=(e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id),u0e=e=>e.status==="cancelled"?"Stopped":"Did not finish";function d0e(e,t,n){const r=new Set(e.map(m=>m.id)),a=new Map(n.map(m=>[m.id,m]));a.set(t.id,t);const i=[...a.values()].filter(m=>!r.has(m.id)&&m.parentId!==null&&r.has(m.parentId)),l=(i.length?[...e,...i].sort(c0e):e).map(m=>a.get(m.id)??m),f=(l.some(m=>m.id===t.id)?l:[...l,t]).filter(m=>m.id===t.id||m.images[0]||m.status==="running"||m.parentId===t.id&&(m.status==="error"||m.status==="cancelled"));let h=0;const p=f.map(m=>{const w=m.images[0]?"ready":m.status==="running"?"pending":"failed";if(w==="failed"&&m.kind==="edit")return{node:m,index:-1,label:u0e(m),from:null,state:w};const y=m.kind==="edit"?++h:0;return{node:m,index:y,label:i0e(y),from:null,state:w}}),g=new Map(p.map((m,w)=>[m.node.id,w]));return p.map((m,w)=>{if(w===0||!m.node.parentId||m.node.parentId===p[w-1].node.id)return m;const y=g.get(m.node.parentId);return y===void 0||p[y].index<0?m:{...m,from:l0e(p[y].index)}})}function f0e(e,t){var n;return((n=e.find(r=>r.state==="pending"&&r.node.parentId===t))==null?void 0:n.node)??null}function K$(e,t){const n=e.find(a=>a.node.id===t);if(!n)return"";if(n.index<0)return n.label;const r=Math.max(0,...e.map(a=>a.index));return n.index===0?"Original":`Refinement ${n.index} of ${r}`}const Yh=28;function h0e({trail:e,activeId:t,names:n,onSelect:r}){var w;const a=s.useRef(null),i=s.useMemo(()=>e.map(y=>B$(y.node,n)),[e,n]),l=Fd(),u=(y,b,k)=>l.open({key:y.node.id,src:gn(y.node.images[0],"tile"),label:y.label,said:i[b],from:y.from,el:k,id:y.node.id});s.useEffect(()=>{var y,b;(b=(y=a.current)==null?void 0:y.querySelector('[aria-pressed="true"]'))==null||b.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[t]);const[f,h]=s.useState(null);s.useEffect(()=>{const y=a.current;if(!y)return;const b=()=>{const E=y.scrollWidth-y.clientWidth;if(E<=1)return h(null);const C=y.scrollLeft;h(C<=1?"end":C>=E-1?"start":"both")},k=()=>{const E=y.querySelector("[data-pending]")??y.querySelector('[aria-pressed="true"]');if(!E)return;const C=E.getBoundingClientRect(),A=y.getBoundingClientRect();C.left<A.left+Yh?y.scrollLeft-=A.left+Yh-C.left:C.right>A.right-Yh&&(y.scrollLeft+=C.right-(A.right-Yh))};b(),y.addEventListener("scroll",b,{passive:!0});const S=new ResizeObserver(()=>{k(),b()});return S.observe(y),()=>{y.removeEventListener("scroll",b),S.disconnect()}},[e.length]),s.useEffect(()=>{const y=a.current;if(!y)return;const b=k=>{y.scrollWidth<=y.clientWidth||Math.abs(k.deltaY)<=Math.abs(k.deltaX)||(k.preventDefault(),y.scrollLeft+=k.deltaY)};return y.addEventListener("wheel",b,{passive:!1}),()=>y.removeEventListener("wheel",b)},[]);const p=y=>{var E,C;const b=[...((E=a.current)==null?void 0:E.querySelectorAll(".sc-trail-tile:not([aria-disabled])"))??[]],k=b.indexOf(document.activeElement);let S=-1;if(y.key==="ArrowRight")S=Math.min(b.length-1,k+1);else if(y.key==="ArrowLeft")S=Math.max(0,k-1);else if(y.key==="Home")S=0;else if(y.key==="End")S=b.length-1;else return;y.preventDefault(),y.stopPropagation(),(C=b[S])==null||C.focus()},g=e.some(y=>y.node.id===t)?t:(w=e[0])==null?void 0:w.node.id,m=K$(e,t);return o.jsxs("div",{className:"sc-trail",children:[m&&o.jsx("span",{className:"sc-trail-say",children:m}),o.jsx("nav",{ref:a,className:"sc-thumbs","aria-label":"History of this shot","data-more":f??void 0,onKeyDown:p,children:e.map((y,b)=>{const k=y.node,S=k.id===t,E=y.state==="pending";return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-trail-tile","data-original":y.index===0&&e.length>1?"":void 0,"aria-label":`${i[b]?`${y.label}: ${i[b]}`:y.label}${E?", still rendering":""}`,"aria-pressed":S,"data-pending":E||void 0,tabIndex:k.id===g?0:-1,onClick:()=>{l.closeNow(),r(k.id)},onPointerEnter:C=>C.pointerType==="mouse"&&y.state==="ready"&&u(y,b,C.currentTarget),onPointerLeave:C=>C.pointerType==="mouse"&&l.close(),onFocus:C=>Qm(C.currentTarget)&&y.state==="ready"&&u(y,b,C.currentTarget),children:y.state==="ready"?o.jsx(W$,{id:k.id,src:gn(k.images[0],"micro"),active:S}):E?o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":S,children:[o.jsx(La,{since:qa(k)}),o.jsx(U$,{id:k.id})]}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":S,children:o.jsx(zc,{size:14})})},k.id)})}),l.shown&&o.jsx(Id,{anchor:l.shown.el,kind:"shot",src:l.shown.src,label:l.shown.label,noun:l.shown.said,note:l.shown.from?`From ${l.shown.from}`:null,onOpen:()=>{var b;const y=(b=l.shown)==null?void 0:b.id;l.closeNow(),y&&r(y)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const p0e=200,eS=32;function m0e({shots:e,activeId:t,onSelect:n,onEndReached:r,complete:a}){var y;const i=s.useRef(null),l=Fd(),u=(b,k)=>l.open({key:b.id,src:gn(b.images[0],"tile"),label:Dr(b),el:k,id:b.id}),f=s.useRef(!1);s.useLayoutEffect(()=>{var k;const b=(k=i.current)==null?void 0:k.querySelector('[aria-pressed="true"]');b&&(b.scrollIntoView({block:"center",behavior:f.current?"smooth":"auto"}),f.current=!0)},[t]);const h=s.useRef(null),p=()=>{const b=i.current,k=h.current;if(!b||!k)return;const S=b.scrollHeight-b.clientHeight,E=b.scrollTop;k.style.setProperty("--sc-shotrail-start",S>1?Math.min(1,E/eS).toFixed(3):"0"),k.style.setProperty("--sc-shotrail-end",S>1?Math.min(1,(S-E)/eS).toFixed(3):"0")};s.useLayoutEffect(()=>{const b=i.current;if(!b)return;p();const k=new ResizeObserver(p);return k.observe(b),()=>k.disconnect()},[e.length]);const g=()=>{p();const b=i.current;!b||a||b.scrollTop+b.clientHeight>=b.scrollHeight-p0e&&r()},m=b=>{var C,A;const k=[...((C=i.current)==null?void 0:C.querySelectorAll(".sc-shotrail-tile:not([aria-disabled])"))??[]],S=k.indexOf(document.activeElement);let E=-1;if(b.key==="ArrowDown")E=Math.min(k.length-1,S+1);else if(b.key==="ArrowUp")E=Math.max(0,S-1);else if(b.key==="Home")E=0;else if(b.key==="End")E=k.length-1;else return;b.preventDefault(),b.stopPropagation(),(A=k[E])==null||A.focus()},w=e.some(b=>b.id===t)?t:(y=e[0])==null?void 0:y.id;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:h,className:"sc-shotrail-shell",children:o.jsx("nav",{ref:i,className:"sc-shotrail","aria-label":"Shots in this view",onScroll:g,onKeyDown:m,children:e.map(b=>{const k=b.id===t,S=b.status==="running",E=b.status==="done"&&!!b.images[0];return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-shotrail-tile","aria-label":S?`${Dr(b)}, still rendering`:Dr(b),"aria-pressed":k,tabIndex:b.id===w?0:-1,onClick:()=>{l.closeNow(),n(b.id)},onPointerEnter:C=>C.pointerType==="mouse"&&E&&u(b,C.currentTarget),onPointerLeave:C=>C.pointerType==="mouse"&&l.close(),onFocus:C=>Qm(C.currentTarget)&&E&&u(b,C.currentTarget),children:E?o.jsx(W$,{id:b.id,src:gn(b.images[0],"micro"),active:k}):S?o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":k,children:[o.jsx(La,{since:qa(b)}),o.jsx(U$,{id:b.id})]}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":k,children:o.jsx(zc,{size:14})})},b.id)})})}),l.shown&&o.jsx(Id,{anchor:l.shown.el,kind:"shot",noun:"Shot",side:"beside",src:l.shown.src,label:l.shown.label,onOpen:()=>{var k;const b=(k=l.shown)==null?void 0:k.id;l.closeNow(),b&&n(b)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const g0e=60;function v0e({onLeft:e,onRight:t}){const n=s.useRef(null);return{onPointerDown:r=>{r.pointerType!=="mouse"&&(n.current={id:r.pointerId,x:r.clientX,y:r.clientY})},onPointerUp:r=>{const a=n.current;if(n.current=null,!a||a.id!==r.pointerId)return;const i=r.clientX-a.x,l=r.clientY-a.y;Math.abs(i)<g0e||Math.abs(i)<2*Math.abs(l)||(i<0?e():t())},onPointerCancel:()=>{n.current=null}}}function w0e(e){const t=Un(),n=Fd(),{shown:r,closeNow:a}=n,[i,l]=s.useState(null),u=i??r,f=()=>{l(null),a()};s.useEffect(()=>{if(!i)return;const w=y=>{const b=y.target;b!=null&&b.closest(".sc-chip-preview")||b!=null&&b.closest(e)||l(null)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[i,e]);const[h,p]=s.useState(null),g=w=>({"data-open":(u==null?void 0:u.key)===w.key||void 0,"aria-haspopup":"dialog",onPointerEnter:y=>y.pointerType==="mouse"&&!i&&n.open({...w,el:y.currentTarget}),onPointerLeave:y=>y.pointerType==="mouse"&&n.close(),onFocus:y=>Qm(y.currentTarget)&&!i&&n.open({...w,el:y.currentTarget}),onClick:y=>{if((i==null?void 0:i.key)===w.key){f();return}a(),l({...w,el:y.currentTarget})}}),m=o.jsxs(o.Fragment,{children:[u&&o.jsx(Id,{anchor:u.el,kind:u.kind,src:$n(u.src,"tile"),label:u.label,onOpen:()=>{const w=u;f(),w.to?t(w.to):p({src:$n(w.src,"full"),kind:w.kind,label:w.label})},onHoverIn:n.keep,onHoverOut:()=>!i&&n.close(),onClose:f},u.key),h&&o.jsx(Cd,{src:h.src,kind:h.kind,label:h.label,onClose:()=>p(null)})]});return{bind:g,isOpen:w=>(u==null?void 0:u.key)===w,surface:m}}function y0e({brief:e,prompt:t,brand:n,saidRef:r,expanded:a,clamped:i}){var T,M;const{scenes:l,presenters:u,demoProducts:f}=Mn(),h=w0e(".sc-ingredient"),p=(e==null?void 0:e.tokens)??[],g=((T=n==null?void 0:n.json)==null?void 0:T.products)??[],m=((M=n==null?void 0:n.json)==null?void 0:M.characters)??[],w=Qc(n),y=rf(n==null?void 0:n.json),[b,k]=s.useState({});s.useEffect(()=>{for(const j of p){if((j==null?void 0:j.t)!=="template")continue;const P=w.find(H=>H.id===j.id);if(!(P!=null&&P.previewUrl)||ud(P.previewColor))continue;const R=`t${j.id}`;kL(P.previewUrl).then(H=>{const D=ud(H??void 0);D&&k(U=>U[R]?U:{...U,[R]:D})})}});const S={products:g,demoProducts:f,cast:m,presenters:u,scenes:[...w,...l]},E=j=>{var R,H;const P=gL(j,S);if((P==null?void 0:P.kind)==="product"){const{product:D,demo:U}=P;return{key:`p${j.id}`,kind:"product",label:(D==null?void 0:D.name)??(U==null?void 0:U.name)??"product",thumb:D?Zm((H=(R=D==null?void 0:D.shots)==null?void 0:R[0])==null?void 0:H.file,"micro"):(U==null?void 0:U.previewUrl)??null,to:n&&(D||U)?Ea(n,j.id):void 0}}if((P==null?void 0:P.kind)==="presenter"){const{character:D,presenter:U}=P,V=(U==null?void 0:U.id)??(D==null?void 0:D.presenterId)??((D==null?void 0:D.origin)==="custom"?D.id:void 0),B=D?Xw(D):U?ki(U):{src:null};return{key:`h${j.id}`,kind:"presenter",label:D!=null&&D.supersededBy?`${D.name}, edited since`:(D==null?void 0:D.name)??(U==null?void 0:U.name)??"someone",thumb:B.src,crop:B.crop,to:n&&V?Ra(n,V):void 0}}if((P==null?void 0:P.kind)==="scene"){const D=P.scene;return{key:`t${j.id}`,kind:"scene",label:(D==null?void 0:D.name)??"a place no longer in the catalog",thumb:(D==null?void 0:D.previewUrl)??null,to:n&&D?zr(n,D.id):void 0,tint:ud(D==null?void 0:D.previewColor),custom:P.custom}}if((j==null?void 0:j.t)==="color")return{key:`c${j.hex}`,kind:"color",label:j.name??j.hex,swatch:j.hex};if((j==null?void 0:j.t)==="ref")return{key:`r${j.imageHash}`,kind:"ref",label:j.label??"reference image",thumb:gn(j.imageHash,"micro"),previewHash:j.imageHash};if((j==null?void 0:j.t)==="mark"){const D=y.find(U=>U.hash===j.imageHash);return{key:`m${j.imageHash}`,kind:"mark",label:D?Xm(n==null?void 0:n.json,D):"brand mark",thumb:gn(j.imageHash,"micro"),previewHash:j.imageHash}}return null},C=j=>{const P=o.jsxs(o.Fragment,{children:[j.thumb?o.jsx("img",{src:j.thumb,alt:"","data-crop":j.crop}):j.swatch?o.jsx("i",{style:{background:j.swatch}}):null,j.label]}),R=j.tint??(j.custom?b[j.key]:void 0),H=R?{"--tint":R}:void 0,D=(j.previewHash?gn(j.previewHash,"tile"):$n(j.thumb,"tile"))??(j.to?"":null);if(D!==null&&hp(j.kind)){const U=j.kind,V=h.isOpen(j.key),B={key:j.key,src:D,kind:U,label:j.label,to:j.to};return o.jsx("button",{type:"button",className:"sc-ingredient","data-kind":j.kind,"data-tinted":R?"":void 0,style:H,title:V?void 0:`${j.label}. Preview.`,"aria-label":`${j.label}. Preview.`,...h.bind(B),children:P},j.key)}return o.jsx("span",{className:"sc-ingredient","data-kind":j.kind,"data-tinted":R?"":void 0,style:H,title:j.label,children:P},j.key)},A=[];for(const j of p){if(j.t==="text"){const R=j.v.trim();R&&A.push(R);continue}const P=E(j);P&&A.push(C(P))}if(!A.length&&!t)return null;const L=A.flatMap((j,P)=>P?[" ",j]:[j]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:r,className:"sc-brief-said","data-expanded":a||void 0,"data-clamped":i||void 0,dir:"auto",children:L.length?L:t||""}),h.surface]})}const b0e=256,ll=new Map;function gv(e,t){for(ll.delete(e),ll.set(e,t);ll.size>b0e;)ll.delete(ll.keys().next().value)}function G$(e,t){const n=new Map(e.map(a=>[a.id,a])),r=[];for(let a=t.parentId?n.get(t.parentId):void 0;a;a=a.parentId?n.get(a.parentId):void 0)r.unshift(a);return{ancestors:r,siblings:e.filter(a=>a.parentId===t.parentId),children:e.filter(a=>a.parentId===t.id),history:e}}function x0e(e,t){gv(e,t);for(const n of t.history??[])n.id!==e&&gv(n.id,G$(t.history??[],n))}function tS(e){const t=e.parentId?ll.get(e.parentId):void 0,n=t==null?void 0:t.history;if(!n)return;const r=n.some(a=>a.id===e.id)?n.map(a=>a.id===e.id?e:a):[...n,e];for(const a of r)gv(a.id,G$(r,a))}function k0e(e){var i;const[t,n]=s.useState(()=>{const l=ll.get(e.id);return l?{id:e.id,lineage:l}:null});s.useEffect(()=>{let l=!0;return Ee.lineage(e.id).then(u=>{l&&(x0e(e.id,u),n({id:e.id,lineage:u}))}).catch(()=>{}),()=>{l=!1}},[e.id,e.childCount,e.status,e.parentId]);const r=(t==null?void 0:t.id)===e.id?t.lineage:ll.get(e.id)??null;if(!r)return{ancestors:[],children:[],siblings:[e],sibIndex:0,parentShot:null,history:null,rootId:e.id,loaded:!1};const a=r.siblings.some(l=>l.id===e.id)?r.siblings:[e,...r.siblings];return{ancestors:r.ancestors,children:r.children,siblings:a,sibIndex:a.findIndex(l=>l.id===e.id),parentShot:r.ancestors[r.ancestors.length-1]??null,history:r.history??null,rootId:((i=r.ancestors[0])==null?void 0:i.id)??e.id,loaded:!0}}const S0e=32,cl=new Map;function E0e(e){for(cl.delete(e.id),cl.set(e.id,e);cl.size>S0e;)cl.delete(cl.keys().next().value)}function C0e(e){const[t,n]=s.useState(()=>cl.get(e.id)??null);return s.useEffect(()=>{const r=cl.get(e.id);if(r){n(r);return}let a=!0;return Ee.node(e.id).then(i=>{a&&(E0e(i),n(i))}).catch(()=>{}),()=>{a=!1}},[e.id]),(t==null?void 0:t.id)===e.id?t:cl.get(e.id)??null}const j0e="(max-width: 1023px)",Y$=380,q$=480,nS=380,Hu=e=>Math.min(q$,Math.max(Y$,Math.round(e)));function A0e({node:e,rootId:t,items:n,loadMore:r,complete:a,brand:i,engines:l,projectId:u,onClose:f,onSelect:h,onRetry:p,onCancel:g,onKeep:m,onLanded:w,onRemix:y,onArchive:b,onUnarchive:k,onDelete:S,onRefined:E,subscribeActivity:C,tokenNames:A}){const{ancestors:L,children:T,history:M}=k0e(e),j=C0e(e),P=s.useMemo(()=>l.find(xe=>xe.id===e.engineId),[l,e.engineId]),{push:R}=rr(),[H,D]=Ma(qr.ovlPanelW,nS),U=s.useRef(0),V=s.useRef(0),B=s.useRef(null),G=s.useMemo(()=>{var xe;return(((xe=e.brief)==null?void 0:xe.tokens)??[]).some(Je=>(Je==null?void 0:Je.t)&&Je.t!=="text"&&Je.t!=="format")},[e.brief]),_=s.useMemo(()=>{const xe=rf(i.json);return{...A,mark:Je=>{const Et=xe.find(Xe=>Xe.hash===Je);return Et?Xm(i.json,Et):null}}},[A,i]),O=s.useMemo(()=>B$(j??e,_),[j,e,_]),[I,K]=s.useState(!1),[z,q]=s.useState(!1),[Z,ee]=s.useState(!1),[he,ue]=s.useState(!1),[ge,te]=s.useState(!1),[J,Q]=s.useState(!1);s.useEffect(()=>{ee(!1),Q(!1),ue(!1)},[e.id]),s.useEffect(()=>{if(!Z)return;const xe=setTimeout(()=>ee(!1),1400);return()=>clearTimeout(xe)},[Z]),s.useEffect(()=>{if(!J)return;const xe=setTimeout(()=>Q(!1),1400);return()=>clearTimeout(xe)},[J]);const[ae,$e]=s.useState(null);Dy(ae,"--sc-ovl-dock-h");const ie=s.useRef(null),[ke,ze]=s.useState(!1),[wt,Ke]=s.useState(!1);s.useEffect(()=>ze(!1),[e.id]),s.useLayoutEffect(()=>{const xe=ie.current;if(!xe||ke)return;const Je=()=>Ke(xe.scrollHeight>xe.clientHeight+1);Je();const Et=new ResizeObserver(Je);return Et.observe(xe),()=>Et.disconnect()},[O,ke]);const[tt,De]=s.useState([]);s.useEffect(()=>{if(!(!C||tt.length===0))return C(xe=>{const Je=new Map(xe.map(Et=>[Et.id,Et]));De(Et=>{const Xe=Et.map(rt=>Je.get(rt.id)??rt);return Xe.some((rt,nt)=>rt!==Et[nt])?Xe:Et})})},[C,tt.length]);const Se=s.useMemo(()=>d0e(M??[...L,e,...T.slice(0,6)],e,tt.length?[...n,...tt]:n),[M,L,e,T,n,tt]),X=s.useMemo(()=>f0e(Se,e.id),[Se,e.id]);s.useEffect(()=>{const xe=tt.find(Je=>Je.status==="done"&&Je.images[0]);xe&&(De(Je=>Je.filter(Et=>Et.id!==xe.id)),tS(xe),e.id===xe.parentId&&h(xe.id))},[tt,e.id,h]);const je=s.useMemo(()=>Se.find(xe=>xe.node.id===e.id)??null,[Se,e.id]),Re=Nr(j0e),re=Se.length>1&&Re?K$(Se,e.id):e.kind!=="edit"?"Shot":M&&je?je.label:"Refinement",Y=s.useMemo(()=>h4(n,e.id),[n,e.id]);s.useEffect(()=>{Y.at>=0&&!a&&n.length-Y.at<=6&&r()},[Y.at,n.length,a,r]);const se=xe=>{const Je=xe>0?Y.next:Y.prev;Je&&h(Je.id)},Ne=Fd(),Be=(xe,Je)=>xe!=null&&xe.images[0]?{onPointerEnter:Et=>{Et.pointerType==="mouse"&&Ne.open({key:xe.id,src:gn(xe.images[0],"tile"),label:Dr(xe),noun:Je,el:Et.currentTarget,id:xe.id})},onPointerLeave:Et=>{Et.pointerType==="mouse"&&Ne.close()}}:{},st=v0e({onLeft:()=>se(1),onRight:()=>se(-1)});s.useEffect(()=>{const xe=Ne.shown;if(!xe)return;const Je=xe.noun==="Next shot"?Y.next:Y.prev;Je!=null&&Je.images[0]?Ne.open({key:Je.id,src:gn(Je.images[0],"tile"),label:Dr(Je),noun:xe.noun,el:xe.el,id:Je.id}):Ne.closeNow()},[e.id]),s.useEffect(()=>{var Xe,rt;const xe=Se.findIndex(nt=>nt.node.id===e.id),Et=[(Xe=Se[xe-1])==null?void 0:Xe.node,(rt=Se[xe+1])==null?void 0:rt.node,Y.prev,Y.next].filter(nt=>!!(nt!=null&&nt.images[0])).map(nt=>{var Yt;const qt=new Image;return qt.decoding="async",qt.src=gn(nt.images[0],"tile"),(Yt=qt.decode)==null||Yt.call(qt).catch(()=>{}),qt});return()=>{for(const nt of Et)nt.src=""}},[Se,e.id,Y.prev,Y.next]);const Pe=e.images[0],Oe=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",Ge=async(xe=!1)=>{if(!z){q(!0);try{const Je=fetch(Tr(Pe)).then(Et=>{if(!Et.ok)throw new Error(`HTTP ${Et.status}`);return Et.blob()});await navigator.clipboard.write([new ClipboardItem({"image/png":Je})]),xe?R({kind:"success",title:"Copied to clipboard"}):ee(!0)}catch(Je){R(ln(Je,"Copy failed"))}finally{q(!1)}}},ft=async()=>{if(!he){ue(!0);try{await(e.archived?k(e):b(e))}finally{ue(!1)}}},bt=async()=>{if(!ge){te(!0);try{const xe=e.brief?dy(e.brief):null;if(!xe||xe.every(Je=>Je.t==="text"&&!Je.v.trim()))await navigator.clipboard.writeText(O);else{const Je=rt=>{var nt;switch(rt.t){case"text":return rt.v;case"product":return _.product(rt.id)??"a product";case"character":return _.person(rt.id)??"a person";case"template":return _.scene(rt.id)??"a place";case"color":return rt.name??rt.hex;case"ref":return"reference image";case"mark":return((nt=_.mark)==null?void 0:nt.call(_,rt.imageHash))??"brand mark"}},{text:Et,html:Xe}=Kte(xe,Je);await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Et],{type:"text/plain"}),"text/html":new Blob([Xe],{type:"text/html"})})])}Q(!0)}catch(xe){R(ln(xe,"Copy failed"))}finally{te(!1)}}};s.useEffect(()=>{const xe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xe}},[]);const at=[{key:"download",label:"Download",icon:o.jsx(ME,{size:14}),onClick:()=>{const xe=document.createElement("a");xe.href=Tr(Pe),xe.download=`${Oe}.png`,xe.click()}},{key:"keep",label:e.kept?"Remove from keepers":"Keep",icon:o.jsx(eo,{size:14,weight:e.kept?"fill":"regular"}),onClick:()=>m(e),tint:e.kept?"var(--sc-star)":void 0,on:e.kept},{key:"copy",label:"Copy image",icon:Z?o.jsx(Gn,{size:14,weight:"bold"}):o.jsx(Qx,{size:14}),onClick:()=>void Ge(),onMenu:()=>void Ge(!0),busy:z,said:Z?"Copied":void 0}],Zt=[{key:"archive",label:e.archived?"Restore":"Archive",icon:e.archived?o.jsx(t1,{size:14}):o.jsx(fm,{size:14}),onClick:()=>void ft(),busy:he},...e.archived?[{key:"delete",label:"Delete permanently",icon:o.jsx(vm,{size:14}),onClick:()=>K(!0),tint:"var(--sc-red)",dialog:!0}]:[]],jt=e.status==="done"&&e.images.length>0,Ft=!jt&&e.kind!=="edit"&&!!e.brief,Pt=jt?[...at,...Zt]:Zt,Tt=jt?o.jsx(J1,{children:Pt.map(xe=>o.jsxs(ef,{onSelect:xe.onMenu??xe.onClick,disabled:xe.busy,color:xe.tint?"red":void 0,children:[xe.icon,xe.label]},xe.key))}):void 0;return Br.createPortal(o.jsx(Md,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:xe=>{var Je;xe.preventDefault(),(Je=B.current)==null||Je.focus({preventScroll:!0})},children:o.jsxs("div",{ref:B,tabIndex:-1,className:"sc-ovl","data-fb":"shot-overlay","data-fb-node":e.id,role:"dialog","aria-modal":"true","aria-label":Dr(e),"data-rail":n.length>1?"":void 0,style:{"--sc-ovl-panel-w":`${Hu(H)}px`},children:[n.length>1&&o.jsx(m0e,{shots:n,activeId:e.id,onSelect:h,onEndReached:r,complete:a}),o.jsxs("header",{className:"sc-ovl-bar",children:[o.jsxs("div",{className:"sc-ovl-bar-l",children:[o.jsx(hr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:f,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),Y.at>=0&&n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Y.prev,onClick:()=>Y.prev&&h(Y.prev.id),"aria-label":"Previous shot",...Be(Y.prev,"Previous shot"),children:o.jsx(Ta,{size:13})}),o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Y.next,onClick:()=>Y.next&&h(Y.next.id),"aria-label":"Next shot",...Be(Y.next,"Next shot"),children:o.jsx(Nl,{size:13})})]})]}),Pt.length>0&&o.jsxs("div",{className:"sc-ovl-bar-r",children:[o.jsx("div",{className:"sc-ovl-acts",children:Pt.map(xe=>o.jsx(hr,{label:xe.said??xe.label,open:!!xe.said,children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:xe.onClick,"aria-label":xe.label,"aria-pressed":xe.on===void 0?void 0:xe.on,"data-on":xe.on||void 0,"aria-haspopup":xe.dialog?"dialog":void 0,"aria-busy":xe.busy||void 0,"data-busy":xe.busy||void 0,style:xe.tint?{color:xe.tint}:void 0,children:xe.icon})},xe.key))}),o.jsxs(Cs,{children:[o.jsx(hr,{label:"More actions",children:o.jsx(js,{children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-overflow","aria-label":"More actions",children:o.jsx($v,{size:18,weight:"bold"})})})}),o.jsx(As,{align:"end",sideOffset:6,children:Pt.map(xe=>o.jsxs(Wn,{onSelect:xe.onMenu??xe.onClick,disabled:xe.busy,color:xe.tint?"red":void 0,children:[xe.icon,xe.label]},xe.key))})]})]})]}),o.jsx(B1,{open:I,onOpenChange:K,children:o.jsxs(U1,{maxWidth:"420px",children:[o.jsx(W1,{children:"Delete this shot permanently?"}),o.jsx(K1,{size:"2",children:"This cannot be undone."}),o.jsxs(Vs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Y1,{children:o.jsx(Sa,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(G1,{children:o.jsx(Sa,{color:"red",onClick:()=>S(e),children:"Delete permanently"})})]})]})}),Ne.shown&&o.jsx(Id,{anchor:Ne.shown.el,kind:"shot",noun:Ne.shown.noun,src:Ne.shown.src,label:Ne.shown.label,onOpen:()=>{var Je;const xe=(Je=Ne.shown)==null?void 0:Je.id;Ne.closeNow(),xe&&h(xe)},onHoverIn:Ne.keep,onHoverOut:Ne.close,onClose:Ne.closeNow},Ne.shown.key),o.jsxs("div",{className:"sc-ovl-stage","data-takes":Se.length>1?"":void 0,...st,children:[o.jsx(r0e,{node:e,onRetry:()=>p(e),onCancel:()=>g(e),engineName:P==null?void 0:P.displayName,menu:Tt}),Se.length>1?o.jsx(h0e,{trail:Se,activeId:e.id,names:_,onSelect:h}):o.jsx("div",{className:"sc-trail sc-trail-empty","aria-hidden":!0})]}),o.jsx("div",{className:"sc-ovl-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize the details panel","aria-valuemin":Y$,"aria-valuemax":q$,"aria-valuenow":Hu(H),tabIndex:0,onPointerDown:xe=>{xe.button===0&&(xe.preventDefault(),xe.stopPropagation(),xe.currentTarget.setPointerCapture(xe.pointerId))},onPointerMove:xe=>{if(!xe.currentTarget.hasPointerCapture(xe.pointerId))return;const Je=xe.currentTarget.closest(".sc-ovl");U.current=xe.clientX,!V.current&&(V.current=requestAnimationFrame(()=>{V.current=0,Je==null||Je.style.setProperty("--sc-ovl-panel-w",`${Hu(window.innerWidth-U.current)}px`)}))},onPointerUp:xe=>{xe.currentTarget.hasPointerCapture(xe.pointerId)&&(xe.currentTarget.releasePointerCapture(xe.pointerId),D(Hu(window.innerWidth-xe.clientX)))},onDoubleClick:xe=>{xe.stopPropagation(),D(nS)},onKeyDown:xe=>{xe.key==="ArrowLeft"?D(Je=>Hu(Je+16)):xe.key==="ArrowRight"&&D(Je=>Hu(Je-16))}}),o.jsxs("aside",{className:"sc-ovl-meta",children:[o.jsxs("div",{className:"sc-ovl-scroll",children:[o.jsxs("div",{className:"sc-ovl-head",children:[o.jsx("b",{children:re}),e.archived&&o.jsx("small",{className:"sc-ovl-flag",children:"archived"}),jt&&e.costUsd>0&&o.jsxs("small",{className:"sc-ovl-spend",title:"Of your API budget",children:["$",e.costUsd.toFixed(2)]})]}),e.kind!=="root"&&(O||G)&&o.jsxs("div",{className:"sc-ovl-sec sc-ovl-brief",children:[o.jsxs("div",{className:"sc-ovl-brief-head",children:[o.jsx("span",{className:"sc-eyebrow",children:"Prompt"}),o.jsx(hr,{label:J?"Copied":"Copy the prompt",open:J||void 0,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-copy","aria-label":"Copy the prompt","aria-busy":ge||void 0,"data-busy":ge?"":void 0,onClick:()=>void bt(),children:J?o.jsx(Gn,{size:14,weight:"bold"}):o.jsx(Qx,{size:14})})})]}),o.jsx("div",{className:"sc-brief-record",children:o.jsx(y0e,{brief:e.brief,prompt:(j==null?void 0:j.prompt)??e.promptHead,brand:i,saidRef:ie,expanded:ke,clamped:wt&&!ke})}),(wt||ke)&&o.jsx("button",{type:"button",className:"sc-s sc-ovl-more","aria-expanded":ke,onClick:()=>ze(xe=>!xe),children:ke?o.jsxs(o.Fragment,{children:[o.jsx(hF,{size:12})," Show less"]}):o.jsxs(o.Fragment,{children:[o.jsx(xl,{size:12})," Show more"]})})]}),(jt||Ft)&&o.jsxs("div",{className:"sc-sugg",children:[Ft&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Put this prompt back in the composer, to change and run again",children:[o.jsx(Ad,{size:12})," Edit the prompt"]}),jt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>p(e),title:"Run the same setup again for a different take",children:[o.jsx(t1,{size:12})," Try again"]}),jt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Start a new shot from this setup: same prompt, chips, shape and count, ready to change",children:[o.jsx(mp,{size:12})," Reuse setup"]})]})]}),(jt||e.status==="running")&&o.jsx("div",{className:"sc-ovl-edit sc-dock",ref:$e,children:o.jsx(Ty,{variant:"overlay",projectId:u,brand:i,engines:l,parentId:t,target:e,holdFor:e.status==="running"?e:X,sourceImage:Pe,persistDraft:!1,onQueued:(xe,Je,Et,Xe)=>{w(Xe??[]);const rt=Je==="edit"?Xe==null?void 0:Xe.find(nt=>nt.id===xe):void 0;rt?(Qde(rt.id),tS(rt),De(nt=>[...nt.filter(qt=>qt.id!==rt.id),rt]),h(rt.id)):xe&&h(xe),xe&&(E==null||E(xe,Je))}})})]})]})}),document.body)}function rS(){const{shotId:e}=aa(),t=RH(),{push:n}=rr(),r=e?t.byId.get(e)??null:null,[a,i]=s.useState(null);s.useEffect(()=>{if(!e||r)return;let g=!0;return Ee.node(e).then(m=>g&&i({id:e,node:m.kind==="root"?null:m})).catch(()=>g&&i({id:e,node:null})),()=>{g=!1}},[e,r]);const l=s.useRef(a);l.current=a,s.useEffect(()=>{if(!e||r)return;let g=!0;const m=t.subscribeActivity(w=>{const y=w.find(k=>k.id===e);if(y)return i({id:e,node:y});const b=l.current;(b==null?void 0:b.id)!==e||!b.node||!Z$([b.node],w).length||Ee.node(e).then(k=>g&&i({id:e,node:k.kind==="root"?null:k})).catch(()=>{})});return()=>{g=!1,m()}},[e,r,t.subscribeActivity]);const u=r??(a!==null&&a.id===e?a.node:null),f=!r&&a!==null&&a.id===e&&a.node===null,h=s.useRef(null);u&&(h.current=u);const p=u??(f?null:h.current);return s.useEffect(()=>{f&&(n({kind:"info",title:"That shot is no longer available",detail:"Back to the feed."}),t.close())},[f,t.close,n]),p?o.jsx(A0e,{node:p,rootId:t.rootId,items:t.items,loadMore:t.loadMore,complete:t.complete,brand:t.brand,engines:t.engines,projectId:t.projectId,onClose:t.close,onSelect:t.select,onRetry:t.retry,onCancel:t.cancel,onKeep:t.keep,onLanded:t.landed,onRefined:t.refined,subscribeActivity:t.subscribeActivity,tokenNames:t.tokenNames,onRemix:t.remix,onArchive:()=>t.archive(p),onUnarchive:()=>t.unarchive(p),onDelete:()=>t.delete(p)}):f?null:o.jsx("div",{className:"sc-ovl-wait",role:"status","aria-label":"Loading",children:o.jsx(Pr,{size:"3"})})}const sS=10;function N0e(){const{status:e,recent:t,history:n,featured:r,running:a,releasesUrl:i,notesFor:l,markSeen:u}=eu(),{hash:f}=Bn(),h=f.startsWith("#v")?n.findIndex(S=>`#v${S.version}`===f)+1:0,[p,g]=s.useState(sS),m=Math.min(n.length,Math.max(p,t.length,h)),w=m<n.length,y=s.useRef(null),b=S=>{var E;y.current=S?((E=n[m])==null?void 0:E.version)??null:null,g(m+sS)};s.useEffect(()=>{var E,C;const S=y.current;y.current=null,!(!S||w)&&((C=(E=document.getElementById(`v${S}`))==null?void 0:E.querySelector("h2"))==null||C.focus())},[m,w]),s.useEffect(()=>{e==="ready"&&u()},[e,u]);const k=s.useRef(null);return s.useEffect(()=>{let S=0;const E=requestAnimationFrame(()=>{S=window.setTimeout(()=>{var C;return(C=k.current)==null?void 0:C.focus({preventScroll:!0})},0)});return()=>{cancelAnimationFrame(E),window.clearTimeout(S)}},[]),s.useEffect(()=>{var S;e!=="ready"||!f||(S=document.getElementById(decodeURIComponent(f.slice(1))))==null||S.scrollIntoView({block:"start"})},[e,f]),o.jsx(ds,{children:o.jsxs("main",{className:"sc-wn-page",id:"main","aria-labelledby":"sc-wn-title",children:[o.jsxs("header",{className:"sc-wn-page-head",children:[o.jsx("h1",{id:"sc-wn-title",ref:k,tabIndex:-1,children:"What's new"}),o.jsx("p",{children:"What changed in Scenri, newest first."})]}),e==="failed"?o.jsx("p",{className:"sc-wn-txt",children:FR}):e==="ready"&&n.length===0?o.jsx("p",{className:"sc-wn-txt",children:_R}):o.jsxs(o.Fragment,{children:[o.jsx("ol",{className:"sc-wn-list",children:n.slice(0,m).map(S=>o.jsx(M0e,{current:S.version===a,entry:S,lead:S.version===(r==null?void 0:r.version),notes:l(S.version)},S.version))}),w&&o.jsx(R0e,{count:m,onMore:b})]}),e==="ready"&&i&&o.jsxs("footer",{className:"sc-wn-page-foot",children:[o.jsx("p",{children:"Every version, and every fix the notes here leave out, is in the full release notes."}),o.jsxs("a",{className:"sc-wn-link",href:i,target:"_blank",rel:"noopener noreferrer",children:["Full release notes",o.jsx("span",{className:"sc-vh",children:" on GitHub, opens in a new tab"}),o.jsx(Ac,{size:13,"aria-hidden":"true"})]})]})]})})}function M0e({entry:e,lead:t,current:n,notes:r}){const a=!!e.announce,i=VR(e),[l,u]=s.useState(!1);return o.jsxs("li",{className:"sc-wn-row",id:`v${e.version}`,"data-kind":a?"headline":"small","data-lead":t||void 0,children:[o.jsx(BR,{entry:e,current:n}),o.jsxs("div",{className:"sc-wn-what",children:[e.title&&o.jsx("h2",{className:"sc-wn-row-hed",tabIndex:-1,children:e.title}),i&&o.jsx(ZR,{picture:i,eager:t,onOpen:()=>u(!0)}),o.jsx(Uee,{sections:e.sections}),r&&o.jsx(Kee,{href:r,version:e.version})]}),l&&i&&o.jsx(Bee,{src:i.src,alt:i.alt,onClose:()=>u(!1)})]})}function R0e({count:e,onMore:t}){const n=s.useRef(null),r=s.useRef(t);return r.current=t,s.useEffect(()=>{const a=n.current;if(!a||typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(l=>l.some(u=>u.isIntersecting)&&r.current(!1),{rootMargin:"0px 0px 480px 0px"});return i.observe(a),()=>i.disconnect()},[e]),o.jsx("div",{className:"sc-wn-more",children:o.jsx("button",{ref:n,type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>r.current(document.activeElement===n.current),children:"Show older updates"})})}function P0e(){const e=BS();return o.jsx(Vs,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Iw,{failure:{kind:"unknown",title:"This page could not be shown.",fix:"Reloading usually brings it back.",raw:String((e==null?void 0:e.message)??e??""),retryable:!0},action:o.jsx(Sa,{size:"1",variant:"soft",color:"gray",onClick:()=>window.location.reload(),children:"Reload"})})})}function L0e(){const{setSlug:e=""}=aa(),{pathname:t,search:n}=Bn(),{brand:r,sets:a,loaded:i,refresh:l}=cn(),u=Un(),f=mn({path:pt.set,end:!1}),h=a.find(m=>m.slug===e)??a.find(m=>m.id===e)??null;qc(h==null?void 0:h.name);const[p,g]=s.useState(null);if(s.useEffect(()=>{if(!i||h)return;if(p===e){u(Sr(r),{replace:!0});return}let m=!0;return l().finally(()=>m&&g(e)),()=>{m=!1}},[i,h,e,p,r,u,l]),s.useEffect(()=>{h&&g(null)},[h]),!i||!h)return null;if(h.slug!==e){const m=f?t.slice(f.pathnameBase.length):"";return o.jsx(Pa,{to:$0(r,h)+m+n,replace:!0})}return o.jsx(z$,{set:h},h.id)}function $0e(){const{pathname:e,search:t}=Bn();return o.jsx(Pa,{to:bY(e,t),replace:!0})}function aS(){const{pathname:e,search:t,hash:n}=Bn();return o.jsx(Pa,{to:EY(e,t,n),replace:!0})}function T0e(){const{brandSlug:e}=aa();return o.jsx(Pa,{to:`/${e}?settings=brand`,replace:!0})}function D0e(){const{sceneId:e}=aa();return o.jsxs(o.Fragment,{children:[o.jsx(nle,{},e),o.jsx(Zc,{})]})}function H0e(){const{presenterId:e}=aa();return o.jsxs(o.Fragment,{children:[o.jsx(ule,{},e),o.jsx(Zc,{},e)]})}function O0e(){const{productId:e}=aa();return o.jsx(sde,{},e)}const I0e=CO([{element:o.jsx(cae,{}),errorElement:o.jsx(P0e,{}),children:[{index:!0,element:o.jsx(ote,{})},{path:pt.setup,element:o.jsx(gae,{})},{path:pt.legacy,element:o.jsx($0e,{})},{path:pt.brand,element:o.jsx(eae,{}),children:[{index:!0,element:o.jsx(Uie,{})},{path:pt.hub,element:o.jsx(z$,{set:null}),children:[{path:pt.hubShot,element:o.jsx(rS,{})}]},{path:pt.set,element:o.jsx(L0e,{}),children:[{path:pt.setShot,element:o.jsx(rS,{})}]},{path:pt.kit,element:o.jsx(T0e,{})},{path:pt.whatsNew,element:o.jsx(N0e,{})},{path:pt.products,element:o.jsx(Uue,{})},{path:pt.product,element:o.jsx(O0e,{})},{path:pt.scenes,element:o.jsx(qie,{}),children:[{path:pt.sceneStudio,element:o.jsx(_7,{})}]},{path:pt.scene,element:o.jsx(D0e,{}),children:[{path:pt.sceneEdit,element:o.jsx(_7,{})}]},{path:pt.presenters,element:o.jsx(cle,{}),children:[{path:pt.presenterStudio,element:o.jsx(jue,{})}]},{path:pt.presenter,element:o.jsx(H0e,{}),children:[{path:pt.presenterEdit,element:o.jsx(gue,{})}]},{path:pt.legacyPresenters,element:o.jsx(aS,{})},{path:pt.legacyScenes,element:o.jsx(aS,{})}]},{path:pt.notFound,element:o.jsx(Pa,{to:pt.root,replace:!0})}]}]),A6=localStorage.getItem("sc-theme")??localStorage.getItem("bt-theme");document.documentElement.dataset.theme=A6==="light"||A6==="dark"?A6:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";WX();const F0e={color:"currentColor",size:"1em",weight:"regular",mirrored:!1,"aria-hidden":!0};fD.createRoot(document.getElementById("root")).render(o.jsx(zn.StrictMode,{children:o.jsx(YS.Provider,{value:F0e,children:o.jsx(GG,{children:o.jsx(tY,{children:o.jsx(YH,{router:I0e})})})})}));
|