Changeset 3509467
- Timestamp:
- 04/18/2026 06:00:02 AM (6 months ago)
- Location:
- strakture
- Files:
-
- 4 added
- 2 deleted
- 26 edited
- 1 copied
-
tags/1.1.5 (copied) (copied from strakture/trunk )
-
tags/1.1.5/app/Admin/OnboardingController.php (modified) (2 diffs)
-
tags/1.1.5/app/Library/Controllers/SiteController.php (modified) (3 diffs)
-
tags/1.1.5/app/Shared/Admin.php (modified) (2 diffs)
-
tags/1.1.5/app/Shared/Services/SiteTypeSync.php (added)
-
tags/1.1.5/content (deleted)
-
tags/1.1.5/public/build/strakture-library.asset.php (modified) (1 diff)
-
tags/1.1.5/public/build/strakture-library.js (modified) (1 diff)
-
tags/1.1.5/public/build/strakture-onboarding.asset.php (modified) (1 diff)
-
tags/1.1.5/public/build/strakture-onboarding.js (modified) (1 diff)
-
tags/1.1.5/public/img/__video-thumb.jpg (added)
-
tags/1.1.5/public/img/video-thumb.jpg (modified) ( previous)
-
tags/1.1.5/readme.txt (modified) (3 diffs)
-
tags/1.1.5/strakture.php (modified) (1 diff)
-
tags/1.1.5/vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
tags/1.1.5/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.1.5/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/app/Admin/OnboardingController.php (modified) (2 diffs)
-
trunk/app/Library/Controllers/SiteController.php (modified) (3 diffs)
-
trunk/app/Shared/Admin.php (modified) (2 diffs)
-
trunk/app/Shared/Services/SiteTypeSync.php (added)
-
trunk/content (deleted)
-
trunk/public/build/strakture-library.asset.php (modified) (1 diff)
-
trunk/public/build/strakture-library.js (modified) (1 diff)
-
trunk/public/build/strakture-onboarding.asset.php (modified) (1 diff)
-
trunk/public/build/strakture-onboarding.js (modified) (1 diff)
-
trunk/public/img/__video-thumb.jpg (added)
-
trunk/public/img/video-thumb.jpg (modified) ( previous)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/strakture.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
strakture/tags/1.1.5/app/Admin/OnboardingController.php
r3499596 r3509467 10 10 11 11 use Strakture\Shared\Services\Sanitizer; 12 use Strakture\Shared\Services\SiteTypeSync; 12 13 13 14 /** … … 47 48 48 49 if ( isset( $data['site_type'] ) ) { 49 \update_option( 'strakture_site_type', $data['site_type'] ); 50 $data['site_type'] = SiteTypeSync::sync( $data['site_type'] ); 51 \update_option( 'strakture_onboarding_settings', $data ); 50 52 } 51 53 -
strakture/tags/1.1.5/app/Library/Controllers/SiteController.php
r3472592 r3509467 10 10 11 11 use Strakture\Shared\Services\Sanitizer; 12 use Strakture\Shared\Services\SiteTypeSync; 12 13 13 14 /** … … 35 36 public static function store( $request ) { 36 37 $data = json_decode( $request->get_param( 'state' ), true ); 37 \update_option( 'strakture_library_site_data', Sanitizer::sanitizeArray( $data ) ); 38 $data = is_array( $data ) ? Sanitizer::sanitizeArray( $data ) : array(); 39 40 \update_option( 'strakture_library_site_data', $data ); 41 42 if ( isset( $data['state']['siteType'] ) ) { 43 SiteTypeSync::sync( $data['state']['siteType'] ); 44 } 45 38 46 return new \WP_REST_Response( $data ); 39 47 } … … 52 60 $snakeKey = strtolower( preg_replace( '/[A-Z]/', '_$0', $key ) ); 53 61 54 \update_option( 'strakture_' . $snakeKey, Sanitizer::sanitizeUnknown( $value ) ); 62 if ( 'site_type' === $snakeKey ) { 63 $value = SiteTypeSync::sync( $value ); 64 } else { 65 $value = Sanitizer::sanitizeUnknown( $value ); 66 \update_option( 'strakture_' . $snakeKey, $value ); 67 } 68 55 69 return new \WP_REST_Response( $value ); 56 70 } -
strakture/tags/1.1.5/app/Shared/Admin.php
r3472592 r3509467 50 50 // Defaults for free version. 51 51 $authToken = ''; 52 $auth = array( 53 'success' => false, 54 'authToken' => '', 55 'issuedAt' => null, 56 'refreshAfterSeconds' => 240, 57 'expiresAfterSeconds' => 300, 58 ); 52 59 $creditInfo = array( 53 60 'remaining' => 0, … … 78 85 'activity' => \wp_json_encode( \get_option( 'strakture_shared_activity', null ) ), 79 86 'authToken' => \esc_attr( $authToken ), 87 'auth' => array( 88 'success' => !empty( $auth['success'] ), 89 'authToken' => \esc_attr( $auth['authToken'] ?? '' ), 90 'issuedAt' => ( isset( $auth['issuedAt'] ) ? (int) $auth['issuedAt'] : null ), 91 'refreshAfterSeconds' => (int) ($auth['refreshAfterSeconds'] ?? 240), 92 'expiresAfterSeconds' => (int) ($auth['expiresAfterSeconds'] ?? 300), 93 ), 80 94 'credits' => array( 81 95 'remaining' => (int) ($creditInfo['remaining'] ?? 0), -
strakture/tags/1.1.5/public/build/strakture-library.asset.php
r3480125 r3509467 1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' 713487f1839b7e6039cd');1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'cb9a702dcfd4ed1dfc9c'); -
strakture/tags/1.1.5/public/build/strakture-library.js
r3472592 r3509467 1 (()=>{var t,e,n={162(t,e,n){"use strict";var r=n(609),i=n(888),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u(function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==i&&h.hasValue){var e=h.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(s=t,e):(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,n,r,i]);var p=s(t,d[0],d[1]);return l(function(){h.hasValue=!0,h.value=p},[p]),c(p),p}},242(t,e,n){"use strict";t.exports=n(162)},493(t,e,n){"use strict";var r=n(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=e,u(i)&&c({inst:i})},[t,n,e]),s(function(){return u(i)&&c({inst:i}),t(function(){u(i)&&c({inst:i})})},[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},609(t){"use strict";t.exports=window.React},888(t,e,n){"use strict";t.exports=n(493)},942(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(i.default=i,t.exports=i):void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}()}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>n[t]);return s.default=()=>n,i.d(o,s),o},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=window.wp.element,e=window.wp.data,n=(e,n)=>{"function"==typeof t.createRoot?(0,t.createRoot)(n).render(e):(0,t.render)(e,n)},r=window.wp.i18n;var o=(0,t.forwardRef)(({icon:e,size:n=24,...r},i)=>(0,t.cloneElement)(e,{width:n,height:n,...r,ref:i}));const s=window.wp.apiFetch;var a=i.n(s);const l=(t,e={})=>{if("string"!=typeof t)return null!=t?t:e;try{var n;return null!==(n=JSON.parse(t))&&void 0!==n?n:e}catch(t){return e}},u=t=>{let e;const n=new Set,r=(t,r)=>{const i="function"==typeof t?t(e):t;if(!Object.is(i,e)){const t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{"production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=e=t(r,i,o);return o};var c=i(609),d=i.t(c,2),h=i.n(c),p=i(242);const{useDebugValue:m}=c,{useSyncExternalStoreWithSelector:f}=p;let g=!1;const y=t=>t,v=t=>{"production"!=={NODE_ENV:"production"}.MODE&&"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?u(t):u)(t):t,n=(t,n)=>function(t,e=y,n){"production"!=={NODE_ENV:"production"}.MODE&&n&&!g&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),g=!0);const r=f(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return m(r),r}(e,t,n);return Object.assign(n,e),n},x=t=>t?v(t):v,w=new Map,b=t=>{const e=w.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([t,e])=>[t,e.getState()])):{}},S=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null!=o?o:"production"!=={NODE_ENV:"production"}.MODE)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return"production"!=={NODE_ENV:"production"}.MODE&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=w.get(n.name);if(r)return{type:"tracked",store:t,...r};const i={connection:e.connect(n),stores:{}};return w.set(n.name,i),{type:"tracked",store:t,...i}})(a,u,l);let h=!0;i.setState=(t,e,o)=>{const u=n(t,e);if(!h)return u;const d=void 0===o?{type:s||"anonymous"}:"string"==typeof o?{type:o}:o;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...b(l.name),[a]:i.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},m=t(i.setState,r,i);if("untracked"===d.type?null==c||c.init(m):(d.stores[d.store]=i,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([t,e])=>[t,t===d.store?m:e.getState()])))),i.dispatchFromDevtools&&"function"==typeof i.dispatch){let t=!1;const e=i.dispatch;i.dispatch=(...n)=>{"production"==={NODE_ENV:"production"}.MODE||"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe(t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):C(t.payload,t=>{if("__setState"===t.type){if(void 0===a)return void p(t.state);1!==Object.keys(t.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const e=t.state[a];if(null==e)return;return void(JSON.stringify(i.getState())!==JSON.stringify(e)&&p(e))}i.dispatchFromDevtools&&"function"==typeof i.dispatch&&i.dispatch(t)});case"DISPATCH":switch(t.payload.type){case"RESET":return p(m),void 0===a?null==c?void 0:c.init(i.getState()):null==c?void 0:c.init(b(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(i.getState())):null==c?void 0:c.init(b(l.name));case"ROLLBACK":return C(t.state,t=>{if(void 0===a)return p(t),void(null==c||c.init(i.getState()));p(t[a]),null==c||c.init(b(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return C(t.state,t=>{void 0!==a?JSON.stringify(i.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)});case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}}),m},C=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function E(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const i=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),o=null!=(r=n.getItem(t))?r:null;return o instanceof Promise?o.then(i):i(o)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const P=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then:t=>P(t)(n),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>P(e)(t)}}},k=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?("production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch(t){}if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=P(o.serialize),d=()=>{const t=o.partialize({...r()});let e;const n=c({state:t,version:o.version}).then(t=>u.setItem(o.name,t)).catch(t=>{e=t});if(e)throw e;return n},h=i.setState;i.setState=(t,e)=>{h(t,e),d()};const p=t((...t)=>{n(...t),d()},r,i);let m;const f=()=>{var t;if(!u)return;s=!1,a.forEach(t=>t(r()));const e=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,r()))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t)return o.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return t.state;if(o.migrate)return o.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return m=o.merge(t,null!=(e=r())?e:p),n(m,!0),d()}).then(()=>{null==e||e(m,void 0),s=!0,l.forEach(t=>t(m))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},f(),m||p})(t,e)):((t,e)=>(n,r,i)=>{let o={storage:E(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=()=>{const t=o.partialize({...r()});return u.setItem(o.name,{state:t,version:o.version})},d=i.setState;i.setState=(t,e)=>{d(t,e),c()};const h=t((...t)=>{n(...t),c()},r,i);let p;i.getInitialState=()=>h;const m=()=>{var t,e;if(!u)return;s=!1,a.forEach(t=>{var e;return t(null!=(e=r())?e:h)});const i=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,null!=(t=r())?t:h))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return[!1,t.state];if(o.migrate)return[!0,o.migrate(t.state,t.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var e;const[i,s]=t;if(p=o.merge(s,null!=(e=r())?e:h),n(p,!0),i)return c()}).then(()=>{null==i||i(p,void 0),p=r(),s=!0,l.forEach(t=>t(p))}).catch(t=>{null==i||i(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},o.skipHydration||m(),p||h})(t,e),T="/strakture/v1/shared/activity",A={getItem:()=>a()({path:T}),setItem:(t,e)=>a()({path:T,method:"POST",data:{state:e}})},j=l(window.straktureSharedData?.activity),D={actions:{}},O=x(k(S((t,e)=>{var n;return{...D,...null!==(n=j?.state)&&void 0!==n?n:{},incrementActivity:n=>{t(t=>({...t,actions:{...t.actions,[n]:Number(e().actions[n]||0)+1}}))}}},{name:"Strakture Activity"}),{name:"strakture_shared_activity",storage:E(()=>A),skipHydration:!0})),M=window.ReactJSXRuntime,R=(0,M.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_98_488)",children:[(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"white"}),(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"url(#paint0_linear_98_488)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_98_488",x1:"-1.2544",y1:"35.9502",x2:"39.167",y2:"26.3118",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_98_488",children:(0,M.jsx)("rect",{width:"36",height:"36",fill:"white"})})]})]}),V=x(S(t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t(t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]})}),{name:"Strakture Library Globals"})),L=()=>{const{setOpen:t}=V(),{incrementActivity:e}=O();return(0,M.jsxs)("div",{role:"button",onClick:()=>{t(!0),e("library-button-click")},className:"components-button has-icon bg-design-main hover:opacity-90 hover:text-white text-white h-9 sm:ml-2 xl:pr-4",children:[(0,M.jsx)(o,{icon:R,size:16}),(0,M.jsx)("span",{className:"ml-1 hidden xl:inline",children:(0,r.__)("Strakture Patterns","strakture")})]})};function F(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t}))}function N(){let t=[],e={addEventListener:(t,n,r,i)=>(t.addEventListener(n,r,i),e.add(()=>t.removeEventListener(n,r,i))),requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame:(...t)=>e.requestAnimationFrame(()=>e.requestAnimationFrame(...t)),setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return F(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add(()=>{Object.assign(t.style,{[e]:r})})},group(t){let e=N();return t(e),this.add(()=>e.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}var I=Object.defineProperty,_=(t,e,n)=>(((t,e,n)=>{e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let B=new class{constructor(){_(this,"current",this.detect()),_(this,"handoffState","pending"),_(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},U=(t,e)=>{B.isServer?(0,c.useEffect)(t,e):(0,c.useLayoutEffect)(t,e)};function $(t){let e=(0,c.useRef)(t);return U(()=>{e.current=t},[t]),e}let H=function(t){let e=$(t);return c.useCallback((...t)=>e.current(...t),[e])};function W(t,e,n,r){let i=$(n);(0,c.useEffect)(()=>{function n(t){i.current(t)}return(t=null!=t?t:window).addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,r])}function z(){let t=(0,c.useRef)(!1);return U(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function q(t){let e=H(t),n=(0,c.useRef)(!1);(0,c.useEffect)(()=>(n.current=!1,()=>{n.current=!0,F(()=>{n.current&&e()})}),[e])}function Y(t){return B.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function G(...t){return(0,c.useMemo)(()=>Y(...t),[...t])}function X(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in d&&d.useSyncExternalStore(()=>()=>{},()=>!1,()=>!t)}(),[e,n]=c.useState(B.isHandoffComplete);return e&&!1===B.isHandoffComplete&&n(!1),c.useEffect(()=>{!0!==e&&n(!0)},[e]),c.useEffect(()=>B.handoff(),[]),!t&&e}let Z=Symbol();function J(...t){let e=(0,c.useRef)(t);(0,c.useEffect)(()=>{e.current=t},[t]);let n=H(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)});return t.every(t=>null==t||(null==t?void 0:t[Z]))?void 0:n}function K(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)},[t,n])}var Q=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Q||{});function tt(t,e){let n=(0,c.useRef)([]),r=H(t);(0,c.useEffect)(()=>{let t=[...n.current];for(let[i,o]of e.entries())if(n.current[i]!==o){let i=r(e,t);return n.current=e,i}},[r,...e])}function et(...t){return Array.from(new Set(t.flatMap(t=>"string"==typeof t?t.split(" "):[]))).filter(Boolean).join(" ")}function nt(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(t=>`"${t}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,nt),r}var rt=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(rt||{}),it=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(it||{});function ot({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=null!=a?a:at;let l=lt(e,t);if(o)return st(l,n,r,s,a);let u=null!=i?i:0;if(2&u){let{static:t=!1,...e}=l;if(t)return st(e,n,r,s,a)}if(1&u){let{unmount:t=!0,...e}=l;return nt(t?0:1,{0:()=>null,1:()=>st({...e,hidden:!0,style:{display:"none"}},n,r,s,a)})}return st(l,n,r,s,a)}function st(t,e={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=dt(t,["unmount","static"]),u=void 0!==t.ref?{[a]:t.ref}:{},d="function"==typeof s?s(e):s;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(e));let h={};if(e){let t=!1,n=[];for(let[r,i]of Object.entries(e))"boolean"==typeof i&&(t=!0),!0===i&&n.push(r);t&&(h["data-headlessui-state"]=n.join(" "))}if(o===c.Fragment&&Object.keys(ct(l)).length>0){if(!(0,c.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(t=>` - ${t}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(t=>` - ${t}`).join("\n")].join("\n"));let t=d.props,e="function"==typeof(null==t?void 0:t.className)?(...e)=>et(null==t?void 0:t.className(...e),l.className):et(null==t?void 0:t.className,l.className),n=e?{className:e}:{};return(0,c.cloneElement)(d,Object.assign({},lt(d.props,ct(dt(l,["ref"]))),h,u,{ref:i(d.ref,u.ref)},n))}return(0,c.createElement)(o,Object.assign({},dt(l,["ref"]),o!==c.Fragment&&u,o!==c.Fragment&&h),d)}function at(...t){return t.every(t=>null==t)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function lt(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(t=>[t,void 0])));for(let t in n)Object.assign(e,{[t](e,...r){let i=n[t];for(let t of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function ut(t){var e;return Object.assign((0,c.forwardRef)(t),{displayName:null!=(e=t.displayName)?e:t.name})}function ct(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function dt(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var ht=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(ht||{});let pt=ut(function(t,e){var n;let{features:r=1,...i}=t;return ot({ourProps:{ref:e,"aria-hidden":!(2&~r)||(null!=(n=i["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}},theirProps:i,slot:{},defaultTag:"div",name:"Hidden"})}),mt=[];!function(){function t(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&mt[0]!==t.target&&(mt.unshift(t.target),mt=mt.filter(t=>null!=t&&t.isConnected),mt.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();let ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var gt,yt,vt=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(vt||{}),xt=((yt=xt||{})[yt.Error=0]="Error",yt[yt.Overflow=1]="Overflow",yt[yt.Success=2]="Success",yt[yt.Underflow=3]="Underflow",yt),wt=((gt=wt||{})[gt.Previous=-1]="Previous",gt[gt.Next=1]="Next",gt);var bt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(bt||{});var St=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(St||{});function Ct(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Et=["textarea","input"].join(",");function Pt(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=t=>t){return t.slice().sort((t,n)=>{let r=e(t),i=e(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(ft)).sort((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}(t);i.length>0&&s.length>1&&(s=s.filter(t=>!i.includes(t))),r=null!=r?r:o.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==o.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,Et))&&n}(a)&&a.select(),2}function kt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var Tt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(Tt||{});let At=ut(function(t,e){let n=(0,c.useRef)(null),r=J(n,e),{initialFocus:i,containers:o,features:s=30,...a}=t;X()||(s=1);let l=G(n);Dt({ownerDocument:l},Boolean(16&s));let u=function({ownerDocument:t,container:e,initialFocus:n},r){let i=(0,c.useRef)(null),o=z();return tt(()=>{if(!r)return;let s=e.current;s&&F(()=>{if(!o.current)return;let e=null==t?void 0:t.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===e)return void(i.current=e)}else if(s.contains(e))return void(i.current=e);null!=n&&n.current?Ct(n.current):Pt(s,vt.First)===xt.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==t?void 0:t.activeElement})},[r]),i}({ownerDocument:l,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},i){let o=z();W(null==t?void 0:t.defaultView,"focus",t=>{if(!i||!o.current)return;let s=kt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?Ot(s,l)?(r.current=l,Ct(l)):(t.preventDefault(),t.stopPropagation(),Ct(a)):Ct(r.current)},!0)}({ownerDocument:l,container:n,containers:o,previousActiveElement:u},Boolean(8&s));let d=function(){let t=(0,c.useRef)(0);return K("keydown",e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)},!0),t}(),h=H(t=>{let e=n.current;e&&nt(d.current,{[Q.Forwards]:()=>{Pt(e,vt.First,{skipElements:[t.relatedTarget]})},[Q.Backwards]:()=>{Pt(e,vt.Last,{skipElements:[t.relatedTarget]})}})}),p=function(){let[t]=(0,c.useState)(N);return(0,c.useEffect)(()=>()=>t.dispose(),[t]),t}(),m=(0,c.useRef)(!1),f={ref:r,onKeyDown(t){"Tab"==t.key&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(t){let e=kt(o);n.current instanceof HTMLElement&&e.add(n.current);let r=t.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(Ot(e,r)||(m.current?Pt(n.current,nt(d.current,{[Q.Forwards]:()=>vt.Next,[Q.Backwards]:()=>vt.Previous})|vt.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&Ct(t.target)))}};return c.createElement(c.Fragment,null,Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}),ot({ourProps:f,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}))}),jt=Object.assign(At,{features:Tt});function Dt({ownerDocument:t},e){let n=function(t=!0){let e=(0,c.useRef)(mt.slice());return tt(([t],[n])=>{!0===n&&!1===t&&F(()=>{e.current.splice(0)}),!1===n&&!0===t&&(e.current=mt.slice())},[t,mt,e]),H(()=>{var t;return null!=(t=e.current.find(t=>null!=t&&t.isConnected))?t:null})}(e);tt(()=>{e||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&Ct(n())},[e]),q(()=>{e&&Ct(n())})}function Ot(t,e){for(let n of t)if(n.contains(e))return!0;return!1}const Mt=window.ReactDOM;let Rt=(0,c.createContext)(!1);function Vt(){return(0,c.useContext)(Rt)}function Lt(t){return c.createElement(Rt.Provider,{value:t.force},t.children)}let Ft=c.Fragment,Nt=c.Fragment,It=(0,c.createContext)(null),_t=(0,c.createContext)(null),Bt=ut(function(t,e){let n=t,r=(0,c.useRef)(null),i=J(function(t,e=!0){return Object.assign(t,{[Z]:e})}(t=>{r.current=t}),e),o=G(r),s=function(t){let e=Vt(),n=(0,c.useContext)(It),r=G(t),[i,o]=(0,c.useState)(()=>{if(!e&&null!==n||B.isServer)return null;let t=null==r?void 0:r.getElementById("headlessui-portal-root");if(t)return t;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return(0,c.useEffect)(()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))},[i,r]),(0,c.useEffect)(()=>{e||null!==n&&o(n.current)},[n,o,e]),i}(r),[a]=(0,c.useState)(()=>{var t;return B.isServer?null:null!=(t=null==o?void 0:o.createElement("div"))?t:null}),l=(0,c.useContext)(_t),u=X();return U(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),U(()=>{if(a&&l)return l.register(a)},[l,a]),q(()=>{var t;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&(null==(t=s.parentElement)||t.removeChild(s)))}),u&&s&&a?(0,Mt.createPortal)(ot({ourProps:{ref:i},theirProps:n,defaultTag:Ft,name:"Portal"}),a):null}),Ut=ut(function(t,e){let{target:n,...r}=t,i={ref:J(e)};return c.createElement(It.Provider,{value:n},ot({ourProps:i,theirProps:r,defaultTag:Nt,name:"Popover.Group"}))}),$t=Object.assign(Bt,{Group:Ut});const Ht="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:Wt,useEffect:zt,useLayoutEffect:qt,useDebugValue:Yt}=d;function Gt(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Ht(n,t)}catch{return!0}}const Xt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:i},o]=Wt({inst:{value:r,getSnapshot:e}});return qt(()=>{i.value=r,i.getSnapshot=e,Gt(i)&&o({inst:i})},[t,r,e]),zt(()=>(Gt(i)&&o({inst:i}),t(()=>{Gt(i)&&o({inst:i})})),[t]),Yt(r),r},Zt="useSyncExternalStore"in d?(t=>t.useSyncExternalStore)(d):Xt;function Jt(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,i=r.clientWidth-r.offsetWidth,o=t-i;n.style(r,"paddingRight",`${o}px`)}}}function Kt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qt(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let te=function(t,e){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:t=>(r.add(t),()=>r.delete(t)),dispatch(t,...i){let o=e[t].call(n,...i);o&&(n=o,r.forEach(t=>t()))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:N(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:Qt(n)},i=[Kt()?{before({doc:t,d:e,meta:n}){function r(t){return n.containers.flatMap(t=>t()).some(e=>e.contains(t))}e.microTask(()=>{var n;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let n=N();n.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>n.dispose()))}let i=null!=(n=window.scrollY)?n:window.pageYOffset,o=null;e.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),s=t.querySelector(i);s&&!r(s)&&(o=s)}catch{}},!0),e.addEventListener(t,"touchstart",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let n=t.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}),e.addEventListener(t,"touchmove",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.headlessuiPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.headlessuiPortal&&t.preventDefault()}else t.preventDefault()},{passive:!1}),e.add(()=>{var t;let e=null!=(t=window.scrollY)?t:window.pageYOffset;i!==e&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},Jt(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];i.forEach(({before:t})=>null==t?void 0:t(r)),i.forEach(({after:t})=>null==t?void 0:t(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});function ee(t,e,n){let r=function(t){return Zt(t.subscribe,t.getSnapshot,t.getSnapshot)}(te),i=t?r.get(t):void 0,o=!!i&&i.count>0;return U(()=>{if(t&&e)return te.dispatch("PUSH",t,n),()=>te.dispatch("POP",t,n)},[e,t]),o}var ne;te.subscribe(()=>{let t=te.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&te.dispatch("TEARDOWN",n)}});let re=null!=(ne=c.useId)?ne:function(){let t=X(),[e,n]=c.useState(t?()=>B.nextId():null);return U(()=>{null===e&&n(B.nextId())},[e]),null!=e?""+e:void 0},ie=new Map,oe=new Map;function se(t,e=!0){U(()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let i=null!=(n=oe.get(r))?n:0;return oe.set(r,i+1),0!==i||(ie.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=oe.get(r))?t:1;if(1===e?oe.delete(r):oe.set(r,e-1),1!==e)return;let n=ie.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,ie.delete(r))}},[t,e])}function ae(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return document.addEventListener(t,e,n),()=>document.removeEventListener(t,e,n)},[t,n])}function le(t,e,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=i(n);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(t);for(let t of s){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(o)||n.composed&&n.composedPath().includes(e))return}return!function(t,e=0){var n;return t!==(null==(n=Y(t))?void 0:n.body)&&nt(e,{0:()=>t.matches(ft),1(){let e=t;for(;null!==e;){if(e.matches(ft))return!0;e=e.parentElement}return!1}})}(o,bt.Loose)&&-1!==o.tabIndex&&n.preventDefault(),e(n,o)}(0,c.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let o=(0,c.useRef)(null);ae("pointerdown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("mousedown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("click",t=>{Kt()||/Android/gi.test(window.navigator.userAgent)||o.current&&(i(t,()=>o.current),o.current=null)},!0),ae("touchend",t=>i(t,()=>t.target instanceof HTMLElement?t.target:null),!0),K("blur",t=>i(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ue=(0,c.createContext)(null);ue.displayName="OpenClosedContext";var ce=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(ce||{});let de=(0,c.createContext)(()=>{});de.displayName="StackContext";var he=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(he||{});function pe({children:t,onUpdate:e,type:n,element:r,enabled:i}){let o=(0,c.useContext)(de),s=H((...t)=>{null==e||e(...t),o(...t)});return U(()=>{let t=void 0===i||!0===i;return t&&s(0,n,r),()=>{t&&s(1,n,r)}},[s,n,r,i]),c.createElement(de.Provider,{value:s},t)}let me=(0,c.createContext)(null);function fe(){let t=(0,c.useContext)(me);if(null===t){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,fe),t}return t}let ge=ut(function(t,e){let n=re(),{id:r=`headlessui-description-${n}`,...i}=t,o=fe(),s=J(e);return U(()=>o.register(r),[r,o.register]),ot({ourProps:{ref:s,...o.props,id:r},theirProps:i,slot:o.slot||{},defaultTag:"p",name:o.name||"Description"})}),ye=Object.assign(ge,{});var ve=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(ve||{}),xe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(xe||{}),we=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(we||{});let be={0:(t,e)=>t.titleId===e.id?t:{...t,titleId:e.id}},Se=(0,c.createContext)(null);function Ce(t){let e=(0,c.useContext)(Se);if(null===e){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ce),e}return e}function Ee(t,e){return nt(e.type,be,t,e)}Se.displayName="DialogContext";let Pe=rt.RenderStrategy|rt.Static,ke=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...u}=t,[d,h]=(0,c.useState)(0),p=(0,c.useRef)(!1);a="dialog"===a||"alertdialog"===a?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=(0,c.useContext)(ue);void 0===i&&null!==m&&(i=(m&ce.Open)===ce.Open);let f=(0,c.useRef)(null),g=J(f,e),y=G(f),v=t.hasOwnProperty("open")||null!==m,x=t.hasOwnProperty("onClose");if(!v&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let w=i?0:1,[b,S]=(0,c.useReducer)(Ee,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),C=H(()=>o(!1)),E=H(t=>S({type:0,id:t})),P=!!X()&&!l&&0===w,k=d>1,T=null!==(0,c.useContext)(Se),[A,j]=function(){let t=(0,c.useContext)(_t),e=(0,c.useRef)([]),n=H(n=>(e.current.push(n),t&&t.register(n),()=>r(n))),r=H(n=>{let r=e.current.indexOf(n);-1!==r&&e.current.splice(r,1),t&&t.unregister(n)}),i=(0,c.useMemo)(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,(0,c.useMemo)(()=>function({children:t}){return c.createElement(_t.Provider,{value:i},t)},[i])]}(),D={get current(){var t;return null!=(t=b.panelRef.current)?t:f.current}},{resolveContainers:O,mainTreeNodeRef:M,MainTreeNode:R}=function({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let i=(0,c.useRef)(null!=(r=null==n?void 0:n.current)?r:null),o=G(i),s=H(()=>{var n,r,s;let a=[];for(let e of t)null!==e&&(e instanceof HTMLElement?a.push(e):"current"in e&&e.current instanceof HTMLElement&&a.push(e.current));if(null!=e&&e.current)for(let t of e.current)a.push(t);for(let t of null!=(n=null==o?void 0:o.querySelectorAll("html > *, body > *"))?n:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(i.current)||t.contains(null==(s=null==(r=i.current)?void 0:r.getRootNode())?void 0:s.host)||a.some(e=>t.contains(e))||a.push(t));return a});return{resolveContainers:s,contains:H(t=>s().some(e=>e.contains(t))),mainTreeNodeRef:i,MainTreeNode:(0,c.useMemo)(()=>function(){return null!=n?null:c.createElement(pt,{features:ht.Hidden,ref:i})},[i,n])}}({portals:A,defaultContainers:[D]}),V=k?"parent":"leaf",L=null!==m&&(m&ce.Closing)===ce.Closing,F=!T&&!L&&P,N=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("body > *"))?t:[]).find(t=>"headlessui-portal-root"!==t.id&&t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(N,F);let I=!!k||P,_=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("[data-headlessui-portal]"))?t:[]).find(t=>t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(_,I),le(O,t=>{t.preventDefault(),C()},!(!P||k));let B=!(k||0!==w);W(null==y?void 0:y.defaultView,"keydown",t=>{B&&(t.defaultPrevented||t.key===ve.Escape&&(t.preventDefault(),t.stopPropagation(),C()))}),function(t,e,n=()=>[document.body]){ee(t,e,t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}})}(y,!(L||0!==w||T),O),(0,c.useEffect)(()=>{if(0!==w||!f.current)return;let t=new ResizeObserver(t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&C()}});return t.observe(f.current),()=>t.disconnect()},[w,f,C]);let[U,$]=function(){let[t,e]=(0,c.useState)([]);return[t.length>0?t.join(" "):void 0,(0,c.useMemo)(()=>function(t){let n=H(t=>(e(e=>[...e,t]),()=>e(e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))),r=(0,c.useMemo)(()=>({register:n,slot:t.slot,name:t.name,props:t.props}),[n,t.slot,t.name,t.props]);return c.createElement(me.Provider,{value:r},t.children)},[e])]}(),z=(0,c.useMemo)(()=>[{dialogState:w,close:C,setTitleId:E},b],[w,b,C,E]),q=(0,c.useMemo)(()=>({open:0===w}),[w]),Y={ref:g,id:r,role:a,"aria-modal":0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":U};return c.createElement(pe,{type:"Dialog",enabled:0===w,element:f,onUpdate:H((t,e)=>{"Dialog"===e&&nt(t,{[he.Add]:()=>h(t=>t+1),[he.Remove]:()=>h(t=>t-1)})})},c.createElement(Lt,{force:!0},c.createElement($t,null,c.createElement(Se.Provider,{value:z},c.createElement($t.Group,{target:f},c.createElement(Lt,{force:!1},c.createElement($,{slot:q,name:"Dialog.Description"},c.createElement(jt,{initialFocus:s,containers:O,features:P?nt(V,{parent:jt.features.RestoreFocus,leaf:jt.features.All&~jt.features.FocusLock}):jt.features.None},c.createElement(j,null,ot({ourProps:Y,theirProps:u,slot:q,defaultTag:"div",features:Pe,visible:0===w,name:"Dialog"}))))))))),c.createElement(R,null))}),Te=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Backdrop"),a=J(e);(0,c.useEffect)(()=>{if(null===s.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return c.createElement(Lt,{force:!0},c.createElement($t,null,ot({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Ae=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-panel-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Panel"),a=J(e,s.panelRef),l=(0,c.useMemo)(()=>({open:0===o}),[o]),u=H(t=>{t.stopPropagation()});return ot({ourProps:{ref:a,id:r,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),je=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=t,[{dialogState:o,close:s}]=Ce("Dialog.Overlay"),a=J(e),l=H(t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),s()}});return ot({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:l},theirProps:i,slot:(0,c.useMemo)(()=>({open:0===o}),[o]),defaultTag:"div",name:"Dialog.Overlay"})}),De=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:o,setTitleId:s}]=Ce("Dialog.Title"),a=J(e);(0,c.useEffect)(()=>(s(r),()=>s(null)),[r,s]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return ot({ourProps:{ref:a,id:r},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Oe=Object.assign(ke,{Backdrop:Te,Panel:Ae,Overlay:je,Title:De,Description:ye});const Me=(0,c.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Re=(0,c.createContext)({}),Ve=(0,c.createContext)(null),Le="undefined"!=typeof document,Fe=Le?c.useLayoutEffect:c.useEffect,Ne=(0,c.createContext)({strict:!1}),Ie=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_e="data-"+Ie("framerAppearId");function Be(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ue(t){return"string"==typeof t||Array.isArray(t)}function $e(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const He=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],We=["initial",...He];function ze(t){return $e(t.animate)||We.some(e=>Ue(t[e]))}function qe(t){return Boolean(ze(t)||t.variants)}function Ye(t){return Array.isArray(t)?t.join(" "):t}const Ge={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xe={};for(const t in Ge)Xe[t]={isEnabled:e=>Ge[t].some(t=>!!e[t])};const Ze=(0,c.createContext)({}),Je=(0,c.createContext)({}),Ke=Symbol.for("motionComponentSymbol");function Qe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&function(t){for(const e in t)Xe[e]={...Xe[e],...t[e]}}(t);const o=(0,c.forwardRef)(function(o,s){let a;const l={...(0,c.useContext)(Me),...o,layoutId:tn(o)},{isStatic:u}=l,d=function(t){const{initial:e,animate:n}=function(t,e){if(ze(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ue(e)?e:void 0,animate:Ue(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,c.useContext)(Re));return(0,c.useMemo)(()=>({initial:e,animate:n}),[Ye(e),Ye(n)])}(o),h=r(o,u);if(!u&&Le){d.visualElement=function(t,e,n,r){const{visualElement:i}=(0,c.useContext)(Re),o=(0,c.useContext)(Ne),s=(0,c.useContext)(Ve),a=(0,c.useContext)(Me).reducedMotion,l=(0,c.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const u=l.current;(0,c.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,c.useRef)(Boolean(n[_e]&&!window.HandoffComplete));return Fe(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,c.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,l,e);const n=(0,c.useContext)(Je),r=(0,c.useContext)(Ne).strict;d.visualElement&&(a=d.visualElement.loadFeatures(l,r,t,n))}return c.createElement(Re.Provider,{value:d},a&&d.visualElement?c.createElement(a,{visualElement:d.visualElement,...l}):null,n(i,o,function(t,e,n){return(0,c.useCallback)(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Be(n)&&(n.current=r))},[e])}(h,d.visualElement,s),h,u,d.visualElement))});return o[Ke]=i,o}function tn({layoutId:t}){const e=(0,c.useContext)(Ze).id;return e&&void 0!==t?e+"-"+t:t}function en(t){function e(e,n={}){return Qe(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const nn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rn(t){return"string"==typeof t&&!t.includes("-")&&!!(nn.indexOf(t)>-1||/[A-Z]/.test(t))}const on={},sn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],an=new Set(sn);function ln(t,{layout:e,layoutId:n}){return an.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!on[t]||"opacity"===t)}const un=t=>Boolean(t&&t.getVelocity),cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dn=sn.length,hn=t=>e=>"string"==typeof e&&e.startsWith(t),pn=hn("--"),mn=hn("var(--"),fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,gn=(t,e,n)=>Math.min(Math.max(n,t),e),yn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vn={...yn,transform:t=>gn(0,1,t)},xn={...yn,default:1},wn=t=>Math.round(1e5*t)/1e5,bn=/(-)?([\d]*\.?[\d])+/g,Sn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Cn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function En(t){return"string"==typeof t}const Pn=t=>({test:e=>En(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),kn=Pn("deg"),Tn=Pn("%"),An=Pn("px"),jn=Pn("vh"),Dn=Pn("vw"),On={...Tn,parse:t=>Tn.parse(t)/100,transform:t=>Tn.transform(100*t)},Mn={...yn,transform:Math.round},Rn={borderWidth:An,borderTopWidth:An,borderRightWidth:An,borderBottomWidth:An,borderLeftWidth:An,borderRadius:An,radius:An,borderTopLeftRadius:An,borderTopRightRadius:An,borderBottomRightRadius:An,borderBottomLeftRadius:An,width:An,maxWidth:An,height:An,maxHeight:An,size:An,top:An,right:An,bottom:An,left:An,padding:An,paddingTop:An,paddingRight:An,paddingBottom:An,paddingLeft:An,margin:An,marginTop:An,marginRight:An,marginBottom:An,marginLeft:An,rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:xn,scaleX:xn,scaleY:xn,scaleZ:xn,skew:kn,skewX:kn,skewY:kn,distance:An,translateX:An,translateY:An,translateZ:An,x:An,y:An,z:An,perspective:An,transformPerspective:An,opacity:vn,originX:On,originY:On,originZ:An,zIndex:Mn,fillOpacity:vn,strokeOpacity:vn,numOctaves:Mn};function Vn(t,e,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(pn(t)){o[t]=n;continue}const r=Rn[t],d=fn(n,r);if(an.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):i[t]=d}if(e.transform||(l||r?i.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,i){let o="";for(let e=0;e<dn;e++){const n=sn[e];void 0!==t[n]&&(o+=`${cn[n]||n}(${t[n]}) `)}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,r?"":o):n&&r&&(o="none"),o}(t.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;i.transformOrigin=`${t} ${e} ${n}`}}function Ln(t,e,n){for(const r in e)un(e[r])||ln(r,n)||(t[r]=e[r])}function Fn(t,e,n){const r={},i=function(t,e,n){const r={};return Ln(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,c.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Vn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=i,r}const Nn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function In(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Nn.has(t)}let Bn=t=>!In(t);try{(Un=require("@emotion/is-prop-valid").default)&&(Bn=t=>t.startsWith("on")?!In(t):Un(t))}catch(t){}var Un;function $n(t,e,n){return"string"==typeof t?t:An.transform(e+n*t)}const Hn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wn={offset:"strokeDashoffset",array:"strokeDasharray"};function zn(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(Vn(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:f}=t;p.transform&&(f&&(m.transform=p.transform),delete p.transform),f&&(void 0!==i||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${$n(e,t.x,t.width)} ${$n(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,i=!0){t.pathLength=1;const o=i?Hn:Wn;t[o.offset]=An.transform(-r);const s=An.transform(e),a=An.transform(n);t[o.array]=`${s} ${a}`}(p,s,a,l,!1)}const qn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yn(t,e,n,r){const i=(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zn(n,e,{enableHardwareAcceleration:!1},qn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ln(e,t.style,t),i.style={...e,...i.style}}return i}function Gn(t=!1){return(e,n,r,{latestValues:i},o)=>{const s=(rn(e)?Yn:Fn)(n,i,o,e),a=function(t,e,n){const r={};for(const i in t)"values"===i&&"object"==typeof t.values||(Bn(i)||!0===n&&In(i)||!e&&!In(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}(n,"string"==typeof e,t),l={...a,...s,ref:r},{children:u}=n,d=(0,c.useMemo)(()=>un(u)?u.get():u,[u]);return(0,c.createElement)(e,{...l,children:d})}}function Xn(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Zn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Jn(t,e,n,r){Xn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Zn.has(n)?n:Ie(n),e.attrs[n])}function Kn(t,e){const{style:n}=t,r={};for(const i in n)(un(n[i])||e.style&&un(e.style[i])||ln(i,t))&&(r[i]=n[i]);return r}function Qn(t,e){const n=Kn(t,e);for(const r in t)(un(t[r])||un(e[r]))&&(n[-1!==sn.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function tr(t,e,n,r={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),e}const er=t=>Array.isArray(t),nr=t=>er(t)?t[t.length-1]||0:t;function rr(t){const e=un(t)?t.get():t;return(t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue))(e)?e.toValue():e}const ir=t=>(e,n)=>{const r=(0,c.useContext)(Re),i=(0,c.useContext)(Ve),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,o){const s={latestValues:or(r,i,o,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(t,e,r,i);return n?o():function(t){const e=(0,c.useRef)(null);return null===e.current&&(e.current=t()),e.current}(o)};function or(t,e,n,r){const i={},o=r(t,{});for(const t in o)i[t]=rr(o[t]);let{initial:s,animate:a}=t;const l=ze(t),u=qe(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!$e(d)&&(Array.isArray(d)?d:[d]).forEach(e=>{const n=tr(t,e);if(!n)return;const{transitionEnd:r,transition:o,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(i[t]=e)}for(const t in r)i[t]=r[t]}),i}const sr=t=>t;class ar{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const lr=["prepare","read","update","preRender","render","postRender"],{schedule:ur,cancel:cr,state:dr,steps:hr}=function(t){let e=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=lr.reduce((t,n)=>(t[n]=function(t){let e=new ar,n=new ar,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,u=l?e:n;return o&&s.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>e=!0),t),{}),o=t=>i[t].process(r),s=()=>{const i=performance.now();e=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,lr.forEach(o),r.isProcessing=!1,e&&(n=!1,t(s))};return{schedule:lr.reduce((o,a)=>{const l=i[a];return o[a]=(i,o=!1,a=!1)=>(e||(e=!0,n=!0,r.isProcessing||t(s)),l.schedule(i,o,a)),o},{}),cancel:t=>lr.forEach(e=>i[e].cancel(t)),state:r,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:sr),pr={useVisualState:ir({scrapeMotionValuesFromProps:Qn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(t,e,{renderState:n,latestValues:r})=>{ur.read(()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}}),ur.render(()=>{zn(n,r,{enableHardwareAcceleration:!1},qn(e.tagName),t.transformTemplate),Jn(e,n)})}})},mr={useVisualState:ir({scrapeMotionValuesFromProps:Kn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const gr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function yr(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function vr(t,e,n,r){return fr(t,e,(t=>e=>gr(e)&&t(e,yr(e)))(n),r)}const xr=(t,e)=>n=>e(t(n)),wr=(...t)=>t.reduce(xr);function br(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const Sr=br("dragHorizontal"),Cr=br("dragVertical");function Er(t){let e=!1;if("y"===t)e=Cr();else if("x"===t)e=Sr();else{const t=Sr(),n=Cr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pr(){const t=Er(!0);return!t||(t(),!1)}class kr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tr(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return vr(t.current,n,(n,i)=>{if("touch"===n.pointerType||Pr())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[r]&&ur.update(()=>o[r](n,i))},{passive:!t.getProps()[r]})}const Ar=(t,e)=>!!e&&(t===e||Ar(t,e.parentElement));function jr(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,yr(n))}const Dr=new WeakMap,Or=new WeakMap,Mr=t=>{const e=Dr.get(t.target);e&&e(t)},Rr=t=>{t.forEach(Mr)};const Vr={some:0,all:1},Lr={inView:{Feature:class extends kr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Vr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Or.has(n)||Or.set(n,{});const r=Or.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Rr,{root:t,...e})),r[i]}(e);return Dr.set(t,n),r.observe(t),()=>{Dr.delete(t),r.unobserve(t)}}(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=e?n:r;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends kr{constructor(){super(...arguments),this.removeStartListeners=sr,this.removeEndListeners=sr,this.removeAccessibleListeners=sr,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=vr(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();ur.update(()=>{i||Ar(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)})},{passive:!(n.onTap||n.onPointerUp)}),i=vr(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=wr(r,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=fr(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=fr(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&jr("up",(t,e)=>{const{onTap:n}=this.node.getProps();n&&ur.update(()=>n(t,e))})}),jr("down",(t,e)=>{this.startPress(t,e)}))}),e=fr(this.node.current,"blur",()=>{this.isPressing&&jr("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=wr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ur.update(()=>n(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ur.update(()=>n(t,e))}mount(){const t=this.node.getProps(),e=vr(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=fr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=wr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends kr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wr(fr(this.node.current,"focus",()=>this.onFocus()),fr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends kr{mount(){this.unmount=wr(Tr(this.node,!0),Tr(this.node,!1))}unmount(){}}}};function Fr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Nr(t,e,n){const r=t.getProps();return tr(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}let Ir=sr,_r=sr;const Br=t=>1e3*t,Ur=t=>t/1e3,$r=t=>Array.isArray(t)&&"number"==typeof t[0];function Hr(t){return Boolean(!t||"string"==typeof t&&zr[t]||$r(t)||Array.isArray(t)&&t.every(Hr))}const Wr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,zr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function qr(t){if(t)return $r(t)?Wr(t):Array.isArray(t)?t.map(qr):zr[t]}const Yr=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Gr(t,e,n,r){if(t===e&&n===r)return sr;return i=>0===i||1===i?i:Yr(function(t,e,n,r,i){let o,s,a=0;do{s=e+(n-e)/2,o=Yr(s,r,i)-t,o>0?n=s:e=s}while(Math.abs(o)>1e-7&&++a<12);return s}(i,0,1,t,n),e,r)}const Xr=Gr(.42,0,1,1),Zr=Gr(0,0,.58,1),Jr=Gr(.42,0,.58,1),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qr=t=>e=>1-t(1-e),ti=t=>1-Math.sin(Math.acos(t)),ei=Qr(ti),ni=Kr(ti),ri=Gr(.33,1.53,.69,.99),ii=Qr(ri),oi=Kr(ii),si={linear:sr,easeIn:Xr,easeInOut:Jr,easeOut:Zr,circIn:ti,circInOut:ni,circOut:ei,backIn:ii,backInOut:oi,backOut:ri,anticipate:t=>(t*=2)<1?.5*ii(t):.5*(2-Math.pow(2,-10*(t-1)))},ai=t=>{if(Array.isArray(t)){_r(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return Gr(e,n,r,i)}return"string"==typeof t?(_r(void 0!==si[t],`Invalid easing type '${t}'`),si[t]):t},li=(t,e)=>n=>Boolean(En(n)&&Cn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ui=(t,e,n)=>r=>{if(!En(r))return r;const[i,o,s,a]=r.match(bn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ci={...yn,transform:t=>Math.round((t=>gn(0,255,t))(t))},di={test:li("rgb","red"),parse:ui("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ci.transform(t)+", "+ci.transform(e)+", "+ci.transform(n)+", "+wn(vn.transform(r))+")"},hi={test:li("#"),parse:function(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:di.transform},pi={test:li("hsl","hue"),parse:ui("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Tn.transform(wn(e))+", "+Tn.transform(wn(n))+", "+wn(vn.transform(r))+")"},mi={test:t=>di.test(t)||hi.test(t)||pi.test(t),parse:t=>di.test(t)?di.parse(t):pi.test(t)?pi.parse(t):hi.parse(t),transform:t=>En(t)?t:t.hasOwnProperty("red")?di.transform(t):pi.transform(t)},fi=(t,e,n)=>-n*t+n*e+t;function gi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const yi=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},vi=[hi,di,pi];function xi(t){const e=(t=>vi.find(e=>e.test(t)))(t);_r(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===pi&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let i=0,o=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;i=gi(a,r,t+1/3),o=gi(a,r,t),s=gi(a,r,t-1/3)}else i=o=s=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:r}}(n)),n}const wi=(t,e)=>{const n=xi(t),r=xi(e),i={...n};return t=>(i.red=yi(n.red,r.red,t),i.green=yi(n.green,r.green,t),i.blue=yi(n.blue,r.blue,t),i.alpha=fi(n.alpha,r.alpha,t),di.transform(i))},bi={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:sr},Si={regex:Sn,countKey:"Colors",token:"${c}",parse:mi.parse},Ci={regex:bn,countKey:"Numbers",token:"${n}",parse:yn.parse};function Ei(t,{regex:e,countKey:n,token:r,parse:i}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...o.map(i)))}function Pi(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ei(n,bi),Ei(n,Si),Ei(n,Ci),n}function ki(t){return Pi(t).values}function Ti(t){const{values:e,numColors:n,numVars:r,tokenised:i}=Pi(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=i<r?e.replace(bi.token,t[i]):i<r+n?e.replace(Si.token,mi.transform(t[i])):e.replace(Ci.token,wn(t[i]));return e}}const Ai=t=>"number"==typeof t?0:t,ji={test:function(t){var e,n;return isNaN(t)&&En(t)&&((null===(e=t.match(bn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Sn))||void 0===n?void 0:n.length)||0)>0},parse:ki,createTransformer:Ti,getAnimatableNone:function(t){const e=ki(t);return Ti(t)(e.map(Ai))}},Di=(t,e)=>n=>`${n>0?e:t}`;function Oi(t,e){return"number"==typeof t?n=>fi(t,e,n):mi.test(t)?wi(t,e):t.startsWith("var(")?Di(t,e):Vi(t,e)}const Mi=(t,e)=>{const n=[...t],r=n.length,i=t.map((t,n)=>Oi(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=i[e](t);return n}},Ri=(t,e)=>{const n={...t,...e},r={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(r[i]=Oi(t[i],e[i]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Vi=(t,e)=>{const n=ji.createTransformer(e),r=Pi(t),i=Pi(e);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?wr(Mi(r.values,i.values),n):(Ir(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Di(t,e))},Li=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Fi=(t,e)=>n=>fi(t,e,n);function Ni(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const o=t.length;if(_r(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],i=n||function(t){return"number"==typeof t?Fi:"string"==typeof t?mi.test(t)?wi:Vi:Array.isArray(t)?Mi:"object"==typeof t?Ri:Fi}(t[0]),o=t.length-1;for(let n=0;n<o;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||sr:e;o=wr(t,o)}r.push(o)}return r}(e,r,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Li(t[n],t[n+1],e);return s[n](r)};return n?e=>l(gn(t[0],t[o-1],e)):l}function Ii({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(r)?r.map(ai):ai(r),o={done:!1,value:e[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Li(0,e,r);t.push(fi(n,1,i))}}(e,t.length-1),e}(e),t),a=Ni(s,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||Jr).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}function _i(t,e){return e?t*(1e3/e):0}function Bi(t,e,n){const r=Math.max(e-5,0);return _i(n-t(r),e-r)}const Ui=12;function $i(t,e){return t*Math.sqrt(1-e*e)}const Hi=["duration","bounce"],Wi=["stiffness","damping","mass"];function zi(t,e){return e.some(e=>void 0!==t[e])}function qi({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],o=t[t.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!zi(t,Wi)&&zi(t,Hi)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,o;Ir(t<=Br(10),"Spring duration must be 10 seconds or less");let s=1-e;s=gn(.05,1,s),t=gn(.01,10,Ur(t)),s<1?(i=e=>{const r=e*s,i=r*t;return.001-(r-n)/$i(e,s)*Math.exp(-i)},o=e=>{const r=e*s*t,o=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=$i(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((o-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Ui;n++)r-=t(r)/e(r);return r}(i,o,5/t);if(t=Br(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...r,velocity:-Ur(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(a*u)),f=o-i,g=Ur(Math.sqrt(a/u)),y=Math.abs(f)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),m<1){const t=$i(g,m);v=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)v=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);v=e=>{const n=Math.exp(-m*g*e),r=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(r)+t*f*Math.cosh(r))/t}}return{calculatedDuration:h&&c||null,next:t=>{const r=v(t);if(h)s.done=t>=c;else{let i=p;0!==t&&(i=m<1?Bi(v,t,r):0);const a=Math.abs(i)<=n,l=Math.abs(o-r)<=e;s.done=a&&l}return s.value=s.done?o:r,s}}}function Yi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=d+m,g=void 0===s?f:s(f);g!==f&&(m=g-d);const y=t=>-m*Math.exp(-t/r),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let w,b;const S=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(w=t,b=qi({keyframes:[h.value,p(h.value)],velocity:Bi(v,t,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>w?b.next(t-w):(!e&&x(t),h)}}}const Gi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>ur.update(e,!0),stop:()=>cr(e),now:()=>dr.isProcessing?dr.timestamp:performance.now()}};function Xi(t){let e=0,n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const Zi={decay:Yi,inertia:Yi,tween:Ii,keyframes:Ii,spring:qi};function Ji({autoplay:t=!0,delay:e=0,driver:n=Gi,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,m,f=1,g=!1;const y=()=>{m=new Promise(t=>{p=t})};let v;y();const x=Zi[i]||Ii;let w;x!==Ii&&"number"!=typeof r[0]&&(w=Ni([0,100],r,{clamp:!1}),r=[0,100]);const b=x({...h,keyframes:r});let S;"mirror"===a&&(S=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let C="idle",E=null,P=null,k=null;null===b.calculatedDuration&&o&&(b.calculatedDuration=Xi(b));const{calculatedDuration:T}=b;let A=1/0,j=1/0;null!==T&&(A=T+s,j=A*(o+1)-s);let D=0;const O=t=>{if(null===P)return;f>0&&(P=Math.min(P,t)),f<0&&(P=Math.min(t-j/f,P)),D=null!==E?E:Math.round(t-P)*f;const n=D-e*(f>=0?1:-1),i=f>=0?n<0:n>j;D=Math.max(n,0),"finished"===C&&null===E&&(D=j);let l=D,u=b;if(o){const t=Math.min(D,j)/A;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,o+1),Boolean(e%2)&&("reverse"===a?(n=1-n,s&&(n-=s/A)):"mirror"===a&&(u=S)),l=gn(0,1,n)*A}const c=i?{done:!1,value:r[0]}:u.next(l);w&&(c.value=w(c.value));let{done:h}=c;i||null===T||(h=f>=0?D>=j:D<=0);const p=null===E&&("finished"===C||"running"===C&&h);return d&&d(c.value),p&&V(),c},M=()=>{v&&v.stop(),v=void 0},R=()=>{C="idle",M(),p(),y(),P=k=null},V=()=>{C="finished",c&&c(),M(),p()},L=()=>{if(g)return;v||(v=n(O));const t=v.now();l&&l(),null!==E?P=t-E:P&&"finished"!==C||(P=t),"finished"===C&&y(),k=P,E=null,C="running",v.start()};t&&L();const F={then:(t,e)=>m.then(t,e),get time(){return Ur(D)},set time(t){t=Br(t),D=t,null===E&&v&&0!==f?P=v.now()-t/f:E=t},get duration(){const t=null===b.calculatedDuration?Xi(b):b.calculatedDuration;return Ur(t)},get speed(){return f},set speed(t){t!==f&&v&&(f=t,F.time=Ur(D))},get state(){return C},play:L,pause:()=>{C="paused",E=D},stop:()=>{g=!0,"idle"!==C&&(C="idle",u&&u(),R())},cancel:()=>{null!==k&&O(k),R()},complete:()=>{C="finished"},sample:t=>(P=0,O(t))};return F}const Ki=function(){let t;return()=>(void 0===t&&(t=Object.hasOwnProperty.call(Element.prototype,"animate")),t)}(),Qi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const to={type:"spring",stiffness:500,damping:25,restSpeed:10},eo={type:"keyframes",duration:.8},no={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ro=(t,{keyframes:e})=>e.length>2?eo:an.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:to:no,io=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!ji.test(e)&&"0"!==e||e.startsWith("url("))),oo=new Set(["brightness","contrast","saturate","opacity"]);function so(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(bn)||[];if(!r)return t;const i=n.replace(r,"");let o=oo.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+i+")"}const ao=/([a-z-]*)\(.*?\)/g,lo={...ji,getAnimatableNone:t=>{const e=t.match(ao);return e?e.map(so).join(" "):t}},uo={...Rn,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:lo,WebkitFilter:lo},co=t=>uo[t];function ho(t,e){let n=co(t);return n!==lo&&(n=ji),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const po=t=>/^0[^.\s]+$/.test(t);function mo(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||po(t):void 0}function fo(t,e){return t[e]||t.default||t}const go=(t,e,n,r={})=>i=>{const o=fo(r,t)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Br(s);const l=function(t,e,n,r){const i=io(e,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<o.length;t++)null===o[t]&&(o[t]=0===t?s:o[t-1]),mo(o[t])&&l.push(t),"string"==typeof o[t]&&"none"!==o[t]&&"0"!==o[t]&&(a=o[t]);if(i&&l.length&&a)for(let t=0;t<l.length;t++)o[l[t]]=ho(e,a);return o}(e,t,n,o),u=l[0],c=l[l.length-1],d=io(t,u),h=io(t,c);Ir(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(o)||(p={...p,...ro(t,p)}),p.duration&&(p.duration=Br(p.duration)),p.repeatDelay&&(p.repeatDelay=Br(p.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const i=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:sr,pause:sr,stop:sr,then:t=>(t(),Promise.resolve()),cancel:sr,complete:sr});return e?Ji({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}(p);if(!r.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...i}){if(!Ki()||!Qi.has(e)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,s,a=!1,l=!1;const u=()=>{s=new Promise(t=>{o=t})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=i;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Hr(e.ease))(e,i)){const t=Ji({...i,repeat:0,delay:0});let e={done:!1,value:c[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;p=void 0,c=n,d=r-10,h="linear"}const m=function(t,e,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=qr(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,c,{...i,duration:d,ease:h,times:p}),f=()=>{l=!1,m.cancel()},g=()=>{l=!0,ur.update(f),o(),u()};return m.onfinish=()=>{l||(t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(c,i)),r&&r(),g())},{then:(t,e)=>s.then(t,e),attachTimeline:t=>(m.timeline=t,m.onfinish=null,sr),get time(){return Ur(m.currentTime||0)},set time(t){m.currentTime=Br(t)},get speed(){return m.playbackRate},set speed(t){m.playbackRate=t},get duration(){return Ur(d)},play:()=>{a||(m.play(),cr(f))},pause:()=>m.pause(),stop:()=>{if(a=!0,"idle"===m.playState)return;const{currentTime:e}=m;if(e){const n=Ji({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}g()},complete:()=>{l||m.finish()},cancel:g}}(e,t,p);if(n)return n}return Ji(p)};function yo(t){return Boolean(un(t)&&t.add)}const vo=t=>/^\-?\d*\.?\d+$/.test(t);function xo(t,e){-1===t.indexOf(e)&&t.push(e)}function wo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class bo{constructor(){this.subscriptions=[]}add(t){return xo(this.subscriptions,t),()=>wo(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const So={current:void 0};class Co{constructor(t,e={}){var n;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=dr;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ur.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ur.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new bo);const n=this.events[t].add(e);return"change"===t?()=>{n(),ur.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return So.current&&So.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?_i(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eo(t,e){return new Co(t,e)}const Po=t=>e=>e.test(t),ko=[yn,An,Tn,kn,Dn,jn,{test:t=>"auto"===t,parse:t=>t}],To=t=>ko.find(Po(t)),Ao=[...ko,mi,ji],jo=t=>Ao.find(Po(t));function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Eo(n))}function Oo(t,e){if(e)return(e[t]||e.default||e).from}function Mo({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Ro(t,e){const n=t.get();if(!Array.isArray(e))return n!==e;for(let t=0;t<e.length;t++)if(e[t]!==n)return!0}function Vo(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(o=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const r=t.getValue(e),i=a[e];if(!r||void 0===i||c&&Mo(c,e))continue;const s={delay:n,elapsed:0,...fo(o||{},e)};if(window.HandoffAppearAnimations){const n=t.getProps()[_e];if(n){const t=window.HandoffAppearAnimations(n,e,r,ur);null!==t&&(s.elapsed=t,s.isHandoff=!0)}}let d=!s.isHandoff&&!Ro(r,i);if("spring"===s.type&&(r.getVelocity()||s.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(go(e,r,i,t.shouldReduceMotion&&an.has(e)?{type:!1}:s));const h=r.animation;yo(l)&&(l.add(e),h.then(()=>l.remove(e))),u.push(h)}return s&&Promise.all(u).then(()=>{s&&function(t,e){const n=Nr(t,e);let{transitionEnd:r={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o)Do(t,e,nr(o[e]))}(t,s)}),u}function Lo(t,e,n={}){const r=Nr(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Vo(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,r=0,i=1,o){const s=[],a=(t.variantChildren.size-1)*r,l=1===i?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Fo).forEach((t,r)=>{t.notify("AnimationStart",e),s.push(Lo(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,o+r,s,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,s]:[s,o];return t().then(()=>e())}return Promise.all([o(),s(n.delay)])}function Fo(t,e){return t.sortNodePosition(e)}const No=[...He].reverse(),Io=He.length;function _o(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Lo(t,e,n));r=Promise.all(i)}else if("string"==typeof e)r=Lo(t,e,n);else{const i="function"==typeof e?Nr(t,e,n.custom):e;r=Promise.all(Vo(t,i,n))}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}(t);const n={animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()};let r=!0;const i=(e,n)=>{const r=Nr(t,n);if(r){const{transition:t,transitionEnd:n,...i}=r;e={...e,...i,...n}}return e};function o(o,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Io;e++){const p=No[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Ue(f),y=p===s?m.isActive:null;!1===y&&(h=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&r&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&null===y||!f&&!m.prevProp||$e(f)||"boolean"==typeof f)continue;let x=Bo(m.prevProp,f)||p===s&&m.isActive&&!v&&g||e>h&&g,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(i,{});!1===y&&(S={});const{prevResolvedValues:C={}}=m,E={...C,...S},P=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0};for(const t in E){const e=S[t],n=C[t];if(d.hasOwnProperty(t))continue;let r=!1;r=er(e)&&er(n)?!Fr(e,n):e!==n,r?void 0!==e?P(t):c.add(t):void 0!==e&&c.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&t.blockInitialAnimation&&(x=!1),!x||v&&!w||u.push(...b.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let p=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),r=!1,p?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,i){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Bo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Fr(e,t)}function Uo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $o=0;const Ho={animation:{Feature:class extends kr{constructor(t){super(t),t.animationState||(t.animationState=_o(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$e(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends kr{constructor(){super(...arguments),this.id=$o++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Wo=(t,e)=>Math.abs(t-e);class zo{constructor(t,e,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Go(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Wo(t.x,e.x),r=Wo(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:i}=dr;this.history.push({...r,timestamp:i});const{onStart:o,onMove:s}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=qo(e,this.transformPagePoint),ur.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Go("pointercancel"===t.type?this.lastMoveEventInfo:qo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!gr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=r||window;const o=qo(yr(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=dr;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Go(o,this.history)),this.removeListeners=wr(vr(this.contextWindow,"pointermove",this.handlePointerMove),vr(this.contextWindow,"pointerup",this.handlePointerUp),vr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cr(this.updatePoint)}}function qo(t,e){return e?{point:e(t.point)}:t}function Yo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return{point:t,delta:Yo(t,Zo(e)),offset:Yo(t,Xo(e)),velocity:Jo(e,.1)}}function Xo(t){return t[0]}function Zo(t){return t[t.length-1]}function Jo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Zo(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Br(e)));)n--;if(!r)return{x:0,y:0};const o=Ur(i.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ko(t){return t.max-t.min}function Qo(t,e=0,n=.01){return Math.abs(t-e)<=n}function ts(t,e,n,r=.5){t.origin=r,t.originPoint=fi(e.min,e.max,t.origin),t.scale=Ko(n)/Ko(e),(Qo(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=fi(n.min,n.max,t.origin)-t.originPoint,(Qo(t.translate)||isNaN(t.translate))&&(t.translate=0)}function es(t,e,n,r){ts(t.x,e.x,n.x,r?r.originX:void 0),ts(t.y,e.y,n.y,r?r.originY:void 0)}function ns(t,e,n){t.min=n.min+e.min,t.max=t.min+Ko(e)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+Ko(e)}function is(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function os(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ss(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const as=.35;function ls(t,e,n){return{min:us(t,e),max:us(t,n)}}function us(t,e){return"number"==typeof t?t:t[e]||0}const cs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ds(t){return[t("x"),t("y")]}function hs({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ps(t){return void 0===t||1===t}function ms({scale:t,scaleX:e,scaleY:n}){return!ps(t)||!ps(e)||!ps(n)}function fs(t){return ms(t)||gs(t)||t.z||t.rotate||t.rotateX||t.rotateY}function gs(t){return ys(t.x)||ys(t.y)}function ys(t){return t&&"0%"!==t}function vs(t,e,n){return n+e*(t-n)}function xs(t,e,n,r,i){return void 0!==i&&(t=vs(t,i,r)),vs(t,n,r)+e}function ws(t,e=0,n=1,r,i){t.min=xs(t.min,e,n,r,i),t.max=xs(t.max,e,n,r,i)}function bs(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}function Ss(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function Es(t,e,[n,r,i]){const o=void 0!==e[i]?e[i]:.5,s=fi(t.min,t.max,o);ws(t,e[n],e[r],s,e.scale)}const Ps=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ts(t,e){Es(t.x,e,Ps),Es(t.y,e,ks)}function As(t,e){return hs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const js=({current:t})=>t?t.ownerDocument.defaultView:null,Ds=new WeakMap;class Os{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new zo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(yr(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Er(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ds(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Tn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Ko(r)*(parseFloat(e)/100))}}this.originPoint[t]=e}),i&&ur.update(()=>i(t,e),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>ds(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:js(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:i}=this.getProps();i&&ur.update(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Ms(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?fi(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?fi(n,t,r.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,i=this.constraints;e&&Be(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!r)&&function(t,{top:e,left:n,bottom:r,right:i}){return{x:os(t.x,n,i),y:os(t.y,e,r)}}(r.layoutBox,e),this.elastic=function(t=as){return!1===t?t=0:!0===t&&(t=as),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ds(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Be(t))return!1;const n=t.current;_r(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(t,e,n){const r=As(t,n),{scroll:i}=e;return i&&(Cs(r.x,i.offset.x),Cs(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ss(t.x,e.x),y:ss(t.y,e.y)}}(r.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=hs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ds(s=>{if(!Ms(s,e,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(go(t,n,0,e))}stopAnimation(){ds(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ds(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ds(e=>{const{drag:n}=this.getProps();if(!Ms(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[e];i.set(t[e]-fi(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Be(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ds(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Ko(t),i=Ko(e);return i>r?n=Li(e.min,e.max-r,t.min):r>i&&(n=Li(t.min,t.max-i,e.min)),gn(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ds(e=>{if(!Ms(e,t,null))return;const n=this.getAxisMotionValue(e),{min:i,max:o}=this.constraints[e];n.set(fi(i,o,r[e]))})}addListeners(){if(!this.visualElement.current)return;Ds.set(this.visualElement,this);const t=vr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();Be(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=fr(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ds(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),r(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=as,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function Ms(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Rs=t=>(e,n)=>{t&&ur.update(()=>t(e,n))},Vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ls(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!An.test(t))return t;t=parseFloat(t)}return`${Ls(t,e.target.x)}% ${Ls(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=ji.parse(t);if(i.length>5)return r;const o=ji.createTransformer(t),s="number"!=typeof i[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=a,i[1+s]/=l;const u=fi(a,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=u),"number"==typeof i[3+s]&&(i[3+s]/=u),o(i)}};class Is extends c.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=t;var o;o=Bs,Object.assign(on,o),i&&(e.group&&e.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,r||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ur.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _s(t){const[e,n]=function(){const t=(0,c.useContext)(Ve);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=(0,c.useId)();return(0,c.useEffect)(()=>r(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),r=(0,c.useContext)(Ze);return c.createElement(Is,{...t,layoutGroup:r,switchLayoutGroup:(0,c.useContext)(Je),isPresent:e,safeToRemove:n})}const Bs={borderRadius:{...Fs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fs,borderTopRightRadius:Fs,borderBottomLeftRadius:Fs,borderBottomRightRadius:Fs,boxShadow:Ns},Us=["TopLeft","TopRight","BottomLeft","BottomRight"],$s=Us.length,Hs=t=>"string"==typeof t?parseFloat(t):t,Ws=t=>"number"==typeof t||An.test(t);function zs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const qs=Gs(0,.5,ei),Ys=Gs(.5,.95,sr);function Gs(t,e,n){return r=>r<t?0:r>e?1:n(Li(t,e,r))}function Xs(t,e){t.min=e.min,t.max=e.max}function Zs(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Js(t,e,n,r,i){return t=vs(t-=e,1/n,r),void 0!==i&&(t=vs(t,1/i,r)),t}function Ks(t,e,[n,r,i],o,s){!function(t,e=0,n=1,r=.5,i,o=t,s=t){if(Tn.test(e)&&(e=parseFloat(e),e=fi(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=fi(o.min,o.max,r);t===o&&(a-=e),t.min=Js(t.min,e,n,a,i),t.max=Js(t.max,e,n,a,i)}(t,e[n],e[r],e[i],e.scale,o,s)}const Qs=["x","scaleX","originX"],ta=["y","scaleY","originY"];function ea(t,e,n,r){Ks(t.x,e,Qs,n?n.x:void 0,r?r.x:void 0),Ks(t.y,e,ta,n?n.y:void 0,r?r.y:void 0)}function na(t){return 0===t.translate&&1===t.scale}function ra(t){return na(t.x)&&na(t.y)}function ia(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function oa(t){return Ko(t.x)/Ko(t.y)}class sa{constructor(){this.members=[]}add(t){xo(this.members,t),t.scheduleRender()}remove(t){if(wo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function aa(t,e,n){let r="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),i&&(r+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const la=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){xo(this.children,t),this.isDirty=!0}remove(t){wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(la),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"],da={visibility:"hidden"};let ha=0;const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function ma({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ha++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;this.projectionUpdateScheduled=!1,pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0,this.nodes.forEach(ya),this.nodes.forEach(Ea),this.nodes.forEach(Pa),this.nodes.forEach(va),t=pa,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ua)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t){const e=performance.now(),n=({timestamp:r})=>{const i=r-e;i>=250&&(cr(n),t(i-250))};return ur.read(n,!0),()=>cr(n)}(r),Vs.hasAnimatedSinceResize&&(Vs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ca))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||s.getDefaultTransition()||Oa,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ia(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...fo(i,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Ca(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ka),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(wa);this.isUpdating||this.nodes.forEach(ba),this.isUpdating=!1,this.nodes.forEach(Sa),this.nodes.forEach(fa),this.nodes.forEach(ga),this.clearAllSnapshots();const t=performance.now();dr.delta=gn(0,1e3/60,t-dr.timestamp),dr.timestamp=t,dr.isProcessing=!0,hr.update.process(dr),hr.preRender.process(dr),hr.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(xa),this.sharedNodes.forEach(Ta)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ur.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ur.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ra(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;t&&(e||fs(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Va((r=n).x),Va(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Cs(e.x,n.offset.x),Cs(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:o}=r;if(r!==this.root&&i&&o.layoutScroll){if(i.isRoot){Zs(e,t);const{scroll:n}=this.root;n&&(Cs(e.x,-n.offset.x),Cs(e.y,-n.offset.y))}Cs(e.x,i.offset.x),Cs(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Zs(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ts(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fs(r.latestValues)&&Ts(n,r.latestValues)}return fs(this.latestValues)&&Ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fs(n.latestValues))continue;ms(n.latestValues)&&n.updateSnapshot();const r=cs();Zs(r,n.measurePageBox()),ea(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fs(this.latestValues)&&ea(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:i,layoutId:o}=this.options;if(this.layout&&(i||o)){if(this.resolvedRelativeTargetAt=dr.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ns(s.x,a.x,l.x),ns(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Zs(this.target,this.layout.layoutBox),bs(this.target,this.targetDelta)):Zs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.target,t.target),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}pa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ms(this.parent.latestValues)&&!gs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===dr.timestamp&&(r=!1),r)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;Zs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const i=n.length;if(!i)return;let o,s;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,bs(t,s)),r&&fs(o.latestValues)&&Ts(t,o.latestValues))}e.x=Ss(e.x),e.y=Ss(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.projectionTransform;es(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=aa(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),pa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Da));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,p,m;Aa(o.x,t.x,n),Aa(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(is(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,h=this.relativeTargetOrigin,p=s,m=n,ja(l.x,h.x,p.x,m),ja(l.y,h.y,p.y,m),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Zs(d,this.relativeTarget)),a&&(this.animationValues=i,function(t,e,n,r,i,o){i?(t.opacity=fi(0,void 0!==n.opacity?n.opacity:1,qs(r)),t.opacityExit=fi(void 0!==e.opacity?e.opacity:1,0,Ys(r))):o&&(t.opacity=fi(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i<$s;i++){const o=`border${Us[i]}Radius`;let s=zs(e,o),a=zs(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Ws(s)===Ws(a)?(t[o]=Math.max(fi(Hs(s),Hs(a),r),0),(Tn.test(a)||Tn.test(s))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=fi(e.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ur.update(()=>{Vs.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=un(0)?0:Eo(0);return r.start(go("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:i}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&La(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ko(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Ko(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Zs(e,n),Ts(e,i),es(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<ca.length;e++){const i="rotate"+ca[e];n[i]&&(r[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return da;const r={visibility:""},i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=rr(null==t?void 0:t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=rr(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=aa(this.projectionDeltaWithTransform,this.treeScale,s),i&&(r.transform=i(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in on){if(void 0===s[t])continue;const{correct:e,applyTo:n}=on[t],i="none"===r.transform?s[t]:e(s[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=i}else r[t]=i}return this.options.layoutId&&(r.pointerEvents=o===this?rr(null==t?void 0:t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(wa),this.root.sharedNodes.clear()}}}function fa(t){t.updateLayout()}function ga(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?ds(t=>{const r=o?n.measuredBox[t]:n.layoutBox[t],i=Ko(r);r.min=e[t].min,r.max=r.min+i}):La(i,n.layoutBox,e)&&ds(r=>{const i=o?n.measuredBox[r]:n.layoutBox[r],s=Ko(e[r]);i.max=i.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};es(s,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?es(a,t.applyTransform(r,!0),n.measuredBox):es(a,e,n.layoutBox);const l=!ra(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:o}=r;if(i&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};is(s,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};is(a,e,o.layoutBox),ia(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ya(t){pa.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function va(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function xa(t){t.clearSnapshot()}function wa(t){t.clearMeasurements()}function ba(t){t.isLayoutDirty=!1}function Sa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ca(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ea(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function ka(t){t.resetRotation()}function Ta(t){t.removeLeadSnapshot()}function Aa(t,e,n){t.translate=fi(e.translate,0,n),t.scale=fi(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ja(t,e,n,r){t.min=fi(e.min,n.min,r),t.max=fi(e.max,n.max,r)}function Da(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Oa={duration:.45,ease:[.4,0,.1,1]},Ma=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=Ma("applewebkit/")&&!Ma("chrome/")?Math.round:sr;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function La(t,e,n){return"position"===t||"preserve-aspect"===t&&!Qo(oa(e),oa(n),.2)}const Fa=ma({attachResizeListener:(t,e)=>fr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Na={current:void 0},Ia=ma({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Na.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),Na.current=t}return Na.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),_a={pan:{Feature:class extends kr{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new zo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:js(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rs(t),onStart:Rs(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&ur.update(()=>r(t,e))}}}mount(){this.removePointerDownListener=vr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends kr{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new Os(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Ia,MeasureLayout:_s}},Ba=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ua(t,e,n=1){_r(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=function(t){const e=Ba.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const t=o.trim();return vo(t)?parseFloat(t):t}return mn(i)?Ua(i,e,n+1):i}const $a=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ha=t=>$a.has(t),Wa=t=>t===yn||t===An,za=(t,e)=>parseFloat(t.split(", ")[e]),qa=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return za(i[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},Ya=new Set(["x","y","z"]),Ga=sn.filter(t=>!Ya.has(t)),Xa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:qa(4,13),y:qa(5,14)};Xa.translateX=Xa.x,Xa.translateY=Xa.y;function Za(t,e,n,r){return(t=>Object.keys(t).some(Ha))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const i=Object.keys(e).filter(Ha);let o=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=To(u);const d=e[i];let h;if(er(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=To(u);for(let n=e;n<t&&null!==d[n];n++)h?_r(To(d[n])===h,"All keyframes must be of the same type"):(h=To(d[n]),_r(h===c||Wa(c)&&Wa(h),"Keyframes must be of the same dimension as the current value"))}else h=To(d);if(c!==h)if(Wa(c)&&Wa(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===An&&(e[i]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[i]=c.transform(d):(s||(o=function(t){const e=[];return Ga.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),r[i]=void 0!==r[i]?r[i]:e[i],l.jump(d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const r=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:s}=o,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Xa[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=Xa[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),Le&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ja={current:null},Ka={current:!1},Qa=new WeakMap,tl=Object.keys(Xe),el=tl.length,nl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rl=We.length;class il{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ur.render(this.render,!1,!0);const{latestValues:s,renderState:a}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ze(e),this.isVariantNode=qe(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&un(e)&&(e.set(s[t],!1),yo(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Qa.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ka.current||function(){if(Ka.current=!0,Le)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ja.current=t.matches;t.addListener(e),e()}else Ja.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ja.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Qa.delete(this.current),this.projection&&this.projection.unmount(),cr(this.notifyUpdate),cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=an.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ur.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,i){let o,s;for(let t=0;t<el;t++){const n=tl[t],{isEnabled:r,Feature:i,ProjectionNode:a,MeasureLayout:l}=Xe[n];a&&(o=a),r(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(s=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&Be(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<nl.length;e++){const n=nl[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const i in e){const o=e[i],s=n[i];if(un(o))t.addValue(i,o),yo(r)&&r.add(i);else if(un(s))t.addValue(i,Eo(o,{owner:t})),yo(r)&&r.remove(i);else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Eo(void 0!==e?e:o,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<rl;t++){const n=We[t],r=this.props[n];(Ue(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Eo(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=tr(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||un(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new bo),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ol extends il{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},i){let o=function(t,e,n){const r={};for(const i in t){const t=Oo(i,e);if(void 0!==t)r[i]=t;else{const t=n.getValue(i);t&&(r[i]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),i){!function(t,e,n){var r,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(vo(u)||po(u))?u=parseFloat(u):!jo(u)&&ji.test(l)&&(u=ho(s,l)),t.addValue(s,Eo(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,o);const t=((t,e,n,r)=>{const i=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!mn(e))return;const n=Ua(e,r);n&&t.set(n)});for(const t in e){const i=e[t];if(!mn(i))continue;const o=Ua(i,r);o&&(e[t]=o,n||(n={}),void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,r);return Za(t,e=i.target,n,r=i.transitionEnd)})(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class sl extends ol{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),i=(pn(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return As(t,e)}build(t,e,n,r){Vn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Kn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(t,e,n,r){Xn(t,e,n,r)}}class al extends ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}return e=Zn.has(e)?e:Ie(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Qn(t,e)}build(t,e,n,r){zn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Jn(t,e,0,r)}mount(t){this.isSVGTag=qn(t.tagName),super.mount(t)}}const ll=(t,e)=>rn(t)?new al(e,{enableHardwareAcceleration:!1}):new sl(e,{enableHardwareAcceleration:!0}),ul={...Ho,...Lr,..._a,layout:{ProjectionNode:Ia,MeasureLayout:_s}},cl=en((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...rn(t)?pr:mr,preloadedFeatures:n,useRender:Gn(e),createVisualElement:r,Component:t}}(t,e,ul,ll)),dl=window.wp.components;Object.defineProperty;var hl=new Map,pl=new WeakMap,ml=0;function fl(t,e,n={},r=void 0){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:s}=function(t){const e=function(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>{return`${e}_${"root"===e?(n=t.root,n?(pl.has(n)||(ml+=1,pl.set(n,ml.toString())),pl.get(n)):"0"):t[e]}`;var n}).toString()}(t);let n=hl.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver(e=>{e.forEach(e=>{var n;const o=e.isIntersecting&&i.some(t=>e.intersectionRatio>=t);t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach(t=>{t(o,e)})})},t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},hl.set(e,n)}return n}(n),a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),o.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),o.unobserve(t)),0===s.size&&(o.disconnect(),hl.delete(i))}}function gl(){return gl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gl.apply(this,arguments)}function yl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yl(Object(n),!0).forEach(function(e){xl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c.Component;class wl extends h().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let i in e){const o=parseInt(i);o>0&&t<=o&&o<n&&(n=o,r=e[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),n=h().Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%t;e[i]||(e[i]=[]),e[i].push(n[r])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let o=n;o&&"string"!=typeof o&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===o&&(o="my-masonry-grid_column"));const s=vl(vl(vl({},t),e),{},{style:vl(vl({},e.style),{},{width:i}),className:o});return r.map((t,e)=>h().createElement("div",gl({},s,{key:e}),t))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:n,columnClassName:r,columnAttrs:i,column:o,className:s}=t,a=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let l=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(l="my-masonry-grid")),h().createElement("div",gl({},a,{className:l}),this.renderColumns())}}wl.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const bl=wl,Sl=window.wp.blockEditor,Cl=window.wp.blocks;var El=i(942),Pl=i.n(El);const kl=window.lodash,Tl={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"},Al=(t,e=[])=>Array.from(e).some(e=>!!e.style&&Array.from(e.style).some(e=>e&&e.includes(t))),jl=new WeakMap,Dl=x(S((t,e)=>({selectedPatterns:{},toggleSelection:(e,n,r="")=>t(t=>{const i={...t.selectedPatterns};if(i[e])delete i[e];else{if(Object.keys(i).length>=10)return t;i[e]={blocks:n,prompt:r}}return{selectedPatterns:i}}),updatePrompt:(e,n)=>t(t=>t.selectedPatterns[e]?{selectedPatterns:{...t.selectedPatterns,[e]:{...t.selectedPatterns[e],prompt:n}}}:t),isSelected:t=>!!e().selectedPatterns[t],getSelectedCount:()=>Object.keys(e().selectedPatterns).length,canSelectMore:()=>Object.keys(e().selectedPatterns).length<10,getSelectedPatterns:()=>Object.entries(e().selectedPatterns).map(([t,e])=>({patternId:t,...e})),clearSelection:()=>t({selectedPatterns:{}}),removeFromSelection:e=>t(t=>{const n={...t.selectedPatterns};return delete n[e],{selectedPatterns:n}})}),{name:"Strakture Selection"})),Ol=({patternId:e,onPatternClick:n,code:i,disabled:o})=>{const[s,a]=(0,t.useState)(!1),l=(0,t.useRef)(),{isSelected:u,toggleSelection:c,canSelectMore:d}=Dl(),h=u(e),p=!h&&!d(),m=/100[vsd]vh|min-height:\s*100vh/.test(i),f=(0,t.useMemo)(()=>(0,Cl.rawHandler)({HTML:Ml(i)}),[i]),{ready:g}=(({container:e,onIFrameLoaded:n,ready:r,loadDelay:i})=>{const o=(()=>{const e=(0,t.useRef)(!1);return(0,t.useEffect)(()=>(e.current=!0,()=>e.current=!1)),e})(),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(!1),{addMissingCSSVar:p}=V(),m=(0,t.useCallback)(t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in Tl)e.getPropertyValue(r)||Array.from(n).filter(t=>{try{return t.cssRules}catch(t){return!1}}).some(t=>Al(r,t.cssRules))||(p(r),t.contentDocument.documentElement.style.setProperty(r,Tl[r]))},[p]),f=(0,t.useCallback)(async(t,e)=>{if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let n=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];n=n?parseFloat(n):null;const r=e.offsetHeight/(null!=n?n:1);t.style.setProperty("max-height",`${r}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)jl.has(t)||jl.set(t,t.style.minHeight),t.style.minHeight=jl.get(t);e.offsetHeight,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>requestAnimationFrame(t));for(const e of i){if(!t.contentDocument?.defaultView)return;const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1},[]);return(0,t.useEffect)(()=>{if(!r)return;const t=setTimeout(()=>{if(l)return;const t=e?.querySelector("iframe[title]");if(!t)return a(t=>t+1);u(t),requestAnimationFrame(()=>n(t,e))},100);return()=>clearTimeout(t)},[l,r,s,e,n]),(0,t.useEffect)(()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame(()=>n(l,e));const n=(0,kl.debounce)(async()=>{o.current&&!h.current&&(r.disconnect(),await f(l,e),"extendable"!==window.straktureSharedData?.themeSlug&&await m(l,e),setTimeout(()=>d(!0),i),o.current&&r.observe(l.contentDocument,t))},300),r=new MutationObserver(n);return r.observe(l.contentDocument,t),()=>{n.cancel(),r?.disconnect()}},[l,e,o,r,f,m,i]),{loading:!l,ready:c}})({container:l.current,ready:s,onIFrameLoaded:()=>{},loadDelay:50});return(0,t.useEffect)(()=>a(!0),[]),(0,M.jsxs)("div",{className:Pl()(`library-pattern pattern-${e} mb-8 rounded-md overflow-hidden w-full border bg-white transition-colors duration-150`,{"opacity-0 border-transparent":!g,"opacity-100 border-gray-400 hover:border-design-main":g&&!o&&!h,"opacity-100 border-design-main bg-design-main/5":g&&!o&&h,"opacity-100 border-gray-400":g&&o,"opacity-50":o}),children:[(0,M.jsx)("button",{ref:l,type:"button",disabled:o,"aria-label":(0,r.__)("Insert Pattern","strakture"),className:Pl()("relative z-10 m-0 inline-block w-full bg-transparent p-0 focus:shadow-sm focus:outline-none focus:ring-wp focus:ring-design-main focus:ring-offset-2 focus:ring-offset-white",{"cursor-not-allowed":o}),onClick:()=>n(e,f),children:(0,M.jsx)(Sl.BlockPreview,{blocks:f,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }\n\t\t\t\t\t\t\t\t'+(m?".wp-block-cover { min-height: 788px !important; }":"")}]})}),(0,M.jsx)("div",{className:"p-3",children:(0,M.jsx)("div",{className:"flex items-center justify-between",children:(0,M.jsxs)("label",{className:"cursor-pointer items-center",children:[(0,M.jsx)("input",{type:"checkbox",checked:h,onChange:()=>c(e,f),disabled:o||p,className:"h-4 w-4 rounded border-gray-400 text-design-main focus:ring-design-main focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50"}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Select pattern","strakture")})]})})})]})},Ml=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),Rl="https://api.strakture.com";var Vl=i(888),Ll=Object.prototype.hasOwnProperty;const Fl=new WeakMap,Nl=()=>{},Il=Nl(),_l=Object,Bl=t=>t===Il,Ul=t=>"function"==typeof t,$l=(t,e)=>({...t,...e}),Hl=t=>Ul(t.then),Wl={},zl={},ql="undefined",Yl=typeof window!=ql,Gl=typeof document!=ql,Xl=Yl&&"Deno"in window,Zl=(t,e)=>{const n=Fl.get(t);return[()=>!Bl(e)&&t.get(e)||Wl,r=>{if(!Bl(e)){const i=t.get(e);e in zl||(zl[e]=i),n[5](e,$l(i,r),i||Wl)}},n[6],()=>!Bl(e)&&e in zl?zl[e]:!Bl(e)&&t.get(e)||Wl]};let Jl=!0;const[Kl,Ql]=Yl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Nl,Nl],tu={isOnline:()=>Jl,isVisible:()=>{const t=Gl&&document.visibilityState;return Bl(t)||"hidden"!==t}},eu={initFocus:t=>(Gl&&document.addEventListener("visibilitychange",t),Kl("focus",t),()=>{Gl&&document.removeEventListener("visibilitychange",t),Ql("focus",t)}),initReconnect:t=>{const e=()=>{Jl=!0,t()},n=()=>{Jl=!1};return Kl("online",e),Kl("offline",n),()=>{Ql("online",e),Ql("offline",n)}}},nu=!c.useId,ru=!Yl||Xl,iu=ru?c.useEffect:c.useLayoutEffect,ou="undefined"!=typeof navigator&&navigator.connection,su=!ru&&ou&&(["slow-2g","2g"].includes(ou.effectiveType)||ou.saveData),au=new WeakMap,lu=(t,e)=>t===`[object ${e}]`;let uu=0;const cu=t=>{const e=typeof t,n=(r=t,_l.prototype.toString.call(r));var r;const i=lu(n,"Date"),o=lu(n,"RegExp"),s=lu(n,"Object");let a,l;if(_l(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=au.get(t),a)return a;if(a=++uu+"~",au.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=cu(t[l])+",";au.set(t,a)}if(s){a="#";const e=_l.keys(t).sort();for(;!Bl(l=e.pop());)Bl(t[l])||(a+=l+":"+cu(t[l])+",");au.set(t,a)}}return a},du=t=>{if(Ul(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?cu(t):"",e]};let hu=0;const pu=()=>++hu;async function mu(...t){const[e,n,r,i]=t,o=$l({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=o.throwOnError;if(Ul(n)){const t=n,r=[],i=e.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(c))}return c(n);async function c(n){const[i]=du(n);if(!i)return;const[c,d]=Zl(e,i),[h,p,m,f]=Fl.get(e),g=()=>{const t=h[i];return(Ul(o.revalidate)?o.revalidate(c().data,n):!1!==o.revalidate)&&(delete m[i],delete f[i],t&&t[0])?t[0](2).then(()=>c().data):c().data};if(t.length<3)return g();let y,v=r,x=!1;const w=pu();p[i]=[w,0];const b=!Bl(l),S=c(),C=S.data,E=S._c,P=Bl(E)?C:E;if(b&&(l=Ul(l)?l(P,C):l,d({data:l,_c:P})),Ul(v))try{v=v(P)}catch(t){y=t,x=!0}if(v&&Hl(v)){if(v=await v.catch(t=>{y=t,x=!0}),w!==p[i][0]){if(x)throw y;return v}x&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Il}))}if(s&&!x)if(Ul(s)){const t=s(v,P);d({data:t,error:Il,_c:Il})}else d({data:v,error:Il,_c:Il});if(p[i][1]=pu(),Promise.resolve(g()).then(()=>{d({_c:Il})}),!x)return v;if(u)throw y}}const fu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},gu=(t,e)=>{if(!Fl.has(t)){const n=$l(eu,e),r=Object.create(null),i=mu.bind(Il,t);let o=Nl;const s=Object.create(null),a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const i=s[e];if(i)for(const t of i)t(n,r)},u=()=>{if(!Fl.has(t)&&(Fl.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!ru)){const e=n.initFocus(setTimeout.bind(Il,fu.bind(Il,r,0))),i=n.initReconnect(setTimeout.bind(Il,fu.bind(Il,r,1)));o=()=>{e&&e(),i&&i(),Fl.delete(t)}}};return u(),[t,i,u,o]}return[t,Fl.get(t)[4]]},[yu,vu]=gu(new Map),xu=$l({onLoadingSlow:Nl,onSuccess:Nl,onError:Nl,onErrorRetry:(t,__,e,n,r)=>{const i=e.errorRetryCount,o=r.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*e.errorRetryInterval;!Bl(i)&&o>i||setTimeout(n,s,r)},onDiscarded:Nl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:su?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:su?5e3:3e3,compare:function t(e,n){var r,i;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((i=e.length)===n.length)for(;i--&&t(e[i],n[i]););return-1===i}if(!r||"object"==typeof e){for(r in i=0,e){if(Ll.call(e,r)&&++i&&!Ll.call(n,r))return!1;if(!(r in n)||!t(e[r],n[r]))return!1}return Object.keys(n).length===i}}return e!=e&&n!=n},isPaused:()=>!1,cache:yu,mutate:vu,fallback:{}},tu),wu=(t,e)=>{const n=$l(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=$l(i,s))}return n},bu=(0,c.createContext)({}),Su="$inf$",Cu=Yl&&window.__SWR_DEVTOOLS_USE__,Eu=Cu?window.__SWR_DEVTOOLS_USE__:[],Pu=t=>Ul(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],ku=Eu.concat(t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=du(e),[,,,i]=Fl.get(yu);if(r.startsWith(Su))return n(...t);const o=i[r];return Bl(o)?n(...t):(delete i[r],o)}),r)),Tu=(t,e)=>(...n)=>{const[r,i,o]=Pu(n),s=(o.use||[]).concat(e);return t(r,i,{...o,use:s})};Cu&&(window.__SWR_DEVTOOLS_REACT__=c);const Au=()=>{};Au(),new WeakMap;const ju=c.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Du={dedupe:!0},Ou=Promise.resolve(Il),Mu=(_l.defineProperty(t=>{const{value:e}=t,n=(0,c.useContext)(bu),r=Ul(e),i=(0,c.useMemo)(()=>r?e(n):e,[r,n,e]),o=(0,c.useMemo)(()=>r?i:wu(n,i),[r,n,i]),s=i&&i.provider,a=(0,c.useRef)(Il);s&&!a.current&&(a.current=gu(s(o.cache||yu),i));const l=a.current;return l&&(o.cache=l[0],o.mutate=l[1]),iu(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,c.createElement)(bu.Provider,$l(t,{value:o}))},"defaultValue",{value:xu}),Ru=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p,strictServerPrefetchWarning:m}=n,[f,g,y,v]=Fl.get(r),[x,w]=du(t),b=(0,c.useRef)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(x),E=(0,c.useRef)(e),P=(0,c.useRef)(n),k=()=>P.current,T=()=>k().isVisible()&&k().isOnline(),[A,j,D,O]=Zl(r,x),M=(0,c.useRef)({}).current,R=Bl(s)?Bl(n.fallback)?Il:n.fallback[x]:s,V=(t,e)=>{for(const n in M){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!Bl(t[r]))return!1;if(!i(H,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},L=(0,c.useMemo)(()=>{const t=!!x&&!!e&&(Bl(a)?!k().isPaused()&&!o&&!1!==l:a),n=e=>{const n=$l(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),i=O(),s=n(r),u=r===i?s:n(i);let c=s;return[()=>{const t=n(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>u]},[r,x]),F=(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>D(x,(e,n)=>{V(n,e)||t()}),[r,x]),L[0],L[1]),N=!b.current,I=f[x]&&f[x].length>0,_=F.data,B=Bl(_)?R&&Hl(R)?ju(R):R:_,U=F.error,$=(0,c.useRef)(B),H=p?Bl(_)?Bl($.current)?B:$.current:_:B,W=x&&Bl(B),z=!ru&&(0,Vl.useSyncExternalStore)(()=>Nl,()=>!1,()=>!0);m&&z&&!o&&W&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const q=!(I&&!Bl(U))&&(N&&!Bl(a)?a:!k().isPaused()&&(o?!Bl(B)&&l:Bl(B)||l)),Y=!!(x&&e&&N&&q),G=Bl(F.isValidating)?Y:F.isValidating,X=Bl(F.isLoading)?Y:F.isLoading,Z=(0,c.useCallback)(async t=>{const e=E.current;if(!x||!e||S.current||k().isPaused())return!1;let r,o,s=!0;const a=t||{},l=!y[x]||!a.dedupe,u=()=>nu?!S.current&&x===C.current&&b.current:x===C.current,c={isValidating:!1,isLoading:!1},d=()=>{j(c)},h=()=>{const t=y[x];t&&t[1]===o&&delete y[x]},p={isValidating:!0};Bl(A().data)&&(p.isLoading=!0);try{if(l&&(j(p),n.loadingTimeout&&Bl(A().data)&&setTimeout(()=>{s&&u()&&k().onLoadingSlow(x,n)},n.loadingTimeout),y[x]=[e(w),pu()]),[r,o]=y[x],r=await r,l&&setTimeout(h,n.dedupingInterval),!y[x]||y[x][1]!==o)return l&&u()&&k().onDiscarded(x),!1;c.error=Il;const t=g[x];if(!Bl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&k().onDiscarded(x),!1;const a=A().data;c.data=i(a,r)?a:r,l&&u()&&k().onSuccess(r,x,n)}catch(t){h();const e=k(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,x,e),(!0===n||Ul(n)&&n(t))&&(k().revalidateOnFocus&&k().revalidateOnReconnect&&!T()||e.onErrorRetry(t,x,e,t=>{const e=f[x];e&&e[0]&&e[0](3,t)},{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0},[x,r]),J=(0,c.useCallback)((...t)=>mu(r,C.current,...t),[]);if(iu(()=>{E.current=e,P.current=n,Bl(_)||($.current=_)}),iu(()=>{if(!x)return;const t=Z.bind(Il,Du);let e=0;if(k().revalidateOnFocus){const t=Date.now();e=t+k().focusThrottleInterval}const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(x,f,(n,r={})=>{if(0==n){const n=Date.now();k().revalidateOnFocus&&n>e&&T()&&(e=n+k().focusThrottleInterval,t())}else if(1==n)k().revalidateOnReconnect&&T()&&t();else{if(2==n)return Z();if(3==n)return Z(r)}});return S.current=!1,C.current=x,b.current=!0,j({_k:w}),q&&(y[x]||(Bl(B)||ru?t():(t=>{Yl&&typeof window.requestAnimationFrame!=ql?window.requestAnimationFrame(t):setTimeout(t,1)})(t))),()=>{S.current=!0,n()}},[x]),iu(()=>{let t;function e(){const e=Ul(u)?u(A().data):u;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!k().isVisible()||!h&&!k().isOnline()?e():Z(Du).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}},[u,d,h,x]),(0,c.useDebugValue)(H),o){if(!nu&&ru&&W)throw new Error("Fallback data is required when using Suspense in SSR.");W&&(E.current=e,P.current=n,S.current=!1);const t=v[x],r=!Bl(t)&&W?J(t):Ou;if(ju(r),!Bl(U)&&W)throw U;const i=W?Z(Du):Ou;!Bl(H)&&W&&(i.status="fulfilled",i.value=!0),ju(i)}return{mutate:J,get data(){return M.data=!0,H},get error(){return M.error=!0,U},get isValidating(){return M.isValidating=!0,G},get isLoading(){return M.isLoading=!0,X}}},function(...t){const e=(()=>{const t=(0,c.useContext)(bu);return(0,c.useMemo)(()=>$l(xu,t),[t])})(),[n,r,i]=Pu(t),o=wu(e,i);let s=Ru;const{use:a}=o,l=(a||[]).concat(ku);for(let t=l.length;t--;)s=l[t](s);return s(n,r||o.fetcher||null,o)});var Ru;const Vu=()=>{},Lu=Vu(),Fu=Object,Nu=t=>t===Lu,Iu=new WeakMap,_u=(t,e)=>t===`[object ${e}]`;let Bu=0;const Uu=t=>{const e=typeof t,n=(r=t,Fu.prototype.toString.call(r));var r;const i=_u(n,"Date"),o=_u(n,"RegExp"),s=_u(n,"Object");let a,l;if(Fu(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=Iu.get(t),a)return a;if(a=++Bu+"~",Iu.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=Uu(t[l])+",";Iu.set(t,a)}if(s){a="#";const e=Fu.keys(t).sort();for(;!Nu(l=e.pop());)Nu(t[l])||(a+=l+":"+Uu(t[l])+",");Iu.set(t,a)}}return a},$u=Promise.resolve(),Hu=Tu(Mu,t=>(e,n,r)=>{const i=(0,c.useRef)(!1),{cache:o,initialSize:s=1,revalidateAll:a=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,p]=Fl.get(yu);let m;try{m=(t=>(t=>{if((t=>"function"==typeof t)(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Uu(t):"",e]})(t?t(0,null):null)[0])(e),m&&(m=Su+m)}catch(t){}const[f,g,y]=Zl(o,m),v=(0,c.useCallback)(()=>Bl(f()._l)?s:f()._l,[o,m,s]);(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>m?y(m,()=>{t()}):()=>{},[o,m]),v,v);const x=(0,c.useCallback)(()=>{const t=f()._l;return Bl(t)?s:t},[m,s]),w=(0,c.useRef)(x());iu(()=>{i.current?m&&g({_l:l?w.current:x()}):i.current=!0},[m,o]);const b=d&&!i.current,S=t(m,async t=>{const i=f()._i,s=f()._r;g({_r:Il});const l=[],c=x(),[d]=Zl(o,t),m=d().data,y=[];let v=null;for(let t=0;t<c;++t){const[c,d]=du(e(t,h?null:v));if(!c)break;const[f,g]=Zl(o,c);let x=f().data;const w=a||i||Bl(x)||u&&!t&&!Bl(m)||b||m&&!Bl(m[t])&&!r.compare(m[t],x);if(n&&("function"==typeof s?s(x,d):w)){const e=async()=>{if(c in p){const t=p[c];delete p[c],x=await t}else x=await n(d);g({data:x,_k:d}),l[t]=x};h?y.push(e):await e()}else l[t]=x;h||(v=x)}return h&&await Promise.all(y.map(t=>t())),g({_i:Il}),l},r),C=(0,c.useCallback)(function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return m?(r&&(Bl(t)?g({_i:!0,_r:n.revalidate}):g({_i:!1,_r:n.revalidate})),arguments.length?S.mutate(t,{...n,revalidate:r}):S.mutate()):$u},[m,o]),E=(0,c.useCallback)(t=>{if(!m)return $u;const[,n]=Zl(o,m);let r;if(Ul(t)?r=t(x()):"number"==typeof t&&(r=t),"number"!=typeof r)return $u;n({_l:r}),w.current=r;const i=[],[s]=Zl(o,m);let a=null;for(let t=0;t<r;++t){const[n]=du(e(t,a)),[r]=Zl(o,n),l=n?r().data:Il;if(Bl(l))return C(s().data);i.push(l),a=l}return C(i)},[m,o,C,x]);return{size:x(),setSize:E,mutate:C,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}}),Wu=t=>fetch(t).then(t=>t.json()) ,zu=({onPatternClick:e,siteType:n,category:i,disabled:o})=>{const{data:s,isLoading:a,setSize:l}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.straktureSharedData?.wpVersion,lang:window.straktureSharedData?.wpLanguage||null,showLocalizedCopy:window.straktureSharedData?.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}=Hu((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter(([,t])=>void 0!==t).forEach(([t,e])=>{r.append(t,e)}),`${Rl}/v1/patterns?${r.toString()}`},Wu,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}})({siteType:n?.slug,category:i}),[u,d]=(0,t.useState)(!0),[h,p]=function({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:s,initialInView:a,fallbackInView:l,onChange:u}={}){var d;const[h,p]=c.useState(null),m=c.useRef(u),[f,g]=c.useState({inView:!!a,entry:void 0});m.current=u,c.useEffect(()=>{if(s||!h)return;let a;return a=fl(h,(t,e)=>{g({inView:t,entry:e}),m.current&&m.current(t,e),e.isIntersecting&&o&&a&&(a(),a=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{a&&a()}},[Array.isArray(t)?t.toString():t,h,i,r,o,s,n,l,e]);const y=null==(d=f.entry)?void 0:d.target,v=c.useRef(void 0);h||!y||o||s||v.current===y||(v.current=y,g({inView:!!a,entry:void 0}));const x=[p,f.inView,f.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}(),[m,f]=(0,t.useState)({}),{isSelected:g,updatePrompt:y,clearSelection:v}=Dl(),x=(0,t.useCallback)((t,e)=>{f(n=>({...n,[t]:e})),g(t)&&y(t,e)},[g,y]);(0,t.useEffect)(()=>{v()},[i,n,v]);const w=(0,t.useCallback)((t,n)=>{e(t,n,m[t]||"")},[e,m]),b=s?.at(-1)?.length<9;return(0,t.useEffect)(()=>{if(a)return d(!0);const t=setTimeout(()=>{d(!1)},750);return()=>clearTimeout(t)},[a]),(0,t.useEffect)(()=>{p&&!a&&l(t=>t+1)},[p,a,l]),a||!s?.length?(0,M.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(bl,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"relative flex w-full gap-6 p-8 pt-2",children:s.map(t=>t.map(({id:t,code:e,patternReplacementCode:n})=>(0,M.jsx)(Ol,{patternId:t,onPatternClick:w,code:null!=n?n:e,disabled:o,prompt:m[t]||"",onPromptChange:x},t)))}),u?(0,M.jsxs)("div",{className:"absolute inset-0 z-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):null,u||b?null:(0,M.jsxs)("div",{ref:h,className:"mb-6 mt-6 flex w-full justify-center md:mt-2",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading more patterns...","strakture")})]})]})},qu=Tu(Mu,t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r))),Yu=async()=>{const t=new URLSearchParams({wpVersion:window.straktureSharedData?.wpVersion||null,lang:window.straktureSharedData?.wpLanguage||null});return await fetch(`${Rl}/v1/patterns/categories?${t.toString()}`).then(t=>t.json())},Gu=x(k(t=>({categories:[],setCategories:e=>t({categories:e})}),{name:`strakture-library-cache-${window.straktureSharedData?.siteId}`})),Xu="/strakture/v1/library/settings",Zu={getItem:async()=>await a()({path:Xu}),setItem:async(t,e)=>await a()({path:Xu,method:"POST",data:{state:e}})},Ju={siteType:"",category:"",totalImports:0},Ku=l(window.straktureLibraryData?.siteInfo),Qu=x(k(t=>{var e,n,r,i;return{...Ju,...null!==(e=Ku?.state)&&void 0!==e?e:{},siteType:(i=null!==(n=null!==(r=window.straktureSharedData?.siteType)&&void 0!==r?r:Ku?.siteType)&&void 0!==n?n:"","string"==typeof i?i:""),setCategory:e=>t({category:e}),setSiteType:e=>t({siteType:e}),incrementImports:()=>t(t=>({totalImports:Number(t.totalImports)+1}))}},{name:"strakture_library_site_data",storage:E(()=>Zu),skipHydration:!0})),tc=()=>{const{category:e,setCategory:n}=Qu(),{data:i,isLoading:o,errorCount:s}=(()=>{var e;const[n,r]=(0,t.useState)(0),i=null!==(e=window.straktureSharedData?.wpLanguage)&&void 0!==e?e:"en_US",{data:o,error:s,isLoading:a}=qu(`categories-${i}`,Yu,{onError:()=>r(t=>t+1),onSuccess:()=>r(0)});return{data:o,errorCount:n>1?n:s?1:0,isLoading:a}})(),{categories:a,setCategories:l}=Gu();return(0,t.useEffect)(()=>{o||s||l(i)},[i,o,l,s]),(0,t.useEffect)(()=>{const t=t=>document.querySelector(`#strakture-library-category-${t}`)?.focus();if(a?.length){if(e){if("all"===e)return t("all");if(a?.find(({slug:t})=>t===e))return t(e)}n("all"),t("all")}},[e,n,a]),(0,M.jsxs)("div",{className:"strakture-type-control",children:[(0,M.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Category","strakture")}),(0,M.jsx)(ec,{categories:a,errorCount:s,current:e,setCurrent:n})]})},ec=({categories:t,errorCount:e,current:n,setCurrent:i})=>{const o=t=>Pl()("text-sm w-full text-left rtl:text-right px-3 py-2 block rounded-md transition-colors",{"bg-design-light text-design-main font-medium":n===t,"bg-transparent text-gray-700 hover:bg-design-light hover:text-design-main":n!==t});return t?.length?(0,M.jsxs)("nav",{className:"w-full flex flex-col gap-0.5",children:[(0,M.jsx)("button",{type:"button",id:"strakture-library-category-all",onClick:()=>i("all"),className:o("all"),children:(0,r.__)("All","strakture")}),t.map(({slug:t,id:e,name:n})=>(0,M.jsx)("button",{type:"button",id:`strakture-library-category-${t}`,onClick:()=>i(t),className:o(t),children:n},e))]}):e>1?(0,M.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-2 py-4",children:[(0,M.jsx)("span",{className:"text-sm text-gray-600",children:(0,r.__)("Retrying...","strakture")}),(0,M.jsx)(dl.Spinner,{})]}):(0,M.jsxs)("div",{className:"flex w-full justify-center py-4",children:[(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Fetching...","strakture")}),(0,M.jsx)(dl.Spinner,{})]})},nc=x(S((t,e)=>{var n,r,i,o;return{remaining:Math.max(0,null!==(n=window.straktureSharedData?.credits?.remaining)&&void 0!==n?n:3),limit:null!==(r=window.straktureSharedData?.credits?.limit)&&void 0!==r?r:3,plan:null!==(i=window.straktureSharedData?.credits?.plan)&&void 0!==i?i:"free",resetDate:null!==(o=window.straktureSharedData?.credits?.resetDate)&&void 0!==o?o:null,isLoading:!1,updateCredits:n=>{var r,i,o,s,a;return t({remaining:Math.max(0,null!==(r=n.remaining)&&void 0!==r?r:e().remaining),limit:null!==(i=n.limit)&&void 0!==i?i:e().limit,plan:null!==(o=n.plan)&&void 0!==o?o:e().plan,resetDate:null!==(s=null!==(a=n.reset_date)&&void 0!==a?a:n.resetDate)&&void 0!==s?s:e().resetDate})},decrementCredit:()=>t(t=>({remaining:Math.max(0,t.remaining-1)})),decrementCredits:e=>t(t=>({remaining:Math.max(0,t.remaining-e)})),hasCredits:()=>e().remaining>0,getFormattedResetDate:()=>{const t=e().resetDate;if(!t)return null;try{return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return null}},setLoading:e=>t({isLoading:e})}},{name:"Strakture Credits"})),rc=async(t,e)=>await a()({path:"/strakture/v1/library/settings/single",method:"POST",data:{key:t,value:e}}),ic=()=>{const{siteType:e,setSiteType:n}=Qu(),{hasCredits:i}=nc(),[o,s]=(0,t.useState)(e||""),[a,l]=(0,t.useState)(!1),u=(0,t.useRef)(null);return(0,t.useEffect)(()=>{u.current||s(e||"")},[e]),(0,t.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),i()?(0,M.jsxs)("div",{"data-tour-target":"site-type",className:"px-4",children:[(0,M.jsx)("label",{htmlFor:"strakture-site-type-input",className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Site Type","strakture")}),(0,M.jsx)("input",{id:"strakture-site-type-input",type:"text",value:o,onChange:t=>{const e=t.target.value;s(e),u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{l(!0);try{await rc("siteType",e),n(e)}catch(t){console.error("Failed to save site type:",t)}finally{l(!1)}},500)},placeholder:(0,r.__)("e.g., Photography Portfolio, Restaurant","strakture"),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-700 placeholder-gray-400 focus:border-design-main focus:outline-none focus:ring-1 focus:ring-design-main"}),(0,M.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:a?(0,r.__)("Saving...","strakture"):(0,r.__)("Describe your site. Example: Restaurant, Photography Portfolio, etc.","strakture")})]}):null},oc=(0,M.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_101_491)",children:[(0,M.jsx)("path",{d:"M29.1262 0.0850517C29.4302 0.091618 29.5619 0.0992173 29.8084 0.291912C29.9788 0.524764 29.9874 0.649825 29.9725 0.931454C29.892 1.33877 29.6895 1.69948 29.5014 2.0654C28.9002 3.26768 28.3322 4.48618 27.7266 5.68631C27.6009 5.86381 27.4911 5.9299 27.2967 6.02649C27.099 6.0503 27.099 6.0503 26.8745 6.04885C21.3294 6.04533 15.7829 6.07902 10.2378 6.04812C9.3778 6.0438 8.69023 6.1758 8.01254 6.74591C6.66749 7.75395 6.6597 9.97523 7.69755 11.1949C8.29168 11.7569 8.97674 11.9939 9.77978 11.9963C13.165 12.0131 16.5505 12.0321 19.9357 12.033C25.4031 12.0356 29.9817 16.4427 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697798 29.9585C0.429173 29.9195 0.197807 29.9338 0.0659368 29.6026C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.83579 24.0689 3.19855 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31377 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C21.8725 18.0734 21.1851 18.0053 20.4733 18.0046C17.5342 17.9957 14.5951 17.9822 11.6559 17.9853C8.64305 17.9879 6.0684 17.5197 3.8283 15.327C-1.40558 10.0469 2.48562 0.307219 9.8165 0.0988723C16.2556 -0.0456274 22.688 0.113503 29.1262 0.0850517Z",fill:"#7851D4"}),(0,M.jsx)("path",{d:"M21.7253 18.1126C21.7105 18.0808 21.7322 18.0132 21.7322 18.0132L24.1366 12.9919C24.1366 12.9919 24.1437 12.9811 24.1494 12.9788C24.1551 12.9765 24.1664 12.9746 24.1751 12.9788C27.5361 14.5693 29.8055 18.0115 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697799 29.9585C0.429174 29.9195 0.197807 29.9338 0.0659368 29.6027C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.8358 24.0689 3.19856 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31378 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C22.2574 18.3336 22.0284 18.2306 21.7912 18.1592C21.7535 18.1478 21.7401 18.1443 21.7253 18.1126Z",fill:"url(#paint0_linear_101_491)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_101_491",x1:"-1.02465",y1:"29.9585",x2:"28.8244",y2:"17.6585",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_101_491",children:(0,M.jsx)("rect",{width:"30",height:"30",fill:"white"})})]})]}),sc=()=>(0,M.jsxs)("div",{className:"hidden flex-shrink-0 flex-col gap-6 md:flex md:w-80",children:[(0,M.jsx)("div",{className:"-mb-5 hidden px-5 py-3 text-strakture-black sm:flex sm:pt-5",children:(0,M.jsx)(o,{icon:oc,size:30})}),(0,M.jsxs)("div",{className:"flex flex-col gap-6 overflow-y-auto pb-16",children:[(0,M.jsx)(ic,{}),(0,M.jsx)("div",{id:"strakture-library-category-control","data-test":"category-control",className:"hidden flex-col overflow-x-hidden px-4 md:flex",children:(0,M.jsx)(tc,{})})]})]}),ac=({onClose:t})=>(0,M.jsx)("button",{className:"block h-6 w-6 bg-transparent p-px text-inherit outline-none focus:shadow-none focus:ring-wp focus:ring-design-main",type:"button",onClick:t,"data-test":"modal-close-button","aria-label":(0,r.__)("Close","strakture"),children:(0,M.jsx)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})})}),lc=({onClose:t,onBatchInsert:e})=>{const{getSelectedCount:n,canSelectMore:i}=Dl(),o=n(),s=!i(),a=window.straktureSharedData?.upgradeUrl;return(0,M.jsxs)("div",{"data-tour-target":"topbar",className:"mb-2 flex h-16 flex-shrink-0 items-center justify-between px-8",children:[(0,M.jsxs)("div",{className:"mt-4 flex items-center gap-4",children:[a&&(0,M.jsx)("a",{href:a,className:"text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline",children:(0,r.__)("Upgrade to Pro","strakture")}),o>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{type:"button",onClick:e,className:Pl()("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-all duration-150","bg-design-main text-white hover:opacity-90"),children:(0,M.jsx)("span",{children:(0,r.sprintf)((0,r.__)("Insert %d Pattern%s","strakture"),o,o>1?"s":"")})}),s&&(0,M.jsx)("span",{className:"text-xs text-gray-500",children:(0,r.__)("Maximum 10 patterns","strakture")})]})]}),(0,M.jsx)("div",{className:"mt-4",children:(0,M.jsx)(ac,{onClose:t})})]})},uc=async t=>{const{insertBlocks:n,replaceBlock:r}=(0,e.dispatch)("core/block-editor"),{getSelectedBlock:i,getBlockHierarchyRootClientId:o,getBlockIndex:s,getGlobalBlockCount:l,getBlockParents:u,getBlock:c,getBlocks:d}=(0,e.select)("core/block-editor"),h=(0,e.select)("core/preferences").get("core","renderingModes")||{},p=(0,e.select)("core").getCurrentTheme()?.stylesheet,m="template-locked"===h?.[p]?.page,{set:f}=(0,e.dispatch)("core/preferences"),g=t=>f("core","renderingModes",{...h,[p]:{...h[p]||{},page:t}});let{clientId:y,name:v,attributes:x}=i()||{};if(y&&m){const t=u(y).map(t=>c(t)).filter(Boolean),e=t.findIndex(t=>"core/post-content"===t?.name),n=s(-1!==e&&t[e+1]?.clientId||y);g("post-only"),await new Promise(t=>requestAnimationFrame(t));const r=d()[n];({clientId:y,name:v,attributes:x}=r||{})}const w=y?o(y):"",b=(w?s(w):l())+1,{missingCSSVars:S}=V.getState();S.forEach(t=>{document?.documentElement?.style?.setProperty(t,Tl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,Tl[t])}),S.length&&(async t=>{var e;const n=window.straktureSharedData?.globalStylesPostID,{styles:r,settings:i}=await a()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter(t=>!r?.css?.includes(`${t}:`))).length)return;const o=t.reduce((t,e)=>t+`${e}: ${Tl[e]};\n`,":root {\n")+"\n}";a()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:i,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+o}}})})(S);try{return m&&!y&&(g("post-only"),await new Promise(t=>requestAnimationFrame(t))),"core/paragraph"===v&&""===x?.content?.text?await r(y,t):await n(t,b)}finally{m&&g("template-locked")}},cc=[{id:"site-type",selector:'[data-tour-target="site-type"]',title:(0,r.__)("Enter your site type","strakture"),description:(0,r.__)("Tell us what kind of site you have — Restaurant, Medical, Photography, etc. This helps generate patterns that match your content.","strakture"),position:"right",offsetY:0,requiresCredits:!0,paidOnly:!1},{id:"pattern-grid",selector:"#strakture-library-patterns-list",title:(0,r.__)("Pick patterns to generate","strakture"),description:(0,r.__)("Browse the patterns and check the box on each one you want to add to your site.","strakture"),position:"left",requiresCredits:!1,paidOnly:!1},{id:"customize",selector:'[data-tour-target="customize-button"]',title:(0,r.__)("Add customization if needed","strakture"),description:(0,r.__)("Click Customize on any pattern to add specific instructions like layout changes, text, or call-to-action details.","strakture"),position:"top",requiresCredits:!0,paidOnly:!1},{id:"generate",selector:'[data-tour-target="topbar"]',title:(0,r.__)("Generate your patterns","strakture"),description:(0,r.__)("After selecting patterns, click the Generate button that appears here to create AI-customized versions for your site.","strakture"),position:"bottom",requiresCredits:!1,paidOnly:!1}],dc=288,hc=12,pc=(t,e,n=0)=>{if(!t)return{opacity:0};const r={position:"fixed",width:dc,zIndex:10001};switch(e){case"right":r.top=t.top+t.height/2+n,r.left=t.right+hc,r.transform="translateY(-50%)",r.left+dc>window.innerWidth-16&&(r.left=t.left-dc-hc);break;case"left":r.top=t.top+t.height/2+n,r.left=t.left-dc-hc,r.transform="translateY(-50%)",r.left<16&&(r.left=t.right+hc);break;case"bottom":r.top=t.bottom+hc+n,r.left=t.left+t.width/2-144;break;case"top":r.top=t.top-hc+n,r.left=t.left+t.width/2-144,r.transform="translateY(-100%)";break;default:r.top=t.bottom+hc+n,r.left=t.left}return r.left<16&&(r.left=16),r.left+dc>window.innerWidth-16&&(r.left=window.innerWidth-dc-16),r},mc=()=>{const{isActive:e,isWaiting:n,currentStep:i,currentStepIndex:o,totalSteps:s,targetRect:a,next:l,skip:u}=(()=>{var e;const{plan:n,hasCredits:r}=nc(),[i,o]=(0,t.useState)(!1),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(null),p=(0,t.useRef)(null),m=cc.filter(t=>!(t.paidOnly&&"free"===n||t.requiresCredits&&!r())),f=null!==(e=m[s])&&void 0!==e?e:null;(0,t.useEffect)(()=>{const t=window.straktureLibraryData?.onboardingCompleted;if(!t){const t=setTimeout(()=>o(!0),350);return()=>clearTimeout(t)}},[]),(0,t.useCallback)(()=>{if(!f)return;const t=document.querySelector(f.selector);t&&(u(t.getBoundingClientRect()),p.current=t)},[f]),(0,t.useEffect)(()=>{if(!i||!f)return;let t=!1;(async()=>{d(!0);const e=await((t,e=1e4)=>new Promise(n=>{const r=document.querySelector(t);if(r)return n(r);const i=new MutationObserver(()=>{const e=document.querySelector(t);e&&(i.disconnect(),n(e))});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),n(null)},e)}))(f.selector);if(t)return;if(!e)return d(!1),void(s<m.length-1?a(t=>t+1):g());if(await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))),t)return;u(e.getBoundingClientRect()),p.current=e,d(!1),h.current&&h.current.disconnect();const n=new ResizeObserver(()=>{t||u(e.getBoundingClientRect())});n.observe(e),h.current=n})();const e=()=>{p.current&&u(p.current.getBoundingClientRect())};window.addEventListener("resize",e);const n=document.getElementById("strakture-library-patterns-list");return n?.addEventListener("scroll",e),()=>{t=!0,window.removeEventListener("resize",e),n?.removeEventListener("scroll",e),h.current&&h.current.disconnect()}},[i,s,f?.selector]);const g=(0,t.useCallback)(()=>{o(!1),p.current=null,h.current&&h.current.disconnect(),rc("onboardingCompleted",!0).catch(console.warn)},[]),y=(0,t.useCallback)(()=>{s>=m.length-1?g():a(t=>t+1)},[s,m.length,g]),v=(0,t.useCallback)(()=>{g()},[g]);return{isActive:i,isWaiting:c,currentStep:f,currentStepIndex:s,totalSteps:m.length,targetRect:l,next:y,skip:v}})(),c=(0,t.useRef)(null);if((0,t.useEffect)(()=>{e&&!n&&c.current&&c.current.focus()},[e,n,o]),(0,t.useEffect)(()=>{if(!e)return;const t=t=>{"Escape"===t.key&&(t.stopPropagation(),u())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,u]),!e||!i)return null;const d=o===s-1,h=a&&!n;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:n?"none":"auto"},onClick:t=>{t.stopPropagation(),t.preventDefault()},"aria-hidden":"true"}),h&&(0,M.jsx)("div",{style:{position:"fixed",top:a.top-8,left:a.left-8,width:a.width+16,height:a.height+16,borderRadius:8,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)",zIndex:1e4,pointerEvents:"none"}}),h&&(0,M.jsxs)("div",{role:"dialog","aria-label":i.title,className:"rounded-lg bg-white p-5 shadow-xl",style:pc(a,i.position,i.offsetY),children:[(0,M.jsx)("h3",{className:"mb-1 text-sm font-semibold text-gray-900",children:i.title}),(0,M.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-gray-600",children:i.description}),(0,M.jsxs)("div",{className:"flex items-center justify-between",children:[(0,M.jsxs)("span",{className:"text-xs text-gray-400",children:[o+1," / ",s]}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("button",{type:"button",onClick:u,className:"rounded px-3 py-1.5 text-xs text-gray-500 hover:text-gray-700",children:(0,r.__)("Skip","strakture")}),(0,M.jsx)("button",{ref:c,type:"button",onClick:l,className:"rounded bg-design-main px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:d?(0,r.__)("Done","strakture"):(0,r.__)("Next","strakture")})]})]})]})]})},fc=()=>{const{incrementActivity:n}=O(),{open:i,setOpen:o}=V(),{category:s,siteType:a,incrementImports:l}=Qu(),{getSelectedPatterns:u,clearSelection:c}=Dl(),{createNotice:d}=(0,e.dispatch)("core/notices"),h=(0,t.useRef)(!1),p=()=>{c(),o(!1)};return(0,t.useLayoutEffect)(()=>{i||h.current||(h.current=!0,new URLSearchParams(window.location.search).has("strakture-open")&&(o(!0),n("library-search-param-auto-open")))},[o,n,i]),(0,t.useEffect)(()=>{const t=new URLSearchParams(window.location.search);t.has("strakture-close")&&(o(!1),t.delete("strakture-close"),window.history.replaceState({},"",window.location.pathname+"?"+t.toString()))},[o,n]),(0,t.useEffect)(()=>{const t=()=>o(!0),e=()=>o(!1);return window.addEventListener("strakture::open-library",t),window.addEventListener("strakture::close-library",e),()=>{window.removeEventListener("strakture::open-library",t),window.removeEventListener("strakture::close-library",e)}},[o,i]),(0,t.useEffect)(()=>{if(!i)return;const t=(0,e.select)("core/edit-post");t&&t.isFeatureActive("welcomeGuide")&&(0,e.dispatch)("core/edit-post").toggleFeature("welcomeGuide")},[i]),i?(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(Oe,{className:"strakture-library strakture-library-modal",open:i,static:!0,onClose:()=>{},children:(0,M.jsxs)("div",{className:"absolute mx-auto h-full w-full md:p-8",children:[(0,M.jsx)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,M.jsxs)(cl.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"relative mx-auto h-full w-full max-w-screen-3xl bg-white rounded-lg shadow-2xl sm:flex sm:overflow-hidden",children:[(0,M.jsx)(Oe.Title,{className:"sr-only",children:(0,r.__)("Design Patterns","strakture")}),(0,M.jsx)(sc,{}),(0,M.jsxs)("div",{className:"relative flex w-full flex-col bg-[#FAFAFA]",children:[(0,M.jsx)(lc,{onClose:p,onBatchInsert:async()=>{const t=u(),e=t.length;if(0===e)return;const n=[];for(const e of t)e.blocks?.length>0&&n.push(...e.blocks);n.length>0&&(await uc(n),l()),c(),o(!1);const i=window.straktureSharedData?.upgradeUrl;d("info",(0,r.sprintf)((0,r.__)("%d patterns added. Upgrade to Pro to generate AI patterns.","strakture"),e),{isDismissible:!0,type:"snackbar",actions:i?[{label:(0,r.__)("Upgrade","strakture"),url:i}]:[]})}}),(0,M.jsx)("div",{id:"strakture-library-patterns-list",className:"relative flex-grow overflow-y-auto",children:(0,M.jsx)(zu,{onPatternClick:async(t,e)=>{await uc(e),l(),p();const n=window.straktureSharedData?.upgradeUrl;d("info",(0,r.__)("Pattern added. Upgrade to Pro to generate AI patterns.","strakture"),{isDismissible:!0,type:"snackbar",actions:n?[{label:(0,r.__)("Upgrade","strakture"),url:n}]:[]})},category:s,siteType:a,disabled:!1})})]})]},"library-modal"),(0,M.jsx)(mc,{})]})})}):null};(0,e.subscribe)(()=>{(()=>{if("function"!=typeof t.createRoot)return;const e="strakture-library-btn",r="strakture-library";if(document.getElementById(e))return;const i=document.querySelector(".edit-post-header-toolbar");if(!i)return;const o=document.createElement("div"),s=Object.assign(o,{id:e,className:r});i.append(s),n((0,M.jsx)(L,{}),s);const a="strakture-library-modal";if(!document.getElementById(a)){const t=document.createElement("div"),e=Object.assign(t,{id:a,className:r});document.body.append(e),n((0,M.jsx)(fc,{}),e)}})()})})()})();1 (()=>{var t,e,n={162(t,e,n){"use strict";var r=n(609),i=n(888),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u(function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==i&&h.hasValue){var e=h.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(s=t,e):(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,n,r,i]);var p=s(t,d[0],d[1]);return l(function(){h.hasValue=!0,h.value=p},[p]),c(p),p}},242(t,e,n){"use strict";t.exports=n(162)},493(t,e,n){"use strict";var r=n(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=e,u(i)&&c({inst:i})},[t,n,e]),s(function(){return u(i)&&c({inst:i}),t(function(){u(i)&&c({inst:i})})},[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},609(t){"use strict";t.exports=window.React},888(t,e,n){"use strict";t.exports=n(493)},942(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(i.default=i,t.exports=i):void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}()}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>n[t]);return s.default=()=>n,i.d(o,s),o},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=window.wp.element,e=window.wp.data,n=(e,n)=>{"function"==typeof t.createRoot?(0,t.createRoot)(n).render(e):(0,t.render)(e,n)},r=window.wp.i18n;var o=(0,t.forwardRef)(({icon:e,size:n=24,...r},i)=>(0,t.cloneElement)(e,{width:n,height:n,...r,ref:i}));const s=window.wp.apiFetch;var a=i.n(s);const l=(t,e={})=>{if("string"!=typeof t)return null!=t?t:e;try{var n;return null!==(n=JSON.parse(t))&&void 0!==n?n:e}catch(t){return e}},u=t=>{let e;const n=new Set,r=(t,r)=>{const i="function"==typeof t?t(e):t;if(!Object.is(i,e)){const t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{"production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=e=t(r,i,o);return o};var c=i(609),d=i.t(c,2),h=i.n(c),p=i(242);const{useDebugValue:m}=c,{useSyncExternalStoreWithSelector:f}=p;let g=!1;const y=t=>t,v=t=>{"production"!=={NODE_ENV:"production"}.MODE&&"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?u(t):u)(t):t,n=(t,n)=>function(t,e=y,n){"production"!=={NODE_ENV:"production"}.MODE&&n&&!g&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),g=!0);const r=f(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return m(r),r}(e,t,n);return Object.assign(n,e),n},x=t=>t?v(t):v,w=new Map,b=t=>{const e=w.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([t,e])=>[t,e.getState()])):{}},S=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null!=o?o:"production"!=={NODE_ENV:"production"}.MODE)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return"production"!=={NODE_ENV:"production"}.MODE&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=w.get(n.name);if(r)return{type:"tracked",store:t,...r};const i={connection:e.connect(n),stores:{}};return w.set(n.name,i),{type:"tracked",store:t,...i}})(a,u,l);let h=!0;i.setState=(t,e,o)=>{const u=n(t,e);if(!h)return u;const d=void 0===o?{type:s||"anonymous"}:"string"==typeof o?{type:o}:o;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...b(l.name),[a]:i.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},m=t(i.setState,r,i);if("untracked"===d.type?null==c||c.init(m):(d.stores[d.store]=i,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([t,e])=>[t,t===d.store?m:e.getState()])))),i.dispatchFromDevtools&&"function"==typeof i.dispatch){let t=!1;const e=i.dispatch;i.dispatch=(...n)=>{"production"==={NODE_ENV:"production"}.MODE||"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe(t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):C(t.payload,t=>{if("__setState"===t.type){if(void 0===a)return void p(t.state);1!==Object.keys(t.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const e=t.state[a];if(null==e)return;return void(JSON.stringify(i.getState())!==JSON.stringify(e)&&p(e))}i.dispatchFromDevtools&&"function"==typeof i.dispatch&&i.dispatch(t)});case"DISPATCH":switch(t.payload.type){case"RESET":return p(m),void 0===a?null==c?void 0:c.init(i.getState()):null==c?void 0:c.init(b(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(i.getState())):null==c?void 0:c.init(b(l.name));case"ROLLBACK":return C(t.state,t=>{if(void 0===a)return p(t),void(null==c||c.init(i.getState()));p(t[a]),null==c||c.init(b(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return C(t.state,t=>{void 0!==a?JSON.stringify(i.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)});case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}}),m},C=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function E(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const i=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),o=null!=(r=n.getItem(t))?r:null;return o instanceof Promise?o.then(i):i(o)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const P=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then:t=>P(t)(n),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>P(e)(t)}}},k=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?("production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch(t){}if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=P(o.serialize),d=()=>{const t=o.partialize({...r()});let e;const n=c({state:t,version:o.version}).then(t=>u.setItem(o.name,t)).catch(t=>{e=t});if(e)throw e;return n},h=i.setState;i.setState=(t,e)=>{h(t,e),d()};const p=t((...t)=>{n(...t),d()},r,i);let m;const f=()=>{var t;if(!u)return;s=!1,a.forEach(t=>t(r()));const e=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,r()))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t)return o.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return t.state;if(o.migrate)return o.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return m=o.merge(t,null!=(e=r())?e:p),n(m,!0),d()}).then(()=>{null==e||e(m,void 0),s=!0,l.forEach(t=>t(m))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},f(),m||p})(t,e)):((t,e)=>(n,r,i)=>{let o={storage:E(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=()=>{const t=o.partialize({...r()});return u.setItem(o.name,{state:t,version:o.version})},d=i.setState;i.setState=(t,e)=>{d(t,e),c()};const h=t((...t)=>{n(...t),c()},r,i);let p;i.getInitialState=()=>h;const m=()=>{var t,e;if(!u)return;s=!1,a.forEach(t=>{var e;return t(null!=(e=r())?e:h)});const i=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,null!=(t=r())?t:h))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return[!1,t.state];if(o.migrate)return[!0,o.migrate(t.state,t.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var e;const[i,s]=t;if(p=o.merge(s,null!=(e=r())?e:h),n(p,!0),i)return c()}).then(()=>{null==i||i(p,void 0),p=r(),s=!0,l.forEach(t=>t(p))}).catch(t=>{null==i||i(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},o.skipHydration||m(),p||h})(t,e),T="/strakture/v1/shared/activity",A={getItem:()=>a()({path:T}),setItem:(t,e)=>a()({path:T,method:"POST",data:{state:e}})},j=l(window.straktureSharedData?.activity),D={actions:{}},O=x(k(S((t,e)=>{var n;return{...D,...null!==(n=j?.state)&&void 0!==n?n:{},incrementActivity:n=>{t(t=>({...t,actions:{...t.actions,[n]:Number(e().actions[n]||0)+1}}))}}},{name:"Strakture Activity"}),{name:"strakture_shared_activity",storage:E(()=>A),skipHydration:!0})),M=window.ReactJSXRuntime,R=(0,M.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_98_488)",children:[(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"white"}),(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"url(#paint0_linear_98_488)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_98_488",x1:"-1.2544",y1:"35.9502",x2:"39.167",y2:"26.3118",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_98_488",children:(0,M.jsx)("rect",{width:"36",height:"36",fill:"white"})})]})]}),V=x(S(t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t(t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]})}),{name:"Strakture Library Globals"})),L=()=>{const{setOpen:t}=V(),{incrementActivity:e}=O();return(0,M.jsxs)("div",{role:"button",onClick:()=>{t(!0),e("library-button-click")},className:"components-button has-icon bg-design-main hover:opacity-90 hover:text-white text-white h-9 sm:ml-2 xl:pr-4",children:[(0,M.jsx)(o,{icon:R,size:16}),(0,M.jsx)("span",{className:"ml-1 hidden xl:inline",children:(0,r.__)("Strakture Patterns","strakture")})]})};function F(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t}))}function N(){let t=[],e={addEventListener:(t,n,r,i)=>(t.addEventListener(n,r,i),e.add(()=>t.removeEventListener(n,r,i))),requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame:(...t)=>e.requestAnimationFrame(()=>e.requestAnimationFrame(...t)),setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return F(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add(()=>{Object.assign(t.style,{[e]:r})})},group(t){let e=N();return t(e),this.add(()=>e.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}var I=Object.defineProperty,_=(t,e,n)=>(((t,e,n)=>{e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let B=new class{constructor(){_(this,"current",this.detect()),_(this,"handoffState","pending"),_(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},U=(t,e)=>{B.isServer?(0,c.useEffect)(t,e):(0,c.useLayoutEffect)(t,e)};function $(t){let e=(0,c.useRef)(t);return U(()=>{e.current=t},[t]),e}let H=function(t){let e=$(t);return c.useCallback((...t)=>e.current(...t),[e])};function W(t,e,n,r){let i=$(n);(0,c.useEffect)(()=>{function n(t){i.current(t)}return(t=null!=t?t:window).addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,r])}function z(){let t=(0,c.useRef)(!1);return U(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function q(t){let e=H(t),n=(0,c.useRef)(!1);(0,c.useEffect)(()=>(n.current=!1,()=>{n.current=!0,F(()=>{n.current&&e()})}),[e])}function Y(t){return B.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function G(...t){return(0,c.useMemo)(()=>Y(...t),[...t])}function X(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in d&&d.useSyncExternalStore(()=>()=>{},()=>!1,()=>!t)}(),[e,n]=c.useState(B.isHandoffComplete);return e&&!1===B.isHandoffComplete&&n(!1),c.useEffect(()=>{!0!==e&&n(!0)},[e]),c.useEffect(()=>B.handoff(),[]),!t&&e}let Z=Symbol();function J(...t){let e=(0,c.useRef)(t);(0,c.useEffect)(()=>{e.current=t},[t]);let n=H(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)});return t.every(t=>null==t||(null==t?void 0:t[Z]))?void 0:n}function K(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)},[t,n])}var Q=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Q||{});function tt(t,e){let n=(0,c.useRef)([]),r=H(t);(0,c.useEffect)(()=>{let t=[...n.current];for(let[i,o]of e.entries())if(n.current[i]!==o){let i=r(e,t);return n.current=e,i}},[r,...e])}function et(...t){return Array.from(new Set(t.flatMap(t=>"string"==typeof t?t.split(" "):[]))).filter(Boolean).join(" ")}function nt(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(t=>`"${t}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,nt),r}var rt=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(rt||{}),it=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(it||{});function ot({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=null!=a?a:at;let l=lt(e,t);if(o)return st(l,n,r,s,a);let u=null!=i?i:0;if(2&u){let{static:t=!1,...e}=l;if(t)return st(e,n,r,s,a)}if(1&u){let{unmount:t=!0,...e}=l;return nt(t?0:1,{0:()=>null,1:()=>st({...e,hidden:!0,style:{display:"none"}},n,r,s,a)})}return st(l,n,r,s,a)}function st(t,e={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=dt(t,["unmount","static"]),u=void 0!==t.ref?{[a]:t.ref}:{},d="function"==typeof s?s(e):s;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(e));let h={};if(e){let t=!1,n=[];for(let[r,i]of Object.entries(e))"boolean"==typeof i&&(t=!0),!0===i&&n.push(r);t&&(h["data-headlessui-state"]=n.join(" "))}if(o===c.Fragment&&Object.keys(ct(l)).length>0){if(!(0,c.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(t=>` - ${t}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(t=>` - ${t}`).join("\n")].join("\n"));let t=d.props,e="function"==typeof(null==t?void 0:t.className)?(...e)=>et(null==t?void 0:t.className(...e),l.className):et(null==t?void 0:t.className,l.className),n=e?{className:e}:{};return(0,c.cloneElement)(d,Object.assign({},lt(d.props,ct(dt(l,["ref"]))),h,u,{ref:i(d.ref,u.ref)},n))}return(0,c.createElement)(o,Object.assign({},dt(l,["ref"]),o!==c.Fragment&&u,o!==c.Fragment&&h),d)}function at(...t){return t.every(t=>null==t)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function lt(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(t=>[t,void 0])));for(let t in n)Object.assign(e,{[t](e,...r){let i=n[t];for(let t of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function ut(t){var e;return Object.assign((0,c.forwardRef)(t),{displayName:null!=(e=t.displayName)?e:t.name})}function ct(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function dt(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var ht=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(ht||{});let pt=ut(function(t,e){var n;let{features:r=1,...i}=t;return ot({ourProps:{ref:e,"aria-hidden":!(2&~r)||(null!=(n=i["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}},theirProps:i,slot:{},defaultTag:"div",name:"Hidden"})}),mt=[];!function(){function t(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&mt[0]!==t.target&&(mt.unshift(t.target),mt=mt.filter(t=>null!=t&&t.isConnected),mt.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();let ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var gt,yt,vt=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(vt||{}),xt=((yt=xt||{})[yt.Error=0]="Error",yt[yt.Overflow=1]="Overflow",yt[yt.Success=2]="Success",yt[yt.Underflow=3]="Underflow",yt),wt=((gt=wt||{})[gt.Previous=-1]="Previous",gt[gt.Next=1]="Next",gt);var bt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(bt||{});var St=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(St||{});function Ct(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Et=["textarea","input"].join(",");function Pt(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=t=>t){return t.slice().sort((t,n)=>{let r=e(t),i=e(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(ft)).sort((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}(t);i.length>0&&s.length>1&&(s=s.filter(t=>!i.includes(t))),r=null!=r?r:o.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==o.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,Et))&&n}(a)&&a.select(),2}function kt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var Tt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(Tt||{});let At=ut(function(t,e){let n=(0,c.useRef)(null),r=J(n,e),{initialFocus:i,containers:o,features:s=30,...a}=t;X()||(s=1);let l=G(n);Dt({ownerDocument:l},Boolean(16&s));let u=function({ownerDocument:t,container:e,initialFocus:n},r){let i=(0,c.useRef)(null),o=z();return tt(()=>{if(!r)return;let s=e.current;s&&F(()=>{if(!o.current)return;let e=null==t?void 0:t.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===e)return void(i.current=e)}else if(s.contains(e))return void(i.current=e);null!=n&&n.current?Ct(n.current):Pt(s,vt.First)===xt.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==t?void 0:t.activeElement})},[r]),i}({ownerDocument:l,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},i){let o=z();W(null==t?void 0:t.defaultView,"focus",t=>{if(!i||!o.current)return;let s=kt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?Ot(s,l)?(r.current=l,Ct(l)):(t.preventDefault(),t.stopPropagation(),Ct(a)):Ct(r.current)},!0)}({ownerDocument:l,container:n,containers:o,previousActiveElement:u},Boolean(8&s));let d=function(){let t=(0,c.useRef)(0);return K("keydown",e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)},!0),t}(),h=H(t=>{let e=n.current;e&&nt(d.current,{[Q.Forwards]:()=>{Pt(e,vt.First,{skipElements:[t.relatedTarget]})},[Q.Backwards]:()=>{Pt(e,vt.Last,{skipElements:[t.relatedTarget]})}})}),p=function(){let[t]=(0,c.useState)(N);return(0,c.useEffect)(()=>()=>t.dispose(),[t]),t}(),m=(0,c.useRef)(!1),f={ref:r,onKeyDown(t){"Tab"==t.key&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(t){let e=kt(o);n.current instanceof HTMLElement&&e.add(n.current);let r=t.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(Ot(e,r)||(m.current?Pt(n.current,nt(d.current,{[Q.Forwards]:()=>vt.Next,[Q.Backwards]:()=>vt.Previous})|vt.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&Ct(t.target)))}};return c.createElement(c.Fragment,null,Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}),ot({ourProps:f,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}))}),jt=Object.assign(At,{features:Tt});function Dt({ownerDocument:t},e){let n=function(t=!0){let e=(0,c.useRef)(mt.slice());return tt(([t],[n])=>{!0===n&&!1===t&&F(()=>{e.current.splice(0)}),!1===n&&!0===t&&(e.current=mt.slice())},[t,mt,e]),H(()=>{var t;return null!=(t=e.current.find(t=>null!=t&&t.isConnected))?t:null})}(e);tt(()=>{e||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&Ct(n())},[e]),q(()=>{e&&Ct(n())})}function Ot(t,e){for(let n of t)if(n.contains(e))return!0;return!1}const Mt=window.ReactDOM;let Rt=(0,c.createContext)(!1);function Vt(){return(0,c.useContext)(Rt)}function Lt(t){return c.createElement(Rt.Provider,{value:t.force},t.children)}let Ft=c.Fragment,Nt=c.Fragment,It=(0,c.createContext)(null),_t=(0,c.createContext)(null),Bt=ut(function(t,e){let n=t,r=(0,c.useRef)(null),i=J(function(t,e=!0){return Object.assign(t,{[Z]:e})}(t=>{r.current=t}),e),o=G(r),s=function(t){let e=Vt(),n=(0,c.useContext)(It),r=G(t),[i,o]=(0,c.useState)(()=>{if(!e&&null!==n||B.isServer)return null;let t=null==r?void 0:r.getElementById("headlessui-portal-root");if(t)return t;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return(0,c.useEffect)(()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))},[i,r]),(0,c.useEffect)(()=>{e||null!==n&&o(n.current)},[n,o,e]),i}(r),[a]=(0,c.useState)(()=>{var t;return B.isServer?null:null!=(t=null==o?void 0:o.createElement("div"))?t:null}),l=(0,c.useContext)(_t),u=X();return U(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),U(()=>{if(a&&l)return l.register(a)},[l,a]),q(()=>{var t;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&(null==(t=s.parentElement)||t.removeChild(s)))}),u&&s&&a?(0,Mt.createPortal)(ot({ourProps:{ref:i},theirProps:n,defaultTag:Ft,name:"Portal"}),a):null}),Ut=ut(function(t,e){let{target:n,...r}=t,i={ref:J(e)};return c.createElement(It.Provider,{value:n},ot({ourProps:i,theirProps:r,defaultTag:Nt,name:"Popover.Group"}))}),$t=Object.assign(Bt,{Group:Ut});const Ht="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:Wt,useEffect:zt,useLayoutEffect:qt,useDebugValue:Yt}=d;function Gt(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Ht(n,t)}catch{return!0}}const Xt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:i},o]=Wt({inst:{value:r,getSnapshot:e}});return qt(()=>{i.value=r,i.getSnapshot=e,Gt(i)&&o({inst:i})},[t,r,e]),zt(()=>(Gt(i)&&o({inst:i}),t(()=>{Gt(i)&&o({inst:i})})),[t]),Yt(r),r},Zt="useSyncExternalStore"in d?(t=>t.useSyncExternalStore)(d):Xt;function Jt(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,i=r.clientWidth-r.offsetWidth,o=t-i;n.style(r,"paddingRight",`${o}px`)}}}function Kt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qt(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let te=function(t,e){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:t=>(r.add(t),()=>r.delete(t)),dispatch(t,...i){let o=e[t].call(n,...i);o&&(n=o,r.forEach(t=>t()))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:N(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:Qt(n)},i=[Kt()?{before({doc:t,d:e,meta:n}){function r(t){return n.containers.flatMap(t=>t()).some(e=>e.contains(t))}e.microTask(()=>{var n;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let n=N();n.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>n.dispose()))}let i=null!=(n=window.scrollY)?n:window.pageYOffset,o=null;e.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),s=t.querySelector(i);s&&!r(s)&&(o=s)}catch{}},!0),e.addEventListener(t,"touchstart",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let n=t.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}),e.addEventListener(t,"touchmove",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.headlessuiPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.headlessuiPortal&&t.preventDefault()}else t.preventDefault()},{passive:!1}),e.add(()=>{var t;let e=null!=(t=window.scrollY)?t:window.pageYOffset;i!==e&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},Jt(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];i.forEach(({before:t})=>null==t?void 0:t(r)),i.forEach(({after:t})=>null==t?void 0:t(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});function ee(t,e,n){let r=function(t){return Zt(t.subscribe,t.getSnapshot,t.getSnapshot)}(te),i=t?r.get(t):void 0,o=!!i&&i.count>0;return U(()=>{if(t&&e)return te.dispatch("PUSH",t,n),()=>te.dispatch("POP",t,n)},[e,t]),o}var ne;te.subscribe(()=>{let t=te.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&te.dispatch("TEARDOWN",n)}});let re=null!=(ne=c.useId)?ne:function(){let t=X(),[e,n]=c.useState(t?()=>B.nextId():null);return U(()=>{null===e&&n(B.nextId())},[e]),null!=e?""+e:void 0},ie=new Map,oe=new Map;function se(t,e=!0){U(()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let i=null!=(n=oe.get(r))?n:0;return oe.set(r,i+1),0!==i||(ie.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=oe.get(r))?t:1;if(1===e?oe.delete(r):oe.set(r,e-1),1!==e)return;let n=ie.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,ie.delete(r))}},[t,e])}function ae(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return document.addEventListener(t,e,n),()=>document.removeEventListener(t,e,n)},[t,n])}function le(t,e,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=i(n);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(t);for(let t of s){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(o)||n.composed&&n.composedPath().includes(e))return}return!function(t,e=0){var n;return t!==(null==(n=Y(t))?void 0:n.body)&&nt(e,{0:()=>t.matches(ft),1(){let e=t;for(;null!==e;){if(e.matches(ft))return!0;e=e.parentElement}return!1}})}(o,bt.Loose)&&-1!==o.tabIndex&&n.preventDefault(),e(n,o)}(0,c.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let o=(0,c.useRef)(null);ae("pointerdown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("mousedown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("click",t=>{Kt()||/Android/gi.test(window.navigator.userAgent)||o.current&&(i(t,()=>o.current),o.current=null)},!0),ae("touchend",t=>i(t,()=>t.target instanceof HTMLElement?t.target:null),!0),K("blur",t=>i(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ue=(0,c.createContext)(null);ue.displayName="OpenClosedContext";var ce=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(ce||{});let de=(0,c.createContext)(()=>{});de.displayName="StackContext";var he=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(he||{});function pe({children:t,onUpdate:e,type:n,element:r,enabled:i}){let o=(0,c.useContext)(de),s=H((...t)=>{null==e||e(...t),o(...t)});return U(()=>{let t=void 0===i||!0===i;return t&&s(0,n,r),()=>{t&&s(1,n,r)}},[s,n,r,i]),c.createElement(de.Provider,{value:s},t)}let me=(0,c.createContext)(null);function fe(){let t=(0,c.useContext)(me);if(null===t){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,fe),t}return t}let ge=ut(function(t,e){let n=re(),{id:r=`headlessui-description-${n}`,...i}=t,o=fe(),s=J(e);return U(()=>o.register(r),[r,o.register]),ot({ourProps:{ref:s,...o.props,id:r},theirProps:i,slot:o.slot||{},defaultTag:"p",name:o.name||"Description"})}),ye=Object.assign(ge,{});var ve=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(ve||{}),xe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(xe||{}),we=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(we||{});let be={0:(t,e)=>t.titleId===e.id?t:{...t,titleId:e.id}},Se=(0,c.createContext)(null);function Ce(t){let e=(0,c.useContext)(Se);if(null===e){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ce),e}return e}function Ee(t,e){return nt(e.type,be,t,e)}Se.displayName="DialogContext";let Pe=rt.RenderStrategy|rt.Static,ke=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...u}=t,[d,h]=(0,c.useState)(0),p=(0,c.useRef)(!1);a="dialog"===a||"alertdialog"===a?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=(0,c.useContext)(ue);void 0===i&&null!==m&&(i=(m&ce.Open)===ce.Open);let f=(0,c.useRef)(null),g=J(f,e),y=G(f),v=t.hasOwnProperty("open")||null!==m,x=t.hasOwnProperty("onClose");if(!v&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let w=i?0:1,[b,S]=(0,c.useReducer)(Ee,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),C=H(()=>o(!1)),E=H(t=>S({type:0,id:t})),P=!!X()&&!l&&0===w,k=d>1,T=null!==(0,c.useContext)(Se),[A,j]=function(){let t=(0,c.useContext)(_t),e=(0,c.useRef)([]),n=H(n=>(e.current.push(n),t&&t.register(n),()=>r(n))),r=H(n=>{let r=e.current.indexOf(n);-1!==r&&e.current.splice(r,1),t&&t.unregister(n)}),i=(0,c.useMemo)(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,(0,c.useMemo)(()=>function({children:t}){return c.createElement(_t.Provider,{value:i},t)},[i])]}(),D={get current(){var t;return null!=(t=b.panelRef.current)?t:f.current}},{resolveContainers:O,mainTreeNodeRef:M,MainTreeNode:R}=function({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let i=(0,c.useRef)(null!=(r=null==n?void 0:n.current)?r:null),o=G(i),s=H(()=>{var n,r,s;let a=[];for(let e of t)null!==e&&(e instanceof HTMLElement?a.push(e):"current"in e&&e.current instanceof HTMLElement&&a.push(e.current));if(null!=e&&e.current)for(let t of e.current)a.push(t);for(let t of null!=(n=null==o?void 0:o.querySelectorAll("html > *, body > *"))?n:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(i.current)||t.contains(null==(s=null==(r=i.current)?void 0:r.getRootNode())?void 0:s.host)||a.some(e=>t.contains(e))||a.push(t));return a});return{resolveContainers:s,contains:H(t=>s().some(e=>e.contains(t))),mainTreeNodeRef:i,MainTreeNode:(0,c.useMemo)(()=>function(){return null!=n?null:c.createElement(pt,{features:ht.Hidden,ref:i})},[i,n])}}({portals:A,defaultContainers:[D]}),V=k?"parent":"leaf",L=null!==m&&(m&ce.Closing)===ce.Closing,F=!T&&!L&&P,N=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("body > *"))?t:[]).find(t=>"headlessui-portal-root"!==t.id&&t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(N,F);let I=!!k||P,_=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("[data-headlessui-portal]"))?t:[]).find(t=>t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(_,I),le(O,t=>{t.preventDefault(),C()},!(!P||k));let B=!(k||0!==w);W(null==y?void 0:y.defaultView,"keydown",t=>{B&&(t.defaultPrevented||t.key===ve.Escape&&(t.preventDefault(),t.stopPropagation(),C()))}),function(t,e,n=()=>[document.body]){ee(t,e,t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}})}(y,!(L||0!==w||T),O),(0,c.useEffect)(()=>{if(0!==w||!f.current)return;let t=new ResizeObserver(t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&C()}});return t.observe(f.current),()=>t.disconnect()},[w,f,C]);let[U,$]=function(){let[t,e]=(0,c.useState)([]);return[t.length>0?t.join(" "):void 0,(0,c.useMemo)(()=>function(t){let n=H(t=>(e(e=>[...e,t]),()=>e(e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))),r=(0,c.useMemo)(()=>({register:n,slot:t.slot,name:t.name,props:t.props}),[n,t.slot,t.name,t.props]);return c.createElement(me.Provider,{value:r},t.children)},[e])]}(),z=(0,c.useMemo)(()=>[{dialogState:w,close:C,setTitleId:E},b],[w,b,C,E]),q=(0,c.useMemo)(()=>({open:0===w}),[w]),Y={ref:g,id:r,role:a,"aria-modal":0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":U};return c.createElement(pe,{type:"Dialog",enabled:0===w,element:f,onUpdate:H((t,e)=>{"Dialog"===e&&nt(t,{[he.Add]:()=>h(t=>t+1),[he.Remove]:()=>h(t=>t-1)})})},c.createElement(Lt,{force:!0},c.createElement($t,null,c.createElement(Se.Provider,{value:z},c.createElement($t.Group,{target:f},c.createElement(Lt,{force:!1},c.createElement($,{slot:q,name:"Dialog.Description"},c.createElement(jt,{initialFocus:s,containers:O,features:P?nt(V,{parent:jt.features.RestoreFocus,leaf:jt.features.All&~jt.features.FocusLock}):jt.features.None},c.createElement(j,null,ot({ourProps:Y,theirProps:u,slot:q,defaultTag:"div",features:Pe,visible:0===w,name:"Dialog"}))))))))),c.createElement(R,null))}),Te=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Backdrop"),a=J(e);(0,c.useEffect)(()=>{if(null===s.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return c.createElement(Lt,{force:!0},c.createElement($t,null,ot({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Ae=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-panel-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Panel"),a=J(e,s.panelRef),l=(0,c.useMemo)(()=>({open:0===o}),[o]),u=H(t=>{t.stopPropagation()});return ot({ourProps:{ref:a,id:r,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),je=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=t,[{dialogState:o,close:s}]=Ce("Dialog.Overlay"),a=J(e),l=H(t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),s()}});return ot({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:l},theirProps:i,slot:(0,c.useMemo)(()=>({open:0===o}),[o]),defaultTag:"div",name:"Dialog.Overlay"})}),De=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:o,setTitleId:s}]=Ce("Dialog.Title"),a=J(e);(0,c.useEffect)(()=>(s(r),()=>s(null)),[r,s]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return ot({ourProps:{ref:a,id:r},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Oe=Object.assign(ke,{Backdrop:Te,Panel:Ae,Overlay:je,Title:De,Description:ye});const Me=(0,c.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Re=(0,c.createContext)({}),Ve=(0,c.createContext)(null),Le="undefined"!=typeof document,Fe=Le?c.useLayoutEffect:c.useEffect,Ne=(0,c.createContext)({strict:!1}),Ie=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_e="data-"+Ie("framerAppearId");function Be(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ue(t){return"string"==typeof t||Array.isArray(t)}function $e(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const He=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],We=["initial",...He];function ze(t){return $e(t.animate)||We.some(e=>Ue(t[e]))}function qe(t){return Boolean(ze(t)||t.variants)}function Ye(t){return Array.isArray(t)?t.join(" "):t}const Ge={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xe={};for(const t in Ge)Xe[t]={isEnabled:e=>Ge[t].some(t=>!!e[t])};const Ze=(0,c.createContext)({}),Je=(0,c.createContext)({}),Ke=Symbol.for("motionComponentSymbol");function Qe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&function(t){for(const e in t)Xe[e]={...Xe[e],...t[e]}}(t);const o=(0,c.forwardRef)(function(o,s){let a;const l={...(0,c.useContext)(Me),...o,layoutId:tn(o)},{isStatic:u}=l,d=function(t){const{initial:e,animate:n}=function(t,e){if(ze(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ue(e)?e:void 0,animate:Ue(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,c.useContext)(Re));return(0,c.useMemo)(()=>({initial:e,animate:n}),[Ye(e),Ye(n)])}(o),h=r(o,u);if(!u&&Le){d.visualElement=function(t,e,n,r){const{visualElement:i}=(0,c.useContext)(Re),o=(0,c.useContext)(Ne),s=(0,c.useContext)(Ve),a=(0,c.useContext)(Me).reducedMotion,l=(0,c.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const u=l.current;(0,c.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,c.useRef)(Boolean(n[_e]&&!window.HandoffComplete));return Fe(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,c.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,l,e);const n=(0,c.useContext)(Je),r=(0,c.useContext)(Ne).strict;d.visualElement&&(a=d.visualElement.loadFeatures(l,r,t,n))}return c.createElement(Re.Provider,{value:d},a&&d.visualElement?c.createElement(a,{visualElement:d.visualElement,...l}):null,n(i,o,function(t,e,n){return(0,c.useCallback)(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Be(n)&&(n.current=r))},[e])}(h,d.visualElement,s),h,u,d.visualElement))});return o[Ke]=i,o}function tn({layoutId:t}){const e=(0,c.useContext)(Ze).id;return e&&void 0!==t?e+"-"+t:t}function en(t){function e(e,n={}){return Qe(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const nn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rn(t){return"string"==typeof t&&!t.includes("-")&&!!(nn.indexOf(t)>-1||/[A-Z]/.test(t))}const on={},sn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],an=new Set(sn);function ln(t,{layout:e,layoutId:n}){return an.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!on[t]||"opacity"===t)}const un=t=>Boolean(t&&t.getVelocity),cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dn=sn.length,hn=t=>e=>"string"==typeof e&&e.startsWith(t),pn=hn("--"),mn=hn("var(--"),fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,gn=(t,e,n)=>Math.min(Math.max(n,t),e),yn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vn={...yn,transform:t=>gn(0,1,t)},xn={...yn,default:1},wn=t=>Math.round(1e5*t)/1e5,bn=/(-)?([\d]*\.?[\d])+/g,Sn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Cn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function En(t){return"string"==typeof t}const Pn=t=>({test:e=>En(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),kn=Pn("deg"),Tn=Pn("%"),An=Pn("px"),jn=Pn("vh"),Dn=Pn("vw"),On={...Tn,parse:t=>Tn.parse(t)/100,transform:t=>Tn.transform(100*t)},Mn={...yn,transform:Math.round},Rn={borderWidth:An,borderTopWidth:An,borderRightWidth:An,borderBottomWidth:An,borderLeftWidth:An,borderRadius:An,radius:An,borderTopLeftRadius:An,borderTopRightRadius:An,borderBottomRightRadius:An,borderBottomLeftRadius:An,width:An,maxWidth:An,height:An,maxHeight:An,size:An,top:An,right:An,bottom:An,left:An,padding:An,paddingTop:An,paddingRight:An,paddingBottom:An,paddingLeft:An,margin:An,marginTop:An,marginRight:An,marginBottom:An,marginLeft:An,rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:xn,scaleX:xn,scaleY:xn,scaleZ:xn,skew:kn,skewX:kn,skewY:kn,distance:An,translateX:An,translateY:An,translateZ:An,x:An,y:An,z:An,perspective:An,transformPerspective:An,opacity:vn,originX:On,originY:On,originZ:An,zIndex:Mn,fillOpacity:vn,strokeOpacity:vn,numOctaves:Mn};function Vn(t,e,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(pn(t)){o[t]=n;continue}const r=Rn[t],d=fn(n,r);if(an.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):i[t]=d}if(e.transform||(l||r?i.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,i){let o="";for(let e=0;e<dn;e++){const n=sn[e];void 0!==t[n]&&(o+=`${cn[n]||n}(${t[n]}) `)}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,r?"":o):n&&r&&(o="none"),o}(t.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;i.transformOrigin=`${t} ${e} ${n}`}}function Ln(t,e,n){for(const r in e)un(e[r])||ln(r,n)||(t[r]=e[r])}function Fn(t,e,n){const r={},i=function(t,e,n){const r={};return Ln(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,c.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Vn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=i,r}const Nn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function In(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Nn.has(t)}let Bn=t=>!In(t);try{(Un=require("@emotion/is-prop-valid").default)&&(Bn=t=>t.startsWith("on")?!In(t):Un(t))}catch(t){}var Un;function $n(t,e,n){return"string"==typeof t?t:An.transform(e+n*t)}const Hn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wn={offset:"strokeDashoffset",array:"strokeDasharray"};function zn(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(Vn(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:f}=t;p.transform&&(f&&(m.transform=p.transform),delete p.transform),f&&(void 0!==i||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${$n(e,t.x,t.width)} ${$n(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,i=!0){t.pathLength=1;const o=i?Hn:Wn;t[o.offset]=An.transform(-r);const s=An.transform(e),a=An.transform(n);t[o.array]=`${s} ${a}`}(p,s,a,l,!1)}const qn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yn(t,e,n,r){const i=(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zn(n,e,{enableHardwareAcceleration:!1},qn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ln(e,t.style,t),i.style={...e,...i.style}}return i}function Gn(t=!1){return(e,n,r,{latestValues:i},o)=>{const s=(rn(e)?Yn:Fn)(n,i,o,e),a=function(t,e,n){const r={};for(const i in t)"values"===i&&"object"==typeof t.values||(Bn(i)||!0===n&&In(i)||!e&&!In(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}(n,"string"==typeof e,t),l={...a,...s,ref:r},{children:u}=n,d=(0,c.useMemo)(()=>un(u)?u.get():u,[u]);return(0,c.createElement)(e,{...l,children:d})}}function Xn(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Zn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Jn(t,e,n,r){Xn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Zn.has(n)?n:Ie(n),e.attrs[n])}function Kn(t,e){const{style:n}=t,r={};for(const i in n)(un(n[i])||e.style&&un(e.style[i])||ln(i,t))&&(r[i]=n[i]);return r}function Qn(t,e){const n=Kn(t,e);for(const r in t)(un(t[r])||un(e[r]))&&(n[-1!==sn.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function tr(t,e,n,r={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),e}const er=t=>Array.isArray(t),nr=t=>er(t)?t[t.length-1]||0:t;function rr(t){const e=un(t)?t.get():t;return(t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue))(e)?e.toValue():e}const ir=t=>(e,n)=>{const r=(0,c.useContext)(Re),i=(0,c.useContext)(Ve),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,o){const s={latestValues:or(r,i,o,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(t,e,r,i);return n?o():function(t){const e=(0,c.useRef)(null);return null===e.current&&(e.current=t()),e.current}(o)};function or(t,e,n,r){const i={},o=r(t,{});for(const t in o)i[t]=rr(o[t]);let{initial:s,animate:a}=t;const l=ze(t),u=qe(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!$e(d)&&(Array.isArray(d)?d:[d]).forEach(e=>{const n=tr(t,e);if(!n)return;const{transitionEnd:r,transition:o,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(i[t]=e)}for(const t in r)i[t]=r[t]}),i}const sr=t=>t;class ar{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const lr=["prepare","read","update","preRender","render","postRender"],{schedule:ur,cancel:cr,state:dr,steps:hr}=function(t){let e=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=lr.reduce((t,n)=>(t[n]=function(t){let e=new ar,n=new ar,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,u=l?e:n;return o&&s.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>e=!0),t),{}),o=t=>i[t].process(r),s=()=>{const i=performance.now();e=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,lr.forEach(o),r.isProcessing=!1,e&&(n=!1,t(s))};return{schedule:lr.reduce((o,a)=>{const l=i[a];return o[a]=(i,o=!1,a=!1)=>(e||(e=!0,n=!0,r.isProcessing||t(s)),l.schedule(i,o,a)),o},{}),cancel:t=>lr.forEach(e=>i[e].cancel(t)),state:r,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:sr),pr={useVisualState:ir({scrapeMotionValuesFromProps:Qn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(t,e,{renderState:n,latestValues:r})=>{ur.read(()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}}),ur.render(()=>{zn(n,r,{enableHardwareAcceleration:!1},qn(e.tagName),t.transformTemplate),Jn(e,n)})}})},mr={useVisualState:ir({scrapeMotionValuesFromProps:Kn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const gr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function yr(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function vr(t,e,n,r){return fr(t,e,(t=>e=>gr(e)&&t(e,yr(e)))(n),r)}const xr=(t,e)=>n=>e(t(n)),wr=(...t)=>t.reduce(xr);function br(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const Sr=br("dragHorizontal"),Cr=br("dragVertical");function Er(t){let e=!1;if("y"===t)e=Cr();else if("x"===t)e=Sr();else{const t=Sr(),n=Cr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pr(){const t=Er(!0);return!t||(t(),!1)}class kr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tr(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return vr(t.current,n,(n,i)=>{if("touch"===n.pointerType||Pr())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[r]&&ur.update(()=>o[r](n,i))},{passive:!t.getProps()[r]})}const Ar=(t,e)=>!!e&&(t===e||Ar(t,e.parentElement));function jr(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,yr(n))}const Dr=new WeakMap,Or=new WeakMap,Mr=t=>{const e=Dr.get(t.target);e&&e(t)},Rr=t=>{t.forEach(Mr)};const Vr={some:0,all:1},Lr={inView:{Feature:class extends kr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Vr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Or.has(n)||Or.set(n,{});const r=Or.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Rr,{root:t,...e})),r[i]}(e);return Dr.set(t,n),r.observe(t),()=>{Dr.delete(t),r.unobserve(t)}}(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=e?n:r;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends kr{constructor(){super(...arguments),this.removeStartListeners=sr,this.removeEndListeners=sr,this.removeAccessibleListeners=sr,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=vr(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();ur.update(()=>{i||Ar(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)})},{passive:!(n.onTap||n.onPointerUp)}),i=vr(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=wr(r,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=fr(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=fr(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&jr("up",(t,e)=>{const{onTap:n}=this.node.getProps();n&&ur.update(()=>n(t,e))})}),jr("down",(t,e)=>{this.startPress(t,e)}))}),e=fr(this.node.current,"blur",()=>{this.isPressing&&jr("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=wr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ur.update(()=>n(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ur.update(()=>n(t,e))}mount(){const t=this.node.getProps(),e=vr(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=fr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=wr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends kr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wr(fr(this.node.current,"focus",()=>this.onFocus()),fr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends kr{mount(){this.unmount=wr(Tr(this.node,!0),Tr(this.node,!1))}unmount(){}}}};function Fr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Nr(t,e,n){const r=t.getProps();return tr(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}let Ir=sr,_r=sr;const Br=t=>1e3*t,Ur=t=>t/1e3,$r=t=>Array.isArray(t)&&"number"==typeof t[0];function Hr(t){return Boolean(!t||"string"==typeof t&&zr[t]||$r(t)||Array.isArray(t)&&t.every(Hr))}const Wr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,zr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function qr(t){if(t)return $r(t)?Wr(t):Array.isArray(t)?t.map(qr):zr[t]}const Yr=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Gr(t,e,n,r){if(t===e&&n===r)return sr;return i=>0===i||1===i?i:Yr(function(t,e,n,r,i){let o,s,a=0;do{s=e+(n-e)/2,o=Yr(s,r,i)-t,o>0?n=s:e=s}while(Math.abs(o)>1e-7&&++a<12);return s}(i,0,1,t,n),e,r)}const Xr=Gr(.42,0,1,1),Zr=Gr(0,0,.58,1),Jr=Gr(.42,0,.58,1),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qr=t=>e=>1-t(1-e),ti=t=>1-Math.sin(Math.acos(t)),ei=Qr(ti),ni=Kr(ti),ri=Gr(.33,1.53,.69,.99),ii=Qr(ri),oi=Kr(ii),si={linear:sr,easeIn:Xr,easeInOut:Jr,easeOut:Zr,circIn:ti,circInOut:ni,circOut:ei,backIn:ii,backInOut:oi,backOut:ri,anticipate:t=>(t*=2)<1?.5*ii(t):.5*(2-Math.pow(2,-10*(t-1)))},ai=t=>{if(Array.isArray(t)){_r(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return Gr(e,n,r,i)}return"string"==typeof t?(_r(void 0!==si[t],`Invalid easing type '${t}'`),si[t]):t},li=(t,e)=>n=>Boolean(En(n)&&Cn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ui=(t,e,n)=>r=>{if(!En(r))return r;const[i,o,s,a]=r.match(bn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ci={...yn,transform:t=>Math.round((t=>gn(0,255,t))(t))},di={test:li("rgb","red"),parse:ui("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ci.transform(t)+", "+ci.transform(e)+", "+ci.transform(n)+", "+wn(vn.transform(r))+")"},hi={test:li("#"),parse:function(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:di.transform},pi={test:li("hsl","hue"),parse:ui("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Tn.transform(wn(e))+", "+Tn.transform(wn(n))+", "+wn(vn.transform(r))+")"},mi={test:t=>di.test(t)||hi.test(t)||pi.test(t),parse:t=>di.test(t)?di.parse(t):pi.test(t)?pi.parse(t):hi.parse(t),transform:t=>En(t)?t:t.hasOwnProperty("red")?di.transform(t):pi.transform(t)},fi=(t,e,n)=>-n*t+n*e+t;function gi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const yi=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},vi=[hi,di,pi];function xi(t){const e=(t=>vi.find(e=>e.test(t)))(t);_r(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===pi&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let i=0,o=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;i=gi(a,r,t+1/3),o=gi(a,r,t),s=gi(a,r,t-1/3)}else i=o=s=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:r}}(n)),n}const wi=(t,e)=>{const n=xi(t),r=xi(e),i={...n};return t=>(i.red=yi(n.red,r.red,t),i.green=yi(n.green,r.green,t),i.blue=yi(n.blue,r.blue,t),i.alpha=fi(n.alpha,r.alpha,t),di.transform(i))},bi={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:sr},Si={regex:Sn,countKey:"Colors",token:"${c}",parse:mi.parse},Ci={regex:bn,countKey:"Numbers",token:"${n}",parse:yn.parse};function Ei(t,{regex:e,countKey:n,token:r,parse:i}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...o.map(i)))}function Pi(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ei(n,bi),Ei(n,Si),Ei(n,Ci),n}function ki(t){return Pi(t).values}function Ti(t){const{values:e,numColors:n,numVars:r,tokenised:i}=Pi(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=i<r?e.replace(bi.token,t[i]):i<r+n?e.replace(Si.token,mi.transform(t[i])):e.replace(Ci.token,wn(t[i]));return e}}const Ai=t=>"number"==typeof t?0:t,ji={test:function(t){var e,n;return isNaN(t)&&En(t)&&((null===(e=t.match(bn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Sn))||void 0===n?void 0:n.length)||0)>0},parse:ki,createTransformer:Ti,getAnimatableNone:function(t){const e=ki(t);return Ti(t)(e.map(Ai))}},Di=(t,e)=>n=>`${n>0?e:t}`;function Oi(t,e){return"number"==typeof t?n=>fi(t,e,n):mi.test(t)?wi(t,e):t.startsWith("var(")?Di(t,e):Vi(t,e)}const Mi=(t,e)=>{const n=[...t],r=n.length,i=t.map((t,n)=>Oi(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=i[e](t);return n}},Ri=(t,e)=>{const n={...t,...e},r={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(r[i]=Oi(t[i],e[i]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Vi=(t,e)=>{const n=ji.createTransformer(e),r=Pi(t),i=Pi(e);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?wr(Mi(r.values,i.values),n):(Ir(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Di(t,e))},Li=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Fi=(t,e)=>n=>fi(t,e,n);function Ni(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const o=t.length;if(_r(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],i=n||function(t){return"number"==typeof t?Fi:"string"==typeof t?mi.test(t)?wi:Vi:Array.isArray(t)?Mi:"object"==typeof t?Ri:Fi}(t[0]),o=t.length-1;for(let n=0;n<o;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||sr:e;o=wr(t,o)}r.push(o)}return r}(e,r,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Li(t[n],t[n+1],e);return s[n](r)};return n?e=>l(gn(t[0],t[o-1],e)):l}function Ii({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(r)?r.map(ai):ai(r),o={done:!1,value:e[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Li(0,e,r);t.push(fi(n,1,i))}}(e,t.length-1),e}(e),t),a=Ni(s,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||Jr).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}function _i(t,e){return e?t*(1e3/e):0}function Bi(t,e,n){const r=Math.max(e-5,0);return _i(n-t(r),e-r)}const Ui=12;function $i(t,e){return t*Math.sqrt(1-e*e)}const Hi=["duration","bounce"],Wi=["stiffness","damping","mass"];function zi(t,e){return e.some(e=>void 0!==t[e])}function qi({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],o=t[t.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!zi(t,Wi)&&zi(t,Hi)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,o;Ir(t<=Br(10),"Spring duration must be 10 seconds or less");let s=1-e;s=gn(.05,1,s),t=gn(.01,10,Ur(t)),s<1?(i=e=>{const r=e*s,i=r*t;return.001-(r-n)/$i(e,s)*Math.exp(-i)},o=e=>{const r=e*s*t,o=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=$i(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((o-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Ui;n++)r-=t(r)/e(r);return r}(i,o,5/t);if(t=Br(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...r,velocity:-Ur(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(a*u)),f=o-i,g=Ur(Math.sqrt(a/u)),y=Math.abs(f)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),m<1){const t=$i(g,m);v=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)v=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);v=e=>{const n=Math.exp(-m*g*e),r=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(r)+t*f*Math.cosh(r))/t}}return{calculatedDuration:h&&c||null,next:t=>{const r=v(t);if(h)s.done=t>=c;else{let i=p;0!==t&&(i=m<1?Bi(v,t,r):0);const a=Math.abs(i)<=n,l=Math.abs(o-r)<=e;s.done=a&&l}return s.value=s.done?o:r,s}}}function Yi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=d+m,g=void 0===s?f:s(f);g!==f&&(m=g-d);const y=t=>-m*Math.exp(-t/r),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let w,b;const S=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(w=t,b=qi({keyframes:[h.value,p(h.value)],velocity:Bi(v,t,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>w?b.next(t-w):(!e&&x(t),h)}}}const Gi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>ur.update(e,!0),stop:()=>cr(e),now:()=>dr.isProcessing?dr.timestamp:performance.now()}};function Xi(t){let e=0,n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const Zi={decay:Yi,inertia:Yi,tween:Ii,keyframes:Ii,spring:qi};function Ji({autoplay:t=!0,delay:e=0,driver:n=Gi,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,m,f=1,g=!1;const y=()=>{m=new Promise(t=>{p=t})};let v;y();const x=Zi[i]||Ii;let w;x!==Ii&&"number"!=typeof r[0]&&(w=Ni([0,100],r,{clamp:!1}),r=[0,100]);const b=x({...h,keyframes:r});let S;"mirror"===a&&(S=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let C="idle",E=null,P=null,k=null;null===b.calculatedDuration&&o&&(b.calculatedDuration=Xi(b));const{calculatedDuration:T}=b;let A=1/0,j=1/0;null!==T&&(A=T+s,j=A*(o+1)-s);let D=0;const O=t=>{if(null===P)return;f>0&&(P=Math.min(P,t)),f<0&&(P=Math.min(t-j/f,P)),D=null!==E?E:Math.round(t-P)*f;const n=D-e*(f>=0?1:-1),i=f>=0?n<0:n>j;D=Math.max(n,0),"finished"===C&&null===E&&(D=j);let l=D,u=b;if(o){const t=Math.min(D,j)/A;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,o+1),Boolean(e%2)&&("reverse"===a?(n=1-n,s&&(n-=s/A)):"mirror"===a&&(u=S)),l=gn(0,1,n)*A}const c=i?{done:!1,value:r[0]}:u.next(l);w&&(c.value=w(c.value));let{done:h}=c;i||null===T||(h=f>=0?D>=j:D<=0);const p=null===E&&("finished"===C||"running"===C&&h);return d&&d(c.value),p&&V(),c},M=()=>{v&&v.stop(),v=void 0},R=()=>{C="idle",M(),p(),y(),P=k=null},V=()=>{C="finished",c&&c(),M(),p()},L=()=>{if(g)return;v||(v=n(O));const t=v.now();l&&l(),null!==E?P=t-E:P&&"finished"!==C||(P=t),"finished"===C&&y(),k=P,E=null,C="running",v.start()};t&&L();const F={then:(t,e)=>m.then(t,e),get time(){return Ur(D)},set time(t){t=Br(t),D=t,null===E&&v&&0!==f?P=v.now()-t/f:E=t},get duration(){const t=null===b.calculatedDuration?Xi(b):b.calculatedDuration;return Ur(t)},get speed(){return f},set speed(t){t!==f&&v&&(f=t,F.time=Ur(D))},get state(){return C},play:L,pause:()=>{C="paused",E=D},stop:()=>{g=!0,"idle"!==C&&(C="idle",u&&u(),R())},cancel:()=>{null!==k&&O(k),R()},complete:()=>{C="finished"},sample:t=>(P=0,O(t))};return F}const Ki=function(){let t;return()=>(void 0===t&&(t=Object.hasOwnProperty.call(Element.prototype,"animate")),t)}(),Qi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const to={type:"spring",stiffness:500,damping:25,restSpeed:10},eo={type:"keyframes",duration:.8},no={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ro=(t,{keyframes:e})=>e.length>2?eo:an.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:to:no,io=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!ji.test(e)&&"0"!==e||e.startsWith("url("))),oo=new Set(["brightness","contrast","saturate","opacity"]);function so(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(bn)||[];if(!r)return t;const i=n.replace(r,"");let o=oo.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+i+")"}const ao=/([a-z-]*)\(.*?\)/g,lo={...ji,getAnimatableNone:t=>{const e=t.match(ao);return e?e.map(so).join(" "):t}},uo={...Rn,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:lo,WebkitFilter:lo},co=t=>uo[t];function ho(t,e){let n=co(t);return n!==lo&&(n=ji),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const po=t=>/^0[^.\s]+$/.test(t);function mo(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||po(t):void 0}function fo(t,e){return t[e]||t.default||t}const go=(t,e,n,r={})=>i=>{const o=fo(r,t)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Br(s);const l=function(t,e,n,r){const i=io(e,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<o.length;t++)null===o[t]&&(o[t]=0===t?s:o[t-1]),mo(o[t])&&l.push(t),"string"==typeof o[t]&&"none"!==o[t]&&"0"!==o[t]&&(a=o[t]);if(i&&l.length&&a)for(let t=0;t<l.length;t++)o[l[t]]=ho(e,a);return o}(e,t,n,o),u=l[0],c=l[l.length-1],d=io(t,u),h=io(t,c);Ir(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(o)||(p={...p,...ro(t,p)}),p.duration&&(p.duration=Br(p.duration)),p.repeatDelay&&(p.repeatDelay=Br(p.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const i=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:sr,pause:sr,stop:sr,then:t=>(t(),Promise.resolve()),cancel:sr,complete:sr});return e?Ji({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}(p);if(!r.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...i}){if(!Ki()||!Qi.has(e)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,s,a=!1,l=!1;const u=()=>{s=new Promise(t=>{o=t})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=i;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Hr(e.ease))(e,i)){const t=Ji({...i,repeat:0,delay:0});let e={done:!1,value:c[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;p=void 0,c=n,d=r-10,h="linear"}const m=function(t,e,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=qr(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,c,{...i,duration:d,ease:h,times:p}),f=()=>{l=!1,m.cancel()},g=()=>{l=!0,ur.update(f),o(),u()};return m.onfinish=()=>{l||(t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(c,i)),r&&r(),g())},{then:(t,e)=>s.then(t,e),attachTimeline:t=>(m.timeline=t,m.onfinish=null,sr),get time(){return Ur(m.currentTime||0)},set time(t){m.currentTime=Br(t)},get speed(){return m.playbackRate},set speed(t){m.playbackRate=t},get duration(){return Ur(d)},play:()=>{a||(m.play(),cr(f))},pause:()=>m.pause(),stop:()=>{if(a=!0,"idle"===m.playState)return;const{currentTime:e}=m;if(e){const n=Ji({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}g()},complete:()=>{l||m.finish()},cancel:g}}(e,t,p);if(n)return n}return Ji(p)};function yo(t){return Boolean(un(t)&&t.add)}const vo=t=>/^\-?\d*\.?\d+$/.test(t);function xo(t,e){-1===t.indexOf(e)&&t.push(e)}function wo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class bo{constructor(){this.subscriptions=[]}add(t){return xo(this.subscriptions,t),()=>wo(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const So={current:void 0};class Co{constructor(t,e={}){var n;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=dr;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ur.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ur.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new bo);const n=this.events[t].add(e);return"change"===t?()=>{n(),ur.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return So.current&&So.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?_i(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eo(t,e){return new Co(t,e)}const Po=t=>e=>e.test(t),ko=[yn,An,Tn,kn,Dn,jn,{test:t=>"auto"===t,parse:t=>t}],To=t=>ko.find(Po(t)),Ao=[...ko,mi,ji],jo=t=>Ao.find(Po(t));function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Eo(n))}function Oo(t,e){if(e)return(e[t]||e.default||e).from}function Mo({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Ro(t,e){const n=t.get();if(!Array.isArray(e))return n!==e;for(let t=0;t<e.length;t++)if(e[t]!==n)return!0}function Vo(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(o=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const r=t.getValue(e),i=a[e];if(!r||void 0===i||c&&Mo(c,e))continue;const s={delay:n,elapsed:0,...fo(o||{},e)};if(window.HandoffAppearAnimations){const n=t.getProps()[_e];if(n){const t=window.HandoffAppearAnimations(n,e,r,ur);null!==t&&(s.elapsed=t,s.isHandoff=!0)}}let d=!s.isHandoff&&!Ro(r,i);if("spring"===s.type&&(r.getVelocity()||s.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(go(e,r,i,t.shouldReduceMotion&&an.has(e)?{type:!1}:s));const h=r.animation;yo(l)&&(l.add(e),h.then(()=>l.remove(e))),u.push(h)}return s&&Promise.all(u).then(()=>{s&&function(t,e){const n=Nr(t,e);let{transitionEnd:r={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o)Do(t,e,nr(o[e]))}(t,s)}),u}function Lo(t,e,n={}){const r=Nr(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Vo(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,r=0,i=1,o){const s=[],a=(t.variantChildren.size-1)*r,l=1===i?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Fo).forEach((t,r)=>{t.notify("AnimationStart",e),s.push(Lo(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,o+r,s,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,s]:[s,o];return t().then(()=>e())}return Promise.all([o(),s(n.delay)])}function Fo(t,e){return t.sortNodePosition(e)}const No=[...He].reverse(),Io=He.length;function _o(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Lo(t,e,n));r=Promise.all(i)}else if("string"==typeof e)r=Lo(t,e,n);else{const i="function"==typeof e?Nr(t,e,n.custom):e;r=Promise.all(Vo(t,i,n))}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}(t);const n={animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()};let r=!0;const i=(e,n)=>{const r=Nr(t,n);if(r){const{transition:t,transitionEnd:n,...i}=r;e={...e,...i,...n}}return e};function o(o,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Io;e++){const p=No[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Ue(f),y=p===s?m.isActive:null;!1===y&&(h=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&r&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&null===y||!f&&!m.prevProp||$e(f)||"boolean"==typeof f)continue;let x=Bo(m.prevProp,f)||p===s&&m.isActive&&!v&&g||e>h&&g,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(i,{});!1===y&&(S={});const{prevResolvedValues:C={}}=m,E={...C,...S},P=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0};for(const t in E){const e=S[t],n=C[t];if(d.hasOwnProperty(t))continue;let r=!1;r=er(e)&&er(n)?!Fr(e,n):e!==n,r?void 0!==e?P(t):c.add(t):void 0!==e&&c.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&t.blockInitialAnimation&&(x=!1),!x||v&&!w||u.push(...b.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let p=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),r=!1,p?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,i){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Bo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Fr(e,t)}function Uo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $o=0;const Ho={animation:{Feature:class extends kr{constructor(t){super(t),t.animationState||(t.animationState=_o(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$e(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends kr{constructor(){super(...arguments),this.id=$o++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Wo=(t,e)=>Math.abs(t-e);class zo{constructor(t,e,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Go(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Wo(t.x,e.x),r=Wo(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:i}=dr;this.history.push({...r,timestamp:i});const{onStart:o,onMove:s}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=qo(e,this.transformPagePoint),ur.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Go("pointercancel"===t.type?this.lastMoveEventInfo:qo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!gr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=r||window;const o=qo(yr(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=dr;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Go(o,this.history)),this.removeListeners=wr(vr(this.contextWindow,"pointermove",this.handlePointerMove),vr(this.contextWindow,"pointerup",this.handlePointerUp),vr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cr(this.updatePoint)}}function qo(t,e){return e?{point:e(t.point)}:t}function Yo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return{point:t,delta:Yo(t,Zo(e)),offset:Yo(t,Xo(e)),velocity:Jo(e,.1)}}function Xo(t){return t[0]}function Zo(t){return t[t.length-1]}function Jo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Zo(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Br(e)));)n--;if(!r)return{x:0,y:0};const o=Ur(i.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ko(t){return t.max-t.min}function Qo(t,e=0,n=.01){return Math.abs(t-e)<=n}function ts(t,e,n,r=.5){t.origin=r,t.originPoint=fi(e.min,e.max,t.origin),t.scale=Ko(n)/Ko(e),(Qo(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=fi(n.min,n.max,t.origin)-t.originPoint,(Qo(t.translate)||isNaN(t.translate))&&(t.translate=0)}function es(t,e,n,r){ts(t.x,e.x,n.x,r?r.originX:void 0),ts(t.y,e.y,n.y,r?r.originY:void 0)}function ns(t,e,n){t.min=n.min+e.min,t.max=t.min+Ko(e)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+Ko(e)}function is(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function os(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ss(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const as=.35;function ls(t,e,n){return{min:us(t,e),max:us(t,n)}}function us(t,e){return"number"==typeof t?t:t[e]||0}const cs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ds(t){return[t("x"),t("y")]}function hs({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ps(t){return void 0===t||1===t}function ms({scale:t,scaleX:e,scaleY:n}){return!ps(t)||!ps(e)||!ps(n)}function fs(t){return ms(t)||gs(t)||t.z||t.rotate||t.rotateX||t.rotateY}function gs(t){return ys(t.x)||ys(t.y)}function ys(t){return t&&"0%"!==t}function vs(t,e,n){return n+e*(t-n)}function xs(t,e,n,r,i){return void 0!==i&&(t=vs(t,i,r)),vs(t,n,r)+e}function ws(t,e=0,n=1,r,i){t.min=xs(t.min,e,n,r,i),t.max=xs(t.max,e,n,r,i)}function bs(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}function Ss(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function Es(t,e,[n,r,i]){const o=void 0!==e[i]?e[i]:.5,s=fi(t.min,t.max,o);ws(t,e[n],e[r],s,e.scale)}const Ps=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ts(t,e){Es(t.x,e,Ps),Es(t.y,e,ks)}function As(t,e){return hs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const js=({current:t})=>t?t.ownerDocument.defaultView:null,Ds=new WeakMap;class Os{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new zo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(yr(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Er(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ds(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Tn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Ko(r)*(parseFloat(e)/100))}}this.originPoint[t]=e}),i&&ur.update(()=>i(t,e),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>ds(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:js(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:i}=this.getProps();i&&ur.update(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Ms(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?fi(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?fi(n,t,r.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,i=this.constraints;e&&Be(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!r)&&function(t,{top:e,left:n,bottom:r,right:i}){return{x:os(t.x,n,i),y:os(t.y,e,r)}}(r.layoutBox,e),this.elastic=function(t=as){return!1===t?t=0:!0===t&&(t=as),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ds(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Be(t))return!1;const n=t.current;_r(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(t,e,n){const r=As(t,n),{scroll:i}=e;return i&&(Cs(r.x,i.offset.x),Cs(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ss(t.x,e.x),y:ss(t.y,e.y)}}(r.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=hs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ds(s=>{if(!Ms(s,e,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(go(t,n,0,e))}stopAnimation(){ds(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ds(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ds(e=>{const{drag:n}=this.getProps();if(!Ms(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[e];i.set(t[e]-fi(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Be(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ds(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Ko(t),i=Ko(e);return i>r?n=Li(e.min,e.max-r,t.min):r>i&&(n=Li(t.min,t.max-i,e.min)),gn(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ds(e=>{if(!Ms(e,t,null))return;const n=this.getAxisMotionValue(e),{min:i,max:o}=this.constraints[e];n.set(fi(i,o,r[e]))})}addListeners(){if(!this.visualElement.current)return;Ds.set(this.visualElement,this);const t=vr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();Be(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=fr(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ds(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),r(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=as,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function Ms(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Rs=t=>(e,n)=>{t&&ur.update(()=>t(e,n))},Vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ls(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!An.test(t))return t;t=parseFloat(t)}return`${Ls(t,e.target.x)}% ${Ls(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=ji.parse(t);if(i.length>5)return r;const o=ji.createTransformer(t),s="number"!=typeof i[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=a,i[1+s]/=l;const u=fi(a,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=u),"number"==typeof i[3+s]&&(i[3+s]/=u),o(i)}};class Is extends c.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=t;var o;o=Bs,Object.assign(on,o),i&&(e.group&&e.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,r||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ur.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _s(t){const[e,n]=function(){const t=(0,c.useContext)(Ve);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=(0,c.useId)();return(0,c.useEffect)(()=>r(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),r=(0,c.useContext)(Ze);return c.createElement(Is,{...t,layoutGroup:r,switchLayoutGroup:(0,c.useContext)(Je),isPresent:e,safeToRemove:n})}const Bs={borderRadius:{...Fs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fs,borderTopRightRadius:Fs,borderBottomLeftRadius:Fs,borderBottomRightRadius:Fs,boxShadow:Ns},Us=["TopLeft","TopRight","BottomLeft","BottomRight"],$s=Us.length,Hs=t=>"string"==typeof t?parseFloat(t):t,Ws=t=>"number"==typeof t||An.test(t);function zs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const qs=Gs(0,.5,ei),Ys=Gs(.5,.95,sr);function Gs(t,e,n){return r=>r<t?0:r>e?1:n(Li(t,e,r))}function Xs(t,e){t.min=e.min,t.max=e.max}function Zs(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Js(t,e,n,r,i){return t=vs(t-=e,1/n,r),void 0!==i&&(t=vs(t,1/i,r)),t}function Ks(t,e,[n,r,i],o,s){!function(t,e=0,n=1,r=.5,i,o=t,s=t){if(Tn.test(e)&&(e=parseFloat(e),e=fi(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=fi(o.min,o.max,r);t===o&&(a-=e),t.min=Js(t.min,e,n,a,i),t.max=Js(t.max,e,n,a,i)}(t,e[n],e[r],e[i],e.scale,o,s)}const Qs=["x","scaleX","originX"],ta=["y","scaleY","originY"];function ea(t,e,n,r){Ks(t.x,e,Qs,n?n.x:void 0,r?r.x:void 0),Ks(t.y,e,ta,n?n.y:void 0,r?r.y:void 0)}function na(t){return 0===t.translate&&1===t.scale}function ra(t){return na(t.x)&&na(t.y)}function ia(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function oa(t){return Ko(t.x)/Ko(t.y)}class sa{constructor(){this.members=[]}add(t){xo(this.members,t),t.scheduleRender()}remove(t){if(wo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function aa(t,e,n){let r="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),i&&(r+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const la=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){xo(this.children,t),this.isDirty=!0}remove(t){wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(la),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"],da={visibility:"hidden"};let ha=0;const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function ma({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ha++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;this.projectionUpdateScheduled=!1,pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0,this.nodes.forEach(ya),this.nodes.forEach(Ea),this.nodes.forEach(Pa),this.nodes.forEach(va),t=pa,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ua)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t){const e=performance.now(),n=({timestamp:r})=>{const i=r-e;i>=250&&(cr(n),t(i-250))};return ur.read(n,!0),()=>cr(n)}(r),Vs.hasAnimatedSinceResize&&(Vs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ca))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||s.getDefaultTransition()||Oa,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ia(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...fo(i,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Ca(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ka),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(wa);this.isUpdating||this.nodes.forEach(ba),this.isUpdating=!1,this.nodes.forEach(Sa),this.nodes.forEach(fa),this.nodes.forEach(ga),this.clearAllSnapshots();const t=performance.now();dr.delta=gn(0,1e3/60,t-dr.timestamp),dr.timestamp=t,dr.isProcessing=!0,hr.update.process(dr),hr.preRender.process(dr),hr.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(xa),this.sharedNodes.forEach(Ta)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ur.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ur.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ra(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;t&&(e||fs(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Va((r=n).x),Va(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Cs(e.x,n.offset.x),Cs(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:o}=r;if(r!==this.root&&i&&o.layoutScroll){if(i.isRoot){Zs(e,t);const{scroll:n}=this.root;n&&(Cs(e.x,-n.offset.x),Cs(e.y,-n.offset.y))}Cs(e.x,i.offset.x),Cs(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Zs(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ts(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fs(r.latestValues)&&Ts(n,r.latestValues)}return fs(this.latestValues)&&Ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fs(n.latestValues))continue;ms(n.latestValues)&&n.updateSnapshot();const r=cs();Zs(r,n.measurePageBox()),ea(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fs(this.latestValues)&&ea(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:i,layoutId:o}=this.options;if(this.layout&&(i||o)){if(this.resolvedRelativeTargetAt=dr.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ns(s.x,a.x,l.x),ns(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Zs(this.target,this.layout.layoutBox),bs(this.target,this.targetDelta)):Zs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.target,t.target),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}pa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ms(this.parent.latestValues)&&!gs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===dr.timestamp&&(r=!1),r)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;Zs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const i=n.length;if(!i)return;let o,s;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,bs(t,s)),r&&fs(o.latestValues)&&Ts(t,o.latestValues))}e.x=Ss(e.x),e.y=Ss(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.projectionTransform;es(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=aa(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),pa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Da));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,p,m;Aa(o.x,t.x,n),Aa(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(is(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,h=this.relativeTargetOrigin,p=s,m=n,ja(l.x,h.x,p.x,m),ja(l.y,h.y,p.y,m),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Zs(d,this.relativeTarget)),a&&(this.animationValues=i,function(t,e,n,r,i,o){i?(t.opacity=fi(0,void 0!==n.opacity?n.opacity:1,qs(r)),t.opacityExit=fi(void 0!==e.opacity?e.opacity:1,0,Ys(r))):o&&(t.opacity=fi(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i<$s;i++){const o=`border${Us[i]}Radius`;let s=zs(e,o),a=zs(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Ws(s)===Ws(a)?(t[o]=Math.max(fi(Hs(s),Hs(a),r),0),(Tn.test(a)||Tn.test(s))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=fi(e.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ur.update(()=>{Vs.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=un(0)?0:Eo(0);return r.start(go("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:i}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&La(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ko(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Ko(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Zs(e,n),Ts(e,i),es(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<ca.length;e++){const i="rotate"+ca[e];n[i]&&(r[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return da;const r={visibility:""},i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=rr(null==t?void 0:t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=rr(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=aa(this.projectionDeltaWithTransform,this.treeScale,s),i&&(r.transform=i(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in on){if(void 0===s[t])continue;const{correct:e,applyTo:n}=on[t],i="none"===r.transform?s[t]:e(s[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=i}else r[t]=i}return this.options.layoutId&&(r.pointerEvents=o===this?rr(null==t?void 0:t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(wa),this.root.sharedNodes.clear()}}}function fa(t){t.updateLayout()}function ga(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?ds(t=>{const r=o?n.measuredBox[t]:n.layoutBox[t],i=Ko(r);r.min=e[t].min,r.max=r.min+i}):La(i,n.layoutBox,e)&&ds(r=>{const i=o?n.measuredBox[r]:n.layoutBox[r],s=Ko(e[r]);i.max=i.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};es(s,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?es(a,t.applyTransform(r,!0),n.measuredBox):es(a,e,n.layoutBox);const l=!ra(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:o}=r;if(i&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};is(s,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};is(a,e,o.layoutBox),ia(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ya(t){pa.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function va(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function xa(t){t.clearSnapshot()}function wa(t){t.clearMeasurements()}function ba(t){t.isLayoutDirty=!1}function Sa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ca(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ea(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function ka(t){t.resetRotation()}function Ta(t){t.removeLeadSnapshot()}function Aa(t,e,n){t.translate=fi(e.translate,0,n),t.scale=fi(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ja(t,e,n,r){t.min=fi(e.min,n.min,r),t.max=fi(e.max,n.max,r)}function Da(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Oa={duration:.45,ease:[.4,0,.1,1]},Ma=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=Ma("applewebkit/")&&!Ma("chrome/")?Math.round:sr;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function La(t,e,n){return"position"===t||"preserve-aspect"===t&&!Qo(oa(e),oa(n),.2)}const Fa=ma({attachResizeListener:(t,e)=>fr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Na={current:void 0},Ia=ma({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Na.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),Na.current=t}return Na.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),_a={pan:{Feature:class extends kr{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new zo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:js(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rs(t),onStart:Rs(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&ur.update(()=>r(t,e))}}}mount(){this.removePointerDownListener=vr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends kr{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new Os(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Ia,MeasureLayout:_s}},Ba=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ua(t,e,n=1){_r(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=function(t){const e=Ba.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const t=o.trim();return vo(t)?parseFloat(t):t}return mn(i)?Ua(i,e,n+1):i}const $a=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ha=t=>$a.has(t),Wa=t=>t===yn||t===An,za=(t,e)=>parseFloat(t.split(", ")[e]),qa=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return za(i[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},Ya=new Set(["x","y","z"]),Ga=sn.filter(t=>!Ya.has(t)),Xa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:qa(4,13),y:qa(5,14)};Xa.translateX=Xa.x,Xa.translateY=Xa.y;function Za(t,e,n,r){return(t=>Object.keys(t).some(Ha))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const i=Object.keys(e).filter(Ha);let o=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=To(u);const d=e[i];let h;if(er(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=To(u);for(let n=e;n<t&&null!==d[n];n++)h?_r(To(d[n])===h,"All keyframes must be of the same type"):(h=To(d[n]),_r(h===c||Wa(c)&&Wa(h),"Keyframes must be of the same dimension as the current value"))}else h=To(d);if(c!==h)if(Wa(c)&&Wa(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===An&&(e[i]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[i]=c.transform(d):(s||(o=function(t){const e=[];return Ga.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),r[i]=void 0!==r[i]?r[i]:e[i],l.jump(d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const r=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:s}=o,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Xa[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=Xa[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),Le&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ja={current:null},Ka={current:!1},Qa=new WeakMap,tl=Object.keys(Xe),el=tl.length,nl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rl=We.length;class il{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ur.render(this.render,!1,!0);const{latestValues:s,renderState:a}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ze(e),this.isVariantNode=qe(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&un(e)&&(e.set(s[t],!1),yo(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Qa.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ka.current||function(){if(Ka.current=!0,Le)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ja.current=t.matches;t.addListener(e),e()}else Ja.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ja.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Qa.delete(this.current),this.projection&&this.projection.unmount(),cr(this.notifyUpdate),cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=an.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ur.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,i){let o,s;for(let t=0;t<el;t++){const n=tl[t],{isEnabled:r,Feature:i,ProjectionNode:a,MeasureLayout:l}=Xe[n];a&&(o=a),r(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(s=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&Be(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<nl.length;e++){const n=nl[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const i in e){const o=e[i],s=n[i];if(un(o))t.addValue(i,o),yo(r)&&r.add(i);else if(un(s))t.addValue(i,Eo(o,{owner:t})),yo(r)&&r.remove(i);else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Eo(void 0!==e?e:o,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<rl;t++){const n=We[t],r=this.props[n];(Ue(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Eo(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=tr(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||un(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new bo),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ol extends il{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},i){let o=function(t,e,n){const r={};for(const i in t){const t=Oo(i,e);if(void 0!==t)r[i]=t;else{const t=n.getValue(i);t&&(r[i]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),i){!function(t,e,n){var r,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(vo(u)||po(u))?u=parseFloat(u):!jo(u)&&ji.test(l)&&(u=ho(s,l)),t.addValue(s,Eo(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,o);const t=((t,e,n,r)=>{const i=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!mn(e))return;const n=Ua(e,r);n&&t.set(n)});for(const t in e){const i=e[t];if(!mn(i))continue;const o=Ua(i,r);o&&(e[t]=o,n||(n={}),void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,r);return Za(t,e=i.target,n,r=i.transitionEnd)})(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class sl extends ol{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),i=(pn(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return As(t,e)}build(t,e,n,r){Vn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Kn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(t,e,n,r){Xn(t,e,n,r)}}class al extends ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}return e=Zn.has(e)?e:Ie(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Qn(t,e)}build(t,e,n,r){zn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Jn(t,e,0,r)}mount(t){this.isSVGTag=qn(t.tagName),super.mount(t)}}const ll=(t,e)=>rn(t)?new al(e,{enableHardwareAcceleration:!1}):new sl(e,{enableHardwareAcceleration:!0}),ul={...Ho,...Lr,..._a,layout:{ProjectionNode:Ia,MeasureLayout:_s}},cl=en((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...rn(t)?pr:mr,preloadedFeatures:n,useRender:Gn(e),createVisualElement:r,Component:t}}(t,e,ul,ll)),dl=window.wp.components;Object.defineProperty;var hl=new Map,pl=new WeakMap,ml=0;function fl(t,e,n={},r=void 0){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:s}=function(t){const e=function(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>{return`${e}_${"root"===e?(n=t.root,n?(pl.has(n)||(ml+=1,pl.set(n,ml.toString())),pl.get(n)):"0"):t[e]}`;var n}).toString()}(t);let n=hl.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver(e=>{e.forEach(e=>{var n;const o=e.isIntersecting&&i.some(t=>e.intersectionRatio>=t);t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach(t=>{t(o,e)})})},t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},hl.set(e,n)}return n}(n),a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),o.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),o.unobserve(t)),0===s.size&&(o.disconnect(),hl.delete(i))}}function gl(){return gl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gl.apply(this,arguments)}function yl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yl(Object(n),!0).forEach(function(e){xl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c.Component;class wl extends h().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let i in e){const o=parseInt(i);o>0&&t<=o&&o<n&&(n=o,r=e[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),n=h().Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%t;e[i]||(e[i]=[]),e[i].push(n[r])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let o=n;o&&"string"!=typeof o&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===o&&(o="my-masonry-grid_column"));const s=vl(vl(vl({},t),e),{},{style:vl(vl({},e.style),{},{width:i}),className:o});return r.map((t,e)=>h().createElement("div",gl({},s,{key:e}),t))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:n,columnClassName:r,columnAttrs:i,column:o,className:s}=t,a=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let l=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(l="my-masonry-grid")),h().createElement("div",gl({},a,{className:l}),this.renderColumns())}}wl.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const bl=wl,Sl=window.wp.blockEditor,Cl=window.wp.blocks;var El=i(942),Pl=i.n(El);const kl=window.lodash,Tl={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"},Al=(t,e=[])=>Array.from(e).some(e=>!!e.style&&Array.from(e.style).some(e=>e&&e.includes(t))),jl=new WeakMap,Dl=x(S((t,e)=>({selectedPatterns:{},toggleSelection:(e,n,r="")=>t(t=>{const i={...t.selectedPatterns};if(i[e])delete i[e];else{if(Object.keys(i).length>=10)return t;i[e]={blocks:n,prompt:r}}return{selectedPatterns:i}}),updatePrompt:(e,n)=>t(t=>t.selectedPatterns[e]?{selectedPatterns:{...t.selectedPatterns,[e]:{...t.selectedPatterns[e],prompt:n}}}:t),isSelected:t=>!!e().selectedPatterns[t],getSelectedCount:()=>Object.keys(e().selectedPatterns).length,canSelectMore:()=>Object.keys(e().selectedPatterns).length<10,getSelectedPatterns:()=>Object.entries(e().selectedPatterns).map(([t,e])=>({patternId:t,...e})),clearSelection:()=>t({selectedPatterns:{}}),removeFromSelection:e=>t(t=>{const n={...t.selectedPatterns};return delete n[e],{selectedPatterns:n}})}),{name:"Strakture Selection"})),Ol=({patternId:e,onPatternClick:n,code:i,disabled:o})=>{const[s,a]=(0,t.useState)(!1),l=(0,t.useRef)(),{isSelected:u,toggleSelection:c,canSelectMore:d}=Dl(),h=u(e),p=!h&&!d(),m=/100[vsd]vh|min-height:\s*100vh/.test(i),f=(0,t.useMemo)(()=>(0,Cl.rawHandler)({HTML:Ml(i)}),[i]),{ready:g}=(({container:e,onIFrameLoaded:n,ready:r,loadDelay:i})=>{const o=(()=>{const e=(0,t.useRef)(!1);return(0,t.useEffect)(()=>(e.current=!0,()=>e.current=!1)),e})(),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(!1),{addMissingCSSVar:p}=V(),m=(0,t.useCallback)(t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in Tl)e.getPropertyValue(r)||Array.from(n).filter(t=>{try{return t.cssRules}catch(t){return!1}}).some(t=>Al(r,t.cssRules))||(p(r),t.contentDocument.documentElement.style.setProperty(r,Tl[r]))},[p]),f=(0,t.useCallback)(async(t,e)=>{if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let n=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];n=n?parseFloat(n):null;const r=e.offsetHeight/(null!=n?n:1);t.style.setProperty("max-height",`${r}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)jl.has(t)||jl.set(t,t.style.minHeight),t.style.minHeight=jl.get(t);e.offsetHeight,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>requestAnimationFrame(t));for(const e of i){if(!t.contentDocument?.defaultView)return;const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1},[]);return(0,t.useEffect)(()=>{if(!r)return;const t=setTimeout(()=>{if(l)return;const t=e?.querySelector("iframe[title]");if(!t)return a(t=>t+1);u(t),requestAnimationFrame(()=>n(t,e))},100);return()=>clearTimeout(t)},[l,r,s,e,n]),(0,t.useEffect)(()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame(()=>n(l,e));const n=(0,kl.debounce)(async()=>{o.current&&!h.current&&(r.disconnect(),await f(l,e),"extendable"!==window.straktureSharedData?.themeSlug&&await m(l,e),setTimeout(()=>d(!0),i),o.current&&r.observe(l.contentDocument,t))},300),r=new MutationObserver(n);return r.observe(l.contentDocument,t),()=>{n.cancel(),r?.disconnect()}},[l,e,o,r,f,m,i]),{loading:!l,ready:c}})({container:l.current,ready:s,onIFrameLoaded:()=>{},loadDelay:50});return(0,t.useEffect)(()=>a(!0),[]),(0,M.jsxs)("div",{className:Pl()(`library-pattern pattern-${e} mb-8 rounded-md overflow-hidden w-full border bg-white transition-colors duration-150`,{"opacity-0 border-transparent":!g,"opacity-100 border-gray-400 hover:border-design-main":g&&!o&&!h,"opacity-100 border-design-main bg-design-main/5":g&&!o&&h,"opacity-100 border-gray-400":g&&o,"opacity-50":o}),children:[(0,M.jsx)("button",{ref:l,type:"button",disabled:o,"aria-label":(0,r.__)("Insert Pattern","strakture"),className:Pl()("relative z-10 m-0 inline-block w-full bg-transparent p-0 focus:shadow-sm focus:outline-none focus:ring-wp focus:ring-design-main focus:ring-offset-2 focus:ring-offset-white",{"cursor-not-allowed":o}),onClick:()=>n(e,f),children:(0,M.jsx)(Sl.BlockPreview,{blocks:f,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }\n\t\t\t\t\t\t\t\t'+(m?".wp-block-cover { min-height: 788px !important; }":"")}]})}),(0,M.jsx)("div",{className:"p-3",children:(0,M.jsx)("div",{className:"flex items-center justify-between",children:(0,M.jsxs)("label",{className:"cursor-pointer items-center",children:[(0,M.jsx)("input",{type:"checkbox",checked:h,onChange:()=>c(e,f),disabled:o||p,className:"h-4 w-4 rounded border-gray-400 text-design-main focus:ring-design-main focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50"}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Select pattern","strakture")})]})})})]})},Ml=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),Rl="https://api.strakture.com";var Vl=i(888),Ll=Object.prototype.hasOwnProperty;const Fl=new WeakMap,Nl=()=>{},Il=Nl(),_l=Object,Bl=t=>t===Il,Ul=t=>"function"==typeof t,$l=(t,e)=>({...t,...e}),Hl=t=>Ul(t.then),Wl={},zl={},ql="undefined",Yl=typeof window!=ql,Gl=typeof document!=ql,Xl=Yl&&"Deno"in window,Zl=(t,e)=>{const n=Fl.get(t);return[()=>!Bl(e)&&t.get(e)||Wl,r=>{if(!Bl(e)){const i=t.get(e);e in zl||(zl[e]=i),n[5](e,$l(i,r),i||Wl)}},n[6],()=>!Bl(e)&&e in zl?zl[e]:!Bl(e)&&t.get(e)||Wl]};let Jl=!0;const[Kl,Ql]=Yl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Nl,Nl],tu={isOnline:()=>Jl,isVisible:()=>{const t=Gl&&document.visibilityState;return Bl(t)||"hidden"!==t}},eu={initFocus:t=>(Gl&&document.addEventListener("visibilitychange",t),Kl("focus",t),()=>{Gl&&document.removeEventListener("visibilitychange",t),Ql("focus",t)}),initReconnect:t=>{const e=()=>{Jl=!0,t()},n=()=>{Jl=!1};return Kl("online",e),Kl("offline",n),()=>{Ql("online",e),Ql("offline",n)}}},nu=!c.useId,ru=!Yl||Xl,iu=ru?c.useEffect:c.useLayoutEffect,ou="undefined"!=typeof navigator&&navigator.connection,su=!ru&&ou&&(["slow-2g","2g"].includes(ou.effectiveType)||ou.saveData),au=new WeakMap,lu=(t,e)=>t===`[object ${e}]`;let uu=0;const cu=t=>{const e=typeof t,n=(r=t,_l.prototype.toString.call(r));var r;const i=lu(n,"Date"),o=lu(n,"RegExp"),s=lu(n,"Object");let a,l;if(_l(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=au.get(t),a)return a;if(a=++uu+"~",au.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=cu(t[l])+",";au.set(t,a)}if(s){a="#";const e=_l.keys(t).sort();for(;!Bl(l=e.pop());)Bl(t[l])||(a+=l+":"+cu(t[l])+",");au.set(t,a)}}return a},du=t=>{if(Ul(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?cu(t):"",e]};let hu=0;const pu=()=>++hu;async function mu(...t){const[e,n,r,i]=t,o=$l({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=o.throwOnError;if(Ul(n)){const t=n,r=[],i=e.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(c))}return c(n);async function c(n){const[i]=du(n);if(!i)return;const[c,d]=Zl(e,i),[h,p,m,f]=Fl.get(e),g=()=>{const t=h[i];return(Ul(o.revalidate)?o.revalidate(c().data,n):!1!==o.revalidate)&&(delete m[i],delete f[i],t&&t[0])?t[0](2).then(()=>c().data):c().data};if(t.length<3)return g();let y,v=r,x=!1;const w=pu();p[i]=[w,0];const b=!Bl(l),S=c(),C=S.data,E=S._c,P=Bl(E)?C:E;if(b&&(l=Ul(l)?l(P,C):l,d({data:l,_c:P})),Ul(v))try{v=v(P)}catch(t){y=t,x=!0}if(v&&Hl(v)){if(v=await v.catch(t=>{y=t,x=!0}),w!==p[i][0]){if(x)throw y;return v}x&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Il}))}if(s&&!x)if(Ul(s)){const t=s(v,P);d({data:t,error:Il,_c:Il})}else d({data:v,error:Il,_c:Il});if(p[i][1]=pu(),Promise.resolve(g()).then(()=>{d({_c:Il})}),!x)return v;if(u)throw y}}const fu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},gu=(t,e)=>{if(!Fl.has(t)){const n=$l(eu,e),r=Object.create(null),i=mu.bind(Il,t);let o=Nl;const s=Object.create(null),a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const i=s[e];if(i)for(const t of i)t(n,r)},u=()=>{if(!Fl.has(t)&&(Fl.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!ru)){const e=n.initFocus(setTimeout.bind(Il,fu.bind(Il,r,0))),i=n.initReconnect(setTimeout.bind(Il,fu.bind(Il,r,1)));o=()=>{e&&e(),i&&i(),Fl.delete(t)}}};return u(),[t,i,u,o]}return[t,Fl.get(t)[4]]},[yu,vu]=gu(new Map),xu=$l({onLoadingSlow:Nl,onSuccess:Nl,onError:Nl,onErrorRetry:(t,__,e,n,r)=>{const i=e.errorRetryCount,o=r.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*e.errorRetryInterval;!Bl(i)&&o>i||setTimeout(n,s,r)},onDiscarded:Nl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:su?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:su?5e3:3e3,compare:function t(e,n){var r,i;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((i=e.length)===n.length)for(;i--&&t(e[i],n[i]););return-1===i}if(!r||"object"==typeof e){for(r in i=0,e){if(Ll.call(e,r)&&++i&&!Ll.call(n,r))return!1;if(!(r in n)||!t(e[r],n[r]))return!1}return Object.keys(n).length===i}}return e!=e&&n!=n},isPaused:()=>!1,cache:yu,mutate:vu,fallback:{}},tu),wu=(t,e)=>{const n=$l(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=$l(i,s))}return n},bu=(0,c.createContext)({}),Su="$inf$",Cu=Yl&&window.__SWR_DEVTOOLS_USE__,Eu=Cu?window.__SWR_DEVTOOLS_USE__:[],Pu=t=>Ul(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],ku=Eu.concat(t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=du(e),[,,,i]=Fl.get(yu);if(r.startsWith(Su))return n(...t);const o=i[r];return Bl(o)?n(...t):(delete i[r],o)}),r)),Tu=(t,e)=>(...n)=>{const[r,i,o]=Pu(n),s=(o.use||[]).concat(e);return t(r,i,{...o,use:s})};Cu&&(window.__SWR_DEVTOOLS_REACT__=c);const Au=()=>{};Au(),new WeakMap;const ju=c.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Du={dedupe:!0},Ou=Promise.resolve(Il),Mu=(_l.defineProperty(t=>{const{value:e}=t,n=(0,c.useContext)(bu),r=Ul(e),i=(0,c.useMemo)(()=>r?e(n):e,[r,n,e]),o=(0,c.useMemo)(()=>r?i:wu(n,i),[r,n,i]),s=i&&i.provider,a=(0,c.useRef)(Il);s&&!a.current&&(a.current=gu(s(o.cache||yu),i));const l=a.current;return l&&(o.cache=l[0],o.mutate=l[1]),iu(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,c.createElement)(bu.Provider,$l(t,{value:o}))},"defaultValue",{value:xu}),Ru=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p,strictServerPrefetchWarning:m}=n,[f,g,y,v]=Fl.get(r),[x,w]=du(t),b=(0,c.useRef)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(x),E=(0,c.useRef)(e),P=(0,c.useRef)(n),k=()=>P.current,T=()=>k().isVisible()&&k().isOnline(),[A,j,D,O]=Zl(r,x),M=(0,c.useRef)({}).current,R=Bl(s)?Bl(n.fallback)?Il:n.fallback[x]:s,V=(t,e)=>{for(const n in M){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!Bl(t[r]))return!1;if(!i(H,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},L=(0,c.useMemo)(()=>{const t=!!x&&!!e&&(Bl(a)?!k().isPaused()&&!o&&!1!==l:a),n=e=>{const n=$l(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),i=O(),s=n(r),u=r===i?s:n(i);let c=s;return[()=>{const t=n(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>u]},[r,x]),F=(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>D(x,(e,n)=>{V(n,e)||t()}),[r,x]),L[0],L[1]),N=!b.current,I=f[x]&&f[x].length>0,_=F.data,B=Bl(_)?R&&Hl(R)?ju(R):R:_,U=F.error,$=(0,c.useRef)(B),H=p?Bl(_)?Bl($.current)?B:$.current:_:B,W=x&&Bl(B),z=!ru&&(0,Vl.useSyncExternalStore)(()=>Nl,()=>!1,()=>!0);m&&z&&!o&&W&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const q=!(I&&!Bl(U))&&(N&&!Bl(a)?a:!k().isPaused()&&(o?!Bl(B)&&l:Bl(B)||l)),Y=!!(x&&e&&N&&q),G=Bl(F.isValidating)?Y:F.isValidating,X=Bl(F.isLoading)?Y:F.isLoading,Z=(0,c.useCallback)(async t=>{const e=E.current;if(!x||!e||S.current||k().isPaused())return!1;let r,o,s=!0;const a=t||{},l=!y[x]||!a.dedupe,u=()=>nu?!S.current&&x===C.current&&b.current:x===C.current,c={isValidating:!1,isLoading:!1},d=()=>{j(c)},h=()=>{const t=y[x];t&&t[1]===o&&delete y[x]},p={isValidating:!0};Bl(A().data)&&(p.isLoading=!0);try{if(l&&(j(p),n.loadingTimeout&&Bl(A().data)&&setTimeout(()=>{s&&u()&&k().onLoadingSlow(x,n)},n.loadingTimeout),y[x]=[e(w),pu()]),[r,o]=y[x],r=await r,l&&setTimeout(h,n.dedupingInterval),!y[x]||y[x][1]!==o)return l&&u()&&k().onDiscarded(x),!1;c.error=Il;const t=g[x];if(!Bl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&k().onDiscarded(x),!1;const a=A().data;c.data=i(a,r)?a:r,l&&u()&&k().onSuccess(r,x,n)}catch(t){h();const e=k(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,x,e),(!0===n||Ul(n)&&n(t))&&(k().revalidateOnFocus&&k().revalidateOnReconnect&&!T()||e.onErrorRetry(t,x,e,t=>{const e=f[x];e&&e[0]&&e[0](3,t)},{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0},[x,r]),J=(0,c.useCallback)((...t)=>mu(r,C.current,...t),[]);if(iu(()=>{E.current=e,P.current=n,Bl(_)||($.current=_)}),iu(()=>{if(!x)return;const t=Z.bind(Il,Du);let e=0;if(k().revalidateOnFocus){const t=Date.now();e=t+k().focusThrottleInterval}const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(x,f,(n,r={})=>{if(0==n){const n=Date.now();k().revalidateOnFocus&&n>e&&T()&&(e=n+k().focusThrottleInterval,t())}else if(1==n)k().revalidateOnReconnect&&T()&&t();else{if(2==n)return Z();if(3==n)return Z(r)}});return S.current=!1,C.current=x,b.current=!0,j({_k:w}),q&&(y[x]||(Bl(B)||ru?t():(t=>{Yl&&typeof window.requestAnimationFrame!=ql?window.requestAnimationFrame(t):setTimeout(t,1)})(t))),()=>{S.current=!0,n()}},[x]),iu(()=>{let t;function e(){const e=Ul(u)?u(A().data):u;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!k().isVisible()||!h&&!k().isOnline()?e():Z(Du).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}},[u,d,h,x]),(0,c.useDebugValue)(H),o){if(!nu&&ru&&W)throw new Error("Fallback data is required when using Suspense in SSR.");W&&(E.current=e,P.current=n,S.current=!1);const t=v[x],r=!Bl(t)&&W?J(t):Ou;if(ju(r),!Bl(U)&&W)throw U;const i=W?Z(Du):Ou;!Bl(H)&&W&&(i.status="fulfilled",i.value=!0),ju(i)}return{mutate:J,get data(){return M.data=!0,H},get error(){return M.error=!0,U},get isValidating(){return M.isValidating=!0,G},get isLoading(){return M.isLoading=!0,X}}},function(...t){const e=(()=>{const t=(0,c.useContext)(bu);return(0,c.useMemo)(()=>$l(xu,t),[t])})(),[n,r,i]=Pu(t),o=wu(e,i);let s=Ru;const{use:a}=o,l=(a||[]).concat(ku);for(let t=l.length;t--;)s=l[t](s);return s(n,r||o.fetcher||null,o)});var Ru;const Vu=()=>{},Lu=Vu(),Fu=Object,Nu=t=>t===Lu,Iu=new WeakMap,_u=(t,e)=>t===`[object ${e}]`;let Bu=0;const Uu=t=>{const e=typeof t,n=(r=t,Fu.prototype.toString.call(r));var r;const i=_u(n,"Date"),o=_u(n,"RegExp"),s=_u(n,"Object");let a,l;if(Fu(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=Iu.get(t),a)return a;if(a=++Bu+"~",Iu.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=Uu(t[l])+",";Iu.set(t,a)}if(s){a="#";const e=Fu.keys(t).sort();for(;!Nu(l=e.pop());)Nu(t[l])||(a+=l+":"+Uu(t[l])+",");Iu.set(t,a)}}return a},$u=Promise.resolve(),Hu=Tu(Mu,t=>(e,n,r)=>{const i=(0,c.useRef)(!1),{cache:o,initialSize:s=1,revalidateAll:a=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,p]=Fl.get(yu);let m;try{m=(t=>(t=>{if((t=>"function"==typeof t)(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Uu(t):"",e]})(t?t(0,null):null)[0])(e),m&&(m=Su+m)}catch(t){}const[f,g,y]=Zl(o,m),v=(0,c.useCallback)(()=>Bl(f()._l)?s:f()._l,[o,m,s]);(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>m?y(m,()=>{t()}):()=>{},[o,m]),v,v);const x=(0,c.useCallback)(()=>{const t=f()._l;return Bl(t)?s:t},[m,s]),w=(0,c.useRef)(x());iu(()=>{i.current?m&&g({_l:l?w.current:x()}):i.current=!0},[m,o]);const b=d&&!i.current,S=t(m,async t=>{const i=f()._i,s=f()._r;g({_r:Il});const l=[],c=x(),[d]=Zl(o,t),m=d().data,y=[];let v=null;for(let t=0;t<c;++t){const[c,d]=du(e(t,h?null:v));if(!c)break;const[f,g]=Zl(o,c);let x=f().data;const w=a||i||Bl(x)||u&&!t&&!Bl(m)||b||m&&!Bl(m[t])&&!r.compare(m[t],x);if(n&&("function"==typeof s?s(x,d):w)){const e=async()=>{if(c in p){const t=p[c];delete p[c],x=await t}else x=await n(d);g({data:x,_k:d}),l[t]=x};h?y.push(e):await e()}else l[t]=x;h||(v=x)}return h&&await Promise.all(y.map(t=>t())),g({_i:Il}),l},r),C=(0,c.useCallback)(function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return m?(r&&(Bl(t)?g({_i:!0,_r:n.revalidate}):g({_i:!1,_r:n.revalidate})),arguments.length?S.mutate(t,{...n,revalidate:r}):S.mutate()):$u},[m,o]),E=(0,c.useCallback)(t=>{if(!m)return $u;const[,n]=Zl(o,m);let r;if(Ul(t)?r=t(x()):"number"==typeof t&&(r=t),"number"!=typeof r)return $u;n({_l:r}),w.current=r;const i=[],[s]=Zl(o,m);let a=null;for(let t=0;t<r;++t){const[n]=du(e(t,a)),[r]=Zl(o,n),l=n?r().data:Il;if(Bl(l))return C(s().data);i.push(l),a=l}return C(i)},[m,o,C,x]);return{size:x(),setSize:E,mutate:C,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}}),Wu=t=>fetch(t).then(t=>t.json());var zu,qu;const Yu="/strakture/v1/library/settings",Gu={getItem:async()=>await a()({path:Yu}),setItem:async(t,e)=>await a()({path:Yu,method:"POST",data:{state:e}})},Xu={siteType:"",category:"",totalImports:0},Zu=l(window.straktureLibraryData?.siteInfo),Ju=null!==(zu=null!==(qu=Zu?.state?.siteType)&&void 0!==qu?qu:Zu?.siteType)&&void 0!==zu?zu:"",Ku=x(k(t=>{var e,n,r,i;return{...Xu,...null!==(e=Zu?.state)&&void 0!==e?e:{},siteType:(i=null!==(n=null!==(r=window.straktureSharedData?.siteType)&&void 0!==r?r:Ju)&&void 0!==n?n:"","string"==typeof i?i:""),setCategory:e=>t({category:e}),setSiteType:e=>t({siteType:e}),incrementImports:()=>t(t=>({totalImports:Number(t.totalImports)+1}))}},{name:"strakture_library_site_data",storage:E(()=>Gu),skipHydration:!0})),Qu=({onPatternClick:e,disabled:n})=>{const i=Ku(t=>t.category),o=i||"all",{data:s,isLoading:a,isValidating:l,setSize:u}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.straktureSharedData?.wpVersion,lang:window.straktureSharedData?.wpLanguage||null,showLocalizedCopy:window.straktureSharedData?.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}=Hu((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter(([,t])=>void 0!==t).forEach(([t,e])=>{r.append(t,e)}),`${Rl}/v1/patterns?${r.toString()}`},Wu,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}})({category:i}),[d,h]=(0,t.useState)(o),[p,m]=(0,t.useState)(!0),[f,g]=function({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:s,initialInView:a,fallbackInView:l,onChange:u}={}){var d;const[h,p]=c.useState(null),m=c.useRef(u),[f,g]=c.useState({inView:!!a,entry:void 0});m.current=u,c.useEffect(()=>{if(s||!h)return;let a;return a=fl(h,(t,e)=>{g({inView:t,entry:e}),m.current&&m.current(t,e),e.isIntersecting&&o&&a&&(a(),a=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{a&&a()}},[Array.isArray(t)?t.toString():t,h,i,r,o,s,n,l,e]);const y=null==(d=f.entry)?void 0:d.target,v=c.useRef(void 0);h||!y||o||s||v.current===y||(v.current=y,g({inView:!!a,entry:void 0}));const x=[p,f.inView,f.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}(),[y,v]=(0,t.useState)({}),{isSelected:x,updatePrompt:w,clearSelection:b}=Dl(),S=o!==d,C=(0,t.useCallback)((t,e)=>{v(n=>({...n,[t]:e})),x(t)&&w(t,e)},[x,w]);(0,t.useEffect)(()=>{b()},[i,b]);const E=(0,t.useCallback)((t,n)=>{e(t,n,y[t]||"")},[e,y]),P=s?.at(-1)?.length<9;return(0,t.useEffect)(()=>{if(a)return m(!0);const t=setTimeout(()=>{m(!1)},750);return()=>clearTimeout(t)},[a]),(0,t.useEffect)(()=>{g&&!a&&u(t=>t+1)},[g,a,u]),(0,t.useEffect)(()=>{a||l||h(o)},[a,l,o]),a||S||!s?.length?(0,M.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(bl,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"relative flex w-full gap-6 p-8 pt-2",children:s.map(t=>t.map(({id:t,code:e,patternReplacementCode:r})=>(0,M.jsx)(Ol,{patternId:t,onPatternClick:E,code:null!=r?r:e,disabled:n,prompt:y[t]||"",onPromptChange:C},t)))}),p?(0,M.jsxs)("div",{className:"absolute inset-0 z-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):null,p||P?null:(0,M.jsxs)("div",{ref:f,className:"mb-6 mt-6 flex w-full justify-center md:mt-2",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading more patterns...","strakture")})]})]})},tc=Tu(Mu,t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r))),ec=async()=>{const t=new URLSearchParams({wpVersion:window.straktureSharedData?.wpVersion||null,lang:window.straktureSharedData?.wpLanguage||null});return await fetch(`${Rl}/v1/patterns/categories?${t.toString()}`).then(t=>t.json())},nc=x(k(t=>({categories:[],setCategories:e=>t({categories:e})}),{name:`strakture-library-cache-${window.straktureSharedData?.siteId}`})),rc=()=>{const e=Ku(t=>t.category),n=Ku(t=>t.setCategory),{data:i,isLoading:o,errorCount:s}=(()=>{var e;const[n,r]=(0,t.useState)(0),i=null!==(e=window.straktureSharedData?.wpLanguage)&&void 0!==e?e:"en_US",{data:o,error:s,isLoading:a}=tc(`categories-${i}`,ec,{onError:()=>r(t=>t+1),onSuccess:()=>r(0)});return{data:o,errorCount:n>1?n:s?1:0,isLoading:a}})(),{categories:a,setCategories:l}=nc();return(0,t.useEffect)(()=>{o||s||l(i)},[i,o,l,s]),(0,t.useEffect)(()=>{const t=t=>document.querySelector(`#strakture-library-category-${t}`)?.focus();if(a?.length){if(e){if("all"===e)return t("all");if(a?.find(({slug:t})=>t===e))return t(e)}n("all"),t("all")}},[e,n,a]),(0,M.jsxs)("div",{className:"strakture-type-control",children:[(0,M.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Category","strakture")}),(0,M.jsx)(ic,{categories:a,errorCount:s,current:e,setCurrent:n})]})},ic=({categories:t,errorCount:e,current:n,setCurrent:i})=>{const o=t=>Pl()("text-sm w-full text-left rtl:text-right px-3 py-2 block rounded-md transition-colors",{"bg-design-light text-design-main font-medium":n===t,"bg-transparent text-gray-700 hover:bg-design-light hover:text-design-main":n!==t});return t?.length?(0,M.jsxs)("nav",{className:"w-full flex flex-col gap-0.5",children:[(0,M.jsx)("button",{type:"button",id:"strakture-library-category-all",onClick:()=>i("all"),className:o("all"),children:(0,r.__)("All","strakture")}),t.map(({slug:t,id:e,name:n})=>(0,M.jsx)("button",{type:"button",id:`strakture-library-category-${t}`,onClick:()=>i(t),className:o(t),children:n},e))]}):e>1?(0,M.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-2 py-4",children:[(0,M.jsx)("span",{className:"text-sm text-gray-600",children:(0,r.__)("Retrying...","strakture")}),(0,M.jsx)(dl.Spinner,{})]}):(0,M.jsxs)("div",{className:"flex w-full justify-center py-4",children:[(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Fetching...","strakture")}),(0,M.jsx)(dl.Spinner,{})]})},oc=x(S((t,e)=>{var n,r,i,o;return{remaining:Math.max(0,null!==(n=window.straktureSharedData?.credits?.remaining)&&void 0!==n?n:3),limit:null!==(r=window.straktureSharedData?.credits?.limit)&&void 0!==r?r:3,plan:null!==(i=window.straktureSharedData?.credits?.plan)&&void 0!==i?i:"free",resetDate:null!==(o=window.straktureSharedData?.credits?.resetDate)&&void 0!==o?o:null,isLoading:!1,updateCredits:n=>{var r,i,o,s,a;return t({remaining:Math.max(0,null!==(r=n.remaining)&&void 0!==r?r:e().remaining),limit:null!==(i=n.limit)&&void 0!==i?i:e().limit,plan:null!==(o=n.plan)&&void 0!==o?o:e().plan,resetDate:null!==(s=null!==(a=n.reset_date)&&void 0!==a?a:n.resetDate)&&void 0!==s?s:e().resetDate})},decrementCredit:()=>t(t=>({remaining:Math.max(0,t.remaining-1)})),decrementCredits:e=>t(t=>({remaining:Math.max(0,t.remaining-e)})),restoreCredits:e=>t({remaining:Math.max(0,e)}),hasCredits:()=>e().remaining>0,getFormattedResetDate:()=>{const t=e().resetDate;if(!t)return null;try{return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return null}},setLoading:e=>t({isLoading:e})}},{name:"Strakture Credits"})),sc=async(t,e)=>await a()({path:"/strakture/v1/library/settings/single",method:"POST",data:{key:t,value:e}}),ac=t=>{window.straktureSharedData&&(window.straktureSharedData.siteType=t)},lc=()=>{const e=Ku(t=>t.siteType),n=Ku(t=>t.setSiteType),{hasCredits:i}=oc(),[o,s]=(0,t.useState)(e||""),[a,l]=(0,t.useState)(!1),u=(0,t.useRef)(null),c=(0,t.useRef)(0),d=(0,t.useCallback)(async t=>{const e=c.current+1;c.current=e,l(!0),ac(t),n(t);try{const r=await sc("siteType",t);if(e!==c.current)return;ac(r),r!==t&&n(r)}catch(t){if(e!==c.current)return;console.error("Failed to save site type:",t)}finally{e===c.current&&l(!1)}},[n]),h=(0,t.useCallback)(()=>{u.current&&o!==e&&(clearTimeout(u.current),u.current=null,d(o))},[o,d,e]);return(0,t.useEffect)(()=>{u.current||s(e||"")},[e]),(0,t.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),i()?(0,M.jsxs)("div",{"data-tour-target":"site-type",className:"px-4",children:[(0,M.jsx)("label",{htmlFor:"strakture-site-type-input",className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Site Type","strakture")}),(0,M.jsx)("input",{id:"strakture-site-type-input",type:"text",value:o,onChange:t=>{const e=t.target.value;s(e),ac(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,d(e)},500)},onBlur:h,placeholder:(0,r.__)("e.g., Photography Portfolio, Restaurant","strakture"),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-700 placeholder-gray-400 focus:border-design-main focus:outline-none focus:ring-1 focus:ring-design-main"}),(0,M.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:a?(0,r.__)("Saving...","strakture"):(0,r.__)("Describe your site. Example: Restaurant, Photography Portfolio, etc.","strakture")})]}):null},uc=(0,M.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_101_491)",children:[(0,M.jsx)("path",{d:"M29.1262 0.0850517C29.4302 0.091618 29.5619 0.0992173 29.8084 0.291912C29.9788 0.524764 29.9874 0.649825 29.9725 0.931454C29.892 1.33877 29.6895 1.69948 29.5014 2.0654C28.9002 3.26768 28.3322 4.48618 27.7266 5.68631C27.6009 5.86381 27.4911 5.9299 27.2967 6.02649C27.099 6.0503 27.099 6.0503 26.8745 6.04885C21.3294 6.04533 15.7829 6.07902 10.2378 6.04812C9.3778 6.0438 8.69023 6.1758 8.01254 6.74591C6.66749 7.75395 6.6597 9.97523 7.69755 11.1949C8.29168 11.7569 8.97674 11.9939 9.77978 11.9963C13.165 12.0131 16.5505 12.0321 19.9357 12.033C25.4031 12.0356 29.9817 16.4427 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697798 29.9585C0.429173 29.9195 0.197807 29.9338 0.0659368 29.6026C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.83579 24.0689 3.19855 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31377 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C21.8725 18.0734 21.1851 18.0053 20.4733 18.0046C17.5342 17.9957 14.5951 17.9822 11.6559 17.9853C8.64305 17.9879 6.0684 17.5197 3.8283 15.327C-1.40558 10.0469 2.48562 0.307219 9.8165 0.0988723C16.2556 -0.0456274 22.688 0.113503 29.1262 0.0850517Z",fill:"#7851D4"}),(0,M.jsx)("path",{d:"M21.7253 18.1126C21.7105 18.0808 21.7322 18.0132 21.7322 18.0132L24.1366 12.9919C24.1366 12.9919 24.1437 12.9811 24.1494 12.9788C24.1551 12.9765 24.1664 12.9746 24.1751 12.9788C27.5361 14.5693 29.8055 18.0115 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697799 29.9585C0.429174 29.9195 0.197807 29.9338 0.0659368 29.6027C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.8358 24.0689 3.19856 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31378 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C22.2574 18.3336 22.0284 18.2306 21.7912 18.1592C21.7535 18.1478 21.7401 18.1443 21.7253 18.1126Z",fill:"url(#paint0_linear_101_491)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_101_491",x1:"-1.02465",y1:"29.9585",x2:"28.8244",y2:"17.6585",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_101_491",children:(0,M.jsx)("rect",{width:"30",height:"30",fill:"white"})})]})]}),cc=()=>(0,M.jsxs)("div",{className:"hidden flex-shrink-0 flex-col gap-6 md:flex md:w-80",children:[(0,M.jsx)("div",{className:"-mb-5 hidden px-5 py-3 text-strakture-black sm:flex sm:pt-5",children:(0,M.jsx)(o,{icon:uc,size:30})}),(0,M.jsxs)("div",{className:"flex flex-col gap-6 overflow-y-auto pb-16",children:[(0,M.jsx)(lc,{}),(0,M.jsx)("div",{id:"strakture-library-category-control","data-test":"category-control",className:"hidden flex-col overflow-x-hidden px-4 md:flex",children:(0,M.jsx)(rc,{})})]})]}),dc=({onClose:t})=>(0,M.jsx)("button",{className:"block h-6 w-6 bg-transparent p-px text-inherit outline-none focus:shadow-none focus:ring-wp focus:ring-design-main",type:"button",onClick:t,"data-test":"modal-close-button","aria-label":(0,r.__)("Close","strakture"),children:(0,M.jsx)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})})}),hc=({onClose:t,onBatchInsert:e})=>{const{getSelectedCount:n,canSelectMore:i}=Dl(),o=n(),s=!i(),a=window.straktureSharedData?.upgradeUrl;return(0,M.jsxs)("div",{"data-tour-target":"topbar",className:"mb-2 flex h-16 flex-shrink-0 items-center justify-between px-8",children:[(0,M.jsxs)("div",{className:"mt-4 flex items-center gap-4",children:[a&&(0,M.jsx)("a",{href:a,className:"text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline",children:(0,r.__)("Upgrade to Pro","strakture")}),o>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{type:"button",onClick:e,className:Pl()("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-all duration-150","bg-design-main text-white hover:opacity-90"),children:(0,M.jsx)("span",{children:(0,r.sprintf)((0,r.__)("Insert %d Pattern%s","strakture"),o,o>1?"s":"")})}),s&&(0,M.jsx)("span",{className:"text-xs text-gray-500",children:(0,r.__)("Maximum 10 patterns","strakture")})]})]}),(0,M.jsx)("div",{className:"mt-4",children:(0,M.jsx)(dc,{onClose:t})})]})},pc=async t=>{const{insertBlocks:n,replaceBlock:r}=(0,e.dispatch)("core/block-editor"),{getSelectedBlock:i,getBlockHierarchyRootClientId:o,getBlockIndex:s,getGlobalBlockCount:l,getBlockParents:u,getBlock:c,getBlocks:d}=(0,e.select)("core/block-editor"),h=(0,e.select)("core/preferences").get("core","renderingModes")||{},p=(0,e.select)("core").getCurrentTheme()?.stylesheet,m="template-locked"===h?.[p]?.page,{set:f}=(0,e.dispatch)("core/preferences"),g=t=>f("core","renderingModes",{...h,[p]:{...h[p]||{},page:t}});let{clientId:y,name:v,attributes:x}=i()||{};if(y&&m){const t=u(y).map(t=>c(t)).filter(Boolean),e=t.findIndex(t=>"core/post-content"===t?.name),n=s(-1!==e&&t[e+1]?.clientId||y);g("post-only"),await new Promise(t=>requestAnimationFrame(t));const r=d()[n];({clientId:y,name:v,attributes:x}=r||{})}const w=y?o(y):"",b=(w?s(w):l())+1,{missingCSSVars:S}=V.getState();S.forEach(t=>{document?.documentElement?.style?.setProperty(t,Tl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,Tl[t])}),S.length&&(async t=>{var e;const n=window.straktureSharedData?.globalStylesPostID,{styles:r,settings:i}=await a()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter(t=>!r?.css?.includes(`${t}:`))).length)return;const o=t.reduce((t,e)=>t+`${e}: ${Tl[e]};\n`,":root {\n")+"\n}";a()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:i,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+o}}})})(S);try{return m&&!y&&(g("post-only"),await new Promise(t=>requestAnimationFrame(t))),"core/paragraph"===v&&""===x?.content?.text?await r(y,t):await n(t,b)}finally{m&&g("template-locked")}},mc=[{id:"site-type",selector:'[data-tour-target="site-type"]',title:(0,r.__)("Enter your site type","strakture"),description:(0,r.__)("Tell us what kind of site you have — Restaurant, Medical, Photography, etc. This helps generate patterns that match your content.","strakture"),position:"right",offsetY:0,requiresCredits:!0,paidOnly:!1},{id:"pattern-grid",selector:"#strakture-library-patterns-list",title:(0,r.__)("Pick patterns to generate","strakture"),description:(0,r.__)("Browse the patterns and check the box on each one you want to add to your site.","strakture"),position:"left",requiresCredits:!1,paidOnly:!1},{id:"customize",selector:'[data-tour-target="customize-button"]',title:(0,r.__)("Add customization if needed","strakture"),description:(0,r.__)("Click Customize on any pattern to add specific instructions like layout changes, text, or call-to-action details.","strakture"),position:"top",requiresCredits:!0,paidOnly:!1},{id:"generate",selector:'[data-tour-target="topbar"]',title:(0,r.__)("Generate your patterns","strakture"),description:(0,r.__)("After selecting patterns, click the Generate button that appears here to create AI-customized versions for your site.","strakture"),position:"bottom",requiresCredits:!1,paidOnly:!1}],fc=288,gc=12,yc=(t,e,n=0)=>{if(!t)return{opacity:0};const r={position:"fixed",width:fc,zIndex:10001};switch(e){case"right":r.top=t.top+t.height/2+n,r.left=t.right+gc,r.transform="translateY(-50%)",r.left+fc>window.innerWidth-16&&(r.left=t.left-fc-gc);break;case"left":r.top=t.top+t.height/2+n,r.left=t.left-fc-gc,r.transform="translateY(-50%)",r.left<16&&(r.left=t.right+gc);break;case"bottom":r.top=t.bottom+gc+n,r.left=t.left+t.width/2-144;break;case"top":r.top=t.top-gc+n,r.left=t.left+t.width/2-144,r.transform="translateY(-100%)";break;default:r.top=t.bottom+gc+n,r.left=t.left}return r.left<16&&(r.left=16),r.left+fc>window.innerWidth-16&&(r.left=window.innerWidth-fc-16),r},vc=()=>{const{isActive:e,isWaiting:n,currentStep:i,currentStepIndex:o,totalSteps:s,targetRect:a,next:l,skip:u}=(()=>{var e;const{plan:n,hasCredits:r}=oc(),[i,o]=(0,t.useState)(!1),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(null),p=(0,t.useRef)(null),m=mc.filter(t=>!(t.paidOnly&&"free"===n||t.requiresCredits&&!r())),f=null!==(e=m[s])&&void 0!==e?e:null;(0,t.useEffect)(()=>{const t=window.straktureLibraryData?.onboardingCompleted;if(!t){const t=setTimeout(()=>o(!0),350);return()=>clearTimeout(t)}},[]),(0,t.useCallback)(()=>{if(!f)return;const t=document.querySelector(f.selector);t&&(u(t.getBoundingClientRect()),p.current=t)},[f]),(0,t.useEffect)(()=>{if(!i||!f)return;let t=!1;(async()=>{d(!0);const e=await((t,e=1e4)=>new Promise(n=>{const r=document.querySelector(t);if(r)return n(r);const i=new MutationObserver(()=>{const e=document.querySelector(t);e&&(i.disconnect(),n(e))});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),n(null)},e)}))(f.selector);if(t)return;if(!e)return d(!1),void(s<m.length-1?a(t=>t+1):g());if(await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))),t)return;u(e.getBoundingClientRect()),p.current=e,d(!1),h.current&&h.current.disconnect();const n=new ResizeObserver(()=>{t||u(e.getBoundingClientRect())});n.observe(e),h.current=n})();const e=()=>{p.current&&u(p.current.getBoundingClientRect())};window.addEventListener("resize",e);const n=document.getElementById("strakture-library-patterns-list");return n?.addEventListener("scroll",e),()=>{t=!0,window.removeEventListener("resize",e),n?.removeEventListener("scroll",e),h.current&&h.current.disconnect()}},[i,s,f?.selector]);const g=(0,t.useCallback)(()=>{o(!1),p.current=null,h.current&&h.current.disconnect(),sc("onboardingCompleted",!0).catch(console.warn)},[]),y=(0,t.useCallback)(()=>{s>=m.length-1?g():a(t=>t+1)},[s,m.length,g]),v=(0,t.useCallback)(()=>{g()},[g]);return{isActive:i,isWaiting:c,currentStep:f,currentStepIndex:s,totalSteps:m.length,targetRect:l,next:y,skip:v}})(),c=(0,t.useRef)(null);if((0,t.useEffect)(()=>{e&&!n&&c.current&&c.current.focus()},[e,n,o]),(0,t.useEffect)(()=>{if(!e)return;const t=t=>{"Escape"===t.key&&(t.stopPropagation(),u())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,u]),!e||!i)return null;const d=o===s-1,h=a&&!n;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:n?"none":"auto"},onClick:t=>{t.stopPropagation(),t.preventDefault()},"aria-hidden":"true"}),h&&(0,M.jsx)("div",{style:{position:"fixed",top:a.top-8,left:a.left-8,width:a.width+16,height:a.height+16,borderRadius:8,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)",zIndex:1e4,pointerEvents:"none"}}),h&&(0,M.jsxs)("div",{role:"dialog","aria-label":i.title,className:"rounded-lg bg-white p-5 shadow-xl",style:yc(a,i.position,i.offsetY),children:[(0,M.jsx)("h3",{className:"mb-1 text-sm font-semibold text-gray-900",children:i.title}),(0,M.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-gray-600",children:i.description}),(0,M.jsxs)("div",{className:"flex items-center justify-between",children:[(0,M.jsxs)("span",{className:"text-xs text-gray-400",children:[o+1," / ",s]}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("button",{type:"button",onClick:u,className:"rounded px-3 py-1.5 text-xs text-gray-500 hover:text-gray-700",children:(0,r.__)("Skip","strakture")}),(0,M.jsx)("button",{ref:c,type:"button",onClick:l,className:"rounded bg-design-main px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:d?(0,r.__)("Done","strakture"):(0,r.__)("Next","strakture")})]})]})]})]})},xc=()=>{const n=O(t=>t.incrementActivity),i=V(t=>t.open),o=V(t=>t.setOpen),s=Ku(t=>t.incrementImports),a=Dl(t=>t.getSelectedPatterns),l=Dl(t=>t.clearSelection),{createNotice:u}=(0,e.dispatch)("core/notices"),c=(0,t.useRef)(!1),d=()=>{l(),o(!1)};return(0,t.useLayoutEffect)(()=>{i||c.current||(c.current=!0,new URLSearchParams(window.location.search).has("strakture-open")&&(o(!0),n("library-search-param-auto-open")))},[o,n,i]),(0,t.useEffect)(()=>{const t=new URLSearchParams(window.location.search);t.has("strakture-close")&&(o(!1),t.delete("strakture-close"),window.history.replaceState({},"",window.location.pathname+"?"+t.toString()))},[o,n]),(0,t.useEffect)(()=>{const t=()=>o(!0),e=()=>o(!1);return window.addEventListener("strakture::open-library",t),window.addEventListener("strakture::close-library",e),()=>{window.removeEventListener("strakture::open-library",t),window.removeEventListener("strakture::close-library",e)}},[o,i]),(0,t.useEffect)(()=>{if(!i)return;const t=(0,e.select)("core/edit-post");t&&t.isFeatureActive("welcomeGuide")&&(0,e.dispatch)("core/edit-post").toggleFeature("welcomeGuide")},[i]),i?(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(Oe,{className:"strakture-library strakture-library-modal",open:i,static:!0,onClose:()=>{},children:(0,M.jsxs)("div",{className:"absolute mx-auto h-full w-full md:p-8",children:[(0,M.jsx)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,M.jsxs)(cl.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"relative mx-auto h-full w-full max-w-screen-3xl bg-white rounded-lg shadow-2xl sm:flex sm:overflow-hidden",children:[(0,M.jsx)(Oe.Title,{className:"sr-only",children:(0,r.__)("Design Patterns","strakture")}),(0,M.jsx)(cc,{}),(0,M.jsxs)("div",{className:"relative flex w-full flex-col bg-[#FAFAFA]",children:[(0,M.jsx)(hc,{onClose:d,onBatchInsert:async()=>{const t=a(),e=t.length;if(0===e)return;const n=[];for(const e of t)e.blocks?.length>0&&n.push(...e.blocks);n.length>0&&(await pc(n),s()),l(),o(!1);const i=window.straktureSharedData?.upgradeUrl;u("info",(0,r.sprintf)((0,r.__)("%d patterns added. Upgrade to Pro to generate AI patterns.","strakture"),e),{isDismissible:!0,type:"snackbar",actions:i?[{label:(0,r.__)("Upgrade","strakture"),url:i}]:[]})}}),(0,M.jsx)("div",{id:"strakture-library-patterns-list",className:"relative flex-grow overflow-y-auto",children:(0,M.jsx)(Qu,{onPatternClick:async(t,e)=>{await pc(e),s(),d();const n=window.straktureSharedData?.upgradeUrl;u("info",(0,r.__)("Pattern added. Upgrade to Pro to generate AI patterns.","strakture"),{isDismissible:!0,type:"snackbar",actions:n?[{label:(0,r.__)("Upgrade","strakture"),url:n}]:[]})},disabled:!1})})]})]},"library-modal"),(0,M.jsx)(vc,{})]})})}):null};(0,e.subscribe)(()=>{(()=>{if("function"!=typeof t.createRoot)return;const e="strakture-library-btn",r="strakture-library";if(document.getElementById(e))return;const i=document.querySelector(".edit-post-header-toolbar");if(!i)return;const o=document.createElement("div"),s=Object.assign(o,{id:e,className:r});i.append(s),n((0,M.jsx)(L,{}),s);const a="strakture-library-modal";if(!document.getElementById(a)){const t=document.createElement("div"),e=Object.assign(t,{id:a,className:r});document.body.append(e),n((0,M.jsx)(xc,{}),e)}})()})})()})(); -
strakture/tags/1.1.5/public/build/strakture-onboarding.asset.php
r3499596 r3509467 1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' c83d00345af326dfce24');1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '0fbff186f44d7eeb5346'); -
strakture/tags/1.1.5/public/build/strakture-onboarding.js
r3485642 r3509467 1 (()=>{"use strict";var e={359(e,t,a){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(a(609)),c=o(a(685)),d={resize:!0,useWorker:!1},u={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0};function h(e,t){return e||t?e:u}t.default=function(e){var t=e.style,a=e.className,n=e.width,s=e.height,i=e.globalOptions,o=e.onInit,u=(0,l.useRef)(null),f=(0,l.useRef)(null);return(0,l.useEffect)(function(){if(u.current)return f.current=c.default.create(u.current,r(r({},d),i)),null==o||o({confetti:f.current}),function(){var e;null===(e=f.current)||void 0===e||e.reset()}},[]),l.default.createElement("canvas",{ref:u,style:h(t,a),className:a,width:n,height:s})}},609(e){e.exports=window.React},685(e,t,a){a.r(t),a.d(t,{create:()=>s,default:()=>n});var r={};!function e(t,a,r,n){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix,o=function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var r=e.transferToImageBitmap();a.createPattern(r,"no-repeat")}catch(e){return!1}return!0}();function l(){}function c(e){var r=a.exports.Promise,n=void 0!==r?r:t.Promise;return"function"==typeof n?new n(e):(e(l,l),null)}var d,u,h,f, g,p,_,m,b,v,x,w=(d=o,u=new Map,{transform:function(e){if(d)return e;if(u.has(e))return u.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),u.set(e,t),t},clear:function(){u.clear()}}),k=(g=Math.floor(1e3/60),p={},_=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(h=function(e){var t=Math.random();return p[t]=requestAnimationFrame(function a(r){_===r||_+g-1<r?(_=r,delete p[t],e()):p[t]=requestAnimationFrame(a)}),t},f=function(e){p[e]&&cancelAnimationFrame(p[e])}):(h=function(e){return setTimeout(e,g)},f=function(e){return clearTimeout(e)}),{frame:h,cancel:f}),y=(v={},function(){if(m)return m;if(!r&&s){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(a,r,n){if(b)return t(a,null),b;var s=Math.random().toString(36).slice(2);return b=c(function(r){function i(t){t.data.callback===s&&(delete v[s],e.removeEventListener("message",i),b=null,w.clear(),n(),r())}e.addEventListener("message",i),t(a,s),v[s]=i.bind(null,{data:{callback:s}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),j={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function M(e,t,a){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:j[t],a)}function S(e){return e<0?0:Math.floor(e)}function N(e,t){return Math.floor(Math.random()*(t-e))+e}function C(e){return parseInt(e,16)}function P(e){return e.map(O)}function O(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:C(t.substring(0,2)),g:C(t.substring(2,4)),b:C(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function T(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function z(e){var t=e.angle*(Math.PI/180),a=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*a-Math.random()*a),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function I(e,a){var o,l=!e,d=!!M(a||{},"resize"),u=!1,h=M(a,"disableForReducedMotion",Boolean),f=s&&M(a||{},"useWorker")?y():null,g=l?B:T,p=!(!e||!f||!e.__confetti_initialized),_="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function m(t,a,s){for(var l=M(t,"particleCount",S),d=M(t,"angle",Number),u=M(t,"spread",Number),h=M(t,"startVelocity",Number),f=M(t,"decay",Number),p=M(t,"gravity",Number),_=M(t,"drift",Number),m=M(t,"colors",P),b=M(t,"ticks",Number),v=M(t,"shapes"),x=M(t,"scalar"),y=!!M(t,"flat"),j=function(e){var t=M(e,"origin",Object);return t.x=M(t,"x",Number),t.y=M(t,"y",Number),t}(t),C=l,O=[],B=e.width*j.x,T=e.height*j.y;C--;)O.push(z({x:B,y:T,angle:d,spread:u,startVelocity:h,color:m[C%m.length],shape:v[N(0,v.length)],ticks:b,decay:f,gravity:p,drift:_,scalar:x,flat:y}));return o?o.addFettis(O):(o=function(e,t,a,s,o){var l,d,u=t.slice(),h=e.getContext("2d"),f=c(function(t){function c(){l=d=null,h.clearRect(0,0,s.width,s.height),w.clear(),o(),t()}l=k.frame(function t(){!r||s.width===n.width&&s.height===n.height||(s.width=e.width=n.width,s.height=e.height=n.height),s.width||s.height||(a(e),s.width=e.width,s.height=e.height),h.clearRect(0,0,s.width,s.height),(u=u.filter(function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,n=t.y+t.random*t.tiltSin,s=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,r,n,s,i){var o=new Path2D(e),l=new Path2D;l.addPath(o,new DOMMatrix(t));var c=new Path2D;return c.addPath(l,new DOMMatrix([Math.cos(i)*n,Math.sin(i)*n,-Math.sin(i)*s,Math.cos(i)*s,a,r])),c}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(s-r),.1*Math.abs(o-n),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var l=Math.PI/10*t.wobble,c=.1*Math.abs(s-r),d=.1*Math.abs(o-n),u=t.shape.bitmap.width*t.scalar,h=t.shape.bitmap.height*t.scalar,f=new DOMMatrix([Math.cos(l)*c,Math.sin(l)*c,-Math.sin(l)*d,Math.cos(l)*d,t.x,t.y]);f.multiplySelf(new DOMMatrix(t.shape.matrix));var g=e.createPattern(w.transform(t.shape.bitmap),"no-repeat");g.setTransform(f),e.globalAlpha=1-a,e.fillStyle=g,e.fillRect(t.x-u/2,t.y-h/2,u,h),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,r,n,s,i,o){e.save(),e.translate(t,a),e.rotate(s),e.scale(r,n),e.arc(0,0,1,0,o,void 0),e.restore()}(e,t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var p=Math.PI/2*3,_=4*t.scalar,m=8*t.scalar,b=t.x,v=t.y,x=5,k=Math.PI/x;x--;)b=t.x+Math.cos(p)*m,v=t.y+Math.sin(p)*m,e.lineTo(b,v),p+=k,b=t.x+Math.cos(p)*_,v=t.y+Math.sin(p)*_,e.lineTo(b,v),p+=k;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(n)),e.lineTo(Math.floor(s),Math.floor(o)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}(h,e)})).length?l=k.frame(t):c()}),d=c});return{addFettis:function(e){return u=u.concat(e),f},canvas:e,promise:f,reset:function(){l&&k.cancel(l),d&&d()}}}(e,O,g,a,s),o.promise)}function b(a){var r=h||M(a,"disableForReducedMotion",Boolean),n=M(a,"zIndex",Number);if(r&&_)return c(function(e){e()});l&&o?e=o.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(n),document.body.appendChild(e)),d&&!p&&g(e);var s={width:e.width,height:e.height};function i(){if(f){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return g(t),void f.postMessage({resize:{width:t.width,height:t.height}})}s.width=s.height=null}function b(){o=null,d&&(u=!1,t.removeEventListener("resize",i)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,p=!1)}return f&&!p&&f.init(e),p=!0,f&&(e.__confetti_initialized=!0),d&&!u&&(u=!0,t.addEventListener("resize",i,!1)),f?f.fire(a,s,b):m(a,s,b)}return b.reset=function(){f&&f.reset(),o&&o.reset()},b}function E(){return x||(x=I(null,{useWorker:!0,resize:!0})),x}a.exports=function(){return E().apply(this,arguments)},a.exports.reset=function(){E().reset()},a.exports.create=I,a.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,a;"string"==typeof e?t=e:(t=e.path,a=e.matrix);var r=new Path2D(t),n=document.createElement("canvas").getContext("2d");if(!a){for(var s,o,l=1e3,c=l,d=l,u=0,h=0,f=0;f<l;f+=2)for(var g=0;g<l;g+=2)n.isPointInPath(r,f,g,"nonzero")&&(c=Math.min(c,f),d=Math.min(d,g),u=Math.max(u,f),h=Math.max(h,g));s=u-c,o=h-d;var p=Math.min(10/s,10/o);a=[p,0,0,p,-Math.round(s/2+c)*p,-Math.round(o/2+d)*p]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,r="#000000",n='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,n="fontFamily"in e?e.fontFamily:n,r="color"in e?e.color:r);var s=10*a,i=s+"px "+n,o=new OffscreenCanvas(s,s),l=o.getContext("2d");l.font=i;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),u=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),h=c.actualBoundingBoxLeft+2,f=c.actualBoundingBoxAscent+2;d+=4,u+=4,(l=(o=new OffscreenCanvas(d,u)).getContext("2d")).font=i,l.fillStyle=r,l.fillText(t,h,f);var g=1/a;return{type:"bitmap",bitmap:o.transferToImageBitmap(),matrix:[g,0,0,g,-d*g/2,-u*g/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),r,!1);const n=r.exports;var s=r.exports.create}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,a),s.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const r=window.wp.element,n=window.wp.apiFetch;var s=a.n(n);const i=window.ReactJSXRuntime,o=(0,r.createContext)(),l=window.straktureOnboardingData||{},c={site_title:l.siteTitle||"",site_tagline:l.siteTagline||"",site_type:l.siteType||"",color_palette:"default",color_palette_file:"",typography_preset:"default",typography_preset_file:"",...l.savedSettings};function d({children:e}){const[t,a]=(0,r.useState)(c),[n,l]=(0,r.useState)(0),[d,u]=(0,r.useState)(!1),h=(0,r.useCallback)((e,t)=>{a(a=>({...a,[e]:t}))},[]),f=(0,r.useCallback)(async(e={})=>{u(!0);const r={...t,...e};try{await s()({path:"/strakture/v1/onboarding/settings",method:"POST",data:r}),a(r)}finally{u(!1)}},[t]),g=(0,r.useCallback)(async()=>{await s()({path:"/strakture/v1/onboarding/complete",method:"POST"})},[]);return(0,i.jsx)(o.Provider,{value:{settings:t,currentStep:n,setCurrentStep:l,isSaving:d,updateSetting:h,saveSettings:f,completeOnboarding:g},children:e})}function u(){return(0,r.useContext)(o)}const h=window.wp.i18n,f=window.wp.primitives;var g=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),p=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),_=(0,i.jsx)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),m=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})}),b=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),v=(0,r.forwardRef)(({icon:e,size:t=24,...a},n)=>(0,r.cloneElement)(e,{width:t,height:t,...a,ref:n})),x=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const w=window.straktureOnboardingData||{},k=[{label:(0,h.__)("Dashboard","strakture"),index:0,icon:g},{label:(0,h.__)("Site Settings","strakture"),index:1,icon:p},{label:(0,h.__)("Colors","strakture"),index:2,icon:_},{label:(0,h.__)("Typography","strakture"),index:3,icon:m}],y=w.isPaying?[...k,{label:(0,h.__)("Starter Sites","strakture"),index:4,icon:b}]:k;function j(){const{currentStep:e,setCurrentStep:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__sidebar",children:[(0,i.jsx)("div",{className:"strakture-onboarding__sidebar-top",children:(0,i.jsx)("div",{className:"strakture-onboarding__back-to-dash",children:(0,i.jsxs)("a",{href:w.adminUrl,children:[(0,i.jsx)(v,{icon:x,size:28}),(0,i.jsx)("span",{children:(0,h.__)("Back to admin","strakture")})]})})}),(0,i.jsx)("ul",{className:"strakture-onboarding__steps",children:y.map(a=>{let r="strakture-onboarding__step";return a.index===e&&(r+=" is-active"),(0,i.jsxs)("li",{className:r,onClick:()=>t(a.index),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(a.index))},children:[(0,i.jsx)(v,{icon:a.icon,size:20}),a.label]},a.index)})})]})}const M=window.wp.components;var S=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});const N=window.straktureOnboardingData||{};function C(){const{setCurrentStep:e}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__dashboard",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav-left",children:[(0,i.jsx)("img",{src:N.logoDarkUrl,alt:(0,h.__)("Strakture","strakture"),className:"strakture-onboarding__dash-nav-logo"}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-version",children:N.version})]}),(0,i.jsxs)("nav",{className:"strakture-onboarding__dash-nav-right",children:[(0,i.jsx)("a",{href:"https://strakture.com",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Website","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://www.youtube.com/@alexandersamokhin",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("YouTube","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:N.adminUrl+"admin.php?page=strakture-contact",children:(0,h.__)("Support","strakture")})]})]}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-hero",children:(0,i.jsxs)("div",{className:"strakture-onboarding__dash-hero-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Welcome to Strakture","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Generate AI-powered patterns that match your theme's design system. Get started by configuring your site with the setup wizard below.","strakture")}),(0,i.jsxs)(M.Button,{variant:"primary",onClick:()=>e(1),children:[(0,h.__)("Start Setup","strakture"),(0,i.jsx)(v,{icon:S,size:20})]})]})}),!N.isPaying&&(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-upgrade",children:[(0,i.jsx)("h2",{children:(0,h.__)("Upgrade to Pro","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Take your site to the next level with AI-powered design and premium features.","strakture")}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,h.__)("AI-generated patterns tailored to your website","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Responsive Controls","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium WordPress theme included","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Full WooCommerce integration","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium block patterns","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Priority support","strakture")})]}),(0,i.jsx)(M.Button,{className:"strakture-onboarding__upgrade-btn",variant:"primary",href:N.upgradeUrl,children:(0,h.__)("Upgrade to Pro","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-section--alt",children:[(0,i.jsx)("h2",{children:(0,h.__)("Watch Video Tutorial","strakture")}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-video",children:(0,i.jsxs)("a",{href:"https://www.youtube.com/watch?v=apyhf08-11A",target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__dash-video-link",children:[(0,i.jsx)("img",{src:N.pluginUrl+"public/img/video-thumb.jpg",alt:(0,h.__)("Getting Started with Strakture","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-video-play",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 48",width:"68",height:"48",children:[(0,i.jsx)("path",{d:"M66.52 7.74A8.52 8.52 0 0 0 60.71 1.9C55.4 0 34 0 34 0S12.6 0 7.29 1.9A8.52 8.52 0 0 0 1.48 7.74C0 13.08 0 24 0 24s0 10.92 1.48 16.26a8.52 8.52 0 0 0 5.81 5.84C12.6 48 34 48 34 48s21.4 0 26.71-1.9a8.52 8.52 0 0 0 5.81-5.84C68 34.92 68 24 68 24s0-10.92-1.48-16.26z",fill:"#ff0000"}),(0,i.jsx)("path",{d:"M27 34l18-10-18-10v20z",fill:"#fff"})]})})]})})]})]})}const P=(window.straktureOnboardingData||{}).isPaying?4:3;function O(){const{currentStep:e,setCurrentStep:t,saveSettings:a,isSaving:r}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__nav",children:[(0,i.jsx)("button",{className:"strakture-onboarding__back-btn",onClick:()=>{t(e-1)},children:(0,h.__)("Go Back","strakture")}),(0,i.jsx)(M.Button,{variant:"primary",onClick:async()=>{await a(),t(e+1)},isBusy:r,disabled:r,children:r?(0,h.__)("Saving...","strakture"):e>=P?(0,h.__)("Save and Finish","strakture"):(0,h.__)("Next","strakture")})]})}function B(){const{settings:e,updateSetting:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__site-settings",children:[(0,i.jsx)("h2",{children:(0,h.__)("Site Settings","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Configure the basic information about your website.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__fields",children:[(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Title","strakture"),value:e.site_title,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_title",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Tagline","strakture"),value:e.site_tagline,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_tagline",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Type","strakture"),value:e.site_type,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_type",e),placeholder:(0,h.__)("e.g., Photography Portfolio, Restaurant","strakture"),help:(0,h.__)("Describe your site. This helps generate better AI patterns.","strakture")})]}),(0,i.jsx)(O,{})]})}const T=window.ReactDOM,z=window.straktureOnboardingData||{};function I({refreshKey:e=0}){const t=(0,r.useRef)(null),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)({}),[l,c]=(0,r.useState)(!1),d=`${z.homeUrl}?strakture_preview=${e}`;return(0,r.useLayoutEffect)(()=>{const e=()=>{if(!t.current||!a)return;const e=a.clientWidth/1600;o({width:1600,height:a.clientHeight/e,transform:`scale(${e})`,transformOrigin:"top left"})};e();const r=new ResizeObserver(()=>{(0,T.flushSync)(()=>{e()})});return a&&r.observe(a),()=>r.disconnect()},[a]),(0,r.useLayoutEffect)(()=>{c(!1)},[e]),(0,i.jsxs)("div",{className:"strakture-onboarding__preview",children:[(0,i.jsx)("div",{className:"strakture-onboarding__preview-browser",children:(0,i.jsxs)("div",{className:"strakture-onboarding__preview-dots",children:[(0,i.jsx)("span",{}),(0,i.jsx)("span",{}),(0,i.jsx)("span",{})]})}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-container",ref:n,children:(0,i.jsx)("iframe",{title:"Site Preview",style:s,className:"strakture-onboarding__preview-iframe"+(l?" is-loaded":""),onLoad:()=>c(!0),src:d,ref:t})})]})}const E=(window.straktureOnboardingData||{}).colorPalettes||[],D=["primary","secondary","headings","background"];function R(e){const t={};return e.forEach(e=>{t[e.slug]=e}),D.map(e=>t[e]).filter(Boolean)}function A(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={color_palette:e.id,color_palette_file:e.file||""};t("color_palette",e.id),t("color_palette_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__colors",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Color Palette","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a color palette for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__palette-list",children:[E.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__palette-card"+(e.color_palette===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__palette-title",children:t.title}),(0,i.jsx)("span",{className:"strakture-onboarding__palette-colors",children:R(t.colors).map((e,t)=>(0,i.jsx)(M.ColorIndicator,{colorValue:e.color},t))})]},t.id)),0===E.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No color palettes found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}const F=(window.straktureOnboardingData||{}).fontPresets||[];function V(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={typography_preset:e.id,typography_preset_file:e.file||""};t("typography_preset",e.id),t("typography_preset_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__typography",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Typography","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a font combination for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__font-list",children:[F.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__font-card"+(e.typography_preset===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-preview",children:"Aa"}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-info",children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-title",children:t.title}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-names",children:[t.headingFont,t.bodyFont&&t.bodyFont!==t.headingFont?` / ${t.bodyFont}`:""]})]})]},t.id)),0===F.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No font presets found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}var L=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const U=window.straktureOnboardingData||{},H=U.starterSites||[];var G=a(359),W=a.n(G);const Z=window.straktureOnboardingData||{},Y={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0,zIndex:999};function q(){const{completeOnboarding:e}=u();(0,r.useEffect)(()=>{e()},[e]);const t=(0,r.useCallback)(({confetti:e})=>{e({particleCount:150,spread:80,origin:{y:.6}})},[]);return(0,i.jsxs)("div",{className:"strakture-onboarding__finish",children:[(0,i.jsx)(W(),{onInit:t,style:Y}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Setup Complete!","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Your site is configured and ready to go. Start editing your homepage or view your site to see the changes.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-actions",children:[(0,i.jsx)(M.Button,{variant:"primary",href:Z.homeUrl,target:"_blank",children:(0,h.__)("View Your Site","strakture")}),(0,i.jsx)(M.Button,{variant:"secondary",href:Z.adminUrl+"site-editor.php?p=%2Ftemplate",children:(0,h.__)("Start Editing","strakture")})]})]})]})}const X=(window.straktureOnboardingData||{}).isPaying?[C,B,A,V,function(){const[e,t]=(0,r.useState)(H),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),l=(0,r.useCallback)(async(e,t)=>{const a=new FormData;return a.append("action",e),a.append("wpnonce",U.starterSitesNonce),a.append("slug",t),(await fetch(U.ajaxUrl,{method:"POST",body:a})).json()},[]),c=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_activate_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,status:r.data.status,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]),d=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_update_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]);return(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites-header",children:[(0,i.jsx)("h2",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a starter site to import. You can customize everything after the import.","strakture")})]}),s&&(0,i.jsx)("div",{className:`strakture-onboarding__starter-sites-notice is-${s.type}`,children:s.message}),(0,i.jsx)("div",{className:"strakture-onboarding__demos-grid",children:e.map((e,t)=>{const r=((e,t)=>{const r=a===e.slug;switch(e.status){case"active":return{label:(0,h.__)("Import","strakture"),href:e.merlin_url,onClick:null,icon:L,isBusy:!1};case"installed":return{label:r?(0,h.__)("Activating...","strakture"):(0,h.__)("Activate","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r};default:return{label:r?(0,h.__)("Installing...","strakture"):(0,h.__)("Install","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r}}})(e,t),n=a===e.slug;return(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card",children:[e.needsUpdate&&(0,i.jsx)("div",{className:"strakture-onboarding__demo-card-update",children:(0,i.jsx)(M.Button,{variant:"link",onClick:()=>d(e,t),disabled:null!==a,isBusy:n,className:"strakture-onboarding__demo-card-update-btn",children:n?(0,h.__)("Updating...","strakture"):(0,h.__)("Update Available — Update Now","strakture")})}),(0,i.jsxs)("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__demo-card-image-link",children:[(0,i.jsx)("img",{src:e.import_preview_image_url,alt:e.import_file_name,className:"strakture-onboarding__demo-card-image"}),(0,i.jsx)("span",{className:"strakture-onboarding__demo-card-badge",children:(0,h.__)("Live Preview","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card-body",children:[(0,i.jsx)("h3",{className:"strakture-onboarding__demo-card-title",children:e.import_file_name}),(0,i.jsx)(M.Button,{variant:"primary",icon:r.icon,href:r.href,onClick:r.onClick,isBusy:r.isBusy,disabled:null!==a,className:"strakture-onboarding__demo-card-btn",children:r.label})]})]},t)})})]})},q]:[C,B,A,V,q];function $(){const{currentStep:e}=u(),t=X[e];return(0,i.jsx)("div",{className:"strakture-onboarding",children:(0,i.jsxs)("div",{className:"strakture-onboarding__layout",children:[(0,i.jsx)(j,{}),(0,i.jsx)("div",{className:"strakture-onboarding__main",children:(0,i.jsx)("div",{className:"strakture-onboarding__content",children:(0,i.jsx)(t,{})})})]})})}const K=document.getElementById("strakture-onboarding");K&&(0,r.createRoot)(K).render((0,i.jsx)(d,{children:(0,i.jsx)($,{})}))})();1 (()=>{"use strict";var e={359(e,t,a){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(a(609)),c=o(a(685)),d={resize:!0,useWorker:!1},u={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0};function h(e,t){return e||t?e:u}t.default=function(e){var t=e.style,a=e.className,n=e.width,s=e.height,i=e.globalOptions,o=e.onInit,u=(0,l.useRef)(null),f=(0,l.useRef)(null);return(0,l.useEffect)(function(){if(u.current)return f.current=c.default.create(u.current,r(r({},d),i)),null==o||o({confetti:f.current}),function(){var e;null===(e=f.current)||void 0===e||e.reset()}},[]),l.default.createElement("canvas",{ref:u,style:h(t,a),className:a,width:n,height:s})}},609(e){e.exports=window.React},685(e,t,a){a.r(t),a.d(t,{create:()=>s,default:()=>n});var r={};!function e(t,a,r,n){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix,o=function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var r=e.transferToImageBitmap();a.createPattern(r,"no-repeat")}catch(e){return!1}return!0}();function l(){}function c(e){var r=a.exports.Promise,n=void 0!==r?r:t.Promise;return"function"==typeof n?new n(e):(e(l,l),null)}var d,u,h,f,p,g,_,m,b,v,x,w=(d=o,u=new Map,{transform:function(e){if(d)return e;if(u.has(e))return u.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),u.set(e,t),t},clear:function(){u.clear()}}),k=(p=Math.floor(1e3/60),g={},_=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(h=function(e){var t=Math.random();return g[t]=requestAnimationFrame(function a(r){_===r||_+p-1<r?(_=r,delete g[t],e()):g[t]=requestAnimationFrame(a)}),t},f=function(e){g[e]&&cancelAnimationFrame(g[e])}):(h=function(e){return setTimeout(e,p)},f=function(e){return clearTimeout(e)}),{frame:h,cancel:f}),y=(v={},function(){if(m)return m;if(!r&&s){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(a,r,n){if(b)return t(a,null),b;var s=Math.random().toString(36).slice(2);return b=c(function(r){function i(t){t.data.callback===s&&(delete v[s],e.removeEventListener("message",i),b=null,w.clear(),n(),r())}e.addEventListener("message",i),t(a,s),v[s]=i.bind(null,{data:{callback:s}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),j={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function M(e,t,a){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:j[t],a)}function S(e){return e<0?0:Math.floor(e)}function N(e,t){return Math.floor(Math.random()*(t-e))+e}function C(e){return parseInt(e,16)}function P(e){return e.map(O)}function O(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:C(t.substring(0,2)),g:C(t.substring(2,4)),b:C(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function T(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function z(e){var t=e.angle*(Math.PI/180),a=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*a-Math.random()*a),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function I(e,a){var o,l=!e,d=!!M(a||{},"resize"),u=!1,h=M(a,"disableForReducedMotion",Boolean),f=s&&M(a||{},"useWorker")?y():null,p=l?B:T,g=!(!e||!f||!e.__confetti_initialized),_="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function m(t,a,s){for(var l=M(t,"particleCount",S),d=M(t,"angle",Number),u=M(t,"spread",Number),h=M(t,"startVelocity",Number),f=M(t,"decay",Number),g=M(t,"gravity",Number),_=M(t,"drift",Number),m=M(t,"colors",P),b=M(t,"ticks",Number),v=M(t,"shapes"),x=M(t,"scalar"),y=!!M(t,"flat"),j=function(e){var t=M(e,"origin",Object);return t.x=M(t,"x",Number),t.y=M(t,"y",Number),t}(t),C=l,O=[],B=e.width*j.x,T=e.height*j.y;C--;)O.push(z({x:B,y:T,angle:d,spread:u,startVelocity:h,color:m[C%m.length],shape:v[N(0,v.length)],ticks:b,decay:f,gravity:g,drift:_,scalar:x,flat:y}));return o?o.addFettis(O):(o=function(e,t,a,s,o){var l,d,u=t.slice(),h=e.getContext("2d"),f=c(function(t){function c(){l=d=null,h.clearRect(0,0,s.width,s.height),w.clear(),o(),t()}l=k.frame(function t(){!r||s.width===n.width&&s.height===n.height||(s.width=e.width=n.width,s.height=e.height=n.height),s.width||s.height||(a(e),s.width=e.width,s.height=e.height),h.clearRect(0,0,s.width,s.height),(u=u.filter(function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,n=t.y+t.random*t.tiltSin,s=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,r,n,s,i){var o=new Path2D(e),l=new Path2D;l.addPath(o,new DOMMatrix(t));var c=new Path2D;return c.addPath(l,new DOMMatrix([Math.cos(i)*n,Math.sin(i)*n,-Math.sin(i)*s,Math.cos(i)*s,a,r])),c}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(s-r),.1*Math.abs(o-n),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var l=Math.PI/10*t.wobble,c=.1*Math.abs(s-r),d=.1*Math.abs(o-n),u=t.shape.bitmap.width*t.scalar,h=t.shape.bitmap.height*t.scalar,f=new DOMMatrix([Math.cos(l)*c,Math.sin(l)*c,-Math.sin(l)*d,Math.cos(l)*d,t.x,t.y]);f.multiplySelf(new DOMMatrix(t.shape.matrix));var p=e.createPattern(w.transform(t.shape.bitmap),"no-repeat");p.setTransform(f),e.globalAlpha=1-a,e.fillStyle=p,e.fillRect(t.x-u/2,t.y-h/2,u,h),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,r,n,s,i,o){e.save(),e.translate(t,a),e.rotate(s),e.scale(r,n),e.arc(0,0,1,0,o,void 0),e.restore()}(e,t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var g=Math.PI/2*3,_=4*t.scalar,m=8*t.scalar,b=t.x,v=t.y,x=5,k=Math.PI/x;x--;)b=t.x+Math.cos(g)*m,v=t.y+Math.sin(g)*m,e.lineTo(b,v),g+=k,b=t.x+Math.cos(g)*_,v=t.y+Math.sin(g)*_,e.lineTo(b,v),g+=k;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(n)),e.lineTo(Math.floor(s),Math.floor(o)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}(h,e)})).length?l=k.frame(t):c()}),d=c});return{addFettis:function(e){return u=u.concat(e),f},canvas:e,promise:f,reset:function(){l&&k.cancel(l),d&&d()}}}(e,O,p,a,s),o.promise)}function b(a){var r=h||M(a,"disableForReducedMotion",Boolean),n=M(a,"zIndex",Number);if(r&&_)return c(function(e){e()});l&&o?e=o.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(n),document.body.appendChild(e)),d&&!g&&p(e);var s={width:e.width,height:e.height};function i(){if(f){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return p(t),void f.postMessage({resize:{width:t.width,height:t.height}})}s.width=s.height=null}function b(){o=null,d&&(u=!1,t.removeEventListener("resize",i)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,g=!1)}return f&&!g&&f.init(e),g=!0,f&&(e.__confetti_initialized=!0),d&&!u&&(u=!0,t.addEventListener("resize",i,!1)),f?f.fire(a,s,b):m(a,s,b)}return b.reset=function(){f&&f.reset(),o&&o.reset()},b}function E(){return x||(x=I(null,{useWorker:!0,resize:!0})),x}a.exports=function(){return E().apply(this,arguments)},a.exports.reset=function(){E().reset()},a.exports.create=I,a.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,a;"string"==typeof e?t=e:(t=e.path,a=e.matrix);var r=new Path2D(t),n=document.createElement("canvas").getContext("2d");if(!a){for(var s,o,l=1e3,c=l,d=l,u=0,h=0,f=0;f<l;f+=2)for(var p=0;p<l;p+=2)n.isPointInPath(r,f,p,"nonzero")&&(c=Math.min(c,f),d=Math.min(d,p),u=Math.max(u,f),h=Math.max(h,p));s=u-c,o=h-d;var g=Math.min(10/s,10/o);a=[g,0,0,g,-Math.round(s/2+c)*g,-Math.round(o/2+d)*g]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,r="#000000",n='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,n="fontFamily"in e?e.fontFamily:n,r="color"in e?e.color:r);var s=10*a,i=s+"px "+n,o=new OffscreenCanvas(s,s),l=o.getContext("2d");l.font=i;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),u=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),h=c.actualBoundingBoxLeft+2,f=c.actualBoundingBoxAscent+2;d+=4,u+=4,(l=(o=new OffscreenCanvas(d,u)).getContext("2d")).font=i,l.fillStyle=r,l.fillText(t,h,f);var p=1/a;return{type:"bitmap",bitmap:o.transferToImageBitmap(),matrix:[p,0,0,p,-d*p/2,-u*p/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),r,!1);const n=r.exports;var s=r.exports.create}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,a),s.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const r=window.wp.element,n=window.wp.apiFetch;var s=a.n(n);const i=window.ReactJSXRuntime,o=(0,r.createContext)(),l=window.straktureOnboardingData||{},c={color_palette:"default",color_palette_file:"",typography_preset:"default",typography_preset_file:"",...l.savedSettings,site_title:l.siteTitle||"",site_tagline:l.siteTagline||"",site_type:l.siteType||""};function d({children:e}){const[t,a]=(0,r.useState)(c),[n,l]=(0,r.useState)(0),[d,u]=(0,r.useState)(!1),h=(0,r.useCallback)((e,t)=>{a(a=>({...a,[e]:t}))},[]),f=(0,r.useCallback)(async(e={})=>{u(!0);const r={...t,...e};try{await s()({path:"/strakture/v1/onboarding/settings",method:"POST",data:r}),a(r)}finally{u(!1)}},[t]),p=(0,r.useCallback)(async()=>{await s()({path:"/strakture/v1/onboarding/complete",method:"POST"})},[]);return(0,i.jsx)(o.Provider,{value:{settings:t,currentStep:n,setCurrentStep:l,isSaving:d,updateSetting:h,saveSettings:f,completeOnboarding:p},children:e})}function u(){return(0,r.useContext)(o)}const h=window.wp.i18n,f=window.wp.primitives;var p=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),g=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),_=(0,i.jsx)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),m=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})}),b=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),v=(0,r.forwardRef)(({icon:e,size:t=24,...a},n)=>(0,r.cloneElement)(e,{width:t,height:t,...a,ref:n})),x=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const w=window.straktureOnboardingData||{},k=[{label:(0,h.__)("Dashboard","strakture"),index:0,icon:p},{label:(0,h.__)("Site Settings","strakture"),index:1,icon:g},{label:(0,h.__)("Colors","strakture"),index:2,icon:_},{label:(0,h.__)("Typography","strakture"),index:3,icon:m}],y=w.isPaying?[...k,{label:(0,h.__)("Starter Sites","strakture"),index:4,icon:b}]:k;function j(){const{currentStep:e,setCurrentStep:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__sidebar",children:[(0,i.jsx)("div",{className:"strakture-onboarding__sidebar-top",children:(0,i.jsx)("div",{className:"strakture-onboarding__back-to-dash",children:(0,i.jsxs)("a",{href:w.adminUrl,children:[(0,i.jsx)(v,{icon:x,size:28}),(0,i.jsx)("span",{children:(0,h.__)("Back to admin","strakture")})]})})}),(0,i.jsx)("ul",{className:"strakture-onboarding__steps",children:y.map(a=>{let r="strakture-onboarding__step";return a.index===e&&(r+=" is-active"),(0,i.jsxs)("li",{className:r,onClick:()=>t(a.index),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(a.index))},children:[(0,i.jsx)(v,{icon:a.icon,size:20}),a.label]},a.index)})})]})}const M=window.wp.components;var S=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});const N=window.straktureOnboardingData||{};function C(){const{setCurrentStep:e}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__dashboard",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav-left",children:[(0,i.jsx)("img",{src:N.logoDarkUrl,alt:(0,h.__)("Strakture","strakture"),className:"strakture-onboarding__dash-nav-logo"}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-version",children:N.version})]}),(0,i.jsxs)("nav",{className:"strakture-onboarding__dash-nav-right",children:[(0,i.jsx)("a",{href:"https://strakture.com/docs/",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Docs","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://strakture.com",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Website","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://www.youtube.com/watch?v=rdpsa8vtLEM",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("YouTube","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:N.adminUrl+"admin.php?page=strakture-contact",children:(0,h.__)("Support","strakture")})]})]}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-hero",children:(0,i.jsxs)("div",{className:"strakture-onboarding__dash-hero-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Welcome to Strakture","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Generate AI-powered patterns that match your theme's design system. Get started by configuring your site with the setup wizard below.","strakture")}),(0,i.jsxs)(M.Button,{variant:"primary",onClick:()=>e(1),children:[(0,h.__)("Start Setup","strakture"),(0,i.jsx)(v,{icon:S,size:20})]})]})}),!N.isPaying&&(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-upgrade",children:[(0,i.jsx)("h2",{children:(0,h.__)("Upgrade to Pro","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Take your site to the next level with AI-powered design and premium features.","strakture")}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,h.__)("AI-generated patterns tailored to your website","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Responsive Controls","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium WordPress theme included","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Full WooCommerce integration","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium block patterns","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Priority support","strakture")})]}),(0,i.jsx)(M.Button,{className:"strakture-onboarding__upgrade-btn",variant:"primary",href:N.upgradeUrl,children:(0,h.__)("Upgrade to Pro","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-section--alt",children:[(0,i.jsx)("h2",{children:(0,h.__)("Watch Video Tutorial","strakture")}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-video",children:(0,i.jsxs)("a",{href:"https://www.youtube.com/watch?v=rdpsa8vtLEM",target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__dash-video-link",children:[(0,i.jsx)("img",{src:N.pluginUrl+"public/img/video-thumb.jpg",alt:(0,h.__)("Getting Started with Strakture","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-video-play",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 48",width:"68",height:"48",children:[(0,i.jsx)("path",{d:"M66.52 7.74A8.52 8.52 0 0 0 60.71 1.9C55.4 0 34 0 34 0S12.6 0 7.29 1.9A8.52 8.52 0 0 0 1.48 7.74C0 13.08 0 24 0 24s0 10.92 1.48 16.26a8.52 8.52 0 0 0 5.81 5.84C12.6 48 34 48 34 48s21.4 0 26.71-1.9a8.52 8.52 0 0 0 5.81-5.84C68 34.92 68 24 68 24s0-10.92-1.48-16.26z",fill:"#ff0000"}),(0,i.jsx)("path",{d:"M27 34l18-10-18-10v20z",fill:"#fff"})]})})]})})]})]})}const P=(window.straktureOnboardingData||{}).isPaying?4:3;function O(){const{currentStep:e,setCurrentStep:t,saveSettings:a,isSaving:r}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__nav",children:[(0,i.jsx)("button",{className:"strakture-onboarding__back-btn",onClick:()=>{t(e-1)},children:(0,h.__)("Go Back","strakture")}),(0,i.jsx)(M.Button,{variant:"primary",onClick:async()=>{await a(),t(e+1)},isBusy:r,disabled:r,children:r?(0,h.__)("Saving...","strakture"):e>=P?(0,h.__)("Save and Finish","strakture"):(0,h.__)("Next","strakture")})]})}function B(){const{settings:e,updateSetting:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__site-settings",children:[(0,i.jsx)("h2",{children:(0,h.__)("Site Settings","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Configure the basic information about your website.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__fields",children:[(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Title","strakture"),value:e.site_title,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_title",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Tagline","strakture"),value:e.site_tagline,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_tagline",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Type","strakture"),value:e.site_type,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_type",e),placeholder:(0,h.__)("e.g., Photography Portfolio, Restaurant","strakture"),help:(0,h.__)("Describe your site. This helps generate better AI patterns.","strakture")})]}),(0,i.jsx)(O,{})]})}const T=window.ReactDOM,z=window.straktureOnboardingData||{};function I({refreshKey:e=0}){const t=(0,r.useRef)(null),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)({}),[l,c]=(0,r.useState)(!1),d=`${z.homeUrl}?strakture_preview=${e}`;return(0,r.useLayoutEffect)(()=>{const e=()=>{if(!t.current||!a)return;const e=a.clientWidth/1600;o({width:1600,height:a.clientHeight/e,transform:`scale(${e})`,transformOrigin:"top left"})};e();const r=new ResizeObserver(()=>{(0,T.flushSync)(()=>{e()})});return a&&r.observe(a),()=>r.disconnect()},[a]),(0,r.useLayoutEffect)(()=>{c(!1)},[e]),(0,i.jsxs)("div",{className:"strakture-onboarding__preview",children:[(0,i.jsx)("div",{className:"strakture-onboarding__preview-browser",children:(0,i.jsxs)("div",{className:"strakture-onboarding__preview-dots",children:[(0,i.jsx)("span",{}),(0,i.jsx)("span",{}),(0,i.jsx)("span",{})]})}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-container",ref:n,children:(0,i.jsx)("iframe",{title:"Site Preview",style:s,className:"strakture-onboarding__preview-iframe"+(l?" is-loaded":""),onLoad:()=>c(!0),src:d,ref:t})})]})}const E=(window.straktureOnboardingData||{}).colorPalettes||[],D=["primary","secondary","headings","background"];function R(e){const t={};return e.forEach(e=>{t[e.slug]=e}),D.map(e=>t[e]).filter(Boolean)}function F(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={color_palette:e.id,color_palette_file:e.file||""};t("color_palette",e.id),t("color_palette_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__colors",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Color Palette","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a color palette for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__palette-list",children:[E.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__palette-card"+(e.color_palette===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__palette-title",children:t.title}),(0,i.jsx)("span",{className:"strakture-onboarding__palette-colors",children:R(t.colors).map((e,t)=>(0,i.jsx)(M.ColorIndicator,{colorValue:e.color},t))})]},t.id)),0===E.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No color palettes found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}const A=(window.straktureOnboardingData||{}).fontPresets||[];function L(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={typography_preset:e.id,typography_preset_file:e.file||""};t("typography_preset",e.id),t("typography_preset_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__typography",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Typography","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a font combination for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__font-list",children:[A.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__font-card"+(e.typography_preset===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-preview",children:"Aa"}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-info",children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-title",children:t.title}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-names",children:[t.headingFont,t.bodyFont&&t.bodyFont!==t.headingFont?` / ${t.bodyFont}`:""]})]})]},t.id)),0===A.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No font presets found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}var V=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const U=window.straktureOnboardingData||{},H=U.starterSites||[];var G=a(359),W=a.n(G);const Z=window.straktureOnboardingData||{},Y={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0,zIndex:999};function q(){const{completeOnboarding:e}=u();(0,r.useEffect)(()=>{e()},[e]);const t=(0,r.useCallback)(({confetti:e})=>{e({particleCount:150,spread:80,origin:{y:.6}})},[]);return(0,i.jsxs)("div",{className:"strakture-onboarding__finish",children:[(0,i.jsx)(W(),{onInit:t,style:Y}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Setup Complete!","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Your site is configured and ready to go. Start editing your homepage or view your site to see the changes.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-actions",children:[(0,i.jsx)(M.Button,{variant:"primary",href:Z.homeUrl,target:"_blank",children:(0,h.__)("View Your Site","strakture")}),(0,i.jsx)(M.Button,{variant:"secondary",href:Z.adminUrl+"site-editor.php?p=%2Ftemplate",children:(0,h.__)("Start Editing","strakture")})]})]})]})}const X=(window.straktureOnboardingData||{}).isPaying?[C,B,F,L,function(){const[e,t]=(0,r.useState)(H),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),l=(0,r.useCallback)(async(e,t)=>{const a=new FormData;return a.append("action",e),a.append("wpnonce",U.starterSitesNonce),a.append("slug",t),(await fetch(U.ajaxUrl,{method:"POST",body:a})).json()},[]),c=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_activate_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,status:r.data.status,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]),d=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_update_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]);return(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites-header",children:[(0,i.jsx)("h2",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a starter site to import. You can customize everything after the import.","strakture")})]}),s&&(0,i.jsx)("div",{className:`strakture-onboarding__starter-sites-notice is-${s.type}`,children:s.message}),(0,i.jsx)("div",{className:"strakture-onboarding__demos-grid",children:e.map((e,t)=>{const r=((e,t)=>{const r=a===e.slug;switch(e.status){case"active":return{label:(0,h.__)("Import","strakture"),href:e.merlin_url,onClick:null,icon:V,isBusy:!1};case"installed":return{label:r?(0,h.__)("Activating...","strakture"):(0,h.__)("Activate","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r};default:return{label:r?(0,h.__)("Installing...","strakture"):(0,h.__)("Install","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r}}})(e,t),n=a===e.slug;return(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card",children:[e.needsUpdate&&(0,i.jsx)("div",{className:"strakture-onboarding__demo-card-update",children:(0,i.jsx)(M.Button,{variant:"link",onClick:()=>d(e,t),disabled:null!==a,isBusy:n,className:"strakture-onboarding__demo-card-update-btn",children:n?(0,h.__)("Updating...","strakture"):(0,h.__)("Update Available — Update Now","strakture")})}),(0,i.jsxs)("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__demo-card-image-link",children:[(0,i.jsx)("img",{src:e.import_preview_image_url,alt:e.import_file_name,className:"strakture-onboarding__demo-card-image"}),(0,i.jsx)("span",{className:"strakture-onboarding__demo-card-badge",children:(0,h.__)("Live Preview","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card-body",children:[(0,i.jsx)("h3",{className:"strakture-onboarding__demo-card-title",children:e.import_file_name}),(0,i.jsx)(M.Button,{variant:"primary",icon:r.icon,href:r.href,onClick:r.onClick,isBusy:r.isBusy,disabled:null!==a,className:"strakture-onboarding__demo-card-btn",children:r.label})]})]},t)})})]})},q]:[C,B,F,L,q];function $(){const{currentStep:e}=u(),t=X[e];return(0,i.jsx)("div",{className:"strakture-onboarding",children:(0,i.jsxs)("div",{className:"strakture-onboarding__layout",children:[(0,i.jsx)(j,{}),(0,i.jsx)("div",{className:"strakture-onboarding__main",children:(0,i.jsx)("div",{className:"strakture-onboarding__content",children:(0,i.jsx)(t,{})})})]})})}const K=document.getElementById("strakture-onboarding");K&&(0,r.createRoot)(K).render((0,i.jsx)(d,{children:(0,i.jsx)($,{})}))})(); -
strakture/tags/1.1.5/readme.txt
r3499596 r3509467 5 5 Requires at least: 6.5 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 https://www.youtube.com/watch?v= 7H7_pUUCxys16 https://www.youtube.com/watch?v=rdpsa8vtLEM 17 17 18 18 Strakture is an AI-powered WordPress block pattern library that generates layouts matched to your theme's actual design system — and to your site's content. Unlike generic pattern libraries that give you patterns you have to restyle and rewrite from scratch, Strakture reads your theme's CSS variables and understands what your site is about, then creates patterns that look native and feel relevant from the first click. … … 230 230 == Changelog == 231 231 232 = 1.1.5 - April 18, 2026 = 233 - Fixed: Site Type now stays in sync between the pattern library modal, Site Settings, and generated patterns 234 - Fixed: Updating Site Type in the modal no longer refreshes the pattern grid while browsing 235 - Fixed: Premium auth now refreshes automatically so pattern generation keeps working after the editor stays open for longer periods 236 232 237 = 1.1.4 - April 6, 2026 = 233 238 - New: Minimal starter site demo -
strakture/tags/1.1.5/strakture.php
r3499596 r3509467 6 6 * Author: Aleksandr Samokhin 7 7 * Author URI: https://aleksandrsamokhin.com 8 * Version: 1.1. 48 * Version: 1.1.5 9 9 * Requires at least: 6.5 10 10 * Requires PHP: 7.0 -
strakture/tags/1.1.5/vendor/composer/autoload_classmap.php
r3486136 r3509467 22 22 'Strakture\\Shared\\Admin' => $baseDir . '/app/Shared/Admin.php', 23 23 'Strakture\\Shared\\Controllers\\ActivityController' => $baseDir . '/app/Shared/Controllers/ActivityController.php', 24 'Strakture\\Shared\\Controllers\\AuthTokenController' => $baseDir . '/app/Shared/Controllers/AuthTokenController.php', 24 25 'Strakture\\Shared\\Controllers\\CreditsController' => $baseDir . '/app/Shared/Controllers/CreditsController.php', 25 26 'Strakture\\Shared\\Controllers\\ImageController' => $baseDir . '/app/Shared/Controllers/ImageController.php', … … 27 28 'Strakture\\Shared\\Services\\FreemiusAuth' => $baseDir . '/app/Shared/Services/FreemiusAuth.php', 28 29 'Strakture\\Shared\\Services\\Sanitizer' => $baseDir . '/app/Shared/Services/Sanitizer.php', 30 'Strakture\\Shared\\Services\\SiteTypeSync' => $baseDir . '/app/Shared/Services/SiteTypeSync.php', 29 31 'Strakture\\StarterSites\\ChildThemeVersions' => $baseDir . '/app/StarterSites/ChildThemeVersions.php', 30 32 'Strakture\\StarterSites\\MerlinPluginThemeStub' => $baseDir . '/app/StarterSites/MerlinPluginThemeStub.php', -
strakture/tags/1.1.5/vendor/composer/autoload_static.php
r3486136 r3509467 41 41 'Strakture\\Shared\\Admin' => __DIR__ . '/../..' . '/app/Shared/Admin.php', 42 42 'Strakture\\Shared\\Controllers\\ActivityController' => __DIR__ . '/../..' . '/app/Shared/Controllers/ActivityController.php', 43 'Strakture\\Shared\\Controllers\\AuthTokenController' => __DIR__ . '/../..' . '/app/Shared/Controllers/AuthTokenController.php', 43 44 'Strakture\\Shared\\Controllers\\CreditsController' => __DIR__ . '/../..' . '/app/Shared/Controllers/CreditsController.php', 44 45 'Strakture\\Shared\\Controllers\\ImageController' => __DIR__ . '/../..' . '/app/Shared/Controllers/ImageController.php', … … 46 47 'Strakture\\Shared\\Services\\FreemiusAuth' => __DIR__ . '/../..' . '/app/Shared/Services/FreemiusAuth.php', 47 48 'Strakture\\Shared\\Services\\Sanitizer' => __DIR__ . '/../..' . '/app/Shared/Services/Sanitizer.php', 49 'Strakture\\Shared\\Services\\SiteTypeSync' => __DIR__ . '/../..' . '/app/Shared/Services/SiteTypeSync.php', 48 50 'Strakture\\StarterSites\\ChildThemeVersions' => __DIR__ . '/../..' . '/app/StarterSites/ChildThemeVersions.php', 49 51 'Strakture\\StarterSites\\MerlinPluginThemeStub' => __DIR__ . '/../..' . '/app/StarterSites/MerlinPluginThemeStub.php', -
strakture/tags/1.1.5/vendor/composer/installed.php
r3499596 r3509467 2 2 'root' => array( 3 3 'name' => 'strakture/strakture', 4 'pretty_version' => '1.1. 4',5 'version' => '1.1. 4.0',6 'reference' => ' b053fea5c943b4b92169a7197148abe3eee22a74',4 'pretty_version' => '1.1.5', 5 'version' => '1.1.5.0', 6 'reference' => '0b6fd6e7598bb15fe60228cfa107f9d9d6269c80', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'strakture/strakture' => array( 23 'pretty_version' => '1.1. 4',24 'version' => '1.1. 4.0',25 'reference' => ' b053fea5c943b4b92169a7197148abe3eee22a74',23 'pretty_version' => '1.1.5', 24 'version' => '1.1.5.0', 25 'reference' => '0b6fd6e7598bb15fe60228cfa107f9d9d6269c80', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', -
strakture/trunk/app/Admin/OnboardingController.php
r3499596 r3509467 10 10 11 11 use Strakture\Shared\Services\Sanitizer; 12 use Strakture\Shared\Services\SiteTypeSync; 12 13 13 14 /** … … 47 48 48 49 if ( isset( $data['site_type'] ) ) { 49 \update_option( 'strakture_site_type', $data['site_type'] ); 50 $data['site_type'] = SiteTypeSync::sync( $data['site_type'] ); 51 \update_option( 'strakture_onboarding_settings', $data ); 50 52 } 51 53 -
strakture/trunk/app/Library/Controllers/SiteController.php
r3472592 r3509467 10 10 11 11 use Strakture\Shared\Services\Sanitizer; 12 use Strakture\Shared\Services\SiteTypeSync; 12 13 13 14 /** … … 35 36 public static function store( $request ) { 36 37 $data = json_decode( $request->get_param( 'state' ), true ); 37 \update_option( 'strakture_library_site_data', Sanitizer::sanitizeArray( $data ) ); 38 $data = is_array( $data ) ? Sanitizer::sanitizeArray( $data ) : array(); 39 40 \update_option( 'strakture_library_site_data', $data ); 41 42 if ( isset( $data['state']['siteType'] ) ) { 43 SiteTypeSync::sync( $data['state']['siteType'] ); 44 } 45 38 46 return new \WP_REST_Response( $data ); 39 47 } … … 52 60 $snakeKey = strtolower( preg_replace( '/[A-Z]/', '_$0', $key ) ); 53 61 54 \update_option( 'strakture_' . $snakeKey, Sanitizer::sanitizeUnknown( $value ) ); 62 if ( 'site_type' === $snakeKey ) { 63 $value = SiteTypeSync::sync( $value ); 64 } else { 65 $value = Sanitizer::sanitizeUnknown( $value ); 66 \update_option( 'strakture_' . $snakeKey, $value ); 67 } 68 55 69 return new \WP_REST_Response( $value ); 56 70 } -
strakture/trunk/app/Shared/Admin.php
r3472592 r3509467 50 50 // Defaults for free version. 51 51 $authToken = ''; 52 $auth = array( 53 'success' => false, 54 'authToken' => '', 55 'issuedAt' => null, 56 'refreshAfterSeconds' => 240, 57 'expiresAfterSeconds' => 300, 58 ); 52 59 $creditInfo = array( 53 60 'remaining' => 0, … … 78 85 'activity' => \wp_json_encode( \get_option( 'strakture_shared_activity', null ) ), 79 86 'authToken' => \esc_attr( $authToken ), 87 'auth' => array( 88 'success' => !empty( $auth['success'] ), 89 'authToken' => \esc_attr( $auth['authToken'] ?? '' ), 90 'issuedAt' => ( isset( $auth['issuedAt'] ) ? (int) $auth['issuedAt'] : null ), 91 'refreshAfterSeconds' => (int) ($auth['refreshAfterSeconds'] ?? 240), 92 'expiresAfterSeconds' => (int) ($auth['expiresAfterSeconds'] ?? 300), 93 ), 80 94 'credits' => array( 81 95 'remaining' => (int) ($creditInfo['remaining'] ?? 0), -
strakture/trunk/public/build/strakture-library.asset.php
r3480125 r3509467 1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' 713487f1839b7e6039cd');1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'cb9a702dcfd4ed1dfc9c'); -
strakture/trunk/public/build/strakture-library.js
r3472592 r3509467 1 (()=>{var t,e,n={162(t,e,n){"use strict";var r=n(609),i=n(888),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u(function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==i&&h.hasValue){var e=h.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(s=t,e):(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,n,r,i]);var p=s(t,d[0],d[1]);return l(function(){h.hasValue=!0,h.value=p},[p]),c(p),p}},242(t,e,n){"use strict";t.exports=n(162)},493(t,e,n){"use strict";var r=n(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=e,u(i)&&c({inst:i})},[t,n,e]),s(function(){return u(i)&&c({inst:i}),t(function(){u(i)&&c({inst:i})})},[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},609(t){"use strict";t.exports=window.React},888(t,e,n){"use strict";t.exports=n(493)},942(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(i.default=i,t.exports=i):void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}()}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>n[t]);return s.default=()=>n,i.d(o,s),o},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=window.wp.element,e=window.wp.data,n=(e,n)=>{"function"==typeof t.createRoot?(0,t.createRoot)(n).render(e):(0,t.render)(e,n)},r=window.wp.i18n;var o=(0,t.forwardRef)(({icon:e,size:n=24,...r},i)=>(0,t.cloneElement)(e,{width:n,height:n,...r,ref:i}));const s=window.wp.apiFetch;var a=i.n(s);const l=(t,e={})=>{if("string"!=typeof t)return null!=t?t:e;try{var n;return null!==(n=JSON.parse(t))&&void 0!==n?n:e}catch(t){return e}},u=t=>{let e;const n=new Set,r=(t,r)=>{const i="function"==typeof t?t(e):t;if(!Object.is(i,e)){const t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{"production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=e=t(r,i,o);return o};var c=i(609),d=i.t(c,2),h=i.n(c),p=i(242);const{useDebugValue:m}=c,{useSyncExternalStoreWithSelector:f}=p;let g=!1;const y=t=>t,v=t=>{"production"!=={NODE_ENV:"production"}.MODE&&"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?u(t):u)(t):t,n=(t,n)=>function(t,e=y,n){"production"!=={NODE_ENV:"production"}.MODE&&n&&!g&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),g=!0);const r=f(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return m(r),r}(e,t,n);return Object.assign(n,e),n},x=t=>t?v(t):v,w=new Map,b=t=>{const e=w.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([t,e])=>[t,e.getState()])):{}},S=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null!=o?o:"production"!=={NODE_ENV:"production"}.MODE)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return"production"!=={NODE_ENV:"production"}.MODE&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=w.get(n.name);if(r)return{type:"tracked",store:t,...r};const i={connection:e.connect(n),stores:{}};return w.set(n.name,i),{type:"tracked",store:t,...i}})(a,u,l);let h=!0;i.setState=(t,e,o)=>{const u=n(t,e);if(!h)return u;const d=void 0===o?{type:s||"anonymous"}:"string"==typeof o?{type:o}:o;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...b(l.name),[a]:i.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},m=t(i.setState,r,i);if("untracked"===d.type?null==c||c.init(m):(d.stores[d.store]=i,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([t,e])=>[t,t===d.store?m:e.getState()])))),i.dispatchFromDevtools&&"function"==typeof i.dispatch){let t=!1;const e=i.dispatch;i.dispatch=(...n)=>{"production"==={NODE_ENV:"production"}.MODE||"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe(t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):C(t.payload,t=>{if("__setState"===t.type){if(void 0===a)return void p(t.state);1!==Object.keys(t.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const e=t.state[a];if(null==e)return;return void(JSON.stringify(i.getState())!==JSON.stringify(e)&&p(e))}i.dispatchFromDevtools&&"function"==typeof i.dispatch&&i.dispatch(t)});case"DISPATCH":switch(t.payload.type){case"RESET":return p(m),void 0===a?null==c?void 0:c.init(i.getState()):null==c?void 0:c.init(b(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(i.getState())):null==c?void 0:c.init(b(l.name));case"ROLLBACK":return C(t.state,t=>{if(void 0===a)return p(t),void(null==c||c.init(i.getState()));p(t[a]),null==c||c.init(b(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return C(t.state,t=>{void 0!==a?JSON.stringify(i.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)});case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}}),m},C=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function E(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const i=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),o=null!=(r=n.getItem(t))?r:null;return o instanceof Promise?o.then(i):i(o)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const P=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then:t=>P(t)(n),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>P(e)(t)}}},k=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?("production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch(t){}if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=P(o.serialize),d=()=>{const t=o.partialize({...r()});let e;const n=c({state:t,version:o.version}).then(t=>u.setItem(o.name,t)).catch(t=>{e=t});if(e)throw e;return n},h=i.setState;i.setState=(t,e)=>{h(t,e),d()};const p=t((...t)=>{n(...t),d()},r,i);let m;const f=()=>{var t;if(!u)return;s=!1,a.forEach(t=>t(r()));const e=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,r()))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t)return o.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return t.state;if(o.migrate)return o.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return m=o.merge(t,null!=(e=r())?e:p),n(m,!0),d()}).then(()=>{null==e||e(m,void 0),s=!0,l.forEach(t=>t(m))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},f(),m||p})(t,e)):((t,e)=>(n,r,i)=>{let o={storage:E(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=()=>{const t=o.partialize({...r()});return u.setItem(o.name,{state:t,version:o.version})},d=i.setState;i.setState=(t,e)=>{d(t,e),c()};const h=t((...t)=>{n(...t),c()},r,i);let p;i.getInitialState=()=>h;const m=()=>{var t,e;if(!u)return;s=!1,a.forEach(t=>{var e;return t(null!=(e=r())?e:h)});const i=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,null!=(t=r())?t:h))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return[!1,t.state];if(o.migrate)return[!0,o.migrate(t.state,t.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var e;const[i,s]=t;if(p=o.merge(s,null!=(e=r())?e:h),n(p,!0),i)return c()}).then(()=>{null==i||i(p,void 0),p=r(),s=!0,l.forEach(t=>t(p))}).catch(t=>{null==i||i(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},o.skipHydration||m(),p||h})(t,e),T="/strakture/v1/shared/activity",A={getItem:()=>a()({path:T}),setItem:(t,e)=>a()({path:T,method:"POST",data:{state:e}})},j=l(window.straktureSharedData?.activity),D={actions:{}},O=x(k(S((t,e)=>{var n;return{...D,...null!==(n=j?.state)&&void 0!==n?n:{},incrementActivity:n=>{t(t=>({...t,actions:{...t.actions,[n]:Number(e().actions[n]||0)+1}}))}}},{name:"Strakture Activity"}),{name:"strakture_shared_activity",storage:E(()=>A),skipHydration:!0})),M=window.ReactJSXRuntime,R=(0,M.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_98_488)",children:[(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"white"}),(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"url(#paint0_linear_98_488)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_98_488",x1:"-1.2544",y1:"35.9502",x2:"39.167",y2:"26.3118",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_98_488",children:(0,M.jsx)("rect",{width:"36",height:"36",fill:"white"})})]})]}),V=x(S(t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t(t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]})}),{name:"Strakture Library Globals"})),L=()=>{const{setOpen:t}=V(),{incrementActivity:e}=O();return(0,M.jsxs)("div",{role:"button",onClick:()=>{t(!0),e("library-button-click")},className:"components-button has-icon bg-design-main hover:opacity-90 hover:text-white text-white h-9 sm:ml-2 xl:pr-4",children:[(0,M.jsx)(o,{icon:R,size:16}),(0,M.jsx)("span",{className:"ml-1 hidden xl:inline",children:(0,r.__)("Strakture Patterns","strakture")})]})};function F(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t}))}function N(){let t=[],e={addEventListener:(t,n,r,i)=>(t.addEventListener(n,r,i),e.add(()=>t.removeEventListener(n,r,i))),requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame:(...t)=>e.requestAnimationFrame(()=>e.requestAnimationFrame(...t)),setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return F(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add(()=>{Object.assign(t.style,{[e]:r})})},group(t){let e=N();return t(e),this.add(()=>e.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}var I=Object.defineProperty,_=(t,e,n)=>(((t,e,n)=>{e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let B=new class{constructor(){_(this,"current",this.detect()),_(this,"handoffState","pending"),_(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},U=(t,e)=>{B.isServer?(0,c.useEffect)(t,e):(0,c.useLayoutEffect)(t,e)};function $(t){let e=(0,c.useRef)(t);return U(()=>{e.current=t},[t]),e}let H=function(t){let e=$(t);return c.useCallback((...t)=>e.current(...t),[e])};function W(t,e,n,r){let i=$(n);(0,c.useEffect)(()=>{function n(t){i.current(t)}return(t=null!=t?t:window).addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,r])}function z(){let t=(0,c.useRef)(!1);return U(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function q(t){let e=H(t),n=(0,c.useRef)(!1);(0,c.useEffect)(()=>(n.current=!1,()=>{n.current=!0,F(()=>{n.current&&e()})}),[e])}function Y(t){return B.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function G(...t){return(0,c.useMemo)(()=>Y(...t),[...t])}function X(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in d&&d.useSyncExternalStore(()=>()=>{},()=>!1,()=>!t)}(),[e,n]=c.useState(B.isHandoffComplete);return e&&!1===B.isHandoffComplete&&n(!1),c.useEffect(()=>{!0!==e&&n(!0)},[e]),c.useEffect(()=>B.handoff(),[]),!t&&e}let Z=Symbol();function J(...t){let e=(0,c.useRef)(t);(0,c.useEffect)(()=>{e.current=t},[t]);let n=H(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)});return t.every(t=>null==t||(null==t?void 0:t[Z]))?void 0:n}function K(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)},[t,n])}var Q=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Q||{});function tt(t,e){let n=(0,c.useRef)([]),r=H(t);(0,c.useEffect)(()=>{let t=[...n.current];for(let[i,o]of e.entries())if(n.current[i]!==o){let i=r(e,t);return n.current=e,i}},[r,...e])}function et(...t){return Array.from(new Set(t.flatMap(t=>"string"==typeof t?t.split(" "):[]))).filter(Boolean).join(" ")}function nt(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(t=>`"${t}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,nt),r}var rt=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(rt||{}),it=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(it||{});function ot({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=null!=a?a:at;let l=lt(e,t);if(o)return st(l,n,r,s,a);let u=null!=i?i:0;if(2&u){let{static:t=!1,...e}=l;if(t)return st(e,n,r,s,a)}if(1&u){let{unmount:t=!0,...e}=l;return nt(t?0:1,{0:()=>null,1:()=>st({...e,hidden:!0,style:{display:"none"}},n,r,s,a)})}return st(l,n,r,s,a)}function st(t,e={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=dt(t,["unmount","static"]),u=void 0!==t.ref?{[a]:t.ref}:{},d="function"==typeof s?s(e):s;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(e));let h={};if(e){let t=!1,n=[];for(let[r,i]of Object.entries(e))"boolean"==typeof i&&(t=!0),!0===i&&n.push(r);t&&(h["data-headlessui-state"]=n.join(" "))}if(o===c.Fragment&&Object.keys(ct(l)).length>0){if(!(0,c.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(t=>` - ${t}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(t=>` - ${t}`).join("\n")].join("\n"));let t=d.props,e="function"==typeof(null==t?void 0:t.className)?(...e)=>et(null==t?void 0:t.className(...e),l.className):et(null==t?void 0:t.className,l.className),n=e?{className:e}:{};return(0,c.cloneElement)(d,Object.assign({},lt(d.props,ct(dt(l,["ref"]))),h,u,{ref:i(d.ref,u.ref)},n))}return(0,c.createElement)(o,Object.assign({},dt(l,["ref"]),o!==c.Fragment&&u,o!==c.Fragment&&h),d)}function at(...t){return t.every(t=>null==t)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function lt(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(t=>[t,void 0])));for(let t in n)Object.assign(e,{[t](e,...r){let i=n[t];for(let t of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function ut(t){var e;return Object.assign((0,c.forwardRef)(t),{displayName:null!=(e=t.displayName)?e:t.name})}function ct(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function dt(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var ht=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(ht||{});let pt=ut(function(t,e){var n;let{features:r=1,...i}=t;return ot({ourProps:{ref:e,"aria-hidden":!(2&~r)||(null!=(n=i["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}},theirProps:i,slot:{},defaultTag:"div",name:"Hidden"})}),mt=[];!function(){function t(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&mt[0]!==t.target&&(mt.unshift(t.target),mt=mt.filter(t=>null!=t&&t.isConnected),mt.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();let ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var gt,yt,vt=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(vt||{}),xt=((yt=xt||{})[yt.Error=0]="Error",yt[yt.Overflow=1]="Overflow",yt[yt.Success=2]="Success",yt[yt.Underflow=3]="Underflow",yt),wt=((gt=wt||{})[gt.Previous=-1]="Previous",gt[gt.Next=1]="Next",gt);var bt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(bt||{});var St=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(St||{});function Ct(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Et=["textarea","input"].join(",");function Pt(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=t=>t){return t.slice().sort((t,n)=>{let r=e(t),i=e(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(ft)).sort((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}(t);i.length>0&&s.length>1&&(s=s.filter(t=>!i.includes(t))),r=null!=r?r:o.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==o.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,Et))&&n}(a)&&a.select(),2}function kt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var Tt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(Tt||{});let At=ut(function(t,e){let n=(0,c.useRef)(null),r=J(n,e),{initialFocus:i,containers:o,features:s=30,...a}=t;X()||(s=1);let l=G(n);Dt({ownerDocument:l},Boolean(16&s));let u=function({ownerDocument:t,container:e,initialFocus:n},r){let i=(0,c.useRef)(null),o=z();return tt(()=>{if(!r)return;let s=e.current;s&&F(()=>{if(!o.current)return;let e=null==t?void 0:t.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===e)return void(i.current=e)}else if(s.contains(e))return void(i.current=e);null!=n&&n.current?Ct(n.current):Pt(s,vt.First)===xt.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==t?void 0:t.activeElement})},[r]),i}({ownerDocument:l,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},i){let o=z();W(null==t?void 0:t.defaultView,"focus",t=>{if(!i||!o.current)return;let s=kt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?Ot(s,l)?(r.current=l,Ct(l)):(t.preventDefault(),t.stopPropagation(),Ct(a)):Ct(r.current)},!0)}({ownerDocument:l,container:n,containers:o,previousActiveElement:u},Boolean(8&s));let d=function(){let t=(0,c.useRef)(0);return K("keydown",e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)},!0),t}(),h=H(t=>{let e=n.current;e&&nt(d.current,{[Q.Forwards]:()=>{Pt(e,vt.First,{skipElements:[t.relatedTarget]})},[Q.Backwards]:()=>{Pt(e,vt.Last,{skipElements:[t.relatedTarget]})}})}),p=function(){let[t]=(0,c.useState)(N);return(0,c.useEffect)(()=>()=>t.dispose(),[t]),t}(),m=(0,c.useRef)(!1),f={ref:r,onKeyDown(t){"Tab"==t.key&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(t){let e=kt(o);n.current instanceof HTMLElement&&e.add(n.current);let r=t.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(Ot(e,r)||(m.current?Pt(n.current,nt(d.current,{[Q.Forwards]:()=>vt.Next,[Q.Backwards]:()=>vt.Previous})|vt.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&Ct(t.target)))}};return c.createElement(c.Fragment,null,Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}),ot({ourProps:f,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}))}),jt=Object.assign(At,{features:Tt});function Dt({ownerDocument:t},e){let n=function(t=!0){let e=(0,c.useRef)(mt.slice());return tt(([t],[n])=>{!0===n&&!1===t&&F(()=>{e.current.splice(0)}),!1===n&&!0===t&&(e.current=mt.slice())},[t,mt,e]),H(()=>{var t;return null!=(t=e.current.find(t=>null!=t&&t.isConnected))?t:null})}(e);tt(()=>{e||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&Ct(n())},[e]),q(()=>{e&&Ct(n())})}function Ot(t,e){for(let n of t)if(n.contains(e))return!0;return!1}const Mt=window.ReactDOM;let Rt=(0,c.createContext)(!1);function Vt(){return(0,c.useContext)(Rt)}function Lt(t){return c.createElement(Rt.Provider,{value:t.force},t.children)}let Ft=c.Fragment,Nt=c.Fragment,It=(0,c.createContext)(null),_t=(0,c.createContext)(null),Bt=ut(function(t,e){let n=t,r=(0,c.useRef)(null),i=J(function(t,e=!0){return Object.assign(t,{[Z]:e})}(t=>{r.current=t}),e),o=G(r),s=function(t){let e=Vt(),n=(0,c.useContext)(It),r=G(t),[i,o]=(0,c.useState)(()=>{if(!e&&null!==n||B.isServer)return null;let t=null==r?void 0:r.getElementById("headlessui-portal-root");if(t)return t;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return(0,c.useEffect)(()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))},[i,r]),(0,c.useEffect)(()=>{e||null!==n&&o(n.current)},[n,o,e]),i}(r),[a]=(0,c.useState)(()=>{var t;return B.isServer?null:null!=(t=null==o?void 0:o.createElement("div"))?t:null}),l=(0,c.useContext)(_t),u=X();return U(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),U(()=>{if(a&&l)return l.register(a)},[l,a]),q(()=>{var t;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&(null==(t=s.parentElement)||t.removeChild(s)))}),u&&s&&a?(0,Mt.createPortal)(ot({ourProps:{ref:i},theirProps:n,defaultTag:Ft,name:"Portal"}),a):null}),Ut=ut(function(t,e){let{target:n,...r}=t,i={ref:J(e)};return c.createElement(It.Provider,{value:n},ot({ourProps:i,theirProps:r,defaultTag:Nt,name:"Popover.Group"}))}),$t=Object.assign(Bt,{Group:Ut});const Ht="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:Wt,useEffect:zt,useLayoutEffect:qt,useDebugValue:Yt}=d;function Gt(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Ht(n,t)}catch{return!0}}const Xt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:i},o]=Wt({inst:{value:r,getSnapshot:e}});return qt(()=>{i.value=r,i.getSnapshot=e,Gt(i)&&o({inst:i})},[t,r,e]),zt(()=>(Gt(i)&&o({inst:i}),t(()=>{Gt(i)&&o({inst:i})})),[t]),Yt(r),r},Zt="useSyncExternalStore"in d?(t=>t.useSyncExternalStore)(d):Xt;function Jt(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,i=r.clientWidth-r.offsetWidth,o=t-i;n.style(r,"paddingRight",`${o}px`)}}}function Kt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qt(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let te=function(t,e){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:t=>(r.add(t),()=>r.delete(t)),dispatch(t,...i){let o=e[t].call(n,...i);o&&(n=o,r.forEach(t=>t()))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:N(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:Qt(n)},i=[Kt()?{before({doc:t,d:e,meta:n}){function r(t){return n.containers.flatMap(t=>t()).some(e=>e.contains(t))}e.microTask(()=>{var n;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let n=N();n.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>n.dispose()))}let i=null!=(n=window.scrollY)?n:window.pageYOffset,o=null;e.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),s=t.querySelector(i);s&&!r(s)&&(o=s)}catch{}},!0),e.addEventListener(t,"touchstart",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let n=t.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}),e.addEventListener(t,"touchmove",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.headlessuiPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.headlessuiPortal&&t.preventDefault()}else t.preventDefault()},{passive:!1}),e.add(()=>{var t;let e=null!=(t=window.scrollY)?t:window.pageYOffset;i!==e&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},Jt(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];i.forEach(({before:t})=>null==t?void 0:t(r)),i.forEach(({after:t})=>null==t?void 0:t(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});function ee(t,e,n){let r=function(t){return Zt(t.subscribe,t.getSnapshot,t.getSnapshot)}(te),i=t?r.get(t):void 0,o=!!i&&i.count>0;return U(()=>{if(t&&e)return te.dispatch("PUSH",t,n),()=>te.dispatch("POP",t,n)},[e,t]),o}var ne;te.subscribe(()=>{let t=te.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&te.dispatch("TEARDOWN",n)}});let re=null!=(ne=c.useId)?ne:function(){let t=X(),[e,n]=c.useState(t?()=>B.nextId():null);return U(()=>{null===e&&n(B.nextId())},[e]),null!=e?""+e:void 0},ie=new Map,oe=new Map;function se(t,e=!0){U(()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let i=null!=(n=oe.get(r))?n:0;return oe.set(r,i+1),0!==i||(ie.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=oe.get(r))?t:1;if(1===e?oe.delete(r):oe.set(r,e-1),1!==e)return;let n=ie.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,ie.delete(r))}},[t,e])}function ae(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return document.addEventListener(t,e,n),()=>document.removeEventListener(t,e,n)},[t,n])}function le(t,e,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=i(n);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(t);for(let t of s){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(o)||n.composed&&n.composedPath().includes(e))return}return!function(t,e=0){var n;return t!==(null==(n=Y(t))?void 0:n.body)&&nt(e,{0:()=>t.matches(ft),1(){let e=t;for(;null!==e;){if(e.matches(ft))return!0;e=e.parentElement}return!1}})}(o,bt.Loose)&&-1!==o.tabIndex&&n.preventDefault(),e(n,o)}(0,c.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let o=(0,c.useRef)(null);ae("pointerdown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("mousedown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("click",t=>{Kt()||/Android/gi.test(window.navigator.userAgent)||o.current&&(i(t,()=>o.current),o.current=null)},!0),ae("touchend",t=>i(t,()=>t.target instanceof HTMLElement?t.target:null),!0),K("blur",t=>i(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ue=(0,c.createContext)(null);ue.displayName="OpenClosedContext";var ce=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(ce||{});let de=(0,c.createContext)(()=>{});de.displayName="StackContext";var he=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(he||{});function pe({children:t,onUpdate:e,type:n,element:r,enabled:i}){let o=(0,c.useContext)(de),s=H((...t)=>{null==e||e(...t),o(...t)});return U(()=>{let t=void 0===i||!0===i;return t&&s(0,n,r),()=>{t&&s(1,n,r)}},[s,n,r,i]),c.createElement(de.Provider,{value:s},t)}let me=(0,c.createContext)(null);function fe(){let t=(0,c.useContext)(me);if(null===t){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,fe),t}return t}let ge=ut(function(t,e){let n=re(),{id:r=`headlessui-description-${n}`,...i}=t,o=fe(),s=J(e);return U(()=>o.register(r),[r,o.register]),ot({ourProps:{ref:s,...o.props,id:r},theirProps:i,slot:o.slot||{},defaultTag:"p",name:o.name||"Description"})}),ye=Object.assign(ge,{});var ve=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(ve||{}),xe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(xe||{}),we=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(we||{});let be={0:(t,e)=>t.titleId===e.id?t:{...t,titleId:e.id}},Se=(0,c.createContext)(null);function Ce(t){let e=(0,c.useContext)(Se);if(null===e){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ce),e}return e}function Ee(t,e){return nt(e.type,be,t,e)}Se.displayName="DialogContext";let Pe=rt.RenderStrategy|rt.Static,ke=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...u}=t,[d,h]=(0,c.useState)(0),p=(0,c.useRef)(!1);a="dialog"===a||"alertdialog"===a?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=(0,c.useContext)(ue);void 0===i&&null!==m&&(i=(m&ce.Open)===ce.Open);let f=(0,c.useRef)(null),g=J(f,e),y=G(f),v=t.hasOwnProperty("open")||null!==m,x=t.hasOwnProperty("onClose");if(!v&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let w=i?0:1,[b,S]=(0,c.useReducer)(Ee,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),C=H(()=>o(!1)),E=H(t=>S({type:0,id:t})),P=!!X()&&!l&&0===w,k=d>1,T=null!==(0,c.useContext)(Se),[A,j]=function(){let t=(0,c.useContext)(_t),e=(0,c.useRef)([]),n=H(n=>(e.current.push(n),t&&t.register(n),()=>r(n))),r=H(n=>{let r=e.current.indexOf(n);-1!==r&&e.current.splice(r,1),t&&t.unregister(n)}),i=(0,c.useMemo)(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,(0,c.useMemo)(()=>function({children:t}){return c.createElement(_t.Provider,{value:i},t)},[i])]}(),D={get current(){var t;return null!=(t=b.panelRef.current)?t:f.current}},{resolveContainers:O,mainTreeNodeRef:M,MainTreeNode:R}=function({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let i=(0,c.useRef)(null!=(r=null==n?void 0:n.current)?r:null),o=G(i),s=H(()=>{var n,r,s;let a=[];for(let e of t)null!==e&&(e instanceof HTMLElement?a.push(e):"current"in e&&e.current instanceof HTMLElement&&a.push(e.current));if(null!=e&&e.current)for(let t of e.current)a.push(t);for(let t of null!=(n=null==o?void 0:o.querySelectorAll("html > *, body > *"))?n:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(i.current)||t.contains(null==(s=null==(r=i.current)?void 0:r.getRootNode())?void 0:s.host)||a.some(e=>t.contains(e))||a.push(t));return a});return{resolveContainers:s,contains:H(t=>s().some(e=>e.contains(t))),mainTreeNodeRef:i,MainTreeNode:(0,c.useMemo)(()=>function(){return null!=n?null:c.createElement(pt,{features:ht.Hidden,ref:i})},[i,n])}}({portals:A,defaultContainers:[D]}),V=k?"parent":"leaf",L=null!==m&&(m&ce.Closing)===ce.Closing,F=!T&&!L&&P,N=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("body > *"))?t:[]).find(t=>"headlessui-portal-root"!==t.id&&t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(N,F);let I=!!k||P,_=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("[data-headlessui-portal]"))?t:[]).find(t=>t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(_,I),le(O,t=>{t.preventDefault(),C()},!(!P||k));let B=!(k||0!==w);W(null==y?void 0:y.defaultView,"keydown",t=>{B&&(t.defaultPrevented||t.key===ve.Escape&&(t.preventDefault(),t.stopPropagation(),C()))}),function(t,e,n=()=>[document.body]){ee(t,e,t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}})}(y,!(L||0!==w||T),O),(0,c.useEffect)(()=>{if(0!==w||!f.current)return;let t=new ResizeObserver(t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&C()}});return t.observe(f.current),()=>t.disconnect()},[w,f,C]);let[U,$]=function(){let[t,e]=(0,c.useState)([]);return[t.length>0?t.join(" "):void 0,(0,c.useMemo)(()=>function(t){let n=H(t=>(e(e=>[...e,t]),()=>e(e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))),r=(0,c.useMemo)(()=>({register:n,slot:t.slot,name:t.name,props:t.props}),[n,t.slot,t.name,t.props]);return c.createElement(me.Provider,{value:r},t.children)},[e])]}(),z=(0,c.useMemo)(()=>[{dialogState:w,close:C,setTitleId:E},b],[w,b,C,E]),q=(0,c.useMemo)(()=>({open:0===w}),[w]),Y={ref:g,id:r,role:a,"aria-modal":0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":U};return c.createElement(pe,{type:"Dialog",enabled:0===w,element:f,onUpdate:H((t,e)=>{"Dialog"===e&&nt(t,{[he.Add]:()=>h(t=>t+1),[he.Remove]:()=>h(t=>t-1)})})},c.createElement(Lt,{force:!0},c.createElement($t,null,c.createElement(Se.Provider,{value:z},c.createElement($t.Group,{target:f},c.createElement(Lt,{force:!1},c.createElement($,{slot:q,name:"Dialog.Description"},c.createElement(jt,{initialFocus:s,containers:O,features:P?nt(V,{parent:jt.features.RestoreFocus,leaf:jt.features.All&~jt.features.FocusLock}):jt.features.None},c.createElement(j,null,ot({ourProps:Y,theirProps:u,slot:q,defaultTag:"div",features:Pe,visible:0===w,name:"Dialog"}))))))))),c.createElement(R,null))}),Te=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Backdrop"),a=J(e);(0,c.useEffect)(()=>{if(null===s.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return c.createElement(Lt,{force:!0},c.createElement($t,null,ot({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Ae=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-panel-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Panel"),a=J(e,s.panelRef),l=(0,c.useMemo)(()=>({open:0===o}),[o]),u=H(t=>{t.stopPropagation()});return ot({ourProps:{ref:a,id:r,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),je=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=t,[{dialogState:o,close:s}]=Ce("Dialog.Overlay"),a=J(e),l=H(t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),s()}});return ot({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:l},theirProps:i,slot:(0,c.useMemo)(()=>({open:0===o}),[o]),defaultTag:"div",name:"Dialog.Overlay"})}),De=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:o,setTitleId:s}]=Ce("Dialog.Title"),a=J(e);(0,c.useEffect)(()=>(s(r),()=>s(null)),[r,s]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return ot({ourProps:{ref:a,id:r},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Oe=Object.assign(ke,{Backdrop:Te,Panel:Ae,Overlay:je,Title:De,Description:ye});const Me=(0,c.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Re=(0,c.createContext)({}),Ve=(0,c.createContext)(null),Le="undefined"!=typeof document,Fe=Le?c.useLayoutEffect:c.useEffect,Ne=(0,c.createContext)({strict:!1}),Ie=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_e="data-"+Ie("framerAppearId");function Be(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ue(t){return"string"==typeof t||Array.isArray(t)}function $e(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const He=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],We=["initial",...He];function ze(t){return $e(t.animate)||We.some(e=>Ue(t[e]))}function qe(t){return Boolean(ze(t)||t.variants)}function Ye(t){return Array.isArray(t)?t.join(" "):t}const Ge={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xe={};for(const t in Ge)Xe[t]={isEnabled:e=>Ge[t].some(t=>!!e[t])};const Ze=(0,c.createContext)({}),Je=(0,c.createContext)({}),Ke=Symbol.for("motionComponentSymbol");function Qe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&function(t){for(const e in t)Xe[e]={...Xe[e],...t[e]}}(t);const o=(0,c.forwardRef)(function(o,s){let a;const l={...(0,c.useContext)(Me),...o,layoutId:tn(o)},{isStatic:u}=l,d=function(t){const{initial:e,animate:n}=function(t,e){if(ze(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ue(e)?e:void 0,animate:Ue(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,c.useContext)(Re));return(0,c.useMemo)(()=>({initial:e,animate:n}),[Ye(e),Ye(n)])}(o),h=r(o,u);if(!u&&Le){d.visualElement=function(t,e,n,r){const{visualElement:i}=(0,c.useContext)(Re),o=(0,c.useContext)(Ne),s=(0,c.useContext)(Ve),a=(0,c.useContext)(Me).reducedMotion,l=(0,c.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const u=l.current;(0,c.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,c.useRef)(Boolean(n[_e]&&!window.HandoffComplete));return Fe(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,c.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,l,e);const n=(0,c.useContext)(Je),r=(0,c.useContext)(Ne).strict;d.visualElement&&(a=d.visualElement.loadFeatures(l,r,t,n))}return c.createElement(Re.Provider,{value:d},a&&d.visualElement?c.createElement(a,{visualElement:d.visualElement,...l}):null,n(i,o,function(t,e,n){return(0,c.useCallback)(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Be(n)&&(n.current=r))},[e])}(h,d.visualElement,s),h,u,d.visualElement))});return o[Ke]=i,o}function tn({layoutId:t}){const e=(0,c.useContext)(Ze).id;return e&&void 0!==t?e+"-"+t:t}function en(t){function e(e,n={}){return Qe(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const nn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rn(t){return"string"==typeof t&&!t.includes("-")&&!!(nn.indexOf(t)>-1||/[A-Z]/.test(t))}const on={},sn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],an=new Set(sn);function ln(t,{layout:e,layoutId:n}){return an.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!on[t]||"opacity"===t)}const un=t=>Boolean(t&&t.getVelocity),cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dn=sn.length,hn=t=>e=>"string"==typeof e&&e.startsWith(t),pn=hn("--"),mn=hn("var(--"),fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,gn=(t,e,n)=>Math.min(Math.max(n,t),e),yn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vn={...yn,transform:t=>gn(0,1,t)},xn={...yn,default:1},wn=t=>Math.round(1e5*t)/1e5,bn=/(-)?([\d]*\.?[\d])+/g,Sn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Cn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function En(t){return"string"==typeof t}const Pn=t=>({test:e=>En(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),kn=Pn("deg"),Tn=Pn("%"),An=Pn("px"),jn=Pn("vh"),Dn=Pn("vw"),On={...Tn,parse:t=>Tn.parse(t)/100,transform:t=>Tn.transform(100*t)},Mn={...yn,transform:Math.round},Rn={borderWidth:An,borderTopWidth:An,borderRightWidth:An,borderBottomWidth:An,borderLeftWidth:An,borderRadius:An,radius:An,borderTopLeftRadius:An,borderTopRightRadius:An,borderBottomRightRadius:An,borderBottomLeftRadius:An,width:An,maxWidth:An,height:An,maxHeight:An,size:An,top:An,right:An,bottom:An,left:An,padding:An,paddingTop:An,paddingRight:An,paddingBottom:An,paddingLeft:An,margin:An,marginTop:An,marginRight:An,marginBottom:An,marginLeft:An,rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:xn,scaleX:xn,scaleY:xn,scaleZ:xn,skew:kn,skewX:kn,skewY:kn,distance:An,translateX:An,translateY:An,translateZ:An,x:An,y:An,z:An,perspective:An,transformPerspective:An,opacity:vn,originX:On,originY:On,originZ:An,zIndex:Mn,fillOpacity:vn,strokeOpacity:vn,numOctaves:Mn};function Vn(t,e,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(pn(t)){o[t]=n;continue}const r=Rn[t],d=fn(n,r);if(an.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):i[t]=d}if(e.transform||(l||r?i.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,i){let o="";for(let e=0;e<dn;e++){const n=sn[e];void 0!==t[n]&&(o+=`${cn[n]||n}(${t[n]}) `)}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,r?"":o):n&&r&&(o="none"),o}(t.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;i.transformOrigin=`${t} ${e} ${n}`}}function Ln(t,e,n){for(const r in e)un(e[r])||ln(r,n)||(t[r]=e[r])}function Fn(t,e,n){const r={},i=function(t,e,n){const r={};return Ln(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,c.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Vn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=i,r}const Nn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function In(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Nn.has(t)}let Bn=t=>!In(t);try{(Un=require("@emotion/is-prop-valid").default)&&(Bn=t=>t.startsWith("on")?!In(t):Un(t))}catch(t){}var Un;function $n(t,e,n){return"string"==typeof t?t:An.transform(e+n*t)}const Hn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wn={offset:"strokeDashoffset",array:"strokeDasharray"};function zn(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(Vn(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:f}=t;p.transform&&(f&&(m.transform=p.transform),delete p.transform),f&&(void 0!==i||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${$n(e,t.x,t.width)} ${$n(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,i=!0){t.pathLength=1;const o=i?Hn:Wn;t[o.offset]=An.transform(-r);const s=An.transform(e),a=An.transform(n);t[o.array]=`${s} ${a}`}(p,s,a,l,!1)}const qn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yn(t,e,n,r){const i=(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zn(n,e,{enableHardwareAcceleration:!1},qn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ln(e,t.style,t),i.style={...e,...i.style}}return i}function Gn(t=!1){return(e,n,r,{latestValues:i},o)=>{const s=(rn(e)?Yn:Fn)(n,i,o,e),a=function(t,e,n){const r={};for(const i in t)"values"===i&&"object"==typeof t.values||(Bn(i)||!0===n&&In(i)||!e&&!In(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}(n,"string"==typeof e,t),l={...a,...s,ref:r},{children:u}=n,d=(0,c.useMemo)(()=>un(u)?u.get():u,[u]);return(0,c.createElement)(e,{...l,children:d})}}function Xn(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Zn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Jn(t,e,n,r){Xn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Zn.has(n)?n:Ie(n),e.attrs[n])}function Kn(t,e){const{style:n}=t,r={};for(const i in n)(un(n[i])||e.style&&un(e.style[i])||ln(i,t))&&(r[i]=n[i]);return r}function Qn(t,e){const n=Kn(t,e);for(const r in t)(un(t[r])||un(e[r]))&&(n[-1!==sn.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function tr(t,e,n,r={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),e}const er=t=>Array.isArray(t),nr=t=>er(t)?t[t.length-1]||0:t;function rr(t){const e=un(t)?t.get():t;return(t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue))(e)?e.toValue():e}const ir=t=>(e,n)=>{const r=(0,c.useContext)(Re),i=(0,c.useContext)(Ve),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,o){const s={latestValues:or(r,i,o,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(t,e,r,i);return n?o():function(t){const e=(0,c.useRef)(null);return null===e.current&&(e.current=t()),e.current}(o)};function or(t,e,n,r){const i={},o=r(t,{});for(const t in o)i[t]=rr(o[t]);let{initial:s,animate:a}=t;const l=ze(t),u=qe(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!$e(d)&&(Array.isArray(d)?d:[d]).forEach(e=>{const n=tr(t,e);if(!n)return;const{transitionEnd:r,transition:o,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(i[t]=e)}for(const t in r)i[t]=r[t]}),i}const sr=t=>t;class ar{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const lr=["prepare","read","update","preRender","render","postRender"],{schedule:ur,cancel:cr,state:dr,steps:hr}=function(t){let e=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=lr.reduce((t,n)=>(t[n]=function(t){let e=new ar,n=new ar,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,u=l?e:n;return o&&s.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>e=!0),t),{}),o=t=>i[t].process(r),s=()=>{const i=performance.now();e=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,lr.forEach(o),r.isProcessing=!1,e&&(n=!1,t(s))};return{schedule:lr.reduce((o,a)=>{const l=i[a];return o[a]=(i,o=!1,a=!1)=>(e||(e=!0,n=!0,r.isProcessing||t(s)),l.schedule(i,o,a)),o},{}),cancel:t=>lr.forEach(e=>i[e].cancel(t)),state:r,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:sr),pr={useVisualState:ir({scrapeMotionValuesFromProps:Qn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(t,e,{renderState:n,latestValues:r})=>{ur.read(()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}}),ur.render(()=>{zn(n,r,{enableHardwareAcceleration:!1},qn(e.tagName),t.transformTemplate),Jn(e,n)})}})},mr={useVisualState:ir({scrapeMotionValuesFromProps:Kn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const gr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function yr(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function vr(t,e,n,r){return fr(t,e,(t=>e=>gr(e)&&t(e,yr(e)))(n),r)}const xr=(t,e)=>n=>e(t(n)),wr=(...t)=>t.reduce(xr);function br(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const Sr=br("dragHorizontal"),Cr=br("dragVertical");function Er(t){let e=!1;if("y"===t)e=Cr();else if("x"===t)e=Sr();else{const t=Sr(),n=Cr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pr(){const t=Er(!0);return!t||(t(),!1)}class kr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tr(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return vr(t.current,n,(n,i)=>{if("touch"===n.pointerType||Pr())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[r]&&ur.update(()=>o[r](n,i))},{passive:!t.getProps()[r]})}const Ar=(t,e)=>!!e&&(t===e||Ar(t,e.parentElement));function jr(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,yr(n))}const Dr=new WeakMap,Or=new WeakMap,Mr=t=>{const e=Dr.get(t.target);e&&e(t)},Rr=t=>{t.forEach(Mr)};const Vr={some:0,all:1},Lr={inView:{Feature:class extends kr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Vr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Or.has(n)||Or.set(n,{});const r=Or.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Rr,{root:t,...e})),r[i]}(e);return Dr.set(t,n),r.observe(t),()=>{Dr.delete(t),r.unobserve(t)}}(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=e?n:r;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends kr{constructor(){super(...arguments),this.removeStartListeners=sr,this.removeEndListeners=sr,this.removeAccessibleListeners=sr,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=vr(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();ur.update(()=>{i||Ar(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)})},{passive:!(n.onTap||n.onPointerUp)}),i=vr(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=wr(r,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=fr(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=fr(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&jr("up",(t,e)=>{const{onTap:n}=this.node.getProps();n&&ur.update(()=>n(t,e))})}),jr("down",(t,e)=>{this.startPress(t,e)}))}),e=fr(this.node.current,"blur",()=>{this.isPressing&&jr("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=wr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ur.update(()=>n(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ur.update(()=>n(t,e))}mount(){const t=this.node.getProps(),e=vr(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=fr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=wr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends kr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wr(fr(this.node.current,"focus",()=>this.onFocus()),fr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends kr{mount(){this.unmount=wr(Tr(this.node,!0),Tr(this.node,!1))}unmount(){}}}};function Fr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Nr(t,e,n){const r=t.getProps();return tr(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}let Ir=sr,_r=sr;const Br=t=>1e3*t,Ur=t=>t/1e3,$r=t=>Array.isArray(t)&&"number"==typeof t[0];function Hr(t){return Boolean(!t||"string"==typeof t&&zr[t]||$r(t)||Array.isArray(t)&&t.every(Hr))}const Wr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,zr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function qr(t){if(t)return $r(t)?Wr(t):Array.isArray(t)?t.map(qr):zr[t]}const Yr=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Gr(t,e,n,r){if(t===e&&n===r)return sr;return i=>0===i||1===i?i:Yr(function(t,e,n,r,i){let o,s,a=0;do{s=e+(n-e)/2,o=Yr(s,r,i)-t,o>0?n=s:e=s}while(Math.abs(o)>1e-7&&++a<12);return s}(i,0,1,t,n),e,r)}const Xr=Gr(.42,0,1,1),Zr=Gr(0,0,.58,1),Jr=Gr(.42,0,.58,1),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qr=t=>e=>1-t(1-e),ti=t=>1-Math.sin(Math.acos(t)),ei=Qr(ti),ni=Kr(ti),ri=Gr(.33,1.53,.69,.99),ii=Qr(ri),oi=Kr(ii),si={linear:sr,easeIn:Xr,easeInOut:Jr,easeOut:Zr,circIn:ti,circInOut:ni,circOut:ei,backIn:ii,backInOut:oi,backOut:ri,anticipate:t=>(t*=2)<1?.5*ii(t):.5*(2-Math.pow(2,-10*(t-1)))},ai=t=>{if(Array.isArray(t)){_r(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return Gr(e,n,r,i)}return"string"==typeof t?(_r(void 0!==si[t],`Invalid easing type '${t}'`),si[t]):t},li=(t,e)=>n=>Boolean(En(n)&&Cn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ui=(t,e,n)=>r=>{if(!En(r))return r;const[i,o,s,a]=r.match(bn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ci={...yn,transform:t=>Math.round((t=>gn(0,255,t))(t))},di={test:li("rgb","red"),parse:ui("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ci.transform(t)+", "+ci.transform(e)+", "+ci.transform(n)+", "+wn(vn.transform(r))+")"},hi={test:li("#"),parse:function(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:di.transform},pi={test:li("hsl","hue"),parse:ui("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Tn.transform(wn(e))+", "+Tn.transform(wn(n))+", "+wn(vn.transform(r))+")"},mi={test:t=>di.test(t)||hi.test(t)||pi.test(t),parse:t=>di.test(t)?di.parse(t):pi.test(t)?pi.parse(t):hi.parse(t),transform:t=>En(t)?t:t.hasOwnProperty("red")?di.transform(t):pi.transform(t)},fi=(t,e,n)=>-n*t+n*e+t;function gi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const yi=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},vi=[hi,di,pi];function xi(t){const e=(t=>vi.find(e=>e.test(t)))(t);_r(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===pi&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let i=0,o=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;i=gi(a,r,t+1/3),o=gi(a,r,t),s=gi(a,r,t-1/3)}else i=o=s=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:r}}(n)),n}const wi=(t,e)=>{const n=xi(t),r=xi(e),i={...n};return t=>(i.red=yi(n.red,r.red,t),i.green=yi(n.green,r.green,t),i.blue=yi(n.blue,r.blue,t),i.alpha=fi(n.alpha,r.alpha,t),di.transform(i))},bi={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:sr},Si={regex:Sn,countKey:"Colors",token:"${c}",parse:mi.parse},Ci={regex:bn,countKey:"Numbers",token:"${n}",parse:yn.parse};function Ei(t,{regex:e,countKey:n,token:r,parse:i}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...o.map(i)))}function Pi(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ei(n,bi),Ei(n,Si),Ei(n,Ci),n}function ki(t){return Pi(t).values}function Ti(t){const{values:e,numColors:n,numVars:r,tokenised:i}=Pi(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=i<r?e.replace(bi.token,t[i]):i<r+n?e.replace(Si.token,mi.transform(t[i])):e.replace(Ci.token,wn(t[i]));return e}}const Ai=t=>"number"==typeof t?0:t,ji={test:function(t){var e,n;return isNaN(t)&&En(t)&&((null===(e=t.match(bn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Sn))||void 0===n?void 0:n.length)||0)>0},parse:ki,createTransformer:Ti,getAnimatableNone:function(t){const e=ki(t);return Ti(t)(e.map(Ai))}},Di=(t,e)=>n=>`${n>0?e:t}`;function Oi(t,e){return"number"==typeof t?n=>fi(t,e,n):mi.test(t)?wi(t,e):t.startsWith("var(")?Di(t,e):Vi(t,e)}const Mi=(t,e)=>{const n=[...t],r=n.length,i=t.map((t,n)=>Oi(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=i[e](t);return n}},Ri=(t,e)=>{const n={...t,...e},r={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(r[i]=Oi(t[i],e[i]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Vi=(t,e)=>{const n=ji.createTransformer(e),r=Pi(t),i=Pi(e);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?wr(Mi(r.values,i.values),n):(Ir(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Di(t,e))},Li=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Fi=(t,e)=>n=>fi(t,e,n);function Ni(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const o=t.length;if(_r(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],i=n||function(t){return"number"==typeof t?Fi:"string"==typeof t?mi.test(t)?wi:Vi:Array.isArray(t)?Mi:"object"==typeof t?Ri:Fi}(t[0]),o=t.length-1;for(let n=0;n<o;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||sr:e;o=wr(t,o)}r.push(o)}return r}(e,r,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Li(t[n],t[n+1],e);return s[n](r)};return n?e=>l(gn(t[0],t[o-1],e)):l}function Ii({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(r)?r.map(ai):ai(r),o={done:!1,value:e[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Li(0,e,r);t.push(fi(n,1,i))}}(e,t.length-1),e}(e),t),a=Ni(s,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||Jr).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}function _i(t,e){return e?t*(1e3/e):0}function Bi(t,e,n){const r=Math.max(e-5,0);return _i(n-t(r),e-r)}const Ui=12;function $i(t,e){return t*Math.sqrt(1-e*e)}const Hi=["duration","bounce"],Wi=["stiffness","damping","mass"];function zi(t,e){return e.some(e=>void 0!==t[e])}function qi({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],o=t[t.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!zi(t,Wi)&&zi(t,Hi)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,o;Ir(t<=Br(10),"Spring duration must be 10 seconds or less");let s=1-e;s=gn(.05,1,s),t=gn(.01,10,Ur(t)),s<1?(i=e=>{const r=e*s,i=r*t;return.001-(r-n)/$i(e,s)*Math.exp(-i)},o=e=>{const r=e*s*t,o=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=$i(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((o-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Ui;n++)r-=t(r)/e(r);return r}(i,o,5/t);if(t=Br(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...r,velocity:-Ur(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(a*u)),f=o-i,g=Ur(Math.sqrt(a/u)),y=Math.abs(f)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),m<1){const t=$i(g,m);v=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)v=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);v=e=>{const n=Math.exp(-m*g*e),r=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(r)+t*f*Math.cosh(r))/t}}return{calculatedDuration:h&&c||null,next:t=>{const r=v(t);if(h)s.done=t>=c;else{let i=p;0!==t&&(i=m<1?Bi(v,t,r):0);const a=Math.abs(i)<=n,l=Math.abs(o-r)<=e;s.done=a&&l}return s.value=s.done?o:r,s}}}function Yi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=d+m,g=void 0===s?f:s(f);g!==f&&(m=g-d);const y=t=>-m*Math.exp(-t/r),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let w,b;const S=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(w=t,b=qi({keyframes:[h.value,p(h.value)],velocity:Bi(v,t,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>w?b.next(t-w):(!e&&x(t),h)}}}const Gi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>ur.update(e,!0),stop:()=>cr(e),now:()=>dr.isProcessing?dr.timestamp:performance.now()}};function Xi(t){let e=0,n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const Zi={decay:Yi,inertia:Yi,tween:Ii,keyframes:Ii,spring:qi};function Ji({autoplay:t=!0,delay:e=0,driver:n=Gi,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,m,f=1,g=!1;const y=()=>{m=new Promise(t=>{p=t})};let v;y();const x=Zi[i]||Ii;let w;x!==Ii&&"number"!=typeof r[0]&&(w=Ni([0,100],r,{clamp:!1}),r=[0,100]);const b=x({...h,keyframes:r});let S;"mirror"===a&&(S=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let C="idle",E=null,P=null,k=null;null===b.calculatedDuration&&o&&(b.calculatedDuration=Xi(b));const{calculatedDuration:T}=b;let A=1/0,j=1/0;null!==T&&(A=T+s,j=A*(o+1)-s);let D=0;const O=t=>{if(null===P)return;f>0&&(P=Math.min(P,t)),f<0&&(P=Math.min(t-j/f,P)),D=null!==E?E:Math.round(t-P)*f;const n=D-e*(f>=0?1:-1),i=f>=0?n<0:n>j;D=Math.max(n,0),"finished"===C&&null===E&&(D=j);let l=D,u=b;if(o){const t=Math.min(D,j)/A;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,o+1),Boolean(e%2)&&("reverse"===a?(n=1-n,s&&(n-=s/A)):"mirror"===a&&(u=S)),l=gn(0,1,n)*A}const c=i?{done:!1,value:r[0]}:u.next(l);w&&(c.value=w(c.value));let{done:h}=c;i||null===T||(h=f>=0?D>=j:D<=0);const p=null===E&&("finished"===C||"running"===C&&h);return d&&d(c.value),p&&V(),c},M=()=>{v&&v.stop(),v=void 0},R=()=>{C="idle",M(),p(),y(),P=k=null},V=()=>{C="finished",c&&c(),M(),p()},L=()=>{if(g)return;v||(v=n(O));const t=v.now();l&&l(),null!==E?P=t-E:P&&"finished"!==C||(P=t),"finished"===C&&y(),k=P,E=null,C="running",v.start()};t&&L();const F={then:(t,e)=>m.then(t,e),get time(){return Ur(D)},set time(t){t=Br(t),D=t,null===E&&v&&0!==f?P=v.now()-t/f:E=t},get duration(){const t=null===b.calculatedDuration?Xi(b):b.calculatedDuration;return Ur(t)},get speed(){return f},set speed(t){t!==f&&v&&(f=t,F.time=Ur(D))},get state(){return C},play:L,pause:()=>{C="paused",E=D},stop:()=>{g=!0,"idle"!==C&&(C="idle",u&&u(),R())},cancel:()=>{null!==k&&O(k),R()},complete:()=>{C="finished"},sample:t=>(P=0,O(t))};return F}const Ki=function(){let t;return()=>(void 0===t&&(t=Object.hasOwnProperty.call(Element.prototype,"animate")),t)}(),Qi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const to={type:"spring",stiffness:500,damping:25,restSpeed:10},eo={type:"keyframes",duration:.8},no={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ro=(t,{keyframes:e})=>e.length>2?eo:an.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:to:no,io=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!ji.test(e)&&"0"!==e||e.startsWith("url("))),oo=new Set(["brightness","contrast","saturate","opacity"]);function so(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(bn)||[];if(!r)return t;const i=n.replace(r,"");let o=oo.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+i+")"}const ao=/([a-z-]*)\(.*?\)/g,lo={...ji,getAnimatableNone:t=>{const e=t.match(ao);return e?e.map(so).join(" "):t}},uo={...Rn,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:lo,WebkitFilter:lo},co=t=>uo[t];function ho(t,e){let n=co(t);return n!==lo&&(n=ji),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const po=t=>/^0[^.\s]+$/.test(t);function mo(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||po(t):void 0}function fo(t,e){return t[e]||t.default||t}const go=(t,e,n,r={})=>i=>{const o=fo(r,t)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Br(s);const l=function(t,e,n,r){const i=io(e,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<o.length;t++)null===o[t]&&(o[t]=0===t?s:o[t-1]),mo(o[t])&&l.push(t),"string"==typeof o[t]&&"none"!==o[t]&&"0"!==o[t]&&(a=o[t]);if(i&&l.length&&a)for(let t=0;t<l.length;t++)o[l[t]]=ho(e,a);return o}(e,t,n,o),u=l[0],c=l[l.length-1],d=io(t,u),h=io(t,c);Ir(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(o)||(p={...p,...ro(t,p)}),p.duration&&(p.duration=Br(p.duration)),p.repeatDelay&&(p.repeatDelay=Br(p.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const i=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:sr,pause:sr,stop:sr,then:t=>(t(),Promise.resolve()),cancel:sr,complete:sr});return e?Ji({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}(p);if(!r.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...i}){if(!Ki()||!Qi.has(e)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,s,a=!1,l=!1;const u=()=>{s=new Promise(t=>{o=t})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=i;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Hr(e.ease))(e,i)){const t=Ji({...i,repeat:0,delay:0});let e={done:!1,value:c[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;p=void 0,c=n,d=r-10,h="linear"}const m=function(t,e,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=qr(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,c,{...i,duration:d,ease:h,times:p}),f=()=>{l=!1,m.cancel()},g=()=>{l=!0,ur.update(f),o(),u()};return m.onfinish=()=>{l||(t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(c,i)),r&&r(),g())},{then:(t,e)=>s.then(t,e),attachTimeline:t=>(m.timeline=t,m.onfinish=null,sr),get time(){return Ur(m.currentTime||0)},set time(t){m.currentTime=Br(t)},get speed(){return m.playbackRate},set speed(t){m.playbackRate=t},get duration(){return Ur(d)},play:()=>{a||(m.play(),cr(f))},pause:()=>m.pause(),stop:()=>{if(a=!0,"idle"===m.playState)return;const{currentTime:e}=m;if(e){const n=Ji({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}g()},complete:()=>{l||m.finish()},cancel:g}}(e,t,p);if(n)return n}return Ji(p)};function yo(t){return Boolean(un(t)&&t.add)}const vo=t=>/^\-?\d*\.?\d+$/.test(t);function xo(t,e){-1===t.indexOf(e)&&t.push(e)}function wo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class bo{constructor(){this.subscriptions=[]}add(t){return xo(this.subscriptions,t),()=>wo(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const So={current:void 0};class Co{constructor(t,e={}){var n;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=dr;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ur.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ur.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new bo);const n=this.events[t].add(e);return"change"===t?()=>{n(),ur.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return So.current&&So.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?_i(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eo(t,e){return new Co(t,e)}const Po=t=>e=>e.test(t),ko=[yn,An,Tn,kn,Dn,jn,{test:t=>"auto"===t,parse:t=>t}],To=t=>ko.find(Po(t)),Ao=[...ko,mi,ji],jo=t=>Ao.find(Po(t));function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Eo(n))}function Oo(t,e){if(e)return(e[t]||e.default||e).from}function Mo({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Ro(t,e){const n=t.get();if(!Array.isArray(e))return n!==e;for(let t=0;t<e.length;t++)if(e[t]!==n)return!0}function Vo(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(o=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const r=t.getValue(e),i=a[e];if(!r||void 0===i||c&&Mo(c,e))continue;const s={delay:n,elapsed:0,...fo(o||{},e)};if(window.HandoffAppearAnimations){const n=t.getProps()[_e];if(n){const t=window.HandoffAppearAnimations(n,e,r,ur);null!==t&&(s.elapsed=t,s.isHandoff=!0)}}let d=!s.isHandoff&&!Ro(r,i);if("spring"===s.type&&(r.getVelocity()||s.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(go(e,r,i,t.shouldReduceMotion&&an.has(e)?{type:!1}:s));const h=r.animation;yo(l)&&(l.add(e),h.then(()=>l.remove(e))),u.push(h)}return s&&Promise.all(u).then(()=>{s&&function(t,e){const n=Nr(t,e);let{transitionEnd:r={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o)Do(t,e,nr(o[e]))}(t,s)}),u}function Lo(t,e,n={}){const r=Nr(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Vo(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,r=0,i=1,o){const s=[],a=(t.variantChildren.size-1)*r,l=1===i?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Fo).forEach((t,r)=>{t.notify("AnimationStart",e),s.push(Lo(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,o+r,s,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,s]:[s,o];return t().then(()=>e())}return Promise.all([o(),s(n.delay)])}function Fo(t,e){return t.sortNodePosition(e)}const No=[...He].reverse(),Io=He.length;function _o(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Lo(t,e,n));r=Promise.all(i)}else if("string"==typeof e)r=Lo(t,e,n);else{const i="function"==typeof e?Nr(t,e,n.custom):e;r=Promise.all(Vo(t,i,n))}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}(t);const n={animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()};let r=!0;const i=(e,n)=>{const r=Nr(t,n);if(r){const{transition:t,transitionEnd:n,...i}=r;e={...e,...i,...n}}return e};function o(o,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Io;e++){const p=No[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Ue(f),y=p===s?m.isActive:null;!1===y&&(h=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&r&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&null===y||!f&&!m.prevProp||$e(f)||"boolean"==typeof f)continue;let x=Bo(m.prevProp,f)||p===s&&m.isActive&&!v&&g||e>h&&g,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(i,{});!1===y&&(S={});const{prevResolvedValues:C={}}=m,E={...C,...S},P=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0};for(const t in E){const e=S[t],n=C[t];if(d.hasOwnProperty(t))continue;let r=!1;r=er(e)&&er(n)?!Fr(e,n):e!==n,r?void 0!==e?P(t):c.add(t):void 0!==e&&c.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&t.blockInitialAnimation&&(x=!1),!x||v&&!w||u.push(...b.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let p=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),r=!1,p?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,i){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Bo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Fr(e,t)}function Uo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $o=0;const Ho={animation:{Feature:class extends kr{constructor(t){super(t),t.animationState||(t.animationState=_o(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$e(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends kr{constructor(){super(...arguments),this.id=$o++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Wo=(t,e)=>Math.abs(t-e);class zo{constructor(t,e,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Go(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Wo(t.x,e.x),r=Wo(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:i}=dr;this.history.push({...r,timestamp:i});const{onStart:o,onMove:s}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=qo(e,this.transformPagePoint),ur.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Go("pointercancel"===t.type?this.lastMoveEventInfo:qo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!gr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=r||window;const o=qo(yr(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=dr;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Go(o,this.history)),this.removeListeners=wr(vr(this.contextWindow,"pointermove",this.handlePointerMove),vr(this.contextWindow,"pointerup",this.handlePointerUp),vr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cr(this.updatePoint)}}function qo(t,e){return e?{point:e(t.point)}:t}function Yo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return{point:t,delta:Yo(t,Zo(e)),offset:Yo(t,Xo(e)),velocity:Jo(e,.1)}}function Xo(t){return t[0]}function Zo(t){return t[t.length-1]}function Jo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Zo(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Br(e)));)n--;if(!r)return{x:0,y:0};const o=Ur(i.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ko(t){return t.max-t.min}function Qo(t,e=0,n=.01){return Math.abs(t-e)<=n}function ts(t,e,n,r=.5){t.origin=r,t.originPoint=fi(e.min,e.max,t.origin),t.scale=Ko(n)/Ko(e),(Qo(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=fi(n.min,n.max,t.origin)-t.originPoint,(Qo(t.translate)||isNaN(t.translate))&&(t.translate=0)}function es(t,e,n,r){ts(t.x,e.x,n.x,r?r.originX:void 0),ts(t.y,e.y,n.y,r?r.originY:void 0)}function ns(t,e,n){t.min=n.min+e.min,t.max=t.min+Ko(e)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+Ko(e)}function is(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function os(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ss(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const as=.35;function ls(t,e,n){return{min:us(t,e),max:us(t,n)}}function us(t,e){return"number"==typeof t?t:t[e]||0}const cs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ds(t){return[t("x"),t("y")]}function hs({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ps(t){return void 0===t||1===t}function ms({scale:t,scaleX:e,scaleY:n}){return!ps(t)||!ps(e)||!ps(n)}function fs(t){return ms(t)||gs(t)||t.z||t.rotate||t.rotateX||t.rotateY}function gs(t){return ys(t.x)||ys(t.y)}function ys(t){return t&&"0%"!==t}function vs(t,e,n){return n+e*(t-n)}function xs(t,e,n,r,i){return void 0!==i&&(t=vs(t,i,r)),vs(t,n,r)+e}function ws(t,e=0,n=1,r,i){t.min=xs(t.min,e,n,r,i),t.max=xs(t.max,e,n,r,i)}function bs(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}function Ss(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function Es(t,e,[n,r,i]){const o=void 0!==e[i]?e[i]:.5,s=fi(t.min,t.max,o);ws(t,e[n],e[r],s,e.scale)}const Ps=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ts(t,e){Es(t.x,e,Ps),Es(t.y,e,ks)}function As(t,e){return hs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const js=({current:t})=>t?t.ownerDocument.defaultView:null,Ds=new WeakMap;class Os{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new zo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(yr(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Er(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ds(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Tn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Ko(r)*(parseFloat(e)/100))}}this.originPoint[t]=e}),i&&ur.update(()=>i(t,e),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>ds(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:js(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:i}=this.getProps();i&&ur.update(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Ms(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?fi(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?fi(n,t,r.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,i=this.constraints;e&&Be(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!r)&&function(t,{top:e,left:n,bottom:r,right:i}){return{x:os(t.x,n,i),y:os(t.y,e,r)}}(r.layoutBox,e),this.elastic=function(t=as){return!1===t?t=0:!0===t&&(t=as),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ds(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Be(t))return!1;const n=t.current;_r(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(t,e,n){const r=As(t,n),{scroll:i}=e;return i&&(Cs(r.x,i.offset.x),Cs(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ss(t.x,e.x),y:ss(t.y,e.y)}}(r.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=hs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ds(s=>{if(!Ms(s,e,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(go(t,n,0,e))}stopAnimation(){ds(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ds(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ds(e=>{const{drag:n}=this.getProps();if(!Ms(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[e];i.set(t[e]-fi(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Be(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ds(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Ko(t),i=Ko(e);return i>r?n=Li(e.min,e.max-r,t.min):r>i&&(n=Li(t.min,t.max-i,e.min)),gn(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ds(e=>{if(!Ms(e,t,null))return;const n=this.getAxisMotionValue(e),{min:i,max:o}=this.constraints[e];n.set(fi(i,o,r[e]))})}addListeners(){if(!this.visualElement.current)return;Ds.set(this.visualElement,this);const t=vr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();Be(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=fr(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ds(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),r(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=as,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function Ms(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Rs=t=>(e,n)=>{t&&ur.update(()=>t(e,n))},Vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ls(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!An.test(t))return t;t=parseFloat(t)}return`${Ls(t,e.target.x)}% ${Ls(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=ji.parse(t);if(i.length>5)return r;const o=ji.createTransformer(t),s="number"!=typeof i[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=a,i[1+s]/=l;const u=fi(a,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=u),"number"==typeof i[3+s]&&(i[3+s]/=u),o(i)}};class Is extends c.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=t;var o;o=Bs,Object.assign(on,o),i&&(e.group&&e.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,r||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ur.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _s(t){const[e,n]=function(){const t=(0,c.useContext)(Ve);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=(0,c.useId)();return(0,c.useEffect)(()=>r(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),r=(0,c.useContext)(Ze);return c.createElement(Is,{...t,layoutGroup:r,switchLayoutGroup:(0,c.useContext)(Je),isPresent:e,safeToRemove:n})}const Bs={borderRadius:{...Fs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fs,borderTopRightRadius:Fs,borderBottomLeftRadius:Fs,borderBottomRightRadius:Fs,boxShadow:Ns},Us=["TopLeft","TopRight","BottomLeft","BottomRight"],$s=Us.length,Hs=t=>"string"==typeof t?parseFloat(t):t,Ws=t=>"number"==typeof t||An.test(t);function zs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const qs=Gs(0,.5,ei),Ys=Gs(.5,.95,sr);function Gs(t,e,n){return r=>r<t?0:r>e?1:n(Li(t,e,r))}function Xs(t,e){t.min=e.min,t.max=e.max}function Zs(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Js(t,e,n,r,i){return t=vs(t-=e,1/n,r),void 0!==i&&(t=vs(t,1/i,r)),t}function Ks(t,e,[n,r,i],o,s){!function(t,e=0,n=1,r=.5,i,o=t,s=t){if(Tn.test(e)&&(e=parseFloat(e),e=fi(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=fi(o.min,o.max,r);t===o&&(a-=e),t.min=Js(t.min,e,n,a,i),t.max=Js(t.max,e,n,a,i)}(t,e[n],e[r],e[i],e.scale,o,s)}const Qs=["x","scaleX","originX"],ta=["y","scaleY","originY"];function ea(t,e,n,r){Ks(t.x,e,Qs,n?n.x:void 0,r?r.x:void 0),Ks(t.y,e,ta,n?n.y:void 0,r?r.y:void 0)}function na(t){return 0===t.translate&&1===t.scale}function ra(t){return na(t.x)&&na(t.y)}function ia(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function oa(t){return Ko(t.x)/Ko(t.y)}class sa{constructor(){this.members=[]}add(t){xo(this.members,t),t.scheduleRender()}remove(t){if(wo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function aa(t,e,n){let r="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),i&&(r+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const la=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){xo(this.children,t),this.isDirty=!0}remove(t){wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(la),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"],da={visibility:"hidden"};let ha=0;const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function ma({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ha++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;this.projectionUpdateScheduled=!1,pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0,this.nodes.forEach(ya),this.nodes.forEach(Ea),this.nodes.forEach(Pa),this.nodes.forEach(va),t=pa,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ua)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t){const e=performance.now(),n=({timestamp:r})=>{const i=r-e;i>=250&&(cr(n),t(i-250))};return ur.read(n,!0),()=>cr(n)}(r),Vs.hasAnimatedSinceResize&&(Vs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ca))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||s.getDefaultTransition()||Oa,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ia(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...fo(i,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Ca(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ka),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(wa);this.isUpdating||this.nodes.forEach(ba),this.isUpdating=!1,this.nodes.forEach(Sa),this.nodes.forEach(fa),this.nodes.forEach(ga),this.clearAllSnapshots();const t=performance.now();dr.delta=gn(0,1e3/60,t-dr.timestamp),dr.timestamp=t,dr.isProcessing=!0,hr.update.process(dr),hr.preRender.process(dr),hr.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(xa),this.sharedNodes.forEach(Ta)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ur.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ur.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ra(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;t&&(e||fs(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Va((r=n).x),Va(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Cs(e.x,n.offset.x),Cs(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:o}=r;if(r!==this.root&&i&&o.layoutScroll){if(i.isRoot){Zs(e,t);const{scroll:n}=this.root;n&&(Cs(e.x,-n.offset.x),Cs(e.y,-n.offset.y))}Cs(e.x,i.offset.x),Cs(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Zs(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ts(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fs(r.latestValues)&&Ts(n,r.latestValues)}return fs(this.latestValues)&&Ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fs(n.latestValues))continue;ms(n.latestValues)&&n.updateSnapshot();const r=cs();Zs(r,n.measurePageBox()),ea(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fs(this.latestValues)&&ea(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:i,layoutId:o}=this.options;if(this.layout&&(i||o)){if(this.resolvedRelativeTargetAt=dr.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ns(s.x,a.x,l.x),ns(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Zs(this.target,this.layout.layoutBox),bs(this.target,this.targetDelta)):Zs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.target,t.target),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}pa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ms(this.parent.latestValues)&&!gs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===dr.timestamp&&(r=!1),r)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;Zs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const i=n.length;if(!i)return;let o,s;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,bs(t,s)),r&&fs(o.latestValues)&&Ts(t,o.latestValues))}e.x=Ss(e.x),e.y=Ss(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.projectionTransform;es(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=aa(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),pa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Da));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,p,m;Aa(o.x,t.x,n),Aa(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(is(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,h=this.relativeTargetOrigin,p=s,m=n,ja(l.x,h.x,p.x,m),ja(l.y,h.y,p.y,m),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Zs(d,this.relativeTarget)),a&&(this.animationValues=i,function(t,e,n,r,i,o){i?(t.opacity=fi(0,void 0!==n.opacity?n.opacity:1,qs(r)),t.opacityExit=fi(void 0!==e.opacity?e.opacity:1,0,Ys(r))):o&&(t.opacity=fi(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i<$s;i++){const o=`border${Us[i]}Radius`;let s=zs(e,o),a=zs(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Ws(s)===Ws(a)?(t[o]=Math.max(fi(Hs(s),Hs(a),r),0),(Tn.test(a)||Tn.test(s))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=fi(e.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ur.update(()=>{Vs.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=un(0)?0:Eo(0);return r.start(go("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:i}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&La(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ko(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Ko(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Zs(e,n),Ts(e,i),es(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<ca.length;e++){const i="rotate"+ca[e];n[i]&&(r[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return da;const r={visibility:""},i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=rr(null==t?void 0:t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=rr(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=aa(this.projectionDeltaWithTransform,this.treeScale,s),i&&(r.transform=i(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in on){if(void 0===s[t])continue;const{correct:e,applyTo:n}=on[t],i="none"===r.transform?s[t]:e(s[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=i}else r[t]=i}return this.options.layoutId&&(r.pointerEvents=o===this?rr(null==t?void 0:t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(wa),this.root.sharedNodes.clear()}}}function fa(t){t.updateLayout()}function ga(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?ds(t=>{const r=o?n.measuredBox[t]:n.layoutBox[t],i=Ko(r);r.min=e[t].min,r.max=r.min+i}):La(i,n.layoutBox,e)&&ds(r=>{const i=o?n.measuredBox[r]:n.layoutBox[r],s=Ko(e[r]);i.max=i.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};es(s,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?es(a,t.applyTransform(r,!0),n.measuredBox):es(a,e,n.layoutBox);const l=!ra(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:o}=r;if(i&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};is(s,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};is(a,e,o.layoutBox),ia(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ya(t){pa.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function va(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function xa(t){t.clearSnapshot()}function wa(t){t.clearMeasurements()}function ba(t){t.isLayoutDirty=!1}function Sa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ca(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ea(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function ka(t){t.resetRotation()}function Ta(t){t.removeLeadSnapshot()}function Aa(t,e,n){t.translate=fi(e.translate,0,n),t.scale=fi(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ja(t,e,n,r){t.min=fi(e.min,n.min,r),t.max=fi(e.max,n.max,r)}function Da(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Oa={duration:.45,ease:[.4,0,.1,1]},Ma=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=Ma("applewebkit/")&&!Ma("chrome/")?Math.round:sr;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function La(t,e,n){return"position"===t||"preserve-aspect"===t&&!Qo(oa(e),oa(n),.2)}const Fa=ma({attachResizeListener:(t,e)=>fr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Na={current:void 0},Ia=ma({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Na.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),Na.current=t}return Na.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),_a={pan:{Feature:class extends kr{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new zo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:js(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rs(t),onStart:Rs(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&ur.update(()=>r(t,e))}}}mount(){this.removePointerDownListener=vr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends kr{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new Os(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Ia,MeasureLayout:_s}},Ba=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ua(t,e,n=1){_r(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=function(t){const e=Ba.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const t=o.trim();return vo(t)?parseFloat(t):t}return mn(i)?Ua(i,e,n+1):i}const $a=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ha=t=>$a.has(t),Wa=t=>t===yn||t===An,za=(t,e)=>parseFloat(t.split(", ")[e]),qa=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return za(i[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},Ya=new Set(["x","y","z"]),Ga=sn.filter(t=>!Ya.has(t)),Xa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:qa(4,13),y:qa(5,14)};Xa.translateX=Xa.x,Xa.translateY=Xa.y;function Za(t,e,n,r){return(t=>Object.keys(t).some(Ha))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const i=Object.keys(e).filter(Ha);let o=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=To(u);const d=e[i];let h;if(er(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=To(u);for(let n=e;n<t&&null!==d[n];n++)h?_r(To(d[n])===h,"All keyframes must be of the same type"):(h=To(d[n]),_r(h===c||Wa(c)&&Wa(h),"Keyframes must be of the same dimension as the current value"))}else h=To(d);if(c!==h)if(Wa(c)&&Wa(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===An&&(e[i]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[i]=c.transform(d):(s||(o=function(t){const e=[];return Ga.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),r[i]=void 0!==r[i]?r[i]:e[i],l.jump(d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const r=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:s}=o,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Xa[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=Xa[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),Le&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ja={current:null},Ka={current:!1},Qa=new WeakMap,tl=Object.keys(Xe),el=tl.length,nl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rl=We.length;class il{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ur.render(this.render,!1,!0);const{latestValues:s,renderState:a}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ze(e),this.isVariantNode=qe(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&un(e)&&(e.set(s[t],!1),yo(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Qa.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ka.current||function(){if(Ka.current=!0,Le)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ja.current=t.matches;t.addListener(e),e()}else Ja.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ja.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Qa.delete(this.current),this.projection&&this.projection.unmount(),cr(this.notifyUpdate),cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=an.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ur.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,i){let o,s;for(let t=0;t<el;t++){const n=tl[t],{isEnabled:r,Feature:i,ProjectionNode:a,MeasureLayout:l}=Xe[n];a&&(o=a),r(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(s=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&Be(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<nl.length;e++){const n=nl[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const i in e){const o=e[i],s=n[i];if(un(o))t.addValue(i,o),yo(r)&&r.add(i);else if(un(s))t.addValue(i,Eo(o,{owner:t})),yo(r)&&r.remove(i);else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Eo(void 0!==e?e:o,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<rl;t++){const n=We[t],r=this.props[n];(Ue(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Eo(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=tr(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||un(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new bo),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ol extends il{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},i){let o=function(t,e,n){const r={};for(const i in t){const t=Oo(i,e);if(void 0!==t)r[i]=t;else{const t=n.getValue(i);t&&(r[i]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),i){!function(t,e,n){var r,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(vo(u)||po(u))?u=parseFloat(u):!jo(u)&&ji.test(l)&&(u=ho(s,l)),t.addValue(s,Eo(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,o);const t=((t,e,n,r)=>{const i=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!mn(e))return;const n=Ua(e,r);n&&t.set(n)});for(const t in e){const i=e[t];if(!mn(i))continue;const o=Ua(i,r);o&&(e[t]=o,n||(n={}),void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,r);return Za(t,e=i.target,n,r=i.transitionEnd)})(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class sl extends ol{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),i=(pn(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return As(t,e)}build(t,e,n,r){Vn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Kn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(t,e,n,r){Xn(t,e,n,r)}}class al extends ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}return e=Zn.has(e)?e:Ie(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Qn(t,e)}build(t,e,n,r){zn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Jn(t,e,0,r)}mount(t){this.isSVGTag=qn(t.tagName),super.mount(t)}}const ll=(t,e)=>rn(t)?new al(e,{enableHardwareAcceleration:!1}):new sl(e,{enableHardwareAcceleration:!0}),ul={...Ho,...Lr,..._a,layout:{ProjectionNode:Ia,MeasureLayout:_s}},cl=en((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...rn(t)?pr:mr,preloadedFeatures:n,useRender:Gn(e),createVisualElement:r,Component:t}}(t,e,ul,ll)),dl=window.wp.components;Object.defineProperty;var hl=new Map,pl=new WeakMap,ml=0;function fl(t,e,n={},r=void 0){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:s}=function(t){const e=function(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>{return`${e}_${"root"===e?(n=t.root,n?(pl.has(n)||(ml+=1,pl.set(n,ml.toString())),pl.get(n)):"0"):t[e]}`;var n}).toString()}(t);let n=hl.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver(e=>{e.forEach(e=>{var n;const o=e.isIntersecting&&i.some(t=>e.intersectionRatio>=t);t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach(t=>{t(o,e)})})},t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},hl.set(e,n)}return n}(n),a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),o.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),o.unobserve(t)),0===s.size&&(o.disconnect(),hl.delete(i))}}function gl(){return gl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gl.apply(this,arguments)}function yl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yl(Object(n),!0).forEach(function(e){xl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c.Component;class wl extends h().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let i in e){const o=parseInt(i);o>0&&t<=o&&o<n&&(n=o,r=e[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),n=h().Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%t;e[i]||(e[i]=[]),e[i].push(n[r])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let o=n;o&&"string"!=typeof o&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===o&&(o="my-masonry-grid_column"));const s=vl(vl(vl({},t),e),{},{style:vl(vl({},e.style),{},{width:i}),className:o});return r.map((t,e)=>h().createElement("div",gl({},s,{key:e}),t))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:n,columnClassName:r,columnAttrs:i,column:o,className:s}=t,a=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let l=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(l="my-masonry-grid")),h().createElement("div",gl({},a,{className:l}),this.renderColumns())}}wl.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const bl=wl,Sl=window.wp.blockEditor,Cl=window.wp.blocks;var El=i(942),Pl=i.n(El);const kl=window.lodash,Tl={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"},Al=(t,e=[])=>Array.from(e).some(e=>!!e.style&&Array.from(e.style).some(e=>e&&e.includes(t))),jl=new WeakMap,Dl=x(S((t,e)=>({selectedPatterns:{},toggleSelection:(e,n,r="")=>t(t=>{const i={...t.selectedPatterns};if(i[e])delete i[e];else{if(Object.keys(i).length>=10)return t;i[e]={blocks:n,prompt:r}}return{selectedPatterns:i}}),updatePrompt:(e,n)=>t(t=>t.selectedPatterns[e]?{selectedPatterns:{...t.selectedPatterns,[e]:{...t.selectedPatterns[e],prompt:n}}}:t),isSelected:t=>!!e().selectedPatterns[t],getSelectedCount:()=>Object.keys(e().selectedPatterns).length,canSelectMore:()=>Object.keys(e().selectedPatterns).length<10,getSelectedPatterns:()=>Object.entries(e().selectedPatterns).map(([t,e])=>({patternId:t,...e})),clearSelection:()=>t({selectedPatterns:{}}),removeFromSelection:e=>t(t=>{const n={...t.selectedPatterns};return delete n[e],{selectedPatterns:n}})}),{name:"Strakture Selection"})),Ol=({patternId:e,onPatternClick:n,code:i,disabled:o})=>{const[s,a]=(0,t.useState)(!1),l=(0,t.useRef)(),{isSelected:u,toggleSelection:c,canSelectMore:d}=Dl(),h=u(e),p=!h&&!d(),m=/100[vsd]vh|min-height:\s*100vh/.test(i),f=(0,t.useMemo)(()=>(0,Cl.rawHandler)({HTML:Ml(i)}),[i]),{ready:g}=(({container:e,onIFrameLoaded:n,ready:r,loadDelay:i})=>{const o=(()=>{const e=(0,t.useRef)(!1);return(0,t.useEffect)(()=>(e.current=!0,()=>e.current=!1)),e})(),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(!1),{addMissingCSSVar:p}=V(),m=(0,t.useCallback)(t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in Tl)e.getPropertyValue(r)||Array.from(n).filter(t=>{try{return t.cssRules}catch(t){return!1}}).some(t=>Al(r,t.cssRules))||(p(r),t.contentDocument.documentElement.style.setProperty(r,Tl[r]))},[p]),f=(0,t.useCallback)(async(t,e)=>{if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let n=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];n=n?parseFloat(n):null;const r=e.offsetHeight/(null!=n?n:1);t.style.setProperty("max-height",`${r}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)jl.has(t)||jl.set(t,t.style.minHeight),t.style.minHeight=jl.get(t);e.offsetHeight,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>requestAnimationFrame(t));for(const e of i){if(!t.contentDocument?.defaultView)return;const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1},[]);return(0,t.useEffect)(()=>{if(!r)return;const t=setTimeout(()=>{if(l)return;const t=e?.querySelector("iframe[title]");if(!t)return a(t=>t+1);u(t),requestAnimationFrame(()=>n(t,e))},100);return()=>clearTimeout(t)},[l,r,s,e,n]),(0,t.useEffect)(()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame(()=>n(l,e));const n=(0,kl.debounce)(async()=>{o.current&&!h.current&&(r.disconnect(),await f(l,e),"extendable"!==window.straktureSharedData?.themeSlug&&await m(l,e),setTimeout(()=>d(!0),i),o.current&&r.observe(l.contentDocument,t))},300),r=new MutationObserver(n);return r.observe(l.contentDocument,t),()=>{n.cancel(),r?.disconnect()}},[l,e,o,r,f,m,i]),{loading:!l,ready:c}})({container:l.current,ready:s,onIFrameLoaded:()=>{},loadDelay:50});return(0,t.useEffect)(()=>a(!0),[]),(0,M.jsxs)("div",{className:Pl()(`library-pattern pattern-${e} mb-8 rounded-md overflow-hidden w-full border bg-white transition-colors duration-150`,{"opacity-0 border-transparent":!g,"opacity-100 border-gray-400 hover:border-design-main":g&&!o&&!h,"opacity-100 border-design-main bg-design-main/5":g&&!o&&h,"opacity-100 border-gray-400":g&&o,"opacity-50":o}),children:[(0,M.jsx)("button",{ref:l,type:"button",disabled:o,"aria-label":(0,r.__)("Insert Pattern","strakture"),className:Pl()("relative z-10 m-0 inline-block w-full bg-transparent p-0 focus:shadow-sm focus:outline-none focus:ring-wp focus:ring-design-main focus:ring-offset-2 focus:ring-offset-white",{"cursor-not-allowed":o}),onClick:()=>n(e,f),children:(0,M.jsx)(Sl.BlockPreview,{blocks:f,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }\n\t\t\t\t\t\t\t\t'+(m?".wp-block-cover { min-height: 788px !important; }":"")}]})}),(0,M.jsx)("div",{className:"p-3",children:(0,M.jsx)("div",{className:"flex items-center justify-between",children:(0,M.jsxs)("label",{className:"cursor-pointer items-center",children:[(0,M.jsx)("input",{type:"checkbox",checked:h,onChange:()=>c(e,f),disabled:o||p,className:"h-4 w-4 rounded border-gray-400 text-design-main focus:ring-design-main focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50"}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Select pattern","strakture")})]})})})]})},Ml=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),Rl="https://api.strakture.com";var Vl=i(888),Ll=Object.prototype.hasOwnProperty;const Fl=new WeakMap,Nl=()=>{},Il=Nl(),_l=Object,Bl=t=>t===Il,Ul=t=>"function"==typeof t,$l=(t,e)=>({...t,...e}),Hl=t=>Ul(t.then),Wl={},zl={},ql="undefined",Yl=typeof window!=ql,Gl=typeof document!=ql,Xl=Yl&&"Deno"in window,Zl=(t,e)=>{const n=Fl.get(t);return[()=>!Bl(e)&&t.get(e)||Wl,r=>{if(!Bl(e)){const i=t.get(e);e in zl||(zl[e]=i),n[5](e,$l(i,r),i||Wl)}},n[6],()=>!Bl(e)&&e in zl?zl[e]:!Bl(e)&&t.get(e)||Wl]};let Jl=!0;const[Kl,Ql]=Yl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Nl,Nl],tu={isOnline:()=>Jl,isVisible:()=>{const t=Gl&&document.visibilityState;return Bl(t)||"hidden"!==t}},eu={initFocus:t=>(Gl&&document.addEventListener("visibilitychange",t),Kl("focus",t),()=>{Gl&&document.removeEventListener("visibilitychange",t),Ql("focus",t)}),initReconnect:t=>{const e=()=>{Jl=!0,t()},n=()=>{Jl=!1};return Kl("online",e),Kl("offline",n),()=>{Ql("online",e),Ql("offline",n)}}},nu=!c.useId,ru=!Yl||Xl,iu=ru?c.useEffect:c.useLayoutEffect,ou="undefined"!=typeof navigator&&navigator.connection,su=!ru&&ou&&(["slow-2g","2g"].includes(ou.effectiveType)||ou.saveData),au=new WeakMap,lu=(t,e)=>t===`[object ${e}]`;let uu=0;const cu=t=>{const e=typeof t,n=(r=t,_l.prototype.toString.call(r));var r;const i=lu(n,"Date"),o=lu(n,"RegExp"),s=lu(n,"Object");let a,l;if(_l(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=au.get(t),a)return a;if(a=++uu+"~",au.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=cu(t[l])+",";au.set(t,a)}if(s){a="#";const e=_l.keys(t).sort();for(;!Bl(l=e.pop());)Bl(t[l])||(a+=l+":"+cu(t[l])+",");au.set(t,a)}}return a},du=t=>{if(Ul(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?cu(t):"",e]};let hu=0;const pu=()=>++hu;async function mu(...t){const[e,n,r,i]=t,o=$l({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=o.throwOnError;if(Ul(n)){const t=n,r=[],i=e.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(c))}return c(n);async function c(n){const[i]=du(n);if(!i)return;const[c,d]=Zl(e,i),[h,p,m,f]=Fl.get(e),g=()=>{const t=h[i];return(Ul(o.revalidate)?o.revalidate(c().data,n):!1!==o.revalidate)&&(delete m[i],delete f[i],t&&t[0])?t[0](2).then(()=>c().data):c().data};if(t.length<3)return g();let y,v=r,x=!1;const w=pu();p[i]=[w,0];const b=!Bl(l),S=c(),C=S.data,E=S._c,P=Bl(E)?C:E;if(b&&(l=Ul(l)?l(P,C):l,d({data:l,_c:P})),Ul(v))try{v=v(P)}catch(t){y=t,x=!0}if(v&&Hl(v)){if(v=await v.catch(t=>{y=t,x=!0}),w!==p[i][0]){if(x)throw y;return v}x&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Il}))}if(s&&!x)if(Ul(s)){const t=s(v,P);d({data:t,error:Il,_c:Il})}else d({data:v,error:Il,_c:Il});if(p[i][1]=pu(),Promise.resolve(g()).then(()=>{d({_c:Il})}),!x)return v;if(u)throw y}}const fu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},gu=(t,e)=>{if(!Fl.has(t)){const n=$l(eu,e),r=Object.create(null),i=mu.bind(Il,t);let o=Nl;const s=Object.create(null),a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const i=s[e];if(i)for(const t of i)t(n,r)},u=()=>{if(!Fl.has(t)&&(Fl.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!ru)){const e=n.initFocus(setTimeout.bind(Il,fu.bind(Il,r,0))),i=n.initReconnect(setTimeout.bind(Il,fu.bind(Il,r,1)));o=()=>{e&&e(),i&&i(),Fl.delete(t)}}};return u(),[t,i,u,o]}return[t,Fl.get(t)[4]]},[yu,vu]=gu(new Map),xu=$l({onLoadingSlow:Nl,onSuccess:Nl,onError:Nl,onErrorRetry:(t,__,e,n,r)=>{const i=e.errorRetryCount,o=r.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*e.errorRetryInterval;!Bl(i)&&o>i||setTimeout(n,s,r)},onDiscarded:Nl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:su?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:su?5e3:3e3,compare:function t(e,n){var r,i;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((i=e.length)===n.length)for(;i--&&t(e[i],n[i]););return-1===i}if(!r||"object"==typeof e){for(r in i=0,e){if(Ll.call(e,r)&&++i&&!Ll.call(n,r))return!1;if(!(r in n)||!t(e[r],n[r]))return!1}return Object.keys(n).length===i}}return e!=e&&n!=n},isPaused:()=>!1,cache:yu,mutate:vu,fallback:{}},tu),wu=(t,e)=>{const n=$l(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=$l(i,s))}return n},bu=(0,c.createContext)({}),Su="$inf$",Cu=Yl&&window.__SWR_DEVTOOLS_USE__,Eu=Cu?window.__SWR_DEVTOOLS_USE__:[],Pu=t=>Ul(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],ku=Eu.concat(t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=du(e),[,,,i]=Fl.get(yu);if(r.startsWith(Su))return n(...t);const o=i[r];return Bl(o)?n(...t):(delete i[r],o)}),r)),Tu=(t,e)=>(...n)=>{const[r,i,o]=Pu(n),s=(o.use||[]).concat(e);return t(r,i,{...o,use:s})};Cu&&(window.__SWR_DEVTOOLS_REACT__=c);const Au=()=>{};Au(),new WeakMap;const ju=c.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Du={dedupe:!0},Ou=Promise.resolve(Il),Mu=(_l.defineProperty(t=>{const{value:e}=t,n=(0,c.useContext)(bu),r=Ul(e),i=(0,c.useMemo)(()=>r?e(n):e,[r,n,e]),o=(0,c.useMemo)(()=>r?i:wu(n,i),[r,n,i]),s=i&&i.provider,a=(0,c.useRef)(Il);s&&!a.current&&(a.current=gu(s(o.cache||yu),i));const l=a.current;return l&&(o.cache=l[0],o.mutate=l[1]),iu(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,c.createElement)(bu.Provider,$l(t,{value:o}))},"defaultValue",{value:xu}),Ru=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p,strictServerPrefetchWarning:m}=n,[f,g,y,v]=Fl.get(r),[x,w]=du(t),b=(0,c.useRef)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(x),E=(0,c.useRef)(e),P=(0,c.useRef)(n),k=()=>P.current,T=()=>k().isVisible()&&k().isOnline(),[A,j,D,O]=Zl(r,x),M=(0,c.useRef)({}).current,R=Bl(s)?Bl(n.fallback)?Il:n.fallback[x]:s,V=(t,e)=>{for(const n in M){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!Bl(t[r]))return!1;if(!i(H,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},L=(0,c.useMemo)(()=>{const t=!!x&&!!e&&(Bl(a)?!k().isPaused()&&!o&&!1!==l:a),n=e=>{const n=$l(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),i=O(),s=n(r),u=r===i?s:n(i);let c=s;return[()=>{const t=n(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>u]},[r,x]),F=(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>D(x,(e,n)=>{V(n,e)||t()}),[r,x]),L[0],L[1]),N=!b.current,I=f[x]&&f[x].length>0,_=F.data,B=Bl(_)?R&&Hl(R)?ju(R):R:_,U=F.error,$=(0,c.useRef)(B),H=p?Bl(_)?Bl($.current)?B:$.current:_:B,W=x&&Bl(B),z=!ru&&(0,Vl.useSyncExternalStore)(()=>Nl,()=>!1,()=>!0);m&&z&&!o&&W&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const q=!(I&&!Bl(U))&&(N&&!Bl(a)?a:!k().isPaused()&&(o?!Bl(B)&&l:Bl(B)||l)),Y=!!(x&&e&&N&&q),G=Bl(F.isValidating)?Y:F.isValidating,X=Bl(F.isLoading)?Y:F.isLoading,Z=(0,c.useCallback)(async t=>{const e=E.current;if(!x||!e||S.current||k().isPaused())return!1;let r,o,s=!0;const a=t||{},l=!y[x]||!a.dedupe,u=()=>nu?!S.current&&x===C.current&&b.current:x===C.current,c={isValidating:!1,isLoading:!1},d=()=>{j(c)},h=()=>{const t=y[x];t&&t[1]===o&&delete y[x]},p={isValidating:!0};Bl(A().data)&&(p.isLoading=!0);try{if(l&&(j(p),n.loadingTimeout&&Bl(A().data)&&setTimeout(()=>{s&&u()&&k().onLoadingSlow(x,n)},n.loadingTimeout),y[x]=[e(w),pu()]),[r,o]=y[x],r=await r,l&&setTimeout(h,n.dedupingInterval),!y[x]||y[x][1]!==o)return l&&u()&&k().onDiscarded(x),!1;c.error=Il;const t=g[x];if(!Bl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&k().onDiscarded(x),!1;const a=A().data;c.data=i(a,r)?a:r,l&&u()&&k().onSuccess(r,x,n)}catch(t){h();const e=k(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,x,e),(!0===n||Ul(n)&&n(t))&&(k().revalidateOnFocus&&k().revalidateOnReconnect&&!T()||e.onErrorRetry(t,x,e,t=>{const e=f[x];e&&e[0]&&e[0](3,t)},{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0},[x,r]),J=(0,c.useCallback)((...t)=>mu(r,C.current,...t),[]);if(iu(()=>{E.current=e,P.current=n,Bl(_)||($.current=_)}),iu(()=>{if(!x)return;const t=Z.bind(Il,Du);let e=0;if(k().revalidateOnFocus){const t=Date.now();e=t+k().focusThrottleInterval}const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(x,f,(n,r={})=>{if(0==n){const n=Date.now();k().revalidateOnFocus&&n>e&&T()&&(e=n+k().focusThrottleInterval,t())}else if(1==n)k().revalidateOnReconnect&&T()&&t();else{if(2==n)return Z();if(3==n)return Z(r)}});return S.current=!1,C.current=x,b.current=!0,j({_k:w}),q&&(y[x]||(Bl(B)||ru?t():(t=>{Yl&&typeof window.requestAnimationFrame!=ql?window.requestAnimationFrame(t):setTimeout(t,1)})(t))),()=>{S.current=!0,n()}},[x]),iu(()=>{let t;function e(){const e=Ul(u)?u(A().data):u;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!k().isVisible()||!h&&!k().isOnline()?e():Z(Du).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}},[u,d,h,x]),(0,c.useDebugValue)(H),o){if(!nu&&ru&&W)throw new Error("Fallback data is required when using Suspense in SSR.");W&&(E.current=e,P.current=n,S.current=!1);const t=v[x],r=!Bl(t)&&W?J(t):Ou;if(ju(r),!Bl(U)&&W)throw U;const i=W?Z(Du):Ou;!Bl(H)&&W&&(i.status="fulfilled",i.value=!0),ju(i)}return{mutate:J,get data(){return M.data=!0,H},get error(){return M.error=!0,U},get isValidating(){return M.isValidating=!0,G},get isLoading(){return M.isLoading=!0,X}}},function(...t){const e=(()=>{const t=(0,c.useContext)(bu);return(0,c.useMemo)(()=>$l(xu,t),[t])})(),[n,r,i]=Pu(t),o=wu(e,i);let s=Ru;const{use:a}=o,l=(a||[]).concat(ku);for(let t=l.length;t--;)s=l[t](s);return s(n,r||o.fetcher||null,o)});var Ru;const Vu=()=>{},Lu=Vu(),Fu=Object,Nu=t=>t===Lu,Iu=new WeakMap,_u=(t,e)=>t===`[object ${e}]`;let Bu=0;const Uu=t=>{const e=typeof t,n=(r=t,Fu.prototype.toString.call(r));var r;const i=_u(n,"Date"),o=_u(n,"RegExp"),s=_u(n,"Object");let a,l;if(Fu(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=Iu.get(t),a)return a;if(a=++Bu+"~",Iu.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=Uu(t[l])+",";Iu.set(t,a)}if(s){a="#";const e=Fu.keys(t).sort();for(;!Nu(l=e.pop());)Nu(t[l])||(a+=l+":"+Uu(t[l])+",");Iu.set(t,a)}}return a},$u=Promise.resolve(),Hu=Tu(Mu,t=>(e,n,r)=>{const i=(0,c.useRef)(!1),{cache:o,initialSize:s=1,revalidateAll:a=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,p]=Fl.get(yu);let m;try{m=(t=>(t=>{if((t=>"function"==typeof t)(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Uu(t):"",e]})(t?t(0,null):null)[0])(e),m&&(m=Su+m)}catch(t){}const[f,g,y]=Zl(o,m),v=(0,c.useCallback)(()=>Bl(f()._l)?s:f()._l,[o,m,s]);(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>m?y(m,()=>{t()}):()=>{},[o,m]),v,v);const x=(0,c.useCallback)(()=>{const t=f()._l;return Bl(t)?s:t},[m,s]),w=(0,c.useRef)(x());iu(()=>{i.current?m&&g({_l:l?w.current:x()}):i.current=!0},[m,o]);const b=d&&!i.current,S=t(m,async t=>{const i=f()._i,s=f()._r;g({_r:Il});const l=[],c=x(),[d]=Zl(o,t),m=d().data,y=[];let v=null;for(let t=0;t<c;++t){const[c,d]=du(e(t,h?null:v));if(!c)break;const[f,g]=Zl(o,c);let x=f().data;const w=a||i||Bl(x)||u&&!t&&!Bl(m)||b||m&&!Bl(m[t])&&!r.compare(m[t],x);if(n&&("function"==typeof s?s(x,d):w)){const e=async()=>{if(c in p){const t=p[c];delete p[c],x=await t}else x=await n(d);g({data:x,_k:d}),l[t]=x};h?y.push(e):await e()}else l[t]=x;h||(v=x)}return h&&await Promise.all(y.map(t=>t())),g({_i:Il}),l},r),C=(0,c.useCallback)(function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return m?(r&&(Bl(t)?g({_i:!0,_r:n.revalidate}):g({_i:!1,_r:n.revalidate})),arguments.length?S.mutate(t,{...n,revalidate:r}):S.mutate()):$u},[m,o]),E=(0,c.useCallback)(t=>{if(!m)return $u;const[,n]=Zl(o,m);let r;if(Ul(t)?r=t(x()):"number"==typeof t&&(r=t),"number"!=typeof r)return $u;n({_l:r}),w.current=r;const i=[],[s]=Zl(o,m);let a=null;for(let t=0;t<r;++t){const[n]=du(e(t,a)),[r]=Zl(o,n),l=n?r().data:Il;if(Bl(l))return C(s().data);i.push(l),a=l}return C(i)},[m,o,C,x]);return{size:x(),setSize:E,mutate:C,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}}),Wu=t=>fetch(t).then(t=>t.json()) ,zu=({onPatternClick:e,siteType:n,category:i,disabled:o})=>{const{data:s,isLoading:a,setSize:l}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.straktureSharedData?.wpVersion,lang:window.straktureSharedData?.wpLanguage||null,showLocalizedCopy:window.straktureSharedData?.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}=Hu((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter(([,t])=>void 0!==t).forEach(([t,e])=>{r.append(t,e)}),`${Rl}/v1/patterns?${r.toString()}`},Wu,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}})({siteType:n?.slug,category:i}),[u,d]=(0,t.useState)(!0),[h,p]=function({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:s,initialInView:a,fallbackInView:l,onChange:u}={}){var d;const[h,p]=c.useState(null),m=c.useRef(u),[f,g]=c.useState({inView:!!a,entry:void 0});m.current=u,c.useEffect(()=>{if(s||!h)return;let a;return a=fl(h,(t,e)=>{g({inView:t,entry:e}),m.current&&m.current(t,e),e.isIntersecting&&o&&a&&(a(),a=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{a&&a()}},[Array.isArray(t)?t.toString():t,h,i,r,o,s,n,l,e]);const y=null==(d=f.entry)?void 0:d.target,v=c.useRef(void 0);h||!y||o||s||v.current===y||(v.current=y,g({inView:!!a,entry:void 0}));const x=[p,f.inView,f.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}(),[m,f]=(0,t.useState)({}),{isSelected:g,updatePrompt:y,clearSelection:v}=Dl(),x=(0,t.useCallback)((t,e)=>{f(n=>({...n,[t]:e})),g(t)&&y(t,e)},[g,y]);(0,t.useEffect)(()=>{v()},[i,n,v]);const w=(0,t.useCallback)((t,n)=>{e(t,n,m[t]||"")},[e,m]),b=s?.at(-1)?.length<9;return(0,t.useEffect)(()=>{if(a)return d(!0);const t=setTimeout(()=>{d(!1)},750);return()=>clearTimeout(t)},[a]),(0,t.useEffect)(()=>{p&&!a&&l(t=>t+1)},[p,a,l]),a||!s?.length?(0,M.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(bl,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"relative flex w-full gap-6 p-8 pt-2",children:s.map(t=>t.map(({id:t,code:e,patternReplacementCode:n})=>(0,M.jsx)(Ol,{patternId:t,onPatternClick:w,code:null!=n?n:e,disabled:o,prompt:m[t]||"",onPromptChange:x},t)))}),u?(0,M.jsxs)("div",{className:"absolute inset-0 z-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):null,u||b?null:(0,M.jsxs)("div",{ref:h,className:"mb-6 mt-6 flex w-full justify-center md:mt-2",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading more patterns...","strakture")})]})]})},qu=Tu(Mu,t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r))),Yu=async()=>{const t=new URLSearchParams({wpVersion:window.straktureSharedData?.wpVersion||null,lang:window.straktureSharedData?.wpLanguage||null});return await fetch(`${Rl}/v1/patterns/categories?${t.toString()}`).then(t=>t.json())},Gu=x(k(t=>({categories:[],setCategories:e=>t({categories:e})}),{name:`strakture-library-cache-${window.straktureSharedData?.siteId}`})),Xu="/strakture/v1/library/settings",Zu={getItem:async()=>await a()({path:Xu}),setItem:async(t,e)=>await a()({path:Xu,method:"POST",data:{state:e}})},Ju={siteType:"",category:"",totalImports:0},Ku=l(window.straktureLibraryData?.siteInfo),Qu=x(k(t=>{var e,n,r,i;return{...Ju,...null!==(e=Ku?.state)&&void 0!==e?e:{},siteType:(i=null!==(n=null!==(r=window.straktureSharedData?.siteType)&&void 0!==r?r:Ku?.siteType)&&void 0!==n?n:"","string"==typeof i?i:""),setCategory:e=>t({category:e}),setSiteType:e=>t({siteType:e}),incrementImports:()=>t(t=>({totalImports:Number(t.totalImports)+1}))}},{name:"strakture_library_site_data",storage:E(()=>Zu),skipHydration:!0})),tc=()=>{const{category:e,setCategory:n}=Qu(),{data:i,isLoading:o,errorCount:s}=(()=>{var e;const[n,r]=(0,t.useState)(0),i=null!==(e=window.straktureSharedData?.wpLanguage)&&void 0!==e?e:"en_US",{data:o,error:s,isLoading:a}=qu(`categories-${i}`,Yu,{onError:()=>r(t=>t+1),onSuccess:()=>r(0)});return{data:o,errorCount:n>1?n:s?1:0,isLoading:a}})(),{categories:a,setCategories:l}=Gu();return(0,t.useEffect)(()=>{o||s||l(i)},[i,o,l,s]),(0,t.useEffect)(()=>{const t=t=>document.querySelector(`#strakture-library-category-${t}`)?.focus();if(a?.length){if(e){if("all"===e)return t("all");if(a?.find(({slug:t})=>t===e))return t(e)}n("all"),t("all")}},[e,n,a]),(0,M.jsxs)("div",{className:"strakture-type-control",children:[(0,M.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Category","strakture")}),(0,M.jsx)(ec,{categories:a,errorCount:s,current:e,setCurrent:n})]})},ec=({categories:t,errorCount:e,current:n,setCurrent:i})=>{const o=t=>Pl()("text-sm w-full text-left rtl:text-right px-3 py-2 block rounded-md transition-colors",{"bg-design-light text-design-main font-medium":n===t,"bg-transparent text-gray-700 hover:bg-design-light hover:text-design-main":n!==t});return t?.length?(0,M.jsxs)("nav",{className:"w-full flex flex-col gap-0.5",children:[(0,M.jsx)("button",{type:"button",id:"strakture-library-category-all",onClick:()=>i("all"),className:o("all"),children:(0,r.__)("All","strakture")}),t.map(({slug:t,id:e,name:n})=>(0,M.jsx)("button",{type:"button",id:`strakture-library-category-${t}`,onClick:()=>i(t),className:o(t),children:n},e))]}):e>1?(0,M.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-2 py-4",children:[(0,M.jsx)("span",{className:"text-sm text-gray-600",children:(0,r.__)("Retrying...","strakture")}),(0,M.jsx)(dl.Spinner,{})]}):(0,M.jsxs)("div",{className:"flex w-full justify-center py-4",children:[(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Fetching...","strakture")}),(0,M.jsx)(dl.Spinner,{})]})},nc=x(S((t,e)=>{var n,r,i,o;return{remaining:Math.max(0,null!==(n=window.straktureSharedData?.credits?.remaining)&&void 0!==n?n:3),limit:null!==(r=window.straktureSharedData?.credits?.limit)&&void 0!==r?r:3,plan:null!==(i=window.straktureSharedData?.credits?.plan)&&void 0!==i?i:"free",resetDate:null!==(o=window.straktureSharedData?.credits?.resetDate)&&void 0!==o?o:null,isLoading:!1,updateCredits:n=>{var r,i,o,s,a;return t({remaining:Math.max(0,null!==(r=n.remaining)&&void 0!==r?r:e().remaining),limit:null!==(i=n.limit)&&void 0!==i?i:e().limit,plan:null!==(o=n.plan)&&void 0!==o?o:e().plan,resetDate:null!==(s=null!==(a=n.reset_date)&&void 0!==a?a:n.resetDate)&&void 0!==s?s:e().resetDate})},decrementCredit:()=>t(t=>({remaining:Math.max(0,t.remaining-1)})),decrementCredits:e=>t(t=>({remaining:Math.max(0,t.remaining-e)})),hasCredits:()=>e().remaining>0,getFormattedResetDate:()=>{const t=e().resetDate;if(!t)return null;try{return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return null}},setLoading:e=>t({isLoading:e})}},{name:"Strakture Credits"})),rc=async(t,e)=>await a()({path:"/strakture/v1/library/settings/single",method:"POST",data:{key:t,value:e}}),ic=()=>{const{siteType:e,setSiteType:n}=Qu(),{hasCredits:i}=nc(),[o,s]=(0,t.useState)(e||""),[a,l]=(0,t.useState)(!1),u=(0,t.useRef)(null);return(0,t.useEffect)(()=>{u.current||s(e||"")},[e]),(0,t.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),i()?(0,M.jsxs)("div",{"data-tour-target":"site-type",className:"px-4",children:[(0,M.jsx)("label",{htmlFor:"strakture-site-type-input",className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Site Type","strakture")}),(0,M.jsx)("input",{id:"strakture-site-type-input",type:"text",value:o,onChange:t=>{const e=t.target.value;s(e),u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{l(!0);try{await rc("siteType",e),n(e)}catch(t){console.error("Failed to save site type:",t)}finally{l(!1)}},500)},placeholder:(0,r.__)("e.g., Photography Portfolio, Restaurant","strakture"),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-700 placeholder-gray-400 focus:border-design-main focus:outline-none focus:ring-1 focus:ring-design-main"}),(0,M.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:a?(0,r.__)("Saving...","strakture"):(0,r.__)("Describe your site. Example: Restaurant, Photography Portfolio, etc.","strakture")})]}):null},oc=(0,M.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_101_491)",children:[(0,M.jsx)("path",{d:"M29.1262 0.0850517C29.4302 0.091618 29.5619 0.0992173 29.8084 0.291912C29.9788 0.524764 29.9874 0.649825 29.9725 0.931454C29.892 1.33877 29.6895 1.69948 29.5014 2.0654C28.9002 3.26768 28.3322 4.48618 27.7266 5.68631C27.6009 5.86381 27.4911 5.9299 27.2967 6.02649C27.099 6.0503 27.099 6.0503 26.8745 6.04885C21.3294 6.04533 15.7829 6.07902 10.2378 6.04812C9.3778 6.0438 8.69023 6.1758 8.01254 6.74591C6.66749 7.75395 6.6597 9.97523 7.69755 11.1949C8.29168 11.7569 8.97674 11.9939 9.77978 11.9963C13.165 12.0131 16.5505 12.0321 19.9357 12.033C25.4031 12.0356 29.9817 16.4427 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697798 29.9585C0.429173 29.9195 0.197807 29.9338 0.0659368 29.6026C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.83579 24.0689 3.19855 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31377 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C21.8725 18.0734 21.1851 18.0053 20.4733 18.0046C17.5342 17.9957 14.5951 17.9822 11.6559 17.9853C8.64305 17.9879 6.0684 17.5197 3.8283 15.327C-1.40558 10.0469 2.48562 0.307219 9.8165 0.0988723C16.2556 -0.0456274 22.688 0.113503 29.1262 0.0850517Z",fill:"#7851D4"}),(0,M.jsx)("path",{d:"M21.7253 18.1126C21.7105 18.0808 21.7322 18.0132 21.7322 18.0132L24.1366 12.9919C24.1366 12.9919 24.1437 12.9811 24.1494 12.9788C24.1551 12.9765 24.1664 12.9746 24.1751 12.9788C27.5361 14.5693 29.8055 18.0115 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697799 29.9585C0.429174 29.9195 0.197807 29.9338 0.0659368 29.6027C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.8358 24.0689 3.19856 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31378 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C22.2574 18.3336 22.0284 18.2306 21.7912 18.1592C21.7535 18.1478 21.7401 18.1443 21.7253 18.1126Z",fill:"url(#paint0_linear_101_491)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_101_491",x1:"-1.02465",y1:"29.9585",x2:"28.8244",y2:"17.6585",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_101_491",children:(0,M.jsx)("rect",{width:"30",height:"30",fill:"white"})})]})]}),sc=()=>(0,M.jsxs)("div",{className:"hidden flex-shrink-0 flex-col gap-6 md:flex md:w-80",children:[(0,M.jsx)("div",{className:"-mb-5 hidden px-5 py-3 text-strakture-black sm:flex sm:pt-5",children:(0,M.jsx)(o,{icon:oc,size:30})}),(0,M.jsxs)("div",{className:"flex flex-col gap-6 overflow-y-auto pb-16",children:[(0,M.jsx)(ic,{}),(0,M.jsx)("div",{id:"strakture-library-category-control","data-test":"category-control",className:"hidden flex-col overflow-x-hidden px-4 md:flex",children:(0,M.jsx)(tc,{})})]})]}),ac=({onClose:t})=>(0,M.jsx)("button",{className:"block h-6 w-6 bg-transparent p-px text-inherit outline-none focus:shadow-none focus:ring-wp focus:ring-design-main",type:"button",onClick:t,"data-test":"modal-close-button","aria-label":(0,r.__)("Close","strakture"),children:(0,M.jsx)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})})}),lc=({onClose:t,onBatchInsert:e})=>{const{getSelectedCount:n,canSelectMore:i}=Dl(),o=n(),s=!i(),a=window.straktureSharedData?.upgradeUrl;return(0,M.jsxs)("div",{"data-tour-target":"topbar",className:"mb-2 flex h-16 flex-shrink-0 items-center justify-between px-8",children:[(0,M.jsxs)("div",{className:"mt-4 flex items-center gap-4",children:[a&&(0,M.jsx)("a",{href:a,className:"text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline",children:(0,r.__)("Upgrade to Pro","strakture")}),o>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{type:"button",onClick:e,className:Pl()("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-all duration-150","bg-design-main text-white hover:opacity-90"),children:(0,M.jsx)("span",{children:(0,r.sprintf)((0,r.__)("Insert %d Pattern%s","strakture"),o,o>1?"s":"")})}),s&&(0,M.jsx)("span",{className:"text-xs text-gray-500",children:(0,r.__)("Maximum 10 patterns","strakture")})]})]}),(0,M.jsx)("div",{className:"mt-4",children:(0,M.jsx)(ac,{onClose:t})})]})},uc=async t=>{const{insertBlocks:n,replaceBlock:r}=(0,e.dispatch)("core/block-editor"),{getSelectedBlock:i,getBlockHierarchyRootClientId:o,getBlockIndex:s,getGlobalBlockCount:l,getBlockParents:u,getBlock:c,getBlocks:d}=(0,e.select)("core/block-editor"),h=(0,e.select)("core/preferences").get("core","renderingModes")||{},p=(0,e.select)("core").getCurrentTheme()?.stylesheet,m="template-locked"===h?.[p]?.page,{set:f}=(0,e.dispatch)("core/preferences"),g=t=>f("core","renderingModes",{...h,[p]:{...h[p]||{},page:t}});let{clientId:y,name:v,attributes:x}=i()||{};if(y&&m){const t=u(y).map(t=>c(t)).filter(Boolean),e=t.findIndex(t=>"core/post-content"===t?.name),n=s(-1!==e&&t[e+1]?.clientId||y);g("post-only"),await new Promise(t=>requestAnimationFrame(t));const r=d()[n];({clientId:y,name:v,attributes:x}=r||{})}const w=y?o(y):"",b=(w?s(w):l())+1,{missingCSSVars:S}=V.getState();S.forEach(t=>{document?.documentElement?.style?.setProperty(t,Tl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,Tl[t])}),S.length&&(async t=>{var e;const n=window.straktureSharedData?.globalStylesPostID,{styles:r,settings:i}=await a()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter(t=>!r?.css?.includes(`${t}:`))).length)return;const o=t.reduce((t,e)=>t+`${e}: ${Tl[e]};\n`,":root {\n")+"\n}";a()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:i,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+o}}})})(S);try{return m&&!y&&(g("post-only"),await new Promise(t=>requestAnimationFrame(t))),"core/paragraph"===v&&""===x?.content?.text?await r(y,t):await n(t,b)}finally{m&&g("template-locked")}},cc=[{id:"site-type",selector:'[data-tour-target="site-type"]',title:(0,r.__)("Enter your site type","strakture"),description:(0,r.__)("Tell us what kind of site you have — Restaurant, Medical, Photography, etc. This helps generate patterns that match your content.","strakture"),position:"right",offsetY:0,requiresCredits:!0,paidOnly:!1},{id:"pattern-grid",selector:"#strakture-library-patterns-list",title:(0,r.__)("Pick patterns to generate","strakture"),description:(0,r.__)("Browse the patterns and check the box on each one you want to add to your site.","strakture"),position:"left",requiresCredits:!1,paidOnly:!1},{id:"customize",selector:'[data-tour-target="customize-button"]',title:(0,r.__)("Add customization if needed","strakture"),description:(0,r.__)("Click Customize on any pattern to add specific instructions like layout changes, text, or call-to-action details.","strakture"),position:"top",requiresCredits:!0,paidOnly:!1},{id:"generate",selector:'[data-tour-target="topbar"]',title:(0,r.__)("Generate your patterns","strakture"),description:(0,r.__)("After selecting patterns, click the Generate button that appears here to create AI-customized versions for your site.","strakture"),position:"bottom",requiresCredits:!1,paidOnly:!1}],dc=288,hc=12,pc=(t,e,n=0)=>{if(!t)return{opacity:0};const r={position:"fixed",width:dc,zIndex:10001};switch(e){case"right":r.top=t.top+t.height/2+n,r.left=t.right+hc,r.transform="translateY(-50%)",r.left+dc>window.innerWidth-16&&(r.left=t.left-dc-hc);break;case"left":r.top=t.top+t.height/2+n,r.left=t.left-dc-hc,r.transform="translateY(-50%)",r.left<16&&(r.left=t.right+hc);break;case"bottom":r.top=t.bottom+hc+n,r.left=t.left+t.width/2-144;break;case"top":r.top=t.top-hc+n,r.left=t.left+t.width/2-144,r.transform="translateY(-100%)";break;default:r.top=t.bottom+hc+n,r.left=t.left}return r.left<16&&(r.left=16),r.left+dc>window.innerWidth-16&&(r.left=window.innerWidth-dc-16),r},mc=()=>{const{isActive:e,isWaiting:n,currentStep:i,currentStepIndex:o,totalSteps:s,targetRect:a,next:l,skip:u}=(()=>{var e;const{plan:n,hasCredits:r}=nc(),[i,o]=(0,t.useState)(!1),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(null),p=(0,t.useRef)(null),m=cc.filter(t=>!(t.paidOnly&&"free"===n||t.requiresCredits&&!r())),f=null!==(e=m[s])&&void 0!==e?e:null;(0,t.useEffect)(()=>{const t=window.straktureLibraryData?.onboardingCompleted;if(!t){const t=setTimeout(()=>o(!0),350);return()=>clearTimeout(t)}},[]),(0,t.useCallback)(()=>{if(!f)return;const t=document.querySelector(f.selector);t&&(u(t.getBoundingClientRect()),p.current=t)},[f]),(0,t.useEffect)(()=>{if(!i||!f)return;let t=!1;(async()=>{d(!0);const e=await((t,e=1e4)=>new Promise(n=>{const r=document.querySelector(t);if(r)return n(r);const i=new MutationObserver(()=>{const e=document.querySelector(t);e&&(i.disconnect(),n(e))});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),n(null)},e)}))(f.selector);if(t)return;if(!e)return d(!1),void(s<m.length-1?a(t=>t+1):g());if(await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))),t)return;u(e.getBoundingClientRect()),p.current=e,d(!1),h.current&&h.current.disconnect();const n=new ResizeObserver(()=>{t||u(e.getBoundingClientRect())});n.observe(e),h.current=n})();const e=()=>{p.current&&u(p.current.getBoundingClientRect())};window.addEventListener("resize",e);const n=document.getElementById("strakture-library-patterns-list");return n?.addEventListener("scroll",e),()=>{t=!0,window.removeEventListener("resize",e),n?.removeEventListener("scroll",e),h.current&&h.current.disconnect()}},[i,s,f?.selector]);const g=(0,t.useCallback)(()=>{o(!1),p.current=null,h.current&&h.current.disconnect(),rc("onboardingCompleted",!0).catch(console.warn)},[]),y=(0,t.useCallback)(()=>{s>=m.length-1?g():a(t=>t+1)},[s,m.length,g]),v=(0,t.useCallback)(()=>{g()},[g]);return{isActive:i,isWaiting:c,currentStep:f,currentStepIndex:s,totalSteps:m.length,targetRect:l,next:y,skip:v}})(),c=(0,t.useRef)(null);if((0,t.useEffect)(()=>{e&&!n&&c.current&&c.current.focus()},[e,n,o]),(0,t.useEffect)(()=>{if(!e)return;const t=t=>{"Escape"===t.key&&(t.stopPropagation(),u())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,u]),!e||!i)return null;const d=o===s-1,h=a&&!n;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:n?"none":"auto"},onClick:t=>{t.stopPropagation(),t.preventDefault()},"aria-hidden":"true"}),h&&(0,M.jsx)("div",{style:{position:"fixed",top:a.top-8,left:a.left-8,width:a.width+16,height:a.height+16,borderRadius:8,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)",zIndex:1e4,pointerEvents:"none"}}),h&&(0,M.jsxs)("div",{role:"dialog","aria-label":i.title,className:"rounded-lg bg-white p-5 shadow-xl",style:pc(a,i.position,i.offsetY),children:[(0,M.jsx)("h3",{className:"mb-1 text-sm font-semibold text-gray-900",children:i.title}),(0,M.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-gray-600",children:i.description}),(0,M.jsxs)("div",{className:"flex items-center justify-between",children:[(0,M.jsxs)("span",{className:"text-xs text-gray-400",children:[o+1," / ",s]}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("button",{type:"button",onClick:u,className:"rounded px-3 py-1.5 text-xs text-gray-500 hover:text-gray-700",children:(0,r.__)("Skip","strakture")}),(0,M.jsx)("button",{ref:c,type:"button",onClick:l,className:"rounded bg-design-main px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:d?(0,r.__)("Done","strakture"):(0,r.__)("Next","strakture")})]})]})]})]})},fc=()=>{const{incrementActivity:n}=O(),{open:i,setOpen:o}=V(),{category:s,siteType:a,incrementImports:l}=Qu(),{getSelectedPatterns:u,clearSelection:c}=Dl(),{createNotice:d}=(0,e.dispatch)("core/notices"),h=(0,t.useRef)(!1),p=()=>{c(),o(!1)};return(0,t.useLayoutEffect)(()=>{i||h.current||(h.current=!0,new URLSearchParams(window.location.search).has("strakture-open")&&(o(!0),n("library-search-param-auto-open")))},[o,n,i]),(0,t.useEffect)(()=>{const t=new URLSearchParams(window.location.search);t.has("strakture-close")&&(o(!1),t.delete("strakture-close"),window.history.replaceState({},"",window.location.pathname+"?"+t.toString()))},[o,n]),(0,t.useEffect)(()=>{const t=()=>o(!0),e=()=>o(!1);return window.addEventListener("strakture::open-library",t),window.addEventListener("strakture::close-library",e),()=>{window.removeEventListener("strakture::open-library",t),window.removeEventListener("strakture::close-library",e)}},[o,i]),(0,t.useEffect)(()=>{if(!i)return;const t=(0,e.select)("core/edit-post");t&&t.isFeatureActive("welcomeGuide")&&(0,e.dispatch)("core/edit-post").toggleFeature("welcomeGuide")},[i]),i?(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(Oe,{className:"strakture-library strakture-library-modal",open:i,static:!0,onClose:()=>{},children:(0,M.jsxs)("div",{className:"absolute mx-auto h-full w-full md:p-8",children:[(0,M.jsx)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,M.jsxs)(cl.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"relative mx-auto h-full w-full max-w-screen-3xl bg-white rounded-lg shadow-2xl sm:flex sm:overflow-hidden",children:[(0,M.jsx)(Oe.Title,{className:"sr-only",children:(0,r.__)("Design Patterns","strakture")}),(0,M.jsx)(sc,{}),(0,M.jsxs)("div",{className:"relative flex w-full flex-col bg-[#FAFAFA]",children:[(0,M.jsx)(lc,{onClose:p,onBatchInsert:async()=>{const t=u(),e=t.length;if(0===e)return;const n=[];for(const e of t)e.blocks?.length>0&&n.push(...e.blocks);n.length>0&&(await uc(n),l()),c(),o(!1);const i=window.straktureSharedData?.upgradeUrl;d("info",(0,r.sprintf)((0,r.__)("%d patterns added. Upgrade to Pro to generate AI patterns.","strakture"),e),{isDismissible:!0,type:"snackbar",actions:i?[{label:(0,r.__)("Upgrade","strakture"),url:i}]:[]})}}),(0,M.jsx)("div",{id:"strakture-library-patterns-list",className:"relative flex-grow overflow-y-auto",children:(0,M.jsx)(zu,{onPatternClick:async(t,e)=>{await uc(e),l(),p();const n=window.straktureSharedData?.upgradeUrl;d("info",(0,r.__)("Pattern added. Upgrade to Pro to generate AI patterns.","strakture"),{isDismissible:!0,type:"snackbar",actions:n?[{label:(0,r.__)("Upgrade","strakture"),url:n}]:[]})},category:s,siteType:a,disabled:!1})})]})]},"library-modal"),(0,M.jsx)(mc,{})]})})}):null};(0,e.subscribe)(()=>{(()=>{if("function"!=typeof t.createRoot)return;const e="strakture-library-btn",r="strakture-library";if(document.getElementById(e))return;const i=document.querySelector(".edit-post-header-toolbar");if(!i)return;const o=document.createElement("div"),s=Object.assign(o,{id:e,className:r});i.append(s),n((0,M.jsx)(L,{}),s);const a="strakture-library-modal";if(!document.getElementById(a)){const t=document.createElement("div"),e=Object.assign(t,{id:a,className:r});document.body.append(e),n((0,M.jsx)(fc,{}),e)}})()})})()})();1 (()=>{var t,e,n={162(t,e,n){"use strict";var r=n(609),i=n(888),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u(function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==i&&h.hasValue){var e=h.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(s=t,e):(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,n,r,i]);var p=s(t,d[0],d[1]);return l(function(){h.hasValue=!0,h.value=p},[p]),c(p),p}},242(t,e,n){"use strict";t.exports=n(162)},493(t,e,n){"use strict";var r=n(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=e,u(i)&&c({inst:i})},[t,n,e]),s(function(){return u(i)&&c({inst:i}),t(function(){u(i)&&c({inst:i})})},[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},609(t){"use strict";t.exports=window.React},888(t,e,n){"use strict";t.exports=n(493)},942(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(i.default=i,t.exports=i):void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}()}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>n[t]);return s.default=()=>n,i.d(o,s),o},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=window.wp.element,e=window.wp.data,n=(e,n)=>{"function"==typeof t.createRoot?(0,t.createRoot)(n).render(e):(0,t.render)(e,n)},r=window.wp.i18n;var o=(0,t.forwardRef)(({icon:e,size:n=24,...r},i)=>(0,t.cloneElement)(e,{width:n,height:n,...r,ref:i}));const s=window.wp.apiFetch;var a=i.n(s);const l=(t,e={})=>{if("string"!=typeof t)return null!=t?t:e;try{var n;return null!==(n=JSON.parse(t))&&void 0!==n?n:e}catch(t){return e}},u=t=>{let e;const n=new Set,r=(t,r)=>{const i="function"==typeof t?t(e):t;if(!Object.is(i,e)){const t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{"production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=e=t(r,i,o);return o};var c=i(609),d=i.t(c,2),h=i.n(c),p=i(242);const{useDebugValue:m}=c,{useSyncExternalStoreWithSelector:f}=p;let g=!1;const y=t=>t,v=t=>{"production"!=={NODE_ENV:"production"}.MODE&&"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?u(t):u)(t):t,n=(t,n)=>function(t,e=y,n){"production"!=={NODE_ENV:"production"}.MODE&&n&&!g&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),g=!0);const r=f(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return m(r),r}(e,t,n);return Object.assign(n,e),n},x=t=>t?v(t):v,w=new Map,b=t=>{const e=w.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([t,e])=>[t,e.getState()])):{}},S=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null!=o?o:"production"!=={NODE_ENV:"production"}.MODE)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return"production"!=={NODE_ENV:"production"}.MODE&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=w.get(n.name);if(r)return{type:"tracked",store:t,...r};const i={connection:e.connect(n),stores:{}};return w.set(n.name,i),{type:"tracked",store:t,...i}})(a,u,l);let h=!0;i.setState=(t,e,o)=>{const u=n(t,e);if(!h)return u;const d=void 0===o?{type:s||"anonymous"}:"string"==typeof o?{type:o}:o;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...b(l.name),[a]:i.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},m=t(i.setState,r,i);if("untracked"===d.type?null==c||c.init(m):(d.stores[d.store]=i,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([t,e])=>[t,t===d.store?m:e.getState()])))),i.dispatchFromDevtools&&"function"==typeof i.dispatch){let t=!1;const e=i.dispatch;i.dispatch=(...n)=>{"production"==={NODE_ENV:"production"}.MODE||"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe(t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):C(t.payload,t=>{if("__setState"===t.type){if(void 0===a)return void p(t.state);1!==Object.keys(t.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const e=t.state[a];if(null==e)return;return void(JSON.stringify(i.getState())!==JSON.stringify(e)&&p(e))}i.dispatchFromDevtools&&"function"==typeof i.dispatch&&i.dispatch(t)});case"DISPATCH":switch(t.payload.type){case"RESET":return p(m),void 0===a?null==c?void 0:c.init(i.getState()):null==c?void 0:c.init(b(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(i.getState())):null==c?void 0:c.init(b(l.name));case"ROLLBACK":return C(t.state,t=>{if(void 0===a)return p(t),void(null==c||c.init(i.getState()));p(t[a]),null==c||c.init(b(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return C(t.state,t=>{void 0!==a?JSON.stringify(i.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)});case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}}),m},C=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function E(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const i=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),o=null!=(r=n.getItem(t))?r:null;return o instanceof Promise?o.then(i):i(o)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const P=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then:t=>P(t)(n),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>P(e)(t)}}},k=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?("production"!=={NODE_ENV:"production"}.MODE&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch(t){}if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=P(o.serialize),d=()=>{const t=o.partialize({...r()});let e;const n=c({state:t,version:o.version}).then(t=>u.setItem(o.name,t)).catch(t=>{e=t});if(e)throw e;return n},h=i.setState;i.setState=(t,e)=>{h(t,e),d()};const p=t((...t)=>{n(...t),d()},r,i);let m;const f=()=>{var t;if(!u)return;s=!1,a.forEach(t=>t(r()));const e=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,r()))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t)return o.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return t.state;if(o.migrate)return o.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return m=o.merge(t,null!=(e=r())?e:p),n(m,!0),d()}).then(()=>{null==e||e(m,void 0),s=!0,l.forEach(t=>t(m))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},f(),m||p})(t,e)):((t,e)=>(n,r,i)=>{let o={storage:E(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...t)},r,i);const c=()=>{const t=o.partialize({...r()});return u.setItem(o.name,{state:t,version:o.version})},d=i.setState;i.setState=(t,e)=>{d(t,e),c()};const h=t((...t)=>{n(...t),c()},r,i);let p;i.getInitialState=()=>h;const m=()=>{var t,e;if(!u)return;s=!1,a.forEach(t=>{var e;return t(null!=(e=r())?e:h)});const i=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,null!=(t=r())?t:h))||void 0;return P(u.getItem.bind(u))(o.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return[!1,t.state];if(o.migrate)return[!0,o.migrate(t.state,t.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var e;const[i,s]=t;if(p=o.merge(s,null!=(e=r())?e:h),n(p,!0),i)return c()}).then(()=>{null==i||i(p,void 0),p=r(),s=!0,l.forEach(t=>t(p))}).catch(t=>{null==i||i(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},o.skipHydration||m(),p||h})(t,e),T="/strakture/v1/shared/activity",A={getItem:()=>a()({path:T}),setItem:(t,e)=>a()({path:T,method:"POST",data:{state:e}})},j=l(window.straktureSharedData?.activity),D={actions:{}},O=x(k(S((t,e)=>{var n;return{...D,...null!==(n=j?.state)&&void 0!==n?n:{},incrementActivity:n=>{t(t=>({...t,actions:{...t.actions,[n]:Number(e().actions[n]||0)+1}}))}}},{name:"Strakture Activity"}),{name:"strakture_shared_activity",storage:E(()=>A),skipHydration:!0})),M=window.ReactJSXRuntime,R=(0,M.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_98_488)",children:[(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"white"}),(0,M.jsx)("path",{d:"M34.9514 0.102057C35.3162 0.109937 35.4742 0.119056 35.7701 0.35029C35.9746 0.629712 35.9848 0.779786 35.967 1.11774C35.8704 1.60652 35.6274 2.03937 35.4016 2.47847C34.6802 3.92121 33.9987 5.38342 33.2719 6.82357C33.1211 7.03656 32.9893 7.11587 32.756 7.23178C32.5188 7.26035 32.5188 7.26035 32.2494 7.25861C25.5952 7.2544 18.9395 7.29481 12.2854 7.25774C11.2534 7.25256 10.4283 7.41096 9.61504 8.09509C8.00099 9.30474 7.99163 11.9703 9.23705 13.4339C9.95002 14.1083 10.7721 14.3927 11.7357 14.3956C15.798 14.4157 19.8606 14.4385 23.9229 14.4395C30.4838 14.4427 35.978 19.7312 35.2131 26.5407C34.5542 31.621 31.3319 35.2053 25.0022 35.9205C24.6598 35.9312 24.3176 35.9319 23.975 35.9317C16.2625 35.9499 8.54992 35.9452 0.837357 35.9502C0.515007 35.9034 0.237366 35.9205 0.0791227 35.5232C-0.079121 35.1258 0.28842 34.4104 0.588463 33.8593C1.35261 32.4222 2.15593 31 2.80817 29.5067C2.97779 29.0847 3.40295 28.8827 3.83826 28.8183C4.06815 28.8069 4.29614 28.8055 4.52631 28.8075C11.1765 28.7708 17.8273 28.7587 24.4776 28.7893C25.7405 28.7828 26.7527 28.4966 27.6824 27.6047C28.3538 26.856 28.5904 25.8918 28.5793 24.9068C28.5076 23.7421 27.884 22.8426 26.9703 22.1771C26.247 21.688 25.4221 21.6063 24.5679 21.6055C21.041 21.5949 17.5141 21.5786 13.9871 21.5823C10.3717 21.5854 7.28207 21.0236 4.59396 18.3924C-1.6867 12.0563 2.98275 0.368658 11.7798 0.118642C19.5068 -0.0547575 27.2256 0.136199 34.9514 0.102057Z",fill:"url(#paint0_linear_98_488)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_98_488",x1:"-1.2544",y1:"35.9502",x2:"39.167",y2:"26.3118",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_98_488",children:(0,M.jsx)("rect",{width:"36",height:"36",fill:"white"})})]})]}),V=x(S(t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t(t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]})}),{name:"Strakture Library Globals"})),L=()=>{const{setOpen:t}=V(),{incrementActivity:e}=O();return(0,M.jsxs)("div",{role:"button",onClick:()=>{t(!0),e("library-button-click")},className:"components-button has-icon bg-design-main hover:opacity-90 hover:text-white text-white h-9 sm:ml-2 xl:pr-4",children:[(0,M.jsx)(o,{icon:R,size:16}),(0,M.jsx)("span",{className:"ml-1 hidden xl:inline",children:(0,r.__)("Strakture Patterns","strakture")})]})};function F(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch(t=>setTimeout(()=>{throw t}))}function N(){let t=[],e={addEventListener:(t,n,r,i)=>(t.addEventListener(n,r,i),e.add(()=>t.removeEventListener(n,r,i))),requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame:(...t)=>e.requestAnimationFrame(()=>e.requestAnimationFrame(...t)),setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return F(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add(()=>{Object.assign(t.style,{[e]:r})})},group(t){let e=N();return t(e),this.add(()=>e.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}var I=Object.defineProperty,_=(t,e,n)=>(((t,e,n)=>{e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let B=new class{constructor(){_(this,"current",this.detect()),_(this,"handoffState","pending"),_(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},U=(t,e)=>{B.isServer?(0,c.useEffect)(t,e):(0,c.useLayoutEffect)(t,e)};function $(t){let e=(0,c.useRef)(t);return U(()=>{e.current=t},[t]),e}let H=function(t){let e=$(t);return c.useCallback((...t)=>e.current(...t),[e])};function W(t,e,n,r){let i=$(n);(0,c.useEffect)(()=>{function n(t){i.current(t)}return(t=null!=t?t:window).addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,r])}function z(){let t=(0,c.useRef)(!1);return U(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function q(t){let e=H(t),n=(0,c.useRef)(!1);(0,c.useEffect)(()=>(n.current=!1,()=>{n.current=!0,F(()=>{n.current&&e()})}),[e])}function Y(t){return B.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function G(...t){return(0,c.useMemo)(()=>Y(...t),[...t])}function X(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in d&&d.useSyncExternalStore(()=>()=>{},()=>!1,()=>!t)}(),[e,n]=c.useState(B.isHandoffComplete);return e&&!1===B.isHandoffComplete&&n(!1),c.useEffect(()=>{!0!==e&&n(!0)},[e]),c.useEffect(()=>B.handoff(),[]),!t&&e}let Z=Symbol();function J(...t){let e=(0,c.useRef)(t);(0,c.useEffect)(()=>{e.current=t},[t]);let n=H(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)});return t.every(t=>null==t||(null==t?void 0:t[Z]))?void 0:n}function K(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)},[t,n])}var Q=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Q||{});function tt(t,e){let n=(0,c.useRef)([]),r=H(t);(0,c.useEffect)(()=>{let t=[...n.current];for(let[i,o]of e.entries())if(n.current[i]!==o){let i=r(e,t);return n.current=e,i}},[r,...e])}function et(...t){return Array.from(new Set(t.flatMap(t=>"string"==typeof t?t.split(" "):[]))).filter(Boolean).join(" ")}function nt(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(t=>`"${t}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,nt),r}var rt=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(rt||{}),it=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(it||{});function ot({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=null!=a?a:at;let l=lt(e,t);if(o)return st(l,n,r,s,a);let u=null!=i?i:0;if(2&u){let{static:t=!1,...e}=l;if(t)return st(e,n,r,s,a)}if(1&u){let{unmount:t=!0,...e}=l;return nt(t?0:1,{0:()=>null,1:()=>st({...e,hidden:!0,style:{display:"none"}},n,r,s,a)})}return st(l,n,r,s,a)}function st(t,e={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=dt(t,["unmount","static"]),u=void 0!==t.ref?{[a]:t.ref}:{},d="function"==typeof s?s(e):s;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(e));let h={};if(e){let t=!1,n=[];for(let[r,i]of Object.entries(e))"boolean"==typeof i&&(t=!0),!0===i&&n.push(r);t&&(h["data-headlessui-state"]=n.join(" "))}if(o===c.Fragment&&Object.keys(ct(l)).length>0){if(!(0,c.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(t=>` - ${t}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(t=>` - ${t}`).join("\n")].join("\n"));let t=d.props,e="function"==typeof(null==t?void 0:t.className)?(...e)=>et(null==t?void 0:t.className(...e),l.className):et(null==t?void 0:t.className,l.className),n=e?{className:e}:{};return(0,c.cloneElement)(d,Object.assign({},lt(d.props,ct(dt(l,["ref"]))),h,u,{ref:i(d.ref,u.ref)},n))}return(0,c.createElement)(o,Object.assign({},dt(l,["ref"]),o!==c.Fragment&&u,o!==c.Fragment&&h),d)}function at(...t){return t.every(t=>null==t)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function lt(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(t=>[t,void 0])));for(let t in n)Object.assign(e,{[t](e,...r){let i=n[t];for(let t of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function ut(t){var e;return Object.assign((0,c.forwardRef)(t),{displayName:null!=(e=t.displayName)?e:t.name})}function ct(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function dt(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var ht=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(ht||{});let pt=ut(function(t,e){var n;let{features:r=1,...i}=t;return ot({ourProps:{ref:e,"aria-hidden":!(2&~r)||(null!=(n=i["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}},theirProps:i,slot:{},defaultTag:"div",name:"Hidden"})}),mt=[];!function(){function t(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&mt[0]!==t.target&&(mt.unshift(t.target),mt=mt.filter(t=>null!=t&&t.isConnected),mt.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();let ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var gt,yt,vt=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(vt||{}),xt=((yt=xt||{})[yt.Error=0]="Error",yt[yt.Overflow=1]="Overflow",yt[yt.Success=2]="Success",yt[yt.Underflow=3]="Underflow",yt),wt=((gt=wt||{})[gt.Previous=-1]="Previous",gt[gt.Next=1]="Next",gt);var bt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(bt||{});var St=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(St||{});function Ct(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Et=["textarea","input"].join(",");function Pt(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=t=>t){return t.slice().sort((t,n)=>{let r=e(t),i=e(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(ft)).sort((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER)))}(t);i.length>0&&s.length>1&&(s=s.filter(t=>!i.includes(t))),r=null!=r?r:o.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==o.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,Et))&&n}(a)&&a.select(),2}function kt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var Tt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(Tt||{});let At=ut(function(t,e){let n=(0,c.useRef)(null),r=J(n,e),{initialFocus:i,containers:o,features:s=30,...a}=t;X()||(s=1);let l=G(n);Dt({ownerDocument:l},Boolean(16&s));let u=function({ownerDocument:t,container:e,initialFocus:n},r){let i=(0,c.useRef)(null),o=z();return tt(()=>{if(!r)return;let s=e.current;s&&F(()=>{if(!o.current)return;let e=null==t?void 0:t.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===e)return void(i.current=e)}else if(s.contains(e))return void(i.current=e);null!=n&&n.current?Ct(n.current):Pt(s,vt.First)===xt.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==t?void 0:t.activeElement})},[r]),i}({ownerDocument:l,container:n,initialFocus:i},Boolean(2&s));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},i){let o=z();W(null==t?void 0:t.defaultView,"focus",t=>{if(!i||!o.current)return;let s=kt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?Ot(s,l)?(r.current=l,Ct(l)):(t.preventDefault(),t.stopPropagation(),Ct(a)):Ct(r.current)},!0)}({ownerDocument:l,container:n,containers:o,previousActiveElement:u},Boolean(8&s));let d=function(){let t=(0,c.useRef)(0);return K("keydown",e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)},!0),t}(),h=H(t=>{let e=n.current;e&&nt(d.current,{[Q.Forwards]:()=>{Pt(e,vt.First,{skipElements:[t.relatedTarget]})},[Q.Backwards]:()=>{Pt(e,vt.Last,{skipElements:[t.relatedTarget]})}})}),p=function(){let[t]=(0,c.useState)(N);return(0,c.useEffect)(()=>()=>t.dispose(),[t]),t}(),m=(0,c.useRef)(!1),f={ref:r,onKeyDown(t){"Tab"==t.key&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(t){let e=kt(o);n.current instanceof HTMLElement&&e.add(n.current);let r=t.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(Ot(e,r)||(m.current?Pt(n.current,nt(d.current,{[Q.Forwards]:()=>vt.Next,[Q.Backwards]:()=>vt.Previous})|vt.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&Ct(t.target)))}};return c.createElement(c.Fragment,null,Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}),ot({ourProps:f,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&c.createElement(pt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:ht.Focusable}))}),jt=Object.assign(At,{features:Tt});function Dt({ownerDocument:t},e){let n=function(t=!0){let e=(0,c.useRef)(mt.slice());return tt(([t],[n])=>{!0===n&&!1===t&&F(()=>{e.current.splice(0)}),!1===n&&!0===t&&(e.current=mt.slice())},[t,mt,e]),H(()=>{var t;return null!=(t=e.current.find(t=>null!=t&&t.isConnected))?t:null})}(e);tt(()=>{e||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&Ct(n())},[e]),q(()=>{e&&Ct(n())})}function Ot(t,e){for(let n of t)if(n.contains(e))return!0;return!1}const Mt=window.ReactDOM;let Rt=(0,c.createContext)(!1);function Vt(){return(0,c.useContext)(Rt)}function Lt(t){return c.createElement(Rt.Provider,{value:t.force},t.children)}let Ft=c.Fragment,Nt=c.Fragment,It=(0,c.createContext)(null),_t=(0,c.createContext)(null),Bt=ut(function(t,e){let n=t,r=(0,c.useRef)(null),i=J(function(t,e=!0){return Object.assign(t,{[Z]:e})}(t=>{r.current=t}),e),o=G(r),s=function(t){let e=Vt(),n=(0,c.useContext)(It),r=G(t),[i,o]=(0,c.useState)(()=>{if(!e&&null!==n||B.isServer)return null;let t=null==r?void 0:r.getElementById("headlessui-portal-root");if(t)return t;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return(0,c.useEffect)(()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))},[i,r]),(0,c.useEffect)(()=>{e||null!==n&&o(n.current)},[n,o,e]),i}(r),[a]=(0,c.useState)(()=>{var t;return B.isServer?null:null!=(t=null==o?void 0:o.createElement("div"))?t:null}),l=(0,c.useContext)(_t),u=X();return U(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),U(()=>{if(a&&l)return l.register(a)},[l,a]),q(()=>{var t;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&(null==(t=s.parentElement)||t.removeChild(s)))}),u&&s&&a?(0,Mt.createPortal)(ot({ourProps:{ref:i},theirProps:n,defaultTag:Ft,name:"Portal"}),a):null}),Ut=ut(function(t,e){let{target:n,...r}=t,i={ref:J(e)};return c.createElement(It.Provider,{value:n},ot({ourProps:i,theirProps:r,defaultTag:Nt,name:"Popover.Group"}))}),$t=Object.assign(Bt,{Group:Ut});const Ht="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:Wt,useEffect:zt,useLayoutEffect:qt,useDebugValue:Yt}=d;function Gt(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Ht(n,t)}catch{return!0}}const Xt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:i},o]=Wt({inst:{value:r,getSnapshot:e}});return qt(()=>{i.value=r,i.getSnapshot=e,Gt(i)&&o({inst:i})},[t,r,e]),zt(()=>(Gt(i)&&o({inst:i}),t(()=>{Gt(i)&&o({inst:i})})),[t]),Yt(r),r},Zt="useSyncExternalStore"in d?(t=>t.useSyncExternalStore)(d):Xt;function Jt(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,i=r.clientWidth-r.offsetWidth,o=t-i;n.style(r,"paddingRight",`${o}px`)}}}function Kt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qt(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let te=function(t,e){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:t=>(r.add(t),()=>r.delete(t)),dispatch(t,...i){let o=e[t].call(n,...i);o&&(n=o,r.forEach(t=>t()))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:N(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:Qt(n)},i=[Kt()?{before({doc:t,d:e,meta:n}){function r(t){return n.containers.flatMap(t=>t()).some(e=>e.contains(t))}e.microTask(()=>{var n;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let n=N();n.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>n.dispose()))}let i=null!=(n=window.scrollY)?n:window.pageYOffset,o=null;e.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),s=t.querySelector(i);s&&!r(s)&&(o=s)}catch{}},!0),e.addEventListener(t,"touchstart",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let n=t.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}),e.addEventListener(t,"touchmove",t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.headlessuiPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.headlessuiPortal&&t.preventDefault()}else t.preventDefault()},{passive:!1}),e.add(()=>{var t;let e=null!=(t=window.scrollY)?t:window.pageYOffset;i!==e&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},Jt(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];i.forEach(({before:t})=>null==t?void 0:t(r)),i.forEach(({after:t})=>null==t?void 0:t(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});function ee(t,e,n){let r=function(t){return Zt(t.subscribe,t.getSnapshot,t.getSnapshot)}(te),i=t?r.get(t):void 0,o=!!i&&i.count>0;return U(()=>{if(t&&e)return te.dispatch("PUSH",t,n),()=>te.dispatch("POP",t,n)},[e,t]),o}var ne;te.subscribe(()=>{let t=te.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&te.dispatch("TEARDOWN",n)}});let re=null!=(ne=c.useId)?ne:function(){let t=X(),[e,n]=c.useState(t?()=>B.nextId():null);return U(()=>{null===e&&n(B.nextId())},[e]),null!=e?""+e:void 0},ie=new Map,oe=new Map;function se(t,e=!0){U(()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let i=null!=(n=oe.get(r))?n:0;return oe.set(r,i+1),0!==i||(ie.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=oe.get(r))?t:1;if(1===e?oe.delete(r):oe.set(r,e-1),1!==e)return;let n=ie.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,ie.delete(r))}},[t,e])}function ae(t,e,n){let r=$(e);(0,c.useEffect)(()=>{function e(t){r.current(t)}return document.addEventListener(t,e,n),()=>document.removeEventListener(t,e,n)},[t,n])}function le(t,e,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=i(n);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(t);for(let t of s){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(o)||n.composed&&n.composedPath().includes(e))return}return!function(t,e=0){var n;return t!==(null==(n=Y(t))?void 0:n.body)&&nt(e,{0:()=>t.matches(ft),1(){let e=t;for(;null!==e;){if(e.matches(ft))return!0;e=e.parentElement}return!1}})}(o,bt.Loose)&&-1!==o.tabIndex&&n.preventDefault(),e(n,o)}(0,c.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let o=(0,c.useRef)(null);ae("pointerdown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("mousedown",t=>{var e,n;r.current&&(o.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)},!0),ae("click",t=>{Kt()||/Android/gi.test(window.navigator.userAgent)||o.current&&(i(t,()=>o.current),o.current=null)},!0),ae("touchend",t=>i(t,()=>t.target instanceof HTMLElement?t.target:null),!0),K("blur",t=>i(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ue=(0,c.createContext)(null);ue.displayName="OpenClosedContext";var ce=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(ce||{});let de=(0,c.createContext)(()=>{});de.displayName="StackContext";var he=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(he||{});function pe({children:t,onUpdate:e,type:n,element:r,enabled:i}){let o=(0,c.useContext)(de),s=H((...t)=>{null==e||e(...t),o(...t)});return U(()=>{let t=void 0===i||!0===i;return t&&s(0,n,r),()=>{t&&s(1,n,r)}},[s,n,r,i]),c.createElement(de.Provider,{value:s},t)}let me=(0,c.createContext)(null);function fe(){let t=(0,c.useContext)(me);if(null===t){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,fe),t}return t}let ge=ut(function(t,e){let n=re(),{id:r=`headlessui-description-${n}`,...i}=t,o=fe(),s=J(e);return U(()=>o.register(r),[r,o.register]),ot({ourProps:{ref:s,...o.props,id:r},theirProps:i,slot:o.slot||{},defaultTag:"p",name:o.name||"Description"})}),ye=Object.assign(ge,{});var ve=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(ve||{}),xe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(xe||{}),we=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(we||{});let be={0:(t,e)=>t.titleId===e.id?t:{...t,titleId:e.id}},Se=(0,c.createContext)(null);function Ce(t){let e=(0,c.useContext)(Se);if(null===e){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ce),e}return e}function Ee(t,e){return nt(e.type,be,t,e)}Se.displayName="DialogContext";let Pe=rt.RenderStrategy|rt.Static,ke=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...u}=t,[d,h]=(0,c.useState)(0),p=(0,c.useRef)(!1);a="dialog"===a||"alertdialog"===a?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=(0,c.useContext)(ue);void 0===i&&null!==m&&(i=(m&ce.Open)===ce.Open);let f=(0,c.useRef)(null),g=J(f,e),y=G(f),v=t.hasOwnProperty("open")||null!==m,x=t.hasOwnProperty("onClose");if(!v&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof o)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let w=i?0:1,[b,S]=(0,c.useReducer)(Ee,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),C=H(()=>o(!1)),E=H(t=>S({type:0,id:t})),P=!!X()&&!l&&0===w,k=d>1,T=null!==(0,c.useContext)(Se),[A,j]=function(){let t=(0,c.useContext)(_t),e=(0,c.useRef)([]),n=H(n=>(e.current.push(n),t&&t.register(n),()=>r(n))),r=H(n=>{let r=e.current.indexOf(n);-1!==r&&e.current.splice(r,1),t&&t.unregister(n)}),i=(0,c.useMemo)(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,(0,c.useMemo)(()=>function({children:t}){return c.createElement(_t.Provider,{value:i},t)},[i])]}(),D={get current(){var t;return null!=(t=b.panelRef.current)?t:f.current}},{resolveContainers:O,mainTreeNodeRef:M,MainTreeNode:R}=function({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let i=(0,c.useRef)(null!=(r=null==n?void 0:n.current)?r:null),o=G(i),s=H(()=>{var n,r,s;let a=[];for(let e of t)null!==e&&(e instanceof HTMLElement?a.push(e):"current"in e&&e.current instanceof HTMLElement&&a.push(e.current));if(null!=e&&e.current)for(let t of e.current)a.push(t);for(let t of null!=(n=null==o?void 0:o.querySelectorAll("html > *, body > *"))?n:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(i.current)||t.contains(null==(s=null==(r=i.current)?void 0:r.getRootNode())?void 0:s.host)||a.some(e=>t.contains(e))||a.push(t));return a});return{resolveContainers:s,contains:H(t=>s().some(e=>e.contains(t))),mainTreeNodeRef:i,MainTreeNode:(0,c.useMemo)(()=>function(){return null!=n?null:c.createElement(pt,{features:ht.Hidden,ref:i})},[i,n])}}({portals:A,defaultContainers:[D]}),V=k?"parent":"leaf",L=null!==m&&(m&ce.Closing)===ce.Closing,F=!T&&!L&&P,N=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("body > *"))?t:[]).find(t=>"headlessui-portal-root"!==t.id&&t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(N,F);let I=!!k||P,_=(0,c.useCallback)(()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("[data-headlessui-portal]"))?t:[]).find(t=>t.contains(M.current)&&t instanceof HTMLElement))?e:null},[M]);se(_,I),le(O,t=>{t.preventDefault(),C()},!(!P||k));let B=!(k||0!==w);W(null==y?void 0:y.defaultView,"keydown",t=>{B&&(t.defaultPrevented||t.key===ve.Escape&&(t.preventDefault(),t.stopPropagation(),C()))}),function(t,e,n=()=>[document.body]){ee(t,e,t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}})}(y,!(L||0!==w||T),O),(0,c.useEffect)(()=>{if(0!==w||!f.current)return;let t=new ResizeObserver(t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&C()}});return t.observe(f.current),()=>t.disconnect()},[w,f,C]);let[U,$]=function(){let[t,e]=(0,c.useState)([]);return[t.length>0?t.join(" "):void 0,(0,c.useMemo)(()=>function(t){let n=H(t=>(e(e=>[...e,t]),()=>e(e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))),r=(0,c.useMemo)(()=>({register:n,slot:t.slot,name:t.name,props:t.props}),[n,t.slot,t.name,t.props]);return c.createElement(me.Provider,{value:r},t.children)},[e])]}(),z=(0,c.useMemo)(()=>[{dialogState:w,close:C,setTitleId:E},b],[w,b,C,E]),q=(0,c.useMemo)(()=>({open:0===w}),[w]),Y={ref:g,id:r,role:a,"aria-modal":0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":U};return c.createElement(pe,{type:"Dialog",enabled:0===w,element:f,onUpdate:H((t,e)=>{"Dialog"===e&&nt(t,{[he.Add]:()=>h(t=>t+1),[he.Remove]:()=>h(t=>t-1)})})},c.createElement(Lt,{force:!0},c.createElement($t,null,c.createElement(Se.Provider,{value:z},c.createElement($t.Group,{target:f},c.createElement(Lt,{force:!1},c.createElement($,{slot:q,name:"Dialog.Description"},c.createElement(jt,{initialFocus:s,containers:O,features:P?nt(V,{parent:jt.features.RestoreFocus,leaf:jt.features.All&~jt.features.FocusLock}):jt.features.None},c.createElement(j,null,ot({ourProps:Y,theirProps:u,slot:q,defaultTag:"div",features:Pe,visible:0===w,name:"Dialog"}))))))))),c.createElement(R,null))}),Te=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Backdrop"),a=J(e);(0,c.useEffect)(()=>{if(null===s.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return c.createElement(Lt,{force:!0},c.createElement($t,null,ot({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Ae=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-panel-${n}`,...i}=t,[{dialogState:o},s]=Ce("Dialog.Panel"),a=J(e,s.panelRef),l=(0,c.useMemo)(()=>({open:0===o}),[o]),u=H(t=>{t.stopPropagation()});return ot({ourProps:{ref:a,id:r,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),je=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=t,[{dialogState:o,close:s}]=Ce("Dialog.Overlay"),a=J(e),l=H(t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),s()}});return ot({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:l},theirProps:i,slot:(0,c.useMemo)(()=>({open:0===o}),[o]),defaultTag:"div",name:"Dialog.Overlay"})}),De=ut(function(t,e){let n=re(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:o,setTitleId:s}]=Ce("Dialog.Title"),a=J(e);(0,c.useEffect)(()=>(s(r),()=>s(null)),[r,s]);let l=(0,c.useMemo)(()=>({open:0===o}),[o]);return ot({ourProps:{ref:a,id:r},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Oe=Object.assign(ke,{Backdrop:Te,Panel:Ae,Overlay:je,Title:De,Description:ye});const Me=(0,c.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Re=(0,c.createContext)({}),Ve=(0,c.createContext)(null),Le="undefined"!=typeof document,Fe=Le?c.useLayoutEffect:c.useEffect,Ne=(0,c.createContext)({strict:!1}),Ie=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_e="data-"+Ie("framerAppearId");function Be(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ue(t){return"string"==typeof t||Array.isArray(t)}function $e(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const He=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],We=["initial",...He];function ze(t){return $e(t.animate)||We.some(e=>Ue(t[e]))}function qe(t){return Boolean(ze(t)||t.variants)}function Ye(t){return Array.isArray(t)?t.join(" "):t}const Ge={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Xe={};for(const t in Ge)Xe[t]={isEnabled:e=>Ge[t].some(t=>!!e[t])};const Ze=(0,c.createContext)({}),Je=(0,c.createContext)({}),Ke=Symbol.for("motionComponentSymbol");function Qe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&function(t){for(const e in t)Xe[e]={...Xe[e],...t[e]}}(t);const o=(0,c.forwardRef)(function(o,s){let a;const l={...(0,c.useContext)(Me),...o,layoutId:tn(o)},{isStatic:u}=l,d=function(t){const{initial:e,animate:n}=function(t,e){if(ze(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ue(e)?e:void 0,animate:Ue(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,c.useContext)(Re));return(0,c.useMemo)(()=>({initial:e,animate:n}),[Ye(e),Ye(n)])}(o),h=r(o,u);if(!u&&Le){d.visualElement=function(t,e,n,r){const{visualElement:i}=(0,c.useContext)(Re),o=(0,c.useContext)(Ne),s=(0,c.useContext)(Ve),a=(0,c.useContext)(Me).reducedMotion,l=(0,c.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const u=l.current;(0,c.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,c.useRef)(Boolean(n[_e]&&!window.HandoffComplete));return Fe(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,c.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,l,e);const n=(0,c.useContext)(Je),r=(0,c.useContext)(Ne).strict;d.visualElement&&(a=d.visualElement.loadFeatures(l,r,t,n))}return c.createElement(Re.Provider,{value:d},a&&d.visualElement?c.createElement(a,{visualElement:d.visualElement,...l}):null,n(i,o,function(t,e,n){return(0,c.useCallback)(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Be(n)&&(n.current=r))},[e])}(h,d.visualElement,s),h,u,d.visualElement))});return o[Ke]=i,o}function tn({layoutId:t}){const e=(0,c.useContext)(Ze).id;return e&&void 0!==t?e+"-"+t:t}function en(t){function e(e,n={}){return Qe(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const nn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rn(t){return"string"==typeof t&&!t.includes("-")&&!!(nn.indexOf(t)>-1||/[A-Z]/.test(t))}const on={},sn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],an=new Set(sn);function ln(t,{layout:e,layoutId:n}){return an.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!on[t]||"opacity"===t)}const un=t=>Boolean(t&&t.getVelocity),cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dn=sn.length,hn=t=>e=>"string"==typeof e&&e.startsWith(t),pn=hn("--"),mn=hn("var(--"),fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,gn=(t,e,n)=>Math.min(Math.max(n,t),e),yn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vn={...yn,transform:t=>gn(0,1,t)},xn={...yn,default:1},wn=t=>Math.round(1e5*t)/1e5,bn=/(-)?([\d]*\.?[\d])+/g,Sn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Cn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function En(t){return"string"==typeof t}const Pn=t=>({test:e=>En(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),kn=Pn("deg"),Tn=Pn("%"),An=Pn("px"),jn=Pn("vh"),Dn=Pn("vw"),On={...Tn,parse:t=>Tn.parse(t)/100,transform:t=>Tn.transform(100*t)},Mn={...yn,transform:Math.round},Rn={borderWidth:An,borderTopWidth:An,borderRightWidth:An,borderBottomWidth:An,borderLeftWidth:An,borderRadius:An,radius:An,borderTopLeftRadius:An,borderTopRightRadius:An,borderBottomRightRadius:An,borderBottomLeftRadius:An,width:An,maxWidth:An,height:An,maxHeight:An,size:An,top:An,right:An,bottom:An,left:An,padding:An,paddingTop:An,paddingRight:An,paddingBottom:An,paddingLeft:An,margin:An,marginTop:An,marginRight:An,marginBottom:An,marginLeft:An,rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:xn,scaleX:xn,scaleY:xn,scaleZ:xn,skew:kn,skewX:kn,skewY:kn,distance:An,translateX:An,translateY:An,translateZ:An,x:An,y:An,z:An,perspective:An,transformPerspective:An,opacity:vn,originX:On,originY:On,originZ:An,zIndex:Mn,fillOpacity:vn,strokeOpacity:vn,numOctaves:Mn};function Vn(t,e,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(pn(t)){o[t]=n;continue}const r=Rn[t],d=fn(n,r);if(an.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):i[t]=d}if(e.transform||(l||r?i.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,i){let o="";for(let e=0;e<dn;e++){const n=sn[e];void 0!==t[n]&&(o+=`${cn[n]||n}(${t[n]}) `)}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,r?"":o):n&&r&&(o="none"),o}(t.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;i.transformOrigin=`${t} ${e} ${n}`}}function Ln(t,e,n){for(const r in e)un(e[r])||ln(r,n)||(t[r]=e[r])}function Fn(t,e,n){const r={},i=function(t,e,n){const r={};return Ln(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,c.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Vn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=i,r}const Nn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function In(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Nn.has(t)}let Bn=t=>!In(t);try{(Un=require("@emotion/is-prop-valid").default)&&(Bn=t=>t.startsWith("on")?!In(t):Un(t))}catch(t){}var Un;function $n(t,e,n){return"string"==typeof t?t:An.transform(e+n*t)}const Hn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wn={offset:"strokeDashoffset",array:"strokeDasharray"};function zn(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(Vn(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:f}=t;p.transform&&(f&&(m.transform=p.transform),delete p.transform),f&&(void 0!==i||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${$n(e,t.x,t.width)} ${$n(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,i=!0){t.pathLength=1;const o=i?Hn:Wn;t[o.offset]=An.transform(-r);const s=An.transform(e),a=An.transform(n);t[o.array]=`${s} ${a}`}(p,s,a,l,!1)}const qn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yn(t,e,n,r){const i=(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zn(n,e,{enableHardwareAcceleration:!1},qn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Ln(e,t.style,t),i.style={...e,...i.style}}return i}function Gn(t=!1){return(e,n,r,{latestValues:i},o)=>{const s=(rn(e)?Yn:Fn)(n,i,o,e),a=function(t,e,n){const r={};for(const i in t)"values"===i&&"object"==typeof t.values||(Bn(i)||!0===n&&In(i)||!e&&!In(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}(n,"string"==typeof e,t),l={...a,...s,ref:r},{children:u}=n,d=(0,c.useMemo)(()=>un(u)?u.get():u,[u]);return(0,c.createElement)(e,{...l,children:d})}}function Xn(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Zn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Jn(t,e,n,r){Xn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Zn.has(n)?n:Ie(n),e.attrs[n])}function Kn(t,e){const{style:n}=t,r={};for(const i in n)(un(n[i])||e.style&&un(e.style[i])||ln(i,t))&&(r[i]=n[i]);return r}function Qn(t,e){const n=Kn(t,e);for(const r in t)(un(t[r])||un(e[r]))&&(n[-1!==sn.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function tr(t,e,n,r={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,i)),e}const er=t=>Array.isArray(t),nr=t=>er(t)?t[t.length-1]||0:t;function rr(t){const e=un(t)?t.get():t;return(t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue))(e)?e.toValue():e}const ir=t=>(e,n)=>{const r=(0,c.useContext)(Re),i=(0,c.useContext)(Ve),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,o){const s={latestValues:or(r,i,o,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(t,e,r,i);return n?o():function(t){const e=(0,c.useRef)(null);return null===e.current&&(e.current=t()),e.current}(o)};function or(t,e,n,r){const i={},o=r(t,{});for(const t in o)i[t]=rr(o[t]);let{initial:s,animate:a}=t;const l=ze(t),u=qe(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!$e(d)&&(Array.isArray(d)?d:[d]).forEach(e=>{const n=tr(t,e);if(!n)return;const{transitionEnd:r,transition:o,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(i[t]=e)}for(const t in r)i[t]=r[t]}),i}const sr=t=>t;class ar{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const lr=["prepare","read","update","preRender","render","postRender"],{schedule:ur,cancel:cr,state:dr,steps:hr}=function(t){let e=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=lr.reduce((t,n)=>(t[n]=function(t){let e=new ar,n=new ar,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,u=l?e:n;return o&&s.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>e=!0),t),{}),o=t=>i[t].process(r),s=()=>{const i=performance.now();e=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,lr.forEach(o),r.isProcessing=!1,e&&(n=!1,t(s))};return{schedule:lr.reduce((o,a)=>{const l=i[a];return o[a]=(i,o=!1,a=!1)=>(e||(e=!0,n=!0,r.isProcessing||t(s)),l.schedule(i,o,a)),o},{}),cancel:t=>lr.forEach(e=>i[e].cancel(t)),state:r,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:sr),pr={useVisualState:ir({scrapeMotionValuesFromProps:Qn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(t,e,{renderState:n,latestValues:r})=>{ur.read(()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}}),ur.render(()=>{zn(n,r,{enableHardwareAcceleration:!1},qn(e.tagName),t.transformTemplate),Jn(e,n)})}})},mr={useVisualState:ir({scrapeMotionValuesFromProps:Kn,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const gr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function yr(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function vr(t,e,n,r){return fr(t,e,(t=>e=>gr(e)&&t(e,yr(e)))(n),r)}const xr=(t,e)=>n=>e(t(n)),wr=(...t)=>t.reduce(xr);function br(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const Sr=br("dragHorizontal"),Cr=br("dragVertical");function Er(t){let e=!1;if("y"===t)e=Cr();else if("x"===t)e=Sr();else{const t=Sr(),n=Cr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pr(){const t=Er(!0);return!t||(t(),!1)}class kr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tr(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return vr(t.current,n,(n,i)=>{if("touch"===n.pointerType||Pr())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[r]&&ur.update(()=>o[r](n,i))},{passive:!t.getProps()[r]})}const Ar=(t,e)=>!!e&&(t===e||Ar(t,e.parentElement));function jr(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,yr(n))}const Dr=new WeakMap,Or=new WeakMap,Mr=t=>{const e=Dr.get(t.target);e&&e(t)},Rr=t=>{t.forEach(Mr)};const Vr={some:0,all:1},Lr={inView:{Feature:class extends kr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Vr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Or.has(n)||Or.set(n,{});const r=Or.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Rr,{root:t,...e})),r[i]}(e);return Dr.set(t,n),r.observe(t),()=>{Dr.delete(t),r.unobserve(t)}}(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=e?n:r;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends kr{constructor(){super(...arguments),this.removeStartListeners=sr,this.removeEndListeners=sr,this.removeAccessibleListeners=sr,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=vr(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();ur.update(()=>{i||Ar(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)})},{passive:!(n.onTap||n.onPointerUp)}),i=vr(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=wr(r,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=fr(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=fr(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&jr("up",(t,e)=>{const{onTap:n}=this.node.getProps();n&&ur.update(()=>n(t,e))})}),jr("down",(t,e)=>{this.startPress(t,e)}))}),e=fr(this.node.current,"blur",()=>{this.isPressing&&jr("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=wr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ur.update(()=>n(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Pr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ur.update(()=>n(t,e))}mount(){const t=this.node.getProps(),e=vr(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=fr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=wr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends kr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wr(fr(this.node.current,"focus",()=>this.onFocus()),fr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends kr{mount(){this.unmount=wr(Tr(this.node,!0),Tr(this.node,!1))}unmount(){}}}};function Fr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Nr(t,e,n){const r=t.getProps();return tr(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}let Ir=sr,_r=sr;const Br=t=>1e3*t,Ur=t=>t/1e3,$r=t=>Array.isArray(t)&&"number"==typeof t[0];function Hr(t){return Boolean(!t||"string"==typeof t&&zr[t]||$r(t)||Array.isArray(t)&&t.every(Hr))}const Wr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,zr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function qr(t){if(t)return $r(t)?Wr(t):Array.isArray(t)?t.map(qr):zr[t]}const Yr=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Gr(t,e,n,r){if(t===e&&n===r)return sr;return i=>0===i||1===i?i:Yr(function(t,e,n,r,i){let o,s,a=0;do{s=e+(n-e)/2,o=Yr(s,r,i)-t,o>0?n=s:e=s}while(Math.abs(o)>1e-7&&++a<12);return s}(i,0,1,t,n),e,r)}const Xr=Gr(.42,0,1,1),Zr=Gr(0,0,.58,1),Jr=Gr(.42,0,.58,1),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qr=t=>e=>1-t(1-e),ti=t=>1-Math.sin(Math.acos(t)),ei=Qr(ti),ni=Kr(ti),ri=Gr(.33,1.53,.69,.99),ii=Qr(ri),oi=Kr(ii),si={linear:sr,easeIn:Xr,easeInOut:Jr,easeOut:Zr,circIn:ti,circInOut:ni,circOut:ei,backIn:ii,backInOut:oi,backOut:ri,anticipate:t=>(t*=2)<1?.5*ii(t):.5*(2-Math.pow(2,-10*(t-1)))},ai=t=>{if(Array.isArray(t)){_r(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return Gr(e,n,r,i)}return"string"==typeof t?(_r(void 0!==si[t],`Invalid easing type '${t}'`),si[t]):t},li=(t,e)=>n=>Boolean(En(n)&&Cn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ui=(t,e,n)=>r=>{if(!En(r))return r;const[i,o,s,a]=r.match(bn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ci={...yn,transform:t=>Math.round((t=>gn(0,255,t))(t))},di={test:li("rgb","red"),parse:ui("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ci.transform(t)+", "+ci.transform(e)+", "+ci.transform(n)+", "+wn(vn.transform(r))+")"},hi={test:li("#"),parse:function(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:di.transform},pi={test:li("hsl","hue"),parse:ui("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Tn.transform(wn(e))+", "+Tn.transform(wn(n))+", "+wn(vn.transform(r))+")"},mi={test:t=>di.test(t)||hi.test(t)||pi.test(t),parse:t=>di.test(t)?di.parse(t):pi.test(t)?pi.parse(t):hi.parse(t),transform:t=>En(t)?t:t.hasOwnProperty("red")?di.transform(t):pi.transform(t)},fi=(t,e,n)=>-n*t+n*e+t;function gi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const yi=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},vi=[hi,di,pi];function xi(t){const e=(t=>vi.find(e=>e.test(t)))(t);_r(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===pi&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let i=0,o=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;i=gi(a,r,t+1/3),o=gi(a,r,t),s=gi(a,r,t-1/3)}else i=o=s=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:r}}(n)),n}const wi=(t,e)=>{const n=xi(t),r=xi(e),i={...n};return t=>(i.red=yi(n.red,r.red,t),i.green=yi(n.green,r.green,t),i.blue=yi(n.blue,r.blue,t),i.alpha=fi(n.alpha,r.alpha,t),di.transform(i))},bi={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:sr},Si={regex:Sn,countKey:"Colors",token:"${c}",parse:mi.parse},Ci={regex:bn,countKey:"Numbers",token:"${n}",parse:yn.parse};function Ei(t,{regex:e,countKey:n,token:r,parse:i}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...o.map(i)))}function Pi(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ei(n,bi),Ei(n,Si),Ei(n,Ci),n}function ki(t){return Pi(t).values}function Ti(t){const{values:e,numColors:n,numVars:r,tokenised:i}=Pi(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=i<r?e.replace(bi.token,t[i]):i<r+n?e.replace(Si.token,mi.transform(t[i])):e.replace(Ci.token,wn(t[i]));return e}}const Ai=t=>"number"==typeof t?0:t,ji={test:function(t){var e,n;return isNaN(t)&&En(t)&&((null===(e=t.match(bn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Sn))||void 0===n?void 0:n.length)||0)>0},parse:ki,createTransformer:Ti,getAnimatableNone:function(t){const e=ki(t);return Ti(t)(e.map(Ai))}},Di=(t,e)=>n=>`${n>0?e:t}`;function Oi(t,e){return"number"==typeof t?n=>fi(t,e,n):mi.test(t)?wi(t,e):t.startsWith("var(")?Di(t,e):Vi(t,e)}const Mi=(t,e)=>{const n=[...t],r=n.length,i=t.map((t,n)=>Oi(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=i[e](t);return n}},Ri=(t,e)=>{const n={...t,...e},r={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(r[i]=Oi(t[i],e[i]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Vi=(t,e)=>{const n=ji.createTransformer(e),r=Pi(t),i=Pi(e);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?wr(Mi(r.values,i.values),n):(Ir(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Di(t,e))},Li=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Fi=(t,e)=>n=>fi(t,e,n);function Ni(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const o=t.length;if(_r(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],i=n||function(t){return"number"==typeof t?Fi:"string"==typeof t?mi.test(t)?wi:Vi:Array.isArray(t)?Mi:"object"==typeof t?Ri:Fi}(t[0]),o=t.length-1;for(let n=0;n<o;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||sr:e;o=wr(t,o)}r.push(o)}return r}(e,r,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Li(t[n],t[n+1],e);return s[n](r)};return n?e=>l(gn(t[0],t[o-1],e)):l}function Ii({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(r)?r.map(ai):ai(r),o={done:!1,value:e[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Li(0,e,r);t.push(fi(n,1,i))}}(e,t.length-1),e}(e),t),a=Ni(s,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||Jr).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}function _i(t,e){return e?t*(1e3/e):0}function Bi(t,e,n){const r=Math.max(e-5,0);return _i(n-t(r),e-r)}const Ui=12;function $i(t,e){return t*Math.sqrt(1-e*e)}const Hi=["duration","bounce"],Wi=["stiffness","damping","mass"];function zi(t,e){return e.some(e=>void 0!==t[e])}function qi({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],o=t[t.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!zi(t,Wi)&&zi(t,Hi)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,o;Ir(t<=Br(10),"Spring duration must be 10 seconds or less");let s=1-e;s=gn(.05,1,s),t=gn(.01,10,Ur(t)),s<1?(i=e=>{const r=e*s,i=r*t;return.001-(r-n)/$i(e,s)*Math.exp(-i)},o=e=>{const r=e*s*t,o=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=$i(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((o-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Ui;n++)r-=t(r)/e(r);return r}(i,o,5/t);if(t=Br(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...r,velocity:-Ur(r.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(a*u)),f=o-i,g=Ur(Math.sqrt(a/u)),y=Math.abs(f)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),m<1){const t=$i(g,m);v=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)v=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);v=e=>{const n=Math.exp(-m*g*e),r=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(r)+t*f*Math.cosh(r))/t}}return{calculatedDuration:h&&c||null,next:t=>{const r=v(t);if(h)s.done=t>=c;else{let i=p;0!==t&&(i=m<1?Bi(v,t,r):0);const a=Math.abs(i)<=n,l=Math.abs(o-r)<=e;s.done=a&&l}return s.value=s.done?o:r,s}}}function Yi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=d+m,g=void 0===s?f:s(f);g!==f&&(m=g-d);const y=t=>-m*Math.exp(-t/r),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let w,b;const S=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(w=t,b=qi({keyframes:[h.value,p(h.value)],velocity:Bi(v,t,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>w?b.next(t-w):(!e&&x(t),h)}}}const Gi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>ur.update(e,!0),stop:()=>cr(e),now:()=>dr.isProcessing?dr.timestamp:performance.now()}};function Xi(t){let e=0,n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const Zi={decay:Yi,inertia:Yi,tween:Ii,keyframes:Ii,spring:qi};function Ji({autoplay:t=!0,delay:e=0,driver:n=Gi,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,m,f=1,g=!1;const y=()=>{m=new Promise(t=>{p=t})};let v;y();const x=Zi[i]||Ii;let w;x!==Ii&&"number"!=typeof r[0]&&(w=Ni([0,100],r,{clamp:!1}),r=[0,100]);const b=x({...h,keyframes:r});let S;"mirror"===a&&(S=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let C="idle",E=null,P=null,k=null;null===b.calculatedDuration&&o&&(b.calculatedDuration=Xi(b));const{calculatedDuration:T}=b;let A=1/0,j=1/0;null!==T&&(A=T+s,j=A*(o+1)-s);let D=0;const O=t=>{if(null===P)return;f>0&&(P=Math.min(P,t)),f<0&&(P=Math.min(t-j/f,P)),D=null!==E?E:Math.round(t-P)*f;const n=D-e*(f>=0?1:-1),i=f>=0?n<0:n>j;D=Math.max(n,0),"finished"===C&&null===E&&(D=j);let l=D,u=b;if(o){const t=Math.min(D,j)/A;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,o+1),Boolean(e%2)&&("reverse"===a?(n=1-n,s&&(n-=s/A)):"mirror"===a&&(u=S)),l=gn(0,1,n)*A}const c=i?{done:!1,value:r[0]}:u.next(l);w&&(c.value=w(c.value));let{done:h}=c;i||null===T||(h=f>=0?D>=j:D<=0);const p=null===E&&("finished"===C||"running"===C&&h);return d&&d(c.value),p&&V(),c},M=()=>{v&&v.stop(),v=void 0},R=()=>{C="idle",M(),p(),y(),P=k=null},V=()=>{C="finished",c&&c(),M(),p()},L=()=>{if(g)return;v||(v=n(O));const t=v.now();l&&l(),null!==E?P=t-E:P&&"finished"!==C||(P=t),"finished"===C&&y(),k=P,E=null,C="running",v.start()};t&&L();const F={then:(t,e)=>m.then(t,e),get time(){return Ur(D)},set time(t){t=Br(t),D=t,null===E&&v&&0!==f?P=v.now()-t/f:E=t},get duration(){const t=null===b.calculatedDuration?Xi(b):b.calculatedDuration;return Ur(t)},get speed(){return f},set speed(t){t!==f&&v&&(f=t,F.time=Ur(D))},get state(){return C},play:L,pause:()=>{C="paused",E=D},stop:()=>{g=!0,"idle"!==C&&(C="idle",u&&u(),R())},cancel:()=>{null!==k&&O(k),R()},complete:()=>{C="finished"},sample:t=>(P=0,O(t))};return F}const Ki=function(){let t;return()=>(void 0===t&&(t=Object.hasOwnProperty.call(Element.prototype,"animate")),t)}(),Qi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const to={type:"spring",stiffness:500,damping:25,restSpeed:10},eo={type:"keyframes",duration:.8},no={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ro=(t,{keyframes:e})=>e.length>2?eo:an.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:to:no,io=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!ji.test(e)&&"0"!==e||e.startsWith("url("))),oo=new Set(["brightness","contrast","saturate","opacity"]);function so(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(bn)||[];if(!r)return t;const i=n.replace(r,"");let o=oo.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+i+")"}const ao=/([a-z-]*)\(.*?\)/g,lo={...ji,getAnimatableNone:t=>{const e=t.match(ao);return e?e.map(so).join(" "):t}},uo={...Rn,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:lo,WebkitFilter:lo},co=t=>uo[t];function ho(t,e){let n=co(t);return n!==lo&&(n=ji),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const po=t=>/^0[^.\s]+$/.test(t);function mo(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||po(t):void 0}function fo(t,e){return t[e]||t.default||t}const go=(t,e,n,r={})=>i=>{const o=fo(r,t)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Br(s);const l=function(t,e,n,r){const i=io(e,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<o.length;t++)null===o[t]&&(o[t]=0===t?s:o[t-1]),mo(o[t])&&l.push(t),"string"==typeof o[t]&&"none"!==o[t]&&"0"!==o[t]&&(a=o[t]);if(i&&l.length&&a)for(let t=0;t<l.length;t++)o[l[t]]=ho(e,a);return o}(e,t,n,o),u=l[0],c=l[l.length-1],d=io(t,u),h=io(t,c);Ir(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(o)||(p={...p,...ro(t,p)}),p.duration&&(p.duration=Br(p.duration)),p.repeatDelay&&(p.repeatDelay=Br(p.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const i=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:sr,pause:sr,stop:sr,then:t=>(t(),Promise.resolve()),cancel:sr,complete:sr});return e?Ji({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}(p);if(!r.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...i}){if(!Ki()||!Qi.has(e)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,s,a=!1,l=!1;const u=()=>{s=new Promise(t=>{o=t})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=i;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Hr(e.ease))(e,i)){const t=Ji({...i,repeat:0,delay:0});let e={done:!1,value:c[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;p=void 0,c=n,d=r-10,h="linear"}const m=function(t,e,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=qr(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,c,{...i,duration:d,ease:h,times:p}),f=()=>{l=!1,m.cancel()},g=()=>{l=!0,ur.update(f),o(),u()};return m.onfinish=()=>{l||(t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(c,i)),r&&r(),g())},{then:(t,e)=>s.then(t,e),attachTimeline:t=>(m.timeline=t,m.onfinish=null,sr),get time(){return Ur(m.currentTime||0)},set time(t){m.currentTime=Br(t)},get speed(){return m.playbackRate},set speed(t){m.playbackRate=t},get duration(){return Ur(d)},play:()=>{a||(m.play(),cr(f))},pause:()=>m.pause(),stop:()=>{if(a=!0,"idle"===m.playState)return;const{currentTime:e}=m;if(e){const n=Ji({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}g()},complete:()=>{l||m.finish()},cancel:g}}(e,t,p);if(n)return n}return Ji(p)};function yo(t){return Boolean(un(t)&&t.add)}const vo=t=>/^\-?\d*\.?\d+$/.test(t);function xo(t,e){-1===t.indexOf(e)&&t.push(e)}function wo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class bo{constructor(){this.subscriptions=[]}add(t){return xo(this.subscriptions,t),()=>wo(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const So={current:void 0};class Co{constructor(t,e={}){var n;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=dr;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ur.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ur.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new bo);const n=this.events[t].add(e);return"change"===t?()=>{n(),ur.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return So.current&&So.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?_i(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eo(t,e){return new Co(t,e)}const Po=t=>e=>e.test(t),ko=[yn,An,Tn,kn,Dn,jn,{test:t=>"auto"===t,parse:t=>t}],To=t=>ko.find(Po(t)),Ao=[...ko,mi,ji],jo=t=>Ao.find(Po(t));function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Eo(n))}function Oo(t,e){if(e)return(e[t]||e.default||e).from}function Mo({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Ro(t,e){const n=t.get();if(!Array.isArray(e))return n!==e;for(let t=0;t<e.length;t++)if(e[t]!==n)return!0}function Vo(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(o=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const r=t.getValue(e),i=a[e];if(!r||void 0===i||c&&Mo(c,e))continue;const s={delay:n,elapsed:0,...fo(o||{},e)};if(window.HandoffAppearAnimations){const n=t.getProps()[_e];if(n){const t=window.HandoffAppearAnimations(n,e,r,ur);null!==t&&(s.elapsed=t,s.isHandoff=!0)}}let d=!s.isHandoff&&!Ro(r,i);if("spring"===s.type&&(r.getVelocity()||s.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(go(e,r,i,t.shouldReduceMotion&&an.has(e)?{type:!1}:s));const h=r.animation;yo(l)&&(l.add(e),h.then(()=>l.remove(e))),u.push(h)}return s&&Promise.all(u).then(()=>{s&&function(t,e){const n=Nr(t,e);let{transitionEnd:r={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o)Do(t,e,nr(o[e]))}(t,s)}),u}function Lo(t,e,n={}){const r=Nr(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Vo(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,r=0,i=1,o){const s=[],a=(t.variantChildren.size-1)*r,l=1===i?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Fo).forEach((t,r)=>{t.notify("AnimationStart",e),s.push(Lo(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,o+r,s,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,s]:[s,o];return t().then(()=>e())}return Promise.all([o(),s(n.delay)])}function Fo(t,e){return t.sortNodePosition(e)}const No=[...He].reverse(),Io=He.length;function _o(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Lo(t,e,n));r=Promise.all(i)}else if("string"==typeof e)r=Lo(t,e,n);else{const i="function"==typeof e?Nr(t,e,n.custom):e;r=Promise.all(Vo(t,i,n))}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}(t);const n={animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()};let r=!0;const i=(e,n)=>{const r=Nr(t,n);if(r){const{transition:t,transitionEnd:n,...i}=r;e={...e,...i,...n}}return e};function o(o,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Io;e++){const p=No[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Ue(f),y=p===s?m.isActive:null;!1===y&&(h=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&r&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&null===y||!f&&!m.prevProp||$e(f)||"boolean"==typeof f)continue;let x=Bo(m.prevProp,f)||p===s&&m.isActive&&!v&&g||e>h&&g,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(i,{});!1===y&&(S={});const{prevResolvedValues:C={}}=m,E={...C,...S},P=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0};for(const t in E){const e=S[t],n=C[t];if(d.hasOwnProperty(t))continue;let r=!1;r=er(e)&&er(n)?!Fr(e,n):e!==n,r?void 0!==e?P(t):c.add(t):void 0!==e&&c.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&t.blockInitialAnimation&&(x=!1),!x||v&&!w||u.push(...b.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let p=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),r=!1,p?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,i){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Bo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Fr(e,t)}function Uo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $o=0;const Ho={animation:{Feature:class extends kr{constructor(t){super(t),t.animationState||(t.animationState=_o(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$e(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends kr{constructor(){super(...arguments),this.id=$o++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Wo=(t,e)=>Math.abs(t-e);class zo{constructor(t,e,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Go(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Wo(t.x,e.x),r=Wo(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:i}=dr;this.history.push({...r,timestamp:i});const{onStart:o,onMove:s}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=qo(e,this.transformPagePoint),ur.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Go("pointercancel"===t.type?this.lastMoveEventInfo:qo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!gr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=r||window;const o=qo(yr(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=dr;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Go(o,this.history)),this.removeListeners=wr(vr(this.contextWindow,"pointermove",this.handlePointerMove),vr(this.contextWindow,"pointerup",this.handlePointerUp),vr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cr(this.updatePoint)}}function qo(t,e){return e?{point:e(t.point)}:t}function Yo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return{point:t,delta:Yo(t,Zo(e)),offset:Yo(t,Xo(e)),velocity:Jo(e,.1)}}function Xo(t){return t[0]}function Zo(t){return t[t.length-1]}function Jo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Zo(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Br(e)));)n--;if(!r)return{x:0,y:0};const o=Ur(i.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ko(t){return t.max-t.min}function Qo(t,e=0,n=.01){return Math.abs(t-e)<=n}function ts(t,e,n,r=.5){t.origin=r,t.originPoint=fi(e.min,e.max,t.origin),t.scale=Ko(n)/Ko(e),(Qo(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=fi(n.min,n.max,t.origin)-t.originPoint,(Qo(t.translate)||isNaN(t.translate))&&(t.translate=0)}function es(t,e,n,r){ts(t.x,e.x,n.x,r?r.originX:void 0),ts(t.y,e.y,n.y,r?r.originY:void 0)}function ns(t,e,n){t.min=n.min+e.min,t.max=t.min+Ko(e)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+Ko(e)}function is(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function os(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ss(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const as=.35;function ls(t,e,n){return{min:us(t,e),max:us(t,n)}}function us(t,e){return"number"==typeof t?t:t[e]||0}const cs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ds(t){return[t("x"),t("y")]}function hs({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ps(t){return void 0===t||1===t}function ms({scale:t,scaleX:e,scaleY:n}){return!ps(t)||!ps(e)||!ps(n)}function fs(t){return ms(t)||gs(t)||t.z||t.rotate||t.rotateX||t.rotateY}function gs(t){return ys(t.x)||ys(t.y)}function ys(t){return t&&"0%"!==t}function vs(t,e,n){return n+e*(t-n)}function xs(t,e,n,r,i){return void 0!==i&&(t=vs(t,i,r)),vs(t,n,r)+e}function ws(t,e=0,n=1,r,i){t.min=xs(t.min,e,n,r,i),t.max=xs(t.max,e,n,r,i)}function bs(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}function Ss(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function Es(t,e,[n,r,i]){const o=void 0!==e[i]?e[i]:.5,s=fi(t.min,t.max,o);ws(t,e[n],e[r],s,e.scale)}const Ps=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ts(t,e){Es(t.x,e,Ps),Es(t.y,e,ks)}function As(t,e){return hs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const js=({current:t})=>t?t.ownerDocument.defaultView:null,Ds=new WeakMap;class Os{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new zo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(yr(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Er(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ds(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Tn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Ko(r)*(parseFloat(e)/100))}}this.originPoint[t]=e}),i&&ur.update(()=>i(t,e),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>ds(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:js(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:i}=this.getProps();i&&ur.update(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Ms(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?fi(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?fi(n,t,r.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,i=this.constraints;e&&Be(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!r)&&function(t,{top:e,left:n,bottom:r,right:i}){return{x:os(t.x,n,i),y:os(t.y,e,r)}}(r.layoutBox,e),this.elastic=function(t=as){return!1===t?t=0:!0===t&&(t=as),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ds(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Be(t))return!1;const n=t.current;_r(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(t,e,n){const r=As(t,n),{scroll:i}=e;return i&&(Cs(r.x,i.offset.x),Cs(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ss(t.x,e.x),y:ss(t.y,e.y)}}(r.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=hs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ds(s=>{if(!Ms(s,e,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(go(t,n,0,e))}stopAnimation(){ds(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ds(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ds(e=>{const{drag:n}=this.getProps();if(!Ms(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[e];i.set(t[e]-fi(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Be(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ds(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Ko(t),i=Ko(e);return i>r?n=Li(e.min,e.max-r,t.min):r>i&&(n=Li(t.min,t.max-i,e.min)),gn(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ds(e=>{if(!Ms(e,t,null))return;const n=this.getAxisMotionValue(e),{min:i,max:o}=this.constraints[e];n.set(fi(i,o,r[e]))})}addListeners(){if(!this.visualElement.current)return;Ds.set(this.visualElement,this);const t=vr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();Be(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=fr(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ds(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),r(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=as,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function Ms(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Rs=t=>(e,n)=>{t&&ur.update(()=>t(e,n))},Vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ls(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!An.test(t))return t;t=parseFloat(t)}return`${Ls(t,e.target.x)}% ${Ls(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=ji.parse(t);if(i.length>5)return r;const o=ji.createTransformer(t),s="number"!=typeof i[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=a,i[1+s]/=l;const u=fi(a,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=u),"number"==typeof i[3+s]&&(i[3+s]/=u),o(i)}};class Is extends c.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=t;var o;o=Bs,Object.assign(on,o),i&&(e.group&&e.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,r||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ur.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _s(t){const[e,n]=function(){const t=(0,c.useContext)(Ve);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=(0,c.useId)();return(0,c.useEffect)(()=>r(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),r=(0,c.useContext)(Ze);return c.createElement(Is,{...t,layoutGroup:r,switchLayoutGroup:(0,c.useContext)(Je),isPresent:e,safeToRemove:n})}const Bs={borderRadius:{...Fs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fs,borderTopRightRadius:Fs,borderBottomLeftRadius:Fs,borderBottomRightRadius:Fs,boxShadow:Ns},Us=["TopLeft","TopRight","BottomLeft","BottomRight"],$s=Us.length,Hs=t=>"string"==typeof t?parseFloat(t):t,Ws=t=>"number"==typeof t||An.test(t);function zs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const qs=Gs(0,.5,ei),Ys=Gs(.5,.95,sr);function Gs(t,e,n){return r=>r<t?0:r>e?1:n(Li(t,e,r))}function Xs(t,e){t.min=e.min,t.max=e.max}function Zs(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Js(t,e,n,r,i){return t=vs(t-=e,1/n,r),void 0!==i&&(t=vs(t,1/i,r)),t}function Ks(t,e,[n,r,i],o,s){!function(t,e=0,n=1,r=.5,i,o=t,s=t){if(Tn.test(e)&&(e=parseFloat(e),e=fi(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=fi(o.min,o.max,r);t===o&&(a-=e),t.min=Js(t.min,e,n,a,i),t.max=Js(t.max,e,n,a,i)}(t,e[n],e[r],e[i],e.scale,o,s)}const Qs=["x","scaleX","originX"],ta=["y","scaleY","originY"];function ea(t,e,n,r){Ks(t.x,e,Qs,n?n.x:void 0,r?r.x:void 0),Ks(t.y,e,ta,n?n.y:void 0,r?r.y:void 0)}function na(t){return 0===t.translate&&1===t.scale}function ra(t){return na(t.x)&&na(t.y)}function ia(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function oa(t){return Ko(t.x)/Ko(t.y)}class sa{constructor(){this.members=[]}add(t){xo(this.members,t),t.scheduleRender()}remove(t){if(wo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function aa(t,e,n){let r="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),i&&(r+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const la=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){xo(this.children,t),this.isDirty=!0}remove(t){wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(la),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"],da={visibility:"hidden"};let ha=0;const pa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function ma({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ha++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;this.projectionUpdateScheduled=!1,pa.totalNodes=pa.resolvedTargetDeltas=pa.recalculatedProjection=0,this.nodes.forEach(ya),this.nodes.forEach(Ea),this.nodes.forEach(Pa),this.nodes.forEach(va),t=pa,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ua)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t){const e=performance.now(),n=({timestamp:r})=>{const i=r-e;i>=250&&(cr(n),t(i-250))};return ur.read(n,!0),()=>cr(n)}(r),Vs.hasAnimatedSinceResize&&(Vs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ca))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||s.getDefaultTransition()||Oa,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ia(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...fo(i,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Ca(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ka),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(wa);this.isUpdating||this.nodes.forEach(ba),this.isUpdating=!1,this.nodes.forEach(Sa),this.nodes.forEach(fa),this.nodes.forEach(ga),this.clearAllSnapshots();const t=performance.now();dr.delta=gn(0,1e3/60,t-dr.timestamp),dr.timestamp=t,dr.isProcessing=!0,hr.update.process(dr),hr.preRender.process(dr),hr.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(xa),this.sharedNodes.forEach(Ta)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ur.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ur.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ra(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;t&&(e||fs(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Va((r=n).x),Va(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Cs(e.x,n.offset.x),Cs(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:i,options:o}=r;if(r!==this.root&&i&&o.layoutScroll){if(i.isRoot){Zs(e,t);const{scroll:n}=this.root;n&&(Cs(e.x,-n.offset.x),Cs(e.y,-n.offset.y))}Cs(e.x,i.offset.x),Cs(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Zs(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ts(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fs(r.latestValues)&&Ts(n,r.latestValues)}return fs(this.latestValues)&&Ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Zs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fs(n.latestValues))continue;ms(n.latestValues)&&n.updateSnapshot();const r=cs();Zs(r,n.measurePageBox()),ea(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fs(this.latestValues)&&ea(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:i,layoutId:o}=this.options;if(this.layout&&(i||o)){if(this.resolvedRelativeTargetAt=dr.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ns(s.x,a.x,l.x),ns(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Zs(this.target,this.layout.layoutBox),bs(this.target,this.targetDelta)):Zs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},is(this.relativeTargetOrigin,this.target,t.target),Zs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}pa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ms(this.parent.latestValues)&&!gs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===dr.timestamp&&(r=!1),r)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;Zs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const i=n.length;if(!i)return;let o,s;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,bs(t,s)),r&&fs(o.latestValues)&&Ts(t,o.latestValues))}e.x=Ss(e.x),e.y=Ss(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.projectionTransform;es(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=aa(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),pa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Da));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,p,m;Aa(o.x,t.x,n),Aa(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(is(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,h=this.relativeTargetOrigin,p=s,m=n,ja(l.x,h.x,p.x,m),ja(l.y,h.y,p.y,m),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Zs(d,this.relativeTarget)),a&&(this.animationValues=i,function(t,e,n,r,i,o){i?(t.opacity=fi(0,void 0!==n.opacity?n.opacity:1,qs(r)),t.opacityExit=fi(void 0!==e.opacity?e.opacity:1,0,Ys(r))):o&&(t.opacity=fi(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i<$s;i++){const o=`border${Us[i]}Radius`;let s=zs(e,o),a=zs(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Ws(s)===Ws(a)?(t[o]=Math.max(fi(Hs(s),Hs(a),r),0),(Tn.test(a)||Tn.test(s))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=fi(e.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ur.update(()=>{Vs.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=un(0)?0:Eo(0);return r.start(go("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:i}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&La(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ko(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Ko(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Zs(e,n),Ts(e,i),es(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<ca.length;e++){const i="rotate"+ca[e];n[i]&&(r[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return da;const r={visibility:""},i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=rr(null==t?void 0:t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=rr(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=aa(this.projectionDeltaWithTransform,this.treeScale,s),i&&(r.transform=i(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in on){if(void 0===s[t])continue;const{correct:e,applyTo:n}=on[t],i="none"===r.transform?s[t]:e(s[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=i}else r[t]=i}return this.options.layoutId&&(r.pointerEvents=o===this?rr(null==t?void 0:t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(wa),this.root.sharedNodes.clear()}}}function fa(t){t.updateLayout()}function ga(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?ds(t=>{const r=o?n.measuredBox[t]:n.layoutBox[t],i=Ko(r);r.min=e[t].min,r.max=r.min+i}):La(i,n.layoutBox,e)&&ds(r=>{const i=o?n.measuredBox[r]:n.layoutBox[r],s=Ko(e[r]);i.max=i.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};es(s,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?es(a,t.applyTransform(r,!0),n.measuredBox):es(a,e,n.layoutBox);const l=!ra(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:o}=r;if(i&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};is(s,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};is(a,e,o.layoutBox),ia(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ya(t){pa.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function va(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function xa(t){t.clearSnapshot()}function wa(t){t.clearMeasurements()}function ba(t){t.isLayoutDirty=!1}function Sa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ca(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ea(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function ka(t){t.resetRotation()}function Ta(t){t.removeLeadSnapshot()}function Aa(t,e,n){t.translate=fi(e.translate,0,n),t.scale=fi(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ja(t,e,n,r){t.min=fi(e.min,n.min,r),t.max=fi(e.max,n.max,r)}function Da(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Oa={duration:.45,ease:[.4,0,.1,1]},Ma=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=Ma("applewebkit/")&&!Ma("chrome/")?Math.round:sr;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function La(t,e,n){return"position"===t||"preserve-aspect"===t&&!Qo(oa(e),oa(n),.2)}const Fa=ma({attachResizeListener:(t,e)=>fr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Na={current:void 0},Ia=ma({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Na.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),Na.current=t}return Na.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),_a={pan:{Feature:class extends kr{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new zo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:js(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rs(t),onStart:Rs(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&ur.update(()=>r(t,e))}}}mount(){this.removePointerDownListener=vr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends kr{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new Os(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Ia,MeasureLayout:_s}},Ba=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ua(t,e,n=1){_r(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=function(t){const e=Ba.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const t=o.trim();return vo(t)?parseFloat(t):t}return mn(i)?Ua(i,e,n+1):i}const $a=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ha=t=>$a.has(t),Wa=t=>t===yn||t===An,za=(t,e)=>parseFloat(t.split(", ")[e]),qa=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return za(i[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},Ya=new Set(["x","y","z"]),Ga=sn.filter(t=>!Ya.has(t)),Xa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:qa(4,13),y:qa(5,14)};Xa.translateX=Xa.x,Xa.translateY=Xa.y;function Za(t,e,n,r){return(t=>Object.keys(t).some(Ha))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const i=Object.keys(e).filter(Ha);let o=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=To(u);const d=e[i];let h;if(er(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=To(u);for(let n=e;n<t&&null!==d[n];n++)h?_r(To(d[n])===h,"All keyframes must be of the same type"):(h=To(d[n]),_r(h===c||Wa(c)&&Wa(h),"Keyframes must be of the same dimension as the current value"))}else h=To(d);if(c!==h)if(Wa(c)&&Wa(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===An&&(e[i]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[i]=c.transform(d):(s||(o=function(t){const e=[];return Ga.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),r[i]=void 0!==r[i]?r[i]:e[i],l.jump(d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const r=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:s}=o,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Xa[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=Xa[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),Le&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ja={current:null},Ka={current:!1},Qa=new WeakMap,tl=Object.keys(Xe),el=tl.length,nl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rl=We.length;class il{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ur.render(this.render,!1,!0);const{latestValues:s,renderState:a}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ze(e),this.isVariantNode=qe(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&un(e)&&(e.set(s[t],!1),yo(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Qa.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ka.current||function(){if(Ka.current=!0,Le)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ja.current=t.matches;t.addListener(e),e()}else Ja.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ja.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Qa.delete(this.current),this.projection&&this.projection.unmount(),cr(this.notifyUpdate),cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=an.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ur.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,i){let o,s;for(let t=0;t<el;t++){const n=tl[t],{isEnabled:r,Feature:i,ProjectionNode:a,MeasureLayout:l}=Xe[n];a&&(o=a),r(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(s=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&Be(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<nl.length;e++){const n=nl[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const i in e){const o=e[i],s=n[i];if(un(o))t.addValue(i,o),yo(r)&&r.add(i);else if(un(s))t.addValue(i,Eo(o,{owner:t})),yo(r)&&r.remove(i);else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Eo(void 0!==e?e:o,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<rl;t++){const n=We[t],r=this.props[n];(Ue(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Eo(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=tr(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||un(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new bo),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ol extends il{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},i){let o=function(t,e,n){const r={};for(const i in t){const t=Oo(i,e);if(void 0!==t)r[i]=t;else{const t=n.getValue(i);t&&(r[i]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),i){!function(t,e,n){var r,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(vo(u)||po(u))?u=parseFloat(u):!jo(u)&&ji.test(l)&&(u=ho(s,l)),t.addValue(s,Eo(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,o);const t=((t,e,n,r)=>{const i=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!mn(e))return;const n=Ua(e,r);n&&t.set(n)});for(const t in e){const i=e[t];if(!mn(i))continue;const o=Ua(i,r);o&&(e[t]=o,n||(n={}),void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,r);return Za(t,e=i.target,n,r=i.transitionEnd)})(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class sl extends ol{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),i=(pn(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return As(t,e)}build(t,e,n,r){Vn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Kn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(t,e,n,r){Xn(t,e,n,r)}}class al extends ol{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(an.has(e)){const t=co(e);return t&&t.default||0}return e=Zn.has(e)?e:Ie(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Qn(t,e)}build(t,e,n,r){zn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Jn(t,e,0,r)}mount(t){this.isSVGTag=qn(t.tagName),super.mount(t)}}const ll=(t,e)=>rn(t)?new al(e,{enableHardwareAcceleration:!1}):new sl(e,{enableHardwareAcceleration:!0}),ul={...Ho,...Lr,..._a,layout:{ProjectionNode:Ia,MeasureLayout:_s}},cl=en((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...rn(t)?pr:mr,preloadedFeatures:n,useRender:Gn(e),createVisualElement:r,Component:t}}(t,e,ul,ll)),dl=window.wp.components;Object.defineProperty;var hl=new Map,pl=new WeakMap,ml=0;function fl(t,e,n={},r=void 0){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:s}=function(t){const e=function(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>{return`${e}_${"root"===e?(n=t.root,n?(pl.has(n)||(ml+=1,pl.set(n,ml.toString())),pl.get(n)):"0"):t[e]}`;var n}).toString()}(t);let n=hl.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver(e=>{e.forEach(e=>{var n;const o=e.isIntersecting&&i.some(t=>e.intersectionRatio>=t);t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach(t=>{t(o,e)})})},t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},hl.set(e,n)}return n}(n),a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),o.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),o.unobserve(t)),0===s.size&&(o.disconnect(),hl.delete(i))}}function gl(){return gl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gl.apply(this,arguments)}function yl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yl(Object(n),!0).forEach(function(e){xl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c.Component;class wl extends h().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let i in e){const o=parseInt(i);o>0&&t<=o&&o<n&&(n=o,r=e[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),n=h().Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%t;e[i]||(e[i]=[]),e[i].push(n[r])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let o=n;o&&"string"!=typeof o&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===o&&(o="my-masonry-grid_column"));const s=vl(vl(vl({},t),e),{},{style:vl(vl({},e.style),{},{width:i}),className:o});return r.map((t,e)=>h().createElement("div",gl({},s,{key:e}),t))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:n,columnClassName:r,columnAttrs:i,column:o,className:s}=t,a=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let l=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(l="my-masonry-grid")),h().createElement("div",gl({},a,{className:l}),this.renderColumns())}}wl.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const bl=wl,Sl=window.wp.blockEditor,Cl=window.wp.blocks;var El=i(942),Pl=i.n(El);const kl=window.lodash,Tl={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"},Al=(t,e=[])=>Array.from(e).some(e=>!!e.style&&Array.from(e.style).some(e=>e&&e.includes(t))),jl=new WeakMap,Dl=x(S((t,e)=>({selectedPatterns:{},toggleSelection:(e,n,r="")=>t(t=>{const i={...t.selectedPatterns};if(i[e])delete i[e];else{if(Object.keys(i).length>=10)return t;i[e]={blocks:n,prompt:r}}return{selectedPatterns:i}}),updatePrompt:(e,n)=>t(t=>t.selectedPatterns[e]?{selectedPatterns:{...t.selectedPatterns,[e]:{...t.selectedPatterns[e],prompt:n}}}:t),isSelected:t=>!!e().selectedPatterns[t],getSelectedCount:()=>Object.keys(e().selectedPatterns).length,canSelectMore:()=>Object.keys(e().selectedPatterns).length<10,getSelectedPatterns:()=>Object.entries(e().selectedPatterns).map(([t,e])=>({patternId:t,...e})),clearSelection:()=>t({selectedPatterns:{}}),removeFromSelection:e=>t(t=>{const n={...t.selectedPatterns};return delete n[e],{selectedPatterns:n}})}),{name:"Strakture Selection"})),Ol=({patternId:e,onPatternClick:n,code:i,disabled:o})=>{const[s,a]=(0,t.useState)(!1),l=(0,t.useRef)(),{isSelected:u,toggleSelection:c,canSelectMore:d}=Dl(),h=u(e),p=!h&&!d(),m=/100[vsd]vh|min-height:\s*100vh/.test(i),f=(0,t.useMemo)(()=>(0,Cl.rawHandler)({HTML:Ml(i)}),[i]),{ready:g}=(({container:e,onIFrameLoaded:n,ready:r,loadDelay:i})=>{const o=(()=>{const e=(0,t.useRef)(!1);return(0,t.useEffect)(()=>(e.current=!0,()=>e.current=!1)),e})(),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(!1),{addMissingCSSVar:p}=V(),m=(0,t.useCallback)(t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in Tl)e.getPropertyValue(r)||Array.from(n).filter(t=>{try{return t.cssRules}catch(t){return!1}}).some(t=>Al(r,t.cssRules))||(p(r),t.contentDocument.documentElement.style.setProperty(r,Tl[r]))},[p]),f=(0,t.useCallback)(async(t,e)=>{if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let n=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];n=n?parseFloat(n):null;const r=e.offsetHeight/(null!=n?n:1);t.style.setProperty("max-height",`${r}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)jl.has(t)||jl.set(t,t.style.minHeight),t.style.minHeight=jl.get(t);e.offsetHeight,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>requestAnimationFrame(t));for(const e of i){if(!t.contentDocument?.defaultView)return;const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1},[]);return(0,t.useEffect)(()=>{if(!r)return;const t=setTimeout(()=>{if(l)return;const t=e?.querySelector("iframe[title]");if(!t)return a(t=>t+1);u(t),requestAnimationFrame(()=>n(t,e))},100);return()=>clearTimeout(t)},[l,r,s,e,n]),(0,t.useEffect)(()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame(()=>n(l,e));const n=(0,kl.debounce)(async()=>{o.current&&!h.current&&(r.disconnect(),await f(l,e),"extendable"!==window.straktureSharedData?.themeSlug&&await m(l,e),setTimeout(()=>d(!0),i),o.current&&r.observe(l.contentDocument,t))},300),r=new MutationObserver(n);return r.observe(l.contentDocument,t),()=>{n.cancel(),r?.disconnect()}},[l,e,o,r,f,m,i]),{loading:!l,ready:c}})({container:l.current,ready:s,onIFrameLoaded:()=>{},loadDelay:50});return(0,t.useEffect)(()=>a(!0),[]),(0,M.jsxs)("div",{className:Pl()(`library-pattern pattern-${e} mb-8 rounded-md overflow-hidden w-full border bg-white transition-colors duration-150`,{"opacity-0 border-transparent":!g,"opacity-100 border-gray-400 hover:border-design-main":g&&!o&&!h,"opacity-100 border-design-main bg-design-main/5":g&&!o&&h,"opacity-100 border-gray-400":g&&o,"opacity-50":o}),children:[(0,M.jsx)("button",{ref:l,type:"button",disabled:o,"aria-label":(0,r.__)("Insert Pattern","strakture"),className:Pl()("relative z-10 m-0 inline-block w-full bg-transparent p-0 focus:shadow-sm focus:outline-none focus:ring-wp focus:ring-design-main focus:ring-offset-2 focus:ring-offset-white",{"cursor-not-allowed":o}),onClick:()=>n(e,f),children:(0,M.jsx)(Sl.BlockPreview,{blocks:f,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }\n\t\t\t\t\t\t\t\t'+(m?".wp-block-cover { min-height: 788px !important; }":"")}]})}),(0,M.jsx)("div",{className:"p-3",children:(0,M.jsx)("div",{className:"flex items-center justify-between",children:(0,M.jsxs)("label",{className:"cursor-pointer items-center",children:[(0,M.jsx)("input",{type:"checkbox",checked:h,onChange:()=>c(e,f),disabled:o||p,className:"h-4 w-4 rounded border-gray-400 text-design-main focus:ring-design-main focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50"}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Select pattern","strakture")})]})})})]})},Ml=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),Rl="https://api.strakture.com";var Vl=i(888),Ll=Object.prototype.hasOwnProperty;const Fl=new WeakMap,Nl=()=>{},Il=Nl(),_l=Object,Bl=t=>t===Il,Ul=t=>"function"==typeof t,$l=(t,e)=>({...t,...e}),Hl=t=>Ul(t.then),Wl={},zl={},ql="undefined",Yl=typeof window!=ql,Gl=typeof document!=ql,Xl=Yl&&"Deno"in window,Zl=(t,e)=>{const n=Fl.get(t);return[()=>!Bl(e)&&t.get(e)||Wl,r=>{if(!Bl(e)){const i=t.get(e);e in zl||(zl[e]=i),n[5](e,$l(i,r),i||Wl)}},n[6],()=>!Bl(e)&&e in zl?zl[e]:!Bl(e)&&t.get(e)||Wl]};let Jl=!0;const[Kl,Ql]=Yl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Nl,Nl],tu={isOnline:()=>Jl,isVisible:()=>{const t=Gl&&document.visibilityState;return Bl(t)||"hidden"!==t}},eu={initFocus:t=>(Gl&&document.addEventListener("visibilitychange",t),Kl("focus",t),()=>{Gl&&document.removeEventListener("visibilitychange",t),Ql("focus",t)}),initReconnect:t=>{const e=()=>{Jl=!0,t()},n=()=>{Jl=!1};return Kl("online",e),Kl("offline",n),()=>{Ql("online",e),Ql("offline",n)}}},nu=!c.useId,ru=!Yl||Xl,iu=ru?c.useEffect:c.useLayoutEffect,ou="undefined"!=typeof navigator&&navigator.connection,su=!ru&&ou&&(["slow-2g","2g"].includes(ou.effectiveType)||ou.saveData),au=new WeakMap,lu=(t,e)=>t===`[object ${e}]`;let uu=0;const cu=t=>{const e=typeof t,n=(r=t,_l.prototype.toString.call(r));var r;const i=lu(n,"Date"),o=lu(n,"RegExp"),s=lu(n,"Object");let a,l;if(_l(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=au.get(t),a)return a;if(a=++uu+"~",au.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=cu(t[l])+",";au.set(t,a)}if(s){a="#";const e=_l.keys(t).sort();for(;!Bl(l=e.pop());)Bl(t[l])||(a+=l+":"+cu(t[l])+",");au.set(t,a)}}return a},du=t=>{if(Ul(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?cu(t):"",e]};let hu=0;const pu=()=>++hu;async function mu(...t){const[e,n,r,i]=t,o=$l({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=o.throwOnError;if(Ul(n)){const t=n,r=[],i=e.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(c))}return c(n);async function c(n){const[i]=du(n);if(!i)return;const[c,d]=Zl(e,i),[h,p,m,f]=Fl.get(e),g=()=>{const t=h[i];return(Ul(o.revalidate)?o.revalidate(c().data,n):!1!==o.revalidate)&&(delete m[i],delete f[i],t&&t[0])?t[0](2).then(()=>c().data):c().data};if(t.length<3)return g();let y,v=r,x=!1;const w=pu();p[i]=[w,0];const b=!Bl(l),S=c(),C=S.data,E=S._c,P=Bl(E)?C:E;if(b&&(l=Ul(l)?l(P,C):l,d({data:l,_c:P})),Ul(v))try{v=v(P)}catch(t){y=t,x=!0}if(v&&Hl(v)){if(v=await v.catch(t=>{y=t,x=!0}),w!==p[i][0]){if(x)throw y;return v}x&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Il}))}if(s&&!x)if(Ul(s)){const t=s(v,P);d({data:t,error:Il,_c:Il})}else d({data:v,error:Il,_c:Il});if(p[i][1]=pu(),Promise.resolve(g()).then(()=>{d({_c:Il})}),!x)return v;if(u)throw y}}const fu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},gu=(t,e)=>{if(!Fl.has(t)){const n=$l(eu,e),r=Object.create(null),i=mu.bind(Il,t);let o=Nl;const s=Object.create(null),a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const i=s[e];if(i)for(const t of i)t(n,r)},u=()=>{if(!Fl.has(t)&&(Fl.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!ru)){const e=n.initFocus(setTimeout.bind(Il,fu.bind(Il,r,0))),i=n.initReconnect(setTimeout.bind(Il,fu.bind(Il,r,1)));o=()=>{e&&e(),i&&i(),Fl.delete(t)}}};return u(),[t,i,u,o]}return[t,Fl.get(t)[4]]},[yu,vu]=gu(new Map),xu=$l({onLoadingSlow:Nl,onSuccess:Nl,onError:Nl,onErrorRetry:(t,__,e,n,r)=>{const i=e.errorRetryCount,o=r.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*e.errorRetryInterval;!Bl(i)&&o>i||setTimeout(n,s,r)},onDiscarded:Nl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:su?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:su?5e3:3e3,compare:function t(e,n){var r,i;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((i=e.length)===n.length)for(;i--&&t(e[i],n[i]););return-1===i}if(!r||"object"==typeof e){for(r in i=0,e){if(Ll.call(e,r)&&++i&&!Ll.call(n,r))return!1;if(!(r in n)||!t(e[r],n[r]))return!1}return Object.keys(n).length===i}}return e!=e&&n!=n},isPaused:()=>!1,cache:yu,mutate:vu,fallback:{}},tu),wu=(t,e)=>{const n=$l(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=$l(i,s))}return n},bu=(0,c.createContext)({}),Su="$inf$",Cu=Yl&&window.__SWR_DEVTOOLS_USE__,Eu=Cu?window.__SWR_DEVTOOLS_USE__:[],Pu=t=>Ul(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],ku=Eu.concat(t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=du(e),[,,,i]=Fl.get(yu);if(r.startsWith(Su))return n(...t);const o=i[r];return Bl(o)?n(...t):(delete i[r],o)}),r)),Tu=(t,e)=>(...n)=>{const[r,i,o]=Pu(n),s=(o.use||[]).concat(e);return t(r,i,{...o,use:s})};Cu&&(window.__SWR_DEVTOOLS_REACT__=c);const Au=()=>{};Au(),new WeakMap;const ju=c.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Du={dedupe:!0},Ou=Promise.resolve(Il),Mu=(_l.defineProperty(t=>{const{value:e}=t,n=(0,c.useContext)(bu),r=Ul(e),i=(0,c.useMemo)(()=>r?e(n):e,[r,n,e]),o=(0,c.useMemo)(()=>r?i:wu(n,i),[r,n,i]),s=i&&i.provider,a=(0,c.useRef)(Il);s&&!a.current&&(a.current=gu(s(o.cache||yu),i));const l=a.current;return l&&(o.cache=l[0],o.mutate=l[1]),iu(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,c.createElement)(bu.Provider,$l(t,{value:o}))},"defaultValue",{value:xu}),Ru=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p,strictServerPrefetchWarning:m}=n,[f,g,y,v]=Fl.get(r),[x,w]=du(t),b=(0,c.useRef)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(x),E=(0,c.useRef)(e),P=(0,c.useRef)(n),k=()=>P.current,T=()=>k().isVisible()&&k().isOnline(),[A,j,D,O]=Zl(r,x),M=(0,c.useRef)({}).current,R=Bl(s)?Bl(n.fallback)?Il:n.fallback[x]:s,V=(t,e)=>{for(const n in M){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!Bl(t[r]))return!1;if(!i(H,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},L=(0,c.useMemo)(()=>{const t=!!x&&!!e&&(Bl(a)?!k().isPaused()&&!o&&!1!==l:a),n=e=>{const n=$l(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),i=O(),s=n(r),u=r===i?s:n(i);let c=s;return[()=>{const t=n(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>u]},[r,x]),F=(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>D(x,(e,n)=>{V(n,e)||t()}),[r,x]),L[0],L[1]),N=!b.current,I=f[x]&&f[x].length>0,_=F.data,B=Bl(_)?R&&Hl(R)?ju(R):R:_,U=F.error,$=(0,c.useRef)(B),H=p?Bl(_)?Bl($.current)?B:$.current:_:B,W=x&&Bl(B),z=!ru&&(0,Vl.useSyncExternalStore)(()=>Nl,()=>!1,()=>!0);m&&z&&!o&&W&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const q=!(I&&!Bl(U))&&(N&&!Bl(a)?a:!k().isPaused()&&(o?!Bl(B)&&l:Bl(B)||l)),Y=!!(x&&e&&N&&q),G=Bl(F.isValidating)?Y:F.isValidating,X=Bl(F.isLoading)?Y:F.isLoading,Z=(0,c.useCallback)(async t=>{const e=E.current;if(!x||!e||S.current||k().isPaused())return!1;let r,o,s=!0;const a=t||{},l=!y[x]||!a.dedupe,u=()=>nu?!S.current&&x===C.current&&b.current:x===C.current,c={isValidating:!1,isLoading:!1},d=()=>{j(c)},h=()=>{const t=y[x];t&&t[1]===o&&delete y[x]},p={isValidating:!0};Bl(A().data)&&(p.isLoading=!0);try{if(l&&(j(p),n.loadingTimeout&&Bl(A().data)&&setTimeout(()=>{s&&u()&&k().onLoadingSlow(x,n)},n.loadingTimeout),y[x]=[e(w),pu()]),[r,o]=y[x],r=await r,l&&setTimeout(h,n.dedupingInterval),!y[x]||y[x][1]!==o)return l&&u()&&k().onDiscarded(x),!1;c.error=Il;const t=g[x];if(!Bl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&k().onDiscarded(x),!1;const a=A().data;c.data=i(a,r)?a:r,l&&u()&&k().onSuccess(r,x,n)}catch(t){h();const e=k(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,x,e),(!0===n||Ul(n)&&n(t))&&(k().revalidateOnFocus&&k().revalidateOnReconnect&&!T()||e.onErrorRetry(t,x,e,t=>{const e=f[x];e&&e[0]&&e[0](3,t)},{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0},[x,r]),J=(0,c.useCallback)((...t)=>mu(r,C.current,...t),[]);if(iu(()=>{E.current=e,P.current=n,Bl(_)||($.current=_)}),iu(()=>{if(!x)return;const t=Z.bind(Il,Du);let e=0;if(k().revalidateOnFocus){const t=Date.now();e=t+k().focusThrottleInterval}const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(x,f,(n,r={})=>{if(0==n){const n=Date.now();k().revalidateOnFocus&&n>e&&T()&&(e=n+k().focusThrottleInterval,t())}else if(1==n)k().revalidateOnReconnect&&T()&&t();else{if(2==n)return Z();if(3==n)return Z(r)}});return S.current=!1,C.current=x,b.current=!0,j({_k:w}),q&&(y[x]||(Bl(B)||ru?t():(t=>{Yl&&typeof window.requestAnimationFrame!=ql?window.requestAnimationFrame(t):setTimeout(t,1)})(t))),()=>{S.current=!0,n()}},[x]),iu(()=>{let t;function e(){const e=Ul(u)?u(A().data):u;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!k().isVisible()||!h&&!k().isOnline()?e():Z(Du).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}},[u,d,h,x]),(0,c.useDebugValue)(H),o){if(!nu&&ru&&W)throw new Error("Fallback data is required when using Suspense in SSR.");W&&(E.current=e,P.current=n,S.current=!1);const t=v[x],r=!Bl(t)&&W?J(t):Ou;if(ju(r),!Bl(U)&&W)throw U;const i=W?Z(Du):Ou;!Bl(H)&&W&&(i.status="fulfilled",i.value=!0),ju(i)}return{mutate:J,get data(){return M.data=!0,H},get error(){return M.error=!0,U},get isValidating(){return M.isValidating=!0,G},get isLoading(){return M.isLoading=!0,X}}},function(...t){const e=(()=>{const t=(0,c.useContext)(bu);return(0,c.useMemo)(()=>$l(xu,t),[t])})(),[n,r,i]=Pu(t),o=wu(e,i);let s=Ru;const{use:a}=o,l=(a||[]).concat(ku);for(let t=l.length;t--;)s=l[t](s);return s(n,r||o.fetcher||null,o)});var Ru;const Vu=()=>{},Lu=Vu(),Fu=Object,Nu=t=>t===Lu,Iu=new WeakMap,_u=(t,e)=>t===`[object ${e}]`;let Bu=0;const Uu=t=>{const e=typeof t,n=(r=t,Fu.prototype.toString.call(r));var r;const i=_u(n,"Date"),o=_u(n,"RegExp"),s=_u(n,"Object");let a,l;if(Fu(t)!==t||i||o)a=i?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(a=Iu.get(t),a)return a;if(a=++Bu+"~",Iu.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=Uu(t[l])+",";Iu.set(t,a)}if(s){a="#";const e=Fu.keys(t).sort();for(;!Nu(l=e.pop());)Nu(t[l])||(a+=l+":"+Uu(t[l])+",");Iu.set(t,a)}}return a},$u=Promise.resolve(),Hu=Tu(Mu,t=>(e,n,r)=>{const i=(0,c.useRef)(!1),{cache:o,initialSize:s=1,revalidateAll:a=!1,persistSize:l=!1,revalidateFirstPage:u=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,p]=Fl.get(yu);let m;try{m=(t=>(t=>{if((t=>"function"==typeof t)(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Uu(t):"",e]})(t?t(0,null):null)[0])(e),m&&(m=Su+m)}catch(t){}const[f,g,y]=Zl(o,m),v=(0,c.useCallback)(()=>Bl(f()._l)?s:f()._l,[o,m,s]);(0,Vl.useSyncExternalStore)((0,c.useCallback)(t=>m?y(m,()=>{t()}):()=>{},[o,m]),v,v);const x=(0,c.useCallback)(()=>{const t=f()._l;return Bl(t)?s:t},[m,s]),w=(0,c.useRef)(x());iu(()=>{i.current?m&&g({_l:l?w.current:x()}):i.current=!0},[m,o]);const b=d&&!i.current,S=t(m,async t=>{const i=f()._i,s=f()._r;g({_r:Il});const l=[],c=x(),[d]=Zl(o,t),m=d().data,y=[];let v=null;for(let t=0;t<c;++t){const[c,d]=du(e(t,h?null:v));if(!c)break;const[f,g]=Zl(o,c);let x=f().data;const w=a||i||Bl(x)||u&&!t&&!Bl(m)||b||m&&!Bl(m[t])&&!r.compare(m[t],x);if(n&&("function"==typeof s?s(x,d):w)){const e=async()=>{if(c in p){const t=p[c];delete p[c],x=await t}else x=await n(d);g({data:x,_k:d}),l[t]=x};h?y.push(e):await e()}else l[t]=x;h||(v=x)}return h&&await Promise.all(y.map(t=>t())),g({_i:Il}),l},r),C=(0,c.useCallback)(function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return m?(r&&(Bl(t)?g({_i:!0,_r:n.revalidate}):g({_i:!1,_r:n.revalidate})),arguments.length?S.mutate(t,{...n,revalidate:r}):S.mutate()):$u},[m,o]),E=(0,c.useCallback)(t=>{if(!m)return $u;const[,n]=Zl(o,m);let r;if(Ul(t)?r=t(x()):"number"==typeof t&&(r=t),"number"!=typeof r)return $u;n({_l:r}),w.current=r;const i=[],[s]=Zl(o,m);let a=null;for(let t=0;t<r;++t){const[n]=du(e(t,a)),[r]=Zl(o,n),l=n?r().data:Il;if(Bl(l))return C(s().data);i.push(l),a=l}return C(i)},[m,o,C,x]);return{size:x(),setSize:E,mutate:C,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}}),Wu=t=>fetch(t).then(t=>t.json());var zu,qu;const Yu="/strakture/v1/library/settings",Gu={getItem:async()=>await a()({path:Yu}),setItem:async(t,e)=>await a()({path:Yu,method:"POST",data:{state:e}})},Xu={siteType:"",category:"",totalImports:0},Zu=l(window.straktureLibraryData?.siteInfo),Ju=null!==(zu=null!==(qu=Zu?.state?.siteType)&&void 0!==qu?qu:Zu?.siteType)&&void 0!==zu?zu:"",Ku=x(k(t=>{var e,n,r,i;return{...Xu,...null!==(e=Zu?.state)&&void 0!==e?e:{},siteType:(i=null!==(n=null!==(r=window.straktureSharedData?.siteType)&&void 0!==r?r:Ju)&&void 0!==n?n:"","string"==typeof i?i:""),setCategory:e=>t({category:e}),setSiteType:e=>t({siteType:e}),incrementImports:()=>t(t=>({totalImports:Number(t.totalImports)+1}))}},{name:"strakture_library_site_data",storage:E(()=>Gu),skipHydration:!0})),Qu=({onPatternClick:e,disabled:n})=>{const i=Ku(t=>t.category),o=i||"all",{data:s,isLoading:a,isValidating:l,setSize:u}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.straktureSharedData?.wpVersion,lang:window.straktureSharedData?.wpLanguage||null,showLocalizedCopy:window.straktureSharedData?.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}=Hu((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter(([,t])=>void 0!==t).forEach(([t,e])=>{r.append(t,e)}),`${Rl}/v1/patterns?${r.toString()}`},Wu,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:i,isValidating:o,mutate:s,size:a,setSize:l}})({category:i}),[d,h]=(0,t.useState)(o),[p,m]=(0,t.useState)(!0),[f,g]=function({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:s,initialInView:a,fallbackInView:l,onChange:u}={}){var d;const[h,p]=c.useState(null),m=c.useRef(u),[f,g]=c.useState({inView:!!a,entry:void 0});m.current=u,c.useEffect(()=>{if(s||!h)return;let a;return a=fl(h,(t,e)=>{g({inView:t,entry:e}),m.current&&m.current(t,e),e.isIntersecting&&o&&a&&(a(),a=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{a&&a()}},[Array.isArray(t)?t.toString():t,h,i,r,o,s,n,l,e]);const y=null==(d=f.entry)?void 0:d.target,v=c.useRef(void 0);h||!y||o||s||v.current===y||(v.current=y,g({inView:!!a,entry:void 0}));const x=[p,f.inView,f.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}(),[y,v]=(0,t.useState)({}),{isSelected:x,updatePrompt:w,clearSelection:b}=Dl(),S=o!==d,C=(0,t.useCallback)((t,e)=>{v(n=>({...n,[t]:e})),x(t)&&w(t,e)},[x,w]);(0,t.useEffect)(()=>{b()},[i,b]);const E=(0,t.useCallback)((t,n)=>{e(t,n,y[t]||"")},[e,y]),P=s?.at(-1)?.length<9;return(0,t.useEffect)(()=>{if(a)return m(!0);const t=setTimeout(()=>{m(!1)},750);return()=>clearTimeout(t)},[a]),(0,t.useEffect)(()=>{g&&!a&&u(t=>t+1)},[g,a,u]),(0,t.useEffect)(()=>{a||l||h(o)},[a,l,o]),a||S||!s?.length?(0,M.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(bl,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"relative flex w-full gap-6 p-8 pt-2",children:s.map(t=>t.map(({id:t,code:e,patternReplacementCode:r})=>(0,M.jsx)(Ol,{patternId:t,onPatternClick:E,code:null!=r?r:e,disabled:n,prompt:y[t]||"",onPromptChange:C},t)))}),p?(0,M.jsxs)("div",{className:"absolute inset-0 z-0 flex flex-col items-center justify-center text-center",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading Patterns...","strakture")})]}):null,p||P?null:(0,M.jsxs)("div",{ref:f,className:"mb-6 mt-6 flex w-full justify-center md:mt-2",children:[(0,M.jsx)(dl.Spinner,{}),(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Loading more patterns...","strakture")})]})]})},tc=Tu(Mu,t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r))),ec=async()=>{const t=new URLSearchParams({wpVersion:window.straktureSharedData?.wpVersion||null,lang:window.straktureSharedData?.wpLanguage||null});return await fetch(`${Rl}/v1/patterns/categories?${t.toString()}`).then(t=>t.json())},nc=x(k(t=>({categories:[],setCategories:e=>t({categories:e})}),{name:`strakture-library-cache-${window.straktureSharedData?.siteId}`})),rc=()=>{const e=Ku(t=>t.category),n=Ku(t=>t.setCategory),{data:i,isLoading:o,errorCount:s}=(()=>{var e;const[n,r]=(0,t.useState)(0),i=null!==(e=window.straktureSharedData?.wpLanguage)&&void 0!==e?e:"en_US",{data:o,error:s,isLoading:a}=tc(`categories-${i}`,ec,{onError:()=>r(t=>t+1),onSuccess:()=>r(0)});return{data:o,errorCount:n>1?n:s?1:0,isLoading:a}})(),{categories:a,setCategories:l}=nc();return(0,t.useEffect)(()=>{o||s||l(i)},[i,o,l,s]),(0,t.useEffect)(()=>{const t=t=>document.querySelector(`#strakture-library-category-${t}`)?.focus();if(a?.length){if(e){if("all"===e)return t("all");if(a?.find(({slug:t})=>t===e))return t(e)}n("all"),t("all")}},[e,n,a]),(0,M.jsxs)("div",{className:"strakture-type-control",children:[(0,M.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Category","strakture")}),(0,M.jsx)(ic,{categories:a,errorCount:s,current:e,setCurrent:n})]})},ic=({categories:t,errorCount:e,current:n,setCurrent:i})=>{const o=t=>Pl()("text-sm w-full text-left rtl:text-right px-3 py-2 block rounded-md transition-colors",{"bg-design-light text-design-main font-medium":n===t,"bg-transparent text-gray-700 hover:bg-design-light hover:text-design-main":n!==t});return t?.length?(0,M.jsxs)("nav",{className:"w-full flex flex-col gap-0.5",children:[(0,M.jsx)("button",{type:"button",id:"strakture-library-category-all",onClick:()=>i("all"),className:o("all"),children:(0,r.__)("All","strakture")}),t.map(({slug:t,id:e,name:n})=>(0,M.jsx)("button",{type:"button",id:`strakture-library-category-${t}`,onClick:()=>i(t),className:o(t),children:n},e))]}):e>1?(0,M.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-2 py-4",children:[(0,M.jsx)("span",{className:"text-sm text-gray-600",children:(0,r.__)("Retrying...","strakture")}),(0,M.jsx)(dl.Spinner,{})]}):(0,M.jsxs)("div",{className:"flex w-full justify-center py-4",children:[(0,M.jsx)("span",{className:"sr-only",children:(0,r.__)("Fetching...","strakture")}),(0,M.jsx)(dl.Spinner,{})]})},oc=x(S((t,e)=>{var n,r,i,o;return{remaining:Math.max(0,null!==(n=window.straktureSharedData?.credits?.remaining)&&void 0!==n?n:3),limit:null!==(r=window.straktureSharedData?.credits?.limit)&&void 0!==r?r:3,plan:null!==(i=window.straktureSharedData?.credits?.plan)&&void 0!==i?i:"free",resetDate:null!==(o=window.straktureSharedData?.credits?.resetDate)&&void 0!==o?o:null,isLoading:!1,updateCredits:n=>{var r,i,o,s,a;return t({remaining:Math.max(0,null!==(r=n.remaining)&&void 0!==r?r:e().remaining),limit:null!==(i=n.limit)&&void 0!==i?i:e().limit,plan:null!==(o=n.plan)&&void 0!==o?o:e().plan,resetDate:null!==(s=null!==(a=n.reset_date)&&void 0!==a?a:n.resetDate)&&void 0!==s?s:e().resetDate})},decrementCredit:()=>t(t=>({remaining:Math.max(0,t.remaining-1)})),decrementCredits:e=>t(t=>({remaining:Math.max(0,t.remaining-e)})),restoreCredits:e=>t({remaining:Math.max(0,e)}),hasCredits:()=>e().remaining>0,getFormattedResetDate:()=>{const t=e().resetDate;if(!t)return null;try{return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return null}},setLoading:e=>t({isLoading:e})}},{name:"Strakture Credits"})),sc=async(t,e)=>await a()({path:"/strakture/v1/library/settings/single",method:"POST",data:{key:t,value:e}}),ac=t=>{window.straktureSharedData&&(window.straktureSharedData.siteType=t)},lc=()=>{const e=Ku(t=>t.siteType),n=Ku(t=>t.setSiteType),{hasCredits:i}=oc(),[o,s]=(0,t.useState)(e||""),[a,l]=(0,t.useState)(!1),u=(0,t.useRef)(null),c=(0,t.useRef)(0),d=(0,t.useCallback)(async t=>{const e=c.current+1;c.current=e,l(!0),ac(t),n(t);try{const r=await sc("siteType",t);if(e!==c.current)return;ac(r),r!==t&&n(r)}catch(t){if(e!==c.current)return;console.error("Failed to save site type:",t)}finally{e===c.current&&l(!1)}},[n]),h=(0,t.useCallback)(()=>{u.current&&o!==e&&(clearTimeout(u.current),u.current=null,d(o))},[o,d,e]);return(0,t.useEffect)(()=>{u.current||s(e||"")},[e]),(0,t.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),i()?(0,M.jsxs)("div",{"data-tour-target":"site-type",className:"px-4",children:[(0,M.jsx)("label",{htmlFor:"strakture-site-type-input",className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-gray-500",children:(0,r.__)("Site Type","strakture")}),(0,M.jsx)("input",{id:"strakture-site-type-input",type:"text",value:o,onChange:t=>{const e=t.target.value;s(e),ac(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,d(e)},500)},onBlur:h,placeholder:(0,r.__)("e.g., Photography Portfolio, Restaurant","strakture"),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-700 placeholder-gray-400 focus:border-design-main focus:outline-none focus:ring-1 focus:ring-design-main"}),(0,M.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:a?(0,r.__)("Saving...","strakture"):(0,r.__)("Describe your site. Example: Restaurant, Photography Portfolio, etc.","strakture")})]}):null},uc=(0,M.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{"clip-path":"url(#clip0_101_491)",children:[(0,M.jsx)("path",{d:"M29.1262 0.0850517C29.4302 0.091618 29.5619 0.0992173 29.8084 0.291912C29.9788 0.524764 29.9874 0.649825 29.9725 0.931454C29.892 1.33877 29.6895 1.69948 29.5014 2.0654C28.9002 3.26768 28.3322 4.48618 27.7266 5.68631C27.6009 5.86381 27.4911 5.9299 27.2967 6.02649C27.099 6.0503 27.099 6.0503 26.8745 6.04885C21.3294 6.04533 15.7829 6.07902 10.2378 6.04812C9.3778 6.0438 8.69023 6.1758 8.01254 6.74591C6.66749 7.75395 6.6597 9.97523 7.69755 11.1949C8.29168 11.7569 8.97674 11.9939 9.77978 11.9963C13.165 12.0131 16.5505 12.0321 19.9357 12.033C25.4031 12.0356 29.9817 16.4427 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697798 29.9585C0.429173 29.9195 0.197807 29.9338 0.0659368 29.6026C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.83579 24.0689 3.19855 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31377 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C21.8725 18.0734 21.1851 18.0053 20.4733 18.0046C17.5342 17.9957 14.5951 17.9822 11.6559 17.9853C8.64305 17.9879 6.0684 17.5197 3.8283 15.327C-1.40558 10.0469 2.48562 0.307219 9.8165 0.0988723C16.2556 -0.0456274 22.688 0.113503 29.1262 0.0850517Z",fill:"#7851D4"}),(0,M.jsx)("path",{d:"M21.7253 18.1126C21.7105 18.0808 21.7322 18.0132 21.7322 18.0132L24.1366 12.9919C24.1366 12.9919 24.1437 12.9811 24.1494 12.9788C24.1551 12.9765 24.1664 12.9746 24.1751 12.9788C27.5361 14.5693 29.8055 18.0115 29.3443 22.1173C28.7952 26.3508 26.1099 29.3377 20.8352 29.9338C20.5498 29.9427 20.2647 29.9433 19.9792 29.9431C13.5521 29.9583 7.12494 29.9544 0.697799 29.9585C0.429174 29.9195 0.197807 29.9338 0.0659368 29.6027C-0.0659329 29.2715 0.240351 28.6754 0.490387 28.2161C1.12717 27.0185 1.79661 25.8333 2.34015 24.5889C2.48149 24.2373 2.8358 24.0689 3.19856 24.0152C3.39013 24.0058 3.58012 24.0045 3.77192 24.0063C9.31378 23.9757 14.8561 23.9656 20.398 23.9911C21.4504 23.9856 22.294 23.7472 23.0687 23.0039C23.6282 22.38 23.8253 21.5765 23.8161 20.7556C23.7563 19.7851 23.2367 19.0355 22.4753 18.481C22.2574 18.3336 22.0284 18.2306 21.7912 18.1592C21.7535 18.1478 21.7401 18.1443 21.7253 18.1126Z",fill:"url(#paint0_linear_101_491)"})]}),(0,M.jsxs)("defs",{children:[(0,M.jsxs)("linearGradient",{id:"paint0_linear_101_491",x1:"-1.02465",y1:"29.9585",x2:"28.8244",y2:"17.6585",gradientUnits:"userSpaceOnUse",children:[(0,M.jsx)("stop",{"stop-color":"#E74070"}),(0,M.jsx)("stop",{offset:"1","stop-color":"#FF8558"})]}),(0,M.jsx)("clipPath",{id:"clip0_101_491",children:(0,M.jsx)("rect",{width:"30",height:"30",fill:"white"})})]})]}),cc=()=>(0,M.jsxs)("div",{className:"hidden flex-shrink-0 flex-col gap-6 md:flex md:w-80",children:[(0,M.jsx)("div",{className:"-mb-5 hidden px-5 py-3 text-strakture-black sm:flex sm:pt-5",children:(0,M.jsx)(o,{icon:uc,size:30})}),(0,M.jsxs)("div",{className:"flex flex-col gap-6 overflow-y-auto pb-16",children:[(0,M.jsx)(lc,{}),(0,M.jsx)("div",{id:"strakture-library-category-control","data-test":"category-control",className:"hidden flex-col overflow-x-hidden px-4 md:flex",children:(0,M.jsx)(rc,{})})]})]}),dc=({onClose:t})=>(0,M.jsx)("button",{className:"block h-6 w-6 bg-transparent p-px text-inherit outline-none focus:shadow-none focus:ring-wp focus:ring-design-main",type:"button",onClick:t,"data-test":"modal-close-button","aria-label":(0,r.__)("Close","strakture"),children:(0,M.jsx)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})})}),hc=({onClose:t,onBatchInsert:e})=>{const{getSelectedCount:n,canSelectMore:i}=Dl(),o=n(),s=!i(),a=window.straktureSharedData?.upgradeUrl;return(0,M.jsxs)("div",{"data-tour-target":"topbar",className:"mb-2 flex h-16 flex-shrink-0 items-center justify-between px-8",children:[(0,M.jsxs)("div",{className:"mt-4 flex items-center gap-4",children:[a&&(0,M.jsx)("a",{href:a,className:"text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline",children:(0,r.__)("Upgrade to Pro","strakture")}),o>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{type:"button",onClick:e,className:Pl()("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-all duration-150","bg-design-main text-white hover:opacity-90"),children:(0,M.jsx)("span",{children:(0,r.sprintf)((0,r.__)("Insert %d Pattern%s","strakture"),o,o>1?"s":"")})}),s&&(0,M.jsx)("span",{className:"text-xs text-gray-500",children:(0,r.__)("Maximum 10 patterns","strakture")})]})]}),(0,M.jsx)("div",{className:"mt-4",children:(0,M.jsx)(dc,{onClose:t})})]})},pc=async t=>{const{insertBlocks:n,replaceBlock:r}=(0,e.dispatch)("core/block-editor"),{getSelectedBlock:i,getBlockHierarchyRootClientId:o,getBlockIndex:s,getGlobalBlockCount:l,getBlockParents:u,getBlock:c,getBlocks:d}=(0,e.select)("core/block-editor"),h=(0,e.select)("core/preferences").get("core","renderingModes")||{},p=(0,e.select)("core").getCurrentTheme()?.stylesheet,m="template-locked"===h?.[p]?.page,{set:f}=(0,e.dispatch)("core/preferences"),g=t=>f("core","renderingModes",{...h,[p]:{...h[p]||{},page:t}});let{clientId:y,name:v,attributes:x}=i()||{};if(y&&m){const t=u(y).map(t=>c(t)).filter(Boolean),e=t.findIndex(t=>"core/post-content"===t?.name),n=s(-1!==e&&t[e+1]?.clientId||y);g("post-only"),await new Promise(t=>requestAnimationFrame(t));const r=d()[n];({clientId:y,name:v,attributes:x}=r||{})}const w=y?o(y):"",b=(w?s(w):l())+1,{missingCSSVars:S}=V.getState();S.forEach(t=>{document?.documentElement?.style?.setProperty(t,Tl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,Tl[t])}),S.length&&(async t=>{var e;const n=window.straktureSharedData?.globalStylesPostID,{styles:r,settings:i}=await a()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter(t=>!r?.css?.includes(`${t}:`))).length)return;const o=t.reduce((t,e)=>t+`${e}: ${Tl[e]};\n`,":root {\n")+"\n}";a()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:i,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+o}}})})(S);try{return m&&!y&&(g("post-only"),await new Promise(t=>requestAnimationFrame(t))),"core/paragraph"===v&&""===x?.content?.text?await r(y,t):await n(t,b)}finally{m&&g("template-locked")}},mc=[{id:"site-type",selector:'[data-tour-target="site-type"]',title:(0,r.__)("Enter your site type","strakture"),description:(0,r.__)("Tell us what kind of site you have — Restaurant, Medical, Photography, etc. This helps generate patterns that match your content.","strakture"),position:"right",offsetY:0,requiresCredits:!0,paidOnly:!1},{id:"pattern-grid",selector:"#strakture-library-patterns-list",title:(0,r.__)("Pick patterns to generate","strakture"),description:(0,r.__)("Browse the patterns and check the box on each one you want to add to your site.","strakture"),position:"left",requiresCredits:!1,paidOnly:!1},{id:"customize",selector:'[data-tour-target="customize-button"]',title:(0,r.__)("Add customization if needed","strakture"),description:(0,r.__)("Click Customize on any pattern to add specific instructions like layout changes, text, or call-to-action details.","strakture"),position:"top",requiresCredits:!0,paidOnly:!1},{id:"generate",selector:'[data-tour-target="topbar"]',title:(0,r.__)("Generate your patterns","strakture"),description:(0,r.__)("After selecting patterns, click the Generate button that appears here to create AI-customized versions for your site.","strakture"),position:"bottom",requiresCredits:!1,paidOnly:!1}],fc=288,gc=12,yc=(t,e,n=0)=>{if(!t)return{opacity:0};const r={position:"fixed",width:fc,zIndex:10001};switch(e){case"right":r.top=t.top+t.height/2+n,r.left=t.right+gc,r.transform="translateY(-50%)",r.left+fc>window.innerWidth-16&&(r.left=t.left-fc-gc);break;case"left":r.top=t.top+t.height/2+n,r.left=t.left-fc-gc,r.transform="translateY(-50%)",r.left<16&&(r.left=t.right+gc);break;case"bottom":r.top=t.bottom+gc+n,r.left=t.left+t.width/2-144;break;case"top":r.top=t.top-gc+n,r.left=t.left+t.width/2-144,r.transform="translateY(-100%)";break;default:r.top=t.bottom+gc+n,r.left=t.left}return r.left<16&&(r.left=16),r.left+fc>window.innerWidth-16&&(r.left=window.innerWidth-fc-16),r},vc=()=>{const{isActive:e,isWaiting:n,currentStep:i,currentStepIndex:o,totalSteps:s,targetRect:a,next:l,skip:u}=(()=>{var e;const{plan:n,hasCredits:r}=oc(),[i,o]=(0,t.useState)(!1),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(null),p=(0,t.useRef)(null),m=mc.filter(t=>!(t.paidOnly&&"free"===n||t.requiresCredits&&!r())),f=null!==(e=m[s])&&void 0!==e?e:null;(0,t.useEffect)(()=>{const t=window.straktureLibraryData?.onboardingCompleted;if(!t){const t=setTimeout(()=>o(!0),350);return()=>clearTimeout(t)}},[]),(0,t.useCallback)(()=>{if(!f)return;const t=document.querySelector(f.selector);t&&(u(t.getBoundingClientRect()),p.current=t)},[f]),(0,t.useEffect)(()=>{if(!i||!f)return;let t=!1;(async()=>{d(!0);const e=await((t,e=1e4)=>new Promise(n=>{const r=document.querySelector(t);if(r)return n(r);const i=new MutationObserver(()=>{const e=document.querySelector(t);e&&(i.disconnect(),n(e))});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),n(null)},e)}))(f.selector);if(t)return;if(!e)return d(!1),void(s<m.length-1?a(t=>t+1):g());if(await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))),t)return;u(e.getBoundingClientRect()),p.current=e,d(!1),h.current&&h.current.disconnect();const n=new ResizeObserver(()=>{t||u(e.getBoundingClientRect())});n.observe(e),h.current=n})();const e=()=>{p.current&&u(p.current.getBoundingClientRect())};window.addEventListener("resize",e);const n=document.getElementById("strakture-library-patterns-list");return n?.addEventListener("scroll",e),()=>{t=!0,window.removeEventListener("resize",e),n?.removeEventListener("scroll",e),h.current&&h.current.disconnect()}},[i,s,f?.selector]);const g=(0,t.useCallback)(()=>{o(!1),p.current=null,h.current&&h.current.disconnect(),sc("onboardingCompleted",!0).catch(console.warn)},[]),y=(0,t.useCallback)(()=>{s>=m.length-1?g():a(t=>t+1)},[s,m.length,g]),v=(0,t.useCallback)(()=>{g()},[g]);return{isActive:i,isWaiting:c,currentStep:f,currentStepIndex:s,totalSteps:m.length,targetRect:l,next:y,skip:v}})(),c=(0,t.useRef)(null);if((0,t.useEffect)(()=>{e&&!n&&c.current&&c.current.focus()},[e,n,o]),(0,t.useEffect)(()=>{if(!e)return;const t=t=>{"Escape"===t.key&&(t.stopPropagation(),u())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,u]),!e||!i)return null;const d=o===s-1,h=a&&!n;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:n?"none":"auto"},onClick:t=>{t.stopPropagation(),t.preventDefault()},"aria-hidden":"true"}),h&&(0,M.jsx)("div",{style:{position:"fixed",top:a.top-8,left:a.left-8,width:a.width+16,height:a.height+16,borderRadius:8,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)",zIndex:1e4,pointerEvents:"none"}}),h&&(0,M.jsxs)("div",{role:"dialog","aria-label":i.title,className:"rounded-lg bg-white p-5 shadow-xl",style:yc(a,i.position,i.offsetY),children:[(0,M.jsx)("h3",{className:"mb-1 text-sm font-semibold text-gray-900",children:i.title}),(0,M.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-gray-600",children:i.description}),(0,M.jsxs)("div",{className:"flex items-center justify-between",children:[(0,M.jsxs)("span",{className:"text-xs text-gray-400",children:[o+1," / ",s]}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("button",{type:"button",onClick:u,className:"rounded px-3 py-1.5 text-xs text-gray-500 hover:text-gray-700",children:(0,r.__)("Skip","strakture")}),(0,M.jsx)("button",{ref:c,type:"button",onClick:l,className:"rounded bg-design-main px-3 py-1.5 text-xs font-medium text-white hover:opacity-90",children:d?(0,r.__)("Done","strakture"):(0,r.__)("Next","strakture")})]})]})]})]})},xc=()=>{const n=O(t=>t.incrementActivity),i=V(t=>t.open),o=V(t=>t.setOpen),s=Ku(t=>t.incrementImports),a=Dl(t=>t.getSelectedPatterns),l=Dl(t=>t.clearSelection),{createNotice:u}=(0,e.dispatch)("core/notices"),c=(0,t.useRef)(!1),d=()=>{l(),o(!1)};return(0,t.useLayoutEffect)(()=>{i||c.current||(c.current=!0,new URLSearchParams(window.location.search).has("strakture-open")&&(o(!0),n("library-search-param-auto-open")))},[o,n,i]),(0,t.useEffect)(()=>{const t=new URLSearchParams(window.location.search);t.has("strakture-close")&&(o(!1),t.delete("strakture-close"),window.history.replaceState({},"",window.location.pathname+"?"+t.toString()))},[o,n]),(0,t.useEffect)(()=>{const t=()=>o(!0),e=()=>o(!1);return window.addEventListener("strakture::open-library",t),window.addEventListener("strakture::close-library",e),()=>{window.removeEventListener("strakture::open-library",t),window.removeEventListener("strakture::close-library",e)}},[o,i]),(0,t.useEffect)(()=>{if(!i)return;const t=(0,e.select)("core/edit-post");t&&t.isFeatureActive("welcomeGuide")&&(0,e.dispatch)("core/edit-post").toggleFeature("welcomeGuide")},[i]),i?(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(Oe,{className:"strakture-library strakture-library-modal",open:i,static:!0,onClose:()=>{},children:(0,M.jsxs)("div",{className:"absolute mx-auto h-full w-full md:p-8",children:[(0,M.jsx)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,M.jsxs)(cl.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"relative mx-auto h-full w-full max-w-screen-3xl bg-white rounded-lg shadow-2xl sm:flex sm:overflow-hidden",children:[(0,M.jsx)(Oe.Title,{className:"sr-only",children:(0,r.__)("Design Patterns","strakture")}),(0,M.jsx)(cc,{}),(0,M.jsxs)("div",{className:"relative flex w-full flex-col bg-[#FAFAFA]",children:[(0,M.jsx)(hc,{onClose:d,onBatchInsert:async()=>{const t=a(),e=t.length;if(0===e)return;const n=[];for(const e of t)e.blocks?.length>0&&n.push(...e.blocks);n.length>0&&(await pc(n),s()),l(),o(!1);const i=window.straktureSharedData?.upgradeUrl;u("info",(0,r.sprintf)((0,r.__)("%d patterns added. Upgrade to Pro to generate AI patterns.","strakture"),e),{isDismissible:!0,type:"snackbar",actions:i?[{label:(0,r.__)("Upgrade","strakture"),url:i}]:[]})}}),(0,M.jsx)("div",{id:"strakture-library-patterns-list",className:"relative flex-grow overflow-y-auto",children:(0,M.jsx)(Qu,{onPatternClick:async(t,e)=>{await pc(e),s(),d();const n=window.straktureSharedData?.upgradeUrl;u("info",(0,r.__)("Pattern added. Upgrade to Pro to generate AI patterns.","strakture"),{isDismissible:!0,type:"snackbar",actions:n?[{label:(0,r.__)("Upgrade","strakture"),url:n}]:[]})},disabled:!1})})]})]},"library-modal"),(0,M.jsx)(vc,{})]})})}):null};(0,e.subscribe)(()=>{(()=>{if("function"!=typeof t.createRoot)return;const e="strakture-library-btn",r="strakture-library";if(document.getElementById(e))return;const i=document.querySelector(".edit-post-header-toolbar");if(!i)return;const o=document.createElement("div"),s=Object.assign(o,{id:e,className:r});i.append(s),n((0,M.jsx)(L,{}),s);const a="strakture-library-modal";if(!document.getElementById(a)){const t=document.createElement("div"),e=Object.assign(t,{id:a,className:r});document.body.append(e),n((0,M.jsx)(xc,{}),e)}})()})})()})(); -
strakture/trunk/public/build/strakture-onboarding.asset.php
r3499596 r3509467 1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' c83d00345af326dfce24');1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '0fbff186f44d7eeb5346'); -
strakture/trunk/public/build/strakture-onboarding.js
r3485642 r3509467 1 (()=>{"use strict";var e={359(e,t,a){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(a(609)),c=o(a(685)),d={resize:!0,useWorker:!1},u={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0};function h(e,t){return e||t?e:u}t.default=function(e){var t=e.style,a=e.className,n=e.width,s=e.height,i=e.globalOptions,o=e.onInit,u=(0,l.useRef)(null),f=(0,l.useRef)(null);return(0,l.useEffect)(function(){if(u.current)return f.current=c.default.create(u.current,r(r({},d),i)),null==o||o({confetti:f.current}),function(){var e;null===(e=f.current)||void 0===e||e.reset()}},[]),l.default.createElement("canvas",{ref:u,style:h(t,a),className:a,width:n,height:s})}},609(e){e.exports=window.React},685(e,t,a){a.r(t),a.d(t,{create:()=>s,default:()=>n});var r={};!function e(t,a,r,n){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix,o=function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var r=e.transferToImageBitmap();a.createPattern(r,"no-repeat")}catch(e){return!1}return!0}();function l(){}function c(e){var r=a.exports.Promise,n=void 0!==r?r:t.Promise;return"function"==typeof n?new n(e):(e(l,l),null)}var d,u,h,f, g,p,_,m,b,v,x,w=(d=o,u=new Map,{transform:function(e){if(d)return e;if(u.has(e))return u.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),u.set(e,t),t},clear:function(){u.clear()}}),k=(g=Math.floor(1e3/60),p={},_=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(h=function(e){var t=Math.random();return p[t]=requestAnimationFrame(function a(r){_===r||_+g-1<r?(_=r,delete p[t],e()):p[t]=requestAnimationFrame(a)}),t},f=function(e){p[e]&&cancelAnimationFrame(p[e])}):(h=function(e){return setTimeout(e,g)},f=function(e){return clearTimeout(e)}),{frame:h,cancel:f}),y=(v={},function(){if(m)return m;if(!r&&s){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(a,r,n){if(b)return t(a,null),b;var s=Math.random().toString(36).slice(2);return b=c(function(r){function i(t){t.data.callback===s&&(delete v[s],e.removeEventListener("message",i),b=null,w.clear(),n(),r())}e.addEventListener("message",i),t(a,s),v[s]=i.bind(null,{data:{callback:s}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),j={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function M(e,t,a){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:j[t],a)}function S(e){return e<0?0:Math.floor(e)}function N(e,t){return Math.floor(Math.random()*(t-e))+e}function C(e){return parseInt(e,16)}function P(e){return e.map(O)}function O(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:C(t.substring(0,2)),g:C(t.substring(2,4)),b:C(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function T(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function z(e){var t=e.angle*(Math.PI/180),a=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*a-Math.random()*a),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function I(e,a){var o,l=!e,d=!!M(a||{},"resize"),u=!1,h=M(a,"disableForReducedMotion",Boolean),f=s&&M(a||{},"useWorker")?y():null,g=l?B:T,p=!(!e||!f||!e.__confetti_initialized),_="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function m(t,a,s){for(var l=M(t,"particleCount",S),d=M(t,"angle",Number),u=M(t,"spread",Number),h=M(t,"startVelocity",Number),f=M(t,"decay",Number),p=M(t,"gravity",Number),_=M(t,"drift",Number),m=M(t,"colors",P),b=M(t,"ticks",Number),v=M(t,"shapes"),x=M(t,"scalar"),y=!!M(t,"flat"),j=function(e){var t=M(e,"origin",Object);return t.x=M(t,"x",Number),t.y=M(t,"y",Number),t}(t),C=l,O=[],B=e.width*j.x,T=e.height*j.y;C--;)O.push(z({x:B,y:T,angle:d,spread:u,startVelocity:h,color:m[C%m.length],shape:v[N(0,v.length)],ticks:b,decay:f,gravity:p,drift:_,scalar:x,flat:y}));return o?o.addFettis(O):(o=function(e,t,a,s,o){var l,d,u=t.slice(),h=e.getContext("2d"),f=c(function(t){function c(){l=d=null,h.clearRect(0,0,s.width,s.height),w.clear(),o(),t()}l=k.frame(function t(){!r||s.width===n.width&&s.height===n.height||(s.width=e.width=n.width,s.height=e.height=n.height),s.width||s.height||(a(e),s.width=e.width,s.height=e.height),h.clearRect(0,0,s.width,s.height),(u=u.filter(function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,n=t.y+t.random*t.tiltSin,s=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,r,n,s,i){var o=new Path2D(e),l=new Path2D;l.addPath(o,new DOMMatrix(t));var c=new Path2D;return c.addPath(l,new DOMMatrix([Math.cos(i)*n,Math.sin(i)*n,-Math.sin(i)*s,Math.cos(i)*s,a,r])),c}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(s-r),.1*Math.abs(o-n),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var l=Math.PI/10*t.wobble,c=.1*Math.abs(s-r),d=.1*Math.abs(o-n),u=t.shape.bitmap.width*t.scalar,h=t.shape.bitmap.height*t.scalar,f=new DOMMatrix([Math.cos(l)*c,Math.sin(l)*c,-Math.sin(l)*d,Math.cos(l)*d,t.x,t.y]);f.multiplySelf(new DOMMatrix(t.shape.matrix));var g=e.createPattern(w.transform(t.shape.bitmap),"no-repeat");g.setTransform(f),e.globalAlpha=1-a,e.fillStyle=g,e.fillRect(t.x-u/2,t.y-h/2,u,h),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,r,n,s,i,o){e.save(),e.translate(t,a),e.rotate(s),e.scale(r,n),e.arc(0,0,1,0,o,void 0),e.restore()}(e,t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var p=Math.PI/2*3,_=4*t.scalar,m=8*t.scalar,b=t.x,v=t.y,x=5,k=Math.PI/x;x--;)b=t.x+Math.cos(p)*m,v=t.y+Math.sin(p)*m,e.lineTo(b,v),p+=k,b=t.x+Math.cos(p)*_,v=t.y+Math.sin(p)*_,e.lineTo(b,v),p+=k;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(n)),e.lineTo(Math.floor(s),Math.floor(o)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}(h,e)})).length?l=k.frame(t):c()}),d=c});return{addFettis:function(e){return u=u.concat(e),f},canvas:e,promise:f,reset:function(){l&&k.cancel(l),d&&d()}}}(e,O,g,a,s),o.promise)}function b(a){var r=h||M(a,"disableForReducedMotion",Boolean),n=M(a,"zIndex",Number);if(r&&_)return c(function(e){e()});l&&o?e=o.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(n),document.body.appendChild(e)),d&&!p&&g(e);var s={width:e.width,height:e.height};function i(){if(f){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return g(t),void f.postMessage({resize:{width:t.width,height:t.height}})}s.width=s.height=null}function b(){o=null,d&&(u=!1,t.removeEventListener("resize",i)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,p=!1)}return f&&!p&&f.init(e),p=!0,f&&(e.__confetti_initialized=!0),d&&!u&&(u=!0,t.addEventListener("resize",i,!1)),f?f.fire(a,s,b):m(a,s,b)}return b.reset=function(){f&&f.reset(),o&&o.reset()},b}function E(){return x||(x=I(null,{useWorker:!0,resize:!0})),x}a.exports=function(){return E().apply(this,arguments)},a.exports.reset=function(){E().reset()},a.exports.create=I,a.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,a;"string"==typeof e?t=e:(t=e.path,a=e.matrix);var r=new Path2D(t),n=document.createElement("canvas").getContext("2d");if(!a){for(var s,o,l=1e3,c=l,d=l,u=0,h=0,f=0;f<l;f+=2)for(var g=0;g<l;g+=2)n.isPointInPath(r,f,g,"nonzero")&&(c=Math.min(c,f),d=Math.min(d,g),u=Math.max(u,f),h=Math.max(h,g));s=u-c,o=h-d;var p=Math.min(10/s,10/o);a=[p,0,0,p,-Math.round(s/2+c)*p,-Math.round(o/2+d)*p]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,r="#000000",n='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,n="fontFamily"in e?e.fontFamily:n,r="color"in e?e.color:r);var s=10*a,i=s+"px "+n,o=new OffscreenCanvas(s,s),l=o.getContext("2d");l.font=i;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),u=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),h=c.actualBoundingBoxLeft+2,f=c.actualBoundingBoxAscent+2;d+=4,u+=4,(l=(o=new OffscreenCanvas(d,u)).getContext("2d")).font=i,l.fillStyle=r,l.fillText(t,h,f);var g=1/a;return{type:"bitmap",bitmap:o.transferToImageBitmap(),matrix:[g,0,0,g,-d*g/2,-u*g/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),r,!1);const n=r.exports;var s=r.exports.create}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,a),s.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const r=window.wp.element,n=window.wp.apiFetch;var s=a.n(n);const i=window.ReactJSXRuntime,o=(0,r.createContext)(),l=window.straktureOnboardingData||{},c={site_title:l.siteTitle||"",site_tagline:l.siteTagline||"",site_type:l.siteType||"",color_palette:"default",color_palette_file:"",typography_preset:"default",typography_preset_file:"",...l.savedSettings};function d({children:e}){const[t,a]=(0,r.useState)(c),[n,l]=(0,r.useState)(0),[d,u]=(0,r.useState)(!1),h=(0,r.useCallback)((e,t)=>{a(a=>({...a,[e]:t}))},[]),f=(0,r.useCallback)(async(e={})=>{u(!0);const r={...t,...e};try{await s()({path:"/strakture/v1/onboarding/settings",method:"POST",data:r}),a(r)}finally{u(!1)}},[t]),g=(0,r.useCallback)(async()=>{await s()({path:"/strakture/v1/onboarding/complete",method:"POST"})},[]);return(0,i.jsx)(o.Provider,{value:{settings:t,currentStep:n,setCurrentStep:l,isSaving:d,updateSetting:h,saveSettings:f,completeOnboarding:g},children:e})}function u(){return(0,r.useContext)(o)}const h=window.wp.i18n,f=window.wp.primitives;var g=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),p=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),_=(0,i.jsx)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),m=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})}),b=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),v=(0,r.forwardRef)(({icon:e,size:t=24,...a},n)=>(0,r.cloneElement)(e,{width:t,height:t,...a,ref:n})),x=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const w=window.straktureOnboardingData||{},k=[{label:(0,h.__)("Dashboard","strakture"),index:0,icon:g},{label:(0,h.__)("Site Settings","strakture"),index:1,icon:p},{label:(0,h.__)("Colors","strakture"),index:2,icon:_},{label:(0,h.__)("Typography","strakture"),index:3,icon:m}],y=w.isPaying?[...k,{label:(0,h.__)("Starter Sites","strakture"),index:4,icon:b}]:k;function j(){const{currentStep:e,setCurrentStep:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__sidebar",children:[(0,i.jsx)("div",{className:"strakture-onboarding__sidebar-top",children:(0,i.jsx)("div",{className:"strakture-onboarding__back-to-dash",children:(0,i.jsxs)("a",{href:w.adminUrl,children:[(0,i.jsx)(v,{icon:x,size:28}),(0,i.jsx)("span",{children:(0,h.__)("Back to admin","strakture")})]})})}),(0,i.jsx)("ul",{className:"strakture-onboarding__steps",children:y.map(a=>{let r="strakture-onboarding__step";return a.index===e&&(r+=" is-active"),(0,i.jsxs)("li",{className:r,onClick:()=>t(a.index),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(a.index))},children:[(0,i.jsx)(v,{icon:a.icon,size:20}),a.label]},a.index)})})]})}const M=window.wp.components;var S=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});const N=window.straktureOnboardingData||{};function C(){const{setCurrentStep:e}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__dashboard",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav-left",children:[(0,i.jsx)("img",{src:N.logoDarkUrl,alt:(0,h.__)("Strakture","strakture"),className:"strakture-onboarding__dash-nav-logo"}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-version",children:N.version})]}),(0,i.jsxs)("nav",{className:"strakture-onboarding__dash-nav-right",children:[(0,i.jsx)("a",{href:"https://strakture.com",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Website","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://www.youtube.com/@alexandersamokhin",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("YouTube","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:N.adminUrl+"admin.php?page=strakture-contact",children:(0,h.__)("Support","strakture")})]})]}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-hero",children:(0,i.jsxs)("div",{className:"strakture-onboarding__dash-hero-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Welcome to Strakture","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Generate AI-powered patterns that match your theme's design system. Get started by configuring your site with the setup wizard below.","strakture")}),(0,i.jsxs)(M.Button,{variant:"primary",onClick:()=>e(1),children:[(0,h.__)("Start Setup","strakture"),(0,i.jsx)(v,{icon:S,size:20})]})]})}),!N.isPaying&&(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-upgrade",children:[(0,i.jsx)("h2",{children:(0,h.__)("Upgrade to Pro","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Take your site to the next level with AI-powered design and premium features.","strakture")}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,h.__)("AI-generated patterns tailored to your website","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Responsive Controls","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium WordPress theme included","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Full WooCommerce integration","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium block patterns","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Priority support","strakture")})]}),(0,i.jsx)(M.Button,{className:"strakture-onboarding__upgrade-btn",variant:"primary",href:N.upgradeUrl,children:(0,h.__)("Upgrade to Pro","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-section--alt",children:[(0,i.jsx)("h2",{children:(0,h.__)("Watch Video Tutorial","strakture")}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-video",children:(0,i.jsxs)("a",{href:"https://www.youtube.com/watch?v=apyhf08-11A",target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__dash-video-link",children:[(0,i.jsx)("img",{src:N.pluginUrl+"public/img/video-thumb.jpg",alt:(0,h.__)("Getting Started with Strakture","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-video-play",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 48",width:"68",height:"48",children:[(0,i.jsx)("path",{d:"M66.52 7.74A8.52 8.52 0 0 0 60.71 1.9C55.4 0 34 0 34 0S12.6 0 7.29 1.9A8.52 8.52 0 0 0 1.48 7.74C0 13.08 0 24 0 24s0 10.92 1.48 16.26a8.52 8.52 0 0 0 5.81 5.84C12.6 48 34 48 34 48s21.4 0 26.71-1.9a8.52 8.52 0 0 0 5.81-5.84C68 34.92 68 24 68 24s0-10.92-1.48-16.26z",fill:"#ff0000"}),(0,i.jsx)("path",{d:"M27 34l18-10-18-10v20z",fill:"#fff"})]})})]})})]})]})}const P=(window.straktureOnboardingData||{}).isPaying?4:3;function O(){const{currentStep:e,setCurrentStep:t,saveSettings:a,isSaving:r}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__nav",children:[(0,i.jsx)("button",{className:"strakture-onboarding__back-btn",onClick:()=>{t(e-1)},children:(0,h.__)("Go Back","strakture")}),(0,i.jsx)(M.Button,{variant:"primary",onClick:async()=>{await a(),t(e+1)},isBusy:r,disabled:r,children:r?(0,h.__)("Saving...","strakture"):e>=P?(0,h.__)("Save and Finish","strakture"):(0,h.__)("Next","strakture")})]})}function B(){const{settings:e,updateSetting:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__site-settings",children:[(0,i.jsx)("h2",{children:(0,h.__)("Site Settings","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Configure the basic information about your website.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__fields",children:[(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Title","strakture"),value:e.site_title,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_title",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Tagline","strakture"),value:e.site_tagline,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_tagline",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Type","strakture"),value:e.site_type,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_type",e),placeholder:(0,h.__)("e.g., Photography Portfolio, Restaurant","strakture"),help:(0,h.__)("Describe your site. This helps generate better AI patterns.","strakture")})]}),(0,i.jsx)(O,{})]})}const T=window.ReactDOM,z=window.straktureOnboardingData||{};function I({refreshKey:e=0}){const t=(0,r.useRef)(null),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)({}),[l,c]=(0,r.useState)(!1),d=`${z.homeUrl}?strakture_preview=${e}`;return(0,r.useLayoutEffect)(()=>{const e=()=>{if(!t.current||!a)return;const e=a.clientWidth/1600;o({width:1600,height:a.clientHeight/e,transform:`scale(${e})`,transformOrigin:"top left"})};e();const r=new ResizeObserver(()=>{(0,T.flushSync)(()=>{e()})});return a&&r.observe(a),()=>r.disconnect()},[a]),(0,r.useLayoutEffect)(()=>{c(!1)},[e]),(0,i.jsxs)("div",{className:"strakture-onboarding__preview",children:[(0,i.jsx)("div",{className:"strakture-onboarding__preview-browser",children:(0,i.jsxs)("div",{className:"strakture-onboarding__preview-dots",children:[(0,i.jsx)("span",{}),(0,i.jsx)("span",{}),(0,i.jsx)("span",{})]})}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-container",ref:n,children:(0,i.jsx)("iframe",{title:"Site Preview",style:s,className:"strakture-onboarding__preview-iframe"+(l?" is-loaded":""),onLoad:()=>c(!0),src:d,ref:t})})]})}const E=(window.straktureOnboardingData||{}).colorPalettes||[],D=["primary","secondary","headings","background"];function R(e){const t={};return e.forEach(e=>{t[e.slug]=e}),D.map(e=>t[e]).filter(Boolean)}function A(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={color_palette:e.id,color_palette_file:e.file||""};t("color_palette",e.id),t("color_palette_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__colors",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Color Palette","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a color palette for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__palette-list",children:[E.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__palette-card"+(e.color_palette===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__palette-title",children:t.title}),(0,i.jsx)("span",{className:"strakture-onboarding__palette-colors",children:R(t.colors).map((e,t)=>(0,i.jsx)(M.ColorIndicator,{colorValue:e.color},t))})]},t.id)),0===E.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No color palettes found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}const F=(window.straktureOnboardingData||{}).fontPresets||[];function V(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={typography_preset:e.id,typography_preset_file:e.file||""};t("typography_preset",e.id),t("typography_preset_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__typography",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Typography","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a font combination for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__font-list",children:[F.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__font-card"+(e.typography_preset===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-preview",children:"Aa"}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-info",children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-title",children:t.title}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-names",children:[t.headingFont,t.bodyFont&&t.bodyFont!==t.headingFont?` / ${t.bodyFont}`:""]})]})]},t.id)),0===F.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No font presets found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}var L=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const U=window.straktureOnboardingData||{},H=U.starterSites||[];var G=a(359),W=a.n(G);const Z=window.straktureOnboardingData||{},Y={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0,zIndex:999};function q(){const{completeOnboarding:e}=u();(0,r.useEffect)(()=>{e()},[e]);const t=(0,r.useCallback)(({confetti:e})=>{e({particleCount:150,spread:80,origin:{y:.6}})},[]);return(0,i.jsxs)("div",{className:"strakture-onboarding__finish",children:[(0,i.jsx)(W(),{onInit:t,style:Y}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Setup Complete!","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Your site is configured and ready to go. Start editing your homepage or view your site to see the changes.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-actions",children:[(0,i.jsx)(M.Button,{variant:"primary",href:Z.homeUrl,target:"_blank",children:(0,h.__)("View Your Site","strakture")}),(0,i.jsx)(M.Button,{variant:"secondary",href:Z.adminUrl+"site-editor.php?p=%2Ftemplate",children:(0,h.__)("Start Editing","strakture")})]})]})]})}const X=(window.straktureOnboardingData||{}).isPaying?[C,B,A,V,function(){const[e,t]=(0,r.useState)(H),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),l=(0,r.useCallback)(async(e,t)=>{const a=new FormData;return a.append("action",e),a.append("wpnonce",U.starterSitesNonce),a.append("slug",t),(await fetch(U.ajaxUrl,{method:"POST",body:a})).json()},[]),c=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_activate_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,status:r.data.status,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]),d=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_update_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]);return(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites-header",children:[(0,i.jsx)("h2",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a starter site to import. You can customize everything after the import.","strakture")})]}),s&&(0,i.jsx)("div",{className:`strakture-onboarding__starter-sites-notice is-${s.type}`,children:s.message}),(0,i.jsx)("div",{className:"strakture-onboarding__demos-grid",children:e.map((e,t)=>{const r=((e,t)=>{const r=a===e.slug;switch(e.status){case"active":return{label:(0,h.__)("Import","strakture"),href:e.merlin_url,onClick:null,icon:L,isBusy:!1};case"installed":return{label:r?(0,h.__)("Activating...","strakture"):(0,h.__)("Activate","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r};default:return{label:r?(0,h.__)("Installing...","strakture"):(0,h.__)("Install","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r}}})(e,t),n=a===e.slug;return(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card",children:[e.needsUpdate&&(0,i.jsx)("div",{className:"strakture-onboarding__demo-card-update",children:(0,i.jsx)(M.Button,{variant:"link",onClick:()=>d(e,t),disabled:null!==a,isBusy:n,className:"strakture-onboarding__demo-card-update-btn",children:n?(0,h.__)("Updating...","strakture"):(0,h.__)("Update Available — Update Now","strakture")})}),(0,i.jsxs)("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__demo-card-image-link",children:[(0,i.jsx)("img",{src:e.import_preview_image_url,alt:e.import_file_name,className:"strakture-onboarding__demo-card-image"}),(0,i.jsx)("span",{className:"strakture-onboarding__demo-card-badge",children:(0,h.__)("Live Preview","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card-body",children:[(0,i.jsx)("h3",{className:"strakture-onboarding__demo-card-title",children:e.import_file_name}),(0,i.jsx)(M.Button,{variant:"primary",icon:r.icon,href:r.href,onClick:r.onClick,isBusy:r.isBusy,disabled:null!==a,className:"strakture-onboarding__demo-card-btn",children:r.label})]})]},t)})})]})},q]:[C,B,A,V,q];function $(){const{currentStep:e}=u(),t=X[e];return(0,i.jsx)("div",{className:"strakture-onboarding",children:(0,i.jsxs)("div",{className:"strakture-onboarding__layout",children:[(0,i.jsx)(j,{}),(0,i.jsx)("div",{className:"strakture-onboarding__main",children:(0,i.jsx)("div",{className:"strakture-onboarding__content",children:(0,i.jsx)(t,{})})})]})})}const K=document.getElementById("strakture-onboarding");K&&(0,r.createRoot)(K).render((0,i.jsx)(d,{children:(0,i.jsx)($,{})}))})();1 (()=>{"use strict";var e={359(e,t,a){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(a(609)),c=o(a(685)),d={resize:!0,useWorker:!1},u={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0};function h(e,t){return e||t?e:u}t.default=function(e){var t=e.style,a=e.className,n=e.width,s=e.height,i=e.globalOptions,o=e.onInit,u=(0,l.useRef)(null),f=(0,l.useRef)(null);return(0,l.useEffect)(function(){if(u.current)return f.current=c.default.create(u.current,r(r({},d),i)),null==o||o({confetti:f.current}),function(){var e;null===(e=f.current)||void 0===e||e.reset()}},[]),l.default.createElement("canvas",{ref:u,style:h(t,a),className:a,width:n,height:s})}},609(e){e.exports=window.React},685(e,t,a){a.r(t),a.d(t,{create:()=>s,default:()=>n});var r={};!function e(t,a,r,n){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix,o=function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var r=e.transferToImageBitmap();a.createPattern(r,"no-repeat")}catch(e){return!1}return!0}();function l(){}function c(e){var r=a.exports.Promise,n=void 0!==r?r:t.Promise;return"function"==typeof n?new n(e):(e(l,l),null)}var d,u,h,f,p,g,_,m,b,v,x,w=(d=o,u=new Map,{transform:function(e){if(d)return e;if(u.has(e))return u.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),u.set(e,t),t},clear:function(){u.clear()}}),k=(p=Math.floor(1e3/60),g={},_=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(h=function(e){var t=Math.random();return g[t]=requestAnimationFrame(function a(r){_===r||_+p-1<r?(_=r,delete g[t],e()):g[t]=requestAnimationFrame(a)}),t},f=function(e){g[e]&&cancelAnimationFrame(g[e])}):(h=function(e){return setTimeout(e,p)},f=function(e){return clearTimeout(e)}),{frame:h,cancel:f}),y=(v={},function(){if(m)return m;if(!r&&s){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(a,r,n){if(b)return t(a,null),b;var s=Math.random().toString(36).slice(2);return b=c(function(r){function i(t){t.data.callback===s&&(delete v[s],e.removeEventListener("message",i),b=null,w.clear(),n(),r())}e.addEventListener("message",i),t(a,s),v[s]=i.bind(null,{data:{callback:s}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),j={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function M(e,t,a){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:j[t],a)}function S(e){return e<0?0:Math.floor(e)}function N(e,t){return Math.floor(Math.random()*(t-e))+e}function C(e){return parseInt(e,16)}function P(e){return e.map(O)}function O(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:C(t.substring(0,2)),g:C(t.substring(2,4)),b:C(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function T(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function z(e){var t=e.angle*(Math.PI/180),a=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*a-Math.random()*a),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function I(e,a){var o,l=!e,d=!!M(a||{},"resize"),u=!1,h=M(a,"disableForReducedMotion",Boolean),f=s&&M(a||{},"useWorker")?y():null,p=l?B:T,g=!(!e||!f||!e.__confetti_initialized),_="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function m(t,a,s){for(var l=M(t,"particleCount",S),d=M(t,"angle",Number),u=M(t,"spread",Number),h=M(t,"startVelocity",Number),f=M(t,"decay",Number),g=M(t,"gravity",Number),_=M(t,"drift",Number),m=M(t,"colors",P),b=M(t,"ticks",Number),v=M(t,"shapes"),x=M(t,"scalar"),y=!!M(t,"flat"),j=function(e){var t=M(e,"origin",Object);return t.x=M(t,"x",Number),t.y=M(t,"y",Number),t}(t),C=l,O=[],B=e.width*j.x,T=e.height*j.y;C--;)O.push(z({x:B,y:T,angle:d,spread:u,startVelocity:h,color:m[C%m.length],shape:v[N(0,v.length)],ticks:b,decay:f,gravity:g,drift:_,scalar:x,flat:y}));return o?o.addFettis(O):(o=function(e,t,a,s,o){var l,d,u=t.slice(),h=e.getContext("2d"),f=c(function(t){function c(){l=d=null,h.clearRect(0,0,s.width,s.height),w.clear(),o(),t()}l=k.frame(function t(){!r||s.width===n.width&&s.height===n.height||(s.width=e.width=n.width,s.height=e.height=n.height),s.width||s.height||(a(e),s.width=e.width,s.height=e.height),h.clearRect(0,0,s.width,s.height),(u=u.filter(function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,n=t.y+t.random*t.tiltSin,s=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,r,n,s,i){var o=new Path2D(e),l=new Path2D;l.addPath(o,new DOMMatrix(t));var c=new Path2D;return c.addPath(l,new DOMMatrix([Math.cos(i)*n,Math.sin(i)*n,-Math.sin(i)*s,Math.cos(i)*s,a,r])),c}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(s-r),.1*Math.abs(o-n),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var l=Math.PI/10*t.wobble,c=.1*Math.abs(s-r),d=.1*Math.abs(o-n),u=t.shape.bitmap.width*t.scalar,h=t.shape.bitmap.height*t.scalar,f=new DOMMatrix([Math.cos(l)*c,Math.sin(l)*c,-Math.sin(l)*d,Math.cos(l)*d,t.x,t.y]);f.multiplySelf(new DOMMatrix(t.shape.matrix));var p=e.createPattern(w.transform(t.shape.bitmap),"no-repeat");p.setTransform(f),e.globalAlpha=1-a,e.fillStyle=p,e.fillRect(t.x-u/2,t.y-h/2,u,h),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,r,n,s,i,o){e.save(),e.translate(t,a),e.rotate(s),e.scale(r,n),e.arc(0,0,1,0,o,void 0),e.restore()}(e,t.x,t.y,Math.abs(s-r)*t.ovalScalar,Math.abs(o-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var g=Math.PI/2*3,_=4*t.scalar,m=8*t.scalar,b=t.x,v=t.y,x=5,k=Math.PI/x;x--;)b=t.x+Math.cos(g)*m,v=t.y+Math.sin(g)*m,e.lineTo(b,v),g+=k,b=t.x+Math.cos(g)*_,v=t.y+Math.sin(g)*_,e.lineTo(b,v),g+=k;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(n)),e.lineTo(Math.floor(s),Math.floor(o)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}(h,e)})).length?l=k.frame(t):c()}),d=c});return{addFettis:function(e){return u=u.concat(e),f},canvas:e,promise:f,reset:function(){l&&k.cancel(l),d&&d()}}}(e,O,p,a,s),o.promise)}function b(a){var r=h||M(a,"disableForReducedMotion",Boolean),n=M(a,"zIndex",Number);if(r&&_)return c(function(e){e()});l&&o?e=o.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(n),document.body.appendChild(e)),d&&!g&&p(e);var s={width:e.width,height:e.height};function i(){if(f){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return p(t),void f.postMessage({resize:{width:t.width,height:t.height}})}s.width=s.height=null}function b(){o=null,d&&(u=!1,t.removeEventListener("resize",i)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,g=!1)}return f&&!g&&f.init(e),g=!0,f&&(e.__confetti_initialized=!0),d&&!u&&(u=!0,t.addEventListener("resize",i,!1)),f?f.fire(a,s,b):m(a,s,b)}return b.reset=function(){f&&f.reset(),o&&o.reset()},b}function E(){return x||(x=I(null,{useWorker:!0,resize:!0})),x}a.exports=function(){return E().apply(this,arguments)},a.exports.reset=function(){E().reset()},a.exports.create=I,a.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,a;"string"==typeof e?t=e:(t=e.path,a=e.matrix);var r=new Path2D(t),n=document.createElement("canvas").getContext("2d");if(!a){for(var s,o,l=1e3,c=l,d=l,u=0,h=0,f=0;f<l;f+=2)for(var p=0;p<l;p+=2)n.isPointInPath(r,f,p,"nonzero")&&(c=Math.min(c,f),d=Math.min(d,p),u=Math.max(u,f),h=Math.max(h,p));s=u-c,o=h-d;var g=Math.min(10/s,10/o);a=[g,0,0,g,-Math.round(s/2+c)*g,-Math.round(o/2+d)*g]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,r="#000000",n='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,n="fontFamily"in e?e.fontFamily:n,r="color"in e?e.color:r);var s=10*a,i=s+"px "+n,o=new OffscreenCanvas(s,s),l=o.getContext("2d");l.font=i;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),u=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),h=c.actualBoundingBoxLeft+2,f=c.actualBoundingBoxAscent+2;d+=4,u+=4,(l=(o=new OffscreenCanvas(d,u)).getContext("2d")).font=i,l.fillStyle=r,l.fillText(t,h,f);var p=1/a;return{type:"bitmap",bitmap:o.transferToImageBitmap(),matrix:[p,0,0,p,-d*p/2,-u*p/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),r,!1);const n=r.exports;var s=r.exports.create}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,a),s.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};const r=window.wp.element,n=window.wp.apiFetch;var s=a.n(n);const i=window.ReactJSXRuntime,o=(0,r.createContext)(),l=window.straktureOnboardingData||{},c={color_palette:"default",color_palette_file:"",typography_preset:"default",typography_preset_file:"",...l.savedSettings,site_title:l.siteTitle||"",site_tagline:l.siteTagline||"",site_type:l.siteType||""};function d({children:e}){const[t,a]=(0,r.useState)(c),[n,l]=(0,r.useState)(0),[d,u]=(0,r.useState)(!1),h=(0,r.useCallback)((e,t)=>{a(a=>({...a,[e]:t}))},[]),f=(0,r.useCallback)(async(e={})=>{u(!0);const r={...t,...e};try{await s()({path:"/strakture/v1/onboarding/settings",method:"POST",data:r}),a(r)}finally{u(!1)}},[t]),p=(0,r.useCallback)(async()=>{await s()({path:"/strakture/v1/onboarding/complete",method:"POST"})},[]);return(0,i.jsx)(o.Provider,{value:{settings:t,currentStep:n,setCurrentStep:l,isSaving:d,updateSetting:h,saveSettings:f,completeOnboarding:p},children:e})}function u(){return(0,r.useContext)(o)}const h=window.wp.i18n,f=window.wp.primitives;var p=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),g=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),_=(0,i.jsx)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),m=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})}),b=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),v=(0,r.forwardRef)(({icon:e,size:t=24,...a},n)=>(0,r.cloneElement)(e,{width:t,height:t,...a,ref:n})),x=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const w=window.straktureOnboardingData||{},k=[{label:(0,h.__)("Dashboard","strakture"),index:0,icon:p},{label:(0,h.__)("Site Settings","strakture"),index:1,icon:g},{label:(0,h.__)("Colors","strakture"),index:2,icon:_},{label:(0,h.__)("Typography","strakture"),index:3,icon:m}],y=w.isPaying?[...k,{label:(0,h.__)("Starter Sites","strakture"),index:4,icon:b}]:k;function j(){const{currentStep:e,setCurrentStep:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__sidebar",children:[(0,i.jsx)("div",{className:"strakture-onboarding__sidebar-top",children:(0,i.jsx)("div",{className:"strakture-onboarding__back-to-dash",children:(0,i.jsxs)("a",{href:w.adminUrl,children:[(0,i.jsx)(v,{icon:x,size:28}),(0,i.jsx)("span",{children:(0,h.__)("Back to admin","strakture")})]})})}),(0,i.jsx)("ul",{className:"strakture-onboarding__steps",children:y.map(a=>{let r="strakture-onboarding__step";return a.index===e&&(r+=" is-active"),(0,i.jsxs)("li",{className:r,onClick:()=>t(a.index),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(a.index))},children:[(0,i.jsx)(v,{icon:a.icon,size:20}),a.label]},a.index)})})]})}const M=window.wp.components;var S=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});const N=window.straktureOnboardingData||{};function C(){const{setCurrentStep:e}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__dashboard",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__dash-nav-left",children:[(0,i.jsx)("img",{src:N.logoDarkUrl,alt:(0,h.__)("Strakture","strakture"),className:"strakture-onboarding__dash-nav-logo"}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-version",children:N.version})]}),(0,i.jsxs)("nav",{className:"strakture-onboarding__dash-nav-right",children:[(0,i.jsx)("a",{href:"https://strakture.com/docs/",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Docs","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://strakture.com",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("Website","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:"https://www.youtube.com/watch?v=rdpsa8vtLEM",target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("YouTube","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-nav-sep",children:"·"}),(0,i.jsx)("a",{href:N.adminUrl+"admin.php?page=strakture-contact",children:(0,h.__)("Support","strakture")})]})]}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-hero",children:(0,i.jsxs)("div",{className:"strakture-onboarding__dash-hero-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Welcome to Strakture","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Generate AI-powered patterns that match your theme's design system. Get started by configuring your site with the setup wizard below.","strakture")}),(0,i.jsxs)(M.Button,{variant:"primary",onClick:()=>e(1),children:[(0,h.__)("Start Setup","strakture"),(0,i.jsx)(v,{icon:S,size:20})]})]})}),!N.isPaying&&(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-upgrade",children:[(0,i.jsx)("h2",{children:(0,h.__)("Upgrade to Pro","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Take your site to the next level with AI-powered design and premium features.","strakture")}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,h.__)("AI-generated patterns tailored to your website","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Responsive Controls","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium WordPress theme included","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Full WooCommerce integration","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Premium block patterns","strakture")}),(0,i.jsx)("li",{children:(0,h.__)("Priority support","strakture")})]}),(0,i.jsx)(M.Button,{className:"strakture-onboarding__upgrade-btn",variant:"primary",href:N.upgradeUrl,children:(0,h.__)("Upgrade to Pro","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__dash-section strakture-onboarding__dash-section--alt",children:[(0,i.jsx)("h2",{children:(0,h.__)("Watch Video Tutorial","strakture")}),(0,i.jsx)("div",{className:"strakture-onboarding__dash-video",children:(0,i.jsxs)("a",{href:"https://www.youtube.com/watch?v=rdpsa8vtLEM",target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__dash-video-link",children:[(0,i.jsx)("img",{src:N.pluginUrl+"public/img/video-thumb.jpg",alt:(0,h.__)("Getting Started with Strakture","strakture")}),(0,i.jsx)("span",{className:"strakture-onboarding__dash-video-play",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 48",width:"68",height:"48",children:[(0,i.jsx)("path",{d:"M66.52 7.74A8.52 8.52 0 0 0 60.71 1.9C55.4 0 34 0 34 0S12.6 0 7.29 1.9A8.52 8.52 0 0 0 1.48 7.74C0 13.08 0 24 0 24s0 10.92 1.48 16.26a8.52 8.52 0 0 0 5.81 5.84C12.6 48 34 48 34 48s21.4 0 26.71-1.9a8.52 8.52 0 0 0 5.81-5.84C68 34.92 68 24 68 24s0-10.92-1.48-16.26z",fill:"#ff0000"}),(0,i.jsx)("path",{d:"M27 34l18-10-18-10v20z",fill:"#fff"})]})})]})})]})]})}const P=(window.straktureOnboardingData||{}).isPaying?4:3;function O(){const{currentStep:e,setCurrentStep:t,saveSettings:a,isSaving:r}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__nav",children:[(0,i.jsx)("button",{className:"strakture-onboarding__back-btn",onClick:()=>{t(e-1)},children:(0,h.__)("Go Back","strakture")}),(0,i.jsx)(M.Button,{variant:"primary",onClick:async()=>{await a(),t(e+1)},isBusy:r,disabled:r,children:r?(0,h.__)("Saving...","strakture"):e>=P?(0,h.__)("Save and Finish","strakture"):(0,h.__)("Next","strakture")})]})}function B(){const{settings:e,updateSetting:t}=u();return(0,i.jsxs)("div",{className:"strakture-onboarding__site-settings",children:[(0,i.jsx)("h2",{children:(0,h.__)("Site Settings","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Configure the basic information about your website.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__fields",children:[(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Title","strakture"),value:e.site_title,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_title",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Tagline","strakture"),value:e.site_tagline,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_tagline",e)}),(0,i.jsx)(M.TextControl,{label:(0,h.__)("Site Type","strakture"),value:e.site_type,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>t("site_type",e),placeholder:(0,h.__)("e.g., Photography Portfolio, Restaurant","strakture"),help:(0,h.__)("Describe your site. This helps generate better AI patterns.","strakture")})]}),(0,i.jsx)(O,{})]})}const T=window.ReactDOM,z=window.straktureOnboardingData||{};function I({refreshKey:e=0}){const t=(0,r.useRef)(null),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)({}),[l,c]=(0,r.useState)(!1),d=`${z.homeUrl}?strakture_preview=${e}`;return(0,r.useLayoutEffect)(()=>{const e=()=>{if(!t.current||!a)return;const e=a.clientWidth/1600;o({width:1600,height:a.clientHeight/e,transform:`scale(${e})`,transformOrigin:"top left"})};e();const r=new ResizeObserver(()=>{(0,T.flushSync)(()=>{e()})});return a&&r.observe(a),()=>r.disconnect()},[a]),(0,r.useLayoutEffect)(()=>{c(!1)},[e]),(0,i.jsxs)("div",{className:"strakture-onboarding__preview",children:[(0,i.jsx)("div",{className:"strakture-onboarding__preview-browser",children:(0,i.jsxs)("div",{className:"strakture-onboarding__preview-dots",children:[(0,i.jsx)("span",{}),(0,i.jsx)("span",{}),(0,i.jsx)("span",{})]})}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-container",ref:n,children:(0,i.jsx)("iframe",{title:"Site Preview",style:s,className:"strakture-onboarding__preview-iframe"+(l?" is-loaded":""),onLoad:()=>c(!0),src:d,ref:t})})]})}const E=(window.straktureOnboardingData||{}).colorPalettes||[],D=["primary","secondary","headings","background"];function R(e){const t={};return e.forEach(e=>{t[e.slug]=e}),D.map(e=>t[e]).filter(Boolean)}function F(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={color_palette:e.id,color_palette_file:e.file||""};t("color_palette",e.id),t("color_palette_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__colors",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Color Palette","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a color palette for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__palette-list",children:[E.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__palette-card"+(e.color_palette===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__palette-title",children:t.title}),(0,i.jsx)("span",{className:"strakture-onboarding__palette-colors",children:R(t.colors).map((e,t)=>(0,i.jsx)(M.ColorIndicator,{colorValue:e.color},t))})]},t.id)),0===E.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No color palettes found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}const A=(window.straktureOnboardingData||{}).fontPresets||[];function L(){const{settings:e,updateSetting:t,saveSettings:a}=u(),[n,s]=(0,r.useState)(0),o=(0,r.useCallback)(async e=>{const r={typography_preset:e.id,typography_preset_file:e.file||""};t("typography_preset",e.id),t("typography_preset_file",e.file||""),await a(r),s(e=>e+1)},[t,a]);return(0,i.jsxs)("div",{className:"strakture-onboarding__typography",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__secondary-sidebar-body",children:[(0,i.jsx)("h2",{children:(0,h.__)("Typography","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a font combination for your site.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__font-list",children:[A.map(t=>(0,i.jsxs)("button",{className:"strakture-onboarding__font-card"+(e.typography_preset===t.id?" is-selected":""),onClick:()=>o(t),children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-preview",children:"Aa"}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-info",children:[(0,i.jsx)("span",{className:"strakture-onboarding__font-title",children:t.title}),(0,i.jsxs)("span",{className:"strakture-onboarding__font-names",children:[t.headingFont,t.bodyFont&&t.bodyFont!==t.headingFont?` / ${t.bodyFont}`:""]})]})]},t.id)),0===A.length&&(0,i.jsx)("p",{className:"strakture-onboarding__no-options",children:(0,h.__)("No font presets found in your theme.","strakture")})]})]}),(0,i.jsx)(O,{})]}),(0,i.jsx)("div",{className:"strakture-onboarding__preview-area",children:(0,i.jsx)(I,{refreshKey:n})})]})}var V=(0,i.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(f.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const U=window.straktureOnboardingData||{},H=U.starterSites||[];var G=a(359),W=a.n(G);const Z=window.straktureOnboardingData||{},Y={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0,zIndex:999};function q(){const{completeOnboarding:e}=u();(0,r.useEffect)(()=>{e()},[e]);const t=(0,r.useCallback)(({confetti:e})=>{e({particleCount:150,spread:80,origin:{y:.6}})},[]);return(0,i.jsxs)("div",{className:"strakture-onboarding__finish",children:[(0,i.jsx)(W(),{onInit:t,style:Y}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-content",children:[(0,i.jsx)("h1",{children:(0,h.__)("Setup Complete!","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Your site is configured and ready to go. Start editing your homepage or view your site to see the changes.","strakture")}),(0,i.jsxs)("div",{className:"strakture-onboarding__finish-actions",children:[(0,i.jsx)(M.Button,{variant:"primary",href:Z.homeUrl,target:"_blank",children:(0,h.__)("View Your Site","strakture")}),(0,i.jsx)(M.Button,{variant:"secondary",href:Z.adminUrl+"site-editor.php?p=%2Ftemplate",children:(0,h.__)("Start Editing","strakture")})]})]})]})}const X=(window.straktureOnboardingData||{}).isPaying?[C,B,F,L,function(){const[e,t]=(0,r.useState)(H),[a,n]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),l=(0,r.useCallback)(async(e,t)=>{const a=new FormData;return a.append("action",e),a.append("wpnonce",U.starterSitesNonce),a.append("slug",t),(await fetch(U.ajaxUrl,{method:"POST",body:a})).json()},[]),c=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_activate_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,status:r.data.status,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]),d=(0,r.useCallback)(async(e,a)=>{n(e.slug),o(null);try{const r=await l("strakture_update_child_theme",e.slug);r.success?(o({type:"success",message:r.data.message}),t(e=>e.map((e,t)=>t===a?{...e,needsUpdate:!1}:e))):o({type:"error",message:r.data?.message||(0,h.__)("Something went wrong.","strakture")})}catch{o({type:"error",message:(0,h.__)("Request failed.","strakture")})}finally{n(null)}},[l]);return(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites",children:[(0,i.jsxs)("div",{className:"strakture-onboarding__starter-sites-header",children:[(0,i.jsx)("h2",{children:(0,h.__)("Starter Sites","strakture")}),(0,i.jsx)("p",{children:(0,h.__)("Choose a starter site to import. You can customize everything after the import.","strakture")})]}),s&&(0,i.jsx)("div",{className:`strakture-onboarding__starter-sites-notice is-${s.type}`,children:s.message}),(0,i.jsx)("div",{className:"strakture-onboarding__demos-grid",children:e.map((e,t)=>{const r=((e,t)=>{const r=a===e.slug;switch(e.status){case"active":return{label:(0,h.__)("Import","strakture"),href:e.merlin_url,onClick:null,icon:V,isBusy:!1};case"installed":return{label:r?(0,h.__)("Activating...","strakture"):(0,h.__)("Activate","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r};default:return{label:r?(0,h.__)("Installing...","strakture"):(0,h.__)("Install","strakture"),href:void 0,onClick:()=>c(e,t),icon:void 0,isBusy:r}}})(e,t),n=a===e.slug;return(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card",children:[e.needsUpdate&&(0,i.jsx)("div",{className:"strakture-onboarding__demo-card-update",children:(0,i.jsx)(M.Button,{variant:"link",onClick:()=>d(e,t),disabled:null!==a,isBusy:n,className:"strakture-onboarding__demo-card-update-btn",children:n?(0,h.__)("Updating...","strakture"):(0,h.__)("Update Available — Update Now","strakture")})}),(0,i.jsxs)("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer",className:"strakture-onboarding__demo-card-image-link",children:[(0,i.jsx)("img",{src:e.import_preview_image_url,alt:e.import_file_name,className:"strakture-onboarding__demo-card-image"}),(0,i.jsx)("span",{className:"strakture-onboarding__demo-card-badge",children:(0,h.__)("Live Preview","strakture")})]}),(0,i.jsxs)("div",{className:"strakture-onboarding__demo-card-body",children:[(0,i.jsx)("h3",{className:"strakture-onboarding__demo-card-title",children:e.import_file_name}),(0,i.jsx)(M.Button,{variant:"primary",icon:r.icon,href:r.href,onClick:r.onClick,isBusy:r.isBusy,disabled:null!==a,className:"strakture-onboarding__demo-card-btn",children:r.label})]})]},t)})})]})},q]:[C,B,F,L,q];function $(){const{currentStep:e}=u(),t=X[e];return(0,i.jsx)("div",{className:"strakture-onboarding",children:(0,i.jsxs)("div",{className:"strakture-onboarding__layout",children:[(0,i.jsx)(j,{}),(0,i.jsx)("div",{className:"strakture-onboarding__main",children:(0,i.jsx)("div",{className:"strakture-onboarding__content",children:(0,i.jsx)(t,{})})})]})})}const K=document.getElementById("strakture-onboarding");K&&(0,r.createRoot)(K).render((0,i.jsx)(d,{children:(0,i.jsx)($,{})}))})(); -
strakture/trunk/readme.txt
r3499596 r3509467 5 5 Requires at least: 6.5 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 14 14 == Description == 15 15 16 https://www.youtube.com/watch?v= 7H7_pUUCxys16 https://www.youtube.com/watch?v=rdpsa8vtLEM 17 17 18 18 Strakture is an AI-powered WordPress block pattern library that generates layouts matched to your theme's actual design system — and to your site's content. Unlike generic pattern libraries that give you patterns you have to restyle and rewrite from scratch, Strakture reads your theme's CSS variables and understands what your site is about, then creates patterns that look native and feel relevant from the first click. … … 230 230 == Changelog == 231 231 232 = 1.1.5 - April 18, 2026 = 233 - Fixed: Site Type now stays in sync between the pattern library modal, Site Settings, and generated patterns 234 - Fixed: Updating Site Type in the modal no longer refreshes the pattern grid while browsing 235 - Fixed: Premium auth now refreshes automatically so pattern generation keeps working after the editor stays open for longer periods 236 232 237 = 1.1.4 - April 6, 2026 = 233 238 - New: Minimal starter site demo -
strakture/trunk/strakture.php
r3499596 r3509467 6 6 * Author: Aleksandr Samokhin 7 7 * Author URI: https://aleksandrsamokhin.com 8 * Version: 1.1. 48 * Version: 1.1.5 9 9 * Requires at least: 6.5 10 10 * Requires PHP: 7.0 -
strakture/trunk/vendor/composer/autoload_classmap.php
r3486136 r3509467 22 22 'Strakture\\Shared\\Admin' => $baseDir . '/app/Shared/Admin.php', 23 23 'Strakture\\Shared\\Controllers\\ActivityController' => $baseDir . '/app/Shared/Controllers/ActivityController.php', 24 'Strakture\\Shared\\Controllers\\AuthTokenController' => $baseDir . '/app/Shared/Controllers/AuthTokenController.php', 24 25 'Strakture\\Shared\\Controllers\\CreditsController' => $baseDir . '/app/Shared/Controllers/CreditsController.php', 25 26 'Strakture\\Shared\\Controllers\\ImageController' => $baseDir . '/app/Shared/Controllers/ImageController.php', … … 27 28 'Strakture\\Shared\\Services\\FreemiusAuth' => $baseDir . '/app/Shared/Services/FreemiusAuth.php', 28 29 'Strakture\\Shared\\Services\\Sanitizer' => $baseDir . '/app/Shared/Services/Sanitizer.php', 30 'Strakture\\Shared\\Services\\SiteTypeSync' => $baseDir . '/app/Shared/Services/SiteTypeSync.php', 29 31 'Strakture\\StarterSites\\ChildThemeVersions' => $baseDir . '/app/StarterSites/ChildThemeVersions.php', 30 32 'Strakture\\StarterSites\\MerlinPluginThemeStub' => $baseDir . '/app/StarterSites/MerlinPluginThemeStub.php', -
strakture/trunk/vendor/composer/autoload_static.php
r3486136 r3509467 41 41 'Strakture\\Shared\\Admin' => __DIR__ . '/../..' . '/app/Shared/Admin.php', 42 42 'Strakture\\Shared\\Controllers\\ActivityController' => __DIR__ . '/../..' . '/app/Shared/Controllers/ActivityController.php', 43 'Strakture\\Shared\\Controllers\\AuthTokenController' => __DIR__ . '/../..' . '/app/Shared/Controllers/AuthTokenController.php', 43 44 'Strakture\\Shared\\Controllers\\CreditsController' => __DIR__ . '/../..' . '/app/Shared/Controllers/CreditsController.php', 44 45 'Strakture\\Shared\\Controllers\\ImageController' => __DIR__ . '/../..' . '/app/Shared/Controllers/ImageController.php', … … 46 47 'Strakture\\Shared\\Services\\FreemiusAuth' => __DIR__ . '/../..' . '/app/Shared/Services/FreemiusAuth.php', 47 48 'Strakture\\Shared\\Services\\Sanitizer' => __DIR__ . '/../..' . '/app/Shared/Services/Sanitizer.php', 49 'Strakture\\Shared\\Services\\SiteTypeSync' => __DIR__ . '/../..' . '/app/Shared/Services/SiteTypeSync.php', 48 50 'Strakture\\StarterSites\\ChildThemeVersions' => __DIR__ . '/../..' . '/app/StarterSites/ChildThemeVersions.php', 49 51 'Strakture\\StarterSites\\MerlinPluginThemeStub' => __DIR__ . '/../..' . '/app/StarterSites/MerlinPluginThemeStub.php', -
strakture/trunk/vendor/composer/installed.php
r3499596 r3509467 2 2 'root' => array( 3 3 'name' => 'strakture/strakture', 4 'pretty_version' => '1.1. 4',5 'version' => '1.1. 4.0',6 'reference' => ' b053fea5c943b4b92169a7197148abe3eee22a74',4 'pretty_version' => '1.1.5', 5 'version' => '1.1.5.0', 6 'reference' => '0b6fd6e7598bb15fe60228cfa107f9d9d6269c80', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'strakture/strakture' => array( 23 'pretty_version' => '1.1. 4',24 'version' => '1.1. 4.0',25 'reference' => ' b053fea5c943b4b92169a7197148abe3eee22a74',23 'pretty_version' => '1.1.5', 24 'version' => '1.1.5.0', 25 'reference' => '0b6fd6e7598bb15fe60228cfa107f9d9d6269c80', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../',
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)