PageSourceSearch

https://www.ccfc-france-canada.com/_nuxt/MDKMuVOy.js

js ccfc-france-canada.com collected 2026-10-02 11:54:11 UTC 1,108,531 bytes, 2,389 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./icC-XkrA.js","./cC1siokt.js","./DhOnfbhC.js","./entry.zjzmjSB7.css","./C8j9ZZhS.js"])))=>i.map(i=>d[i]);
2import{bh as Ml,d as Vv,b4 as Xv,be as Zv,bq as Yv,x as Dl}from"./DhOnfbhC.js";function Ea(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function Tl(e,t,n,o,i,r,a){try{var s=e[r](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(o,i)}function Au(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var r=e.apply(t,n);function a(l){Tl(r,o,i,a,s,"next",l)}function s(l){Tl(r,o,i,a,s,"throw",l)}a(void 0)})}}function Pu(e,t,n){return t=nr(t),(function(o,i){if(i&&(typeof i=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r})(o)})(e,Du()?Reflect.construct(t,n||[],nr(e).constructor):t.apply(e,n))}function ys(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bs(e,t,n){return t&&(function(o,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,Tu(a.key),a)}})(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dt(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ws(e))||t){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return a=l.done,l},e:function(l){s=!0,r=l},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw r}}}}function ee(e,t,n){return(t=Tu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nr(e)}function Mu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&za(e,t)}function Du(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Du=function(){return!!e})()}function Rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rl(Object(n),!0).forEach(function(o){ee(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rl(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Cr(e,t){if(e==null)return{};var n,o,i=(function(a,s){if(a==null)return{};var l={};for(var c in a)if({}.hasOwnProperty.call(a,c)){if(s.indexOf(c)!==-1)continue;l[c]=a[c]}return l})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ei(){var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function r(g,p,f,v){var y=p&&p.prototype instanceof s?p:s,b=Object.create(y.prototype);return Mt(b,"_invoke",(function(w,x,C){var I,S,P,A=0,D=C||[],R=!1,M={p:0,n:0,v:e,a:N,f:N.bind(e,4),d:function(z,_){return I=z,S=0,P=e,M.n=_,a}};function N(z,_){for(S=z,P=_,t=0;!R&&A&&!L&&t<D.length;t++){var L,j=D[t],E=M.p,F=j[2];z>
33?(L=F===_)&&(P=j[(S=j[4])?5:(S=3,3)],j[4]=j[5]=e):j[0]<=E&&((L=z<2&&E<j[1])?(S=0,M.v=_,M.n=j[1]):E<F&&(L=z<3||j[0]>_||_>F)&&(j[4]=z,j[5]=_,M.n=F,S=0))}if(L||z>1)return a;throw R=!0,_}return function(z,_,L){if(A>1)throw TypeError("Generator is already running");for(R&&_===1&&N(_,L),S=_,P=L;(t=S<2?e:P)||!R;){I||(S?S<3?(S>1&&(M.n=-1),N(S,P)):M.n=P:M.v=P);try{if(A=2,I){if(S||(z="next"),t=I[z]){if(!(t=t.call(I,P)))throw TypeError("iterator result is not an object");if(!t.done)return t;P=t.value,S<2&&(S=0)}else S===1&&(t=I.return)&&t.call(I),S<2&&(P=TypeError("The iterator does not provide a '"+z+"' method"),S=1);I=e}else if((t=(R=M.n<0)?P:w.call(x,M))!==a)break}catch(j){I=e,S=1,P=j}finally{A=1}}return{value:t,done:R}}})(g,f,v),!0),b}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(Mt(t={},o,function(){return this}),t),u=c.prototype=s.prototype=Object.create(d);function m(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,c):(g.__proto__=c,Mt(g,i,"GeneratorFunction")),g.prototype=Object.create(u),g}return l.prototype=c,Mt(u,"constructor",c),Mt(c,"constructor",l),l.displayName="GeneratorFunction",Mt(c,i,"GeneratorFunction"),Mt(u),Mt(u,i,"Generator"),Mt(u,o,function(){return this}),Mt(u,"toString",function(){return"[object Generator]"}),(ei=function(){return{w:r,m}})()}function Mt(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Mt=function(r,a,s,l){function c(d,u){Mt(r,d,function(m){return this._invoke(d,u,m)})}a?i?i(r,a,{value:s,enumerable:!l,configurable:!l,writable:!l}):r[a]=s:(c("next",0),c("throw",1),c("return",2))},Mt(e,t,n,o)}function za(e,t){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},za(e,t)}function q(e,t){return(function(n){if(Array.isArray(n))return n})(e)||(function(n,o){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var r,a,s,l,c=[],d=!0,u=!1;try{if(s=(i=i.call(n)).next,o!==0)for(;!(d=(r=s.call(i)).done)&&(c.push(r.value),c.length!==o);d=!0);}catch(m){u=!0,a=m}finally{try{if(!d&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(u)throw a}}return c}})(e,t)||ws(e,t)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Eo(e){return(function(t){if(Array.isArray(t))return Ea(t)})(e)||(function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)})(e)||ws(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Tu(e){var t=(function(n,o){if(typeof n!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,o);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)})(e,"string");return typeof t=="symbol"?t:t+""}function Yn(e){return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function ws(e,t){if(e){if(typeof e=="string")return Ea(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ea(e,t):void 0}}var Ir,Ce,Ru,Gn,El,Eu,zu,Lu,xs,La,Na,Nu,ti={},Ou=[],Qv=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pi=Array.isArray;function bn(e,t){for(var n in t)e[n]=t[n];return e}function ks(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function h(e,t,n){var o,i,r,a={};for(r in t)r=="key"?o=t[r]:r=="ref"?i=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?Ir.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)a[r]===void 0&&(a[r]=e.defaultProps[r]);return Xi(e,a,o,i,null)}function Xi(e,t,n,o,i){var r={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ru,__i:-1,__u:0};
vendor: 1,237 bytes, line 5
5return i==null&&Ce.vnode!=null&&Ce.vnode(r),r}function de(e){return e.children}function Jt(e,t){this.props=e,this.context=t}function Ao(e,t){if(t==null)return e.__?Ao(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Ao(e):null}function Fu(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Fu(e)}}function Oa(e){(!e.__d&&(e.__d=!0)&&Gn.push(e)&&!or.__r++||El!=Ce.debounceRendering)&&((El=Ce.debounceRendering)||Eu)(or)}function or(){for(var e,t,n,o,i,r,a,s=1;Gn.length;)Gn.length>s&&Gn.sort(zu),e=Gn.shift(),s=Gn.length,e.__d&&(n=void 0,o=void 0,i=(o=(t=e).__v).__e,r=[],a=[],t.__P&&((n=bn({},o)).__v=o.__v+1,Ce.vnode&&Ce.vnode(n),Cs(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[i]:null,r,i??Ao(o),!!(32&o.__u),a),n.__v=o.__v,n.__.__k[n.__i]=n,ju(r,n,a),o.__e=o.__=null,n.__e!=i&&Fu(n)));or.__r=0}function _u(e,t,n,o,i,r,a,s,l,c,d){var u,m,g,p,f,v,y,b=o&&o.__k||Ou,w=t.length;for(l=(function(x,C,I,S,P){var A,D,R,M,N,z=I.length,_=z,L=0;for(x.__k=new Array(P),A=0;A<P;A++)(D=C[A])!=null&&typeof D!="boolean"&&typeof D!="function"?(typeof D=="str
5ing"||typeof D=="number"||typeof D=="bigint"||D.constructor==String?D=x.__k[A]=Xi(null,D,null,null,null):pi(D)?D=x.__k[A]=Xi(de,{children:D},null,null,null):D.constructor===void 0&&D.__b>0?D=x.__k[A]=Xi(D.type,D.props,D.key,D.ref?D.ref:null,D.__v):x.__k[A]=D,M=A+L,D.__=x,D.__b=x.__b+1,R=null,(N=D.__i=Jv(D,I,M,_))!=-1&&(_--,(R=I[N])&&(R.__u|=2)),R==null||R.__v==null?(N==-1&&(P>z?L--:P<z&&L++),typeof D.type!="function"&&(D.__u|=4)):N!=M&&(N==M-1?L--:N==M+1?L++:(N>M?L--:L++,D.__u|=4))):x.__k[A]=null;if(_)for(A=0;A<z;A++)(R=I[A])!=null&&!(2&R.__u)&&(R.__e==S&&(S=Ao(R)),Bu(R,R));return S})(n,t,b,l,w),u=0;u<w;u++)(g=n.__k[u])!=null&&(m=g.__i==-1?ti:b[g.__i]||ti,g.__i=u,v=Cs(e,g,m,i,r,a,s,l,c,d),p=g.__e,g.ref&&m.ref!=g.ref&&(m.ref&&Is(m.ref,null,g),d.push(g.ref,g.__c||p,g)),f==null&&p!=null&&(f=p),(y=!!(4&g.__u))||m.__k===g.__k?l=$u(g,l,e,y):typeof g.type=="function"&&v!==void 0?l=v:p&&(l=p.nextSibling),g.__u&=-7);return n.__e=f,l}function $u(e,t,n,o){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=$u(i[r],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Ao(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ir(e,t){return t=t||[],e==null||typeof e=="boolean"||(pi(e)?e.some(function(n){ir(n,t)}):t.push(e)),t}function Jv(e,t,n,o){var i,r,a,s=e.key,l=e.type,c=t[n],d=c!=null&&!(2&c.__u);if(c===null&&s==null||d&&s==c.key&&l==c.type)return n;if(o>(d?1:0)){for(i=n-1,r=n+1;i>=0||r<t.length;)if((c=t[a=i>=0?i--:r++])!=null&&!(2&c.__u)&&s==c.key&&l==c.type)return a}return-1}function zl(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Qv.test(t)?n:n+"px"}function Pi(e,t,n,o,i){var r,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||zl(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||zl(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Lu,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=xs,e.addEventListener(t,r?Na:La,r)):e.removeEventListener(t,r?Na:La,r);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ll(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=xs++;else if(t.t<n.u)return;return n(Ce.event?Ce.event(t):t)}}}function Cs(e,t,n,o,i,r,a,s,l,c){var d,u,m,g,p,f,v,y,b,w,x,C,I,S,P,A,D,R=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),r=[s=t.__e=n.__e]),(d=Ce.__b)&&d(t);e:if(typeof R=="function")try{if(y=t.props,b="prototype"in R&&R.prototype.render,w=(d=R.contextType)&&o[d.__c],x=d?w?w.props.value:d.__:o,n.__c?v=(u=t.__c=n.__c).__=u.__E:(b?t.__c=u=new R(y,x):(t.__c=u=new Jt(y,x),u.constructor=R,u.render=ty),w&&w.sub(u),u.state||(u.state={}),u.__n=o,m=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&R.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=bn({},u.__s)),bn(u.__s,R.getDerivedStateFromProps(y,u.__s))),g=u.props,p=u.state,u.__v=t,m)b&&R.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&R.getDerivedStateFromProps==null&&y!==g&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(y,x),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(y,u.__s,x)===!1){for(t.__v!=n.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(M){M&&(M.__=t)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(y,u.__s,x),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(g,p,f)})}if(u.context=x,u.props=y,u.__P=e,u.__e=!1,I=Ce.__r,S=0,b){for(u.state=u.__s,u.__d=!1,I&&I(t),d=u.render(u.props,u.state,u.context),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[]}else do u.__d=!1,I&&I(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++S<25);u.state=u.__s,u.getChildContext!=null&&(o=bn(bn({},o),u.getChildContext())),b&&!m&&u.getSnapshotBeforeUpdate!=null&&(f=u.getSnapshotBeforeUpdate(g,p)),A=d,d!=null&&d.type===de&&d.key==null&&(A=Uu(d.props.children)),s=_u(e,pi(A)?A:[A],t,n,o,i,r,a,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),v&&(u.__E=u.__=null)}
vendor: 4,224 bytes, line 5
5catch(M){if(t.__v=null,l||r!=null)if(M.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,t.__e=s}else{for(D=r.length;D--;)ks(r[D]);Fa(t)}else t.__e=n.__e,t.__k=n.__k,M.then||Fa(t);Ce.__e(M,t,n)}else r==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ey(n.__e,t,n,o,i,r,a,l,c);return(d=Ce.diffed)&&d(t),128&t.__u?void 0:s}function Fa(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Fa)}function ju(e,t,n){for(var o=0;o<n.length;o++)Is(n[o],n[++o],n[++o]);Ce.__c&&Ce.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(r){r.call(i)})}catch(r){Ce.__e(r,i.__v)}})}function Uu(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:pi(e)?e.map(Uu):bn({},e)}function ey(e,t,n,o,i,r,a,s,l){var c,d,u,m,g,p,f,v=n.props||ti,y=t.props,b=t.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((g=r[c])&&"setAttribute"in g==!!b&&(b?g.localName==b:g.nodeType==3)){e=g,r[c]=null;break}}if(e==null){if(b==null)return document.createTextNode(y);e=document.createElementNS(i,b,y.is&&y),s&&(Ce.__m&&Ce.__m(t,r),s=!1),r=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(r=r&&Ir.call(e.childNodes),!s&&r!=null)for(v={},c=0;c<e.attributes.length;c++)v[(g=e.attributes[c]).name]=g.value;for(c in v)if(g=v[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=g;else if(!(c in y)){if(c=="value"&&"defaultValue"in y||c=="checked"&&"defaultChecked"in y)continue;Pi(e,c,null,g,i)}}for(c in y)g=y[c],c=="children"?m=g:c=="dangerouslySetInnerHTML"?d=g:c=="value"?p=g:c=="checked"?f=g:s&&typeof g!="function"||v[c]===g||Pi(e,c,g,v[c],i);if(d)s||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),_u(t.type=="template"?e.content:e,pi(m)?m:[m],t,n,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,a,r?r[0]:n.__k&&Ao(n,0),s,l),r!=null)for(c=r.length;c--;)ks(r[c]);s||(c="value",b=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[c]||b=="progress"&&!p||b=="option"&&p!=v[c])&&Pi(e,c,p,v[c],i),c="checked",f!=null&&f!=e[c]&&Pi(e,c,f,v[c],i))}return e}function Is(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){Ce.__e(i,n)}}function Bu(e,t,n){var o,i;if(Ce.unmount&&Ce.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Is(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){Ce.__e(r,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Bu(o[i],t,n||typeof e.type!="function");n||ks(e.__e),e.__c=e.__=e.__e=void 0}function ty(e,t,n){return this.constructor(e,n)}function rr(e,t,n){var o,i,r;t==document&&(t=document.documentElement),Ce.__&&Ce.__(e,t),o=t.__k,i=[],r=[],Cs(t,e=t.__k=h(de,null,[e]),o||ti,ti,t.namespaceURI,o?null:t.firstChild?Ir.call(t.childNodes):null,i,o?o.__e:t.firstChild,!1,r),ju(i,e,r)}function rn(e){function t(n){var o,i;return this.getChildContext||(o=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(r){this.props.value!=r.value&&o.forEach(function(a){a.__e=!0,Oa(a)})},this.sub=function(r){o.add(r);var a=r.componentWillUnmount;r.componentWillUnmount=function(){o&&o.delete(r),a&&a.call(r)}}),n.children}return t.__c="__cC"+Nu++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}Ir=Ou.slice,Ce={__e:function(e,t,n,o){for(var i,r,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Ru=0,Jt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=bn({},this.state),typeof e=="function"&&(e=e(bn({},n),this.props)),e&&bn(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Oa(this))},Jt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Oa(this))},Jt.prototype.render=de,Gn=[],Eu=typeof Promise=="function"?Promise.prototype.then.bind(Prom
vendor: 4,165 bytes, lines 5-27
5ise.resolve()):setTimeout,zu=function(e,t){return e.__v.__b-t.__v.__b},or.__r=0,Lu=/(PointerCapture)$|Capture$/i,xs=0,La=Ll(!1),Na=Ll(!0),Nu=0;var Qn,qe,ia,Nl,ni=0,Wu=[],Qe=Ce,Ol=Qe.__b,Fl=Qe.__r,_l=Qe.diffed,$l=Qe.__c,jl=Qe.unmount,Ul=Qe.__;function gi(e,t){Qe.__h&&Qe.__h(qe,e,ni||t),ni=0;var n=qe.__H||(qe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return ni=1,Hu(Gu,e)}function Hu(e,t,n){var o=gi(Qn++,2);if(o.t=e,!o.__c&&(o.__=[Gu(void 0,t),function(s){var l=o.__N?o.__N[0]:o.__[0],c=o.t(l,s);l!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=qe,!qe.__f)){var i=function(s,l,c){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!r||r.call(this,s,l,c);var u=o.__c.props!==s;return d.forEach(function(m){if(m.__N){var g=m.__[0];m.__=m.__N,m.__N=void 0,g!==m.__[0]&&(u=!0)}}),r&&r.call(this,s,l,c)||u};qe.__f=!0;var r=qe.shouldComponentUpdate,a=qe.componentWillUpdate;qe.componentWillUpdate=function(s,l,c){if(this.__e){var d=r;r=void 0,i(s,l,c),r=d}a&&a.call(this,s,l,c)},qe.shouldComponentUpdate=i}return o.__N||o.__}function $(e,t){var n=gi(Qn++,3);!Qe.__s&&As(n.__H,t)&&(n.__=e,n.u=t,qe.__H.__h.push(n))}function Ss(e,t){var n=gi(Qn++,4);!Qe.__s&&As(n.__H,t)&&(n.__=e,n.u=t,qe.__h.push(n))}function K(e){return ni=5,Z(function(){return{current:e}},[])}function Z(e,t){var n=gi(Qn++,7);return As(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function W(e,t){return ni=8,Z(function(){return e},t)}function an(e){var t=qe.context[e.__c],n=gi(Qn++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(qe)),t.props.value):e.__}function ny(){for(var e;e=Wu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Zi),e.__H.__h.forEach(_a),e.__H.__h=[]}catch(t){e.__H.__h=[],Qe.__e(t,e.__v)}}Qe.__b=function(e){qe=null,Ol&&Ol(e)},Qe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ul&&Ul(e,t)},Qe.__r=function(e){Fl&&Fl(e),Qn=0;var t=(qe=e.__c).__H;t&&(ia===qe?(t.__h=[],qe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Zi),t.__h.forEach(_a),t.__h=[],Qn=0)),ia=qe},Qe.diffed=function(e){_l&&_l(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wu.push(t)!==1&&Nl===Qe.requestAnimationFrame||((Nl=Qe.requestAnimationFrame)||oy)(ny)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ia=qe=null},Qe.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Zi),n.__h=n.__h.filter(function(o){return!o.__||_a(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Qe.__e(o,n.__v)}}),$l&&$l(e,t)},Qe.unmount=function(e){jl&&jl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Zi(o)}catch(i){t=i}}),n.__H=void 0,t&&Qe.__e(t,n.__v))};var Bl=typeof requestAnimationFrame=="function";function oy(e){var t,n=function(){clearTimeout(o),Bl&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Bl&&(t=requestAnimationFrame(n))}function Zi(e){var t=qe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),qe=t}function _a(e){var t=qe;e.__c=e.__(),qe=t}function As(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Gu(e,t){return typeof t=="function"?t(e):t}var iy=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
6@layer properties;
7@layer theme, base, components, utilities;
8@layer theme {
9  :root, :host {
10    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
11      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
12    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
13      "Courier New", monospace;
14    --color-red-500: oklch(63.7% 0.237 25.331);
15    --color-red-600: oklch(57.7% 0.245 27.325);
16    --color-yellow-500: oklch(79.5% 0.184 86.047);
17    --color-green-500: oklch(72.3% 0.219 149.579);
18    --color-teal-500: oklch(70.4% 0.14 182.503);
19    --color-blue-500: oklch(62.3% 0.214 259.815);
20    --color-indigo-500: oklch(58.5% 0.233 277.117);
21    --color-purple-500: oklch(62.7% 0.265 303.9);
22    --color-pink-500: oklch(65.6% 0.241 354.308);
23    --color-gray-300: oklch(87.2% 0.01 258.338);
24    --color-white: #fff;
25    --spacing: 0.25rem;
26    --container-sm: 24rem;
27    --text-xs: 0.75rem;
28    --text-xs--line-height: calc(1 / 0.75);
29    --text-sm: 0.875rem;
30    --text-sm--line-height: calc(1.25 / 0.875);
31    --text-base: 1rem;
32    --text-base--line-height: calc(1.5 / 1);
33    --text-lg: 1.125rem;
34    --text-lg--line-height: calc(1.75 / 1.125);
35    --text-xl: 1.25rem;
36    --text-xl--line-height: calc(1.75 / 1.25);
37    --font-weight-medium: 500;
38    --font-weight-semibold: 600;
39    --font-weight-bold: 700;
40    --tracking-widest: 0.1em;
41    --leading-relaxed: 1.625;
42    --radius-md: 0.375rem;
43    --radius-lg: 0.5rem;
44    --radius-xl: 0.75rem;
45    --radius-2xl: 1rem;
46    --ease-out: cubic-bezier(0, 0, 0.2, 1);
47    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
48    --animate-spin: spin 1s linear infinite;
49    --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
50    --default-transition-duration: 150ms;
51    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
52    --default-font-family: var(--font-sans);
53    --default-mono-font-family: var(--font-mono);
54    --color-bg-app: var(--ep-background-app);
55    --color-bg-surface: var(--ep-background-surface);
56    --color-bg-surface-alt: var(--ep-background-surface-alt);
57    --color-bg-elevated: var(--ep-background-elevated);
58    --color-bg-overlay: var(--ep-background-overlay);
59    --color-bg-input: var(--ep-background-input);
60    --color-fg-primary: var(--ep-foreground-primary);
61    --color-fg-secondary: var(--ep-foreground-secondary);
62    --color-fg-muted: var(--ep-foreground-muted);
63    --color-fg-disabled: var(--ep-foreground-disabled);
64    --color-fg-on-accent: var(--ep-foreground-on-accent);
65    --color-border-default: var(--ep-border-default);
66    --color-border-subtle: var(--ep-border-subtle);
67    --color-border-strong: var(--ep-border-strong);
68    --color-accent: var(--ep-accent-primary);
69    --color-accent-hover: var(--ep-accent-primary-hover);
70    --color-accent-light: var(--ep-accent-primary-light);
71    --color-accent-fg: var(--ep-accent-primary-foreground);
72    --color-interactive-hover: var(--ep-interactive-hover);
73    --color-interactive-active: var(--ep-interactive-active);
74    --color-interactive-selected: var(--ep-interactive-selected);
75    --color-interactive-focus-ring: var(--ep-interactive-focus-ring);
76    --color-state-error: var(--ep-state-error);
77    --color-state-error-light: var(--ep-state-error-light);
78    --color-state-warning: var(--ep-state-warning);
79    --color-state-warning-light: var(--ep-state-warning-light);
80    --color-state-success: var(--ep-state-success);
81    --color-state-success-light: var(--ep-state-success-light);
82    --color-state-info-light: var(--ep-state-info-light);
83    --color-tooltip-bg: var(--ep-tooltip-background);
84    --color-tooltip-fg: var(--ep-tooltip-foreground);
85  }
86}
87@layer base {
88  *, ::after, ::before, ::backdrop, ::file-selector-button {
89    box-sizing: border-box;
90    margin: 0;
91    padding: 0;
92    border: 0 solid;
93  }
94  html, :host {
95    line-height: 1.5;
96    -webkit-text-size-adjust: 100%;
97    -moz-tab-size: 4;
98      -o-tab-size: 4;
99         tab-size: 4;
100    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
101    font-feature-settings: var(--default-font-feature-settings, normal);
102    font-variation-settings: var(--default-font-variation-settings, normal);
103    -webkit-tap-highlight-color: transparent;
104  }
105  hr {
106    height: 0;
107    color: inherit;
108    border-top-width: 1px;
109  }
110  abbr:where([title]) {
111    -webkit-text-decoration: underline dotted;
112    text-decoration: underline dotted;
113  }
114  h1, h2, h3, h4, h5, h6 {
115    font-size: inherit;
116    font-weight: inherit;
117  }
118  a {
119    color: inherit;
120    -webkit-text-decoration: inherit;
121    text-decoration: inherit;
122  }
123  b, strong {
124    font-weight: bolder;
125  }
126  code, kbd, samp, pre {
127    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
128    font-feature-settings: var(--default-mono-font-feature-settings, normal);
129    font-variation-settings: var(--default-mono-font-variation-settings, normal);
130    font-size: 1em;
131  }
132  small {
133    font-size: 80%;
134  }
135  sub, sup {
136    font-size: 75%;
137    line-height: 0;
138    position: relative;
139    vertical-align: baseline;
140  }
141  sub {
142    bottom: -0.25em;
143  }
144  sup {
145    top: -0.5em;
146  }
147  table {
148    text-indent: 0;
149    border-color: inherit;
150    border-collapse: collapse;
151  }
152  :-moz-focusring {
153    outline: auto;
154  }
155  progress {
156    vertical-align: baseline;
157  }
158  summary {
159    display: list-item;
160  }
161  ol, ul, menu {
162    list-style: none;
163  }
164  img, svg, video, canvas, audio, iframe, embed, object {
165    display: block;
166    vertical-align: middle;
167  }
168  img, video {
169    max-width: 100%;
170    height: auto;
171  }
172  button, input, select, optgroup, textarea, ::file-selector-button {
173    font: inherit;
174    font-feature-settings: inherit;
175    font-variation-settings: inherit;
176    letter-spacing: inherit;
177    color: inherit;
178    border-radius: 0;
179    background-color: transparent;
180    opacity: 1;
181  }
182  :where(select:is([multiple], [size])) optgroup {
183    font-weight: bolder;
184  }
185  :where(select:is([multiple], [size])) optgroup option {
186    padding-inline-start: 20px;
187  }
188  ::file-selector-button {
189    margin-inline-end: 4px;
190  }
191  ::-moz-placeholder {
192    opacity: 1;
193  }
194  ::placeholder {
195    opacity: 1;
196  }
197  @supports (not (-webkit-appearance: -apple-pay-button))  or (contain-intrinsic-size: 1px) {
198    ::-moz-placeholder {
199      color: currentcolor;
200      @supports (color: color-mix(in lab, red, red)) {
201        color: color-mix(in oklab, currentcolor 50%, transparent);
202      }
203    }
204    ::placeholder {
205      color: currentcolor;
206      @supports (color: color-mix(in lab, red, red)) {
207        color: color-mix(in oklab, currentcolor 50%, transparent);
208      }
209    }
210  }
211  textarea {
212    resize: vertical;
213  }
214  ::-webkit-search-decoration {
215    -webkit-appearance: none;
216  }
217  ::-webkit-date-and-time-value {
218    min-height: 1lh;
219    text-align: inherit;
220  }
221  ::-webkit-datetime-edit {
222    display: inline-flex;
223  }
224  ::-webkit-datetime-edit-fields-wrapper {
225    padding: 0;
226  }
227  ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-d
227ay-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
228    padding-block: 0;
229  }
230  ::-webkit-calendar-picker-indicator {
231    line-height: 1;
232  }
233  :-moz-ui-invalid {
234    box-shadow: none;
235  }
236  button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
237    -webkit-appearance: button;
238       -moz-appearance: button;
239            appearance: button;
240  }
241  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
242    height: auto;
243  }
244  [hidden]:where(:not([hidden="until-found"])) {
245    display: none !important;
246  }
247}
248@layer utilities {
249  .pointer-events-auto {
250    pointer-events: auto;
251  }
252  .pointer-events-none {
253    pointer-events: none;
254  }
255  .invisible {
256    visibility: hidden;
257  }
258  .visible {
259    visibility: visible;
260  }
261  .absolute {
262    position: absolute;
263  }
264  .fixed {
265    position: fixed;
266  }
267  .relative {
268    position: relative;
269  }
270  .static {
271    position: static;
272  }
273  .sticky {
274    position: sticky;
275  }
276  .inset-0 {
277    inset: calc(var(--spacing) * 0);
278  }
279  .inset-x-0 {
280    inset-inline: calc(var(--spacing) * 0);
281  }
282  .inset-y-0 {
283    inset-block: calc(var(--spacing) * 0);
284  }
285  .top-0 {
286    top: calc(var(--spacing) * 0);
287  }
288  .top-1 {
289    top: calc(var(--spacing) * 1);
290  }
291  .top-1\\/2 {
292    top: calc(1/2 * 100%);
293  }
294  .top-4 {
295    top: calc(var(--spacing) * 4);
296  }
297  .top-6 {
298    top: calc(var(--spacing) * 6);
299  }
300  .right-0 {
301    right: calc(var(--spacing) * 0);
302  }
303  .right-1 {
304    right: calc(var(--spacing) * 1);
305  }
306  .right-2 {
307    right: calc(var(--spacing) * 2);
308  }
309  .right-4 {
310    right: calc(var(--spacing) * 4);
311  }
312  .bottom-0 {
313    bottom: calc(var(--spacing) * 0);
314  }
315  .left-0 {
316    left: calc(var(--spacing) * 0);
317  }
318  .left-1\\/2 {
319    left: calc(1/2 * 100%);
320  }
321  .z-3 {
322    z-index: 3;
323  }
324  .z-10 {
325    z-index: 10;
326  }
327  .z-40 {
328    z-index: 40;
329  }
330  .z-50 {
331    z-index: 50;
332  }
333  .z-100 {
334    z-index: 100;
335  }
336  .col-start-1 {
337    grid-column-start: 1;
338  }
339  .row-start-1 {
340    grid-row-start: 1;
341  }
342  .container {
343    width: 100%;
344    @media (width >= 40rem) {
345      max-width: 40rem;
346    }
347    @media (width >= 48rem) {
348      max-width: 48rem;
349    }
350    @media (width >= 64rem) {
351      max-width: 64rem;
352    }
353    @media (width >= 80rem) {
354      max-width: 80rem;
355    }
356    @media (width >= 96rem) {
357      max-width: 96rem;
358    }
359  }
360  .mx-4 {
361    margin-inline: calc(var(--spacing) * 4);
362  }
363  .my-2 {
364    margin-block: calc(var(--spacing) * 2);
365  }
366  .my-4 {
367    margin-block: calc(var(--spacing) * 4);
368  }
369  .-mt-1 {
370    margin-top: calc(var(--spacing) * -1);
371  }
372  .mt-0\\.5 {
373    margin-top: calc(var(--spacing) * 0.5);
374  }
375  .mt-1 {
376    margin-top: calc(var(--spacing) * 1);
377  }
378  .mt-2 {
379    margin-top: calc(var(--spacing) * 2);
380  }
381  .mt-3 {
382    margin-top: calc(var(--spacing) * 3);
383  }
384  .mt-4 {
385    margin-top: calc(var(--spacing) * 4);
386  }
387  .mt-5 {
388    margin-top: calc(var(--spacing) * 5);
389  }
390  .mt-6 {
391    margin-top: calc(var(--spacing) * 6);
392  }
393  .mt-8 {
394    margin-top: calc(var(--spacing) * 8);
395  }
396  .-mr-1 {
397    margin-right: calc(var(--spacing) * -1);
398  }
399  .mr-1\\.5 {
400    margin-right: calc(var(--spacing) * 1.5);
401  }
402  .mr-2 {
403    margin-right: calc(var(--spacing) * 2);
404  }
405  .mr-3 {
406    margin-right: calc(var(--spacing) * 3);
407  }
408  .mr-4 {
409    margin-right: calc(var(--spacing) * 4);
410  }
411  .mb-1 {
412    margin-bottom: calc(var(--spacing) * 1);
413  }
414  .mb-1\\.5 {
415    margin-bottom: calc(var(--spacing) * 1.5);
416  }
417  .mb-2 {
418    margin-bottom: calc(var(--spacing) * 2);
419  }
420  .mb-3 {
421    margin-bottom: calc(var(--spacing) * 3);
422  }
423  .mb-4 {
424    margin-bottom: calc(var(--spacing) * 4);
425  }
426  .mb-6 {
427    margin-bottom: calc(var(--spacing) * 6);
428  }
429  .ml-1 {
430    margin-left: calc(var(--spacing) * 1);
431  }
432  .ml-2 {
433    margin-left: calc(var(--spacing) * 2);
434  }
435  .block {
436    display: block;
437  }
438  .contents {
439    display: contents;
440  }
441  .flex {
442    display: flex;
443  }
444  .grid {
445    display: grid;
446  }
447  .hidden {
448    display: none;
449  }
450  .inline {
451    display: inline;
452  }
453  .inline-block {
454    display: inline-block;
455  }
456  .inline-flex {
457    display: inline-flex;
458  }
459  .h-1 {
460    height: calc(var(--spacing) * 1);
461  }
462  .h-1\\.5 {
463    height: calc(var(--spacing) * 1.5);
464  }
465  .h-2 {
466    height: calc(var(--spacing) * 2);
467  }
468  .h-3 {
469    height: calc(var(--spacing) * 3);
470  }
471  .h-3\\.5 {
472    height: calc(var(--spacing) * 3.5);
473  }
474  .h-4 {
475    height: calc(var(--spacing) * 4);
476  }
477  .h-5 {
478    height: calc(var(--spacing) * 5);
479  }
480  .h-6 {
481    height: calc(var(--spacing) * 6);
482  }
483  .h-7 {
484    height: calc(var(--spacing) * 7);
485  }
486  .h-8 {
487    height: calc(var(--spacing) * 8);
488  }
489  .h-9 {
490    height: calc(var(--spacing) * 9);
491  }
492  .h-10 {
493    height: calc(var(--spacing) * 10);
494  }
495  .h-12 {
496    height: calc(var(--spacing) * 12);
497  }
498  .h-16 {
499    height: calc(var(--spacing) * 16);
500  }
501  .h-18 {
502    height: calc(var(--spacing) * 18);
503  }
504  .h-\\[32px\\] {
505    height: 32px;
506  }
507  .h-full {
508    height: 100%;
509  }
510  .h-px {
511    height: 1px;
512  }
513  .max-h-48 {
514    max-height: calc(var(--spacing) * 48);
515  }
516  .max-h-60 {
517    max-height: calc(var(--spacing) * 60);
518  }
519  .min-h-0 {
520    min-height: calc(var(--spacing) * 0);
521  }
522  .\\!w-full {
523    width: 100% !important;
524  }
525  .w-2 {
526    width: calc(var(--spacing) * 2);
527  }
528  .w-3 {
529    width: calc(var(--spacing) * 3);
530  }
531  .w-3\\.5 {
532    width: calc(var(--spacing) * 3.5);
533  }
534  .w-4 {
535    width: calc(var(--spacing) * 4);
536  }
537  .w-5 {
538    width: calc(var(--spacing) * 5);
539  }
540  .w-6 {
541    width: calc(var(--spacing) * 6);
542  }
543  .w-8 {
544    width: calc(var(--spacing) * 8);
545  }
546  .w-9 {
547    width: calc(var(--spacing) * 9);
548  }
549  .w-10 {
550    width: calc(var(--spacing) * 10);
551  }
552  .w-12 {
553    width: calc(var(--spacing) * 12);
554  }
555  .w-16 {
556    width: calc(var(--spacing) * 16);
557  }
558  .w-18 {
559    width: calc(var(--spacing) * 18);
560  }
561  .w-32 {
562    width: calc(var(--spacing) * 32);
563  }
564  .w-\\[32px\\] {
565    width: 32px;
566  }
567  .w-auto {
568    width: auto;
569  }
570  .w-full {
571    width: 100%;
572  }
573  .w-px {
574    width: 1px;
575  }
576  .max-w-\\[80\\%\\] {
577    max-width: 80%;
578  }
579  .max-w-\\[90\\%\\] {
580    max-width: 90%;
581  }
582  .max-w-\\[150px\\] {
583    max-width: 150px;
584  }
585  .max-w-\\[180px\\] {
586    max-width: 180px;
587  }
588  .max-w-\\[240px\\] {
589    max-width: 240px;
590  }
591  .max-w-sm {
592    max-width: var(--container-sm);
593  }
594  .min-w-0 {
595    min-width: calc(var(--spacing) * 0);
596  }
597  .min-w-\\[8rem\\] {
598    min-width: 8rem;
599  }
600  .min-w-\\[32px\\] {
601    min-width: 32px;
602  }
603  .min-w-\\[120px\\] {
604    min-width: 120px;
605  }
606  .min-w-\\[200px\\] {
607    min-width: 200px;
608  }
609  .flex-1 {
610    flex: 1;
611  }
612  .flex-\\[2\\] {
613    flex: 2;
614  }
615  .flex-shrink-0 {
616    flex-shrink: 0;
617  }
618  .shrink {
619    flex-shrink: 1;
620  }
621  .shrink-0 {
622    flex-shrink: 0;
623  }
624  .-translate-x-1\\/2 {
625    --tw-translate-x: calc(calc(1/2 * 100%) * -1);
626    translate: var(--tw-translate-x) var(--tw-translate-y);
627  }
628  .translate-x-\\[1px\\] {
629    --tw-translate-x: 1px;
630    translate: var(--tw-translate-x) var(--tw-translate-y);
631  }
632  .-translate-y-1\\/2 {
633    --tw-translate-y: calc(calc(1/2 * 100%) * -1);
634    translate: var(--tw-translate-x) var(--tw-translate-y);
635  }
636  .translate-y-\\[1px\\] {
637    --tw-translate-y: 1px;
638    translate: var(--tw-translate-x) var(--tw-translate-y);
639  }
640  .scale-95 {
641    --tw-scale-x: 95%;
642    --tw-scale-y: 95%;
643    --tw-scale-z: 95%;
644    scale: var(--tw-scale-x) var(--tw-scale-y);
645  }
646  .scale-100 {
647    --tw-scale-x: 100%;
648    --tw-scale-y: 100%;
649    --tw-scale-z: 100%;
650    scale: var(--tw-scale-x) var(--tw-scale-y);
651  }
652  .scale-110 {
653    --tw-scale-x: 110%;
654    --tw-scale-y: 110%;
655    --tw-scale-z: 110%;
656    scale: var(--tw-scale-x) var(--tw-scale-y);
657  }
658  .rotate-45 {
659    rotate: 45deg;
660  }
661  .rotate-180 {
662    rotate: 180deg;
663  }
664  .transform {
665    transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
666  }
667  .animate-pulse {
668    animation: var(--animate-pulse);
669  }
670  .animate-spin {
671    animation: var(--animate-spin);
672  }
673  .cursor-default {
674    cursor: default;
675  }
676  .cursor-grab {
677    cursor: grab;
678  }
679  .cursor-not-allowed {
680    cursor: not-allowed;
681  }
682  .cursor-pointer {
683    cursor: pointer;
684  }
685  .touch-none {
686    touch-action: none;
687  }
688  .resize {
689    resize: both;
690  }
691  .appearance-none {
692    -webkit-appearance: none;
693       -moz-appearance: none;
694            appearance: none;
695  }
696  .grid-cols-1 {
697    grid-template-columns: repeat(1, minmax(0, 1fr));
698  }
699  .grid-cols-2 {
700    grid-template-columns: repeat(2, minmax(0, 1fr));
701  }
702  .grid-cols-6 {
703    grid-template-columns: repeat(6, minmax(0, 1fr));
704  }
705  .flex-col {
706    flex-direction: column;
707  }
708  .flex-row {
709    flex-direction: row;
710  }
711  .flex-nowrap {
712    flex-wrap: nowrap;
713  }
714  .flex-wrap {
715    flex-wrap: wrap;
716  }
717  .items-center {
718    align-items: center;
719  }
720  .items-end {
721    align-items: flex-end;
722  }
723  .items-start {
724    align-items: flex-start;
725  }
726  .justify-between {
727    justify-content: space-between;
728  }
729  .justify-center {
730    justify-content: center;
731  }
732  .justify-end {
733    justify-content: flex-end;
734  }
735  .justify-start {
736    justify-content: flex-start;
737  }
738  .gap-1 {
739    gap: calc(var(--spacing) * 1);
740  }
741  .gap-1\\.5 {
742    gap: calc(var(--spacing) * 1.5);
743  }
744  .gap-2 {
745    gap: calc(var(--spacing) * 2);
746  }
747  .gap-3 {
748    gap: calc(var(--spacing) * 3);
749  }
750  .gap-4 {
751    gap: calc(var(--spacing) * 4);
752  }
753  .space-y-2 {
754    :where(& > :not(:last-child)) {
755      --tw-space-y-reverse: 0;
756      margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
757      margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
758    }
759  }
760  .space-y-3 {
761    :where(& > :not(:last-child)) {
762      --tw-space-y-reverse: 0;
763      margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
764      margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
765    }
766  }
767  .space-y-4 {
768    :where(& > :not(:last-child)) {
769      --tw-space-y-reverse: 0;
770      margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
771      margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
772    }
773  }
774  .space-y-5 {
775    :where(& > :not(:last-child)) {
776      --tw-space-y-reverse: 0;
777      margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));
778      margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
779    }
780  }
781  .space-y-6 {
782    :where(& > :not(:last-child)) {
783      --tw-space-y-reverse: 0;
784      margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
785      margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
786    }
787  }
788  .gap-x-1 {
789    -moz-column-gap: calc(var(--spacing) * 1);
790         column-gap: calc(var(--spacing) * 1);
791  }
792  .space-x-2 {
793    :where(& > :not(:last-child)) {
794      --tw-space-x-reverse: 0;
795      margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));
796      margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
797    }
798  }
799  .space-x-3 {
800    :where(& > :not(:last-child)) {
801      --tw-space-x-reverse: 0;
802      margin-inline-start: calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));
803      margin-inline-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)));
804    }
805  }
806  .gap-y-4 {
807    row-gap: calc(var(--spacing) * 4);
808  }
809  .divide-y {
810    :where(& > :not(:last-child)) {
811      --tw-divide-y-reverse: 0;
812      border-bottom-style: var(--tw-border-style);
813      border-top-style: var(--tw-border-style);
814      border-top-width: calc(1px * var(--tw-divide-y-reverse));
815      border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
816    }
817  }
818  .divide-border-subtle {
819    :where(& > :not(:last-child)) {
820      border-color: var(--color-border-subtle);
821    }
822  }
823  .truncate {
824    overflow: hidden;
825    text-overflow: ellipsis;
826    white-space: nowrap;
827  }
828  .overflow-auto {
829    overflow: auto;
830  }
831  .overflow-hidden {
832    overflow: hidden;
833  }
834  .overflow-x-auto {
835    overflow-x: auto;
836  }
837  .overflow-y-auto {
838    overflow-y: auto;
839  }
840  .rounded {
841    border-radius: 0.25rem;
842  }
843  .rounded-\\[3px\\] {
844    border-radius: 3px;
845  }
846  .rounded-full {
847    border-radius: calc(infinity * 1px);
848  }
849  .rounded-lg {
850    border-radius: var(--radius-lg);
851  }
852  .rounded-md {
853    border-radius: var(--radius-md);
854  }
855  .rounded-none {
856    border-radius: 0;
857  }
858  .rounded-xl {
859    border-radius: var(--radius-xl);
860  }
861  .rounded-t-2xl {
862    border-top-left-radius: var(--radius-2xl);
863    border-top-right-radius: var(--radius-2xl);
864  }
865  .rounded-t-lg {
866    border-top-left-radius: var(--radius-lg);
867    border-top-right-radius: var(--radius-lg);
868  }
869  .rounded-l-md {
870    border-top-left-radius: var(--radius-md);
871    border-bottom-left-radius: var(--radius-md);
872  }
873  .rounded-r-md {
874    border-top-right-radius: var(--radius-md);
875    border-bottom-right-radius: var(--radius-md);
876  }
877  .border {
878    border-style: var(--tw-border-style);
879    border-width: 1px;
880  }
881  .border-0 {
882    border-style: var(--tw-border-style);
883    border-width: 0px;
884  }
885  .border-2 {
886    border-style: var(--tw-border-style);
887    border-width: 2px;
888  }
889  .border-3 {
890    border-style: var(--tw-border-style);
891    border-width: 3px;
892  }
893  .border-4 {
894    border-style: var(--tw-border-style);
895    border-width: 4px;
896  }
897  .border-t {
898    border-top-style: var(--tw-border-style);
899    border-top-width: 1px;
900  }
901  .border-r {
902    border-right-style: var(--tw-border-style);
903    border-right-width: 1px;
904  }
905  .border-r-0 {
906    border-right-style: var(--tw-border-style);
907    border-right-width: 0px;
908  }
909  .border-b {
910    border-bottom-style: var(--tw-border-style);
911    border-bottom-width: 1px;
912  }
913  .border-b-2 {
914    border-bottom-style: var(--tw-border-style);
915    border-bottom-width: 2px;
916  }
917  .border-l {
918    border-left-style: var(--tw-border-style);
919    border-left-width: 1px;
920  }
921  .border-dashed {
922    --tw-border-style: dashed;
923    border-style: dashed;
924  }
925  .border-none {
926    --tw-border-style: none;
927    border-style: none;
928  }
929  .border-\\[\\#cfd4da\\] {
930    border-color: #cfd4da;
931  }
932  .border-accent {
933    border-color: var(--color-accent);
934  }
935  .border-border-default {
936    border-color: var(--color-border-default);
937  }
938  .border-border-strong {
939    border-color: var(--color-border-strong);
940  }
941  .border-border-subtle {
942    border-color: var(--color-border-subtle);
943  }
944  .border-gray-300 {
945    border-color: var(--color-gray-300);
946  }
947  .border-state-error {
948    border-color: var(--color-state-error);
949  }
950  .border-transparent {
951    border-color: transparent;
952  }
953  .border-t-accent {
954    border-top-color: var(--color-accent);
955  }
956  .border-r-accent {
957    border-right-color: var(--color-accent);
958  }
959  .border-b-accent {
960    border-bottom-color: var(--color-accent);
961  }
962  .border-b-transparent {
963    border-bottom-color: transparent;
964  }
965  .bg-\\[\\#f8f9fa\\] {
966    background-color: #f8f9fa;
967  }
968  .bg-accent {
969    background-color: var(--color-accent);
970  }
971  .bg-accent-light {
972    background-color: var(--color-accent-light);
973  }
974  .bg-accent\\/5 {
975    background-color: var(--color-accent);
976    @supports (color: color-mix(in lab, red, red)) {
977      background-color: color-mix(in oklab, var(--color-accent) 5%, transparent);
978    }
979  }
980  .bg-accent\\/10 {
981    background-color: var(--color-accent);
982    @supports (color: color-mix(in lab, red, red)) {
983      background-color: color-mix(in oklab, var(--color-accent) 10%, transparent);
984    }
985  }
986  .bg-bg-app {
987    background-color: var(--color-bg-app);
988  }
989  .bg-bg-elevated {
990    background-color: var(--color-bg-elevated);
991  }
992  .bg-bg-input {
993    background-color: var(--color-bg-input);
994  }
995  .bg-bg-overlay {
996    background-color: var(--color-bg-overlay);
997  }
998  .bg-bg-surface {
999    background-color: var(--color-bg-surface);
1000  }
1001  .bg-bg-surface-alt {
1002    background-color: var(--color-bg-surface-alt);
1003  }
1004  .bg-bg-surface\\/80 {
1005    background-color: var(--color-bg-surface);
1006    @supports (color: color-mix(in lab, red, red)) {
1007      background-color: color-mix(in oklab, var(--color-bg-surface) 80%, transparent);
1008    }
1009  }
1010  .bg-blue-500 {
1011    background-color: var(--color-blue-500);
1012  }
1013  .bg-border-default {
1014    background-color: var(--color-border-default);
1015  }
1016  .bg-border-subtle {
1017    background-color: var(--color-border-subtle);
1018  }
1019  .bg-green-500 {
1020    background-color: var(--color-green-500);
1021  }
1022  .bg-indigo-500 {
1023    background-color: var(--color-indigo-500);
1024  }
1025  .bg-inherit {
1026    background-color: inherit;
1027  }
1028  .bg-interactive-hover {
1029    background-color: var(--color-interactive-hover);
1030  }
1031  .bg-interactive-selected {
1032    background-color: var(--color-interactive-selected);
1033  }
1034  .bg-pink-500 {
1035    background-color: var(--color-pink-500);
1036  }
1037  .bg-purple-500 {
1038    background-color: var(--color-purple-500);
1039  }
1040  .bg-red-500 {
1041    background-color: var(--color-red-500);
1042  }
1043  .bg-state-error {
1044    background-color: var(--color-state-error);
1045  }
1046  .bg-state-error-light {
1047    background-color: var(--color-state-error-light);
1048  }
1049  .bg-state-info-light {
1050    background-color: var(--color-state-info-light);
1051  }
1052  .bg-state-success-light {
1053    background-color: var(--color-state-success-light);
1054  }
1055  .bg-state-warning-light {
1056    background-color: var(--color-state-warning-light);
1057  }
1058  .bg-teal-500 {
1059    background-color: var(--color-teal-500);
1060  }
1061  .bg-tooltip-bg {
1062    background-color: var(--color-tooltip-bg);
1063  }
1064  .bg-transparent {
1065    background-color: transparent;
1066  }
1067  .bg-white {
1068    background-color: var(--color-white);
1069  }
1070  .bg-yellow-500 {
1071    background-color: var(--color-yellow-500);
1072  }
1073  .object-contain {
1074    -o-object-fit: contain;
1075       object-fit: contain;
1076  }
1077  .p-0 {
1078    padding: calc(var(--spacing) * 0);
1079  }
1080  .p-0\\.5 {
1081    padding: calc(var(--spacing) * 0.5);
1082  }
1083  .p-1 {
1084    padding: calc(var(--spacing) * 1);
1085  }
1086  .p-1\\.5 {
1087    padding: calc(var(--spacing) * 1.5);
1088  }
1089  .p-2 {
1090    padding: calc(var(--spacing) * 2);
1091  }
1092  .p-3 {
1093    padding: calc(var(--spacing) * 3);
1094  }
1095  .p-4 {
1096    padding: calc(var(--spacing) * 4);
1097  }
1098  .p-5 {
1099    padding: calc(var(--spacing) * 5);
1100  }
1101  .p-6 {
1102    padding: calc(var(--spacing) * 6);
1103  }
1104  .p-8 {
1105    padding: calc(var(--spacing) * 8);
1106  }
1107  .p-\\[5px\\] {
1108    padding: 5px;
1109  }
1110  .px-1 {
1111    padding-inline: calc(var(--spacing) * 1);
1112  }
1113  .px-2 {
1114    padding-inline: calc(var(--spacing) * 2);
1115  }
1116  .px-3 {
1117    padding-inline: calc(var(--spacing) * 3);
1118  }
1119  .px-4 {
1120    padding-inline: calc(var(--spacing) * 4);
1121  }
1122  .px-5 {
1123    padding-inline: calc(var(--spacing) * 5);
1124  }
1125  .px-6 {
1126    padding-inline: calc(var(--spacing) * 6);
1127  }
1128  .py-1 {
1129    padding-block: calc(var(--spacing) * 1);
1130  }
1131  .py-1\\.5 {
1132    padding-block: calc(var(--spacing) * 1.5);
1133  }
1134  .py-2 {
1135    padding-block: calc(var(--spacing) * 2);
1136  }
1137  .py-2\\.5 {
1138    padding-block: calc(var(--spacing) * 2.5);
1139  }
1140  .py-3 {
1141    padding-block: calc(var(--spacing) * 3);
1142  }
1143  .py-4 {
1144    padding-block: calc(var(--spacing) * 4);
1145  }
1146  .pt-0\\.5 {
1147    padding-top: calc(var(--spacing) * 0.5);
1148  }
1149  .pt-2 {
1150    padding-top: calc(var(--spacing) * 2);
1151  }
1152  .pt-3 {
1153    padding-top: calc(var(--spacing) * 3);
1154  }
1155  .pt-4 {
1156    padding-top: calc(var(--spacing) * 4);
1157  }
1158  .pr-2 {
1159    padding-right: calc(var(--spacing) * 2);
1160  }
1161  .pr-3 {
1162    padding-right: calc(var(--spacing) * 3);
1163  }
1164  .pr-6 {
1165    padding-right: calc(var(--spacing) * 6);
1166  }
1167  .pr-7 {
1168    padding-right: calc(var(--spacing) * 7);
1169  }
1170  .pr-9 {
1171    padding-right: calc(var(--spacing) * 9);
1172  }
1173  .pr-10 {
1174    padding-right: calc(var(--spacing) * 10);
1175  }
1176  .pb-3 {
1177    padding-bottom: calc(var(--spacing) * 3);
1178  }
1179  .pb-4 {
1180    padding-bottom: calc(var(--spacing) * 4);
1181  }
1182  .pl-0\\.5 {
1183    padding-left: calc(var(--spacing) * 0.5);
1184  }
1185  .pl-2 {
1186    padding-left: calc(var(--spacing) * 2);
1187  }
1188  .pl-3 {
1189    padding-left: calc(var(--spacing) * 3);
1190  }
1191  .pl-4 {
1192    padding-left: calc(var(--spacing) * 4);
1193  }
1194  .pl-6 {
1195    padding-left: calc(var(--spacing) * 6);
1196  }
1197  .pl-8 {
1198    padding-left: calc(var(--spacing) * 8);
1199  }
1200  .text-center {
1201    text-align: center;
1202  }
1203  .text-left {
1204    text-align: left;
1205  }
1206  .text-right {
1207    text-align: right;
1208  }
1209  .text-base {
1210    font-size: var(--text-base);
1211    line-height: var(--tw-leading, var(--text-base--line-height));
1212  }
1213  .text-lg {
1214    font-size: var(--text-lg);
1215    line-height: var(--tw-leading, var(--text-lg--line-height));
1216  }
1217  .text-sm {
1218    font-size: var(--text-sm);
1219    line-height: var(--tw-leading, var(--text-sm--line-height));
1220  }
1221  .text-xl {
1222    font-size: var(--text-xl);
1223    line-height: var(--tw-leading, var(--text-xl--line-height));
1224  }
1225  .text-xs {
1226    font-size: var(--text-xs);
1227    line-height: var(--tw-leading, var(--text-xs--line-height));
1228  }
1229  .text-\\[10px\\] {
1230    font-size: 10px;
1231  }
1232  .text-\\[13px\\] {
1233    font-size: 13px;
1234  }
1235  .leading-none {
1236    --tw-leading: 1;
1237    line-height: 1;
1238  }
1239  .leading-relaxed {
1240    --tw-leading: var(--leading-relaxed);
1241    line-height: var(--leading-relaxed);
1242  }
1243  .font-bold {
1244    --tw-font-weight: var(--font-weight-bold);
1245    font-weight: var(--font-weight-bold);
1246  }
1247  .font-medium {
1248    --tw-font-weight: var(--font-weight-medium);
1249    font-weight: var(--font-weight-medium);
1250  }
1251  .font-semibold {
1252    --tw-font-weight: var(--font-weight-semibold);
1253    font-weight: var(--font-weight-semibold);
1254  }
1255  .tracking-widest {
1256    --tw-tracking: var(--tracking-widest);
1257    letter-spacing: var(--tracking-widest);
1258  }
1259  .whitespace-nowrap {
1260    white-space: nowrap;
1261  }
1262  .text-accent {
1263    color: var(--color-accent);
1264  }
1265  .text-accent-fg {
1266    color: var(--color-accent-fg);
1267  }
1268  .text-border-default {
1269    color: var(--color-border-default);
1270  }
1271  .text-fg-disabled {
1272    color: var(--color-fg-disabled);
1273  }
1274  .text-fg-muted {
1275    color: var(--color-fg-muted);
1276  }
1277  .text-fg-on-accent {
1278    color: var(--color-fg-on-accent);
1279  }
1280  .text-fg-primary {
1281    color: var(--color-fg-primary);
1282  }
1283  .text-fg-secondary {
1284    color: var(--color-fg-secondary);
1285  }
1286  .text-red-600 {
1287    color: var(--color-red-600);
1288  }
1289  .text-state-error {
1290    color: var(--color-state-error);
1291  }
1292  .text-state-success {
1293    color: var(--color-state-success);
1294  }
1295  .text-state-warning {
1296    color: var(--color-state-warning);
1297  }
1298  .text-tooltip-fg {
1299    color: var(--color-tooltip-fg);
1300  }
1301  .text-white {
1302    color: var(--color-white);
1303  }
1304  .uppercase {
1305    text-transform: uppercase;
1306  }
1307  .italic {
1308    font-style: italic;
1309  }
1310  .underline {
1311    text-decoration-line: underline;
1312  }
1313  .placeholder-fg-muted {
1314    &::-moz-placeholder {
1315      color: var(--color-fg-muted);
1316    }
1317    &::placeholder {
1318      color: var(--color-fg-muted);
1319    }
1320  }
1321  .accent-accent {
1322    accent-color: var(--color-accent);
1323  }
1324  .opacity-0 {
1325    opacity: 0%;
1326  }
1327  .opacity-50 {
1328    opacity: 50%;
1329  }
1330  .opacity-100 {
1331    opacity: 100%;
1332  }
1333  .shadow {
1334    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1335    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1336  }
1337  .shadow-2xl {
1338    --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));
1339    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1340  }
1341  .shadow-lg {
1342    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1343    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1344  }
1345  .shadow-md {
1346    --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1347    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
1347dow);
1348  }
1349  .shadow-sm {
1350    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1351    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1352  }
1353  .ring {
1354    --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1355    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1356  }
1357  .ring-1 {
1358    --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1359    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1360  }
1361  .ring-2 {
1362    --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1363    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
1363dow);
1364  }
1365  .ring-accent {
1366    --tw-ring-color: var(--color-accent);
1367  }
1368  .ring-border-default {
1369    --tw-ring-color: var(--color-border-default);
1370  }
1371  .ring-interactive-focus-ring {
1372    --tw-ring-color: var(--color-interactive-focus-ring);
1373  }
1374  .ring-offset-1 {
1375    --tw-ring-offset-width: 1px;
1376    --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1377  }
1378  .outline {
1379    outline-style: var(--tw-outline-style);
1380    outline-width: 1px;
1381  }
1382  .outline-1 {
1383    outline-style: var(--tw-outline-style);
1384    outline-width: 1px;
1385  }
1386  .outline-2 {
1387    outline-style: var(--tw-outline-style);
1388    outline-width: 2px;
1389  }
1390  .-outline-offset-1 {
1391    outline-offset: calc(1px * -1);
1392  }
1393  .outline-offset-2 {
1394    outline-offset: 2px;
1395  }
1396  .outline-accent {
1397    outline-color: var(--color-accent);
1398  }
1399  .outline-border-default {
1400    outline-color: var(--color-border-default);
1401  }
1402  .filter {
1403    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1404  }
1405  .backdrop-blur {
1406    --tw-backdrop-blur: blur(8px);
1407    backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1408  }
1409  .transition {
1410    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
1411    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1412    transition-duration: var(--tw-duration, var(--default-transition-duration));
1413  }
1414  .transition-\\[height\\] {
1415    transition-property: height;
1416    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1417    transition-duration: var(--tw-duration, var(--default-transition-duration));
1418  }
1419  .transition-all {
1420    transition-property: all;
1421    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1422    transition-duration: var(--tw-duration, var(--default-transition-duration));
1423  }
1424  .transition-colors {
1425    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
1426    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1427    transition-duration: var(--tw-duration, var(--default-transition-duration));
1428  }
1429  .transition-opacity {
1430    transition-property: opacity;
1431    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1432    transition-duration: var(--tw-duration, var(--default-transition-duration));
1433  }
1434  .transition-transform {
1435    transition-property: transform, translate, scale, rotate;
1436    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1437    transition-duration: var(--tw-duration, var(--default-transition-duration));
1438  }
1439  .duration-150 {
1440    --tw-duration: 150ms;
1441    transition-duration: 150ms;
1442  }
1443  .duration-200 {
1444    --tw-duration: 200ms;
1445    transition-duration: 200ms;
1446  }
1447  .duration-300 {
1448    --tw-duration: 300ms;
1449    transition-duration: 300ms;
1450  }
1451  .ease-in-out {
1452    --tw-ease: var(--ease-in-out);
1453    transition-timing-function: var(--ease-in-out);
1454  }
1455  .ease-out {
1456    --tw-ease: var(--ease-out);
1457    transition-timing-function: var(--ease-out);
1458  }
1459  .outline-none {
1460    --tw-outline-style: none;
1461    outline-style: none;
1462  }
1463  .select-none {
1464    -webkit-user-select: none;
1465    -moz-user-select: none;
1466         user-select: none;
1467  }
1468  .group-hover\\:opacity-100 {
1469    &:is(:where(.group):hover *) {
1470      @media (hover: hover) {
1471        opacity: 100%;
1472      }
1473    }
1474  }
1475  .peer-checked\\:opacity-100 {
1476    &:is(:where(.peer):checked ~ *) {
1477      opacity: 100%;
1478    }
1479  }
1480  .placeholder\\:text-fg-muted {
1481    &::-moz-placeholder {
1482      color: var(--color-fg-muted);
1483    }
1484    &::placeholder {
1485      color: var(--color-fg-muted);
1486    }
1487  }
1488  .first\\:mt-0 {
1489    &:first-child {
1490      margin-top: calc(var(--spacing) * 0);
1491    }
1492  }
1493  .checked\\:border-accent {
1494    &:checked {
1495      border-color: var(--color-accent);
1496    }
1497  }
1498  .checked\\:bg-accent {
1499    &:checked {
1500      background-color: var(--color-accent);
1501    }
1502  }
1503  .hover\\:scale-105 {
1504    &:hover {
1505      @media (hover: hover) {
1506        --tw-scale-x: 105%;
1507        --tw-scale-y: 105%;
1508        --tw-scale-z: 105%;
1509        scale: var(--tw-scale-x) var(--tw-scale-y);
1510      }
1511    }
1512  }
1513  .hover\\:border-accent {
1514    &:hover {
1515      @media (hover: hover) {
1516        border-color: var(--color-accent);
1517      }
1518    }
1519  }
1520  .hover\\:border-border-default {
1521    &:hover {
1522      @media (hover: hover) {
1523        border-color: var(--color-border-default);
1524      }
1525    }
1526  }
1527  .hover\\:border-fg-muted {
1528    &:hover {
1529      @media (hover: hover) {
1530        border-color: var(--color-fg-muted);
1531      }
1532    }
1533  }
1534  .hover\\:border-fg-muted\\/30 {
1535    &:hover {
1536      @media (hover: hover) {
1537        border-color: var(--color-fg-muted);
1538        @supports (color: color-mix(in lab, red, red)) {
1539          border-color: color-mix(in oklab, var(--color-fg-muted) 30%, transparent);
1540        }
1541      }
1542    }
1543  }
1544  .hover\\:border-state-error {
1545    &:hover {
1546      @media (hover: hover) {
1547        border-color: var(--color-state-error);
1548      }
1549    }
1550  }
1551  .hover\\:border-b-accent {
1552    &:hover {
1553      @media (hover: hover) {
1554        border-bottom-color: var(--color-accent);
1555      }
1556    }
1557  }
1558  .hover\\:border-b-fg-muted {
1559    &:hover {
1560      @media (hover: hover) {
1561        border-bottom-color: var(--color-fg-muted);
1562      }
1563    }
1564  }
1565  .hover\\:\\!bg-accent-hover {
1566    &:hover {
1567      @media (hover: hover) {
1568        background-color: var(--color-accent-hover) !important;
1569      }
1570    }
1571  }
1572  .hover\\:bg-accent {
1573    &:hover {
1574      @media (hover: hover) {
1575        background-color: var(--color-accent);
1576      }
1577    }
1578  }
1579  .hover\\:bg-accent-hover {
1580    &:hover {
1581      @media (hover: hover) {
1582        background-color: var(--color-accent-hover);
1583      }
1584    }
1585  }
1586  .hover\\:bg-bg-surface {
1587    &:hover {
1588      @media (hover: hover) {
1589        background-color: var(--color-bg-surface);
1590      }
1591    }
1592  }
1593  .hover\\:bg-border-default {
1594    &:hover {
1595      @media (hover: hover) {
1596        background-color: var(--color-border-default);
1597      }
1598    }
1599  }
1600  .hover\\:bg-interactive-hover {
1601    &:hover {
1602      @media (hover: hover) {
1603        background-color: var(--color-interactive-hover);
1604      }
1605    }
1606  }
1607  .hover\\:bg-state-error-light {
1608    &:hover {
1609      @media (hover: hover) {
1610        background-color: var(--color-state-error-light);
1611      }
1612    }
1613  }
1614  .hover\\:bg-state-error\\/90 {
1615    &:hover {
1616      @media (hover: hover) {
1617        background-color: var(--color-state-error);
1618        @supports (color: color-mix(in lab, red, red)) {
1619          background-color: color-mix(in oklab, var(--color-state-error) 90%, transparent);
1620        }
1621      }
1622    }
1623  }
1624  .hover\\:bg-transparent {
1625    &:hover {
1626      @media (hover: hover) {
1627        background-color: transparent;
1628      }
1629    }
1630  }
1631  .hover\\:text-accent-hover {
1632    &:hover {
1633      @media (hover: hover) {
1634        color: var(--color-accent-hover);
1635      }
1636    }
1637  }
1638  .hover\\:text-fg-on-accent {
1639    &:hover {
1640      @media (hover: hover) {
1641        color: var(--color-fg-on-accent);
1642      }
1643    }
1644  }
1645  .hover\\:text-fg-primary {
1646    &:hover {
1647      @media (hover: hover) {
1648        color: var(--color-fg-primary);
1649      }
1650    }
1651  }
1652  .hover\\:text-fg-secondary {
1653    &:hover {
1654      @media (hover: hover) {
1655        color: var(--color-fg-secondary);
1656      }
1657    }
1658  }
1659  .hover\\:shadow-md {
1660    &:hover {
1661      @media (hover: hover) {
1662        --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1663        box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1664      }
1665    }
1666  }
1667  .hover\\:ring {
1668    &:hover {
1669      @media (hover: hover) {
1670        --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1671        box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1672      }
1673    }
1674  }
1675  .hover\\:ring-0 {
1676    &:hover {
1677      @media (hover: hover) {
1678        --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1679        box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
1679dow);
1680      }
1681    }
1682  }
1683  .hover\\:ring-accent {
1684    &:hover {
1685      @media (hover: hover) {
1686        --tw-ring-color: var(--color-accent);
1687      }
1688    }
1689  }
1690  .hover\\:ring-transparent {
1691    &:hover {
1692      @media (hover: hover) {
1693        --tw-ring-color: transparent;
1694      }
1695    }
1696  }
1697  .focus\\:border-accent {
1698    &:focus {
1699      border-color: var(--color-accent);
1700    }
1701  }
1702  .focus\\:border-blue-500 {
1703    &:focus {
1704      border-color: var(--color-blue-500);
1705    }
1706  }
1707  .focus\\:border-state-error {
1708    &:focus {
1709      border-color: var(--color-state-error);
1710    }
1711  }
1712  .focus\\:border-transparent {
1713    &:focus {
1714      border-color: transparent;
1715    }
1716  }
1717  .focus\\:ring-1 {
1718    &:focus {
1719      --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1720      box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1721    }
1722  }
1723  .focus\\:ring-2 {
1724    &:focus {
1725      --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1726      box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
1726dow);
1727    }
1728  }
1729  .focus\\:ring-accent {
1730    &:focus {
1731      --tw-ring-color: var(--color-accent);
1732    }
1733  }
1734  .focus\\:ring-blue-500 {
1735    &:focus {
1736      --tw-ring-color: var(--color-blue-500);
1737    }
1738  }
1739  .focus\\:outline-none {
1740    &:focus {
1741      --tw-outline-style: none;
1742      outline-style: none;
1743    }
1744  }
1745  .active\\:cursor-grabbing {
1746    &:active {
1747      cursor: grabbing;
1748    }
1749  }
1750  .active\\:bg-interactive-active {
1751    &:active {
1752      background-color: var(--color-interactive-active);
1753    }
1754  }
1755  .disabled\\:cursor-not-allowed {
1756    &:disabled {
1757      cursor: not-allowed;
1758    }
1759  }
1760  .disabled\\:opacity-40 {
1761    &:disabled {
1762      opacity: 40%;
1763    }
1764  }
1765  .disabled\\:opacity-50 {
1766    &:disabled {
1767      opacity: 50%;
1768    }
1769  }
1770  .disabled\\:hover\\:bg-transparent {
1771    &:disabled {
1772      &:hover {
1773        @media (hover: hover) {
1774          background-color: transparent;
1775        }
1776      }
1777    }
1778  }
1779  .disabled\\:hover\\:ring-0 {
1780    &:disabled {
1781      &:hover {
1782        @media (hover: hover) {
1783          --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1784          box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
1784dow);
1785        }
1786      }
1787    }
1788  }
1789  .sm\\:grid-cols-2 {
1790    @media (width >= 40rem) {
1791      grid-template-columns: repeat(2, minmax(0, 1fr));
1792    }
1793  }
1794  .md\\:flex {
1795    @media (width >= 48rem) {
1796      display: flex;
1797    }
1798  }
1799  .md\\:h-auto {
1800    @media (width >= 48rem) {
1801      height: auto;
1802    }
1803  }
1804  .md\\:max-h-\\[80vh\\] {
1805    @media (width >= 48rem) {
1806      max-height: 80vh;
1807    }
1808  }
1809  .md\\:w-\\[28rem\\] {
1810    @media (width >= 48rem) {
1811      width: 28rem;
1812    }
1813  }
1814  .md\\:w-\\[32rem\\] {
1815    @media (width >= 48rem) {
1816      width: 32rem;
1817    }
1818  }
1819  .md\\:w-\\[36rem\\] {
1820    @media (width >= 48rem) {
1821      width: 36rem;
1822    }
1823  }
1824  .md\\:w-\\[42rem\\] {
1825    @media (width >= 48rem) {
1826      width: 42rem;
1827    }
1828  }
1829  .md\\:w-\\[48rem\\] {
1830    @media (width >= 48rem) {
1831      width: 48rem;
1832    }
1833  }
1834  .md\\:max-w-\\[90vw\\] {
1835    @media (width >= 48rem) {
1836      max-width: 90vw;
1837    }
1838  }
1839  .md\\:flex-none {
1840    @media (width >= 48rem) {
1841      flex: none;
1842    }
1843  }
1844  .md\\:items-center {
1845    @media (width >= 48rem) {
1846      align-items: center;
1847    }
1848  }
1849  .md\\:justify-center {
1850    @media (width >= 48rem) {
1851      justify-content: center;
1852    }
1853  }
1854  .md\\:rounded-lg {
1855    @media (width >= 48rem) {
1856      border-radius: var(--radius-lg);
1857    }
1858  }
1859  .md\\:border {
1860    @media (width >= 48rem) {
1861      border-style: var(--tw-border-style);
1862      border-width: 1px;
1863    }
1864  }
1865  .md\\:border-border-subtle {
1866    @media (width >= 48rem) {
1867      border-color: var(--color-border-subtle);
1868    }
1869  }
1870  .md\\:shadow-lg {
1871    @media (width >= 48rem) {
1872      --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1873      box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1874    }
1875  }
1876}
1877:host {
1878  --tw-translate-x: 0;
1879  --tw-translate-y: 0;
1880  --tw-translate-z: 0;
1881  --tw-rotate-x: rotateX(0);
1882  --tw-rotate-y: rotateY(0);
1883  --tw-rotate-z: rotateZ(0);
1884  --tw-skew-x: skewX(0);
1885  --tw-skew-y: skewY(0);
1886  --tw-border-style: solid;
1887  --tw-gradient-from: #0000;
1888  --tw-gradient-via: #0000;
1889  --tw-gradient-to: #0000;
1890  --tw-gradient-from-position: 0%;
1891  --tw-gradient-via-position: 50%;
1892  --tw-gradient-to-position: 100%;
1893  --tw-shadow: 0 0 #0000;
1894  --tw-inset-shadow: 0 0 #0000;
1895  --tw-ring-shadow: 0 0 #0000;
1896  --tw-inset-ring-shadow: 0 0 #0000;
1897  --tw-ring-offset-width: 0px;
1898  --tw-ring-offset-color: #fff;
1899  --tw-ring-offset-shadow: 0 0 #0000;
1900  --tw-outline-style: solid;
1901  display: flex;
1902  flex-direction: column;
1903  overflow: hidden;
1904  width: 100%;
1905  height: 100%;
1906  --ep-font-family: 'Open Sans', system-ui, sans-serif;
1907  font-family: var(--ep-font-family);
1908  color: var(--ep-foreground-primary);
1909  background-color: var(--ep-background-surface);
1910}
1911.embedpdf-snippet-root {
1912  display: flex;
1913  flex-direction: column;
1914  width: 100%;
1915  height: 100%;
1916  font-family: var(--ep-font-family);
1917}
1918:host *::-webkit-scrollbar {
1919  width: 8px;
1920  height: 8px;
1921}
1922:host *::-webkit-scrollbar-track {
1923  background: var(--ep-scrollbar-track);
1924}
1925:host *::-webkit-scrollbar-thumb {
1926  background: var(--ep-scrollbar-thumb);
1927  border-radius: 4px;
1928}
1929:host *::-webkit-scrollbar-thumb:hover {
1930  background: var(--ep-scrollbar-thumb-hover);
1931}
1932@property --tw-translate-x {
1933  syntax: "*";
1934  inherits: false;
1935  initial-value: 0;
1936}
1937@property --tw-translate-y {
1938  syntax: "*";
1939  inherits: false;
1940  initial-value: 0;
1941}
1942@property --tw-translate-z {
1943  syntax: "*";
1944  inherits: false;
1945  initial-value: 0;
1946}
1947@property --tw-scale-x {
1948  syntax: "*";
1949  inherits: false;
1950  initial-value: 1;
1951}
1952@property --tw-scale-y {
1953  syntax: "*";
1954  inherits: false;
1955  initial-value: 1;
1956}
1957@property --tw-scale-z {
1958  syntax: "*";
1959  inherits: false;
1960  initial-value: 1;
1961}
1962@property --tw-rotate-x {
1963  syntax: "*";
1964  inherits: false;
1965}
1966@property --tw-rotate-y {
1967  syntax: "*";
1968  inherits: false;
1969}
1970@property --tw-rotate-z {
1971  syntax: "*";
1972  inherits: false;
1973}
1974@property --tw-skew-x {
1975  syntax: "*";
1976  inherits: false;
1977}
1978@property --tw-skew-y {
1979  syntax: "*";
1980  inherits: false;
1981}
1982@property --tw-space-y-reverse {
1983  syntax: "*";
1984  inherits: false;
1985  initial-value: 0;
1986}
1987@property --tw-space-x-reverse {
1988  syntax: "*";
1989  inherits: false;
1990  initial-value: 0;
1991}
1992@property --tw-divide-y-reverse {
1993  syntax: "*";
1994  inherits: false;
1995  initial-value: 0;
1996}
1997@property --tw-border-style {
1998  syntax: "*";
1999  inherits: false;
2000  initial-value: solid;
2001}
2002@property --tw-leading {
2003  syntax: "*";
2004  inherits: false;
2005}
2006@property --tw-font-weight {
2007  syntax: "*";
2008  inherits: false;
2009}
2010@property --tw-tracking {
2011  syntax: "*";
2012  inherits: false;
2013}
2014@property --tw-shadow {
2015  syntax: "*";
2016  inherits: false;
2017  initial-value: 0 0 #0000;
2018}
2019@property --tw-shadow-color {
2020  syntax: "*";
2021  inherits: false;
2022}
2023@property --tw-shadow-alpha {
2024  syntax: "<percentage>";
2025  inherits: false;
2026  initial-value: 100%;
2027}
2028@property --tw-inset-shadow {
2029  syntax: "*";
2030  inherits: false;
2031  initial-value: 0 0 #0000;
2032}
2033@property --tw-inset-shadow-color {
2034  syntax: "*";
2035  inherits: false;
2036}
2037@property --tw-inset-shadow-alpha {
2038  syntax: "<percentage>";
2039  inherits: false;
2040  initial-value: 100%;
2041}
2042@property --tw-ring-color {
2043  syntax: "*";
2044  inherits: false;
2045}
2046@property --tw-ring-shadow {
2047  syntax: "*";
2048  inherits: false;
2049  initial-value: 0 0 #0000;
2050}
2051@property --tw-inset-ring-color {
2052  syntax: "*";
2053  inherits: false;
2054}
2055@property --tw-inset-ring-shadow {
2056  syntax: "*";
2057  inherits: false;
2058  initial-value: 0 0 #0000;
2059}
2060@property --tw-ring-inset {
2061  syntax: "*";
2062  inherits: false;
2063}
2064@property --tw-ring-offset-width {
2065  syntax: "<length>";
2066  inherits: false;
2067  initial-value: 0px;
2068}
2069@property --tw-ring-offset-color {
2070  syntax: "*";
2071  inherits: false;
2072  initial-value: #fff;
2073}
2074@property --tw-ring-offset-shadow {
2075  syntax: "*";
2076  inherits: false;
2077  initial-value: 0 0 #0000;
2078}
2079@property --tw-outline-style {
2080  syntax: "*";
2081  inherits: false;
2082  initial-value: solid;
2083}
2084@property --tw-blur {
2085  syntax: "*";
2086  inherits: false;
2087}
2088@property --tw-brightness {
2089  syntax: "*";
2090  inherits: false;
2091}
2092@property --tw-contrast {
2093  syntax: "*";
2094  inherits: false;
2095}
2096@property --tw-grayscale {
2097  syntax: "*";
2098  inherits: false;
2099}
2100@property --tw-hue-rotate {
2101  syntax: "*";
2102  inherits: false;
2103}
2104@property --tw-invert {
2105  syntax: "*";
2106  inherits: false;
2107}
2108@property --tw-opacity {
2109  syntax: "*";
2110  inherits: false;
2111}
2112@property --tw-saturate {
2113  syntax: "*";
2114  inherits: false;
2115}
2116@property --tw-sepia {
2117  syntax: "*";
2118  inherits: false;
2119}
2120@property --tw-drop-shadow {
2121  syntax: "*";
2122  inherits: false;
2123}
2124@property --tw-drop-shadow-color {
2125  syntax: "*";
2126  inherits: false;
2127}
2128@property --tw-drop-shadow-alpha {
2129  syntax: "<percentage>";
2130  inherits: false;
2131  initial-value: 100%;
2132}
2133@property --tw-drop-shadow-size {
2134  syntax: "*";
2135  inherits: false;
2136}
2137@property --tw-backdrop-blur {
2138  syntax: "*";
2139  inherits: false;
2140}
2141@property --tw-backdrop-brightness {
2142  syntax: "*";
2143  inherits: false;
2144}
2145@property --tw-backdrop-contrast {
2146  syntax: "*";
2147  inherits: false;
2148}
2149@property --tw-backdrop-grayscale {
2150  syntax: "*";
2151  inherits: false;
2152}
2153@property --tw-backdrop-hue-rotate {
2154  syntax: "*";
2155  inherits: false;
2156}
2157@property --tw-backdrop-invert {
2158  syntax: "*";
2159  inherits: false;
2160}
2161@property --tw-backdrop-opacity {
2162  syntax: "*";
2163  inherits: false;
2164}
2165@property --tw-backdrop-saturate {
2166  syntax: "*";
2167  inherits: false;
2168}
2169@property --tw-backdrop-sepia {
2170  syntax: "*";
2171  inherits: false;
2172}
2173@property --tw-duration {
2174  syntax: "*";
2175  inherits: false;
2176}
2177@property --tw-ease {
2178  syntax: "*";
2179  inherits: false;
2180}
2181@keyframes spin {
2182  to {
2183    transform: rotate(360deg);
2184  }
2185}
2186@keyframes pulse {
2187  50% {
2188    opacity: 0.5;
2189  }
2190}
2191@layer properties {
2192  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
2193    *, ::before, ::after, ::backdrop {
2194      --tw-translate-x: 0;
2195      --tw-translate-y: 0;
2196      --tw-translate-z: 0;
2197      --tw-scale-x: 1;
2198      --tw-scale-y: 1;
2199      --tw-scale-z: 1;
2200      --tw-rotate-x: initial;
2201      --tw-rotate-y: initial;
2202      --tw-rotate-z: initial;
2203      --tw-skew-x: initial;
2204      --tw-skew-y: initial;
2205      --tw-space-y-reverse: 0;
2206      --tw-space-x-reverse: 0;
2207      --tw-divide-y-reverse: 0;
2208      --tw-border-style: solid;
2209      --tw-leading: initial;
2210      --tw-font-weight: initial;
2211      --tw-tracking: initial;
2212      --tw-shadow: 0 0 #0000;
2213      --tw-shadow-color: initial;
2214      --tw-shadow-alpha: 100%;
2215      --tw-inset-shadow: 0 0 #0000;
2216      --tw-inset-shadow-color: initial;
2217      --tw-inset-shadow-alpha: 100%;
2218      --tw-ring-color: initial;
2219      --tw-ring-shadow: 0 0 #0000;
2220      --tw-inset-ring-color: initial;
2221      --tw-inset-ring-shadow: 0 0 #0000;
2222      --tw-ring-inset: initial;
2223      --tw-ring-offset-width: 0px;
2224      --tw-ring-offset-color: #fff;
2225      --tw-ring-offset-shadow: 0 0 #0000;
2226      --tw-outline-style: solid;
2227      --tw-blur: initial;
2228      --tw-brightness: initial;
2229      --tw-contrast: initial;
2230      --tw-grayscale: initial;
2231      --tw-hue-rotate: initial;
2232      --tw-invert: initial;
2233      --tw-opacity: initial;
2234      --tw-saturate: initial;
2235      --tw-sepia: initial;
2236      --tw-drop-shadow: initial;
2237      --tw-drop-shadow-color: initial;
2238      --tw-drop-shadow-alpha: 100%;
2239      --tw-drop-shadow-size: initial;
2240      --tw-backdrop-blur: initial;
2241      --tw-backdrop-brightness: initial;
2242      --tw-backdrop-contrast: initial;
2243      --tw-backdrop-grayscale: initial;
2244      --tw-backdrop-hue-rotate: initial;
2245      --tw-backdrop-invert: initial;
2246      --tw-backdrop-opacity: initial;
2247      --tw-backdrop-saturate: initial;
2248      --tw-backdrop-sepia: initial;
2249      --tw-duration: initial;
2250      --tw-ease: initial;
2251    }
2252  }
2253}
2254`,ry=0;function k(e,t,n,o,i,r){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ry,__i:-1,__u:0,__source:i,__self:r};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return Ce.vnode&&Ce.vnode(c),c}var fi=(e=>(e[e.Degree0=0]="Degree0",e[e.Degree90=1]="Degree90",e[e.Degree180=2]="Degree180",e[e.Degree270=3]="Degree270",e))(fi||{});function ay(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function sy(e){return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}function cS(e){return{origin:ay(e.origin),size:sy(e.size)}}function $a(e){const{width:t,height:n}=e;return{width:n,height:t}}function ar(e,t,n){return{width:(e=t%2==0?e:$a(e)).width*n,height:e.height*n}}function dS(e){const t=[e.p1.x,e.p2.x,e.p3.x,e.p4.x],n=[e.p1.y,e.p2.y,e.p3.y,e.p4.y];return{origin:{x:Math.min(...t),y:Math.min(...n)}
vendor: 11,114 bytes, line 2254
2254,size:{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}}}function uS(e){return{p1:{x:e.origin.x,y:e.origin.y},p2:{x:e.origin.x+e.size.width,y:e.origin.y},p3:{x:e.origin.x+e.size.width,y:e.origin.y+e.size.height},p4:{x:e.origin.x,y:e.origin.y+e.size.height}}}function qu(e,t,n){let o=t.x,i=t.y;switch(n){case 0:o=t.x,i=t.y;break;case 1:o=e.height-t.y,i=t.x;break;case 2:o=e.width-t.x,i=e.height-t.y;break;case 3:o=t.y,i=e.width-t.x}return{x:o,y:i}}function Yi(e,t){return{x:e.x*t,y:e.y*t}}function _t(e){if(e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};const t=e.map(r=>r.x),n=e.map(r=>r.y),o=Math.min(...t),i=Math.min(...n);return{origin:{x:o,y:i},size:{width:Math.max(...t)-o,height:Math.max(...n)-i}}}function Ku(e,t,n){const o=Math.cos(t),i=Math.sin(t),r=e.x*o-e.y*i,a=e.x*i+e.y*o;return{x:r+n.x,y:a+n.y}}function Et(e,t){return{origin:{x:e.origin.x-t,y:e.origin.y-t},size:{width:e.size.width+2*t,height:e.size.height+2*t}}}function Ps(e,t,n){let o=t.origin.x,i=t.origin.y,r=t.size;switch(n){case 0:break;case 1:o=e.height-t.origin.y-t.size.height,i=t.origin.x,r=$a(t.size);break;case 2:o=e.width-t.origin.x-t.size.width,i=e.height-t.origin.y-t.size.height;break;case 3:o=t.origin.y,i=e.width-t.origin.x-t.size.width,r=$a(t.size)}return{origin:{x:o,y:i},size:{width:r.width,height:r.height}}}function Vu(e,t){return{origin:{x:e.origin.x*t,y:e.origin.y*t},size:{width:e.size.width*t,height:e.size.height*t}}}function ly(e,t,n,o){return Vu(Ps(e,t,n),o)}const cy={origin:{x:0,y:0},size:{width:0,height:0}};function Ms(e){if(e.length===0)return null;let t=e[0].origin.x,n=e[0].origin.y,o=e[0].origin.x+e[0].size.width,i=e[0].origin.y+e[0].size.height;for(const r of e)t=Math.min(t,r.origin.x),n=Math.min(n,r.origin.y),o=Math.max(o,r.origin.x+r.size.width),i=Math.max(i,r.origin.y+r.size.height);return{origin:{x:t,y:n},size:{width:o-t,height:i-n}}}function Mi(e){const t=e%360;return t<0?t+360:t}function Jn(e){return{x:e.origin.x+e.size.width/2,y:e.origin.y+e.size.height/2}}function eo(e,t,n){const o=n*Math.PI/180,i=Math.cos(o),r=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*i-s*r,y:t.y+a*r+s*i}}function Xu(e,t,n){return e.map(o=>eo(o,t,n))}function On(e,t,n){return _t(Xu([{x:e.origin.x,y:e.origin.y},{x:e.origin.x+e.size.width,y:e.origin.y},{x:e.origin.x+e.size.width,y:e.origin.y+e.size.height},{x:e.origin.x,y:e.origin.y+e.size.height}],n,t))}function Ds(e,t){return On(e,t,Jn(e))}function Zu(e,t,n){const o=n*Math.PI/180,i=Math.cos(o),r=Math.sin(o),a=1-i,s=r,l=-r,c=1-i,d=a*c-s*l,u=Jn(e);if(Math.abs(d)<1e-10)return u;const m=Jn(t),g=m.x-(i*u.x-r*u.y),p=m.y-(r*u.x+i*u.y);return{x:(c*g-s*p)/d,y:(-l*g+a*p)/d}}function hS(e,t,n,o){const i=e.origin.x,r=e.origin.y,a=e.size.width,s=e.size.height,l=n/a,c=o/s,d=n/s,u=o/a;switch(t){case 0:return{a:l,b:0,c:0,d:c,e:-l*i,f:-c*r};case 3:return{a:0,b:-u,c:d,d:0,e:-d*r,f:u*(i+a)};case 2:return{a:-l,b:0,c:0,d:-c,e:l*(i+a),f:c*(r+s)};case 1:return{a:0,b:u,c:-d,d:0,e:d*(r+s),f:-u*i}}}function Wl(e,t){const n=Math.min(t.width/e.width,t.height/e.height,1);return{width:e.width*n,height:e.height*n}}class Yu{isEnabled(){return!1}debug(){}info(){}warn(){}error(){}perf(){}}class Qu{isEnabled(){return!0}debug(t,n,...o){console.debug(`${t}.${n}`,...o)}info(t,n,...o){console.info(`${t}.${n}`,...o)}warn(t,n,...o){console.warn(`${t}.${n}`,...o)}error(t,n,...o){console.error(`${t}.${n}`,...o)}perf(t,n,o,i,...r){console.info(`${t}.${n}.${o}.${i}`,...r)}}class dy{constructor(t,n){this.logger=t,this.level=n}isEnabled(t){return this.level<={debug:0,info:1,warn:2,error:3}[t]}debug(t,n,...o){this.level<=0&&this.logger.debug(t,n,...o)}info(t,n,...o){this.level<=1&&this.logger.info(t,n,...o)}warn(t,n,...o){this.level<=2&&this.logger.warn(t,n,...o)}error(t,n,...o){this.level<=3&&this.logger.error(t,n,...o)}perf(t,n,o,i,...r){this.logger.perf(t,n,o,i,...r)}}class Ju{constructor(){this.marks=new Map}isEnabled(){return!1}debug(t,n,...o){}info(t,n,...o){}warn(t,n,...o){}error(t,n,...o){}perf(t,n,o,i,r,...a){const s=`${t}.${n}.${o}.${i}.${r}`;switch(i){case"Begin":globalThis.performance.mark(s,{detail:a}),this.marks.set(`${t}.${n}.${o}.${r}`,Date.now());break;case"End":globalThis.performance.mark(s,{detail:a});const l=`${t}.${n}.${o}.Measure.${r}`,c=`${t}.${n}.${o}.Begin.${r}`;globalThis.performance.measure(l,c,s);const d=this.marks.get(`${t}.${n}.${o}.${r}`);if(d){const u=Date.now()-d;console.info(`⏱️ ${t}.${n}.${o}.${r}: ${u}ms`),this.marks.delete(`${t}.${n}.${o}.${r}`)}}}}class eh{constructor(t){this.loggers=t}isEnabled(t){return this.loggers.some(n=>n.isEnabled(t))}debug(t,n,...o){for(const i of this.loggers)i.debug(t,n,...o)}info(t,n,...o){for(const i of this.loggers)i.info(t,n,...o)}warn(t,n,...o){for(const i of this.loggers)i.warn(t,n,...o)}error(t,n,...o){for(const i of this.loggers)i.error(t,n,...o)}perf(t,n,o,i,...r){for(const a of this.loggers)a.perf(t,n,o,i,...r)}}var Tn=(e=>(e[e.Pending=0]="Pending",e[e.Resolved=1]="Resolved",e[e.Rejected=2]="Rejected",e[e.Aborted=3]="Aborted",e))(Tn||{});class fo extends Error{constructor(t){super(`Task aborted: ${JSON.stringify(t)}`),this.name="TaskAbortedError",this.reason=t}}class Qi extends Error{constructor(t){super(`Task rejected: ${JSON.stringify(t)}`),this.name="TaskRejectedError",this.reason=t}}class se{constructor(){this.state={stage:0},this.resolvedCallbacks=[],this.rejectedCallbacks=[],this._promise=null,this.progressCbs=[]}toPromise(){return this._promise||(this._promise=new Promise((t,n)=>{this.wait(o=>t(o),o=>{o.type==="abort"?n(new fo(o.reason)):n(new Qi(o.reason))})})),this._promise}wait(t,n){switch(this.state.stage){case 0:this.resolvedCallbacks.push(t),this.rejectedCallbacks.push(n);break;case 1:t(this.state.result);break;case 2:n({type:"reject",reason:this.state.reason});break;case 3:n({type:"abort",reason:this.state.reason})}}resolve(t){if(this.state.stage===0){this.state={stage:1,result:t};for(const n of this.resolvedCallbacks)try{n(t)}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}reject(t){if(this.state.stage===0){this.state={stage:2,reason:t};for(const n of this.rejectedCallbacks)try{n({type:"reject",reason:t})}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}abort(t){if(this.state.stage===0){this.state={stage:3,reason:t};for(const n of this.rejectedCallbacks)try{n({type:"abort",reason:t})}catch{}this.resolvedCallbacks=[],this.rejectedCallbacks=[]}}fail(t){t.type==="abort"?this.abort(t.reason):this.reject(t.reason)}onProgress(t){this.progressCbs.push(t)}progress(t){for(const n of this.progressCbs)n(t)}static all(t){const n=new se;if(t.length===0)return n.resolve([]),n;const o=new Array(t.length);let i=0,r=!1;return t.forEach((a,s)=>{a.wait(l=>{r||(o[s]=l,i++,i===t.length&&(r=!0,n.resolve(o)))},l=>{r||(r=!0,l.type==="abort"?n.abort(l.reason):n.reject(l.reason))})}),n}static allSettled(t){const n=new se;if(t.length===0)return n.resolve([]),n;const o=new Array(t.length);let i=0;return t.forEach((r,a)=>{r.wait(s=>{o[a]={status:"resolved",value:s},i++,i===t.length&&n.resolve(o)},s=>{o[a]={status:s.type==="abort"?"aborted":"rejected",reason:s.reason},i++,i===t.length&&n.resolve(o)})}),n}static race(t){const n=new se;if(t.length===0)return n.reject("No tasks provided"),n;let o=!1;return t.forEach(i=>{i.wait(r=>{o||(o=!0,n.resolve(r))},r=>{o||(o=!0,r.type==="abort"?n.abort(r.reason):n.reject(r.reason))})}),n}static withProgress(t,n){const o=se.all(t);if(n){let i=0;t.forEach(r=>{r.wait(()=>{i++,n(i,t.length)},()=>{i++,n(i,t.length)})})}return o}}const uy=Object.freeze(["­","​","⁠","\uFEFF","￾","￿"]),hy=new RegExp(`[${uy.join("")}]`,"g");function mS(e){return e.replace(hy,"")}var Sr=(e=>(e[e.Unknown=0]="Unknown",e[e.XYZ=1]="XYZ",e[e.FitPage=2]="FitPage",e[e.FitHorizontal=3]="FitHorizontal",e[e.FitVertical=4]="FitVertical",e[e.FitRectangle=5]="FitRectangle",e[e.FitBoundingBox=6]="FitBoundingBox",e[e.FitBoundingBoxHorizontal=7]="FitBoundingBoxHorizontal",e[e.FitBoundingBoxVertical=8]="FitBoundingBoxVertical",e))(Sr||{}),my=(e=>(e[e.NotSet=0]="NotSet",e[e.True=1]="True",e[e.False=2]="False",e[e.Unknown=3]="Unknown",e))(my||{}),Ee=(e=>(e[e.Unknown=-1]="Unknown",e[e.Courier=0]="Courier",e[e.Courier_Bold=1]="Courier_Bold",e[e.Courier_BoldOblique=2]="Courier_BoldOblique",e[e.Courier_Oblique=3]="Courier_Oblique",e[e.Helvetica=4]="Helvetica",e[e.Helvetica_Bold=5]="Helvetica_Bold",e[e.Helvetica_BoldOblique=6]="Helvetica_BoldOblique",e[e.Helvetica_Oblique=7]="Helvetica_Oblique",e[e.Times_Roman=8]="Times_Roman",e[e.Times_Bold=9]="Times_Bold",e[e.Times_BoldItalic=10]="Times_BoldItalic",e[e.Times_Italic=11]="Times_Italic",e[e.Symbol=12]="Symbol",e[e.ZapfDingbats=13]="ZapfDingbats",e))(Ee||{}),Xe=(e=>(e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right",e))(Xe||{}),mt=(e=>(e[e.Top=0]="Top",e[e.Middle=1]="Middle",e[e.Bottom=2]="Bottom",e))(mt||{}),ve=(e=>(e[e.Normal=0]="Normal",e[e.Multiply=1]="Multiply",e[e.Screen=2]="Screen",e[e.Overlay=3]="Overlay",e[e.Darken=4]="Darken",e[e.Lighten=5]="Lighten",e[e.ColorDodge=6]="ColorDodge",e[e.ColorBurn=7]="ColorBurn",e[e.HardLight=8]="HardLight",e[e.SoftLight=9]="SoftLight",e[e.Difference=10]="Difference",e[e.Exclusion=11]="Exclusion",e[e.Hue=12]="Hue",e[e.Saturation=13]="Saturation",e[e.Color=14]="Color",e[e.Luminosity=15]="Luminosity",e))(ve||{}),th=(e=>(e[e.Contain=0]="Contain",e[e.Cover=1]="Cover",e[e.Stretch=2]="Stretch",e))(th||{}),zn=(e=>(e[e.Unsupported=0]="Unsupported",e[e.Goto=1]="Goto",e[e.RemoteGoto=2]="RemoteGoto",e[e.URI=3]="URI",e[e.LaunchAppOrOpenFile=4]="LaunchAppOrOpenFile",e))(zn||{});const pS=1,gS=2,fS=4;var T=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXT=1]="TEXT",e[e.LINK=2]="LINK",e[e.FREETEXT=3]="FREETEXT",e[e.LINE=4]="LINE",e[e.SQUARE=5]="SQUARE",e[e.CIRCLE=6]="CIRCLE",e[e.POLYGON=7]="POLYGON",e[e.POLYLINE=8]="POLYLINE",e[e.HIGHLIGHT=9]="HIGHLIGHT",e[e.UNDERLINE=10]="UNDERLINE",e[e.SQUIGGLY=11]="SQUIGGLY",e[e.STRIKEOUT=12]="STRIKEOUT",e[e.STAMP=13]="STAMP",e[e.CARET=14]="CARET",e[e.INK=15]="INK",e[e.POPUP=16]="POPUP",e[e.FILEATTACHMENT=17]="FILEATTACHMENT",e[e.SOUND=18]="SOUND",e[e.MOVIE=19]="MOVIE",e[e.WIDGET=20]="WIDGET",e[e.SCREEN=21]="SCREEN",e[e.PRINTERMARK=22]="PRINTERMARK",e[e.TRAPNET=23]="TRAPNET",e[e.WATERMARK=24]="WATERMARK",e[e.THREED=25]="THREED",e[e.RICHMEDIA=26]="RICHMEDIA",e[e.XFAWIDGET=27]="XFAWIDGET",e[e.REDACT=28]="REDACT",e))(T||{}),nh=(e=>(e[e.Created=0]="Created",e[e.Committed=1]="Committed",e))(nh||{}),oh=(e=>(e[e.Normal=0]="Normal",e[e.Rollover=1]="Rollover",e[e.Down=2]="Down",e))(oh||{}),ih=(e=>(e.Marked="Marked",e.Unmarked="Unmarked",e.Accepted="Accepted",e.Rejected="Rejected",e.Completed="Completed",e.Cancelled="Cancelled",e.None="None",e))(ih||{}),rh=(e=>(e.Marked="Marked",e.Review="Review",e))(rh||{}),Pe=(e=>(e[e.Unknown=-1]="Unknown",e[e.Comment=0]="Comment",e[e.Key=1]="Key",e[e.Note=2]="Note",e[e.Help=3]="Help",e[e.NewParagraph=4]="NewParagraph",e[e.Paragraph=5]="Paragraph",e[e.Insert=6]="Insert",e[e.Graph=7]="Graph",e[e.PushPin=8]="PushPin",e[e.Paperclip=9]="Paperclip",e[e.Tag=10]="Tag",e[e.Speaker=11]="Speaker",e[e.Mic=12]="Mic",e[e.Approved=13]="Approved",e[e.Experimental=14]="Experimental",e[e.NotApproved=1
22545]="NotApproved",e[e.AsIs=16]="AsIs",e[e.Expired=17]="Expired",e[e.NotForPublicRelease=18]="NotForPublicRelease",e[e.Confidential=19]="Confidential",e[e.Final=20]="Final",e[e.Sold=21]="Sold",e[e.Departmental=22]="Departmental",e[e.ForComment=23]="ForComment",e[e.TopSecret=24]="TopSecret",e[e.Draft=25]="Draft",e[e.ForPublicRelease=26]="ForPublicRelease",e[e.Completed=27]="Completed",e[e.Void=28]="Void",e[e.PreliminaryResults=29]="PreliminaryResults",e[e.InformationOnly=30]="InformationOnly",e[e.Rejected=31]="Rejected",e[e.Witness=32]="Witness",e[e.InitialHere=33]="InitialHere",e[e.SignHere=34]="SignHere",e[e.Accepted=35]="Accepted",e[e.Custom=36]="Custom",e[e.Image=37]="Image",e))(Pe||{});const py=Pe;var ge=(e=>(e[e.None=0]="None",e[e.Square=1]="Square",e[e.Circle=2]="Circle",e[e.Diamond=3]="Diamond",e[e.OpenArrow=4]="OpenArrow",e[e.ClosedArrow=5]="ClosedArrow",e[e.Butt=6]="Butt",e[e.ROpenArrow=7]="ROpenArrow",e[e.RClosedArrow=8]="RClosedArrow",e[e.Slash=9]="Slash",e[e.Unknown=10]="Unknown",e))(ge||{}),Ut=(e=>(e[e.Unknown=0]="Unknown",e[e.Reply=1]="Reply",e[e.Group=2]="Group",e))(Ut||{}),he=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.PUSHBUTTON=1]="PUSHBUTTON",e[e.CHECKBOX=2]="CHECKBOX",e[e.RADIOBUTTON=3]="RADIOBUTTON",e[e.COMBOBOX=4]="COMBOBOX",e[e.LISTBOX=5]="LISTBOX",e[e.TEXTFIELD=6]="TEXTFIELD",e[e.SIGNATURE=7]="SIGNATURE",e[e.XFA=8]="XFA",e[e.XFA_CHECKBOX=9]="XFA_CHECKBOX",e[e.XFA_COMBOBOX=10]="XFA_COMBOBOX",e[e.XFA_IMAGEFIELD=11]="XFA_IMAGEFIELD",e[e.XFA_LISTBOX=12]="XFA_LISTBOX",e[e.XFA_PUSHBUTTON=13]="XFA_PUSHBUTTON",e[e.XFA_SIGNATURE=14]="XFA_SIGNATURE",e[e.XFA_TEXTFIELD=15]="XFA_TEXTFIELD",e))(he||{}),gy=(e=>(e[e.Color=0]="Color",e[e.InteriorColor=1]="InteriorColor",e[e.OverlayColor=2]="OverlayColor",e[e.TextColor=3]="TextColor",e))(gy||{}),ke=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.SOLID=1]="SOLID",e[e.DASHED=2]="DASHED",e[e.BEVELED=3]="BEVELED",e[e.INSET=4]="INSET",e[e.UNDERLINE=5]="UNDERLINE",e[e.CLOUDY=6]="CLOUDY",e))(ke||{}),ah=(e=>(e[e.NONE=0]="NONE",e[e.INVISIBLE=1]="INVISIBLE",e[e.HIDDEN=2]="HIDDEN",e[e.PRINT=4]="PRINT",e[e.NO_ZOOM=8]="NO_ZOOM",e[e.NO_ROTATE=16]="NO_ROTATE",e[e.NO_VIEW=32]="NO_VIEW",e[e.READ_ONLY=64]="READ_ONLY",e[e.LOCKED=128]="LOCKED",e[e.TOGGLE_NOVIEW=256]="TOGGLE_NOVIEW",e[e.LOCKED_CONTENTS=512]="LOCKED_CONTENTS",e))(ah||{}),me=(e=>(e[e.NONE=0]="NONE",e[e.READONLY=1]="READONLY",e[e.REQUIRED=2]="REQUIRED",e[e.NOEXPORT=4]="NOEXPORT",e[e.TEXT_MULTIPLINE=4096]="TEXT_MULTIPLINE",e[e.TEXT_PASSWORD=8192]="TEXT_PASSWORD",e[e.TEXT_FILESELECT=1048576]="TEXT_FILESELECT",e[e.TEXT_DONOTSPELLCHECK=4194304]="TEXT_DONOTSPELLCHECK",e[e.TEXT_DONOTSCROLL=8388608]="TEXT_DONOTSCROLL",e[e.TEXT_COMB=16777216]="TEXT_COMB",e[e.TEXT_RICHTEXT=33554432]="TEXT_RICHTEXT",e[e.BUTTON_NOTOGGLETOOFF=16384]="BUTTON_NOTOGGLETOOFF",e[e.BUTTON_RADIO=32768]="BUTTON_RADIO",e[e.BUTTON_PUSHBUTTON=65536]="BUTTON_PUSHBUTTON",e[e.BUTTON_RADIOSINUNISON=33554432]="BUTTON_RADIOSINUNISON",e[e.CHOICE_COMBO=131072]="CHOICE_COMBO",e[e.CHOICE_EDIT=262144]="CHOICE_EDIT",e[e.CHOICE_SORT=524288]="CHOICE_SORT",e[e.CHOICE_MULTL_SELECT=2097152]="CHOICE_MULTL_SELECT",e[e.CHOICE_DONOTSPELLCHECK=4194304]="CHOICE_DONOTSPELLCHECK",e[e.CHOICE_COMMITONSELCHANGE=67108864]="CHOICE_COMMITONSELCHANGE",e))(me||{}),fy=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXT=1]="TEXT",e[e.PATH=2]="PATH",e[e.IMAGE=3]="IMAGE",e[e.SHADING=4]="SHADING",e[e.FORM=5]="FORM",e))(fy||{});const ja=Object.freeze({1:"invisible",2:"hidden",4:"print",8:"noZoom",16:"noRotate",32:"noView",64:"readOnly",128:"locked",256:"toggleNoView",512:"lockedContents"}),vy=Object.entries(ja).reduce((e,[t,n])=>(e[n]=Number(t),e),{});function yy(e){return Object.keys(ja).filter(t=>(e&t)!==0).map(t=>ja[t])}function by(e){return e.reduce((t,n)=>t|vy[n],0)}function Kn(e){return e.exportValue!=null&&e.field.value===e.exportValue}var wy=(e=>(e[e.KEY_STROKE=12]="KEY_STROKE",e[e.FORMAT=13]="FORMAT",e[e.VALIDATE=14]="VALIDATE",e[e.CALCULATE=15]="CALCULATE",e))(wy||{}),xy=(e=>(e.Keystroke="keystroke",e.Format="format",e.Validate="validate",e.Calculate="calculate",e))(xy||{}),ky=(e=>(e.DocumentNamed="document_named",e.WidgetKeystroke="widget_keystroke",e.WidgetFormat="widget_format",e.WidgetValidate="widget_validate",e.WidgetCalculate="widget_calculate",e))(ky||{}),Cy=(e=>(e[e.Create=0]="Create",e[e.Read=1]="Read",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e))(Cy||{}),Xo=(e=>(e[e.None=0]="None",e[e.MatchCase=1]="MatchCase",e[e.MatchWholeWord=2]="MatchWholeWord",e[e.MatchConsecutive=4]="MatchConsecutive",e))(Xo||{}),U=(e=>(e[e.Print=4]="Print",e[e.ModifyContents=8]="ModifyContents",e[e.CopyContents=16]="CopyContents",e[e.ModifyAnnotations=32]="ModifyAnnotations",e[e.FillForms=256]="FillForms",e[e.ExtractForAccessibility=512]="ExtractForAccessibility",e[e.AssembleDocument=1024]="AssembleDocument",e[e.PrintHighQuality=2048]="PrintHighQuality",e[e.AllowAll=3900]="AllowAll",e))(U||{});
vendor: 10,094 bytes, line 2254
2254class Iy extends Error{constructor(t,n){const o=t.map(i=>U[i]).join(", ");super(`Permission denied. Required: ${o}`),this.requiredFlags=t,this.currentPermissions=n,this.name="PermissionDeniedError"}}var Sy=(e=>(e[e.Display=0]="Display",e[e.Print=1]="Print",e))(Sy||{}),H=(e=>(e[e.Ok=0]="Ok",e[e.Unknown=1]="Unknown",e[e.NotFound=2]="NotFound",e[e.WrongFormat=3]="WrongFormat",e[e.Password=4]="Password",e[e.Security=5]="Security",e[e.PageError=6]="PageError",e[e.XFALoad=7]="XFALoad",e[e.XFALayout=8]="XFALayout",e[e.Cancelled=9]="Cancelled",e[e.Initialization=10]="Initialization",e[e.NotReady=11]="NotReady",e[e.NotSupport=12]="NotSupport",e[e.LoadDoc=13]="LoadDoc",e[e.DocNotOpen=14]="DocNotOpen",e[e.CantCloseDoc=15]="CantCloseDoc",e[e.CantCreateNewDoc=16]="CantCreateNewDoc",e[e.CantImportPages=17]="CantImportPages",e[e.CantCreateAnnot=18]="CantCreateAnnot",e[e.CantSetAnnotRect=19]="CantSetAnnotRect",e[e.CantSetAnnotContent=20]="CantSetAnnotContent",e[e.CantRemoveInkList=21]="CantRemoveInkList",e[e.CantAddInkStoke=22]="CantAddInkStoke",e[e.CantReadAttachmentSize=23]="CantReadAttachmentSize",e[e.CantReadAttachmentContent=24]="CantReadAttachmentContent",e[e.CantFocusAnnot=25]="CantFocusAnnot",e[e.CantSelectText=26]="CantSelectText",e[e.CantSelectOption=27]="CantSelectOption",e[e.CantCheckField=28]="CantCheckField",e[e.CantSetAnnotString=29]="CantSetAnnotString",e[e.CantDeletePage=30]="CantDeletePage",e))(H||{});class ne{static create(){return new se}static resolve(t){const n=new se;return n.resolve(t),n}static reject(t){const n=new se;return n.reject(t),n}static abort(t){const n=new se;return n.reject(t),n}}function vS(e){const t=n=>(o=>Math.max(0,Math.min(255,o)))(n).toString(16).padStart(2,"0");return`#${t(e.red)}${t(e.green)}${t(e.blue)}`}function Ay(e){/^#?[0-9a-f]{3}$/i.test(e)&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3").toLowerCase());const[,t,n,o]=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e)??(()=>{throw new Error(`Invalid hex colour: "${e}"`)})();return{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16)}}function yS(e){return(t=>Math.max(0,Math.min(255,t)))(e)/255}function bS(e){return((t,n=255)=>Math.max(0,Math.min(n,t)))(Math.round(255*e))}function wS(e){if(!e?.startsWith("D:")||e.length<16)return;const t=+e.slice(2,6),n=+e.slice(6,8)-1,o=+e.slice(8,10),i=+e.slice(10,12),r=+e.slice(12,14),a=+e.slice(14,16);return new Date(Date.UTC(t,n,o,i,r,a))}function xS(e=new Date){const t=(n,o=2)=>n.toString().padStart(o,"0");return`D:${e.getUTCFullYear()}${t(e.getUTCMonth()+1)}${t(e.getUTCDate())}${t(e.getUTCHours())}${t(e.getUTCMinutes())}${t(e.getUTCSeconds())}`}const Ua=Object.freeze([{id:Xe.Left,label:"Left",css:"left"},{id:Xe.Center,label:"Center",css:"center"},{id:Xe.Right,label:"Right",css:"right"}]),Hl=Ua.reduce((e,t)=>(e[t.id]=t,e),{});function Ar(e){return(function(t){return Hl[t]??Hl[Xe.Left]})(e).css}Ua.reduce((e,t)=>(e[t.css]=t.id,e),{}),Ua.map(e=>({value:e.id,label:e.label}));var sh=(e=>(e.Courier="Courier",e.Helvetica="Helvetica",e.Times="Times",e.Symbol="Symbol",e.ZapfDingbats="ZapfDingbats",e.Unknown="Unknown",e))(sh||{});const Py=Ee.Helvetica,lh={id:Ee.Helvetica,family:"Helvetica",bold:!1,italic:!1,label:"Helvetica",css:"Helvetica, Arial, sans-serif"},Ts=Object.freeze([{id:Ee.Courier,family:"Courier",bold:!1,italic:!1,label:"Courier",css:"Courier, monospace"},{id:Ee.Courier_Bold,family:"Courier",bold:!0,italic:!1,label:"Courier Bold",css:"Courier, monospace"},{id:Ee.Courier_BoldOblique,family:"Courier",bold:!0,italic:!0,label:"Courier Bold Oblique",css:"Courier, monospace"},{id:Ee.Courier_Oblique,family:"Courier",bold:!1,italic:!0,label:"Courier Oblique",css:"Courier, monospace"},lh,{id:Ee.Helvetica_Bold,family:"Helvetica",bold:!0,italic:!1,label:"Helvetica Bold",css:"Helvetica, Arial, sans-serif"},{id:Ee.Helvetica_BoldOblique,family:"Helvetica",bold:!0,italic:!0,label:"Helvetica Bold Oblique",css:"Helvetica, Arial, sans-serif"},{id:Ee.Helvetica_Oblique,family:"Helvetica",bold:!1,italic:!0,label:"Helvetica Oblique",css:"Helvetica, Arial, sans-serif"},{id:Ee.Times_Roman,family:"Times",bold:!1,italic:!1,label:"Times Roman",css:'"Times New Roman", Times, serif'},{id:Ee.Times_Bold,family:"Times",bold:!0,italic:!1,label:"Times Bold",css:'"Times New Roman", Times, serif'},{id:Ee.Times_BoldItalic,family:"Times",bold:!0,italic:!0,label:"Times Bold Italic",css:'"Times New Roman", Times, serif'},{id:Ee.Times_Italic,family:"Times",bold:!1,italic:!0,label:"Times Italic",css:'"Times New Roman", Times, serif'},{id:Ee.Symbol,family:"Symbol",bold:!1,italic:!1,label:"Symbol",css:"Symbol, serif"},{id:Ee.ZapfDingbats,family:"ZapfDingbats",bold:!1,italic:!1,label:"Zapf Dingbats",css:"ZapfDingbats, serif"}]),My=Ts.reduce((e,t)=>(e[t.id]=t,e),{}),ch=new Map;for(const e of Ts)ch.set(`${e.family}_${e.bold}_${e.italic}`,e.id);function Pr(e){return My[e]??lh}function Gl(e){return Pr(e).family}function Wo(e){return Pr(e).bold}function Ho(e){return Pr(e).italic}function Un(e,{bold:t,italic:n}){return ch.get(`${e}_${t}_${n}`)??Py}function Cn(e){const t=Pr(e);return{fontFamily:t.css,fontWeight:t.bold?"bold":"normal",fontStyle:t.italic?"italic":"normal"}}Object.values(sh).filter(e=>e!=="Unknown").map(e=>({value:e,label:e}));const Dy=[...new Set(Ts.map(e=>e.family))];function ql(e){switch(e){case"Courier":return"Courier";case"Helvetica":default:return"Helvetica";case"Times":return"Times";case"Symbol":return"Symbol";case"ZapfDingbats":return"ZapfDingbats"}}const sr=Object.freeze([{id:ve.Normal,label:"Normal",css:"normal"},{id:ve.Multiply,label:"Multiply",css:"multiply"},{id:ve.Screen,label:"Screen",css:"screen"},{id:ve.Overlay,label:"Overlay",css:"overlay"},{id:ve.Darken,label:"Darken",css:"darken"},{id:ve.Lighten,label:"Lighten",css:"lighten"},{id:ve.ColorDodge,label:"Color Dodge",css:"color-dodge"},{id:ve.ColorBurn,label:"Color Burn",css:"color-burn"},{id:ve.HardLight,label:"Hard Light",css:"hard-light"},{id:ve.SoftLight,label:"Soft Light",css:"soft-light"},{id:ve.Difference,label:"Difference",css:"difference"},{id:ve.Exclusion,label:"Exclusion",css:"exclusion"},{id:ve.Hue,label:"Hue",css:"hue"},{id:ve.Saturation,label:"Saturation",css:"saturation"},{id:ve.Color,label:"Color",css:"color"},{id:ve.Luminosity,label:"Luminosity",css:"luminosity"}]),Kl=sr.reduce((e,t)=>(e[t.id]=t,e),{});function vo(e){return(function(t){return Kl[t]??Kl[ve.Normal]})(e).css}sr.reduce((e,t)=>(e[t.css]=t.id,e),{}),sr.map(e=>({value:e.id,label:e.label}));const Ty=sr.map(e=>e.id);function Vl(e){if(e instanceof Yu)return{type:"noop"};if(e instanceof Qu)return{type:"console"};if(e instanceof Ju)return{type:"perf"};if(e instanceof dy){const t=e;return{type:"level",config:{level:t.level,logger:Vl(t.logger)}}}return e instanceof eh?{type:"all",config:{loggers:e.loggers.map(Vl)}}:{type:"noop"}}function pe(){var e;if(typeof((e=globalThis.crypto)==null?void 0:e.randomUUID)=="function")return globalThis.crypto.randomUUID();const t=(function(o){var i;if(typeof((i=globalThis.crypto)==null?void 0:i.getRandomValues)=="function")return globalThis.crypto.getRandomValues(new Uint8Array(o));if(typeof require=="function")try{const{randomBytes:a}=require("crypto");return a(o)}catch{}const r=new Uint8Array(o);for(let a=0;a<o;a++)r[a]=Math.floor(256*Math.random());return r})(16);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}class Zo extends se{constructor(t={}){super(),this.children=new Map,this.childResults=[],this.completedCount=0,this.expectedCount=0,this.isFinalized=!1,this.config={aggregate:t.aggregate??(n=>n),onChildComplete:t.onChildComplete??(()=>{}),failFast:t.failFast??!0}}addChild(t,n){if(this.state.stage!==Tn.Pending)return this.state.stage===Tn.Aborted&&t.abort(this.state.reason),this;const o=n??this.expectedCount;return this.expectedCount=Math.max(this.expectedCount,o+1),this.children.set(t,o),t.wait(i=>this.handleChildSuccess(t,i,o),i=>this.handleChildError(t,i,o)),this}finalize(){return this.isFinalized||(this.isFinalized=!0,this.expectedCount===0&&this.resolve(this.config.aggregate([]))),this}handleChildSuccess(t,n,o){if(this.state.stage!==Tn.Pending)return;this.childResults[o]=n,this.completedCount++,this.children.delete(t);const i=this.config.onChildComplete(this.completedCount,this.expectedCount,n,o);if(i!==void 0&&this.progress(i),this.completedCount===this.expectedCount){const r=this.config.aggregate(this.childResults);this.resolve(r)}}handleChildError(t,n,o){if(this.state.stage===Tn.Pending){if(this.children.delete(t),this.config.failFast){for(const[i]of this.children)i.abort("Sibling task failed");this.children.clear(),this.fail(n)}else if(this.childResults[o]=void 0,this.completedCount++,this.completedCount===this.expectedCount){const i=this.config.aggregate(this.childResults);this.resolve(i)}}}abort(t){for(const[n]of this.children)n.abort(t);this.children.clear(),super.abort(t)}reject(t){for(const[n]of this.children)n.abort(t);this.children.clear(),super.reject(t)}getPendingCount(){return this.children.size}getCompletedCount(){return this.completedCount}static gather(t){const n=new Zo({aggregate:o=>o,onChildComplete:(o,i)=>({completed:o,total:i})});return t.forEach((o,i)=>n.addChild(o,i)),n.finalize(),n}static gatherIndexed(t){const n=new Zo({aggregate:o=>{const i={};return o.forEach((r,a)=>{i[a]=r}),i},onChildComplete:(o,i,r,a)=>({page:a,result:r})});return t.forEach((o,i)=>n.addChild(o,i)),n.finalize(),n}static gatherFrom(t,n){const o=new Zo(n);return t.forEach((i,r)=>o.addChild(i,r)),o.finalize(),o}static first(t){let n=!1;const o=new Zo({aggregate:i=>i[0],failFast:!1});return o.handleChildSuccess=(i,r)=>{if(!n){n=!0;for(const[a]of o.children)a!==i&&a.abort("Race won by sibling");o.resolve(r)}},t.forEach((i,r)=>o.addChild(i,r)),o.finalize(),o}}class ra{constructor(t){this.parentTask=t,this.activeChild=null,this.disposed=!1;const n=t.abort.bind(t);t.abort=o=>{var i;this.disposed=!0,(i=this.activeChild)==null||i.abort(o),n(o)}}run(t){return new Promise((n,o)=>
2254{if(this.disposed||this.parentTask.state.stage!==Tn.Pending)return void o(new fo("Sequence aborted"));const i=t();this.activeChild=i,i.wait(r=>{this.activeChild=null,n(r)},r=>{this.activeChild=null,r.type==="abort"?o(new fo(r.reason)):o(new Qi(r.reason))})})}runWithProgress(t,n){return new Promise((o,i)=>{if(this.disposed||this.parentTask.state.stage!==Tn.Pending)return void i(new fo("Sequence aborted"));const r=t();this.activeChild=r,r.onProgress(a=>{this.parentTask.progress(n(a))}),r.wait(a=>{this.activeChild=null,o(a)},a=>{this.activeChild=null,a.type==="abort"?i(new fo(a.reason)):i(new Qi(a.reason))})})}execute(t,n){t().catch(o=>{o instanceof fo||(o instanceof Qi?this.parentTask.reject(o.reason):this.parentTask.reject(n(o)))})}}function Xl(e){if(e.byteLength<4)return null;const t=new Uint8Array(e);return t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71?(function(n){if(n.byteLength<24)return null;const o=new DataView(n),i=o.getUint32(16),r=o.getUint32(20);return i===0||r===0?null:{mimeType:"image/png",width:i,height:r}})(e):t[0]===255&&t[1]===216&&t[2]===255?(function(n){const o=new Uint8Array(n);let i=2;for(;i+4<o.byteLength;){if(o[i]!==255)return null;const r=o[i+1];if(r>=192&&r<=195){if(i+9>o.byteLength)return null;const a=new DataView(n,i+5),s=a.getUint16(0),l=a.getUint16(2);return l===0||s===0?null:{mimeType:"image/jpeg",width:l,height:s}}r===216||r===217?i+=2:r===255?i+=1:i+=2+(o[i+2]<<8|o[i+3])}return null})(e):t[0]===37&&t[1]===80&&t[2]===68&&t[3]===70?{mimeType:"application/pdf"}:null}function et(){}class Zl{constructor(){this.dependencyGraph=new Map}addNode(t,n=[]){this.dependencyGraph.set(t,new Set(n))}hasCircularDependencies(){const t=new Set,n=new Set,o=i=>{t.add(i),n.add(i);const r=this.dependencyGraph.get(i)||new Set;for(const a of r)if(t.has(a)){if(n.has(a))return!0}else if(o(a))return!0;return n.delete(i),!1};for(const i of this.dependencyGraph.keys())if(!t.has(i)&&o(i))return!0;return!1}resolveLoadOrder(){if(this.hasCircularDependencies())throw new Error("Circular dependencies detected");const t=[],n=new Set,o=new Set,i=r=>{if(o.has(r))throw new Error("Circular dependency");if(n.has(r))return;o.add(r);const a=this.dependencyGraph.get(r)||new Set;for(const s of a)i(s);o.delete(r),n.add(r),t.push(r)};for(const r of this.dependencyGraph.keys())n.has(r)||i(r);return t}}class Ct extends Error{constructor(t){super(t),this.name="PluginRegistrationError"}}
vendor: 5,209 bytes, line 2254
2254class mo extends Error{constructor(t){super(t),this.name="PluginNotFoundError"}}class Ry extends Error{constructor(t){super(t),this.name="CircularDependencyError"}}class Ey extends Error{constructor(t){super(t),this.name="PluginConfigurationError"}}class zy{constructor(t,n){this.store=t,this.pluginId=n}getState(){return this.store.getState().plugins[this.pluginId]}dispatch(t){return this.store.dispatchToPlugin(this.pluginId,t)}subscribeToState(t){return this.store.subscribeToPlugin(this.pluginId,(n,o,i)=>{t(n,o,i)})}onAction(t,n){return this.store.onAction(t,(o,i,r)=>{n(o,i.plugins[this.pluginId],r.plugins[this.pluginId])})}}const Mr="START_LOADING_DOCUMENT",dh="UPDATE_DOCUMENT_LOADING_PROGRESS",Dr="SET_DOCUMENT_LOADED",Rs="SET_DOCUMENT_ERROR",Es="RETRY_LOADING_DOCUMENT",Tr="CLOSE_DOCUMENT",zs="SET_ACTIVE_DOCUMENT",Ls="REORDER_DOCUMENTS",Ns="MOVE_DOCUMENT",Os="UPDATE_DOCUMENT_SECURITY",zo="REFRESH_PAGES",Rr="SET_SCALE",Er="SET_ROTATION",Ly=[Mr,dh,Dr,Tr,zs,Rs,Es,"REFRESH_DOCUMENT",zo,"SET_PAGES",Rr,Er,"SET_DEFAULT_SCALE","SET_DEFAULT_ROTATION",Ls,Ns,Os],Yl=(e,t,n,o,i,r,a)=>({type:Mr,payload:{documentId:e,name:t,scale:n,rotation:o,passwordProvided:i,autoActivate:r,permissions:a}}),Ql=(e,t)=>({type:Tr,payload:{documentId:e,nextActiveDocumentId:t}}),Di=(e,t)=>({type:zo,payload:{documentId:e,pageIndexes:t}}),Jl=(e,t)=>({type:Er,payload:{rotation:e,documentId:t}});class Ny{constructor(t,n){this.initialCoreState=n,this.pluginReducers={},this.listeners=[],this.pluginListeners={},this.isDispatching=!1,this.state={core:n,plugins:{}},this.coreReducer=t}addPluginReducer(t,n,o){this.state.plugins[t]=o,this.pluginReducers[t]=n}dispatchToCore(t){if(!this.coreReducer)return this.getState();if(this.isDispatching)throw new Error("Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.");const n=this.getState();try{this.isDispatching=!0,this.state.core=this.coreReducer(this.state.core,t)}finally{this.isDispatching=!1}return this.listeners.forEach(o=>{const i=this.getState();o(t,i,n)}),this.getState()}dispatchToPlugin(t,n,o=!0){if(this.isDispatching)throw new Error("Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.");const i=this.getState(),r=this.pluginReducers[t];if(!r)return i.plugins[t];const a=i.plugins[t];try{this.isDispatching=!0;const s=r(a,n);this.state.plugins[t]=s}finally{this.isDispatching=!1}return o&&this.listeners.forEach(s=>{const l=this.getState();s(n,l,i)}),this.pluginListeners[t]&&this.pluginListeners[t].forEach(s=>{const l=this.getState().plugins[t];s(n,l,a)}),this.getState().plugins[t]}dispatch(t){if(this.isDispatching)throw new Error("Reducers may not dispatch actions. To trigger cascading actions, dispatch from a listener callback instead.");const n=this.getState();try{this.isDispatching=!0,this.isCoreAction(t)&&(this.state.core=this.coreReducer(this.state.core,t));for(const o in this.pluginReducers){const i=this.pluginReducers[o],r=n.plugins[o];i&&(this.state.plugins[o]=i(r,t))}}finally{this.isDispatching=!1}return this.listeners.forEach(o=>{const i=this.getState();o(t,i,n)}),this.getState()}getState(){if(this.isDispatching)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return{core:{...this.state.core},plugins:{...this.state.plugins}}}subscribe(t){if(this.isDispatching)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state.");return this.listeners.push(t),()=>{if(this.isDispatching)throw new Error("You may not unsubscribe from a store listener while the reducer is executing.");this.listeners=this.listeners.filter(n=>n!==t)}}subscribeToPlugin(t,n){if(!(t in this.state.plugins))throw new Error(`Plugin state not found for plugin "${t}". Did you forget to call addPluginReducer?`);if(this.isDispatching)throw new Error("You may not call store.subscribeToPlugin() while the reducer is executing.");return this.pluginListeners[t]||(this.pluginListeners[t]=[]),this.pluginListeners[t].push(n),()=>{if(this.isDispatching)throw new Error("You may not unsubscribe from a store listener while the reducer is executing.");this.pluginListeners[t]=this.pluginListeners[t].filter(o=>o!==n),this.pluginListeners[t].length===0&&delete this.pluginListeners[t]}}onAction(t,n){return this.subscribe((o,i,r)=>{o.type===t&&n(o,i,r)})}getPluginStore(t){if(!(t in this.state.plugins))throw new Error(`Plugin state not found for plugin "${t}". Did you forget to call addPluginReducer?`);return new zy(this,t)}isCoreAction(t){return Ly.includes(t.type)}destroy(){var t,n;this.listeners.length=0;for(const o in this.pluginListeners)(n=(t=this.pluginListeners[o])==null?void 0:t.splice)==null||n.call(t,0);this.pluginListeners={},this.pluginReducers={},this.state.plugins={},this.state.core={...this.initialCoreState}}}U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.E
2254xtractForAccessibility,U.AssembleDocument,U.PrintHighQuality;const Oy=[U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality],Fy={[U.Print]:"print",[U.ModifyContents]:"modifyContents",[U.CopyContents]:"copyContents",[U.ModifyAnnotations]:"modifyAnnotations",[U.FillForms]:"fillForms",[U.ExtractForAccessibility]:"extractForAccessibility",[U.AssembleDocument]:"assembleDocument",[U.PrintHighQuality]:"printHighQuality"};function ec(e,t){if(!e)return;if(t in e)return e[t];const n=Fy[t];return n&&n in e?e[n]:void 0}function lr(e,t,n){var o;const i=e.documents[t],r=i?.permissions,a=e.globalPermissions,s=((o=i?.document)==null?void 0:o.permissions)??U.AllowAll,l=ec(r?.overrides,n);if(l!==void 0)return l;const c=ec(a?.overrides,n);return c!==void 0?c:!(r?.enforceDocumentPermissions??a?.enforceDocumentPermissions??!0)||(s&n)!==0}function tc(e,t){return Oy.reduce((n,o)=>lr(e,t,o)?n|o:n,0)}function _y(e,t,n){const o=e.activeDocumentId;if(o!==t)return o;if(n!==void 0)return n&&e.documents[n]?n:null;const i=e.documentOrder.indexOf(t);return i===-1?null:i>0?e.documentOrder[i-1]:i<e.documentOrder.length-1?e.documentOrder[i+1]:null}const $y=(e,t)=>{switch(t.type){case Mr:{const{documentId:n,name:o,scale:i,rotation:r,passwordProvided:a,autoActivate:s=!0,permissions:l}=t.payload,c={id:n,name:o,status:"loading",loadingProgress:0,error:null,document:null,scale:i??e.defaultScale,rotation:r??e.defaultRotation,passwordProvided:a??!1,pageRefreshVersions:{},permissions:l,loadStartedAt:Date.now()};return{...e,documents:{...e.documents,[n]:c},documentOrder:[...e.documentOrder,n],activeDocumentId:s||!e.activeDocumentId?n:e.activeDocumentId}}case dh:{const{documentId:n,progress:o}=t.payload,i=e.documents[n];return i&&i.status==="loading"?{...e,documents:{...e.documents,[n]:{...i,loadingProgress:o}}}:e}case Dr:{const{documentId:n,document:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,status:"loaded",document:o,error:null,errorCode:void 0,errorDetails:void 0,passwordProvided:void 0,loadedAt:Date.now()}}}:e}case Rs:{const{documentId:n,error:o,errorCode:i,errorDetails:r}=t.payload,a=e.documents[n];return a?{...e,documents:{...e.documents,[n]:{...a,status:"error",error:o,errorCode:i,errorDetails:r}}}:e}case Es:{const{documentId:n,passwordProvided:o}=t.payload,i=e.documents[n];return i&&i.status==="error"?{...e,documents:{...e.documents,[n]:{...i,status:"loading",loadingProgress:0,error:null,errorCode:void 0,errorDetails:void 0,passwordProvided:o??!1,loadStartedAt:Date.now()}}}:e}case Tr:{const{documentId:n,nextActiveDocumentId:o}=t.payload,{[n]:i,...r}=e.documents;return{...e,documents:r,documentOrder:e.documentOrder.filter(a=>a!==n),activeDocumentId:_y(e,n,o)}}case Ns:{const{documentId:n,toIndex:o}=t.payload,i=(function(r,a,s){const l=r.indexOf(a);if(l===-1||s<0||s>=r.length||l===s)return null;const c=[...r];return c.splice(l,1),c.splice(s,0,a),c})(e.documentOrder,n,o);return i?{...e,documentOrder:i}:e}case Ls:return{...e,documentOrder:t.payload};case zs:return{...e,activeDocumentId:t.payload};case Rr:{const{scale:n,documentId:o}=t.payload,i=o??e.activeDocumentId;if(!i)return e;const r=e.documents[i];return r?{...e,documents:{...e.documents,[i]:{...r,scale:n}}}:e}case Er:{const{rotation:n,documentId:o}=t.payload,i=o??e.activeDocumentId;if(!i)return e;const r=e.documents[i];return r?{...e,documents:{...e.documents,[i]:{...r,rotation:n}}}:e}case zo:{const{documentId:n,pageIndexes:o}=t.payload,i=e.documents[n];if(!i)return e;const r={...i.pageRefreshVersions};for(const a of o)r[a]=(r[a]||0)+1;return{...e,documents:{...e.documents,[n]:{...i,pageRefreshVersions:r}}}}case Os:{const{documentId:n,permissions:o,isOwnerUnlocked:i}=t.payload,r=e.documents[n];return r?.document?{...e,documents:{...e.documents,[n]:{...r,document:{...r.document,permissions:o,isOwnerUnlocked:i}}}}:e}default:return e}};class jy{constructor(t,n){this.plugins=new Map,this.manifests=new Map,this.capabilities=new Map,this.status=new Map,this.configurations=new Map,this.initPromise=null,this.pendingRegistrations=[],this.processingRegistrations=[],this.initialized=!1,this.isInitializing=!1,this.pluginsReadyPromise=null,this.destroyed=!1,this.resolver=new Zl,this.engine=t,this.initialCoreState=(o=>({documents:{},documentOrder:[],activeDocumentId:null,defaultScale:o?.defaultScale??1,defaultRotation:o?.defaultRotation??fi.Degree0,globalPermissions:o?.permissions}))(n),this.store=new Ny($y,this.initialCoreState),this.logger=n?.logger??new Yu}getLogger(){return this.logger}registerPlugin(t,n){if(this.initialized&&!this.isInitializing)throw new Ct("Cannot register plugins after initialization");this.validateManifest(t.manifest),this.store.addPluginReducer(t.manifest.id,t.reducer,typeof t.initialState=="function"?t.initialState(this.initialCoreState,{...t.manifest.defaultConfig,...n}):t.initialState),this.pendingRegistrations.push({package:t,config:n})}getStore(){return this.store}getEngine(){return this.engine}pluginsReady(){return this.pluginsReadyPromise||(this.pluginsReadyPromise=(async()=>{this.initialized||await this.initialize();const t=Array.from(this.plugins.values()).map(n=>typeof n.ready=="function"?n.ready():Promise.resolve());await Promise.all(t)})()),this.pluginsReadyPromise}async initialize(){if(this.destroyed)throw new Ct("Registry has been destroyed");return this.initPromise||(this.initPromise=(async()=>
vendor: 2,459 bytes, line 2254
2254{if(this.initialized)throw new Ct("Registry is already initialized");this.isInitializing=!0;try{if(this.destroyed)return;for(;this.pendingRegistrations.length>0;){if(this.destroyed)return;this.processingRegistrations=[...this.pendingRegistrations],this.pendingRegistrations=[];for(const n of this.processingRegistrations){const o=new Set,i=[...n.package.manifest.requires,...n.package.manifest.optional];for(const r of i){const a=this.processingRegistrations.find(s=>s.package.manifest.provides.includes(r));a&&o.add(a.package.manifest.id)}this.resolver.addNode(n.package.manifest.id,[...o])}const t=this.resolver.resolveLoadOrder();for(const n of t){const o=this.processingRegistrations.find(i=>i.package.manifest.id===n);this.instantiatePlugin(o.package.manifest,o.package.create,o.config)}for(const n of t)await this.runPluginInitialization(n);this.processingRegistrations=[],this.resolver=new Zl}this.initialized=!0}catch(t){throw t instanceof Error?new Ry(`Failed to resolve plugin dependencies: ${t.message}`):t}finally{this.isInitializing=!1}})()),this.initPromise}instantiatePlugin(t,n,o){const i={...t.defaultConfig,...o};this.validateConfig(t.id,i,t.defaultConfig);const r=n(this,i);this.validatePlugin(r);for(const a of t.provides){if(this.capabilities.has(a))throw new Ct(`Capability ${a} is already provided by plugin ${this.capabilities.get(a)}`);this.capabilities.set(a,t.id)}this.plugins.set(t.id,r),this.manifests.set(t.id,t),this.status.set(t.id,"registered"),this.configurations.set(t.id,i)}async runPluginInitialization(t){const n=this.plugins.get(t);if(!n)return;const o=this.manifests.get(t),i=this.configurations.get(t);for(const r of o.requires)if(!this.capabilities.has(r))throw new Ct(`Missing required capability: ${r} for plugin ${t}`);this.logger.debug("PluginRegistry","InitializePlugin",`Initializing plugin ${t}`);try{n.initialize&&await n.initialize(i),this.status.set(t,"active"),this.logger.info("PluginRegistry","PluginInitialized",`Plugin ${t} initialized successfully`)}catch(r){throw this.status.set(t,"error"),this.logger.error("PluginRegistry","InitializationFailed",`Plugin ${t} initialization failed`,{error:r}),r}}getPluginConfig(t){const n=this.configurations.get(t);if(!n)throw new mo(`Configuration for plugin ${t} not found`);return n}validateConfig(t,n,o){const i=Object.keys(o).filter(r=>!n.hasOwnProperty(r));if(i.length>0)throw new Ey(`Missing required configuration keys for plugin ${t}: ${i.join(", ")}`)}
2254async updatePluginConfig(t,n){const o=this.getPlugin(t);if(!o)throw new mo(`Plugin ${t} not found`);const i=this.manifests.get(t),r=this.configurations.get(t);if(!i||!r)throw new mo(`Plugin ${t} not found`);const a={...r,...n};this.validateConfig(t,a,i.defaultConfig),this.configurations.set(t,a),o.initialize&&await o.initialize(a)}registerPluginBatch(t){for(const n of t)this.registerPlugin(n.package,n.config)}async unregisterPlugin(t){const n=this.plugins.get(t);if(!n)throw new mo(`Plugin ${t} is not registered`);const o=this.manifests.get(t);if(!o)throw new mo(`Manifest for plugin ${t} not found`);for(const[i,r]of this.manifests.entries())if(i!==t&&[...r.requires,...r.optional].some(a=>o.provides.includes(a)))throw new Ct(`Cannot unregister plugin ${t}: plugin ${i} depends on it`);try{n.destroy&&await n.destroy();for(const i of o.provides)this.capabilities.delete(i);this.plugins.delete(t),this.manifests.delete(t),this.status.delete(t)}catch(i){throw i instanceof Error?new Error(`Failed to unregister plugin ${t}: ${i.message}`):i}}getPlugin(t){return this.plugins.get(t)||null}getCapabilityProvider(t){const n=this.capabilities.get(t);return n?this.getPlugin(n):null}hasCapability(t){return this.capabilities.has(t)}getAllPlugins(){return Array.from(this.plugins.values())}getPluginStatus(t){const n=this.status.get(t);if(!n)throw new mo(`Plugin ${t} not found`);return n}validatePlugin(t){if(!t.id)throw new Ct("Plugin must have an id")}validateManifest(t){if(!t.id)throw new Ct("Manifest must have an id");if(!t.name)throw new Ct("Manifest must have a name");if(!t.version)throw new Ct("Manifest must have a version");if(!Array.isArray(t.provides))throw new Ct("Manifest must have a provides array");if(!Array.isArray(t.requires))throw new Ct("Manifest must have a requires array");if(!Array.isArray(t.optional))throw new Ct("Manifest must have an optional array")}isDestroyed(){return this.destroyed}async destroy(){var t;if(this.destroyed)throw new Ct("Registry has already been destroyed");this.destroyed=!0;try{await this.initPromise}catch{}for(const n of Array.from(this.plugins.values()).reverse())await((t=n.destroy)==null?void 0:t.call(n));this.store.destroy(),this.plugins.clear(),this.manifests.clear(),this.capabilities.clear(),this.status.clear(),this.pendingRegistrations.length=0,this.processingRegistrations.length=0}}function Fe(e,t){return{package:e,config:t}}function Uy(e){return"autoMountElements"in e&&typeof e.autoMountElements=="function"}class $e{constructor(t,n){if(this.id=t,this.registry=n,this.cooldownActions={},this.debouncedTimeouts={},this.unsubscribeFromState=null,this.unsubscribeFromCoreStore=null,this.unsubscribeFromStartLoadingDocument=null,this.unsubscribeFromSetDocumentLoaded=null,this.unsubscribeFromCloseDocument=null,this.unsubscribeFromSetScale=null,this.unsubscribeFromSetRotation=null,t!==this.constructor.id)throw new Error(`Plugin ID mismatch: ${t} !== ${this.constructor.id}`);this.engine=this.registry.getEngine(),this.logger=this.registry.getLogger(),this.coreStore=this.registry.getStore(),this.pluginStore=this.coreStore.getPluginStore(this.id),this.unsubscribeFromState=this.pluginStore.subscribeToState((o,i,r)=>{this.onStoreUpdated(r,i)}),this.unsubscribeFromCoreStore=this.coreStore.subscribe((o,i,r)=>{this.onCoreStoreUpdated(r,i),i.core.activeDocumentId!==r.core.activeDocumentId&&this.onActiveDocumentChanged(r.core.activeDocumentId,i.core.activeDocumentId)}),this.unsubscribeFromStartLoadingDocument=this.coreStore.onAction(Mr,o=>{this.onDocumentLoadingStarted(o.payload.documentId)}),this.unsubscribeFromSetDocumentLoaded=this.coreStore.onAction(Dr,o=>{this.onDocumentLoaded(o.payload.documentId)}),this.unsubscribeFromCloseDocument=this.coreStore.onAction(Tr,o=>{this.onDocumentClosed(o.payload.documentId)}),this.unsubscribeFromSetScale=this.coreStore.onAction(Rr,(o,i)=>{const r=o.payload.documentId??i.core.activeDocumentId;r&&this.onScaleChanged(r,o.payload.scale)}),this.unsubscribeFromSetRotation=this.coreStore.onAction(Er,(o,i)=>{const r=o.payload.documentId??i.core.activeDocumentId;r&&this.onRotationChanged(r,o.payload.rotation)}),this.readyPromise=new Promise(o=>{this.readyResolve=o}),this.readyResolve()}provides(){if(!this._capability){const t=this.buildCapability();this._capability=Object.freeze(t)}return this._capability}get state(){return this.pluginStore.getState()}get coreState(){return this.coreStore.getState()}getState(){return this.pluginStore.getState()}getCoreState(){return this.coreStore.getState()}dispatchCoreAction(t){return this.coreStore.dispatchToCore(t)}
vendor: 4,134 bytes, line 2254
2254dispatchToAllPlugins(t){return this.coreStore.dispatch(t)}dispatch(t){return this.pluginStore.dispatch(t)}cooldownDispatch(t,n=100){const o=Date.now();return o-(this.cooldownActions[t.type]||0)>=n&&(this.cooldownActions[t.type]=o,this.dispatch(t),!0)}debouncedDispatch(t,n=100){const o=t.type;this.debouncedTimeouts[o]&&clearTimeout(this.debouncedTimeouts[o]),this.debouncedTimeouts[o]=setTimeout(()=>{this.dispatch(t),delete this.debouncedTimeouts[o]},n)}cancelDebouncedDispatch(t){this.debouncedTimeouts[t]&&(clearTimeout(this.debouncedTimeouts[t]),delete this.debouncedTimeouts[t])}subscribe(t){return this.pluginStore.subscribeToState(t)}subscribeToCoreStore(t){return this.coreStore.subscribe(t)}onStoreUpdated(t,n){}onCoreStoreUpdated(t,n){}onDocumentLoadingStarted(t){}onDocumentLoaded(t){}onDocumentClosed(t){}onActiveDocumentChanged(t,n){}onScaleChanged(t,n){}onRotationChanged(t,n){}destroy(){Object.values(this.debouncedTimeouts).forEach(t=>{clearTimeout(t)}),this.debouncedTimeouts={},this.unsubscribeFromState&&(this.unsubscribeFromState(),this.unsubscribeFromState=null),this.unsubscribeFromCoreStore&&(this.unsubscribeFromCoreStore(),this.unsubscribeFromCoreStore=null),this.unsubscribeFromStartLoadingDocument&&(this.unsubscribeFromStartLoadingDocument(),this.unsubscribeFromStartLoadingDocument=null),this.unsubscribeFromSetDocumentLoaded&&(this.unsubscribeFromSetDocumentLoaded(),this.unsubscribeFromSetDocumentLoaded=null),this.unsubscribeFromCloseDocument&&(this.unsubscribeFromCloseDocument(),this.unsubscribeFromCloseDocument=null),this.unsubscribeFromSetScale&&(this.unsubscribeFromSetScale(),this.unsubscribeFromSetScale=null),this.unsubscribeFromSetRotation&&(this.unsubscribeFromSetRotation(),this.unsubscribeFromSetRotation=null)}ready(){return this.readyPromise}markReady(){this.readyResolve()}resetReady(){this.readyPromise=new Promise(t=>{this.readyResolve=t})}getActiveDocumentId(){const t=this.coreState.core.activeDocumentId;if(!t)throw new Error("No active document");return t}getActiveDocumentIdOrNull(){return this.coreState.core.activeDocumentId}getCoreDocument(t){const n=t??this.getActiveDocumentIdOrNull();return n?this.coreState.core.documents[n]??null:null}getCoreDocumentOrThrow(t){const n=this.getCoreDocument(t);if(!n)throw new Error(`Document not found: ${t??"active"}`);return n}getDocumentPermissions(t){const n=t??this.coreState.core.activeDocumentId;return n?tc(this.coreState.core,n):U.AllowAll}checkPermission(t,...n){const o=t??this.coreState.core.activeDocumentId;return!o||n.every(i=>lr(this.coreState.core,o,i))}requirePermission(t,...n){const o=t??this.coreState.core.activeDocumentId;if(!o)return;const i=[];for(const r of n)lr(this.coreState.core,o,r)||i.push(r);if(i.length>0){const r=tc(this.coreState.core,o);throw new Iy(i,r)}}}class cr{constructor(t,n){this.handler=t,this.options=n,this.lastRun=0,this.handle=o=>{this.options.mode==="debounce"?this.debounce(o):this.throttle(o)}}debounce(t){this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.handler(t),this.timeoutId=void 0},this.options.wait)}throttle(t){if(this.options.mode==="debounce")return;const n=Date.now(),o=this.options.throttleMode||"leading-trailing";n-this.lastRun>=this.options.wait&&(o==="leading-trailing"&&this.handler(t),this.lastRun=n),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.handler(t),this.lastRun=Date.now(),this.timeoutId=void 0},this.options.wait-(n-this.lastRun))}destroy(){this.timeoutId&&window.clearTimeout(this.timeoutId)}}class Ba{constructor(t,n){this.handler=t,this.options=n,this.controls=new Map,this.handle=o=>{const i=String(this.options.keyExtractor(o));let r=this.controls.get(i);r||(r=new cr(this.handler,this.baseOptions),this.controls.set(i,r)),r.handle(o)},this.baseOptions={mode:n.mode,wait:n.wait,...n.mode==="throttle"&&"throttleMode"in n?{throttleMode:n.throttleMode}:{}}}destroy(){for(const t of this.controls.values())t.destroy();this.controls.clear()}}function Wa(e){return"keyExtractor"in e}function ue(e,t,n){return e<t?t:e>n?n:e}function to(e,t,n){if(e===t)return!0;
2254if(e==null||t==null)return e===t;const o=typeof e;if(o!==typeof t)return!1;if(o==="object"){n||(n=new Set);const i=(function(s,l){return`${nc(s)}__${nc(l)}`})(e,t);if(n.has(i))return!0;n.add(i);const r=Array.isArray(e),a=Array.isArray(t);return r&&a?(function(s,l,c){if(s.length!==l.length)return!1;const d=new Array(l.length).fill(!1);e:for(let u=0;u<s.length;u++){const m=s[u];for(let g=0;g<l.length;g++)if(!d[g]&&to(m,l[g],c)){d[g]=!0;continue e}return!1}return!0})(e,t,n):!r&&!a&&(function(s,l,c){const d=Object.keys(s).sort(),u=Object.keys(l).sort();if(d.length!==u.length)return!1;for(let m=0;m<d.length;m++)if(d[m]!==u[m])return!1;for(const m of d)if(!to(s[m],l[m],c))return!1;return!0})(e,t,n)}return!1}let By=0;const aa=new WeakMap;function nc(e){return aa.has(e)||aa.set(e,++By),aa.get(e)}function st(){const e=new Set;return{emit:(t=void 0)=>e.forEach(n=>n(t)),on:t=>(e.add(t),()=>e.delete(t)),off:t=>e.delete(t),clear:()=>e.clear()}}function xe(e,t=to){const n=new Set,o=new Map;let i=e;const r=(a,s)=>{let l=a,c=()=>{};if(s){if(Wa(s)){const d=new Ba(a,s);l=d.handle,c=()=>d.destroy()}else{const d=new cr(a,s);l=d.handle,c=()=>d.destroy()}o.set(a,{wrapped:l,destroy:c})}return i!==void 0&&l(i),n.add(l),()=>{n.delete(l),c(),o.delete(a)}};return{get value(){return i},emit(a=void 0){i!==void 0&&t(i,a)||(i=a,(s=>{n.forEach(l=>l(s))})(a))},on:r,off(a){const s=o.get(a);s?(n.delete(s.wrapped),s.destroy(),o.delete(a)):n.delete(a)},clear(){n.clear(),o.forEach(a=>a.destroy()),o.clear()},select:(a,s=to)=>(l,c)=>{let d;if(i!==void 0){const u=a(i);d=u,l(u)}return r(u=>{const m=a(u);d!==void 0&&s(d,m)||(d=m,l(m))},c)}}}function Ue(e,t){const n=t?.cache??!0,o=t?.equality??to,i=new Map,r=new Map,a=new Map,s=new Set,l=new Map,c=d=>String(d);return{emit(d,u){const m=c(d);if(n){const f=i.get(m);if(f!==void 0&&o(f,u))return;i.set(m,u)}const g=r.get(m);g&&g.forEach(f=>f(u));const p=e(d,u);s.forEach(f=>f(p))},forScope(d){const u=c(d);return(m,g)=>{const p=(b=>{let w=r.get(b);return w||(w=new Set,r.set(b,w)),w})(u),f=(b=>{let w=a.get(b);return w||(w=new Map,a.set(b,w)),w})(u);let v=m,y=()=>{};if(g){if(Wa(g)){const b=new Ba(m,g);v=b.handle,y=()=>b.destroy()}else{const b=new cr(m,g);v=b.handle,y=()=>b.destroy()}f.set(m,{wrapped:v,destroy:y})}if(n){const b=i.get(u);b!==void 0&&v(b)}return p.add(v),()=>{p.delete(v),y(),f.delete(m),p.size===0&&r.delete(u),f.size===0&&a.delete(u)}}},onGlobal:(d,u)=>{let m=d,g=()=>{};if(u){if(Wa(u)){const p=new Ba(d,u);m=p.handle,g=()=>p.destroy()}else{const p=new cr(d,u);m=p.handle,g=()=>p.destroy()}l.set(d,{wrapped:m,destroy:g})}return s.add(m),()=>{s.delete(m),g(),l.delete(d)}},getValue:d=>n?i.get(c(d)):void 0,getScopes:()=>Array.from(n?i.keys():r.keys()),clearScope(d){const u=c(d);n&&i.delete(u);const m=r.get(u);m&&(m.clear(),r.delete(u));const g=a.get(u);g&&(g.forEach(p=>p.destroy()),g.clear(),a.delete(u))},clear(){n&&i.clear(),r.forEach(d=>d.clear()),r.clear(),a.forEach(d=>{d.forEach(u=>u.destroy()),d.clear()}),a.clear(),s.clear(),l.forEach(d=>d.destroy()),l.clear()}}}class Wy{constructor(t){this.autoMountElements=[],this.package=t}addUtility(t){return this.autoMountElements.push({component:t,type:"utility"}),this}addWrapper(t){return this.autoMountElements.push({component:t,type:"wrapper"}),this}build(){return{...this.package,autoMountElements:()=>this.autoMountElements}}}function Bt(e){return new Wy(e)}const Fs=rn({registry:null,coreState:null,isInitializing:!0,pluginsReady:!1,activeDocumentId:null,activeDocument:null,documents:{},documentStates:[]});function Hy({plugins:e,children:t}){const{utilities:n,wrappers:o}=Z(()=>{const r=[],a=[];for(const s of e){const l=s.package;if(Uy(l)){const c=l.autoMountElements()||[];for(const d of c)d.type==="utility"?r.push(d.component):d.type==="wrapper"&&a.push(d.component)}}return{utilities:r,wrappers:a}},[e]),i=k(de,{children:[t,n.map((r,a)=>k(r,{},`utility-${a}`))]});return k(de,{children:o.reduce((r,a)=>k(a,{children:r}),i)})}function Gy({engine:e,config:t,logger:n,onInitialized:o,plugins:i,children:r,autoMountDomElements:a=!0}){const[s,l]=O(null),[c,d]=O(null),[u,m]=O(!0),[g,p]=O(!1),f=K(o);$(()=>{f.current=o},[o]),$(()=>{const b={...t,logger:t?.logger??n},w=new jy(e,b);w.registerPluginBatch(i);let x;return(async()=>{var C;if(await w.initialize(),w.isDestroyed())return;const I=w.getStore();d(I.getState().core);const S=I.subscribe((P,A,D)=>{I.isCoreAction(P)&&A.core!==D.core&&d(A.core)});if(await((C=f.current)==null?void 0:C.call(f,w)),!w.isDestroyed())return w.pluginsReady().then(()=>{w.isDestroyed()||p(!0)}),l(w),m(!1),S;S()})().then(C=>{x=C}).catch(console.error),()=>{x?.(),w.destroy(),l(null),d(null),m(!0),p(!1)}},[e,i]);const v=Z(()=>{const b=c?.activeDocumentId??null,w=c?.documents??{},x=c?.documentOrder??[],C=b&&w[b]?w[b]:null,I=x.map(S=>w[S]).filter(S=>S!=null);return{registry:s,coreState:c,isInitializing:u,pluginsReady:g,activeDocumentId:b,activeDocument:C,documents:w,documentStates:I}},[s,c,u,g]),y=typeof r=="function"?r(v):r;return k(Fs.Provider,{value:v,children:g&&a?k(Hy,{plugins:i,children:y}):y})}function At(e){const{registry:t}=(function(){const o=an(Fs);if(o===void 0)throw new Error("useCapability must be used within a PDFContext.Provider");const{registry:i,isInitializing:r}=o;if(r)return o;if(i===null)throw new Error("PDF registry failed to initialize properly");return o}
2254)();if(t===null)return{plugin:null,isLoading:!0,ready:new Promise(()=>{})};const n=t.getPlugin(e);if(!n)throw new Error(`Plugin ${e} not found`);return{plugin:n,isLoading:!1,ready:n.ready()}}function We(e){const{plugin:t,isLoading:n,ready:o}=At(e);if(!t)return{provides:null,isLoading:n,ready:o};if(!t.provides)throw new Error(`Plugin ${e} does not provide a capability`);return{provides:t.provides(),isLoading:n,ready:o}}function dr(){const{coreState:e}=an(Fs);return e}function pt(e){const t=dr();return Z(()=>t&&e?t.documents[e]??null:null,[t,e])}U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality;const qy=[U.Print,U.ModifyContents,U.CopyContents,U.ModifyAnnotations,U.FillForms,U.ExtractForAccessibility,U.AssembleDocument,U.PrintHighQuality],Ky={[U.Print]:"print",[U.ModifyContents]:"modifyContents",[U.CopyContents]:"copyContents",[U.ModifyAnnotations]:"modifyAnnotations",[U.FillForms]:"fillForms",[U.ExtractForAccessibility]:"extractForAccessibility",[U.AssembleDocument]:"assembleDocument",[U.PrintHighQuality]:"printHighQuality"};function oc(e,t){if(!e)return;if(t in e)return e[t];const n=Ky[t];return n&&n in e?e[n]:void 0}function sa(e,t,n){var o;const i=e.documents[t],r=i?.permissions,a=e.globalPermissions,s=((o=i?.document)==null?void 0:o.permissions)??U.AllowAll,l=oc(r?.overrides,n);if(l!==void 0)return l;const c=oc(a?.overrides,n);return c!==void 0?c:!(r?.enforceDocumentPermissions??a?.enforceDocumentPermissions??!0)||(s&n)!==0}function zr(e){const t=dr();return Z(()=>{var n,o;if(!t)return{permissions:U.AllowAll,pdfPermissions:U.AllowAll,hasPermission:()=>!0,hasAllPermissions:()=>!0,canPrint:!0,canModifyContents:!0,canCopyContents:!0,canModifyAnnotations:!0,canFillForms:!0,canExtractForAccessibility:!0,canAssembleDocument:!0,canPrintHighQuality:!0};const i=(function(a,s){return qy.reduce((l,c)=>sa(a,s,c)?l|c:l,0)})(t,e),r=a=>sa(t,e,a);return{permissions:i,pdfPermissions:((o=(n=t.documents[e])==null?void 0:n.document)==null?void 0:o.permissions)??U.AllowAll,hasPermission:r,hasAllPermissions:(...a)=>a.every(s=>sa(t,e,s)),canPrint:r(U.Print),canModifyContents:r(U.ModifyContents),canCopyContents:r(U.CopyContents),canModifyAnnotations:r(U.ModifyAnnotations),canFillForms:r(U.FillForms),canExtractForAccessibility:r(U.ExtractForAccessibility),canAssembleDocument:r(U.AssembleDocument),canPrintHighQuality:r(U.PrintHighQuality)}},[t,e])}const Vy="https://cdn.jsdelivr.net/npm/@embedpdf/[email protected]/dist/pdfium.wasm";rn(void 0);const uh="viewport",Xy={id:uh,name:"Viewport Plugin",version:"1.0.0",provides:["viewport"],requires:[],optional:[],defaultConfig:{viewportGap:10,scrollEndDelay:300}},hh="INIT_VIEWPORT_STATE",mh="CLEANUP_VIEWPORT_STATE",ph="REGISTER_VIEWPORT",gh="UNREGISTER_VIEWPORT",fh="SET_VIEWPORT_METRICS",vh="SET_VIEWPORT_SCROLL_METRICS",yh="SET_VIEWPORT_GAP",bh="SET_SCROLL_ACTIVITY",wh="SET_SMOOTH_SCROLL_ACTIVITY",xh="ADD_VIEWPORT_GATE",kh="REMOVE_VIEWPORT_GATE";function ic(e,t){return{type:wh,payload:{documentId:e,isSmoothScrolling:t}}}const Zy={viewportMetrics:{width:0,height:0,scrollTop:0,scrollLeft:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0,clientLeft:0,clientTop:0,relativePosition:{x:0,y:0}},isScrolling:!1,isSmoothScrolling:!1,gates:new Set},rc={viewportGap:0,documents:{},activeViewports:new Set,activeDocumentId:null},Ch=class extends $e{constructor(e,t,n){var o;super(e,t),this.id=e,this.viewportResize$=xe(),this.viewportMetrics$=xe(),this.scrollMetrics$=xe(),this.scrollActivity$=xe(),this.gateState$=xe(),this.scrollRequests$=new Map,n.viewportGap&&this.dispatch((o=n.viewportGap,{type:yh,payload:o})),this.scrollEndDelay=n.scrollEndDelay||100}onDocumentLoadingStarted(e){this.dispatch((function(t){return{type:hh,payload:{documentId:t}}})(e)),this.scrollRequests$.set(e,st()),this.logger.debug("ViewportPlugin","DocumentOpened",`Initialized viewport state for document: ${e}`)}onDocumentClosed(e){var t;this.dispatch((function(n){return{type:mh,payload:{documentId:n}}})(e)),(t=this.scrollRequests$.get(e))==null||t.clear(),this.scrollRequests$.delete(e),this.logger.debug("ViewportPlugin","DocumentClosed",`Cleaned up viewport state for document: ${e}`)}buildCapability(){return{getViewportGap:()=>this.state.viewportGap,getMetrics:()=>this.getMetrics(),scrollTo:e=>this.scrollTo(e),isScrolling:()=>this.isScrolling(),isSmoothScrolling:()=>this.isSmoothScrolling(),isGated:e=>this.isGated(e),hasGate:(e,t)=>
2254this.hasGate(e,t),getGates:e=>this.getGates(e),forDocument:e=>this.createViewportScope(e),gate:(e,t)=>this.gate(e,t),releaseGate:(e,t)=>this.releaseGate(e,t),isViewportMounted:e=>this.state.activeViewports.has(e),onViewportChange:this.viewportMetrics$.on,onViewportResize:this.viewportResize$.on,onScrollChange:this.scrollMetrics$.on,onScrollActivity:this.scrollActivity$.on,onGateChange:this.gateState$.on}}createViewportScope(e){return{getMetrics:()=>this.getMetrics(e),scrollTo:t=>this.scrollTo(t,e),isScrolling:()=>this.isScrolling(e),isSmoothScrolling:()=>this.isSmoothScrolling(e),isGated:()=>this.isGated(e),hasGate:t=>this.hasGate(t,e),getGates:()=>this.getGates(e),gate:t=>this.gate(t,e),releaseGate:t=>this.releaseGate(t,e),onViewportChange:t=>this.viewportMetrics$.on(n=>{n.documentId===e&&t(n.metrics)}),onScrollChange:t=>this.scrollMetrics$.on(n=>{n.documentId===e&&t(n.scrollMetrics)}),onScrollActivity:t=>this.scrollActivity$.on(n=>{n.documentId===e&&t(n.activity)}),onGateChange:t=>this.gateState$.on(n=>{n?.documentId===e&&t(n)})}}registerViewport(e){if(!this.state.documents[e])throw new Error(`Cannot register viewport for ${e}: document state not found. Document must be opened before registering viewport.`);this.state.activeViewports.has(e)||(this.dispatch((function(t){return{type:ph,payload:{documentId:t}}})(e)),this.logger.debug("ViewportPlugin","RegisterViewport",`Registered viewport (DOM mounted) for document: ${e}`))}unregisterViewport(e){this.registry.isDestroyed()||this.state.activeViewports.has(e)&&(this.dispatch((function(t){return{type:gh,payload:{documentId:t}}})(e)),this.logger.debug("ViewportPlugin","UnregisterViewport",`Unregistered viewport (DOM unmounted) for document: ${e}. State preserved.`))}setViewportResizeMetrics(e,t){if(this.registry.isDestroyed())return;this.dispatch((function(o,i){return{type:fh,payload:{documentId:o,metrics:i}}})(e,t));const n=this.state.documents[e];n&&this.viewportResize$.emit({documentId:e,metrics:n.viewportMetrics})}setViewportScrollMetrics(e,t){if(this.registry.isDestroyed())return;const n=this.state.documents[e];n&&(t.scrollTop===n.viewportMetrics.scrollTop&&t.scrollLeft===n.viewportMetrics.scrollLeft||(this.dispatch((function(o,i){return{type:vh,payload:{documentId:o,scrollMetrics:i}}})(e,t)),this.bumpScrollActivity(e),this.scrollMetrics$.emit({documentId:e,scrollMetrics:t})))}onScrollRequest(e,t){const n=this.scrollRequests$.get(e);if(!n)throw new Error(`Cannot subscribe to scroll requests for ${e}: document state not initialized`);return n.on(t)}gate(e,t){const n=this.state.documents[t];n?n.gates.has(e)||(this.dispatch((function(o,i){return{type:xh,payload:{documentId:o,key:i}}})(t,e)),this.logger.debug("ViewportPlugin","GateAdded",`Added gate '${e}' for document: ${t}. Total gates: ${n.gates.size+1}`)):this.logger.warn("ViewportPlugin","GateViewport",`Cannot gate viewport for ${t}: document not found`)}releaseGate(e,t){const n=this.state.documents[t];n?n.gates.has(e)&&(this.dispatch((function(o,i){return{type:kh,payload:{documentId:o,key:i}}})(t,e)),this.logger.debug("ViewportPlugin","GateReleased",`Released gate '${e}' for document: ${t}. Remaining gates: ${n.gates.size-1}`)):this.logger.warn("ViewportPlugin","ReleaseGate",`Cannot release gate for ${t}: document not found`)}getViewportState(e){const t=e??this.getActiveDocumentId(),n=this.state.documents[t];if(!n)throw new Error(`Viewport state not found for document: ${t}`);return n}getMetrics(e){return this.getViewportState(e).viewportMetrics}isScrolling(e){return this.getViewportState(e).isScrolling}isSmoothScrolling(e){return this.getViewportState(e).isSmoothScrolling}isGated(e){return this.getViewportState(e).gates.size>0}hasGate(e,t){return this.getViewportState(t).gates.has(e)}getGates(e){const t=this.getViewportState(e);return Array.from(t.gates)}scrollTo(e,t){const n=t??this.getActiveDocumentId(),o=this.getViewportState(n),{x:i,y:r,alignX:a,alignY:s,behavior:l="auto"}=e;l==="smooth"&&this.dispatch(ic(n,!0));const c=o.viewportMetrics;let d=i,u=r;a!==void 0&&(d=i-c.clientWidth*(a/100)),s!==void 0&&(u=r-c.clientHeight*(s/100));const m=this.scrollRequests$.get(n);m&&m.emit({x:d,y:u,behavior:l})}bumpScrollActivity(e){this.debouncedDispatch((function(t,n){return{type:bh,payload:{documentId:t,isScrolling:n}}})(e,!1),this.scrollEndDelay),this.debouncedDispatch(ic(e,!1),this.scrollEndDelay)}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];if(o!==i&&(this.viewportMetrics$.emit({documentId:n,metrics:i.viewportMetrics}),!o||o.isScrolling===i.isScrolling&&o.isSmoothScrolling===i.isSmoothScrolling||this.scrollActivity$.emit({documentId:n,activity:{isScrolling:i.isScrolling,isSmoothScrolling:i.isSmoothScrolling}}
vendor: 15,564 bytes, line 2254
2254),o&&o.gates!==i.gates)){const r=Array.from(o.gates),a=Array.from(i.gates),s=a.find(c=>!r.includes(c)),l=r.find(c=>!a.includes(c));this.gateState$.emit({documentId:n,isGated:i.gates.size>0,gates:a,addedGate:s,removedGate:l}),this.logger.debug("ViewportPlugin","GateStateChanged",`Gate state changed for document ${n}. Gates: [${a.join(", ")}], Gated: ${i.gates.size>0}`)}}}async initialize(e){this.logger.info("ViewportPlugin","Initialize","Viewport plugin initialized")}async destroy(){this.viewportMetrics$.clear(),this.viewportResize$.clear(),this.scrollMetrics$.clear(),this.scrollActivity$.clear(),this.gateState$.clear(),this.scrollRequests$.forEach(e=>e.clear()),this.scrollRequests$.clear(),super.destroy()}};Ch.id="viewport";let vi=Ch;const Yy={manifest:Xy,create:(e,t)=>new vi(uh,e,t),reducer:(e=rc,t)=>{switch(t.type){case hh:{const{documentId:n}=t.payload;return{...e,documents:{...e.documents,[n]:{...Zy,gates:new Set}}}}case mh:{const{documentId:n}=t.payload,{[n]:o,...i}=e.documents,r=new Set(e.activeViewports);return r.delete(n),{...e,documents:i,activeViewports:r,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case ph:{const{documentId:n}=t.payload,o=new Set(e.activeViewports);return o.add(n),{...e,activeViewports:o,activeDocumentId:e.activeDocumentId??n}}case gh:{const{documentId:n}=t.payload,o=new Set(e.activeViewports);return o.delete(n),{...e,activeViewports:o}}case"SET_ACTIVE_VIEWPORT_DOCUMENT":return{...e,activeDocumentId:t.payload};case yh:return{...e,viewportGap:t.payload};case fh:{const{documentId:n,metrics:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,viewportMetrics:{width:o.width,height:o.height,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft,clientWidth:o.clientWidth,clientHeight:o.clientHeight,scrollWidth:o.scrollWidth,scrollHeight:o.scrollHeight,clientLeft:o.clientLeft,clientTop:o.clientTop,relativePosition:{x:o.scrollWidth<=o.clientWidth?0:o.scrollLeft/(o.scrollWidth-o.clientWidth),y:o.scrollHeight<=o.clientHeight?0:o.scrollTop/(o.scrollHeight-o.clientHeight)}}}}}:e}case vh:{const{documentId:n,scrollMetrics:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,viewportMetrics:{...i.viewportMetrics,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft},isScrolling:!0}}}:e}case bh:{const{documentId:n,isScrolling:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isScrolling:o}}}:e}case wh:{const{documentId:n,isSmoothScrolling:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isSmoothScrolling:o}}}:e}case xh:{const{documentId:n,key:o}=t.payload,i=e.documents[n];if(!i)return e;const r=new Set(i.gates);return r.add(o),{...e,documents:{...e.documents,[n]:{...i,gates:r}}}}case kh:{const{documentId:n,key:o}=t.payload,i=e.documents[n];if(!i)return e;const r=new Set(i.gates);return r.delete(o),{...e,documents:{...e.documents,[n]:{...i,gates:r}}}}default:return e}},initialState:rc},Ih=rn(null),Ha=()=>We(vi.id);function Qy(e){const{plugin:t}=At(vi.id),n=K(null);return Ss(()=>{if(!t)return;const o=n.current;if(!o)return;try{t.registerViewport(e)}catch(s){return void console.error(`Failed to register viewport for document ${e}:`,s)}const i=()=>{t.setViewportScrollMetrics(e,{scrollTop:o.scrollTop,scrollLeft:o.scrollLeft})};o.addEventListener("scroll",i);const r=new ResizeObserver(()=>{t.setViewportResizeMetrics(e,{width:o.offsetWidth,height:o.offsetHeight,clientWidth:o.clientWidth,clientHeight:o.clientHeight,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft,scrollWidth:o.scrollWidth,scrollHeight:o.scrollHeight,clientLeft:o.clientLeft,clientTop:o.clientTop})});r.observe(o);const a=t.onScrollRequest(e,({x:s,y:l,behavior:c="auto"})=>{requestAnimationFrame(()=>{o.scrollTo({left:s,top:l,behavior:c})})});return()=>{t.unregisterViewport(e),r.disconnect(),o.removeEventListener("scroll",i),a()}},[t,e]),n}function Jy({children:e,documentId:t,...n}){const[o,i]=O(0),r=Qy(t),{provides:a}=Ha(),s=(d=>{const{provides:u}=Ha(),[m,g]=O(u?.isGated(d)??!1);return $(()=>{if(u)return g(u.isGated(d)),u.onGateChange(p=>{p.documentId===d&&g(p.isGated)})},[u,d]),m})(t);$(()=>{a&&i(a.getViewportGap())},[a]);const{style:l,...c}=n;return k(Ih.Provider,{value:r,children:k("div",{...c,ref:r,style:{width:"100%",height:"100%",overflow:"auto",...typeof l=="object"?l:{},padding:`${o}px`},children:!s&&e})})}var It=(e=>(e.Vertical="vertical",e.Horizontal="horizontal",e))(It||{});class Sh{constructor(t){this.pageGap=t.pageGap??20,this.viewportGap=t.viewportGap??20,this.bufferSize=t.bufferSize??2}getCenteringOffsetX(t,n){return!n||t.width>=n.width?0:(n.width-t.width)/2}getCenteringOffsetY(t,n){return 0}getVisibleRange(t,n,o){const i=this.getScrollOffset(t),r=i,a=i+this.getClientSize(t);let s=0;for(;s<n.length&&(n[s].offset+this.getItemSizeAlongScrollAxis(n[s]))*o<=r;)s++;let l=s;for(;l<n.length&&n[l].offset*o<=a;)l++;return{start:Math.max(0,s-this.bufferSize),end:Math.min(n.length-1,l+this.bufferSize-1)}}handleScroll(t,n,o){const i=this.getVisibleRange(t,n,o),r=n.slice(i.start,i.end+1),a=this.getTotalContentSize(n),s=this.calculatePageVisibility(r,t,o,a),l=s.map(v=>v.pageNumber),c=n.slice(i.start,i.end+1).flatMap(v=>v.index),d=this.determineCurrentPage(s),u=n[i.start],m=n[i.end],g=u?u.offset*o:0,p=n[n.length-1],f=m?(p.offset+this.getItemSizeAlongScrollAxis(p))*o-(m.offset+this.getItemSizeAlongScrollAxis(m))*o:0;return{currentPage:d,visiblePages:l,pageVisibilityMetrics:s,renderedPageIndexes:c,scrollOffset:{x:t.scrollLeft,y:t.scrollTop},startSpacing:g,endSpacing:f}}calculatePageVisibility(t,n,o,i){const r=[];return t.forEach(a=>{const s=this.getCenteringOffsetX(a,i),l=this.getCenteringOffsetY(a,i);a.pageLayouts.forEach(c=>{const d=(a.x+s)*o,u=(a.y+l)*o,m=d+c.x*o,g=u+c.y*o,p=c.rotatedWidth*o,f=c.rotatedHeight*o,v=n.scrollLeft,y=n.scrollTop,b=v+n.clientWidth,w=y+n.clientHeight,x=Math.max(m,v),C=Math.max(g,y),I=Math.min(m+p,b),S=Math.min(g+f,w);if(x<I&&C<S){const P=I-x,A=S-C,D=p*f,R=P*A;r.push({pageNumber:c.pageNumber,viewportX:x-v,viewportY:C-y,visiblePercentage:R/D*100,original:{pageX:(x-m)/o,pageY:(C-g)/o,visibleWidth:P/o,visibleHeight:A/o,scale:1},scaled:{pageX:x-m,pageY:C-g,visibleWidth:P,visibleHeight:A,scale:o}})}})}),r}determineCurrentPage(t){if(t.length===0)return 1;const n=Math.max(...t.map(i=>i.visiblePercentage)),o=t.filter(i=>i.visiblePercentage===n);return o.length===1?o[0].pageNumber:o.sort((i,r)=>i.pageNumber-r.pageNumber)[0].pageNumber}getRectLocationForPage(t,n,o){const i=n.find(l=>l.pageNumbers.includes(t));if(!i)return null;const r=i.pageLayouts.find(l=>l.pageNumber===t);if(!r)return null;const a=this.getCenteringOffsetX(i,o),s=this.getCenteringOffsetY(i,o);return{origin:{x:i.x+r.x+a,y:i.y+r.y+s},size:{width:r.width,height:r.height}}}getScrollPositionForPage(t,n,o,i,r){const a=this.getTotalContentSize(n),s=this.getRectLocationForPage(t,n,a);if(!s)return null;const l=Yi(s.origin,o);if(r){const c=(function(d,u,m,g){return Yi(qu(d,u,m),g)})({width:s.size.width,height:s.size.height},{x:r.x,y:r.y},i,o);return{x:l.x+c.x+this.viewportGap,y:l.y+c.y+this.viewportGap}}return{x:l.x+this.viewportGap,y:l.y+this.viewportGap}}getRectPositionForPage(t,n,o,i,r){const a=this.getTotalContentSize(n),s=this.getRectLocationForPage(t,n,a);if(!s)return null;const l=Yi(s.origin,o),c=ly({width:s.size.width,height:s.size.height},r,i,o);return{origin:{x:l.x+c.origin.x,y:l.y+c.origin.y},size:c.size}}}class eb extends Sh{constructor(t){super(t)}createVirtualItems(t){let n=0;return t.map((o,i)=>{let r=0;const a=o.map(d=>{const u={pageNumber:d.index+1,pageIndex:d.index,x:r,y:0,width:d.size.width,height:d.size.height,rotatedWidth:d.rotatedSize.width,rotatedHeight:d.rotatedSize.height,elevated:!1};return r+=d.rotatedSize.width+this.pageGap,u}),s=o.reduce((d,u,m)=>d+u.rotatedSize.width+(m<o.length-1?this.pageGap:0),0),l=Math.max(...o.map(d=>d.rotatedSize.height)),c={id:`item-${i}`,x:0,y:n,offset:n,width:s,height:l,pageLayouts:a,pageNumbers:o.map(d=>d.index+1),index:i};return n+=l+this.pageGap,c})}getTotalContentSize(t){return t.length===0?{width:0,height:0}:{width:Math.max(...t.map(n=>n.width)),height:t[t.length-1].y+t[t.length-1].height}}getScrollOffset(t){return t.scrollTop}getClientSize(t){return t.clientHeight}getItemSizeAlongScrollAxis(t){return t.height}}class tb extends Sh{constructor(t){super(t)}createVirtualItems(t){let n=0;return t.map((o,i)=>{let r=0;const a=o.map(d=>{const u={pageNumber:d.index+1,pageIndex:d.index,x:r,y:0,width:d.size.width,height:d.size.height,rotatedWidth:d.rotatedSize.width,rotatedHeight:d.rotatedSize.height,elevated:!1};return r+=d.rotatedSize.width+this.pageGap,u}),s=o.reduce((d,u,m)=>d+u.rotatedSize.width+(m<o.length-1?this.pageGap:0),0),l=Math.max(...o.map(d=>d.rotatedSize.height)),c={id:`item-${i}`,x:n,y:0,offset:n,width:s,height:l,pageLayouts:a,pageNumbers:o.map(d=>d.index+1),index:i};return n+=s+this.pageGap,c})}getTotalContentSize(t){return t.length===0?{width:0,height:0}:{width:t[t.length-1].x+t[t.length-1].width,height:Math.max(...t.map(n=>n.height))}}getScrollOffset(t){return t.scrollLeft}getClientSize(t){return t.clientWidth}getItemSizeAlongScrollAxis(t){return t.width}getCenteringOffsetX(t,n){return 0}getCenteringOffsetY(t,n){return!n||t.height>=n.height?0:(n.height-t.height)/2}}const Ah="INIT_SCROLL_STATE",Ph="CLEANUP_SCROLL_STATE",Mh="UPDATE_DOCUMENT_SCROLL_STATE",Dh="SET_SCROLL_STRATEGY";function Go(e,t){return{type:Mh,payload:{documentId:e,state:t}}}const nb={isChanging:!1,targetPage:1,fromPage:1,startTime:0},Th=class extends $e{constructor(e,t,n){var o,i,r;super(e,t),this.id=e,this.config=n,this.elevatedPages=new Map,this.strategies=new Map,this.layoutReady=new Set,this.initialLayoutFired=new Set,this.scrollerLayoutEmitters=new Map,this.pageChange$=xe(),this.scroll$=xe(),this.layoutChange$=xe(),this.pageChangeState$=xe(),this.layoutReady$=xe(),this.state$=xe(),this.viewport=this.registry.getPlugin("viewport").provides(),this.spread=((o=this.registry.getPlugin("spread"))==null?void 0:o.provides())??null,this.viewport.onScrollActivity(s=>{const l=this.getDocumentState(s.documentId);l?.pageChangeState.isChanging&&!s.activity.isSmoothScrolling&&this.completePageChange(s.documentId)}),(i=this.spread)==null||i.onSpreadChange(s=>{this.refreshDocumentLayout(s.documentId)});const a=(r=this.registry.getPlugin("interaction-manager"))==null?void 0:r.provides();a&&a.onPageActivityChange(s=>{let l=this.elevatedPages.get(s.documentId);s.hasActivity?(l||(l=new Set,this.elevatedPages.set(s.documentId,l)),l.add(s.pageIndex)):l?.delete(s.pageIndex),this.pushScrollerLayout(s.documentId)}),this.viewport.onViewportChange(s=>{const l=this.getDocumentState(s.documentId);if(!l)return;const c=this.computeMetrics(s.documentId,s.metrics);this.layoutReady.has(s.documentId)?this.commitMetrics(s.documentId,c):this.commitMetrics(s.documentId,{...c,scrollOffset:l.scrollOffset})})}onDocumentLoadingStarted(e){const t=this.getCoreDocument(e);if(!t)return;const n=this.createDocumentState(t);this.dispatch((function(i,r){return{type:Ah,payload:{documentId:i,state:r}}})(e,n));const o=this.createStrategy(n.strategy);this.strategies.set(e,o),this.scrollerLayoutEmitters.set(e,xe())}onDocumentLoaded(e){var t;const n=this.getCoreDocument(e);n&&(this.dispatch(Go(e,{totalPages:((t=n.document)==null?void 0:t.pageCount)??0})),this.refreshDocumentLayout(e),this.logger.debug("ScrollPlugin","DocumentOpened",`Initialized scroll state for document: ${e}`))}onDocumentClosed(e){this.strategies.delete(e),this.layoutReady.delete(e),this.initialLayoutFired.delete(e),this.elevatedPages.delete(e);const t=this.scrollerLayoutEmitters.get(e);t&&(t.clear(),this.scrollerLayoutEmitters.delete(e)),this.dispatch((function(n){return{type:Ph,payload:n}})(e)),this.logger.debug("ScrollPlugin","DocumentClosed",`Cleaned up scroll state for document: ${e}`)}onScaleChanged(e){const t=this.coreState.core.documents[e];if(!t||t.status!=="loaded")return;const n=this.viewport.forDocument(e),o=this.computeMetrics(e,n.getMetrics());this.commitMetrics(e,o)}onRotationChanged(e){this.refreshDocumentLayout(e)}onScrollerData(e,t){const n=this.scrollerLayoutEmitters.get(e);if(!n)throw new Error(`No scroller layout emitter found for document: ${e}`);return n.on(t)}getScrollerLayout(e){const t=this.getDocumentState(e),n=this.getCoreDocumentOrThrow(e);if(!t||!n)throw new Error(`Cannot get scroller layout for document: ${e}`);return o=t,i=n.scale,r=this.elevatedPages.get(e),{startSpacing:o.startSpacing,endSpacing:o.endSpacing,totalWidth:o.totalContentSize.width*i,totalHeight:o.totalContentSize.height*i,pageGap:o.pageGap*i,strategy:o.strategy,items:o.renderedPageIndexes.map(a=>({...o.virtualItems[a],pageLayouts:o.virtualItems[a].pageLayouts.map(s=>({...s,rotatedWidth:s.rotatedWidth*i,rotatedHeight:s.rotatedHeight*i,width:s.width*i,height:s.height*i,elevated:r?.has(s.pageIndex)??!1}))}))};var o,i,r}setLayoutReady(e){if(this.layoutReady.has(e))return;const t=this.getDocumentState(e);if(!t)return;this.layoutReady.add(e);const n=!this.initialLayoutFired.has(e);n&&this.initialLayoutFired.add(e),this.viewport.forDocument(e).scrollTo({...t.scrollOffset,behavior:"instant"}),this.layoutReady$.emit({documentId:e,isInitial:n,pageNumber:t.currentPage,totalPages:t.totalPages})}clearLayoutReady(e){this.layoutReady.delete(e)}buildCapability(){return{getCurrentPage:()=>this.getCurrentPage(),getTotalPages:()=>this.getTotalPages(),getPageChangeState:()=>this.getPageChangeState(),scrollToPage:e=>this.scrollToPage(e),scrollToNextPage:e=>this.scrollToNextPage(e),scrollToPreviousPage:e=>this.scrollToPreviousPage(e),getMetrics:e=>this.getMetrics(e),getLayout:()=>this.getLayout(),getRectPositionForPage:(e,t,n,o)=>this.getRectPositionForPage(e,t,n,o),forDocument:e=>this.createScrollScope(e),setScrollStrategy:(e,t)=>this.setScrollStrategyForDocument(e,t),getPageGap:()=>this.state.defaultPageGap,onPageChange:this.pageChange$.on,onScroll:this.scroll$.on,onLayoutChange:this.layoutChange$.on,onLayoutReady:this.layoutReady$.on,onPageChangeState:this.pageChangeState$.on,onStateChange:this.state$.on}}createScrollScope(e){return{getCurrentPage:()=>this.getCurrentPage(e),getTotalPages:()=>this.getTotalPages(e),getPageChangeState:()=>this.getPageChangeState(e),scrollToPage:t=>this.scrollToPage(t,e),scrollToNextPage:t=>this.scrollToNextPage(t,e),scrollToPreviousPage:t=>this.scrollToPreviousPage(t,e),getSpreadPagesWithRotatedSize:()=>this.getSpreadPagesWithRotatedSize(e),getMetrics:t=>this.getMetrics(t,e),getLayout:()=>this.getLayout(e),getRectPositionForPage:(t,n,o,i)=>this.getRectPositionForPage(t,n,o,i,e),setScrollStrategy:t=>this.setScrollStrategyForDocument(t,e),onPageChange:t=>this.pageChange$.on(n=>{n.documentId===e&&t(n)}),onScroll:t=>this.scroll$.on(n=>{n.documentId===e&&t(n.metrics)}),onLayoutChange:t=>this.layoutChange$.on(n=>{n.documentId===e&&t(n.layout)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Scroll state not found for document: ${e??"active"}`);return t}getStrategy(e){const t=e??this.getActiveDocumentId(),n=this.strategies.get(t);if(!n)throw new Error(`Strategy not found for document: ${t}`);return n}createStrategy(e){const t={pageGap:this.state.defaultPageGap,viewportGap:this.viewport.getViewportGap(),bufferSize:this.state.defaultBufferSize};return e===It.Horizontal?new tb(t):new eb(t)}createDocumentState(e){var t;return{virtualItems:[],totalPages:((t=e.document)==null?void 0:t.pageCount)??0,currentPage:1,totalContentSize:{
2254width:0,height:0},strategy:this.state.defaultStrategy,pageGap:this.state.defaultPageGap,visiblePages:[],pageVisibilityMetrics:[],renderedPageIndexes:[],scrollOffset:{x:0,y:0},startSpacing:0,endSpacing:0,pageChangeState:nb}}startPageChange(e,t,n="smooth"){const o=this.getDocumentState(e);if(!o)return;const i={isChanging:!0,targetPage:t,fromPage:o.currentPage,startTime:Date.now()};this.dispatch(Go(e,{pageChangeState:i,currentPage:t})),this.pageChange$.emit({documentId:e,pageNumber:t,totalPages:o.totalPages}),n==="instant"&&this.completePageChange(e)}completePageChange(e){const t=this.getDocumentState(e);if(!t||!t.pageChangeState.isChanging)return;const n={isChanging:!1,targetPage:t.pageChangeState.targetPage,fromPage:t.pageChangeState.fromPage,startTime:t.pageChangeState.startTime};this.dispatch(Go(e,{pageChangeState:n}))}computeLayout(e,t){const n=this.getStrategy(e),o=n.createVirtualItems(t);return{virtualItems:o,totalContentSize:n.getTotalContentSize(o)}}computeMetrics(e,t,n){const o=this.getCoreDocumentOrThrow(e),i=this.getDocumentState(e),r=this.getStrategy(e);if(!i)throw new Error(`Document state not found: ${e}`);return r.handleScroll(t,n??i.virtualItems,o.scale)}commitMetrics(e,t){const n=this.getDocumentState(e);if(!n)return;const o=n.pageChangeState.isChanging,i=o&&t.currentPage!==n.currentPage?{...t,currentPage:n.currentPage}:t;this.dispatch(Go(e,i)),this.scroll$.emit({documentId:e,metrics:i}),o||t.currentPage===n.currentPage||this.pageChange$.emit({documentId:e,pageNumber:t.currentPage,totalPages:n.totalPages}),this.pushScrollerLayout(e)}pushScrollerLayout(e){const t=this.scrollerLayoutEmitters.get(e);if(t)try{const n=this.getScrollerLayout(e);t.emit(n)}catch{}}refreshDocumentLayout(e){const t=this.coreState.core.documents[e],n=this.getDocumentState(e);if(!t||!n||t.status!=="loaded")return;const o=this.getSpreadPagesWithRotatedSize(e),i=this.computeLayout(e,o),r=this.viewport.forDocument(e),a=this.computeMetrics(e,r.getMetrics(),i.virtualItems);this.dispatch(Go(e,{...i,...a})),this.layoutChange$.emit({documentId:e,layout:i}),this.pushScrollerLayout(e)}getSpreadPagesWithRotatedSize(e){var t,n;const o=e??this.getActiveDocumentId(),i=this.coreState.core.documents[o];if(!i)throw new Error(`Document ${o} not loaded`);return(((t=this.spread)==null?void 0:t.forDocument(o).getSpreadPages())||((n=i.document)==null?void 0:n.pages.map(r=>[r]))||[]).map(r=>r.map(a=>{const s=((a.rotation??0)+i.rotation)%4;return{...a,rotatedSize:ar(a.size,s,1)}}))}getCurrentPage(e){return this.getDocumentStateOrThrow(e).currentPage}getTotalPages(e){return this.getDocumentStateOrThrow(e).totalPages}getPageChangeState(e){return this.getDocumentStateOrThrow(e).pageChangeState}scrollToPage(e,t){var n;const o=t??this.getActiveDocumentId(),i=this.getDocumentStateOrThrow(o),r=this.getStrategy(o),a=this.getCoreDocumentOrThrow(o),{pageNumber:s,behavior:l="smooth",pageCoordinates:c,alignX:d,alignY:u}=e;this.startPageChange(o,s,l);const m=(n=a.document)==null?void 0:n.pages[s-1],g=((m?.rotation??0)+a.rotation)%4,p=r.getScrollPositionForPage(s,i.virtualItems,a.scale,g,c);p?this.viewport.forDocument(o).scrollTo({...p,behavior:l,alignX:d,alignY:u}):this.completePageChange(o)}scrollToNextPage(e="smooth",t){const n=t??this.getActiveDocumentId(),o=this.getDocumentStateOrThrow(n),i=this.getStrategy(n),r=this.getCoreDocumentOrThrow(n),a=o.virtualItems.findIndex(s=>s.pageNumbers.includes(o.currentPage));if(a>=0&&a<o.virtualItems.length-1){const s=o.virtualItems[a+1].pageNumbers[0];this.startPageChange(n,s,e);const l=i.getScrollPositionForPage(s,o.virtualItems,r.scale,r.rotation);l?this.viewport.forDocument(n).scrollTo({...l,behavior:e}):this.completePageChange(n)}}scrollToPreviousPage(e="smooth",t){const n=t??this.getActiveDocumentId(),o=this.getDocumentStateOrThrow(n),i=this.getStrategy(n),r=this.coreState.core.documents[n],a=o.virtualItems.findIndex(s=>s.pageNumbers.includes(o.currentPage));if(a>0){const s=o.virtualItems[a-1].pageNumbers[0];this.startPageChange(n,s,e);const l=i.getScrollPositionForPage(s,o.virtualItems,r.scale,r.rotation);l?this.viewport.forDocument(n).scrollTo({...l,behavior:e}):this.completePageChange(n)}}getMetrics(e,t){const n=t??this.getActiveDocumentId();if(e)return this.computeMetrics(n,e);const o=this.viewport.forDocument(n);return this.computeMetrics(n,o.getMetrics())}getLayout(e){const t=this.getDocumentStateOrThrow(e);return{virtualItems:t.virtualItems,totalContentSize:t.totalContentSize}}getRectPositionForPage(e,t,n,o,i){var r;const a=i??this.getActiveDocumentId(),s=this.getDocumentStateOrThrow(a),l=this.getStrategy(a),c=this.getCoreDocumentOrThrow(a);let d=o;if(d===void 0){const u=(r=c.document)==null?void 0:r.pages[e];d=((u?.rotation??0)+c.rotation)%4}return l.getRectPositionForPage(e+1,s.virtualItems,n??c.scale,d,t)}setScrollStrategyForDocument(e,t){const n=t??this.getActiveDocumentId(),o=this.getDocumentState(n);if(!o||o.strategy===e)return;const i=this.createStrategy(e);this.strategies.set(n,i),this.dispatch((function(r,a){return{type:Dh,payload:{documentId:r,strategy:a}}})(n,e)),this.refreshDocumentLayout(n)}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o!==i&&(this.state$.emit(i),o?.pageChangeState!==i.pageChangeState&&this.pageChangeState$.emit({documentId:n,state:i.pageChangeState}
vendor: 10,042 bytes, line 2254
2254),this.pushScrollerLayout(n))}}async initialize(){this.logger.info("ScrollPlugin","Initialize","Scroll plugin initialized")}async destroy(){this.strategies.clear(),this.layoutReady.clear(),this.initialLayoutFired.clear(),this.elevatedPages.clear();for(const e of this.scrollerLayoutEmitters.values())e.clear();this.scrollerLayoutEmitters.clear(),this.pageChange$.clear(),this.scroll$.clear(),this.layoutChange$.clear(),this.pageChangeState$.clear(),this.layoutReady$.clear(),this.state$.clear(),super.destroy()}};Th.id="scroll";let Lr=Th;const ac="scroll",ob={manifest:{id:ac,name:"Scroll Plugin",version:"1.0.0",provides:["scroll"],requires:["viewport"],optional:["spread","interaction-manager"],defaultConfig:{defaultPageGap:10,defaultBufferSize:4,defaultStrategy:It.Vertical}},create:(e,t)=>new Lr(ac,e,t),reducer:(e,t)=>{switch(t.type){case Ah:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o}}}case Ph:{const{[t.payload]:n,...o}=e.documents;return{...e,documents:o}}case Mh:{const{documentId:n,state:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,...o}}}:e}case Dh:{const{documentId:n,strategy:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,strategy:o}}}:e}default:return e}},initialState:(e,t)=>((n,o)=>({defaultStrategy:o.defaultStrategy??It.Vertical,defaultPageGap:o.defaultPageGap??10,defaultBufferSize:o.defaultBufferSize??2,documents:{}}))(0,t)},io=()=>We(Lr.id),Rh=e=>{const{provides:t}=io(),[n,o]=O(1),[i,r]=O(1);return $(()=>{if(!t||!e)return;const a=t.forDocument(e);return o(a.getCurrentPage()),r(a.getTotalPages()),t.onPageChange(s=>{s.documentId===e&&(o(s.pageNumber),r(s.totalPages))})},[t,e]),{provides:t?.forDocument(e)??null,state:{currentPage:n,totalPages:i}}};function ib({documentId:e,renderPage:t,...n}){const{plugin:o}=At(Lr.id),[i,r]=O({layout:null,docId:null});$(()=>{if(!o||!e)return;const s=o.onScrollerData(e,l=>{r({layout:l,docId:e})});return()=>{s(),r({layout:null,docId:null}),o.clearLayoutReady(e)}},[o,e]);const a=i.docId===e?i.layout:null;return Ss(()=>{o&&e&&a&&o.setLayoutReady(e)},[o,e,a]),a?k("div",{...n,style:{width:`${a.totalWidth}px`,height:`${a.totalHeight}px`,position:"relative",boxSizing:"border-box",margin:"0 auto",...a.strategy===It.Horizontal&&{display:"flex",flexDirection:"row"}},children:[k("div",{style:{...a.strategy===It.Horizontal?{width:a.startSpacing,height:"100%",flexShrink:0}:{height:a.startSpacing,width:"100%"}}}),k("div",{style:{gap:a.pageGap,display:"flex",alignItems:"center",position:"relative",boxSizing:"border-box",...a.strategy===It.Horizontal?{flexDirection:"row",minHeight:"100%"}:{flexDirection:"column",minWidth:"fit-content"}},children:a.items.map(s=>k("div",{style:{display:"flex",justifyContent:"center",gap:a.pageGap},children:s.pageLayouts.map(l=>k("div",{style:{width:`${l.rotatedWidth}px`,height:`${l.rotatedHeight}px`,position:"relative",zIndex:l.elevated?1:void 0},children:t({...l})},l.pageNumber))},s.pageNumbers[0]))}),k("div",{style:{...a.strategy===It.Horizontal?{width:a.endSpacing,height:"100%",flexShrink:0}:{height:a.endSpacing,width:"100%"}}})]}):null}var wt=(e=>(e.None="none",e.Odd="odd",e.Even="even",e))(wt||{});const Eh="SPREAD/INIT_STATE",zh="SPREAD/CLEANUP_STATE",Lh="SPREAD/SET_SPREAD_MODE",Nh="SPREAD/SET_PAGE_GROUPING";function sc(e,t){return{type:Nh,payload:{documentId:e,grouping:t}}}const Oh=class extends $e{constructor(e,t,n){var o;super(e,t),this.spreadEmitter$=xe(),this.defaultSpreadMode=n.defaultSpreadMode??wt.None,this.viewport=((o=t.getPlugin("viewport"))==null?void 0:o.provides())??null}onDocumentLoadingStarted(e){var t;const n={spreadMode:this.defaultSpreadMode};this.dispatch((function(o,i){return{type:Eh,payload:{documentId:o,state:i}}})(e,n)),(t=this.viewport)==null||t.gate("spread",e),this.logger.debug("SpreadPlugin","DocumentOpened",`Initialized spread state for document: ${e}`)}onDocumentLoaded(e){var t;const n=this.coreState.core.documents[e];if(n?.document){const o=this.calculatePageGrouping(e,n.document.pages.length);this.dispatch(sc(e,o))}(t=this.viewport)==null||t.releaseGate("spread",e)}onDocumentClosed(e){this.dispatch((function(t){return{type:zh,payload:t}})(e)),this.logger.debug("SpreadPlugin","DocumentClosed",`Cleaned up spread state for document: ${e}`)}buildCapability(){return{setSpreadMode:e=>this.setSpreadModeForDocument(e),getSpreadMode:()=>this.getSpreadModeForDocument(),getSpreadPages:()=>this.getSpreadPages(),forDocument:e=>this.createSpreadScope(e),onSpreadChange:this.spreadEmitter$.on}}createSpreadScope(e){return{setSpreadMode:t=>this.setSpreadModeForDocument(t,e),getSpreadMode:()=>this.getSpreadModeForDocument(e),getSpreadPages:()=>this.getSpreadPages(e),onSpreadChange:t=>this.spreadEmitter$.on(n=>{n.documentId===e&&t(n.spreadMode)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Spread state not found for document: ${e??"active"}`);return t}setSpreadModeForDocument(e,t){const n=t??this.getActiveDocumentId(),o=this.getDocumentStateOrThrow(n),i=this.coreState.core.documents[n];if(!i?.document)throw new Error(`Document ${n} not loaded`);if(o.spreadMode!==e){this.dispatch((function(a,s){return{type:Lh,payload:{documentId:a,spreadMode:s}}})(n,e));const r=this.calculatePageGrouping(n,i.document.pages.length);this.dispatch(sc(n,r)),this.spreadEmitter$.emit({documentId:n,spreadMode:e})}}getSpreadModeForDocument(e){return this.getDocumentStateOrThrow(e).spreadMode}calculatePageGrouping(e,t){switch(this.getDocumentStateOrThrow(e).spreadMode){case wt.None:return Array.from({length:t},(n,o)=>[o]);case wt.Odd:return Array.from({length:Math.ceil(t/2)},(n,o)=>{const i=[2*o];return 2*o+1<t&&i.push(2*o+1),i});case wt.Even:return[[0],...Array.from({length:Math.ceil((t-1)/2)},(n,o)=>{const i=[1+2*o];return 1+2*o+1<t&&i.push(1+2*o+1),i})];default:return Array.from({length:t},(n,o)=>[o])}}getSpreadPages(e){const t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t],o=this.getDocumentStateOrThrow(t);if(!n?.document)throw new Error(`Document ${t} not loaded`);const i=o.pageGrouping??[],r=n.document.pages;return i.map(a=>a.map(s=>r[s]).filter(Boolean))}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o?.spreadMode!==i.spreadMode&&this.logger.debug("SpreadPlugin","SpreadModeChanged",`Spread mode changed for document ${n}: ${o?.spreadMode??wt.None} -> ${i.spreadMode}`)}}async initialize(e){this.logger.info("SpreadPlugin","Initialize","Spread plugin initialized")}async destroy(){this.spreadEmitter$.clear(),super.destroy()}};Oh.id="spread";let Fh=Oh;const _h="spread",rb={id:_h,name:"Spread Plugin",version:"1.0.0",provides:["spread"],requires:[],optional:["viewport"],defaultConfig:{}};wt.None;const lc={documents:{},activeDocumentId:null},ab={manifest:rb,create:(e,t)=>new Fh(_h,e,t),reducer:(e=lc,t)=>{switch(t.type){case Eh:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case zh:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"SPREAD/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Lh:{const{documentId:n,spreadMode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,spreadMode:o}}}:e}case Nh:{const{documentId:n,grouping:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,pageGrouping:o}}}:e}default:return e}},initialState:lc},ht="ui",sb={id:ht,name:"UI Plugin",version:"1.0.0",provides:["ui"],requires:[],optional:["i18n"],defaultConfig:{schema:{id:"empty",version:"1.0.0",toolbars:{},menus:{},sidebars:{},modals:{},selectionMenus:{}}}},$h="UI/INIT_STATE",jh="UI/CLEANUP_STATE",Uh="UI/SET_ACTIVE_TOOLBAR",Bh="UI/CLOSE_TOOLBAR_SLOT",Wh="UI/SET_ACTIVE_SIDEBAR",Hh="UI/CLOSE_SIDEBAR_SLOT",Gh="UI/SET_SIDEBAR_TAB",qh="UI/OPEN_MODAL",Kh="UI/CLOSE_MODAL",Vh="UI/CLEAR_MODAL",Xh="UI/OPEN_MENU",Zh="UI/CLOSE_MENU",Yh="UI/CLOSE_ALL_MENUS",Qh="UI/SET_OVERLAY_ENABLED",Jh="UI/SET_DISABLED_CATEGORIES",em="UI/SET_HIDDEN_ITEMS",cc=(e,t,n,o,i,r)=>({type:Wh,payload:{documentId:e,placement:t,slot:n,sidebarId:o,activeTab:i,props:r}}),dc=(e,t,n)=>({type:Hh,payload:{documentId:e,placement:t,slot:n}}),uc=(e,t)=>({type:Xh,payload:{documentId:e,menuState:t}}),hc=(e,t)=>({type:Zh,payload:{documentId:e,menuId:t}}),mc=(e,t,n)=>({type:Qh,payload:{documentId:e,overlayId:t,enabled:n}}),Ti=e=>({type:Jh,payload:{categories:e}}),Ri=e=>({type:em,payload:{hiddenItems:e}});function lb(e,t){if(!t)return e;const n={...e};for(const[o,i]of Object.entries(t))n[o]?n[o]={...n[o],...i,items:i.items??n[o].items,responsive:i.responsive??n[o].responsive}:n[o]=i;return n}function cb(e,t){if(!t)return e;const n={...e};for(const[o,i]of Object.entries(t))n[o]?n[o]={...n[o],...i,items:i.items??n[o].items}:n[o]=i;return n}function db(e,t){if(!t)return e;const n={...e};for(const[o,i]of Object.entries(t))n[o]?n[o]={...n[o],...i,content:i.content??n[o].content}:n[o]=i;return n}function ur(e,t){var n;if(!((n=e.responsive)!=null&&n.breakpoints))return null;const o=(function(l,c,d){if(!d||!c?.groups)return l;const u=c.groups.find(g=>g.locales.includes(d));if(!u)return l;const m={};for(const[g,p]of Object.entries(l)){const f=u.breakpoints[g];f?m[g]={minWidth:p.minWidth,maxWidth:p.maxWidth,hide:f.replaceHide?f.replaceHide:[...p.hide||[],...f.hide||[]],show:f.replaceShow?f.replaceShow:[...p.show||[],...f.show||[]]}:m[g]=p}return m})(e.responsive.breakpoints,e.responsive.localeOverrides,t),i=new Map,r=new Map;for(const[l,c]of Object.entries(o))r.set(l,{minWidth:c.minWidth,maxWidth:c.maxWidth});const a=new Set,s=l=>{l.forEach(c=>{a.add(c.id),c.type==="group"&&c.items&&s(c.items),c.type==="tab-group"&&c.tabs&&s(c.tabs),c.type==="section"&&c.items&&s(c.items)})};s(e.items);for(const l of a){const c=[];let d=!0;Array.from(Object.entries(o)).sort((m,g)=>
2254(m[1].minWidth??0)-(g[1].minWidth??0)).forEach(([m,g],p)=>{var f,v;const y=(f=g.hide)==null?void 0:f.includes(l),b=(v=g.show)==null?void 0:v.includes(l);(y||b)&&(c.push({breakpointId:m,minWidth:g.minWidth,maxWidth:g.maxWidth,visible:b||!y,priority:p}),p===0&&(d=b||!y))}),c.length>0&&i.set(l,{itemId:l,shouldRender:!0,visibilityRules:c,defaultVisible:d})}return{items:i,breakpoints:r}}const tm="data-epdf",nm="data-epdf-s",_s="data-epdf-i",Nr="data-epdf-cat",$s="data-epdf-dis",om="data-epdf-hid",yn={ROOT:`[${tm}]`,STYLES:`[${nm}]`,ITEM:e=>`[${_s}="${e}"]`,CATEGORIES:e=>`[${Nr}~="${e}"]`,DISABLED_CATEGORY:e=>`[${$s}~="${e}"]`,HIDDEN_ITEM:e=>`[${om}~="${e}"]`},ub={useContainerQueries:!0};function hb(e,t={}){const n={...ub,...t.config},o=t.locale,i=im(e,o),r=[];r.push((function(c){return`/* ═══════════════════════════════════════════════════════════════════════════ */
2255/* EmbedPDF UI Stylesheet - Auto-generated${c?` (locale: ${c})`:""}                         */
2256/* DO NOT EDIT MANUALLY - This file is generated from your UI schema            */
2257/* ═══════════════════════════════════════════════════════════════════════════ */`})(o));const a=(function(c,d){const u=[],m=d.useContainerQueries?"@container":"@media",g=new Set;return c.responsiveItems.forEach((p,f)=>{if(g.has(f))return;g.add(f);const v=(function(y,b,w){if(b.visibilityRules.length===0)return null;const x=[],C=yn.ITEM(y);b.defaultVisible||x.push(`${C} { display: none; }`);for(const I of b.visibilityRules){const S=[];if(I.minWidth!==void 0&&S.push(`(min-width: ${I.minWidth}px)`),I.maxWidth!==void 0&&S.push(`(max-width: ${I.maxWidth}px)`),S.length>0){const P=I.visible?"flex":"none";x.push(`${w} ${S.join(" and ")} {
2258  ${C} { display: ${P}; }
2259}`)}}return x.length>0?x.join(`
2260`):null})(f,p,m);v&&u.push(v)}),u.length===0?"":`/* ─── Responsive Visibility Rules ─── */
2261/* Items show/hide based on container width */
2262
2263${u.join(`
2264
2265`)}`})(i,n);a&&r.push(a);const s=(function(c){if(c.categories.size===0)return"";const d=[],u=Array.from(c.categories).sort();for(const m of u)d.push(`${yn.ROOT}[${$s}~="${m}"] [${Nr}~="${m}"] {
2266  display: none !important;
2267}`);return`/* ─── Category Visibility Rules ─── */
2268/* Items hide when ANY of their categories is disabled */
2269/* Use: data-disabled-categories="category1 category2" on root element */
2270
2271${d.join(`
2272
2273`)}`})(i);s&&r.push(s);const l=(function(c,d){if(c.dependencies.length===0)return"";const u=[],m=d.useContainerQueries?"@container":"@media";for(const g of c.dependencies){const p=bb(g,c,m);p.length>0&&u.push(...p)}return u.length===0?"":`/* ─── Dependency Visibility Rules ─── */
2274/* Container elements hide when all their dependencies are hidden */
2275
2276${u.join(`
2277
2278`)}`})(i,n);return l&&r.push(l),r.filter(c=>c.trim()).join(`
2279
2280`)}function Ei(e,t){const n=new Set(t),o=[];return e.forEach((i,r)=>{i.some(a=>n.has(a))&&o.push(r)}),o}function im(e,t){const n=new Set,o=new Map,i=[],r=new Map,a=new Map;for(const[s,l]of Object.entries(e.menus))mb(s,l,n,o,i,r,a,t);for(const[s,l]of Object.entries(e.toolbars))gb(s,l,n,o,i,a,t);for(const[s,l]of Object.entries(e.sidebars))vb(s,l,n,o,i);for(const[s,l]of Object.entries(e.selectionMenus||{}))yb(s,l,n,o,i,a,t);for(const[s,l]of Object.entries(e.overlays||{}))nn(s,l.categories,l.visibilityDependsOn,n,o,i);return{categories:n,itemCategories:o,dependencies:i,menuBreakpoints:r,responsiveItems:a}}function mb(e,t,n,o,i,r,a,s){nn(e,t.categories,t.visibilityDependsOn,n,o,i),rm(t.items,n,o,i);const l=ur(t,s);l&&l.items.forEach((d,u)=>{a.set(u,d)});const c=(function(d,u,m){var g;const p=[],f=ur(d,m);if((g=d.responsive)!=null&&g.breakpoints&&f){const v=Array.from(f.breakpoints.entries()).sort((y,b)=>(y[1].minWidth??0)-(b[1].minWidth??0));for(const[y,b]of v){const w=pb(f,b),x=new Set;for(const C of w){const I=u.get(C);I&&I.forEach(S=>x.add(S))}p.push({minWidth:b.minWidth,maxWidth:b.maxWidth,visibleItemIds:w,visibleCategories:x})}}else{const v=[],y=new Set;am(d.items,u,v,y),p.push({visibleItemIds:v,visibleCategories:y})}return p})(t,o,s);r.set(e,c)}function rm(e,t,n,o){for(const i of e)nn(i.id,i.categories,i.visibilityDependsOn,t,n,o),i.type==="section"&&rm(i.items,t,n,o)}function am(e,t,n,o){for(const i of e){n.push(i.id);const r=t.get(i.id);r&&r.forEach(a=>o.add(a)),i.type==="section"&&am(i.items,t,n,o)}}function pb(e,t){const n=[];
2280return e.items.forEach((o,i)=>{let r=o.defaultVisible;for(const a of o.visibilityRules)(a.minWidth===void 0||t.minWidth!==void 0&&t.minWidth>=a.minWidth)&&(a.maxWidth===void 0||t.maxWidth!==void 0&&t.maxWidth<=a.maxWidth)&&(r=a.visible);r&&n.push(i)}),n}function gb(e,t,n,o,i,r,a){nn(e,t.categories,t.visibilityDependsOn,n,o,i);const s=ur(t,a);s&&s.items.forEach((l,c)=>{r.set(c,l)}),sm(t.items,n,o,i)}function sm(e,t,n,o){for(const i of e)nn(i.id,i.categories,i.visibilityDependsOn,t,n,o),i.type==="group"&&i.items&&sm(i.items,t,n,o),i.type==="tab-group"&&i.tabs&&fb(i.tabs,t,n,o)}function fb(e,t,n,o){for(const i of e)nn(i.id,i.categories,i.visibilityDependsOn,t,n,o)}function vb(e,t,n,o,i){if(nn(e,t.categories,t.visibilityDependsOn,n,o,i),t.content.type==="tabs")for(const r of t.content.tabs)nn(r.id,r.categories,r.visibilityDependsOn,n,o,i)}function yb(e,t,n,o,i,r,a){if(nn(e,t.categories,t.visibilityDependsOn,n,o,i),t.responsive){const s=ur(t,a);s&&s.items.forEach((l,c)=>{r.set(c,l)})}lm(t.items,n,o,i)}function lm(e,t,n,o){for(const i of e)nn(i.id,i.categories,i.visibilityDependsOn,t,n,o),i.type==="group"&&i.items&&lm(i.items,t,n,o)}function nn(e,t,n,o,i,r){var a;t?.length&&(t.forEach(s=>o.add(s)),i.set(e,t)),n&&(n.menuId||(a=n.itemIds)!=null&&a.length)&&r.push({itemId:e,dependsOnMenuId:n.menuId,dependsOnItemIds:n.itemIds})}function bb(e,t,n,o){var i;const r=[];if(e.dependsOnMenuId){const a=t.menuBreakpoints.get(e.dependsOnMenuId);if(a&&a.length>0){r.push(`/* "${e.itemId}" depends on menu "${e.dependsOnMenuId}" */`);for(const s of a){if(s.visibleItemIds.length===0)continue;const l=s.visibleItemIds.sort().map(u=>yn.HIDDEN_ITEM(u)).join(""),c=`${yn.ROOT}${l} ${yn.ITEM(e.itemId)} {
2281  display: none !important;
2282}`,d=[];s.minWidth!==void 0&&d.push(`(min-width: ${s.minWidth}px)`),s.maxWidth!==void 0&&d.push(`(max-width: ${s.maxWidth}px)`),d.length>0?r.push(`${n} ${d.join(" and ")} {
2283  ${c}
2284}`):r.push(c)}}}if((i=e.dependsOnItemIds)!=null&&i.length){r.push(`/* "${e.itemId}" depends on items: ${e.dependsOnItemIds.join(", ")} */`);const a=e.dependsOnItemIds.sort().map(s=>yn.HIDDEN_ITEM(s)).join("");r.push(`${yn.ROOT}${a} ${yn.ITEM(e.itemId)} {
2285  display: none !important;
2286}`)}return r}function it(e,t){var n;return{[_s]:e.id,[Nr]:((n=e.categories)==null?void 0:n.join(" "))||void 0,...t}}const cm=class extends $e{constructor(e,t,n){var o,i;if(super(e,t),this.cachedStylesheet=null,this.cachedLocale=null,this.i18n=null,this.i18nCleanup=null,this.categoryChanged$=xe(),this.stylesheetInvalidated$=st(),this.toolbarChanged$=Ue((r,a)=>({documentId:r,...a}),{cache:!1}),this.sidebarChanged$=Ue((r,a)=>({documentId:r,...a}),{cache:!1}),this.modalChanged$=Ue((r,a)=>({documentId:r,...a}),{cache:!1}),this.menuChanged$=Ue((r,a)=>({documentId:r,...a}),{cache:!1}),this.overlayChanged$=Ue((r,a)=>({documentId:r,...a}),{cache:!1}),this.schema=n.schema,this.stylesheetConfig=n.stylesheetConfig||{},this.itemCategories=im(this.schema).itemCategories,(o=n.disabledCategories)==null?void 0:o.length){this.dispatch(Ti(n.disabledCategories));const r=Ei(this.itemCategories,n.disabledCategories);this.dispatch(Ri(r))}this.i18n=((i=t.getPlugin("i18n"))==null?void 0:i.provides())??null,this.i18n&&(this.i18nCleanup=this.i18n.onLocaleChange(({currentLocale:r})=>{this.handleLocaleChange(r)}),this.cachedLocale=this.i18n.getLocale())}async initialize(){this.logger.info("UIPlugin","Initialize","UI plugin initialized")}async destroy(){this.i18nCleanup&&(this.i18nCleanup(),this.i18nCleanup=null),this.toolbarChanged$.clear(),this.sidebarChanged$.clear(),this.modalChanged$.clear(),this.menuChanged$.clear(),this.overlayChanged$.clear(),this.stylesheetInvalidated$.clear(),super.destroy()}onDocumentLoadingStarted(e){this.dispatch(((t,n)=>({type:$h,payload:{documentId:t,schema:n}}))(e,this.schema))}onDocumentClosed(e){this.dispatch((t=>({type:jh,payload:{documentId:t}}))(e)),this.toolbarChanged$.clearScope(e),this.sidebarChanged$.clearScope(e),this.modalChanged$.clearScope(e),this.menuChanged$.clearScope(e),this.overlayChanged$.clearScope(e)}handleLocaleChange(e){this.cachedLocale!==e&&(this.logger.debug("UIPlugin","LocaleChange",`Locale changed: ${this.cachedLocale} -> ${e}`),this.cachedLocale=e,this.invalidateStylesheet(),this.stylesheetInvalidated$.emit())}getStylesheet(){var e;const t=((e=this.i18n)==null?void 0:e.getLocale())??null;return this.cachedStylesheet&&this.cachedLocale===t||(this.cachedStylesheet=hb(this.schema,{config:this.stylesheetConfig,locale:t??void 0}),this.cachedLocale=t),this.cachedStylesheet}getLocale(){var e;return((e=this.i18n)==null?void 0:e.getLocale())??null}invalidateStylesheet(){this.cachedStylesheet=null}onStylesheetInvalidated(e){return this.stylesheetInvalidated$.on(e)}disableCategoryImpl(e){const t=new Set(this.state.disabledCategories);if(!t.has(e)){t.add(e);const n=Array.from(t);
vendor: 14,318 bytes, line 2286
2286this.dispatch(Ti(n));const o=Ei(this.itemCategories,n);this.dispatch(Ri(o)),this.categoryChanged$.emit({disabledCategories:n,hiddenItems:o})}}enableCategoryImpl(e){const t=new Set(this.state.disabledCategories);if(t.has(e)){t.delete(e);const n=Array.from(t);this.dispatch(Ti(n));const o=Ei(this.itemCategories,n);this.dispatch(Ri(o)),this.categoryChanged$.emit({disabledCategories:n,hiddenItems:o})}}toggleCategoryImpl(e){this.state.disabledCategories.includes(e)?this.enableCategoryImpl(e):this.disableCategoryImpl(e)}setDisabledCategoriesImpl(e){this.dispatch(Ti(e));const t=Ei(this.itemCategories,e);this.dispatch(Ri(t)),this.categoryChanged$.emit({disabledCategories:e,hiddenItems:t})}buildCapability(){return{setActiveToolbar:(e,t,n,o)=>this.setToolbarForDocument(e,t,n,o),setActiveSidebar:(e,t,n,o,i,r)=>this.setSidebarForDocument(e,t,n,o,i,r),toggleSidebar:(e,t,n,o,i,r)=>this.toggleSidebarForDocument(e,t,n,o,i,r),openModal:(e,t,n)=>this.openModalForDocument(e,t,n),openMenu:(e,t,n,o)=>this.openMenuForDocument(e,t,n,o),toggleMenu:(e,t,n,o)=>this.toggleMenuForDocument(e,t,n,o),enableOverlay:(e,t)=>this.enableOverlayForDocument(e,t),disableOverlay:(e,t)=>this.disableOverlayForDocument(e,t),toggleOverlay:(e,t)=>this.toggleOverlayForDocument(e,t),forDocument:e=>this.createUIScope(e),getSchema:()=>this.schema,mergeSchema:e=>{var t,n;this.schema=(t=this.schema,n=e,{...t,...n,toolbars:lb(t.toolbars,n.toolbars),menus:cb(t.menus,n.menus),sidebars:db(t.sidebars,n.sidebars)})},disableCategory:e=>this.disableCategoryImpl(e),enableCategory:e=>this.enableCategoryImpl(e),toggleCategory:e=>this.toggleCategoryImpl(e),setDisabledCategories:e=>this.setDisabledCategoriesImpl(e),getDisabledCategories:()=>this.state.disabledCategories,isCategoryDisabled:e=>this.state.disabledCategories.includes(e),getHiddenItems:()=>this.state.hiddenItems,onToolbarChanged:this.toolbarChanged$.onGlobal,onSidebarChanged:this.sidebarChanged$.onGlobal,onModalChanged:this.modalChanged$.onGlobal,onMenuChanged:this.menuChanged$.onGlobal,onOverlayChanged:this.overlayChanged$.onGlobal,onCategoryChanged:this.categoryChanged$.on}}createUIScope(e){return{setActiveToolbar:(t,n,o)=>this.setToolbarForDocument(t,n,o,e),getActiveToolbar:(t,n)=>this.getToolbarForDocument(t,n,e),closeToolbarSlot:(t,n)=>this.closeToolbarForDocument(t,n,e),isToolbarOpen:(t,n,o)=>this.isToolbarOpenForDocument(t,n,o,e),setActiveSidebar:(t,n,o,i,r)=>this.setSidebarForDocument(t,n,o,e,i,r),getActiveSidebar:(t,n)=>this.getSidebarForDocument(t,n,e),closeSidebarSlot:(t,n)=>this.closeSidebarForDocument(t,n,e),toggleSidebar:(t,n,o,i,r)=>this.toggleSidebarForDocument(t,n,o,e,i,r),isSidebarOpen:(t,n,o)=>this.isSidebarOpenForDocument(t,n,o,e),setSidebarTab:(t,n)=>this.setSidebarTabForDocument(t,n,e),getSidebarTab:t=>this.getSidebarTabForDocument(t,e),openModal:(t,n)=>this.openModalForDocument(t,n,e),closeModal:()=>this.closeModalForDocument(e),clearModal:()=>this.clearModalForDocument(e),getActiveModal:()=>this.getActiveModalForDocument(e),isModalOpen:()=>this.isModalOpenForDocument(e),openMenu:(t,n,o)=>this.openMenuForDocument(t,n,o,e),closeMenu:t=>this.closeMenuForDocument(t,e),toggleMenu:(t,n,o)=>this.toggleMenuForDocument(t,n,o,e),closeAllMenus:()=>this.closeAllMenusForDocument(e),isMenuOpen:t=>this.isMenuOpenForDocument(t,e),getOpenMenus:()=>this.getOpenMenusForDocument(e),enableOverlay:t=>this.enableOverlayForDocument(t,e),disableOverlay:t=>this.disableOverlayForDocument(t,e),toggleOverlay:t=>this.toggleOverlayForDocument(t,e),isOverlayEnabled:t=>this.isOverlayEnabledForDocument(t,e),getEnabledOverlays:()=>this.getEnabledOverlaysForDocument(e),getSchema:()=>this.schema,getState:()=>this.getDocumentStateOrThrow(e),onToolbarChanged:this.toolbarChanged$.forScope(e),onSidebarChanged:this.sidebarChanged$.forScope(e),onModalChanged:this.modalChanged$.forScope(e),onMenuChanged:this.menuChanged$.forScope(e),onOverlayChanged:this.overlayChanged$.forScope(e)}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`UI state not found for document: ${e??"active"}`);return t}setToolbarForDocument(e,t,n,o){const i=o??this.getActiveDocumentId();this.dispatch(((r,a,s,l)=>({type:Uh,payload:{documentId:r,placement:a,slot:s,toolbarId:l}}))(i,e,t,n)),this.toolbarChanged$.emit(i,{placement:e,slot:t,toolbarId:n})}getToolbarForDocument(e,t,n){const o=`${e}-${t}`,i=this.getDocumentStateOrThrow(n).activeToolbars[o];return i?.isOpen?i.toolbarId:null}closeToolbarForDocument(e,t,n){const o=n??this.getActiveDocumentId();this.dispatch(((i,r,a)=>({type:Bh,payload:{documentId:i,placement:r,slot:a}}))(o,e,t)),this.toolbarChanged$.emit(o,{placement:e,slot:t,toolbarId:""})}isToolbarOpenForDocument(e,t,n,o){const i=`${e}-${t}`,r=this.getDocumentStateOrThrow(o).activeToolbars[i];return!(!r||!r.isOpen)&&(!n||r.toolbarId===n)}setSidebarForDocument(e,t,n,o,i,r){const a=o??this.getActiveDocumentId();this.dispatch(cc(a,e,t,n,i,r)),this.sidebarChanged$.emit(a,{placement:e,slot:t,sidebarId:n})}getSidebarForDocument(e,t,n){const o=`${e}-${t}`,i=this.getDocumentStateOrThrow(n).activeSidebars[o];return i?.isOpen?i.sidebarId:null}closeSidebarForDocument(e,t,n){const o=n??this.getActiveDocumentId();this.dispatch(dc(o,e,t)),this.sidebarChanged$.emit(o,{placement:e,slot:t,sidebarId:""})}toggleSidebarForDocument(e,t,n,o,i,r){const a=o??this.getActiveDocumentId(),s=`${e}-${t}`,l=this.getDocumentStateOrThrow(a).activeSidebars[s];l?.sidebarId===n&&l?.isOpen?(this.dispatch(dc(a,e,t)),this.sidebarChanged$.emit(a,{placement:e,slot:t,sidebarId:""})):(this.dispatch(cc(a,e,t,n,i,r)),this.sidebarChanged$.emit(a,{placement:e,slot:t,sidebarId:n}))}isSidebarOpenForDocument(e,t,n,o){const i=`${e}-${t}`,r=this.getDocumentStateOrThrow(o).activeSidebars[i];return!(!r||!r.isOpen)&&(!n||r.sidebarId===n)}setSidebarTabForDocument(e,t,n){const o=n??this.getActiveDocumentId();this.dispatch(((i,r,a)=>({type:Gh,payload:{documentId:i,sidebarId:r,tabId:a}}))(o,e,t))}getSidebarTabForDocument(e,t){return this.getDocumentStateOrThrow(t).sidebarTabs[e]??null}openModalForDocument(e,t,n){const o=n??this.getActiveDocumentId();this.dispatch(((i,r,a)=>({type:qh,payload:{documentId:i,modalId:r,props:a}}))(o,e,t)),this.modalChanged$.emit(o,{modalId:e,isOpen:!0})}closeModalForDocument(e){const t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).activeModal;this.dispatch((o=>({type:Kh,payload:{documentId:o}}))(t)),this.modalChanged$.emit(t,{modalId:n?.modalId??null,isOpen:!1})}clearModalForDocument(e){const t=e??this.getActiveDocumentId();this.dispatch((n=>({type:Vh,payload:{documentId:n}}))(t))}getActiveModalForDocument(e){return this.getDocumentStateOrThrow(e).activeModal}isModalOpenForDocument(e){const t=this.getDocumentStateOrThrow(e).activeModal;return t?.isOpen??!1}openMenuForDocument(e,t,n,o){const i=o??this.getActiveDocumentId();this.dispatch(uc(i,{menuId:e,triggeredByCommandId:t,triggeredByItemId:n})),this.menuChanged$.emit(i,{menuId:e,isOpen:!0})}closeMenuForDocument(e,t){const n=t??this.getActiveDocumentId();this.dispatch(hc(n,e)),this.menuChanged$.emit(n,{menuId:e,isOpen:!1})}toggleMenuForDocument(e,t,n,o){const i=o??this.getActiveDocumentId();this.getDocumentStateOrThrow(i).openMenus[e]?(this.dispatch(hc(i,e)),this.menuChanged$.emit(i,{menuId:e,isOpen:!1})):(this.dispatch(uc(i,{menuId:e,triggeredByCommandId:t,triggeredByItemId:n})),this.menuChanged$.emit(i,{menuId:e,isOpen:!0}))}closeAllMenusForDocument(e){const t=e??this.getActiveDocumentId();this.dispatch((n=>({type:Yh,payload:{documentId:n}}))(t))}isMenuOpenForDocument(e,t){return!!this.getDocumentStateOrThrow(t).openMenus[e]}getOpenMenusForDocument(e){return Object.values(this.getDocumentStateOrThrow(e).openMenus)}enableOverlayForDocument(e,t){const n=t??this.getActiveDocumentId();this.dispatch(mc(n,e,!0)),this.overlayChanged$.emit(n,{overlayId:e,isEnabled:!0})}disableOverlayForDocument(e,t){const n=t??this.getActiveDocumentId();this.dispatch(mc(n,e,!1)),this.overlayChanged$.emit(n,{overlayId:e,isEnabled:!1})}toggleOverlayForDocument(e,t){const n=t??this.getActiveDocumentId();this.isOverlayEnabledForDocument(e,n)?this.disableOverlayForDocument(e,n):this.enableOverlayForDocument(e,n)}isOverlayEnabledForDocument(e,t){return this.getDocumentStateOrThrow(t).enabledOverlays[e]??!0}getEnabledOverlaysForDocument(e){const t=this.getDocumentStateOrThrow(e).enabledOverlays;return Object.entries(t).filter(([,n])=>n).map(([n])=>n)}};cm.id="ui";let Or=cm;const Bn={activeToolbars:{},activeSidebars:{},activeModal:null,openMenus:{},sidebarTabs:{},enabledOverlays:{}},pc={documents:{},disabledCategories:[],hiddenItems:[]};function dm(e,t){const n=(function(o){return o.ui??null})(e);return n?.documents[t]??null}function um(e,t){return`${e}-${t}`}function po(e,t,n,o,i){const r=(function(a,s,l,c){const d=dm(a,s);return d?d.activeToolbars[um(l,c)]??null:null})(e,t,n,o);return!(!r||!r.isOpen)&&(!i||r.toolbarId===i)}function Yt(e,t,n,o,i){const r=(function(a,s,l,c){const d=dm(a,s);return d?d.activeSidebars[um(l,c)]??null:null})(e,t,n,o);return!(!r||!r.isOpen)&&(!i||r.sidebarId===i)}const wb={manifest:sb,create:(e,t)=>new Or(ht,e,t),reducer:(e=pc,t)=>{var n;switch(t.type){case $h:{const{documentId:o,schema:i}=t.payload,r={};Object.values(i.toolbars).forEach(s=>{if(s.permanent&&s.position){const l=`${s.position.placement}-${s.position.slot}`;r[l]={toolbarId:s.id,isOpen:!0}}});const a={};return i.overlays&&Object.values(i.overlays).forEach(s=>{a[s.id]=s.defaultEnabled??!0}),{...e,documents:{...e.documents,[o]:{...Bn,activeToolbars:r,enabledOverlays:a}}}}case jh:{const{documentId:o}=t.payload,{[o]:i,...r}=e.documents;return{...e,documents:r}}case Uh:{const{documentId:o,placement:i,slot:r,toolbarId:a}=t.payload,s=e.documents[o]||Bn,l=`${i}-${r}`;return{...e,documents:{...e.documents,[o]:{...s,activeToolbars:{...s.activeToolbars,[l]:{toolbarId:a,isOpen:!0}}}}}}case Bh:{const{documentId:o,placement:i,slot:r}=t.payload,a=e.documents[o];if(!a)return e;const s=`${i}-${r}`,l=a.activeToolbars[s];return l?{...e,documents:{...e.documents,[o]:{...a,activeToolbars:{...a.activeToolbars,[s]:{...l,isOpen:!1}}}}}:e}case Wh:{const{documentId:o,placement:i,slot:r,sidebarId:a,activeTab:s,props:l}=t.payload,c=e.documents[o]||Bn,d=`${i}-${r}`;return{...e,documents:{...e.documents,[o]:{...c,activeSidebars:{...c.activeSidebars,[d]:{sidebarId:a,isOpen:!0,props:l}},...s&&{sidebarTabs:{...c.sidebarTabs,[a]:s}}}}}}case Hh:{const{documentId:o,placement:i,slot:r}=t.payload,a=e.documents[o];if(!a)return e;const s=`${i}-${r}`,l=a.activeSidebars[s];return l?{...e,documents:{...e.documents,[o]:{...a,activeSidebars:{...a.activeSidebars,[s]:{...l,isOpen:!1}}}}}:e}case Gh:{const{documentId:o,sidebarId:i,tabId:r}=t.payload,a=e.documents[o]||Bn;return{...e,documents:{...e.documents,[o]:{...a,sidebarTabs:{...a.sidebarTabs,[i]:r}}}}}case qh:{const{documentId:o,modalId:i,props:r}=t.payload,a=e.documents[o]||Bn;return{...e,documents:{...e.documents,[o]:{...a,activeModal:{modalId:i,isOpen:!0,props:r},openMenus:{}}}}}case Kh:{const{documentId:o}=t.payload,i=e.documents[o];return i?.activeModal?{...e,documents:{...e.documents,[o]:{...i,activeModal:{...i.activeModal,isOpen:!1}}}}:e}case Vh:{const{documentId:o}=t.payload,i=e.documents[o];return i?(n=i.activeModal)!=null&&n.isOpen?e:{...e,documents:{...e.documents,[o]:{...i,activeModal:null}}}:e}case Xh:{const{documentId:o,menuState:i}=t.payload,r=e.documents[o]||Bn;return{...e,documents:{...e.documents,[o]:{...r,openMenus:{[i.menuId]:i}}}}}case Zh:{const{documentId:o,menuId:i}=t.payload,r=e.documents[o];if(!r)return e;const{[i]:a,...s}=r.openMenus;return{...e,documents:{...e.documents,[o]:{...r,openMenus:s}}}}case Yh:{const{documentId:o}=t.payload,i=e.documents[o];return i?{...e,documents:{...e.documents,[o]:{...i,openMenus:{}}}}:e}case Qh:{const{documentId:o,overlayId:i,enabled:r}=t.payload,a=e.documents[o]||Bn;return{...e,documents:{...e.documents,[o]:{...a,enabledOverlays:{...a.enabledOverlays,[i]:r}}}}}case Jh:return{...e,disabledCategories:t.payload.categories};case em:return{...e,hiddenItems:t.payload.hiddenItems};default:return e}},initialState:pc},ro=()=>We(Or.id),hm=e=>{const{provides:t}=ro(),[n,o]=O(null);return $(()=>{if(!t)return;const i=t.forDocument(e);o(i.getState());const r=i.onToolbarChanged(()=>o(i.getState())),a=i.onSidebarChanged(()=>o(i.getState())),s=i.onModalChanged(()=>o(i.getState())),l=i.onMenuChanged(()=>o(i.getState())),c=i.onOverlayChanged(()=>o(i.getState()));return()=>{r(),a(),s(),l(),c()}},[t,e]),n},mm=rn(null);function pm(){const e=an(mm);if(!e)throw new Error("useUIContainer must be used within a UIProvider");return e}const gm=rn(null);function xb({children:e}){const t=K(new Map),n={register:W((o,i,r)=>{const a=`${o}:${i}`;t.current.set(a,r)},[]),unregister:W((o,i)=>{const r=`${o}:${i}`;t.current.delete(r)},[]),getAnchor:W((o,i)=>{const r=`${o}:${i}`;return t.current.get(r)||null},[])};return k(gm.Provider,{value:n,children:e})}function fm(){const e=an(gm);if(!e)throw new Error("useAnchorRegistry must be used within UIProvider");return e}function vm(e,t){const n=fm(),o=K(null),i=K(e),r=K(t);return i.current=e,r.current=t,W(a=>{const s=o.current;o.current=a,a?a!==s&&n.register(i.current,r.current,a):s&&n.unregister(i.current,r.current)},[n])}const ym=rn(null);function kb({children:e,initialComponents:t={}}){const n=K(new Map(Object.entries(t))),o={register:W((i,r)=>{n.current.set(i,r)},[]),unregister:W(i=>{n.current.delete(i)},[]),get:W(i=>n.current.get(i),[]),has:W(i=>n.current.has(i),[]),getRegisteredIds:W(()=>Array.from(n.current.keys()),[])};return k(ym.Provider,{value:o,children:e})}function Fr(){const e=(function(){const t=an(ym);if(!t)throw new Error("useComponentRegistry must be used within UIProvider");return t})();return{renderCustomComponent:(t,n,o)=>{const i=e.get(t);return i?k(i,{documentId:n,...o||{}}):(console.error(`Component "${t}" not found in registry`),null)}}}const bm=rn(null);function Cb({children:e,renderers:t}){return k(bm.Provider,{value:t,children:e})}function js(){const e=an(bm);if(!e)throw new Error("useRenderers must be used within UIProvider");return e}function zi(e,t){var n;const{provides:o}=ro(),i=js(),r=W(s=>{var l;const c=o?.getSchema(),d=(l=c?.selectionMenus)==null?void 0:l[e];
2286return!d||!s.selected?null:k(i.selectionMenu,{schema:d,documentId:t,props:s})},[o,i,e,t]),a=o?.getSchema();if((n=a?.selectionMenus)!=null&&n[e])return r}function Ib({container:e,documentId:t}){const n=hm(t),{provides:o}=ro(),i=fm(),r=js(),[a,s]=O(null),l=n?.openMenus||{},c=o?.getSchema();if($(()=>{const u=Object.keys(l);if(u.length>0){const m=u[0];if(!m)return void s(null);const g=l[m];if(g&&g.triggeredByItemId){const p=i.getAnchor(t,g.triggeredByItemId);s({menuId:m,anchorEl:p})}else s(null)}else s(null)},[l,i,t]),!a||!c)return null;const d=c.menus[a.menuId];return d?k(r.menu,{schema:d,documentId:t,anchorEl:a.anchorEl,onClose:()=>{a&&o?.forDocument(t).closeMenu(a.menuId)},container:e}):(console.warn(`Menu "${a.menuId}" not found in schema`),null)}function Sb({children:e,style:t,...n}){const{plugin:o}=At(Or.id),{provides:i}=ro(),[r,a]=O([]),[s,l]=O([]),c=K(null),d=K(null),u=K(null),m=K(null),g=Z(()=>({containerRef:m,getContainer:()=>m.current}),[]),p=W(w=>{const x=u.current;if(u.current=w,m.current=w,w&&w!==x&&o){const C=(function(A){const D=A.getRootNode();return D instanceof ShadowRoot?D:document.head})(w);d.current=C;const I=C.querySelector(yn.STYLES);if(I)return c.current=I,void(I.textContent=o.getStylesheet());const S=o.getStylesheet(),P=document.createElement("style");P.setAttribute(nm,""),P.textContent=S,C instanceof ShadowRoot?C.insertBefore(P,C.firstChild):C.appendChild(P),c.current=P}},[o]);$(()=>()=>{var w;(w=c.current)!=null&&w.parentNode&&!u.current&&c.current.remove(),c.current=null,d.current=null},[]),$(()=>{if(o)return o.onStylesheetInvalidated(()=>{c.current&&(c.current.textContent=o.getStylesheet())})},[o]),$(()=>{if(i)return a(i.getDisabledCategories()),l(i.getHiddenItems()),i.onCategoryChanged(({disabledCategories:w,hiddenItems:x})=>{a(w),l(x)})},[i]);const f=Z(()=>r.length>0?r.join(" "):void 0,[r]),v=Z(()=>s.length>0?s.join(" "):void 0,[s]),y=Z(()=>{const w={containerType:"inline-size"};return t&&typeof t=="object"?{...w,...t}:w},[t]),b={[tm]:"",[$s]:f,[om]:v};return k(mm.Provider,{value:g,children:k("div",{ref:p,...b,...n,style:y,children:e})})}function Ab({children:e,documentId:t,components:n={},renderers:o,menuContainer:i,...r}){return k(xb,{children:k(kb,{initialComponents:n,children:k(Cb,{renderers:o,children:k(Sb,{...r,children:[e,k(Ib,{documentId:t,container:i})]})})})})}const wm=class extends $e{constructor(e,t,n){super(e,t),this.id=e,this.documentOpened$=xe(),this.documentClosed$=xe(),this.activeDocumentChanged$=xe(),this.documentError$=xe(),this.documentOrderChanged$=xe(),this.openFileRequest$=st(),this.loadOptions=new Map,this.maxDocuments=n?.maxDocuments}buildCapability(){return{openFileDialog:e=>this.openFileDialog(e),openDocumentUrl:e=>this.openDocumentUrl(e),openDocumentBuffer:e=>this.openDocumentBuffer(e),retryDocument:(e,t)=>this.retryDocument(e,t),closeDocument:e=>this.closeDocument(e),closeAllDocuments:()=>this.closeAllDocuments(),setActiveDocument:e=>{if(!this.isDocumentOpen(e))throw new Error(`Cannot set active document: ${e} is not open`);this.dispatchCoreAction((t=>({type:zs,payload:t}))(e))},getActiveDocumentId:()=>this.coreState.core.activeDocumentId,getActiveDocument:()=>{var e;const t=this.coreState.core.activeDocumentId;return t?((e=this.coreState.core.documents[t])==null?void 0:e.document)??null:null},getDocumentOrder:()=>this.coreState.core.documentOrder,moveDocument:(e,t)=>{this.dispatchCoreAction(((n,o)=>({type:Ns,payload:{documentId:n,toIndex:o}}))(e,t))},swapDocuments:(e,t)=>{const n=this.coreState.core.documentOrder,o=n.indexOf(e),i=n.indexOf(t);if(o===-1||i===-1)throw new Error("One or both documents not found in order");const r=[...n];[r[o],r[i]]=[r[i],r[o]],this.dispatchCoreAction((a=>({type:Ls,payload:a}))(r))},getDocument:e=>{var t;return((t=this.coreState.core.documents[e])==null?void 0:t.document)??null},getDocumentState:e=>this.coreState.core.documents[e]??null,getOpenDocuments:()=>this.coreState.core.documentOrder.map(e=>this.coreState.core.documents[e]).filter(e=>e!==null),isDocumentOpen:e=>this.isDocumentOpen(e),getDocumentCount:()=>Object.keys(this.coreState.core.documents).length,getDocumentIndex:e=>this.coreState.core.documentOrder.indexOf(e),setDocumentEncryption:(e,t)=>this.setDocumentEncryption(e,t),unlockOwnerPermissions:(e,t)=>this.unlockOwnerPermissions(e,t),removeEncryption:e=>this.removeEncryption(e),onDocumentOpened:this.documentOpened$.on,onDocumentClosed:this.documentClosed$.on,onDocumentError:this.documentError$.on,onActiveDocumentChanged:this.activeDocumentChanged$.on,onDocumentOrderChanged:this.documentOrderChanged$.on}}isDocumentOpen(e){return!!this.coreState.core.documents[e]}onDocumentLoaded(e){const t=this.coreState.core.documents[e];t&&t.status==="loaded"&&(this.loadOptions.delete(e),this.documentOpened$.emit(t),this.logger.info("DocumentManagerPlugin","DocumentOpened",`Document ${e} opened successfully`,{name:t.name}))}onDocumentClosed(e){this.loadOptions.delete(e),this.documentClosed$.emit(e),this.logger.info("DocumentManagerPlugin","DocumentClosed",`Document ${e} closed`)}onActiveDocumentChanged(e,t){this.activeDocumentChanged$.emit({previousDocumentId:e,currentDocumentId:t}),this.logger.info("DocumentManagerPlugin","ActiveDocumentChanged",`Active document changed from ${e} to ${t}`)}onCoreStoreUpdated(e,t){e.core.documentOrder!==t.core.documentOrder&&this.documentOrderChanged$.emit({order:t.core.documentOrder})}onOpenFileRequest(e){return this.openFileRequest$.on(e)}openDocumentUrl(e){const t=new se,n=e.documentId||this.generateDocumentId(),o=this.checkDocumentLimit();if(o)return t.reject(o),t;const i=e.name??this.extractNameFromUrl(e.url);this.loadOptions.set(n,e),this.dispatchCoreAction(Yl(n,i,e.scale,e.rotation,!!e.password,e.autoActivate,e.permissions)),this.logger.info("DocumentManagerPlugin","OpenD
2286ocumentUrl",`Starting to load document from URL: ${e.url}`,{documentId:n,passwordProvided:!!e.password});const r={id:n,url:e.url},a=this.engine.openDocumentUrl(r,{password:e.password,mode:e.mode,requestOptions:e.requestOptions,normalizeRotation:!0});return t.resolve({documentId:n,task:a}),this.handleLoadTask(n,a,"OpenDocumentUrl"),t}openDocumentBuffer(e){const t=new se,n=this.checkDocumentLimit();if(n)return t.reject(n),t;const o=e.documentId||this.generateDocumentId();this.loadOptions.set(o,e),this.dispatchCoreAction(Yl(o,e.name,e.scale,e.rotation,!!e.password,e.autoActivate,e.permissions)),this.logger.info("DocumentManagerPlugin","OpenDocumentBuffer",`Starting to load document from buffer: ${e.name}`,{documentId:o,passwordProvided:!!e.password});const i={id:o,content:e.buffer},r=this.engine.openDocumentBuffer(i,{password:e.password,normalizeRotation:!0});return t.resolve({documentId:o,task:r}),this.handleLoadTask(o,r,"OpenDocumentBuffer"),t}retryDocument(e,t){const n=new se,o=this.validateRetry(e);if(!o.valid)return n.reject(o.error),n;const i={...this.loadOptions.get(e),...t?.password&&{password:t.password}};this.loadOptions.set(e,i),this.dispatchCoreAction(((a,s)=>({type:Es,payload:{documentId:a,passwordProvided:s}}))(e,!!t?.password)),this.logger.info("DocumentManagerPlugin","RetryDocument",`Retrying to load document ${e}`,{passwordProvided:!!t?.password});const r="url"in i?this.retryUrlDocument(e,i):this.retryBufferDocument(e,i);return n.resolve({documentId:e,task:r}),this.handleLoadTask(e,r,"RetryDocument"),n}openFileDialog(e){const t=new se;return this.openFileRequest$.emit({task:t,options:e}),t}closeDocument(e){const t=new se,n=this.coreState.core.documents[e];return n?(n.status==="loaded"&&n.document?this.engine.closeDocument(n.document).wait(()=>{this.dispatchCoreAction(Ql(e)),t.resolve()},o=>{this.logger.error("DocumentManagerPlugin","CloseDocument",`Failed to close document ${e}`,o),t.fail(o)}):(this.logger.info("DocumentManagerPlugin","CloseDocument",`Closing document ${e} in ${n.status} state (skipping engine close)`),this.dispatchCoreAction(Ql(e)),t.resolve()),t):(this.logger.warn("DocumentManagerPlugin","CloseDocument",`Cannot close document ${e}: not found in state`),t.resolve(),t)}closeAllDocuments(){const e=Object.keys(this.coreState.core.documents),t=e.map(n=>this.closeDocument(n));return this.logger.info("DocumentManagerPlugin","CloseAllDocuments",`Closing ${e.length} documents`),se.all(t)}setDocumentEncryption(e,t){const n=new se,o=this.coreState.core.documents[e];return o?.document?(this.logger.info("DocumentManagerPlugin","SetDocumentEncryption",`Setting encryption on document ${e}`,{hasUserPassword:!!t.userPassword,allowedFlags:t.allowedFlags}),this.engine.setDocumentEncryption(o.document,t.userPassword??"",t.ownerPassword,t.allowedFlags).wait(i=>{i&&this.logger.info("DocumentManagerPlugin","SetDocumentEncryption",`Encryption set successfully on document ${e}`),n.resolve(i)},i=>{this.logger.error("DocumentManagerPlugin","SetDocumentEncryption",`Failed to set encryption on document ${e}`,i),n.fail(i)}),n):(n.reject({code:H.DocNotOpen,message:`Document ${e} is not open`}),n)}unlockOwnerPermissions(e,t){const n=new se,o=this.coreState.core.documents[e];if(!o?.document)return n.reject({code:H.DocNotOpen,message:`Document ${e} is not open`}),n;const i=o.document;return this.logger.info("DocumentManagerPlugin","UnlockOwnerPermissions",`Attempting to unlock owner permissions on document ${e}`),this.engine.unlockOwnerPermissions(i,t).wait(r=>{r&&(this.logger.info("DocumentManagerPlugin","UnlockOwnerPermissions",`Owner permissions unlocked on document ${e}`),this.dispatchCoreAction(((s,l,c)=>({type:Os,payload:{documentId:s,permissions:l,isOwnerUnlocked:c}}))(e,4294967295,!0))),n.resolve(r)},r=>{this.logger.error("DocumentManagerPlugin","UnlockOwnerPermissions",`Failed to unlock owner permissions on document ${e}`,r),n.fail(r)}),n}removeEncryption(e){const t=new se,n=this.coreState.core.documents[e];return n?.document?(this.logger.info("DocumentManagerPlugin","RemoveEncryption",`Marking document ${e} for encryption removal on save`),this.engine.removeEncryption(n.document).wait(o=>{o&&this.logger.info("DocumentManagerPlugin","RemoveEncryption",`Document ${e} marked for encryption removal`),t.resolve(o)},o=>{this.logger.error("DocumentManagerPlugin","RemoveEncryption",`Failed to mark document ${e} for encryption removal`,o),t.fail(o)}),t):(t.reject({code:H.DocNotOpen,message:`Document ${e} is not open`}),t)}checkDocumentLimit(){return this.maxDocuments&&Object.keys(this.coreState.core.documents).length>=this.maxDocuments?{code:H.Unknown,message:`Maximum number of documents (${this.maxDocuments}) reached`}:null}validateRetry(e){const t=this.coreState.core.documents[e];return t?t.status==="loaded"?{valid:!1,error:{code:H.Unknown,message:`Document ${e} is already loaded successfully`}}:t.status!=="error"?{valid:!1,error:{code:H.Unknown,message:`Document ${e} is not in error state (current state: ${t.status})`}}:this.loadOptions.has(e)?{valid:!0}:{valid:!1,error:{code:H.Unknown,message:`No retry information available for document ${e}`}}:{valid:!1,error:{code:H.NotFound,message:`Document ${e} not found`}}}retryUrlDocument(e,t){const n={id:e,url:t.url};return this.engine.openDocumentUrl(n,{password:t.password,mode:t.mode,requestOptions:t.requestOptions})}retryBufferDocument(e,t){const n={id:e,content:t.buffer};return this.engine.openDocumentBuffer(n,{password:t.password,normalizeRotation:!0})}
2286handleLoadTask(e,t,n){t.wait(o=>{this.dispatchCoreAction(((i,r)=>({type:Dr,payload:{documentId:i,document:r}}))(e,o))},o=>{this.handleLoadError(e,o,n)})}handleLoadError(e,t,n){var o,i,r;const a=((o=t.reason)==null?void 0:o.message)||"Failed to load document";this.logger.error("DocumentManagerPlugin",n,"Failed to load document",t),this.dispatchCoreAction(((s,l,c,d)=>({type:Rs,payload:{documentId:s,error:l,errorCode:c,errorDetails:d}}))(e,a,(i=t.reason)==null?void 0:i.code,t.reason)),this.documentError$.emit({documentId:e,message:a,code:(r=t.reason)==null?void 0:r.code,reason:t.reason})}generateDocumentId(){return`doc-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}extractNameFromUrl(e){try{const t=new URL(e),n=t.pathname.split("/").pop();if(!n)return;let o=decodeURIComponent(n);return o.toLowerCase().endsWith(".pdf")||(o+=".pdf"),o}catch{return}}async initialize(e){var t;if(this.logger.info("DocumentManagerPlugin","Initialize","Document Manager Plugin initialized",{maxDocuments:this.maxDocuments,initialDocumentsCount:((t=e.initialDocuments)==null?void 0:t.length)??0}),e.initialDocuments&&e.initialDocuments.length>0)for(const n of e.initialDocuments)try{"buffer"in n?this.openDocumentBuffer(n):"url"in n&&this.openDocumentUrl(n)}catch(o){this.logger.error("DocumentManagerPlugin","Initialize","Failed to initiate initial document load",o)}}async destroy(){await this.closeAllDocuments().toPromise(),this.loadOptions.clear(),this.documentOpened$.clear(),this.documentClosed$.clear(),this.activeDocumentChanged$.clear(),this.documentOrderChanged$.clear(),this.documentError$.clear(),super.destroy()}};wm.id="document-manager";let hr=wm;const gc="document-manager";function Pb({documentId:e,children:t}){const n=pt(e);return n?k(de,{children:t({documentState:n,isLoading:n.status==="loading",isError:n.status==="error",isLoaded:n.status==="loaded"})}):null}const Lo=()=>We(hr.id),Mb=Bt({manifest:{id:gc,name:"Document Manager Plugin",version:"1.0.0",provides:["document-manager"],requires:[],optional:[],defaultConfig:{maxDocuments:10}},create:(e,t)=>new hr(gc,e,t),reducer:e=>e,initialState:{}}).addUtility(function(){const{plugin:e}=At(hr.id),{provides:t}=Lo(),n=K(null),o=K(null),i=K(void 0);return $(()=>{if(e?.onOpenFileRequest)return e.onOpenFileRequest(({task:r,options:a})=>{var s;o.current=r,i.current=a,(s=n.current)==null||s.click()})},[e]),k("input",{ref:n,type:"file",accept:"application/pdf",style:{display:"none"},onChange:async r=>{var a,s,l,c,d;const u=(a=r.currentTarget.files)==null?void 0:a[0];if(!u||!t)return;const m=await u.arrayBuffer();t.openDocumentBuffer({name:u.name,buffer:m,documentId:(s=i.current)==null?void 0:s.documentId,scale:(l=i.current)==null?void 0:l.scale,rotation:(c=i.current)==null?void 0:c.rotation,autoActivate:(d=i.current)==null?void 0:d.autoActivate}).wait(g=>{var p;(p=o.current)==null||p.resolve(g)},g=>{var p;(p=o.current)==null||p.fail(g)})}})}).build(),xm="commands",Db={id:xm,name:"Commands Plugin",version:"1.0.0",provides:["commands"],requires:[],optional:["i18n","ui"],defaultConfig:{commands:{}}},km="COMMANDS/SET_DISABLED_CATEGORIES",Li=e=>({type:km,payload:e}),Cm=class extends $e{constructor(e,t,n){var o;super(e,t),this.commands=new Map,this.i18n=null,this.shortcutMap=new Map,this.commandExecuted$=st(),this.commandStateChanged$=st(),this.shortcutExecuted$=st(),this.categoryChanged$=xe(),this.previousStates=new Map;const i=t.getPlugin("i18n");this.i18n=i?.provides()??null,(o=n.disabledCategories)!=null&&o.length&&this.dispatch(Li(n.disabledCategories)),Object.values(n.commands).forEach(r=>{this.registerCommand(r)}),this.registry.getStore().subscribe((r,a)=>{this.onGlobalStoreChange(a)})}onDocumentClosed(e){this.previousStates.delete(e),this.logger.debug("CommandsPlugin","DocumentClosed",`Cleaned up command state cache for document: ${e}`)}async initialize(){this.logger.info("CommandsPlugin","Initialize","Commands plugin initialized")}async destroy(){this.commandExecuted$.clear(),this.commandStateChanged$.clear(),this.shortcutExecuted$.clear(),this.categoryChanged$.clear(),this.commands.clear(),this.shortcutMap.clear(),this.previousStates.clear(),super.destroy()}disableCategoryImpl(e){const t=new Set(this.state.disabledCategories);t.has(e)||(t.add(e),this.dispatch(Li(Array.from(t))),this.categoryChanged$.emit({disabledCategories:Array.from(t)}))}enableCategoryImpl(e){const t=new Set(this.state.disabledCategories);t.has(e)&&(t.delete(e),this.dispatch(Li(Array.from(t))),this.categoryChanged$.emit({disabledCategories:Array.from(t)}))}toggleCategoryImpl(e){this.state.disabledCategories.includes(e)?this.enableCategoryImpl(e):this.disableCategoryImpl(e)}setDisabledCategoriesImpl(e){this.dispatch(Li(e)),this.categoryChanged$.emit({disabledCategories:e})}isCommandCategoryDisabled(e){var t;return!!((t=e.categories)!=null&&t.length)&&e.categories.some(n=>this.state.disabledCategories.includes(n))}buildCapability(){return{resolve:(e,t)=>
vendor: 4,770 bytes, line 2286
2286this.resolve(e,t),execute:(e,t,n="ui")=>this.execute(e,t,n),getAllCommands:e=>this.getAllCommands(e),getCommandsByCategory:(e,t)=>this.getCommandsByCategory(e,t),getCommandByShortcut:e=>this.getCommandByShortcut(e),getAllShortcuts:()=>new Map(this.shortcutMap),forDocument:e=>this.createCommandScope(e),registerCommand:e=>this.registerCommand(e),unregisterCommand:e=>this.unregisterCommand(e),disableCategory:e=>this.disableCategoryImpl(e),enableCategory:e=>this.enableCategoryImpl(e),toggleCategory:e=>this.toggleCategoryImpl(e),setDisabledCategories:e=>this.setDisabledCategoriesImpl(e),getDisabledCategories:()=>this.state.disabledCategories,isCategoryDisabled:e=>this.state.disabledCategories.includes(e),onCommandExecuted:this.commandExecuted$.on,onCommandStateChanged:this.commandStateChanged$.on,onShortcutExecuted:this.shortcutExecuted$.on,onCategoryChanged:this.categoryChanged$.on}}createCommandScope(e){return{resolve:t=>this.resolve(t,e),execute:(t,n="ui")=>this.execute(t,e,n),getAllCommands:()=>this.getAllCommands(e),getCommandsByCategory:t=>this.getCommandsByCategory(t,e),onCommandStateChanged:t=>this.commandStateChanged$.on(n=>{if(n.documentId===e){const{documentId:o,...i}=n;t(i)}})}}resolve(e,t){const n=t??this.getActiveDocumentId(),o=this.commands.get(e);if(!o)throw new Error(`Command not found: ${e}`);const i=this.registry.getStore().getState(),r=this.resolveLabel(o,i,n),a=o.shortcuts?Array.isArray(o.shortcuts)?o.shortcuts:[o.shortcuts]:void 0,s=this.resolveDynamic(o.disabled,i,n)??!1,l=this.isCommandCategoryDisabled(o),c=s||l;return{id:o.id,label:r,icon:this.resolveDynamic(o.icon,i,n),iconProps:this.resolveDynamic(o.iconProps,i,n),active:this.resolveDynamic(o.active,i,n)??!1,disabled:c,visible:this.resolveDynamic(o.visible,i,n)??!0,shortcuts:a,shortcutLabel:o.shortcutLabel,categories:o.categories,description:o.description,execute:()=>o.action({registry:this.registry,state:i,documentId:n,logger:this.logger})}}resolveLabel(e,t,n){const o=this.resolveDynamic(e.labelKey,t,n);if(o&&this.i18n){const i=this.resolveDynamic(e.labelParams,t,n);return this.i18n.t(o,{params:i,documentId:n})}return e.label?e.label:e.id}resolveDynamic(e,t,n){if(e!==void 0)return typeof e=="function"?e({registry:this.registry,state:t,documentId:n,logger:this.logger}):e}execute(e,t,n="ui"){const o=t??this.getActiveDocumentId(),i=this.resolve(e,o);i.disabled?this.logger.warn("CommandsPlugin","ExecutionBlocked",`Command '${e}' is disabled for document '${o}'`):i.visible?(i.execute(),this.commandExecuted$.emit({commandId:e,documentId:o,source:n}),this.logger.debug("CommandsPlugin","CommandExecuted",`Command '${e}' executed for document '${o}' (source: ${n})`)):this.logger.warn("CommandsPlugin","ExecutionBlocked",`Command '${e}' is not visible for document '${o}'`)}registerCommand(e){this.commands.has(e.id)&&this.logger.warn("CommandsPlugin","CommandOverwrite",`Command '${e.id}' already exists and will be overwritten`),this.commands.set(e.id,e),e.shortcuts&&(Array.isArray(e.shortcuts)?e.shortcuts:[e.shortcuts]).forEach(t=>{const n=this.normalizeShortcut(t);this.shortcutMap.set(n,e.id)}),this.logger.debug("CommandsPlugin","CommandRegistered",`Command '${e.id}' registered`)}unregisterCommand(e){const t=this.commands.get(e);t&&(t.shortcuts&&(Array.isArray(t.shortcuts)?t.shortcuts:[t.shortcuts]).forEach(n=>{const o=this.normalizeShortcut(n);this.shortcutMap.delete(o)}),this.commands.delete(e),this.logger.debug("CommandsPlugin","CommandUnregistered",`Command '${e}' unregistered`))}getCommandByShortcut(e){const t=this.normalizeShortcut(e),n=this.shortcutMap.get(t);return n?this.commands.get(n)??null:null}normalizeShortcut(e){return e.toLowerCase().split("+").sort().join("+")}getAllCommands(e){const t=e??this.getActiveDocumentId();return Array.from(this.commands.keys()).map(n=>this.resolve(n,t))}getCommandsByCategory(e,t){const n=t??this.getActiveDocumentId();return Array.from(this.commands.values()).filter(o=>{var i;return(i=o.categories)==null?void 0:i.includes(e)}).map(o=>this.resolve(o.id,n))}onGlobalStoreChange(e){Object.keys(e.core.documents).forEach(t=>{this.detectCommandChanges(t,e)})}detectCommandChanges(e,t){const n=t.core.documents[e];if(!n||n.status!=="loaded")return;const o=this.previousStates.get(e)??new Map;this.commands.forEach((i,r)=>{const a=this.resolve(r,e),s=o.get(r);if(!s)return void o.set(r,a);const l={};s.active!==a.active&&(l.active=a.active),s.disabled!==a.disabled&&(l.disabled=a.disabled),s.visible!==a.visible&&(l.visible=a.visible),s.label!==a.label&&(l.label=a.label),s.icon!==a.icon&&(l.icon=a.icon),to(s.iconProps,a.iconProps)||(l.iconProps=a.iconProps),Object.keys(l).length>0&&(o.set(r,a),this.commandStateChanged$.emit({commandId:r,documentId:e,changes:l}))}),this.previousStates.set(e,o)}};
2286Cm.id="commands";let Us=Cm;const fc={disabledCategories:[]},Im=()=>We(Us.id),Gt=(e,t)=>{const{provides:n}=Im(),[o,i]=O(()=>n?n.resolve(e,t):null);return $(()=>n?(i(n.resolve(e,t)),n.onCommandStateChanged(r=>{r.commandId===e&&r.documentId===t&&i(n.resolve(e,t))})):void i(null),[n,e,t]),o},Tb=Bt({manifest:Db,create:(e,t)=>new Us(xm,e,t),reducer:(e=fc,t)=>t.type===km?{...e,disabledCategories:t.payload}:e,initialState:fc}).addUtility(function(){const{provides:e}=Im();return $(()=>{if(!e)return;const t=(function(n){return o=>{const i=o.composedPath()[0]||o.target;if((i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)&&o.key!=="Tab")return;const r=(function(l){const c=[];l.ctrlKey&&c.push("ctrl"),l.shiftKey&&c.push("shift"),l.altKey&&c.push("alt"),l.metaKey&&c.push("meta");let d=l.key.toLowerCase();return d===" "&&(d="space"),["control","shift","alt","meta"].includes(d)?null:[...c,d].sort().join("+")})(o);if(!r)return;const a=n.getCommandByShortcut(r);if(!a)return;const s=n.resolve(a.id);!s.disabled&&s.visible&&(o.preventDefault(),o.stopPropagation(),n.execute(a.id,void 0,"keyboard"))}})(e);return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),null}).build(),Sm="i18n",Rb={id:Sm,name:"I18n Plugin",version:"1.0.0",provides:["i18n"],requires:[],optional:[],defaultConfig:{defaultLocale:"en",locales:[{code:"en",name:"English",translations:{commands:{zoom:{in:"Zoom In",out:"Zoom Out",fitWidth:"Fit to Width",fitPage:"Fit to Page",automatic:"Automatic",level:"Zoom Level ({level}%)",inArea:"Zoom In Area"},fullscreen:{enter:"Enter Full Screen",exit:"Exit Full Screen"},rotate:{clockwise:"Rotate Clockwise",counterclockwise:"Rotate Counter-Clockwise"},menu:"Menu",sidebar:"Sidebar",search:"Search",comment:"Comment",download:"Download",print:"Print",openFile:"Open PDF",save:"Save",settings:"Settings",view:"View",annotate:"Annotate",shapes:"Shapes",redact:"Redact",fillAndSign:"Fill and Sign",form:"Form",pan:"Pan",pointer:"Pointer",undo:"Undo",redo:"Redo",copy:"Copy",screenshot:"Screenshot",nextPage:"Next Page",previousPage:"Previous Page"}}},{code:"es",name:"Español",translations:{commands:{zoom:{in:"Acercar",out:"Alejar",fitWidth:"Ajustar al ancho",fitPage:"Ajustar a la página",automatic:"Automático",level:"Nivel de zoom ({level}%)",inArea:"Acercar área"},fullscreen:{enter:"Pantalla completa",exit:"Salir de pantalla completa"},rotate:{clockwise:"Girar a la derecha",counterclockwise:"Girar a la izquierda"},menu:"Menú",sidebar:"Barra lateral",search:"Buscar",comment:"Comentario",download:"Descargar",print:"Imprimir",openFile:"Abrir PDF",save:"Guardar",settings:"Configuración",view:"Ver",annotate:"Anotar",shapes:"Formas",redact:"Redactar",fillAndSign:"Rellenar y firmar",form:"Formulario",pan:"Desplazar",pointer:"Puntero",undo:"Deshacer",redo:"Rehacer",copy:"Copiar",screenshot:"Captura de pantalla",nextPage:"Página siguiente",previousPage:"Página anterior"}}}]}},Am="I18N/SET_LOCALE",Pm="I18N/REGISTER_LOCALE",vc=e=>({type:Am,payload:e}),yc=e=>({type:Pm,payload:e}),Mm=class extends $e{constructor(e,t,n){super(e,t),this.locales=new Map,this.paramResolvers=new Map,this.paramsCache=new Map,this.localeChange$=st(),this.paramsChanged$=Ue((o,i)=>({documentId:o,...i}),{cache:!1}),this.config=n,n.locales.forEach(o=>{this.locales.set(o.code,o),this.dispatch(yc(o.code))}),n.paramResolvers&&Object.entries(n.paramResolvers).forEach(([o,i])=>{this.paramResolvers.set(o,i)}),this.dispatch(vc(n.defaultLocale)),this.registry.getStore().subscribe((o,i)=>{this.detectParamChanges(i)})}async initialize(){this.logger.info("I18nPlugin","Initialize","I18n plugin initialized")}async destroy(){this.localeChange$.clear(),this.paramsChanged$.clear(),this.paramResolvers.clear(),this.paramsCache.clear(),super.destroy()}onDocumentClosed(e){this.paramsCache.delete(e),this.paramsChanged$.clearScope(e),this.logger.debug("I18nPlugin","DocumentClosed",`Cleaned up params cache for document: ${e}`)}buildCapability(){return{t:(e,t)=>this.translate(e,t),forDocument:e=>this.createI18nScope(e),registerParamResolver:(e,t)=>this.registerParamResolver(e,t),unregisterParamResolver:e=>this.unregisterParamResolver(e),setLocale:e=>
vendor: 4,179 bytes, line 2286
2286this.setLocale(e),getLocale:()=>this.state.currentLocale,getAvailableLocales:()=>[...this.state.availableLocales],getLocaleInfo:e=>this.locales.get(e)??null,registerLocale:e=>this.registerLocale(e),hasLocale:e=>this.locales.has(e),onLocaleChange:this.localeChange$.on,onParamsChanged:this.paramsChanged$.onGlobal}}createI18nScope(e){return{t:(t,n)=>this.translate(t,{documentId:e,...n}),onParamsChanged:this.paramsChanged$.forScope(e)}}translate(e,t){const n=this.locales.get(this.state.currentLocale),o=this.config.fallbackLocale?this.locales.get(this.config.fallbackLocale):null;let i=this.getNestedValue(n?.translations,e);if(!i&&o&&(i=this.getNestedValue(o.translations,e)),!i){if(!t?.fallback)return this.logger.warn("I18nPlugin","MissingTranslation",`Translation not found for key: ${e}`),e;i=t.fallback}let r=t?.params;return!r&&this.paramResolvers.has(e)&&(r=this.resolveParams(e,t?.documentId)),this.interpolate(i,r)}resolveParams(e,t){const n=this.paramResolvers.get(e);if(!n)return;const o=this.registry.getStore().getState();try{return n({state:o,documentId:t})}catch(i){return void this.logger.error("I18nPlugin","ParamResolverError",`Error resolving params for key "${e}":`,i)}}getNestedValue(e,t){if(!e)return;const n=t.split(".");let o=e;for(const i of n){if(o==null)return;o=o[i]}return typeof o=="string"?o:void 0}interpolate(e,t){return t?e.replace(/\{(\w+)\}/g,(n,o)=>{const i=t[o];return i!==void 0?String(i):n}):e}detectParamChanges(e){Object.keys(e.core.documents).forEach(t=>{this.detectDocumentParamChanges(t,e)})}detectDocumentParamChanges(e,t){const n=this.paramsCache.get(e),o=[];this.paramResolvers.forEach((i,r)=>{try{const a=i({state:t,documentId:e});to(n?.get(r),a)||(o.push(r),this.paramsCache.has(e)||this.paramsCache.set(e,new Map),this.paramsCache.get(e).set(r,a))}catch(a){this.logger.error("I18nPlugin","ParamDetectionError",`Error detecting param changes for key "${r}":`,a)}}),o.length>0&&(this.paramsChanged$.emit(e,{changedKeys:o}),this.logger.debug("I18nPlugin","ParamsChanged",`Translation params changed for document ${e}:`,o))}registerParamResolver(e,t){this.paramResolvers.has(e)&&this.logger.warn("I18nPlugin","ResolverOverwrite",`Param resolver for "${e}" already exists and will be overwritten`),this.paramResolvers.set(e,t),this.paramsCache.forEach(n=>{n.delete(e)}),this.logger.debug("I18nPlugin","ResolverRegistered",`Param resolver registered for: ${e}`)}unregisterParamResolver(e){this.paramResolvers.delete(e)&&(this.paramsCache.forEach(t=>{t.delete(e)}),this.logger.debug("I18nPlugin","ResolverUnregistered",`Param resolver unregistered for: ${e}`))}setLocale(e){if(!this.locales.has(e))return void this.logger.warn("I18nPlugin","LocaleNotFound",`Locale '${e}' is not registered`);const t=this.state.currentLocale;t!==e&&(this.dispatch(vc(e)),this.localeChange$.emit({previousLocale:t,currentLocale:e}),this.logger.info("I18nPlugin","LocaleChanged",`Locale changed to: ${e}`))}registerLocale(e){this.locales.has(e.code)?this.logger.warn("I18nPlugin","LocaleAlreadyRegistered",`Locale '${e.code}' is already registered`):(this.locales.set(e.code,e),this.dispatch(yc(e.code)),this.logger.info("I18nPlugin","LocaleRegistered",`Locale registered: ${e.code}`))}};Mm.id="i18n";let Bs=Mm;const bc={currentLocale:"en",availableLocales:[]},Eb={manifest:Rb,create:(e,t)=>new Bs(Sm,e,t),reducer:(e=bc,t)=>{switch(t.type){case Am:{const n=t.payload;return e.availableLocales.includes(n)?{...e,currentLocale:n}:(console.warn(`I18nPlugin: Locale '${n}' not available`),e)}case Pm:{const n=t.payload;return e.availableLocales.includes(n)?e:{...e,availableLocales:[...e.availableLocales,n]}}default:return e}},initialState:bc},Le=e=>{const{provides:t}=We(Bs.id),[,n]=Hu(i=>i+1,0),o=W((i,r)=>t?t.t(i,{documentId:e,params:r?.params,fallback:r?.fallback}):r?.fallback??i,[t,e]);return $(()=>{if(!t)return;const i=t.onLocaleChange(()=>{n()}),r=e?t.forDocument(e).onParamsChanged(()=>{n()}):t.onParamsChanged(()=>{n()});return()=>{i(),r()}},[t,e]),{translate:o,locale:t?.getLocale()??"en"}};var dt=(e=>(e.Automatic="automatic",e.FitPage="fit-page",e.FitWidth="fit-width",e))(dt||{}),Hn=(e=>(e[e.Center=0]="Center",e[e.Top=1]="Top",e))(Hn||{});
2286const Ws="zoom",zb={id:Ws,name:"Zoom Plugin",version:"1.0.0",provides:["zoom"],requires:["viewport","scroll"],optional:["interaction-manager","spread"],defaultConfig:{defaultZoomLevel:dt.Automatic,minZoom:.2,maxZoom:60,zoomStep:.1,zoomRanges:[{min:.2,max:.5,step:.05},{min:.5,max:1,step:.1},{min:1,max:2,step:.2},{min:2,max:4,step:.4},{min:4,max:10,step:.8},{min:10,max:20,step:1.6},{min:20,max:40,step:3.2},{min:40,max:60,step:6.4}],presets:[{name:"Fit Page",value:dt.FitPage},{name:"Fit Width",value:dt.FitWidth},{name:"Automatic",value:dt.Automatic},{name:"25%",value:.25},{name:"50%",value:.5},{name:"100%",value:1},{name:"125%",value:1.25},{name:"150%",value:1.5},{name:"200%",value:2},{name:"400%",value:4},{name:"800%",value:8},{name:"1600%",value:16}]}},Dm="ZOOM/INIT_STATE",Tm="ZOOM/CLEANUP_STATE",Rm="ZOOM/SET_ZOOM_LEVEL",Em="ZOOM/SET_MARQUEE_ZOOM_ACTIVE",zm={zoomLevel:dt.Automatic,currentZoomLevel:1,isMarqueeZoomActive:!1},wc={documents:{},activeDocumentId:null},Lm=class extends $e{constructor(e,t,n){var o,i,r;super(e,t),this.zoom$=st(),this.state$=xe(),this.viewportPlugin=t.getPlugin("viewport"),this.viewport=this.viewportPlugin.provides(),this.scroll=t.getPlugin("scroll").provides();const a=t.getPlugin("interaction-manager");this.interactionManager=a?.provides()??null;const s=t.getPlugin("spread");this.spread=s?.provides()??null,this.minZoom=n.minZoom??.25,this.maxZoom=n.maxZoom??10,this.zoomStep=n.zoomStep??.1,this.defaultZoomLevel=n.defaultZoomLevel,this.presets=n.presets??[],this.zoomRanges=this.normalizeRanges(n.zoomRanges??[]),this.viewport.onViewportResize(l=>this.recalcAuto(l.documentId,Hn.Top),{mode:"debounce",wait:150,keyExtractor:l=>l.documentId}),(o=this.spread)==null||o.onSpreadChange(l=>{this.recalcAuto(l.documentId,Hn.Top)}),(i=this.interactionManager)==null||i.registerMode({id:"marqueeZoom",scope:"page",exclusive:!0,cursor:"zoom-in"}),(r=this.interactionManager)==null||r.onModeChange(l=>{const c=l.activeMode==="marqueeZoom",d=this.getDocumentState(l.documentId);var u;d&&d.isMarqueeZoomActive!==c&&this.dispatch((u=l.documentId,{type:Em,payload:{documentId:u,isActive:c}}))})}onDocumentLoadingStarted(e){this.viewport.gate("zoom",e);const t={...zm,zoomLevel:this.defaultZoomLevel};this.dispatch((function(n,o){return{type:Dm,payload:{documentId:n,state:o}}})(e,t)),this.logger.debug("ZoomPlugin","DocumentOpened",`Initialized zoom state for document: ${e}`)}onDocumentLoaded(e){this.recalcAuto(e,Hn.Top)}onDocumentClosed(e){this.dispatch((function(t){return{type:Tm,payload:t}})(e)),this.logger.debug("ZoomPlugin","DocumentClosed",`Cleaned up zoom state for document: ${e}`)}onRotationChanged(e){this.recalcAuto(e,Hn.Top)}buildCapability(){return{requestZoom:(e,t)=>this.requestZoom(e,t),requestZoomBy:(e,t)=>this.requestZoomBy(e,t),zoomIn:()=>this.zoomIn(),zoomOut:()=>this.zoomOut(),zoomToArea:(e,t)=>this.zoomToArea(e,t),enableMarqueeZoom:()=>this.enableMarqueeZoom(),disableMarqueeZoom:()=>this.disableMarqueeZoom(),toggleMarqueeZoom:()=>this.toggleMarqueeZoom(),isMarqueeZoomActive:()=>this.isMarqueeZoomActive(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createZoomScope(e),registerMarqueeOnPage:e=>this.registerMarqueeOnPage(e),getPresets:()=>this.presets,onZoomChange:this.zoom$.on,onStateChange:this.state$.on}}createZoomScope(e){return{requestZoom:(t,n)=>this.requestZoom(t,n,e),requestZoomBy:(t,n)=>this.requestZoomBy(t,n,e),zoomIn:()=>this.zoomIn(e),zoomOut:()=>this.zoomOut(e),zoomToArea:(t,n)=>this.zoomToArea(t,n,e),enableMarqueeZoom:()=>this.enableMarqueeZoom(e),disableMarqueeZoom:()=>this.disableMarqueeZoom(e),toggleMarqueeZoom:()=>this.toggleMarqueeZoom(e),isMarqueeZoomActive:()=>this.isMarqueeZoomActive(e),getState:()=>this.getDocumentStateOrThrow(e),onZoomChange:t=>this.zoom$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Zoom state not found for document: ${e??"active"}`);return t}requestZoom(e,t,n){this.handleRequest({level:e,center:t},n)}requestZoomBy(e,t,n){const o=n??this.getActiveDocumentId(),i=this.getDocumentStateOrThrow(o).currentZoomLevel,r=this.toZoom(i+e);this.handleRequest({level:r,center:t},o)}zoomIn(e){const t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).currentZoomLevel;this.handleRequest({level:n,delta:this.stepFor(n)},t)}zoomOut(e){const t=e??this.getActiveDocumentId(),n=this.getDocumentStateOrThrow(t).currentZoomLevel;this.handleRequest({level:n,delta:-this.stepFor(n)},t)}zoomToArea(e,t,n){const o=n??this.getActiveDocumentId();this.handleZoomToArea(o,e,t)}enableMarqueeZoom(e){var t;const n=e??this.getActiveDocumentId();(t=this.interactionManager)==null||t.forDocument(n).activate("marqueeZoom")}disableMarqueeZoom(e){var t;const n=e??this.getActiveDocumentId();(t=this.interactionManager)==null||t.forDocument(n).activateDefaultMode()}toggleMarqueeZoom(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManager)==null?void 0:t.forDocument(n);o?.getActiveMode()==="marqueeZoom"?o.activateDefaultMode():o?.activate("marqueeZoom")}isMarqueeZoomActive(e){var t;const n=e??this.getActiveDocumentId();return((t=this.interactionManager)==null?void 0:t.forDocument(n).getActiveMode())==="marqueeZoom"}handleRequest({level:e,delta:t=0,center:n,focus:o=Hn.Center,align:i="keep"},r){const a=r??this.getActiveDocumentId(),s=this.getDocumentStateOrThrow(a);if(!this.coreState.core.documents[a])return;const l=this.viewport.forDocument(a),c=l.getMetrics(),d=s.currentZoomLevel;if(c.clientWidth===0||c.clientHeight===0)return;const u=typeof e=="number"?e:this.computeZoomForMode(a,e,c);if(u===!1)return;const m=ue(u+t,this.minZoom,this.maxZoom),g=Math.floor(1e3*m)/1e3,p=n??{vx:c.clientWidth/2,vy:o===Hn.Top?0:c.clientHeight/2},{desiredScrollLeft:f,desiredScrollTop:v}=this.computeScrollForZoomChange(a,c,d,g,p,i);isNaN(f)||isNaN(v)||this.viewportPlugin.setViewportScrollMetrics(a,{scrollLeft:f,scrollTop:v}),this.dispatch((function(b,w,x){return{type:Rm,payload:{documentId:b,zoomLevel:w,currentZoomLevel:x}}})(a,typeof e=="number"?g:e,g)),this.dispatchCoreAction(((b,w)=>({type:Rr,payload:{scale:b,documentId:w}}))(g,a)),this.viewport.isGated(a)&&this.viewport.releaseGate("zoom",a),l.scrollTo({x:f,y:v,behavior:"instant"});const y={documentId:a,oldZoom:d,newZoom:g,level:e,center:p,desiredScrollLeft:f,desiredScrollTop:v,viewport:c};this.zoom$.emit(y)}computeZoomForMode(e,t,n){if(!this.coreState.core.documents[e])return!1;const o=this.scroll.forDocument(e),i=o?this.scroll.getPageGap():0,r=this.viewport.getViewportGap(),a=o.getSpreadPagesWithRotatedSize();if(!a.length||n.clientWidth===0||n.clientHeight===0)return!1;const s=n.clientWidth-2*r,l=n.clientHeight-2*r;if(s<=0||l<=0)return!1;let c=0,d=0;
vendor: 15,506 bytes, line 2286
2286switch(a.forEach(u=>{const m=u.reduce((p,f,v)=>p+f.rotatedSize.width+(v?i:0),0),g=Math.max(...u.map(p=>p.rotatedSize.height));c=Math.max(c,m),d=Math.max(d,g)}),t){case dt.FitWidth:return s/c;case dt.FitPage:return Math.min(s/c,l/d);case dt.Automatic:return Math.min(s/c,1);default:return 1}}computeScrollForZoomChange(e,t,n,o,i,r="keep"){const a=this.scroll.forDocument(e).getLayout(),s=this.viewport.getViewportGap(),l=a.totalContentSize.width,c=a.totalContentSize.height,d=t.clientWidth-2*s,u=t.clientHeight-2*s,m=(C,I,S)=>I*S<C?(C-I*S)/2:0,g=m(d,l,n),p=m(u,c,n),f=m(d,l,o),v=m(u,c,o),y=(t.scrollLeft+i.vx-s-g)/n*o+s+f,b=(t.scrollTop+i.vy-s-p)/n*o+s+v,w=r==="center"?y-t.clientWidth/2:y-i.vx,x=r==="center"?b-t.clientHeight/2:b-i.vy;return{desiredScrollLeft:Math.max(0,w),desiredScrollTop:Math.max(0,x)}}handleZoomToArea(e,t,n){const o=this.coreState.core.documents[e];if(!o)return;const i=o.rotation,r=this.viewport.forDocument(e).getMetrics(),a=this.viewport.getViewportGap(),s=this.getDocumentStateOrThrow(e).currentZoomLevel,l=r.clientWidth-2*a,c=r.clientHeight-2*a,d=this.scroll.forDocument(e).getLayout(),u=d.virtualItems.find(P=>P.pageLayouts.some(A=>A.pageIndex===t));if(!u)return;const m=u.pageLayouts.find(P=>P.pageIndex===t),g=Ps({width:m.width,height:m.height},n,i),p=this.toZoom(Math.min(l/g.size.width,c/g.size.height)),f=u.x+m.x,v=u.y+m.y,y=f+g.origin.x+g.size.width/2,b=v+g.origin.y+g.size.height/2,w=(P,A,D)=>A*D<P?(P-A*D)/2:0,x=w(l,d.totalContentSize.width,s),C=w(c,d.totalContentSize.height,s),I=a+x+y*s-r.scrollLeft,S=a+C+b*s-r.scrollTop;this.handleRequest({level:p,center:{vx:I,vy:S},align:"center"},e)}recalcAuto(e,t){const n=this.getDocumentState(e);n&&(n.zoomLevel!==dt.Automatic&&n.zoomLevel!==dt.FitPage&&n.zoomLevel!==dt.FitWidth||this.handleRequest({level:n.zoomLevel,focus:t},e))}normalizeRanges(e){return[...e].filter(t=>t.step>0&&t.max>t.min).sort((t,n)=>t.min-n.min)}stepFor(e){const t=this.zoomRanges.find(n=>e>=n.min&&e<n.max);return t?t.step:this.zoomStep}toZoom(e){return parseFloat(ue(e,this.minZoom,this.maxZoom).toFixed(2))}registerMarqueeOnPage(e){if(!this.interactionManager)return this.logger.warn("ZoomPlugin","MissingDependency","Interaction manager plugin not loaded, marquee zoom disabled"),()=>{};const t=this.coreState.core.documents[e.documentId];if(!t||!t.document)return this.logger.warn("ZoomPlugin","DocumentNotFound","Document not found"),()=>{};const n=t.document.pages[e.pageIndex];if(!n)return this.logger.warn("ZoomPlugin","PageNotFound",`Page ${e.pageIndex} not found`),()=>{};const o=(function(i){const{pageSize:r,scale:a,minDragPx:s=5,onPreview:l,onCommit:c,onSmallDrag:d}=i;let u=null,m=null;return{onPointerDown:(g,p)=>{var f;u=g,m={origin:{x:g.x,y:g.y},size:{width:0,height:0}},l?.(m),(f=p.setPointerCapture)==null||f.call(p)},onPointerMove:g=>{if(!u)return;const p=ue(g.x,0,r.width),f=ue(g.y,0,r.height);m={origin:{x:Math.min(u.x,p),y:Math.min(u.y,f)},size:{width:Math.abs(p-u.x),height:Math.abs(f-u.y)}},l?.(m)},onPointerUp:(g,p)=>{var f;m&&(Math.max(m.size.width,m.size.height)*a>s?c?.(m):d?.()),u=null,m=null,l?.(null),(f=p.releasePointerCapture)==null||f.call(p)},onPointerCancel:(g,p)=>{var f;u=null,m=null,l?.(null),(f=p.releasePointerCapture)==null||f.call(p)}}})({pageSize:n.size,scale:e.scale,onPreview:e.callback.onPreview,onCommit:i=>{var r,a;this.zoomToArea(e.pageIndex,i,e.documentId),(a=(r=e.callback).onCommit)==null||a.call(r,i)},onSmallDrag:()=>{var i,r;this.zoomIn(e.documentId),(r=(i=e.callback).onSmallDrag)==null||r.call(i)}});return this.interactionManager.registerHandlers({documentId:e.documentId,modeId:"marqueeZoom",handlers:o,pageIndex:e.pageIndex})}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o&&i&&(o.currentZoomLevel!==i.currentZoomLevel||o.zoomLevel!==i.zoomLevel||o.isMarqueeZoomActive!==i.isMarqueeZoomActive)&&this.state$.emit({documentId:n,state:i})}}async initialize(){this.logger.info("ZoomPlugin","Initialize","Zoom plugin initialized")}async destroy(){this.zoom$.clear(),this.state$.clear(),super.destroy()}};Lm.id="zoom";let Hs=Lm;const Lb={manifest:zb,create:(e,t)=>new Hs(Ws,e,t),reducer:(e=wc,t)=>{switch(t.type){case Dm:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case Tm:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"ZOOM/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Rm:{const{documentId:n,zoomLevel:o,currentZoomLevel:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,zoomLevel:o,currentZoomLevel:i}}}:e}case Em:{const{documentId:n,isActive:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isMarqueeZoomActive:o}}}:e}default:return e}},initialState:wc},Gs=()=>We(Hs.id);function xc(e){const[t,n]=[e[0],e[1]],o=n.clientX-t.clientX,i=n.clientY-t.clientY;return Math.hypot(o,i)}function Nb(e,t={}){const{provides:n}=We("viewport"),{provides:o}=Gs(),i=an(Ih),r=K(null);return Ss(()=>{const a=r.current,s=i?.current;if(a&&s&&o)return(function({element:l,container:c,documentId:d,zoomProvides:u,viewportGap:m=0,options:g={}}){const{enablePinch:p=!0,enableWheel:f=!0}=g;if(typeof window>"u")return()=>{};const v=u.forDocument(d),y=()=>v.getState();let b=0,w=1,x=!1,C=0,I=null,S=1,P=0,A=0,D=0,R=0,M=0,N=0,z=0,_=0,L=0,j=0,E=0,F=0,X=0;const Q=(ae,Ie,be)=>Math.min(Math.max(ae,Ie),be),J=()=>{const ae=c.clientWidth-2*m,Ie=l.offsetWidth,be=Ie<ae?(ae-Ie)/2:0;l.style.marginLeft=`${be}px`},te=ae=>{const Ie=P*ae,be=A*ae;let Oe=L*(1-ae);const vt=_-Ie/2-D,Pt=j-X*ae-D,Wt=Math.max(0,Ie-z),ze=.3*z,Vt=Math.min(1,Wt/ze);let tt=vt+(Pt-vt)*Vt;return be>N-2*F&&(Oe=Q(R+Oe,N-F-be,F)-R),Ie>M-2*F&&(tt=Q(D+tt,M-F-Ie,F)-D),{tx:tt,ty:Oe,blend:Vt,finalWidth:Ie}},G=ae=>{w=ae;const{tx:Ie,ty:be}=te(ae);l.style.transformOrigin="0 0",l.style.transform=`translate(${Ie}px, ${be}px) scale(${ae})`},oe=()=>{l.style.transform="none",l.style.transformOrigin="0 0",w=1},le=()=>{const{tx:ae,finalWidth:Ie}=te(w),be=(w-1)*b;let Oe,vt=E;if(Ie<=z)Oe=_;else{const Pt=1-w;Oe=Math.abs(Pt)>.001?D+ae/Pt:j}v.requestZoomBy(be,{vx:Oe,vy:vt}),oe(),b=0},Te=(ae,Ie)=>{const be=c.getBoundingClientRect(),Oe=l.getBoundingClientRect();F=m,P=Oe.width,A=Oe.height,D=Oe.left-be.left,R=Oe.top-be.top,M=be.width,N=be.height,z=c.clientWidth,_=c.clientLeft+z/2;const vt=ae-Oe.left;L=Ie-Oe.top,j=ae-be.left,E=Ie-be.top,X=P<z?j*P/z:vt},De=ae=>{if(ae.touches.length!==2)return;x=!0,b=y().currentZoomLevel,C=xc(ae.touches);const Ie=(function(be){const[Oe,vt]=[be[0],be[1]];return{x:(Oe.clientX+vt.clientX)/2,y:(Oe.clientY+vt.clientY)/2}})(ae.touches);Te(Ie.x,Ie.y),ae.preventDefault()},Ne=ae=>{if(!x||ae.touches.length!==2)return;const Ie=xc(ae.touches);G(Ie/C),ae.preventDefault()},V=ae=>{x&&(ae.touches.length>=2||(x=!1,le()))},Se=ae=>{if(!ae.ctrlKey&&!ae.metaKey)return;ae.preventDefault(),I===null?(b=y().currentZoomLevel,S=1,Te(ae.clientX,ae.clientY)):clearTimeout(I);const Ie=1-.01*ae.deltaY;S*=Ie,S=Math.max(.1,Math.min(10,S)),G(S),I=setTimeout(()=>{I=null,le(),S=1},150)},He=v.onStateChange(()=>J()),Re=new ResizeObserver(()=>J());return Re.observe(l),Re.observe(c),J(),p&&(c.addEventListener("touchstart",De,{passive:!1}),c.addEventListener("touchmove",Ne,{passive:!1}),c.addEventListener("touchend",V),c.addEventListener("touchcancel",V)),f&&c.addEventListener("wheel",Se,{passive:!1}),()=>{p&&(c.removeEventListener("touchstart",De),c.removeEventListener("touchmove",Ne),c.removeEventListener("touchend",V),c.removeEventListener("touchcancel",V)),f&&c.removeEventListener("wheel",Se),I&&clearTimeout(I),He(),Re.disconnect(),oe(),l.style.marginLeft=""}})({element:a,container:s,documentId:e,zoomProvides:o,viewportGap:n?.getViewportGap()||0,options:t})},[n,o,e,i,t.enablePinch,t.enableWheel]),{elementRef:r}}function Ob({children:e,documentId:t,style:n,enablePinch:o=!0,enableWheel:i=!0,...r}){const a=Z(()=>({enablePinch:o,enableWheel:i}),[o,i]),{elementRef:s}=Nb(t,a);return k("div",{ref:s,...r,style:{...n,display:"inline-block",overflow:"visible",boxSizing:"border-box"},children:e})}const Fb=({documentId:e,pageIndex:t,scale:n,className:o,stroke:i="rgba(33,150,243,0.8)",fill:r="rgba(33,150,243,0.15)"})=>{const{provides:a}=Gs(),s=pt(e),[l,c]=O(null),d=Z(()=>n!==void 0?n:s?.scale??1,[n,s?.scale]);return $(()=>{if(a)return a.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:d,callback:{onPreview:c}})},[a,e,t,d]),l?k("div",{style:{position:"absolute",pointerEvents:"none",left:l.origin.x*d,top:l.origin.y*d,width:l.size.width*d,height:l.size.height*d,border:`1px solid ${i}`,background:r,boxSizing:"border-box"},className:o}):null},Nm=class extends $e{constructor(e,t,n){super(e,t),this.config=n}buildCapability(){return{renderPage:e=>this.renderPage(e),renderPageRect:e=>this.renderPageRect(e),renderPageRaw:e=>this.renderPageRaw(e),renderPageRectRaw:e=>this.renderPageRectRaw(e),forDocument:e=>this.createRenderScope(e)}}createRenderScope(e){return{renderPage:t=>this.renderPage(t,e),renderPageRect:t=>this.renderPageRect(t,e),renderPageRaw:t=>this.renderPageRaw(t,e),renderPageRectRaw:t=>this.renderPageRectRaw(t,e)}}renderPage({pageIndex:e,options:t},n){const o=n??this.getActiveDocumentId(),i=this.coreState.core.documents[o];if(!i?.document)throw new Error(`Document ${o} not loaded`);const r=i.document.pages.find(s=>s.index===e);if(!r)throw new Error(`Page ${e} not found in document ${o}`);const a={...t??{},withForms:t?.withForms??this.config.withForms??!1,withAnnotations:t?.withAnnotations??this.config.withAnnotations??!1,imageType:t?.imageType??this.config.defaultImageType??"image/png",imageQuality:t?.imageQuality??this.config.defaultImageQuality??.92};return this.engine.renderPage(i.document,r,a)}renderPageRect({pageIndex:e,rect:t,options:n},o){const i=o??this.getActiveDocumentId(),r=this.coreState.core.documents[i];if(!r?.document)throw new Error(`Document ${i} not loaded`);const a=r.document.pages.find(l=>l.index===e);if(!a)throw new Error(`Page ${e} not found in document ${i}`);const s={...n??{},withForms:n?.withForms??this.config.withForms??!1,withAnnotations:n?.withAnnotations??this.config.withAnnotations??!1,imageType:n?.imageType??this.config.defaultImageType??"image/png",imageQuality:n?.imageQuality??this.config.defaultImageQuality??.92};return this.engine.renderPageRect(r.document,a,t,s)}renderPageRaw({pageIndex:e,options:t},n){const o=n??this.getActiveDocumentId(),i=this.coreState.core.documents[o];if(!i?.document)throw new Error(`Document ${o} not loaded`);const r=i.document.pages.find(s=>s.index===e);if(!r)throw new Error(`Page ${e} not found in document ${o}`);const a={...t??{},withForms:t?.withForms??this.config.withForms??!1,withAnnotations:t?.withAnnotations??this.config.withAnnotations??!1};return this.engine.renderPageRaw(i.document,r,a)}renderPageRectRaw({pageIndex:e,rect:t,options:n},o){const i=o??this.getActiveDocumentId(),r=this.coreState.core.documents[i];if(!r?.document)throw new Error(`Document ${i} not loaded`);const a=r.document.pages.find(l=>l.index===e);if(!a)throw new Error(`Page ${e} not found in document ${i}`);const s={...n??{},withForms:n?.withForms??this.config.withForms??!1,withAnnotations:n?.withAnnotations??this.config.withAnnotations??!1};return this.engine.renderPageRectRaw(r.document,a,t,s)}async initialize(e){this.logger.info("RenderPlugin","Initialize","Render plugin initialized")}async destroy(){super.destroy()}};Nm.id="render";let qs=Nm;const kc="render",_b={manifest:{id:kc,name:"Render Plugin",version:"1.0.0",provides:["render"],requires:[],optional:[],defaultConfig:{}},create:(e,t)=>new qs(kc,e,t),reducer:()=>{},initialState:{}};function $b({documentId:e,pageIndex:t,scale:n,dpr:o,style:i,...r}){const{provides:a}=We(qs.id),s=pt(e),[l,c]=O(null),d=K(null),u=Z(()=>s&&s.pageRefreshVersions[t]||0,[s,t]),m=Z(()=>n!==void 0?n:s?.scale??1,[n,s?.scale]),g=Z(()=>o!==void 0?o:window.devicePixelRatio,[o]);return $(()=>{if(!a)return;const p=a.forDocument(e).renderPage({pageIndex:t,options:{scaleFactor:m,dpr:g}});return p.wait(f=>{const v=URL.createObjectURL(f);c(v),d.current=v},et),()=>{d.current?(URL.revokeObjectURL(d.current),d.current=null):p.abort({code:H.Cancelled,message:"canceled render task"})}},[e,t,m,g,a,u]),k(de,{children:l&&k("img",{src:l,onLoad:()=>{d.current&&(URL.revokeObjectURL(d.current),d.current=null)},...r,style:{width:"100%",height:"100%",...i||{}}})})}const Om="rotate",jb={id:Om,name:"Rotate Plugin",version:"1.0.0",provides:["rotate"],requires:[],optional:[],defaultConfig:{}},Fm="ROTATE/INIT_STATE",_m="ROTATE/CLEANUP_STATE",$m="ROTATE/SET_ROTATION",jm=class extends $e{constructor(e,t,n){super(e,t),this.rotate$=xe(),this.defaultRotation=n.defaultRotation??0}onDocumentLoadingStarted(e){const t={rotation:this.defaultRotation};this.dispatch((function(n,o){return{type:Fm,payload:{documentId:n,state:o}}})(e,t)),this.dispatchCoreAction(Jl(this.defaultRotation,e)),this.logger.debug("RotatePlugin","DocumentOpened",`Initialized rotation state for document: ${e}`)}onDocumentClosed(e){this.dispatch((function(t){return{type:_m,payload:t}})(e)),this.logger.debug("RotatePlugin","DocumentClosed",`Cleaned up rotation state for document: ${e}`)}buildCapability(){return{setRotation:e=>this.setRotationForDocument(e),getRotation:()=>this.getRotationForDocument(),rotateForward:()=>this.rotateForward(),rotateBackward:()=>this.rotateBackward(),forDocument:e=>this.createRotateScope(e),onRotateChange:this.rotate$.on}}createRotateScope(e){return{setRotation:t=>this.setRotationForDocument(t,e),getRotation:()=>this.getRotationForDocument(e),rotateForward:()=>this.rotateForward(e),rotateBackward:()=>this.rotateBackward(e),onRotateChange:t=>this.rotate$.on(n=>{n.documentId===e&&t(n.rotation)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Rotation state not found for document: ${e??"active"}`);return t}setRotationForDocument(e,t){const n=t??this.getActiveDocumentId(),o=this.coreState.core.documents[n];if(!o?.document)throw new Error(`Document ${n} not loaded`);this.dispatch((function(i,r){return{type:$m,payload:{documentId:i,rotation:r}}})(n,e)),this.dispatchCoreAction(Jl(e,n)),this.rotate$.emit({documentId:n,rotation:e})}getRotationForDocument(e){return this.getDocumentStateOrThrow(e).rotation}rotateForward(e){const t=e??this.getActiveDocumentId(),n=this.getRotationForDocument(t),o=(n+1)%4;this.setRotationForDocument(o,t)}rotateBackward(e){const t=e??this.getActiveDocumentId(),n=this.getRotationForDocument(t),o=(n+3)%4;this.setRotationForDocument(o,t)}getMatrixAsString(e){return(function(t,n,o){const[i,r,a,s,l,c]=(function(d,u,m){let g=1,p=0,f=0,v=1,y=0,b=0;switch(d){case 1:g=0,p=1,f=-1,v=0,y=m;break;case 2:g=-1,p=0,f=0,v=-1,y=u,b=m;break;case 3:g=0,p=-1,f=1,v=0,b=u}return[g,p,f,v,y,b]})(t,n,o);return`matrix(${i},${r},${a},${s},${l},${c})`})(e.rotation,e.width,e.height)}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o?.rotation!==i.rotation&&this.logger.debug("RotatePlugin","RotationChanged",`Rotation changed for document ${n}: ${o?.rotation??0} -> ${i.rotation}`)}}async initialize(e){this.logger.info("RotatePlugin","Initialize","Rotate plugin initialized")}async destroy(){this.rotate$.clear(),super.destroy()}};jm.id="rotate";let Ks=jm;const Cc={documents:{},activeDocumentId:null},Ub={manifest:jb,create:(e,t)=>
2286new Ks(Om,e,t),reducer:(e=Cc,t)=>{switch(t.type){case Fm:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case _m:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"ROTATE/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case $m:{const{documentId:n,rotation:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,rotation:o}}}:e}default:return e}},initialState:Cc};function Bb({children:e,documentId:t,pageIndex:n,rotation:o,scale:i,style:r,...a}){var s,l,c,d;const{plugin:u}=At(Ks.id),m=pt(t),g=(l=(s=m?.document)==null?void 0:s.pages)==null?void 0:l[n],p=((c=g?.size)==null?void 0:c.width)??0,f=((d=g?.size)==null?void 0:d.height)??0,v=g?.rotation??0,y=m?.rotation??0,b=o!==void 0?o:(v+y)%4,w=i??m?.scale??1,x=u?.getMatrixAsString({width:p*w,height:f*w,rotation:b})??"matrix(1, 0, 0, 1, 0, 0)";return g?k("div",{...a,style:{position:"absolute",transformOrigin:"0 0",transform:x,...r},children:e}):null}const Um="SEARCH/INIT_STATE",Bm="SEARCH/CLEANUP_STATE",Wm="SEARCH/START_SEARCH_SESSION",Hm="SEARCH/STOP_SEARCH_SESSION",Gm="SEARCH/SET_SEARCH_FLAGS",qm="SEARCH/SET_SHOW_ALL_RESULTS",Km="SEARCH/START_SEARCH",Vm="SEARCH/SET_SEARCH_RESULTS",Xm="SEARCH/APPEND_SEARCH_RESULTS",Zm="SEARCH/SET_ACTIVE_RESULT_INDEX";function Ic(e,t){return{type:qm,payload:{documentId:e,showAll:t}}}function la(e,t,n,o){return{type:Vm,payload:{documentId:e,results:t,total:n,activeResultIndex:o}}}function Sc(e,t){return{type:Zm,payload:{documentId:e,index:t}}}const mr={flags:[],results:[],total:0,activeResultIndex:-1,showAllResults:!0,query:"",loading:!1,active:!1},Ac={documents:{}},Pn=(e,t,n)=>{const o=e.documents[t]||mr;return{...e,documents:{...e.documents,[t]:{...o,...n}}}},Ym=class extends $e{constructor(e,t,n){super(e,t),this.searchStop$=xe(),this.searchStart$=xe(),this.searchResult$=xe(),this.searchActiveResultChange$=xe(),this.searchResultState$=xe(),this.searchState$=xe(),this.currentTask=new Map,this.pluginConfig=n}onDocumentLoadingStarted(e){const t={...mr,flags:this.pluginConfig.flags||[],showAllResults:this.pluginConfig.showAllResults??!0};this.dispatch((function(n,o){return{type:Um,payload:{documentId:n,state:o}}})(e,t))}onDocumentClosed(e){this.stopSearchSession(e),this.dispatch((function(t){return{type:Bm,payload:t}})(e)),this.currentTask.delete(e)}async initialize(){}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o!==i&&(this.searchState$.emit({documentId:n,state:i}),o&&o.results===i.results&&o.activeResultIndex===i.activeResultIndex&&o.showAllResults===i.showAllResults&&o.active===i.active||this.searchResultState$.emit({documentId:n,state:{results:i.results,activeResultIndex:i.activeResultIndex,showAllResults:i.showAllResults,active:i.active}}))}}buildCapability(){const e=n=>n??this.getActiveDocumentId(),t=n=>{const o=e(n),i=this.state.documents[o];if(!i)throw new Error(`Search state not found for document ${o}`);return i};return{startSearch:n=>this.startSearchSession(e(n)),stopSearch:n=>this.stopSearchSession(e(n)),searchAllPages:(n,o)=>this.searchAllPages(n,e(o)),nextResult:n=>this.nextResult(e(n)),previousResult:n=>this.previousResult(e(n)),goToResult:(n,o)=>this.goToResult(n,e(o)),setShowAllResults:(n,o)=>this.dispatch(Ic(e(o),n)),getShowAllResults:n=>t(n).showAllResults,getFlags:n=>t(n).flags,setFlags:(n,o)=>this.setFlags(n,e(o)),getState:n=>t(n),forDocument:this.createSearchScope.bind(this),onSearchResult:this.searchResult$.on,onSearchStart:this.searchStart$.on,onSearchStop:this.searchStop$.on,onActiveResultChange:this.searchActiveResultChange$.on,onSearchResultStateChange:this.searchResultState$.on,onStateChange:this.searchState$.on}}createSearchScope(e){const t=()=>{const n=this.state.documents[e];if(!n)throw new Error(`Search state not found for document ${e}`);return n};return{startSearch:()=>this.startSearchSession(e),stopSearch:()=>this.stopSearchSession(e),searchAllPages:n=>this.searchAllPages(n,e),nextResult:()=>this.nextResult(e),previousResult:()=>this.previousResult(e),goToResult:n=>this.goToResult(n,e),setShowAllResults:n=>this.dispatch(Ic(e,n)),getShowAllResults:()=>t().showAllResults,getFlags:()=>t().flags,setFlags:n=>this.setFlags(n,e),getState:t,onSearchResult:n=>this.searchResult$.on(o=>{o.documentId===e&&n(o.results)}),onSearchStart:n=>this.searchStart$.on(o=>{o.documentId===e&&n()}),onSearchStop:n=>this.searchStop$.on(o=>{o.documentId===e&&n()}),onActiveResultChange:n=>this.searchActiveResultChange$.on(o=>{o.documentId===e&&n(o.index)}),onSearchResultStateChange:n=>this.searchResultState$.on(o=>{o.documentId===e&&n(o.state)}),onStateChange:n=>this.searchState$.on(o=>{o.documentId===e&&n(o.state)})}}setFlags(e,t){this.dispatch((function(o,i){return{type:Gm,payload:{documentId:o,flags:i}}})(t,e));const n=this.state.documents[t];n?.active&&this.searchAllPages(n.query,t,!0)}notifySearchStart(e){this.searchStart$.emit({documentId:e})}notifySearchStop(e){this.searchStop$.emit({documentId:e})}notifyActiveResultChange(e,t){this.searchActiveResultChange$.emit({documentId:e,index:t})}startSearchSession(e){this.getCoreDocument(e)&&(this.dispatch((function(t){return{type:Wm,payload:{documentId:t}}})(e)),this.notifySearchStart(e))}stopSearchSession(e){var t;const n=this.state.documents[e];if(!n?.active)return;const o=this.currentTask.get(e);if(o){try{(t=o.abort)==null||t.call(o,{code:H.Cancelled,message:"search stopped"})}catch{}this.currentTask.delete(e)}this.dispatch((function(i){return{type:Hm,payload:{documentId:i}}})(e)),this.notifySearchStop(e)}searchAllPages(e,t,n=!1){var o;const i=this.state.documents[t];if(!i)return ne.reject({code:H.NotFound,message:"Search state not initialized"});const r=this.getCoreDocument(t);if(!r?.document)return ne.reject({code:H.NotFound,message:"Document not loaded"});const a=e.trim();if(i.query===a&&!n)return ne.resolve({results:i.results,total:i.total});const s=this.currentTask.get(t);if(s){try{(o=s.abort)==null||o.call(s,{code:H.Cancelled,message:"new search"})}catch{}this.currentTask.delete(t)}if(this.dispatch((function(c,d){return{type:Km,payload:{documentId:c,query:d}}})(t,a)),!a)return this.dispatch(la(t,[],0,-1)),ne.resolve({results:[],total:0});i.active||this.startSearchSession(t);const l=this.engine.searchAllPages(r.document,a,{flags:i.flags});return this.currentTask.set(t,l),l.onProgress(c=>{var d;(d=c?.results)!=null&&d.length&&this.currentTask.get(t)===l&&(this.dispatch((function(u,m){return{type:Xm,payload:{documentId:u,results:m}}})(t,c.results)),this.state.documents[t].activeResultIndex===-1&&(this.dispatch(Sc(t,0)),this.notifyActiveResultChange(t,0)))}),l.wait(c=>{this.currentTask.delete(t);const d=c.total>0?0:-1;this.dispatch(la(t,c.results,c.total,d)),this.searchResult$.emit({documentId:t,results:c}),c.total>0&&this.notifyActiveResultChange(t,0)},c=>{var d;((d=c?.reason)==null?void 0:d.code)!==H.Cancelled&&(console.error("Error during search:",c),this.dispatch(la(t,[],0,-1))),this.currentTask.delete(t)}),l}nextResult(e){const t=this.state.documents[e];if(!t||t.results.length===0)return-1;const n=t.activeResultIndex>=t.results.length-1?0:t.activeResultIndex+1;return this.goToResult(n,e)}previousResult(e){const t=this.state.documents[e];if(!t||t.results.length===0)return-1;const n=t.activeResultIndex<=0?t.results.length-1:t.activeResultIndex-1;return this.goToResult(n,e)}goToResult(e,t){const n=this.state.documents[t];return!n||n.results.length===0||e<0||e>=n.results.length?-1:(this.dispatch(Sc(t,e)),this.notifyActiveResultChange(t,e),e)}async destroy(){for(const e of Object.keys(this.state.documents))this.stopSearchSession(e);this.searchResult$.clear(),this.searchStart$.clear(),this.searchStop$.clear(),this.searchActiveResultChange$.clear(),this.searchResultState$.clear(),this.searchState$.clear(),super.destroy()}};Ym.id="search";let Vs=Ym;const Pc="search",Wb={manifest:{id:Pc,name:"Search Plugin",version:"1.0.0",provides:["search"],requires:[],optional:[],defaultConfig:{flags:[]}},create:(e,t)=>
vendor: 4,333 bytes, line 2286
2286new Vs(Pc,e,t),reducer:(e=Ac,t)=>{switch(t.type){case Um:return{...e,documents:{...e.documents,[t.payload.documentId]:t.payload.state}};case Bm:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i}}case Wm:return Pn(e,t.payload.documentId,{active:!0});case Hm:return Pn(e,t.payload.documentId,{results:[],total:0,activeResultIndex:-1,query:"",loading:!1,active:!1});case Gm:return Pn(e,t.payload.documentId,{flags:t.payload.flags});case qm:return Pn(e,t.payload.documentId,{showAllResults:t.payload.showAll});case Km:return Pn(e,t.payload.documentId,{loading:!0,query:t.payload.query,results:[],total:0,activeResultIndex:-1});case Xm:{const{documentId:n,results:o}=t.payload,i=e.documents[n];if(!i)return e;const r=[...i.results,...o],a=i.activeResultIndex===-1&&r.length>0?0:i.activeResultIndex;return Pn(e,n,{results:r,total:r.length,activeResultIndex:a,loading:!0})}case Vm:{const{documentId:n,results:o,total:i,activeResultIndex:r}=t.payload;return Pn(e,n,{results:o,total:i,activeResultIndex:r,loading:!1})}case Zm:return Pn(e,t.payload.documentId,{activeResultIndex:t.payload.index});default:return e}},initialState:Ac},Qm=()=>We(Vs.id);function Hb({documentId:e,pageIndex:t,scale:n,style:o,highlightColor:i="#FFFF00",activeHighlightColor:r="#FFBF00",...a}){const{provides:s}=Qm(),[l,c]=O(null),d=pt(e),u=Z(()=>s?.forDocument(e),[s,e]),m=Z(()=>n!==void 0?n:d?.scale??1,[n,d?.scale]);return $(()=>{if(!u)return void c(null);const g=u.getState();return c({results:g.results,activeResultIndex:g.activeResultIndex,showAllResults:g.showAllResults,active:g.active}),u.onSearchResultStateChange(p=>{c(p)})},[u]),!l||!l.active?null:k("div",{style:{...o,pointerEvents:"none"},...a,children:l.results.map((g,p)=>({result:g,originalIndex:p})).filter(({result:g})=>g.pageIndex===t).filter(({originalIndex:g})=>l.showAllResults||g===l.activeResultIndex).map(({result:g,originalIndex:p})=>g.rects.map((f,v)=>k("div",{style:{position:"absolute",top:f.origin.y*m,left:f.origin.x*m,width:f.size.width*m,height:f.size.height*m,backgroundColor:p===l.activeResultIndex?r:i,mixBlendMode:"multiply",transform:"scale(1.02)",transformOrigin:"center",transition:"opacity .3s ease-in-out",opacity:1}},`${p}-${v}`)))})}const qn="selection",Gb={id:qn,name:"Selection Plugin",version:"1.0.0",provides:["selection"],requires:["interaction-manager"],optional:["viewport","scroll"],defaultConfig:{menuHeight:40}},Jm="SELECTION/INIT_STATE",ep="SELECTION/CLEANUP_STATE",tp="SELECTION/CACHE_PAGE_GEOMETRY",np="SELECTION/SET_SELECTION",op="SELECTION/START_SELECTION",ip="SELECTION/END_SELECTION",rp="SELECTION/CLEAR_SELECTION",ap="SELECTION/SET_RECTS",sp="SELECTION/SET_SLICES",lp="SELECTION/EVICT_PAGE_GEOMETRY",ca=(e,t)=>({type:np,payload:{documentId:e,selection:t}}),da=e=>({type:op,payload:{documentId:e}}),ua=e=>({type:ip,payload:{documentId:e}}),Mc=(e,t)=>({type:ap,payload:{documentId:e,rects:t}}),Dc=(e,t)=>({type:sp,payload:{documentId:e,slices:t}}),cp={geometry:{},rects:{},slices:{},selection:null,active:!1,selecting:!1},Tc={documents:{}},Qt=(e,t,n)=>({...e,documents:{...e.documents,[t]:n}});function Yo(e,t){return e.rects[t]??[]}function yo(e,t){return Ms(Yo(e,t))}function ha(e){const t=[],n=e.rects;for(const o in n){const i=Number(o),r=Ms(n[i]);r&&t.push({page:i,rect:r})}return t}function Rc(e,t){const n=e.rects[t]||[];if(n.length===0)return null;const o=yo(e,t);return o?{pageIndex:t,rect:o,segmentRects:n}:null}function Ec(e){const t=[],n=Object.keys(e.rects).map(Number);for(const o of n){const i=e.rects[o]||[];if(i.length===0)continue;const r=yo(e,o);r&&t.push({pageIndex:o,rect:r,segmentRects:i})}return t}function Ni(e,t,n=1.5){for(const s of e.runs){if(!(t.y>=s.rect.y&&t.y<=s.rect.y+s.rect.height&&t.x>=s.rect.x&&t.x<=s.rect.x+s.rect.width))continue;const l=s.glyphs.findIndex(c=>{const d=c.tightX??c.x,u=c.tightY??c.y,m=c.tightWidth??c.width,g=c.tightHeight??c.height;return t.x>=d&&t.x<=d+m&&t.y>=u&&t.y<=u+g});if(l!==-1)return s.charStart+l}if(n<=0)return-1;const o=(function(s,l){let c=0,d=0;for(const u of s.runs)for(const m of u.glyphs)m.flags!==2&&(c+=m.height,d++);return d===0?0:c/d*l})(e,n),i=o/2;let r=-1,a=1/0;for(const s of e.runs)if(!(t.y<s.rect.y-i||t.y>s.rect.y+s.rect.height+i||t.x<s.rect.x-i||t.x>s.rect.x+s.rect.width+i))for(let l=0;l<s.glyphs.length;l++){const c=s.glyphs[l];if(c.flags===2)continue;
2286const d=c.tightX??c.x,u=c.tightY??c.y,m=c.tightWidth??c.width,g=c.tightHeight??c.height,p=d-i,f=d+m+i,v=u-i,y=u+g+i;if(t.x<p||t.x>f||t.y<v||t.y>y)continue;const b=Math.min(Math.abs(t.x-d),Math.abs(t.x-(d+m)))+Math.min(Math.abs(t.y-u),Math.abs(t.y-(u+g)));b<a&&(a=b,r=s.charStart+l)}return r}function zc(e,t,n){if(!e||!t||n<e.start.page||n>e.end.page)return null;const o=n===e.start.page?e.start.index:0,i=t.runs[t.runs.length-1],r=i.charStart+i.glyphs.length-1;return{from:o,to:n===e.end.page?e.end.index:r}}function Lc(e,t,n,o=!0){const i=[];for(const r of e.runs){const a=r.charStart,s=a+r.glyphs.length-1;if(s<t||a>n)continue;const l=Math.max(t,a)-a,c=Math.min(n,s)-a;let d=1/0,u=-1/0,m=1/0,g=-1/0,p=0,f=0,v=-1/0;const y=()=>{d!==1/0&&p>0&&i.push({rect:{origin:{x:d,y:m},size:{width:u-d,height:g-m}},charCount:p,fontSize:r.fontSize}),d=1/0,u=-1/0,m=1/0,g=-1/0,p=0,f=0,v=-1/0};for(let b=l;b<=c;b++){const w=r.glyphs[b];if(w.flags!==2){if(p>0&&v>-1/0){const x=Math.abs(w.x-v),C=f/p;C>0&&x>2.5*C&&y()}d=Math.min(d,w.x),u=Math.max(u,w.x+w.width),m=Math.min(m,w.y),g=Math.max(g,w.y+w.height),p++,f+=w.width,v=w.x+w.width}}y()}return o?(function(r){const a=[];let s=null,l=null;for(const c of r)s&&l?Kb(s,c)?l=dp(l,c.rect):(a.push(l),l=c.rect):l=c.rect,s=c;return l&&!Ga(l)&&a.push(l),a})(i):i.map(r=>r.rect)}function dp(e,t){const n=Math.min(e.origin.x,t.origin.x),o=Math.min(e.origin.y,t.origin.y);return{origin:{x:n,y:o},size:{width:Math.max(e.origin.x+e.size.width,t.origin.x+t.size.width)-n,height:Math.max(e.origin.y+e.size.height,t.origin.y+t.size.height)-o}}}function Ga(e){return e.size.width<=0||e.size.height<=0}function qb(e,t){if(Ga(e)||Ga(t))return 0;const n=dp(e,t);return n.size.height===e.size.height||n.size.height===t.size.height?1:(function(i,r){const a=Math.max(i.origin.x,r.origin.x),s=Math.max(i.origin.y,r.origin.y),l=Math.min(i.origin.x+i.size.width,r.origin.x+r.size.width),c=Math.min(i.origin.y+i.size.height,r.origin.y+r.size.height);return{origin:{x:a,y:s},size:{width:Math.max(0,l-a),height:Math.max(0,c-s)}}})(e,t).size.height/n.size.height}function Kb(e,t){if(e.fontSize!=null&&t.fontSize!=null&&e.fontSize>0&&t.fontSize>0&&Math.max(e.fontSize,t.fontSize)/Math.min(e.fontSize,t.fontSize)>1.5)return!1;const n=e.rect,o=t.rect;if(qb(n,o)<.8)return!1;const i=1*n.size.width/e.charCount,r=1*o.size.width/t.charCount,a=n.origin.x-i,s=n.origin.x+n.size.width+i,l=o.origin.x-r;return a<o.origin.x+o.size.width+r&&s>l}function Oi(e,t){for(let n=0;n<e.runs.length;n++){const o=e.runs[n],i=t-o.charStart;if(i>=0&&i<o.glyphs.length)return{runIdx:n,localIdx:i}}return null}function Nc(e){return e===1||e===2}function Oc(e){return e.rect.width===0&&e.rect.height===0}function Fc(e,t,n,o){const i=Math.max(t,o)-Math.min(e,n),r=Math.max(0,Math.min(t,o)-Math.max(e,n));return i!==0&&r/i>=.5}const up=class extends $e{constructor(e,t,n){var o,i,r;super(e,t),this.enabledModesPerDoc=new Map,this.selecting=new Map,this.anchor=new Map,this.hasTextAnchor=new Map,this.marqueePage=new Map,this.pageCallbacks=new Map,this.geoAccessOrder=new Map,this.menuPlacement$=Ue((s,l)=>({documentId:s,placement:l})),this.selChange$=Ue((s,l)=>({documentId:s,selection:l,modeId:this.interactionManagerCapability.forDocument(s).getActiveMode()})),this.textRetrieved$=Ue((s,l)=>({documentId:s,text:l})),this.copyToClipboard$=Ue((s,l)=>({documentId:s,text:l}),{cache:!1}),this.beginSelection$=Ue((s,l)=>({documentId:s,page:l.page,index:l.index,modeId:l.modeId}),{cache:!1}),this.endSelection$=Ue((s,l)=>({documentId:s,modeId:l.modeId}),{cache:!1}),this.marqueeChange$=Ue((s,l)=>({documentId:s,pageIndex:l.pageIndex,rect:l.rect,modeId:l.modeId}),{cache:!1}),this.marqueeEnd$=Ue((s,l)=>({documentId:s,pageIndex:l.pageIndex,rect:l.rect,modeId:l.modeId}),{cache:!1}),this.emptySpaceClick$=Ue((s,l)=>({documentId:s,pageIndex:l.pageIndex,modeId:l.modeId}),{cache:!1}),this.viewportCapability=null,this.scrollCapability=null,this.config=n,this.menuHeight=n.menuHeight??40;const a=t.getPlugin("interaction-manager");if(!a)throw new Error("SelectionPlugin: InteractionManagerPlugin is required.");this.interactionManagerCapability=a.provides(),this.viewportCapability=((o=t.getPlugin("viewport"))==null?void 0:o.provides())??null,this.scrollCapability=((i=t.getPlugin("scroll"))==null?void 0:i.provides())??null,this.coreStore.onAction(zo,s=>{const{documentId:l,pageIndexes:c}=s.payload,d=c.map(u=>this.getNewPageGeometryAndCache(l,u));
vendor: 5,082 bytes, line 2286
2286se.all(d).wait(()=>{c.forEach(u=>{this.notifyPage(l,u)})},et)}),(r=this.viewportCapability)==null||r.onViewportChange(s=>{this.recalculateMenuPlacement(s.documentId)},{mode:"throttle",wait:100})}onDocumentLoadingStarted(e){var t;this.dispatch(((o,i)=>({type:Jm,payload:{documentId:o,state:i}}))(e,cp));const n=((t=this.config.marquee)==null?void 0:t.enabled)!==!1;this.enabledModesPerDoc.set(e,new Map([["pointerMode",{enableSelection:!0,showSelectionRects:!0,enableMarquee:n,showMarqueeRects:!0}]])),this.pageCallbacks.set(e,new Map),this.geoAccessOrder.set(e,[]),this.selecting.set(e,!1),this.anchor.set(e,void 0),this.hasTextAnchor.set(e,!1)}onDocumentClosed(e){this.dispatch((t=>({type:ep,payload:t}))(e)),this.enabledModesPerDoc.delete(e),this.pageCallbacks.delete(e),this.geoAccessOrder.delete(e),this.selecting.delete(e),this.hasTextAnchor.delete(e),this.anchor.delete(e),this.marqueePage.delete(e),this.selChange$.clearScope(e),this.textRetrieved$.clearScope(e),this.copyToClipboard$.clearScope(e),this.beginSelection$.clearScope(e),this.endSelection$.clearScope(e),this.menuPlacement$.clearScope(e),this.marqueeChange$.clearScope(e),this.marqueeEnd$.clearScope(e),this.emptySpaceClick$.clearScope(e)}async initialize(){}async destroy(){this.selChange$.clear(),this.textRetrieved$.clear(),this.copyToClipboard$.clear(),this.beginSelection$.clear(),this.endSelection$.clear(),this.menuPlacement$.clear(),this.marqueeChange$.clear(),this.marqueeEnd$.clear(),this.emptySpaceClick$.clear(),super.destroy()}buildCapability(){const e=t=>t??this.getActiveDocumentId();return{getFormattedSelection:t=>Ec(this.getDocumentState(e(t))),getFormattedSelectionForPage:(t,n)=>Rc(this.getDocumentState(e(n)),t),getHighlightRectsForPage:(t,n)=>Yo(this.getDocumentState(e(n)),t),getHighlightRects:t=>this.getDocumentState(e(t)).rects,getBoundingRectForPage:(t,n)=>yo(this.getDocumentState(e(n)),t),getBoundingRects:t=>ha(this.getDocumentState(e(t))),getSelectedText:t=>this.getSelectedText(e(t)),setSelection:(t,n)=>this.applySelection(e(n),t),clear:t=>this.clearSelection(e(t)),copyToClipboard:t=>this.copyToClipboard(e(t)),getState:t=>this.getDocumentState(e(t)),enableForMode:(t,n,o)=>{var i;return(i=this.enabledModesPerDoc.get(e(o)))==null?void 0:i.set(t,{...n})},isEnabledForMode:(t,n)=>{var o;return((o=this.enabledModesPerDoc.get(e(n)))==null?void 0:o.has(t))??!1},setMarqueeEnabled:(t,n)=>this.setMarqueeEnabled(e(n),t),isMarqueeEnabled:t=>this.isMarqueeEnabled(e(t)),forDocument:this.createSelectionScope.bind(this),onCopyToClipboard:this.copyToClipboard$.onGlobal,onSelectionChange:this.selChange$.onGlobal,onTextRetrieved:this.textRetrieved$.onGlobal,onBeginSelection:this.beginSelection$.onGlobal,onEndSelection:this.endSelection$.onGlobal,onMarqueeChange:this.marqueeChange$.onGlobal,onMarqueeEnd:this.marqueeEnd$.onGlobal,onEmptySpaceClick:this.emptySpaceClick$.onGlobal}}createSelectionScope(e){return{getFormattedSelection:()=>Ec(this.getDocumentState(e)),getFormattedSelectionForPage:t=>Rc(this.getDocumentState(e),t),getHighlightRectsForPage:t=>Yo(this.getDocumentState(e),t),getHighlightRects:()=>this.getDocumentState(e).rects,getBoundingRectForPage:t=>yo(this.getDocumentState(e),t),getBoundingRects:()=>ha(this.getDocumentState(e)),getSelectedText:()=>this.getSelectedText(e),setSelection:t=>this.applySelection(e,t),clear:()=>this.clearSelection(e),copyToClipboard:()=>this.copyToClipboard(e),getState:()=>this.getDocumentState(e),setMarqueeEnabled:t=>this.setMarqueeEnabled(e,t),isMarqueeEnabled:()=>this.isMarqueeEnabled(e),onSelectionChange:this.selChange$.forScope(e),onTextRetrieved:this.textRetrieved$.forScope(e),onCopyToClipboard:this.copyToClipboard$.forScope(e),onBeginSelection:this.beginSelection$.forScope(e),onEndSelection:this.endSelection$.forScope(e),onMarqueeChange:this.marqueeChange$.forScope(e),onMarqueeEnd:this.marqueeEnd$.forScope(e),onEmptySpaceClick:this.emptySpaceClick$.forScope(e)}}getDocumentState(e){const t=this.state.documents[e];if(!t)throw new Error(`Selection state not found for document: ${e}`);return t}onMenuPlacement(e,t){return this.menuPlacement$.forScope(e)(t)}registerSelectionOnPage(e){var t;const{documentId:n,pageIndex:o,onRectsChange:i}=e,r=this.state.documents[n];if(!r)return this.logger.warn("SelectionPlugin","RegisterFailed",`Cannot register selection on page ${o} for document ${n}: document state not initialized.`),()=>{};(t=this.pageCallbacks.get(n))==null||t.set(o,i);const a=this.getOrLoadGeometry(n,o),s=this.interactionManagerCapability.forDocument(n),l=this.enabledModesPerDoc.get(n);i({rects:Yo(r,o),boundingRect:yo(r,o)}),a.wait(u=>{const m=this.getDocumentState(n),g=m.selection;if(!g||o<g.start.page||o>g.end.page)return;const p=zc(g,u,o);if(!p)return;const f=Lc(u,p.from,p.to);this.dispatch(Mc(n,{...m.rects,[o]:f})),this.dispatch(Dc(n,{...m.slices,[o]:{start:p.from,count:p.to-p.from+1}})),this.notifyPage(n,o)},et);const c=(function(u){const m=u.minDragDistance??3,g=u.toleranceFactor??1.5;let p=null,f=null,v=!1,y=0;function b(){var w;p=null,f=null,v=!1,(w=u.setHasTextAnchor)==null||w.call(u,!1)}
2286return{onPointerDown:(w,x,C)=>{var I,S;if(x.target===x.currentTarget&&((I=u.onEmptySpaceClick)==null||I.call(u,C)),!u.isEnabled(C))return;const P=Date.now();(y===0||P-y>=500)&&u.onClear(C);const A=u.getGeometry();if(!A)return;const D=Ni(A,w,g);D!==-1&&(p=D,f=w,v=!1,(S=u.setHasTextAnchor)==null||S.call(u,!0))},onPointerMove:(w,x,C)=>{if(!u.isEnabled(C))return;const I=u.getGeometry();if(!I)return;const S=Ni(I,w,g);if(u.setCursor(S!==-1?"text":null),p!==null&&f&&!v){const P=w.x-f.x,A=w.y-f.y;return void(Math.sqrt(P*P+A*A)>=m&&(v=!0,u.onBegin(p,C),S!==-1&&u.onUpdate(S,C)))}u.isSelecting()&&S!==-1&&u.onUpdate(S,C)},onPointerUp:(w,x,C)=>{u.isEnabled(C)&&v&&u.onEnd(C),b()},onDoubleClick:(w,x,C)=>{var I;if(!u.isEnabled(C))return;const S=u.getGeometry();if(!S)return;const P=Ni(S,w,g);P!==-1&&(y=Date.now(),(I=u.onWordSelect)==null||I.call(u,P,C))},onClick:(w,x,C)=>{var I;if(!u.isEnabled(C)||y===0)return;if(Date.now()-y>500)return void(y=0);y=0;const S=u.getGeometry();if(!S)return;const P=Ni(S,w,g);P!==-1&&((I=u.onLineSelect)==null||I.call(u,P,C))},onHandlerActiveEnd:w=>{b(),u.isEnabled(w)&&u.onClear(w)}}})({getGeometry:()=>this.getDocumentState(n).geometry[o],isEnabled:u=>{const m=l?.get(u);return!!m&&m.enableSelection!==!1},onBegin:(u,m)=>this.beginSelection(n,o,u,m),onUpdate:(u,m)=>this.updateSelection(n,o,u,m),onEnd:u=>this.endSelection(n,u),onClear:u=>this.clearSelection(n,u),isSelecting:()=>this.selecting.get(n)??!1,setCursor:u=>u?s.setCursor("selection-text",u,10):s.removeCursor("selection-text"),onEmptySpaceClick:u=>this.emptySpaceClick$.emit(n,{pageIndex:o,modeId:u}),onWordSelect:(u,m)=>this.selectWord(n,o,u,m),onLineSelect:(u,m)=>this.selectLine(n,o,u,m),setHasTextAnchor:u=>this.hasTextAnchor.set(n,u),minDragDistance:this.config.minSelectionDragDistance,toleranceFactor:this.config.toleranceFactor}),d=this.interactionManagerCapability.registerAlways({scope:{type:"page",documentId:n,pageIndex:o},handlers:c});return()=>{var u;d(),(u=this.pageCallbacks.get(n))==null||u.delete(o),a.abort({code:H.Cancelled,message:"Cleanup"})}}registerMarqueeOnPage(e){var t;const{documentId:n,pageIndex:o,scale:i,onRectChange:r}=e;if(!this.state.documents[n])return this.logger.warn("SelectionPlugin","RegisterMarqueeFailed",`Cannot register marquee on page ${o} for document ${n}: document state not initialized.`),()=>{};const a=this.coreState.core.documents[n];if(!a||!a.document)return this.logger.warn("SelectionPlugin","DocumentNotFound",`Cannot register marquee on page ${o}: document not found`),()=>{};const s=a.document.pages[o];if(!s)return this.logger.warn("SelectionPlugin","PageNotFound",`Cannot register marquee on page ${o}: page not found`),()=>{};const l=s.size,c=((t=this.config.marquee)==null?void 0:t.minDragPx)??5,d=()=>{var m;const g=this.interactionManagerCapability.forDocument(n).getActiveMode(),p=(m=this.enabledModesPerDoc.get(n))==null?void 0:m.get(g);return p?.showMarqueeRects!==!1},u=(function(m){const{pageSize:g,scale:p,minDragPx:f=5}=m;let v=null,y=null;return{onPointerDown:(b,w,x)=>{var C,I;m.isEnabled(x)&&((C=m.isTextSelecting)!=null&&C.call(m)||(v=b,y={origin:{x:b.x,y:b.y},size:{width:0,height:0}},m.onBegin(b,x),(I=w.setPointerCapture)==null||I.call(w)))},onPointerMove:(b,w,x)=>{if(!v||!m.isEnabled(x))return;const C=ue(b.x,0,g.width),I=ue(b.y,0,g.height);y={origin:{x:Math.min(v.x,C),y:Math.min(v.y,I)},size:{width:Math.abs(C-v.x),height:Math.abs(I-v.y)}},m.onChange(y,x)},onPointerUp:(b,w,x)=>{var C;m.isEnabled(x)&&(y&&v&&(Math.max(y.size.width,y.size.height)*p>f?m.onEnd(y,x):m.onCancel(x)),v=null,y=null,(C=w.releasePointerCapture)==null||C.call(w))},onPointerCancel:(b,w,x)=>{var C;m.isEnabled(x)&&(v=null,y=null,m.onCancel(x),(C=w.releasePointerCapture)==null||C.call(w))}}})({pageSize:l,scale:i,minDragPx:c,isEnabled:m=>{var g;const p=(g=this.enabledModesPerDoc.get(n))==null?void 0:g.get(m);return p?.enableMarquee===!0},isTextSelecting:()=>(this.selecting.get(n)??!1)||(this.hasTextAnchor.get(n)??!1),onBegin:(m,g)=>this.beginMarquee(n,o,m,g),onChange:(m,g)=>{this.updateMarquee(n,o,m,g),r(d()?m:null)},onEnd:(m,g)=>{this.endMarquee(n,o,m,g),r(null)},onCancel:m=>{this.cancelMarquee(n,m),r(null)}});return this.interactionManagerCapability.registerAlways({scope:{type:"page",documentId:n,pageIndex:o},handlers:u})}getPlacementMetrics(e,t,n,o){var i;const r=(i=this.scrollCapability)==null?void 0:i.forDocument(e),a=r?.getRectPositionForPage(t,n);if(!a)return null;const s=a.origin.y-o.scrollTop,l=a.origin.y+a.size.height-o.scrollTop;return{pageIndex:t,rect:n,spaceAbove:s,spaceBelow:o.clientHeight-l,isBottomVisible:l>0&&l<=o.clientHeight,isTopVisible:s>=0&&s<o.clientHeight}}emitMenuPlacement(e,t){this.menuPlacement$.emit(e,t),t?this.interactionManagerCapability.claimPageActivity(e,"selection-menu",t.pageIndex):this.interactionManagerCapability.releasePageActivity(e,"selection-menu")}recalculateMenuPlacement(e){const t=this.state.documents[e];if(!t)return;if(t.selecting||t.selection===null)return void this.emitMenuPlacement(e,null);const n=ha(t);if(n.length===0)return void this.emitMenuPlacement(e,null);const o=n[n.length-1];if(!this.viewportCapability||!this.scrollCapability)return void this.emitMenuPlacement(e,{pageIndex:o.page,rect:o.rect,spaceAbove:0,spaceBelow:1/0,suggestTop:!1,isVisible:!0});const i=this.viewportCapability.forDocument(e).getMetrics(),r=n[0],a=this.getPlacementMetrics(e,o.page,o.rect,i),s=this.getPlacementMetrics(e,r.page,r.rect,i);a&&a.isBottomVisible&&a.spaceBelow>this.menuHeight?this.emitMenuPlacement(e,{...a,suggestTop:!1,isVisible:!0}):s&&s.isTopVisible?this.emitMenuPlacement(e,{...s,suggestTop:!0,isVisible:!0}):a&&a.isBottomVisible?this.emitMenuPlacement(e,{...a,suggestTop:!1,isVisible:!0}):this.emitMenuPlacement(e,null)}notifyPage(e,t){var n,o;const i=(n=this.pageCallbacks.get(e))==null?void 0:n.get(t);if(i){const r=this.getDocumentState(e),a=this.interactionManagerCapability.forDocument(e).getActiveMode(),s=(o=this.enabledModesPerDoc.get(e))==null?void 0:o.get(a);i(s&&(s.showSelectionRects??s.showRects)!==!1?{rects:Yo(r,t),boundingRect:yo(r,t)}:{rects:[],boundingRect:null})}}notifyAllPages(e){var t;(t=this.pageCallbacks.get(e))==null||t.forEach((n,o)=>{this.notifyPage(e,o)})}getNewPageGeometryAndCache(e,t){const n=this.getCoreDocument(e);
vendor: 10,431 bytes, lines 2286-2287
2286if(!n||!n.document)return ne.reject({code:H.NotFound,message:"Doc Not Found"});const o=n.document.pages.find(r=>r.index===t),i=this.engine.getPageGeometry(n.document,o);return i.wait(r=>{this.dispatch(((a,s,l)=>({type:tp,payload:{documentId:a,page:s,geo:l}}))(e,t,r)),this.touchGeometry(e,t)},et),i}getOrLoadGeometry(e,t){const n=this.getDocumentState(e).geometry[t];return n?(this.touchGeometry(e,t),ne.resolve(n)):this.getNewPageGeometryAndCache(e,t)}touchGeometry(e,t){const n=this.geoAccessOrder.get(e);if(!n)return;const o=n.indexOf(t);o>-1&&n.splice(o,1),n.push(t),this.evictGeometryIfNeeded(e)}evictGeometryIfNeeded(e){const t=this.config.maxCachedGeometries??50,n=this.geoAccessOrder.get(e);if(!n||n.length<=t)return;const o=this.pageCallbacks.get(e),i=[];for(;n.length-i.length>t;){const r=n.find(a=>!i.includes(a)&&!o?.has(a));if(r===void 0)break;i.push(r)}if(i.length!==0){for(const r of i){const a=n.indexOf(r);a>-1&&n.splice(a,1)}this.dispatch(((r,a)=>({type:lp,payload:{documentId:r,pages:a}}))(e,i))}}beginSelection(e,t,n,o){this.selecting.set(e,!0),this.anchor.set(e,{page:t,index:n}),this.dispatch(da(e)),this.beginSelection$.emit(e,{page:t,index:n,modeId:o}),this.recalculateMenuPlacement(e)}endSelection(e,t){this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch(ua(e)),this.endSelection$.emit(e,{modeId:t}),this.recalculateMenuPlacement(e)}clearSelection(e,t){this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch((n=>({type:rp,payload:{documentId:n}}))(e)),this.selChange$.emit(e,null),this.emitMenuPlacement(e,null),this.notifyAllPages(e)}applySelection(e,t){if(!this.state.documents[e])return ne.reject({code:H.NotFound,message:`Selection state not found for document: ${e}`});if(t===null)return this.clearSelection(e),ne.resolve(void 0);const n=this.validateRange(e,t);if(n)return ne.reject(n);const o=this.normalizeRange(t),i=[];for(let s=o.start.page;s<=o.end.page;s++)i.push(s);const r=i.map(s=>this.getOrLoadGeometry(e,s)),a=ne.create();return se.all(r).wait(()=>{if(!this.state.documents[e])return void a.reject({code:H.NotFound,message:`Selection state not found for document: ${e}`});const s=this.clampRangeToGeometry(e,o);if(!s)return void a.reject({code:H.NotFound,message:`Cannot apply selection: page(s) ${o.start.page}-${o.end.page} have no text geometry`});this.selecting.set(e,!1),this.anchor.set(e,void 0);const l=Object.keys(this.getDocumentState(e).rects).map(Number);this.dispatch(da(e)),this.dispatch(ca(e,s)),this.updateRectsAndSlices(e,s),this.dispatch(ua(e)),this.selChange$.emit(e,s);const c=new Set(l);for(let d=s.start.page;d<=s.end.page;d++)c.add(d);c.forEach(d=>this.notifyPage(e,d)),this.recalculateMenuPlacement(e),a.resolve(void 0)},s=>a.reject(s.reason)),a}validateRange(e,t){var n,o;const i=l=>!!l&&typeof l=="object"&&Number.isInteger(l.page)&&Number.isInteger(l.index);if(!t||typeof t!="object"||!t.start||!t.end)return{code:H.Unknown,message:"Invalid selection range: expected { start, end }"};if(!i(t.start)||!i(t.end))return{code:H.Unknown,message:"Invalid selection range: start/end must have integer page and index"};if(t.start.index<0||t.end.index<0)return{code:H.Unknown,message:"Invalid selection range: glyph index cannot be negative"};const r=((o=(n=this.getCoreDocument(e))==null?void 0:n.document)==null?void 0:o.pageCount)??0,a=Math.min(t.start.page,t.end.page),s=Math.max(t.start.page,t.end.page);return a<0||s>=r?{code:H.NotFound,message:`Invalid selection range: page ${a<0?a:s} out of bounds [0, ${r})`}:null}clampRangeToGeometry(e,t){const n=this.getDocumentState(e),o=s=>{const l=n.geometry[s];if(!l||l.runs.length===0)return-1;const c=l.runs[l.runs.length-1];return c.charStart+c.glyphs.length-1},i=o(t.start.page),r=o(t.end.page);if(i<0&&r<0)return null;const a=(s,l)=>l<0?0:Math.min(Math.max(s,0),l);return{start:{page:t.start.page,index:a(t.start.index,i)},end:{page:t.end.page,index:a(t.end.index,r)}}}normalizeRange(e){const{start:t,end:n}=e;return n.page>t.page||n.page===t.page&&n.index>=t.index?{start:t,end:n}:{start:n,end:t}}selectWord(e,t,n,o){const i=this.getDocumentState(e).geometry[t];if(!i)return;const r=(function(a,s){if(!Oi(a,s))return null;const l=(function(u){if(u.runs.length===0)return 0;const m=u.runs[u.runs.length-1];return m.charStart+m.glyphs.length})(a);if(l===0)return null;let c=s;for(;c>0;){const u=Oi(a,c-1);if(!u||Nc(a.runs[u.runIdx].glyphs[u.localIdx].flags))break;c--}let d=s;for(;d<l-1;){const u=Oi(a,d+1);if(!u||Nc(a.runs[u.runIdx].glyphs[u.localIdx].flags))break;d++}return{from:c,to:d}})(i,n);r&&this.applyInstantSelection(e,t,r.from,r.to,o)}selectLine(e,t,n,o){const i=this.getDocumentState(e).geometry[t];if(!i)return;const r=(function(a,s){const l=Oi(a,s);if(!l)return null;const c=a.runs[l.runIdx],d=c.rect.y,u=c.rect.y+c.rect.height;let m=c.charStart,g=c.charStart+c.glyphs.length-1;for(let p=l.runIdx-1;p>=0;p--){const f=a.runs[p];if(!Oc(f)){if(!Fc(f.rect.y,f.rect.y+f.rect.height,d,u))break;m=f.charStart}}for(let p=l.runIdx+1;p<a.runs.length;p++){const f=a.runs[p];if(!Oc(f)){if(!Fc(f.rect.y,f.rect.y+f.rect.height,d,u))break;g=f.charStart+f.glyphs.length-1}}return{from:m,to:g}})(i,n);r&&this.applyInstantSelection(e,t,r.from,r.to,o)}applyInstantSelection(e,t,n,o,i){const r={start:{page:t,index:n},end:{page:t,index:o}};this.selecting.set(e,!1),this.anchor.set(e,void 0),this.dispatch(da(e)),this.dispatch(ca(e,r)),this.updateRectsAndSlices(e,r),this.dispatch(ua(e)),this.selChange$.emit(e,r),this.beginSelection$.emit(e,{page:t,index:n,modeId:i}),this.endSelection$.emit(e,{modeId:i});for(let a=r.start.page;a<=r.end.page;a++)this.notifyPage(e,a);this.recalculateMenuPlacement(e)}updateSelection(e,t,n,o){if(!this.selecting.get(e)||!this.anchor.get(e))return;const i=this.anchor.get(e),r=t>i.page||t===i.page&&n>=i.index,a={start:r?i:{page:t,index:n},end:r?{page:t,index:n}:i};this.dispatch(ca(e,a)),this.updateRectsAndSlices(e,a),this.selChange$.emit(e,a);for(let s=a.start.page;s<=a.end.page;s++)this.notifyPage(e,s)}updateRectsAndSlices(e,t){const n=this.getDocumentState(e),o={},i={};for(let r=t.start.page;r<=t.end.page;r++){const a=n.geometry[r],s=zc(t,a,r);s&&(o[r]=Lc(a,s.from,s.to),i[r]={start:s.from,count:s.to-s.from+1})}this.dispatch(Mc(e,o)),this.dispatch(Dc(e,i))}getSelectedText(e){if(!this.checkPermission(e,U.CopyContents))return this.logger.debug("SelectionPlugin","GetSelectedText",`Cannot get selected text: document ${e} lacks CopyContents permission`),ne.reject({code:H.Security,message:"Document lacks CopyContents permission"});const t=this.getCoreDocument(e),n=this.getDocumentState(e);if(!t?.document||!n.selection)return ne.reject({code:H.NotFound,message:"Doc Not Found or No Selection"});const o=n.selection,i=[];for(let a=o.start.page;a<=o.end.page;a++){const s=n.slices[a];s&&i.push({pageIndex:a,charIndex:s.start,charCount:s.count})}if(i.length===0)return ne.resolve([]);const r=this.engine.getTextSlices(t.document,i);return r.wait(a=>{this.textRetrieved$.emit(e,a)},et),r}copyToClipboard(e){if(!this.checkPermission(e,U.CopyContents))return void this.logger.debug("SelectionPlugin","CopyToClipboard",`Cannot copy to clipboard: document ${e} lacks CopyContents permission`);this.getSelectedText(e).wait(t=>{this.copyToClipboard$.emit(e,t.join(`
2287`))},et)}beginMarquee(e,t,n,o){this.marqueePage.set(e,t)}updateMarquee(e,t,n,o){this.marqueeChange$.emit(e,{pageIndex:t,rect:n,modeId:o})}endMarquee(e,t,n,o){this.marqueeEnd$.emit(e,{pageIndex:t,rect:n,modeId:o}),this.marqueeChange$.emit(e,{pageIndex:t,rect:null,modeId:o}),this.marqueePage.delete(e)}cancelMarquee(e,t){const n=this.marqueePage.get(e);n!==void 0&&(this.marqueeChange$.emit(e,{pageIndex:n,rect:null,modeId:t}),this.marqueePage.delete(e))}setMarqueeEnabled(e,t){const n=this.enabledModesPerDoc.get(e);if(!n)return;const o=n.get("pointerMode");o?o.enableMarquee=t:t&&n.set("pointerMode",{enableMarquee:!0})}isMarqueeEnabled(e){var t;const n=(t=this.enabledModesPerDoc.get(e))==null?void 0:t.get("pointerMode");return n?.enableMarquee!==!1}};up.id="selection";let _r=up;const Vb={manifest:Gb,create:(e,t)=>new _r(qn,e,t),reducer:(e=Tc,t)=>{switch(t.type){case Jm:{const{documentId:n,state:o}=t.payload;return Qt(e,n,o)}case ep:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i}}case tp:{const{documentId:n,page:o,geo:i}=t.payload,r=e.documents[n];return r?Qt(e,n,{...r,geometry:{...r.geometry,[o]:i}}):e}case np:{const{documentId:n,selection:o}=t.payload,i=e.documents[n];return i?Qt(e,n,{...i,selection:o,active:!0}):e}case op:{const{documentId:n}=t.payload,o=e.documents[n];return o?Qt(e,n,{...o,selecting:!0,selection:null,rects:{}}):e}case ip:{const{documentId:n}=t.payload,o=e.documents[n];return o?Qt(e,n,{...o,selecting:!1}):e}case rp:{const{documentId:n}=t.payload,o=e.documents[n];return o?Qt(e,n,{...o,selecting:!1,selection:null,rects:{},active:!1}):e}case ap:{const{documentId:n,rects:o}=t.payload,i=e.documents[n];return i?Qt(e,n,{...i,rects:o}):e}case sp:{const{documentId:n,slices:o}=t.payload,i=e.documents[n];return i?Qt(e,n,{...i,slices:o}):e}case lp:{const{documentId:n,pages:o}=t.payload,i=e.documents[n];if(!i)return e;const r={...i.geometry},a={...i.rects},s={...i.slices};for(const l of o)delete r[l],delete a[l],delete s[l];return Qt(e,n,{...i,geometry:r,rects:a,slices:s})}case"SELECTION/RESET":{const{documentId:n}=t.payload;return e.documents[n]?Qt(e,n,cp):e}default:return e}},initialState:Tc};function hp(e,t){const{width:n,height:o}=e.size;switch(t%4){case 1:return{matrix:`matrix(0, -1, 1, 0, 0, ${o})`,width:o,height:n};case 2:return{matrix:`matrix(-1, 0, 0, -1, ${n}, ${o})`,width:n,height:o};case 3:return{matrix:`matrix(0, 1, -1, 0, ${n}, 0)`,width:o,height:n};default:return{matrix:"matrix(1, 0, 0, 1, 0, 0)",width:n,height:o}}}const Xb="onDblClick";function oi({children:e,...t}){const{rect:n,rotation:o}=t,{matrix:i,width:r,height:a}=hp(n,o),s=K(null);return $(()=>{const l=s.current;if(!l)return;const c=u=>{u.stopPropagation()},d=u=>{u.stopPropagation()};return l.addEventListener("pointerdown",c,{capture:!0}),l.addEventListener("touchstart",d,{capture:!0,passive:!0}),()=>{l.removeEventListener("pointerdown",c,{capture:!0}),l.removeEventListener("touchstart",d,{capture:!0})}},[]),k(de,{children:e({menuWrapperProps:{style:{position:"absolute",left:n.origin.x,top:n.origin.y,transform:i,transformOrigin:"0 0",width:r,height:a,pointerEvents:"none",zIndex:3},ref:l=>{s.current=l}},matrix:i,rect:{origin:{x:n.origin.x,y:n.origin.y}
2287,size:{width:r,height:a}}})})}function mp(e,t,n,o=!1){if(!t)return e;let{origin:{x:i,y:r},size:{width:a,height:s}}=e;const l=t.minWidth??1,c=t.minHeight??1,d=t.maxWidth,u=t.maxHeight;if(n&&a>0&&s>0){const m=a/s;a<l&&(a=l,s=a/m),s<c&&(s=c,a=s*m),d!==void 0&&a>d&&(a=d,s=a/m),u!==void 0&&s>u&&(s=u,a=s*m)}else a=Math.max(l,a),s=Math.max(c,s),d!==void 0&&(a=Math.min(d,a)),u!==void 0&&(s=Math.min(u,s));return t.boundingBox&&!o&&(i=Math.max(0,Math.min(i,t.boundingBox.width-a)),r=Math.max(0,Math.min(r,t.boundingBox.height-s))),{origin:{x:i,y:r},size:{width:a,height:s}}}function _c(e,t,n){const i=Ds(e,t);return i.origin.x>=-1e-6&&i.origin.y>=-1e-6&&i.origin.x+i.size.width<=n.width+1e-6&&i.origin.y+i.size.height<=n.height+1e-6}function Fi(e,t,n,o,i){const{startRect:r,maintainAspectRatio:a=!1,annotationRotation:s=0,constraints:l}=n,c=(function(m){return{x:m.includes("e")?"left":m.includes("w")?"right":"center",y:m.includes("s")?"top":m.includes("n")?"bottom":"center"}})(t),d=r.size.width/r.size.height||1;let u=(function(m,g,p){let f=m.origin.x,v=m.origin.y,y=m.size.width,b=m.size.height;return p.x==="left"?y+=g.x:p.x==="right"&&(f+=g.x,y-=g.x),p.y==="top"?b+=g.y:p.y==="bottom"&&(v+=g.y,b-=g.y),{origin:{x:f,y:v},size:{width:y,height:b}}})(r,e,c);if(a&&(u=(function(m,g,p,f){let{x:v,y}=m.origin,{width:b,height:w}=m.size;if(p.x==="center"||p.y==="center")p.y==="center"?(w=b/f,y=g.origin.y+(g.size.height-w)/2):(b=w*f,v=g.origin.x+(g.size.width-b)/2);else{const x=Math.abs(b-g.size.width),C=Math.abs(w-g.size.height),I=x+C;if(I===0)b=g.size.width,w=g.size.height;else{const S=x/I,P=C/I,A=b/f;b=S*b+P*(w*f),w=S*A+P*w}}return p.x==="right"&&(v=g.origin.x+g.size.width-b),p.y==="bottom"&&(y=g.origin.y+g.size.height-w),{origin:{x:v,y},size:{width:b,height:w}}})(u,r,c,d)),o&&(u=(function(m,g,p,f,v){if(!f)return m;let{x:y,y:b}=m.origin,{width:w,height:x}=m.size;w=Math.max(1,w),x=Math.max(1,x);const C=p.x==="left"?g.origin.x:g.origin.x+g.size.width,I=p.y==="top"?g.origin.y:g.origin.y+g.size.height,S=p.x==="left"?f.width-C:p.x==="right"?C:2*Math.min(g.origin.x,f.width-g.origin.x-g.size.width)+g.size.width,P=p.y==="top"?f.height-I:p.y==="bottom"?I:2*Math.min(g.origin.y,f.height-g.origin.y-g.size.height)+g.size.height;if(v){const A=w>S?S/w:1,D=x>P?P/x:1,R=Math.min(A,D);R<1&&(w*=R,x*=R)}else w=Math.min(w,S),x=Math.min(x,P);return y=p.x==="left"?C:p.x==="right"?C-w:g.origin.x+(g.size.width-w)/2,b=p.y==="top"?I:p.y==="bottom"?I-x:g.origin.y+(g.size.height-x)/2,y=Math.max(0,Math.min(y,f.width-w)),b=Math.max(0,Math.min(b,f.height-x)),{origin:{x:y,y:b},size:{width:w,height:x}}})(u,r,c,l?.boundingBox,a)),u=mp(u,l,a,i),i&&(u=(function(m,g,p){let f,v;return f=p.x==="left"?g.origin.x:p.x==="right"?g.origin.x+g.size.width-m.size.width:g.origin.x+(g.size.width-m.size.width)/2,v=p.y==="top"?g.origin.y:p.y==="bottom"?g.origin.y+g.size.height-m.size.height:g.origin.y+(g.size.height-m.size.height)/2,{origin:{x:f,y:v},size:m.size}})(u,r,c)),s!==0){const m=(function(y,b){return{x:b.x==="left"?y.origin.x:b.x==="right"?y.origin.x+y.size.width:y.origin.x+y.size.width/2,y:b.y==="top"?y.origin.y:b.y==="bottom"?y.origin.y+y.size.height:y.origin.y+y.size.height/2}})(r,c),g={x:r.origin.x+r.size.width/2,y:r.origin.y+r.size.height/2},p={x:u.origin.x+u.size.width/2,y:u.origin.y+u.size.height/2},f=eo(m,g,s),v=eo(m,p,s);u={origin:{x:u.origin.x+(f.x-v.x),y:u.origin.y+(f.y-v.y)},size:u.size}}return u}const Zb={n:0,ne:45,e:90,se:135,s:180,sw:225,w:270,nw:315},Yb=["ns-resize","nesw-resize","ew-resize","nwse-resize","ns-resize","nesw-resize","ew-resize","nwse-resize"];function Qb(e,t,n=0){const o=((Zb[e]+90*t+n)%360+360)%360,i=Math.round(o/45)%8;return Yb[i]}function Jb(e,t,n){const o=-e/2;return n==="center"?o:n==="outside"?o-t:o+t}class e0{constructor(t,n){this.config=t,this.onUpdate=n,this.state="idle",this.startPoint=null,this.startElement=null,this.startRotationElement=null,this.gestureRotationCenter=null,this.activeHandle=null,this.currentPosition=null,this.activeVertexIndex=null,this.startVertices=[],this.currentVertices=[],this.rotationCenter=null,this.centerScreen=null,this.initialRotation=0,this.lastComputedRotation=0,this.rotationDelta=0,this.rotationSnappedAngle=null,this.currentVertices=t.vertices||[]}updateConfig(t){this.config={...this.config,...t},this.state!=="vertex-editing"&&(this.currentVertices=t.vertices||[])}startDrag(t,n){this.state="dragging",this.startPoint={x:t,y:n},this.startElement={...this.config.element},this.startRotationElement=this.config.rotationElement?{...this.config.rotationElement}:null,this.currentPosition={...this.config.element},this.onUpdate({state:"start",transformData:{type:"move",changes:{rect:this.startElement}}})}startResize(t,n,o){this.state="resizing",this.activeHandle=t,this.startPoint={x:n,y:o},this.startElement={...this.config.element},this.currentPosition={...this.config.element},this.onUpdate({state:"start",transformData:{type:"resize",changes:{rect:this.startElement},metadata:{handle:this.activeHandle,maintainAspectRatio:this.config.maintainAspectRatio}}})}startVertexEdit(t,n,o){this.currentVertices=[...this.config.vertices??this.currentVertices],t<0||t>=this.currentVertices.length||(this.state="vertex-editing",this.activeVertexIndex=t,this.startPoint={x:n,y:o},this.startVertices=[...this.currentVertices],this.gestureRotationCenter=this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2},this.onUpdate({state:"start",transformData:{type:"vertex-edit",changes:{vertices:this.startVertices},metadata:{vertexIndex:t}}}))}startRotation(t,n,o=0,i){this.state="rotating",this.startPoint={x:t,y:n},this.startElement={...this.config.element},this.rotationCenter=this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2};const{scale:r=1}=this.config,a=this.config.rotationElement??this.config.element,s=a.size.width*r,l=a.size.height*r,c=i??Math.max(s,l)/2+35,d=(o+90*(this.config.pageRotation??0))*Math.PI/180;this.centerScreen={x:t-c*Math.sin(d),y:n+c*Math.cos(d)},this.initialRotation=o,this.lastComputedRotation=o,this.rotationDelta=0,this.rotationSnappedAngle=null,this.onUpdate({state:"start",transformData:{type:"rotate",changes:{rotation:o},metadata:{rotationAngle:o,rotationDelta:0,rotationCenter:this.rotationCenter,isSnapped:!1}}})}move(t,n,o,i){if(this.state!=="idle"&&this.startPoint)if(o===void 0||o!==0){if(this.state==="dragging"&&this.startElement){const r=this.calculateDelta(t,n),a=this.calculateDragPosition(r);this.currentPosition=a,this.onUpdate({state:"move",transformData:{type:"move",changes:{rect:a}}})}else if(this.state==="resizing"&&this.activeHandle&&this.startElement){const r=(function(a,s,l){const{annotationRotation:c=0,constraints:d}=l,u=d?.boundingBox;if(c!==0&&u){const m=Fi(a,s,l,!1,!0);if(_c(m,c,u))return m;let g=Fi({x:0,y:0},s,l,!1,!0),p=0,f=1;for(let v=0;v<20;v+=1){const y=(p+f)/2,b=Fi({x:a.x*y,y:a.y*y},s,l,!1,!0);_c(b,c,u)?(g=b,p=y):f=y}return g}return Fi(a,s,l,!0,!1)})(this.calculateLocalDelta(t,n),this.activeHandle,{startRect:this.startElement,maintainAspectRatio:this.config.maintainAspectRatio||!!i,annotationRotation:this.config.annotationRotation,constraints:this.config.constraints});this.currentPosition=r,this.onUpdate({state:"move",transformData:{type:"resize",changes:{rect:r},metadata:{handle:this.activeHandle,maintainAspectRatio:this.config.maintainAspectRatio||!!i}}})}else if(this.state==="vertex-editing"&&this.activeVertexIndex!==null){const r=this.calculateVertexPosition(t,n);this.currentVertices=r,this.onUpdate({state:"move",transformData:{type:"vertex-edit",changes:{vertices:r},metadata:{vertexIndex:this.activeVertexIndex}}})}else if(this.state==="rotating"&&this.rotationCenter){const r=this.calculateAngleFromMouse(t,n),a=this.applyRotationSnapping(r),s=Mi(a.angle),l=s-this.lastComputedRotation,c=l>180?l-360:l<-180?l+360:l;this.rotationDelta+=c,this.lastComputedRotation=s,this.rotationSnappedAngle=a.isSnapped?s:null,this.onUpdate({state:"move",transformData:{type:"rotate",changes:{rotation:s},metadata:{rotationAngle:s,rotationDelta:this.rotationDelta,rotationCenter:this.rotationCenter,isSnapped:a.isSnapped,snappedAngle:this.rotationSnappedAngle??void 0,cursorPosition:{clientX:t,clientY:n}}}})}}else this.end()}end(){if(this.state==="idle")return;const t=this.state,n=this.activeHandle,o=this.activeVertexIndex;if(t==="vertex-editing")this.onUpdate({state:"end",transformData:{type:"vertex-edit",changes:{vertices:this.currentVertices},metadata:{vertexIndex:o||void 0}}});else if(t==="rotating")this.onUpdate({state:"end",transformData:{type:"rotate",changes:{rotation:this.lastComputedRotation},metadata:{rotationAngle:this.lastComputedRotation,rotationDelta:this.rotationDelta,rotationCenter:this.rotationCenter||void 0,isSnapped:this.rotationSnappedAngle!==null,snappedAngle:this.rotationSnappedAngle??void 0}}});else{const i=this.currentPosition||this.config.element;this.onUpdate({state:"end",transformData:{type:t==="dragging"?"move":"resize",changes:{rect:i},metadata:t==="dragging"?void 0:{handle:n||void 0,maintainAspectRatio:this.config.maintainAspectRatio}}})}this.reset()}cancel(){this.state!=="idle"&&(this.state==="vertex-editing"?this.onUpdate({state:"end",transformData:{type:"vertex-edit",changes:{vertices:this.startVertices},metadata:{vertexIndex:this.activeVertexIndex||void 0}}}):this.state==="rotating"?this.onUpdate({state:"end",transformData:{type:"rotate",changes:{rotation:this.initialRotation},metadata:{rotationAngle:this.initialRotation,rotationDelta:0,rotationCenter:this.rotationCenter||void 0,isSnapped:!1}}}):this.startElement&&this.onUpdate({state:"end",transformData:{type:this.state==="dragging"?"move":"resize",changes:{rect:this.startElement},metadata:this.state==="dragging"?void 0:{handle:this.activeHandle||void 0,maintainAspectRatio:this.config.maintainAspectRatio}}}),this.reset())}reset(){this.state="idle",this.startPoint=null,this.startElement=null,this.startRotationElement=null,this.gestureRotationCenter=null,this.activeHandle=null,this.currentPosition=null,this.activeVertexIndex=null,this.startVertices=[],this.rotationCenter=null,this.centerScreen=null,this.initialRotation=0,this.lastComputedRotation=0,this.rotationDelta=0,this.rotationSnappedAngle=null}calculateDelta(t,n){if(!this.startPoint)return{x:0,y:0};const o={x:t-this.startPoint.x,y:n-this.startPoint.y};return this.transformDelta(o)}transformDelta(t){const{pageRotation:n=0,scale:o=1}=this.config,i=n*Math.PI/2,r=Math.cos(i),a=Math.sin(i),s=t.x/o,l=t.y/o;return{x:r*s+a*l,y:-a*s+r*l}}calculateLocalDelta(t,n){const o=this.calculateDelta(t,n),{annotationRotation:i=0}=this.config;if(i===0)return o;const r=i*Math.PI/180,a=Math.cos(r),s=Math.sin(r);return{x:a*o.x+s*o.y,y:-s*o.x+a*o.y}}clampPoint(t){var n;const o=(n=this.config.constraints)==null?void 0:n.boundingBox;if(!o)return t;const{annotationRotation:i=0}=this.config;if(i===0)return{x:Math.max(0,Math.min(t.x,o.width)),y:Math.max(0,Math.min(t.y,o.height))};const r=this.gestureRotationCenter??this.config.rotationCenter??{x:this.config.element.origin.x+this.config.element.size.width/2,y:this.config.element.origin.y+this.config.element.size.height/2},a=eo(t,r,i),s=Math.max(0,Math.min(a.x,o.width)),l=Math.max(0,Math.min(a.y,o.height));return s===a.x&&l===a.y?t:eo({x:s,y:l},r,-i)}calculateVertexPosition(t,n){if(this.activeVertexIndex===null)return this.startVertices;const o=this.calculateLocalDelta(t,n),i=[...this.startVertices],r=i[this.activeVertexIndex],a={x:r.x+o.x,y:r.y+o.y};return i[this.activeVertexIndex]=this.clampPoint(a),i}calculateDragPosition(t){if(!this.startElement)return this.config.element;const n={origin:{x:this.startElement.origin.x+t.x,y:this.startElement.origin.y+t.y}
vendor: 1,685 bytes, line 2287
2287,size:{width:this.startElement.size.width,height:this.startElement.size.height}},{annotationRotation:o=0,constraints:i}=this.config,r=i?.boundingBox;if(o!==0&&r){let a,s,l,c;if(this.startRotationElement)a=this.startRotationElement.size.width,s=this.startRotationElement.size.height,l=this.startRotationElement.origin.x-this.startElement.origin.x,c=this.startRotationElement.origin.y-this.startElement.origin.y;else{const m=Math.abs(o*Math.PI/180),g=Math.abs(Math.cos(m)),p=Math.abs(Math.sin(m)),f=n.size.width,v=n.size.height;a=f*g+v*p,s=f*p+v*g,l=(f-a)/2,c=(v-s)/2}let{x:d,y:u}=n.origin;return d=Math.max(-l,Math.min(d,r.width-a-l)),u=Math.max(-c,Math.min(u,r.height-s-c)),{origin:{x:d,y:u},size:n.size}}return mp(n,i,this.config.maintainAspectRatio??!1)}calculateAngleFromMouse(t,n){if(!this.centerScreen)return this.initialRotation;const o=t-this.centerScreen.x,i=n-this.centerScreen.y;if(Math.sqrt(o*o+i*i)<10)return this.lastComputedRotation;const r=90*(this.config.pageRotation??0),a=Math.atan2(i,o)*(180/Math.PI)+90-r;return Mi(Math.round(a))}applyRotationSnapping(t){const n=this.config.rotationSnapAngles??[0,90,180,270],o=this.config.rotationSnapThreshold??4,i=Mi(t);for(const r of n){const a=Mi(r),s=Math.abs(i-a);if(Math.min(s,360-s)<=o)return{angle:a,isSnapped:!0,snapTarget:a}}return{angle:i,isSnapped:!1}}}function pp(e){var t,n,o,i,r,a;const{controller:s,resizeUI:l,vertexUI:c,rotationUI:d,includeVertices:u=!1,includeRotation:m=!1,currentRotation:g=0,handleAttrs:p,vertexAttrs:f,rotationAttrs:v}=e,{dragProps:y,createResizeProps:b,createVertexProps:w,createRotationProps:x}=(function(S){const{onUpdate:P,enabled:A=!0,...D}=S,R=K(null),M=K(P),N=K(null),z=K(null);$(()=>
2287{M.current=P},[P]),$(()=>{R.current?R.current.updateConfig(D):R.current=new e0(D,G=>{var oe;return(oe=M.current)==null?void 0:oe.call(M,G)})},[D.element,D.rotationCenter,D.rotationElement,D.constraints,D.maintainAspectRatio,D.pageRotation,D.annotationRotation,D.scale,D.vertices]);const _=W(G=>{var oe,le;const Te=N.current,De=z.current,Ne=G??Te;if(De&&Ne!==null)try{(oe=De.hasPointerCapture)!=null&&oe.call(De,Ne)&&((le=De.releasePointerCapture)==null||le.call(De,Ne))}catch{}N.current=null,z.current=null},[]),L=W(G=>{var oe;N.current!==null&&N.current!==G.pointerId&&((oe=R.current)==null||oe.end(),_(N.current));const le=G.currentTarget;N.current=G.pointerId,z.current=le;try{le.setPointerCapture(G.pointerId)}catch{}},[_]);$(()=>{const G=globalThis,oe=Te=>{var De;const Ne=N.current;Ne!==null&&Te.pointerId===Ne&&((De=R.current)==null||De.end(),_(Te.pointerId))},le=()=>{var Te;N.current!==null&&((Te=R.current)==null||Te.end(),_())};return G.addEventListener("pointerup",oe,!0),G.addEventListener("pointercancel",oe,!0),G.addEventListener("blur",le,!0),()=>{G.removeEventListener("pointerup",oe,!0),G.removeEventListener("pointercancel",oe,!0),G.removeEventListener("blur",le,!0)}},[_]),$(()=>()=>{var G;N.current!==null&&((G=R.current)==null||G.end(),_())},[_]);const j=W(G=>{var oe;A&&(G.preventDefault(),G.stopPropagation(),(oe=R.current)==null||oe.startDrag(G.clientX,G.clientY),L(G))},[A,L]),E=W(G=>{var oe;G.preventDefault(),G.stopPropagation();const le=N.current;le!==null&&G.pointerId!==le||((oe=R.current)==null||oe.move(G.clientX,G.clientY,G.buttons,G.shiftKey),N.current===G.pointerId&&G.buttons===0&&_(G.pointerId))},[_]),F=W(G=>{var oe;G.preventDefault(),G.stopPropagation();const le=N.current;le!==null&&G.pointerId!==le||((oe=R.current)==null||oe.end(),_(G.pointerId))},[_]),X=W(G=>{var oe;const le=N.current;le!==null&&G.pointerId===le&&((oe=R.current)==null||oe.end(),_(G.pointerId))},[_]),Q=W(G=>({onPointerDown:oe=>{var le;A&&(oe.preventDefault(),oe.stopPropagation(),(le=R.current)==null||le.startResize(G,oe.clientX,oe.clientY),L(oe))},onPointerMove:E,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:X}),[A,E,F,X,L]),J=W(G=>({onPointerDown:oe=>{var le;A&&(oe.preventDefault(),oe.stopPropagation(),(le=R.current)==null||le.startVertexEdit(G,oe.clientX,oe.clientY),L(oe))},onPointerMove:E,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:X}),[A,E,F,X,L]),te=W((G=0,oe)=>({onPointerDown:le=>{var Te;if(!A)return;le.preventDefault(),le.stopPropagation();const De=le.currentTarget.getBoundingClientRect(),Ne=De.left+De.width/2,V=De.top+De.height/2;(Te=R.current)==null||Te.startRotation(Ne,V,G,oe),L(le)},onPointerMove:E,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:X}),[A,E,F,X,L]);return{dragProps:A?{onPointerDown:j,onPointerMove:E,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:X}:{},createResizeProps:Q,createVertexProps:J,createRotationProps:te}})(s),C=Z(()=>(function(S,P={}){const{handleSize:A=8,spacing:D=1,offsetMode:R="outside",includeSides:M=!1,zIndex:N=3,rotationAwareCursor:z=!0}=P,_=(S.pageRotation??0)%4,L=S.annotationRotation??0,j=E=>({[E]:Jb(A,D,R)+"px"});return[["nw",{...j("top"),...j("left")}],["ne",{...j("top"),...j("right")}],["sw",{...j("bottom"),...j("left")}],["se",{...j("bottom"),...j("right")}],...M?[["n",{...j("top"),left:`calc(50% - ${A/2}px)`}],["s",{...j("bottom"),left:`calc(50% - ${A/2}px)`}],["w",{...j("left"),top:`calc(50% - ${A/2}px)`}],["e",{...j("right"),top:`calc(50% - ${A/2}px)`}]]:[]].map(([E,F])=>({handle:E,style:{position:"absolute",width:A+"px",height:A+"px",borderRadius:"50%",zIndex:N,cursor:z?Qb(E,_,L):"default",pointerEvents:"auto",touchAction:"none",...F},attrs:{"data-epdf-handle":E}}))})(s,l).map(S=>{var P;return{key:(P=S.attrs)==null?void 0:P["data-epdf-handle"],style:S.style,...b(S.handle),...S.attrs??{},...p?.(S.handle)??{}}}),[s.element.origin.x,s.element.origin.y,s.element.size.width,s.element.size.height,s.scale,s.pageRotation,s.annotationRotation,s.maintainAspectRatio,l?.handleSize,l?.spacing,l?.offsetMode,l?.includeSides,l?.zIndex,l?.rotationAwareCursor,b,p]),I=Z(()=>u?(function(P,A={},D){const{vertexSize:R=12,zIndex:M=4}=A,N=P.element,z=P.scale??1;return(D??P.vertices??[]).map((_,L)=>({handle:"nw",style:{position:"absolute",left:(_.x-N.origin.x)*z-R/2+"px",to
2287p:(_.y-N.origin.y)*z-R/2+"px",width:R+"px",height:R+"px",borderRadius:"50%",cursor:"pointer",zIndex:M,pointerEvents:"auto",touchAction:"none"},attrs:{"data-epdf-vertex":L}}))})(s,c,s.vertices).map((P,A)=>({key:A,style:P.style,...w(A),...P.attrs??{},...f?.(A)??{}})):[],[u,s.element.origin.x,s.element.origin.y,s.element.size.width,s.element.size.height,s.scale,s.vertices,c?.vertexSize,c?.zIndex,w,f]);return{dragProps:y,resize:C,vertices:I,rotation:Z(()=>{if(!m)return null;const S=(function(P,A={},D=0){const{handleSize:R=16,zIndex:M=5,showConnector:N=!0,connectorWidth:z=1}=A,_=P.scale??1,L=P.element,j=P.rotationElement??L,E=P.rotationCenter??{x:L.origin.x+L.size.width/2,y:L.origin.y+L.size.height/2};j.size.width,j.size.height;const F=(E.x-j.origin.x)*_,X=(E.y-j.origin.y)*_,Q=D*Math.PI/180,J=A.margin??35,te=L.size.height*_/2+J;return{handleStyle:{position:"absolute",left:F+te*Math.sin(Q)-R/2+"px",top:X-te*Math.cos(Q)-R/2+"px",width:R+"px",height:R+"px",borderRadius:"50%",cursor:"grab",zIndex:M,pointerEvents:"auto",touchAction:"none"},connectorStyle:N?{position:"absolute",left:F-z/2+"px",top:X-te+"px",width:z+"px",height:te+"px",transformOrigin:"center bottom",transform:`rotate(${D}deg)`,zIndex:M-1,pointerEvents:"none"}:{},radius:te,attrs:{"data-epdf-rotation-handle":!0}}})(s,d,g);return{handle:{style:S.handleStyle,...x(g,S.radius),...S.attrs??{},...v?.()??{}},connector:{style:S.connectorStyle,"data-epdf-rotation-connector":!0}}},[m,s.element.origin.x,s.element.origin.y,s.element.size.width,s.element.size.height,(t=s.rotationCenter)==null?void 0:t.x,(n=s.rotationCenter)==null?void 0:n.y,(o=s.rotationElement)==null?void 0:o.origin.x,(i=s.rotationElement)==null?void 0:i.origin.y,(r=s.rotationElement)==null?void 0:r.size.width,(a=s.rotationElement)==null?void 0:a.size.height,s.scale,g,d?.handleSize,d?.margin,d?.zIndex,d?.showConnector,d?.connectorWidth,x,v])}}const $r=()=>We(_r.id),gp=()=>At(_r.id);function t0({documentId:e,pageIndex:t,scale:n,rotation:o,background:i="rgba(33,150,243)",selectionMenu:r}){var a,s;const{plugin:l}=gp(),c=pt(e),d=(s=(a=c?.document)==null?void 0:a.pages)==null?void 0:s[t],[u,m]=O([]),[g,p]=O(null),[f,v]=O(null);$(()=>{if(l&&e)return l.registerSelectionOnPage({documentId:e,pageIndex:t,onRectsChange:({rects:x,boundingRect:C})=>{m(x),p(C)}})},[l,e,t]),$(()=>{if(l&&e)return l.onMenuPlacement(e,x=>{v(x)})},[l,e]);const y=Z(()=>n!==void 0?n:c?.scale??1,[n,c?.scale]),b=Z(()=>o!==void 0?o:((d?.rotation??0)+(c?.rotation??0))%4,[o,d?.rotation,c?.rotation]),w=r&&f&&f.pageIndex===t&&f.isVisible;return g?k(de,{children:[k("div",{style:{position:"absolute",left:g.origin.x*y,top:g.origin.y*y,width:g.size.width*y,height:g.size.height*y,mixBlendMode:"multiply",isolation:"isolate",pointerEvents:"none"},children:u.map((x,C)=>k("div",{style:{position:"absolute",left:(x.origin.x-g.origin.x)*y,top:(x.origin.y-g.origin.y)*y,width:x.size.width*y,height:x.size.height*y,background:i}},C))}),w&&k(oi,{rect:{origin:{x:f.rect.origin.x*y,y:f.rect.origin.y*y},size:{width:f.rect.size.width*y,height:f.rect.size.height*y}},rotation:b,children:x=>r({...x,context:{type:"selection",pageIndex:t},selected:!0,placement:f})})]}):null}const n0=({documentId:e,pageIndex:t,scale:n,className:o,background:i,borderColor:r,borderStyle:a="dashed",stroke:s,fill:l})=>{const{plugin:c}=gp(),d=pt(e),[u,m]=O(null),g=r??s??"rgba(0,122,204,0.8)",p=i??l??"rgba(0,122,204,0.15)",f=Z(()=>n!==void 0?n:d?.scale??1,[n,d?.scale]);return $(()=>{if(c&&e)return c.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:f,onRectChange:m})},[c,e,t,f]),u?k("div",{style:{position:"absolute",pointerEvents:"none",left:u.origin.x*f,top:u.origin.y*f,width:u.size.width*f,height:u.size.height*f,border:`1px ${a} ${g}`,background:p,boxSizing:"border-box",zIndex:1e3},className:o}):null};function o0({documentId:e,pageIndex:t,scale:n,rotation:o,background:i,textStyle:r,marqueeStyle:a,marqueeClassName:s,selectionMenu:l}){return k(de,{children:[k(t0,{documentId:e,pageIndex:t,scale:n,rotation:o,background:r?.background??i,selectionMenu:l}),k(n0,{documentId:e,pageIndex:t,scale:n,background:a?.background,borderColor:a?.borderColor,borderStyle:a?.borderStyle,className:s})]})}const i0=Bt(Vb).addUtility(function(){const{provides:e}=$r();return $(()=>{if(e)return e.onCopyToClipboard(({text:t})=>{navigator.clipboard.writeText(t)}
vendor: 8,610 bytes, line 2287
2287)},[e]),null}).build(),fp="tiling",r0={id:fp,name:"Tiling Plugin",version:"1.0.0",provides:["tiling"],requires:["render","scroll","viewport"],optional:[],defaultConfig:{tileSize:768,overlapPx:2.5,extraRings:0}},vp="TILING/INIT_STATE",yp="TILING/CLEANUP_STATE",bp="TILING/UPDATE_VISIBLE_TILES",wp="TILING/MARK_TILE_STATUS",$c=(e,t)=>({type:bp,payload:{documentId:e,tiles:t}}),jc=(e,t,n,o)=>({type:wp,payload:{documentId:e,pageIndex:t,tileId:n,status:o}}),a0={visibleTiles:{}};function Uc({tileSize:e=768,overlapPx:t=2.5,extraRings:n=0,scale:o,rotation:i,page:r,metric:a}){const s=r.size.width*o,l=r.size.height*o,c=e-t,d=(function(I,S,P,A){return Vu(Ps(I,S,(4-P)%4),1/A)})(ar(r.size,i,o),{origin:{x:a.scaled.pageX,y:a.scaled.pageY},size:{width:a.scaled.visibleWidth,height:a.scaled.visibleHeight}},i,1),u=d.origin.x,m=d.origin.y,g=u+d.size.width,p=m+d.size.height,f=Math.floor((s-1)/c),v=Math.floor((l-1)/c),y=Math.max(0,Math.floor(u/c)-n),b=Math.min(f,Math.floor((g-1)/c)+n),w=Math.max(0,Math.floor(m/c)-n),x=Math.min(v,Math.floor((p-1)/c)+n),C=[];for(let I=y;I<=b;I++){const S=I*c,P=Math.min(e,s-S),A=S/o,D=P/o;for(let R=w;R<=x;R++){const M=R*c,N=Math.min(e,l-M),z=M/o,_=N/o;C.push({id:`p${r.index}-${o}-x${S}-y${M}-w${P}-h${N}`,col:I,row:R,pageRect:{origin:{x:A,y:z},size:{width:D,height:_}},screenRect:{origin:{x:S,y:M},size:{width:P,height:N}},status:"queued",srcScale:o,isFallback:!1})}}return C}const xp=class extends $e{constructor(e,t,n){super(e,t),this.tileRendering$=xe(),this.config=n,this.renderCapability=this.registry.getPlugin("render").provides(),this.scrollCapability=this.registry.getPlugin("scroll").provides(),this.viewportCapability=this.registry.getPlugin("viewport").provides(),this.scrollCapability.onScroll(o=>this.calculateVisibleTiles(o.documentId,o.metrics),{mode:"throttle",wait:50,throttleMode:"trailing"}),this.coreStore.onAction(zo,o=>this.recalculateTiles(o.payload))}onDocumentLoadingStarted(e){this.dispatch(((t,n)=>({type:vp,payload:{documentId:t,state:n}}))(e,a0))}onDocumentClosed(e){this.dispatch((t=>({type:yp,payload:t}))(e))}onScaleChanged(e){this.recalculateTilesForDocument(e)}onRotationChanged(e){this.recalculateTilesForDocument(e)}recalculateTilesForDocument(e){const t=this.scrollCapability.forDocument(e),n=this.viewportCapability.forDocument(e),o=t.getMetrics(n.getMetrics());this.calculateVisibleTiles(e,o)}async recalculateTiles(e){const{documentId:t,pageIndexes:n}=e,o=this.getCoreDocument(t);if(!o||!o.document)return;const i=this.scrollCapability.forDocument(t),r=this.viewportCapability.forDocument(t),a=i.getMetrics(r.getMetrics()),s={},l=Date.now(),c=o.scale;for(const d of n){const u=a.pageVisibilityMetrics.find(p=>p.pageNumber===d+1);if(!u)continue;const m=o.document.pages[d];if(!m)continue;const g=((m.rotation??0)+o.rotation)%4;s[d]=Uc({page:m,metric:u,scale:c,rotation:g,tileSize:this.config.tileSize,overlapPx:this.config.overlapPx,extraRings:this.config.extraRings}).map(p=>({...p,id:`${p.id}-r${l}`}))}Object.keys(s).length>0&&this.dispatch($c(t,s))}async initialize(){}calculateVisibleTiles(e,t){const n=this.getCoreDocument(e);if(!n||!n.document)return;const o=n.scale,i={};for(const r of t.pageVisibilityMetrics){const a=r.pageNumber-1,s=n.document.pages[a];if(!s)continue;const l=Uc({page:s,metric:r,scale:o,rotation:((s.rotation??0)+n.rotation)%4,tileSize:this.config.tileSize,overlapPx:this.config.overlapPx,extraRings:this.config.extraRings});i[a]=l}this.dispatch($c(e,i))}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o!==i&&this.tileRendering$.emit({documentId:n,tiles:i.visibleTiles})}}buildCapability(){return{renderTile:this.renderTile.bind(this),forDocument:this.createTilingScope.bind(this),onTileRendering:this.tileRendering$.on}}createTilingScope(e){return{renderTile:t=>this.renderTile(t,e),onTileRendering:t=>this.tileRendering$.on(n=>{n.documentId===e&&t(n.tiles)})}}renderTile(e,t){const n=t??this.getActiveDocumentId();if(!this.renderCapability)throw new Error("Render capability not available.");this.dispatch(jc(n,e.pageIndex,e.tile.id,"rendering"));const o=this.renderCapability.forDocument(n).renderPageRect({pageIndex:e.pageIndex,rect:e.tile.pageRect,options:{scaleFactor:e.tile.srcScale,dpr:e.dpr,...e.imageType||this.config.defaultImageType?{imageType:e.imageType??this.config.defaultImageType}:{}}});return o.wait(()=>{this.dispatch(jc(n,e.pageIndex,e.tile.id,"ready"))},et),o}};xp.id="tiling";let Xs=xp;const s0={manifest:r0,create:(e,t)=>new Xs(fp,e,t),reducer:(e,t)=>((n,o)=>{var i,r;switch(o.type){case vp:{const{documentId:a,state:s}=o.payload;return{...n,documents:{...n.documents,[a]:s}}}case yp:{const a=o.payload,{[a]:s,...l}=n.documents;return{...n,documents:l}}case bp:{const{documentId:a,tiles:s}=o.payload,l=n.documents[a];if(!l)return n;const c={...l.visibleTiles};for(const d in s){const u=Number(d),m=s[u],g=c[u]??[],p=(i=g.find(v=>!v.isFallback))==null?void 0:i.srcScale,f=m.length>0?m[0].srcScale:p;if(p!==void 0&&p!==f){const v=g.filter(b=>!b.isFallback&&b.status==="ready").map(b=>({...b,isFallback:!0})),y=v.length>0?[]:g.filter(b=>b.isFallback);c[u]=[...y,...v,...m]}else{const v=new Set(m.map(w=>w.id)),y=[],b=new Set;for(const w of g)(w.isFallback||v.has(w.id))&&(y.push(w),b.add(w.id));for(const w of m)b.has(w.id)||y.push(w);c[u]=y}}return{...n,documents:{...n.documents,[a]:{...l,visibleTiles:c}}}}case wp:{const{documentId:a,pageIndex:s,tileId:l,status:c}=o.payload,d=n.documents[a];if(!d)return n;const u=((r=d.visibleTiles[s])==null?void 0:r.map(f=>f.id===l?{...f,status:c}:f))??[],m=u.filter(f=>!f.isFallback),g=m.length>0&&m.every(f=>f.status==="ready"),p=g?m:u;return{...n,documents:{...n.documents,[a]:{...d,visibleTiles:{...d.visibleTiles,[s]:p}}}}}default:return n}})(e,t),initialState:{documents:{}}},kp=()=>We(Xs.id);function l0({documentId:e,pageIndex:t,tile:n,dpr:o,scale:i}){const{provides:r}=kp(),a=Z(()=>r?.forDocument(e),[r,e]),[s,l]=O(),c=K(null),d=i/n.srcScale;return $(()=>{if(n.status==="ready"&&c.current||!a)return;const u=a.renderTile({pageIndex:t,tile:n,dpr:o});return u.wait(m=>{const g=URL.createObjectURL(m);c.current=g,l(g)},et),()=>{c.current?(URL.revokeObjectURL(c.current),c.current=null):u.abort({code:H.Cancelled,message:"canceled render task"})}},[a,t,n.id]),s?k("img",{src:s,onLoad:()=>{c.current&&(URL.revokeObjectURL(c.current),c.current=null)},style:{position:"absolute",left:n.screenRect.origin.x*d,top:n.screenRect.origin.y*d,width:n.screenRect.size.width*d,height:n.screenRect.size.height*d,display:"block"}}):null}function c0({documentId:e,pageIndex:t,scale:n,style:o,...i}){const{provides:r}=kp(),a=pt(e),[s,l]=O([]);$(()=>{if(r)return r.onTileRendering(d=>{d.documentId===e&&l(d.tiles[t]??[])})},[r,e,t]);const c=Z(()=>n!==void 0?n:a?.scale??1,[n,a?.scale]);return k("div",{style:{...o},...i,children:s?.map(d=>k(l0,{documentId:e,pageIndex:t,tile:d,dpr:window.devicePixelRatio,scale:c},d.id))})}const Cp="thumbnail",d0={id:Cp,name:"Thumbnail Plugin",version:"1.0.0",provides:["thumbnail"],requires:["render"],optional:["scroll"],defaultConfig:{width:150,gap:10,buffer:3,labelHeight:16,autoScroll:!0,scrollBehavior:"smooth",imagePadding:0,paddingY:0}},Ip="THUMBNAIL/INIT_STATE",Sp="THUMBNAIL/CLEANUP_STATE",Ap="THUMBNAIL/SET_WINDOW_STATE",Pp="THUMBNAIL/UPDATE_VIEWPORT_METRICS";function Bc(e,t){return{type:Ip,payload:{documentId:e,state:t}}}const u0={thumbs:[],window:null,viewportH:0,scrollY:0},Wc={documents:{},activeDocumentId:null},Mp=class extends $e{constructor(e,t,n){var o;super(e,t),this.cfg=n,this.scrollCapability=null,this.taskCaches=new Map,this.canAutoScroll=new Map,this.window$=Ue((i,r)=>({documentId:i,window:r})),this.scrollTo$=Ue((i,r)=>({documentId:i,options:r})),this.refreshPages$=Ue((i,r)=>({documentId:i,pages:r}),{cache:!1}),this.renderCapability=this.registry.getPlugin("render").provides(),this.scrollCapability=((o=this.registry.getPlugin("scroll"))==null?void 0:o.provides())??null,this.coreStore.onAction(zo,i=>{const r=i.payload.documentId??this.getActiveDocumentId(),a=i.payload.pageIndexes;this.refreshPages$.emit(r,a);const s=this.taskCaches.get(r);if(s)for(const l of a)s.delete(l)}),this.scrollCapability&&this.cfg.autoScroll!==!1&&(this.scrollCapability.onPageChangeState(({documentId:i,state:r})=>{this.canAutoScroll.set(i,!r.isChanging),r.isChanging||this.scrollToThumb(r.targetPage-1,i)}),this.scrollCapability.onPageChange(({documentId:i,pageNumber:r})=>{this.canAutoScroll.get(i)!==!1&&this.scrollToThumb(r-1,i)}))}onDocumentLoadingStarted(e){this.dispatch(Bc(e,{...u0})),this.taskCaches.set(e,new Map),this.canAutoScroll.set(e,!0),this.logger.debug("Thumbn
2287ailPlugin","DocumentOpened",`Initialized thumbnail state for document: ${e}`)}onDocumentLoaded(e){this.calculateWindowState(e)}onDocumentClosed(e){this.dispatch((function(n){return{type:Sp,payload:n}})(e));const t=this.taskCaches.get(e);t&&(t.forEach(n=>{n.abort({code:"cancelled",message:"Document closed"})}),t.clear(),this.taskCaches.delete(e)),this.canAutoScroll.delete(e),this.window$.clearScope(e),this.scrollTo$.clearScope(e),this.refreshPages$.clearScope(e),this.logger.debug("ThumbnailPlugin","DocumentClosed",`Cleaned up thumbnail state for document: ${e}`)}onRotationChanged(e){this.calculateWindowState(e)}buildCapability(){return{scrollToThumb:e=>this.scrollToThumb(e),renderThumb:(e,t)=>this.renderThumb(e,t),updateWindow:(e,t)=>this.updateWindow(e,t),getWindow:()=>this.getWindow(),forDocument:e=>this.createThumbnailScope(e),onWindow:this.window$.onGlobal,onScrollTo:this.scrollTo$.onGlobal,onRefreshPages:this.refreshPages$.onGlobal}}createThumbnailScope(e){return{scrollToThumb:t=>this.scrollToThumb(t,e),renderThumb:(t,n)=>this.renderThumb(t,n,e),updateWindow:(t,n)=>this.updateWindow(t,n,e),getWindow:()=>this.getWindow(e),onWindow:this.window$.forScope(e),onScrollTo:this.scrollTo$.forScope(e),onRefreshPages:this.refreshPages$.forScope(e)}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}calculateWindowState(e){const t=this.coreState.core.documents[e];if(!t?.document)return;const n=this.cfg.width??120,o=this.cfg.labelHeight??16,i=this.cfg.gap??8,r=this.cfg.imagePadding??0,a=this.cfg.paddingY??0,s=Math.max(1,n-2*r);let l=a;const c=t.document.pages.map(m=>{const g=m.rotation%2==1,p=g?m.size.height:m.size.width,f=(g?m.size.width:m.size.height)/p,v=Math.round(s*f),y=r+v+r+o,b={pageIndex:m.index,width:s,height:v,wrapperHeight:y,top:l,labelHeight:o,padding:r};return l+=y+i,b}),d={start:-1,end:-1,items:[],totalHeight:l-i+a},u=this.getDocumentState(e);u&&(this.dispatch(Bc(e,{...u,thumbs:c,window:d})),u.viewportH>0?this.updateWindow(u.scrollY,u.viewportH,e):this.window$.emit(e,d))}updateWindow(e,t,n){const o=n??this.getActiveDocumentId(),i=this.getDocumentState(o);if(!i||!i.window||i.thumbs.length===0)return;const r=this.cfg.buffer??3;this.dispatch((function(g,p,f){return{type:Pp,payload:{documentId:g,scrollY:p,viewportH:f}}})(o,e,t));let a=0,s=i.thumbs.length-1,l=0;for(;a<=s;){const g=a+s>>1,p=i.thumbs[g];p.top+p.wrapperHeight<e?a=g+1:(l=g,s=g-1)}let c=l;const d=e+t;for(;c+1<i.thumbs.length&&i.thumbs[c].top<d;)c++;c=Math.min(i.thumbs.length-1,c+r);const u=Math.max(0,l-r);if(u===i.window.start&&c===i.window.end)return;const m={start:u,end:c,items:i.thumbs.slice(u,c+1),totalHeight:i.window.totalHeight};this.dispatch((function(g,p){return{type:Ap,payload:{documentId:g,window:p}}})(o,m)),this.window$.emit(o,m)}getWindow(e){const t=this.getDocumentState(e);return t?.window??null}scrollToThumb(e,t){const n=t??this.getActiveDocumentId(),o=this.getDocumentState(n);if(!o||!o.window)return;const i=o.thumbs[e];if(!i)return;const r=this.cfg.scrollBehavior??"smooth",a=this.cfg.paddingY??0;if(o.viewportH<=0){const u=Math.max(a,i.top-i.wrapperHeight);return void this.scrollTo$.emit(n,{top:u,behavior:r})}const s=i.top,l=i.top+i.wrapperHeight,c=s<o.scrollY+8+a,d=l>o.scrollY+o.viewportH-8;c?this.scrollTo$.emit(n,{top:Math.max(0,s-a),behavior:r}):d&&this.scrollTo$.emit(n,{top:Math.max(0,l-o.viewportH+a),behavior:r})}renderThumb(e,t,n){const o=n??this.getActiveDocumentId(),i=this.taskCaches.get(o);if(!i)throw new Error(`Task cache not found for document: ${o}`);if(i.has(e))return i.get(e);const r=this.coreState.core.documents[o];if(!r?.document)throw new Error(`Document not found: ${o}`);const a=r.document.pages[e];if(!a)throw new Error(`Page ${e} not found in document: ${o}`);const s=this.cfg.width??120,l=this.cfg.imagePadding??0,c=Math.max(1,s-2*l)/a.size.width,d=this.renderCapability.forDocument(o).renderPageRect({pageIndex:e,rect:{origin:{x:0,y:0},size:a.size},options:{scaleFactor:c,dpr:t,rotation:a.rotation}});return i.set(e,d),d.wait(et,()=>i.delete(e)),d}async initialize(){this.logger.info("ThumbnailPlugin","Initialize","Thumbnail plugin initialized")}async destroy(){this.window$.clear(),this.refreshPages$.clear(),this.scrollTo$.clear(),this.taskCaches.forEac
vendor: 4,653 bytes, line 2287
2287h(e=>{e.forEach(t=>{t.abort({code:"cancelled",message:"Plugin destroyed"})}),e.clear()}),this.taskCaches.clear(),this.canAutoScroll.clear(),super.destroy()}};Mp.id="thumbnail";let jr=Mp;const h0={manifest:d0,create:(e,t)=>new jr(Cp,e,t),reducer:(e=Wc,t)=>{switch(t.type){case Ip:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case Sp:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"THUMBNAIL/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Ap:{const{documentId:n,window:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,window:o}}}:e}case Pp:{const{documentId:n,scrollY:o,viewportH:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,scrollY:o,viewportH:i}}}:e}default:return e}},initialState:Wc},Dp=()=>At(jr.id);function m0({documentId:e,style:t,children:n,...o}){const{plugin:i}=Dp(),r=K(null),[a,s]=O({window:null,docId:null}),l=a.docId===e?a.window:null;$(()=>{if(!i)return;const d=i.provides().forDocument(e),u=d.getWindow();u&&s({window:u,docId:e});const m=d.onWindow(g=>{s({window:g,docId:e})});return()=>{m(),s({window:null,docId:null})}},[i,e]),$(()=>{const d=r.current;if(!d||!i)return;const u=i.provides().forDocument(e),m=()=>u.updateWindow(d.scrollTop,d.clientHeight);return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)},[i,e]),$(()=>{const d=r.current;if(!d||!i)return;const u=i.provides().forDocument(e),m=new ResizeObserver(()=>{u.updateWindow(d.scrollTop,d.clientHeight)});return m.observe(d),()=>m.disconnect()},[i,e]),$(()=>{const d=r.current;!d||!i||i.provides().forDocument(e).updateWindow(d.scrollTop,d.clientHeight)},[l,i,e]),$(()=>{const d=r.current;if(!(!d||!i||!l))return i.provides().forDocument(e).onScrollTo(({top:u,behavior:m})=>{d.scrollTo({top:u,behavior:m})})},[i,e,!!l]);const c=i?.cfg.paddingY??0;return k("div",{ref:r,style:{overflowY:"auto",position:"relative",paddingTop:c,paddingBottom:c,height:"100%",...t},...o,children:k("div",{style:{height:l?.totalHeight??0,position:"relative"},children:l?.items.map(d=>n(d))})})}function p0({documentId:e,meta:t,style:n,...o}){const{provides:i}=We(jr.id),{plugin:r}=Dp(),[a,s]=O(),l=K(null),[c,d]=O(0);return $(()=>{if(r)return r.provides().forDocument(e).onRefreshPages(u=>{u.includes(t.pageIndex)&&d(m=>m+1)})},[r,e,t.pageIndex]),$(()=>{const u=i?.forDocument(e),m=u?.renderThumb(t.pageIndex,window.devicePixelRatio);return m?.wait(g=>{const p=URL.createObjectURL(g);l.current=p,s(p)},et),()=>{l.current?(URL.revokeObjectURL(l.current),l.current=null):m?.abort({code:H.Cancelled,message:"canceled render task"})}},[i,e,t.pageIndex,c]),a?k("img",{src:a,onLoad:()=>{l.current&&(URL.revokeObjectURL(l.current),l.current=null)},style:n,...o}):null}const Y="annotation",g0={id:Y,name:"Annotation Plugin",version:"1.0.0",provides:["annotation"],requires:["interaction-manager","selection"],optional:["history","scroll"],defaultConfig:{autoCommit:!0,annotationAuthor:"Guest",deactivateToolAfterCreate:!1,selectAfterCreate:!0,autoOpenLinks:!0}},Tp="ANNOTATION/INIT_STATE",Rp="ANNOTATION/CLEANUP_STATE",Ep="ANNOTATION/SET_ANNOTATIONS",zp="ANNOTATION/SELECT_ANNOTATION",Lp="ANNOTATION/DESELECT_ANNOTATION",Np="ANNOTATION/ADD_TO_SELECTION",Op="ANNOTATION/REMOVE_FROM_SELECTION",Fp="ANNOTATION/SET_SELECTION",_p="ANNOTATION/SET_ACTIVE_TOOL_ID",$p="ANNOTATION/CREATE_ANNOTATION",jp="ANNOTATION/PATCH_ANNOTATION",Up="ANNOTATION/MOVE_ANNOTATION",Bp="ANNOTATION/DELETE_ANNOTATION",Wp="ANNOTATION/COMMIT",Hp="ANNOTATION/PURGE_ANNOTATION",Gp="ANNOTATION/SET_LOCKED",qp="ANNOTATION/SYNC_OBJECT",Kp="ANNOTATION/ADD_COLOR_PRESET",Vp="ANNOTATION/SET_TOOL_DEFAULTS",Xp="ANNOTATION/ADD_TOOL",ma=e=>({type:Lp,payload:{documentId:e}}),pa=(e,t,n)=>({type:Np,payload:{documentId:e,pageIndex:t,id:n}}),Hc=(e,t)=>({type:Op,payload:{documentId:e,id:t}}),ga=(e,t)=>({type:Fp,payload:{documentId:e,ids:t}}),Gc=(e,t,n)=>({type:_p,payload:{documentId:e,toolId:t,context:n}}),_i=(e,t,n)=>({type:$p,payload:{documentId:e,pageIndex:t,annotation:n}}),$i=(e,t,n,o)=>({type:jp,payload:{documentId:e,pageIndex:t,id:n,patch:o}}),qc=(e,t,n,o)=>({type:Up,payload:{documentId:e,pageIndex:t,id:n,patch:o}}),fa=(e,t,n)=>({type:Bp,payload:{documentId:e,pageIndex:t,id:n}}),va=(e,t,n)=>({type:Hp,payload:{documentId:e,pageIndex:t,uid:n}});var Ze=(e=>(e.None="none",e.All="all",e.Include="include",e.Exclude="exclude",e))(Ze||{});function f0(e){return(function(t){return t.object.type===T.HIGHLIGHT})(e)||(function(t){return t.object.type===T.UNDERLINE}
2287)(e)||(function(t){return t.object.type===T.STRIKEOUT})(e)||(function(t){return t.object.type===T.SQUIGGLY})(e)}function Zp(e){return e.object.type===T.TEXT}function pr(e){return Zp(e)&&!e.object.inReplyToId||f0(e)||(function(t){return t.object.type===T.INK})(e)||(function(t){return t.object.type===T.SQUARE})(e)||(function(t){return t.object.type===T.CIRCLE})(e)||(function(t){return t.object.type===T.POLYGON})(e)||(function(t){return t.object.type===T.LINE})(e)||(function(t){return t.object.type===T.POLYLINE})(e)||(function(t){return t.object.type===T.FREETEXT})(e)||(function(t){return t.object.type===T.STAMP})(e)||(function(t){return t.object.type===T.REDACT})(e)||(function(t){return t.object.type===T.CARET})(e)}function v0(e){return pr(e)||(function(t){return t.object.type===T.WIDGET})(e)}function ya(e){return e?.categories??[]}function ji(e,t){switch(t.type){case Ze.None:return!1;case Ze.All:return!0;case Ze.Include:return e.length!==0&&e.some(n=>t.categories.includes(n));case Ze.Exclude:return e.length===0||!e.some(n=>t.categories.includes(n))}}function Kc(e){var t;return((t=e.flags)==null?void 0:t.includes("locked"))??!1}function Yp(e){var t;return((t=e.flags)==null?void 0:t.includes("noView"))??!1}function Qp(e){var t;return((t=e.flags)==null?void 0:t.includes("hidden"))??!1}const qa=(e,t)=>(e.pages[t]??[]).map(n=>e.byUid[n]),ii=e=>e.selectedUids.map(t=>e.byUid[t]).filter(t=>t!==void 0),Ka=e=>e.selectedUids;function Ye(e,t){const n=e.tools.find(o=>o.id===t);return n?.defaults}const y0=(e,t)=>((n,o,i)=>{const r=[];for(const a of Object.values(n.pages))for(const s of a){const l=n.byUid[s];l&&"inReplyToId"in l.object&&l.object.inReplyToId===o&&i.includes(l.object.type)&&r.push(l)}return r})(e,t,[T.LINK]),Jp=(e,t)=>{const n=e.byUid[t];if(n)return n.object.inReplyToId&&n.object.replyType===Ut.Group?n.object.inReplyToId:t},Vc=(e,t)=>{const n=Jp(e,t);if(!n)return[];const o=[],i=e.byUid[n];i&&i.object.type!==T.LINK&&o.push(i);for(const r of Object.values(e.pages))for(const a of r){const s=e.byUid[a];s&&s.object.inReplyToId===n&&s.object.replyType===Ut.Group&&s.object.type!==T.LINK&&o.push(s)}return o},Xc=(e,t)=>{const n=e.byUid[t];if(!n||n.object.type===T.LINK)return!1;if(n.object.inReplyToId&&n.object.replyType===Ut.Group)return!0;for(const o of Object.values(e.pages))for(const i of o){const r=e.byUid[i];if(r&&r.object.inReplyToId===t&&r.object.replyType===Ut.Group&&r.object.type!==T.LINK)return!0}return!1};function Ke(e){let t=e;return[()=>t,n=>{t=n}]}const Va={annotationType:T.INK,create(e){const{onCommit:t,onPreview:n,getTool:o,pageSize:i}=e,[r,a]=Ke([]),[s,l]=Ke(!1),c={current:null},d=g=>({x:ue(g.x,0,i.width),y:ue(g.y,0,i.height)}),u=()=>{const g=o();return g?{...g.defaults,strokeWidth:g.defaults.strokeWidth??1,strokeColor:g.defaults.strokeColor??g.defaults.color??"#000000",opacity:g.defaults.opacity??1,flags:g.defaults.flags??["print"]}:null},m=()=>{const g=r();if(g.length===0||g[0].points.length===0)return null;const p=u();if(!p)return null;const f=g.flatMap(y=>y.points),v=Et(_t(f),p.strokeWidth/2);return{type:T.INK,bounds:v,data:{...p,rect:v,inkList:g,blendMode:p.blendMode}}};return{onPointerDown:(g,p)=>{var f;const v=d(g);l(!0),c.current&&clearTimeout(c.current);const y=[...r(),{points:[v]}];a(y),n(m()),(f=p.setPointerCapture)==null||f.call(p)},onPointerMove:g=>{if(!s())return;const p=r();if(p.length===0)return;const f=d(g);p[p.length-1].points.push(f),a(p),n(m())},onPointerUp:(g,p)=>{var f;l(!1),(f=p.releasePointerCapture)==null||f.call(p);const v=o(),y=v?.behavior;if(y?.smartLineRecognition){const w=y.smartLineThreshold??.15,x=r(),C=x[x.length-1];if(C&&C.points.length>1&&(function(I,S){if(I.length<3)return!0;const P=I[0],A=I[I.length-1],D=Math.hypot(A.x-P.x,A.y-P.y);return D<5?!1:I.reduce((M,N)=>{const z=Math.abs((A.x-P.x)*(P.y-N.y)-(P.x-N.x)*(A.y-P.y))/D;return Math.max(M,z)},0)/D<S})(C.points,w)){const I=C.points[0],S=C.points[C.points.length-1],P=S.x-I.x,A=S.y-I.y,D=Math.atan2(Math.abs(A),Math.abs(P))*(180/Math.PI),R=y.snapAngleDeg??15;if(D<=R){const M=C.points.reduce((N,z)=>N+z.y,0)/C.points.length;C.points=[{x:I.x,y:M},{x:S.x,y:M}]}else if(D>=90-R){const M=C.points.reduce((N,z)=>N+z.x,0)/C.points.length;C.points=[{x:M,y:I.y},{x:M,y:S.y}]}a([...x]),n(m())}}const b=y?.commitDelay??800;c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{const w=r();if(w.length>0&&w[0].points.length>1){const x=u();if(!x)return;const C=w.flatMap(S=>S.points),I=Et(_t(C),x.strokeWidth/2);t({...x,inkList:w,rect:I,type:T.INK,pageIndex:e.pageIndex,id:pe(),created:new Date})}a([]),n(null)},b)},onPointerCancel:(g,p)=>{var f;a([]),l(!1),n(null),c.current&&clearTimeout(c.current),(f=p.releasePointerCapture)==null||f.call(p)}}}};function eg(e){const t=n=>{const o=9*n,i=Math.PI/6;
vendor: 50,502 bytes, line 2287
2287return{x:-o*Math.cos(i),y:o*Math.sin(i)}};return{getSvgPath:n=>{const{x:o,y:i}=t(n);return e?`M 0 0 L ${o} ${i} L ${o} ${-i} Z`:`M ${o} ${i} L 0 0 L ${o} ${-i}`},getLocalPoints:n=>{const{x:o,y:i}=t(n);return[{x:0,y:0},{x:o,y:i},{x:o,y:-i}]},getRotation:n=>n,filled:e}}function Zc(e,t){const n=o=>o*e/2;return{getSvgPath:o=>{const i=n(o);return`M ${-i} 0 L ${i} 0`},getLocalPoints:o=>{const i=n(o);return[{x:-i,y:0},{x:i,y:0}]},getRotation:t,filled:!1}}const Yc=eg(!1),Qc=eg(!0),gr={[ge.OpenArrow]:Yc,[ge.ClosedArrow]:Qc,[ge.ROpenArrow]:{...Yc,getRotation:e=>e+Math.PI},[ge.RClosedArrow]:{...Qc,getRotation:e=>e+Math.PI},[ge.Circle]:{getSvgPath:e=>{const t=5*e/2;return`M ${t} 0 A ${t} ${t} 0 1 1 ${-t} 0 A ${t} ${t} 0 1 1 ${t} 0`},getLocalPoints:e=>{const t=5*e/2;return[{x:-t,y:-t},{x:t,y:t}]},getRotation:()=>0,filled:!0},[ge.Square]:{getSvgPath:e=>{const t=6*e/2;return`M ${-t} ${-t} L ${t} ${-t} L ${t} ${t} L ${-t} ${t} Z`},getLocalPoints:e=>{const t=6*e/2;return[{x:-t,y:-t},{x:t,y:-t},{x:t,y:t},{x:-t,y:t}]},getRotation:e=>e,filled:!0},[ge.Diamond]:{getSvgPath:e=>{const t=6*e/2;return`M 0 ${-t} L ${t} 0 L 0 ${t} L ${-t} 0 Z`},getLocalPoints:e=>{const t=6*e/2;return[{x:0,y:-t},{x:t,y:0},{x:0,y:t},{x:-t,y:0}]},getRotation:e=>e,filled:!0},[ge.Butt]:Zc(6,e=>e+Math.PI/2),[ge.Slash]:Zc(18,e=>e+Math.PI/1.5)};function $t(e,t,n){if(!e||e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};const o=[...e],i=(a,s)=>Math.atan2(s.y-a.y,s.x-a.x),r=(a,s,l)=>{if(!a)return;const c=gr[a];if(!c)return;const d=c.getLocalPoints(t),u=c.getRotation(l),m=d.map(g=>Ku(g,u,s));o.push(...m)};if(e.length>=2){const a=i(e[1],e[0]);r(n?.start,e[0],a);const s=e.length-1,l=i(e[s-1],e[s]);r(n?.end,e[s],l)}if(o.length<=1){const a=e[0]||{x:0,y:0},s=t;return{origin:{x:a.x-s,y:a.y-s},size:{width:2*s,height:2*s}}}return Et(_t(o),t/2+1.2*t)}function Ur(e,t){if(!e.unrotatedRect)return{rect:t};const n=Jn(t);return{rect:On(t,e.rotation??0,n),unrotatedRect:t}}function Fn(e){return e.unrotatedRect?Zu(e.unrotatedRect,e.rect,e.rotation??0):Jn(e.rect)}function Zs(e,t,n){const o=Fn(e),i=e.unrotatedRect??e.rect,r=t.origin.x-i.origin.x,a=t.origin.y-i.origin.y;return{rect:On(t,n,{x:o.x+r,y:o.y+a}),unrotatedRect:t}}function Br(e,t,n){if(!e.unrotatedRect)return t;const o=e.rotation??0;if(Math.abs(o%360)<1e-8)return t;const i=Fn(e),r=Jn(n),a=o*Math.PI/180,s=Math.cos(a),l=Math.sin(a),c=i.x-r.x,d=i.y-r.y,u=(1-s)*c+l*d,m=-l*c+(1-s)*d;return Math.abs(u)<1e-8&&Math.abs(m)<1e-8?t:t.map(g=>({x:g.x+u,y:g.y+m}))}function Ys(e,t){return t?{origin:{x:e.origin.x+t.left,y:e.origin.y+t.top},size:{width:Math.max(0,e.size.width-t.left-t.right),height:Math.max(0,e.size.height-t.top-t.bottom)}}:e}function ri(e,t){return{left:t.origin.x-e.origin.x,top:t.origin.y-e.origin.y,right:e.origin.x+e.size.width-(t.origin.x+t.size.width),bottom:e.origin.y+e.size.height-(t.origin.y+t.size.height)}}function ai(e,t){const n=t.origin.x+t.size.width/2,o=t.origin.y+t.size.height/2,i=e.x-n,r=e.y-o;return Math.abs(i)>=Math.abs(r)?i>0?{x:t.origin.x+t.size.width,y:o}:{x:t.origin.x,y:o}:r>0?{x:n,y:t.origin.y+t.size.height}:{x:n,y:t.origin.y}}function Po(e,t,n,o){const i=[...t];if(n&&t.length>=2){const m=gr[n];if(m){const g=Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x),p=m.getLocalPoints(o),f=m.getRotation(g+Math.PI),v=p.map(y=>Ku(y,f,t[0]));i.push(...v)}}const r=Et(_t(i),o),a=e.origin.x+e.size.width,s=e.origin.y+e.size.height,l=r.origin.x+r.size.width,c=r.origin.y+r.size.height,d=Math.min(e.origin.x,r.origin.x),u=Math.min(e.origin.y,r.origin.y);return{origin:{x:d,y:u},size:{width:Math.max(a,l)-d,height:Math.max(s,c)-u}}}const b0={extractVertices:e=>{const t=Ys(e.rect,e.rectangleDifferences),n=e.calloutLine;return!n||n.length<3?[{x:e.rect.origin.x,y:e.rect.origin.y},{x:e.rect.origin.x,y:e.rect.origin.y},{x:t.origin.x,y:t.origin.y},{x:t.origin.x+t.size.width,y:t.origin.y+t.size.height}]:[n[0],n[1],{x:t.origin.x,y:t.origin.y},{x:t.origin.x+t.size.width,y:t.origin.y+t.size.height}]},transformAnnotation:(e,t)=>{if(t.length<4)return{};const[n,o,i,r]=t,a={origin:{x:Math.min(i.x,r.x),y:Math.min(i.y,r.y)},size:{width:Math.abs(r.x-i.x),height:Math.abs(r.y-i.y)}},s=[n,o,ai(o,a)],l=Po(a,s,e.lineEnding,e.strokeWidth??1);return{calloutLine:s,rect:l,rectangleDifferences:ri(l,a)}}};class tg{constructor(){this.patches=new Map}register(t,n){this.patches.set(t,n)}transform(t,n){const o=this.patches.get(t.type);return o?o(t,n):n.changes}}const w0=new tg;function In(e,t){var n;if(((n=t.metadata)==null?void 0:n.rotationAngle)===void 0)return null;const o=t.metadata.rotationAngle,i=t.changes.unrotatedRect??e.unrotatedRect??e.rect;return{...Zs(e,{origin:{...i.origin},size:{...i.size}},o),rotation:o}}function yi(e,t){return{rotation:t,...Zs(e,e.unrotatedRect??e.rect,t)}}function Sn(e,t){const n=t.origin.x-e.rect.origin.x,o=t.origin.y-e.rect.origin.y,i={rect:t};return e.unrotatedRect&&(i.unrotatedRect={origin:{x:e.unrotatedRect.origin.x+n,y:e.unrotatedRect.origin.y+o},size:{...e.unrotatedRect.size}}),{dx:n,dy:o,rects:i}}function _n(e,t,n){const o=e.unrotatedRect??e.rect;let i=t.size.width/o.size.width,r=t.size.height/o.size.height;if((t.size.width<10||t.size.height<10)&&(i=Math.max(i,10/o.size.width),r=Math.max(r,10/o.size.height),t={origin:t.origin,size:{width:o.size.width*i,height:o.size.height*r}}),n?.maintainAspectRatio){const a=Math.min(i,r);i=a,r=a,t={origin:t.origin,size:{width:o.size.width*a,height:o.size.height*a}}}return{scaleX:i,scaleY:r,oldRect:o,resolvedRect:t,rects:e.unrotatedRect?{unrotatedRect:t,rect:Ds(t,e.rotation??0)}:{rect:t}}}function bi(e,t){const n=e.unrotatedRect??e.rect,o=t.unrotatedRect??n;return{dx:o.origin.x-n.origin.x,dy:o.origin.y-n.origin.y}}function Mo(e,t,n){if(t===0||e.rotation!==void 0)return e;const o=(4-t)%4*90;let i=e;if(n&&(t===1||t===3)){const l=e.rect,c=l.origin.x+l.size.width/2,d=l.origin.y+l.size.height/2;i={...e,rect:{origin:{x:c-l.size.height/2,y:d-l.size.width/2},size:{width:l.size.height,height:l.size.width}}}}const{rotation:r,rect:a,unrotatedRect:s}=yi(i,o);return{...i,rotation:r,rect:a,unrotatedRect:s}}function ao(e,t){const n=ue(e.rect.origin.x,0,t.width-e.rect.size.width),o=ue(e.rect.origin.y,0,t.height-e.rect.size.height),i=n-e.rect.origin.x,r=o-e.rect.origin.y;return i===0&&r===0?e:{...e,rect:{origin:{x:n,y:o},size:e.rect.size},...e.unrotatedRect?{unrotatedRect:{origin:{x:e.unrotatedRect.origin.x+i,y:e.unrotatedRect.origin.y+r},size:e.unrotatedRect.size}}:{}}}const Xa=(e,t)=>{switch(t.type){case"vertex-edit":default:return t.changes;case"move":{if(!t.changes.rect)return t.changes;const{dx:n,dy:o,rects:i}=Sn(e,t.changes.rect);return{...i,inkList:e.inkList.map(r=>({points:r.points.map(a=>({x:a.x+n,y:a.y+o}))}))}}case"resize":{if(!t.changes.rect)return t.changes;const{scaleX:n,scaleY:o,oldRect:i,resolvedRect:r,rects:a}=_n(e,t.changes.rect,t.metadata),s=(x,C)=>({origin:{x:x.origin.x+C,y:x.origin.y+C},size:{width:Math.max(1,x.size.width-2*C),height:Math.max(1,x.size.height-2*C)}}),l=.001,c=Math.abs(n-1)>l,d=Math.abs(o-1)>l,u=c&&!d?n:!c&&d?o:Math.min(n,o),m=Math.max(1,e.strokeWidth*u),g=Math.max(1,Math.min(r.size.width,r.size.height)),p=Math.min(m,g),f=Number(p.toFixed(1)),v=s(i,e.strokeWidth/2),y=s(r,f/2),b=y.size.width/Math.max(v.size.width,1e-6),w=y.size.height/Math.max(v.size.height,1e-6);return{...a,inkList:e.inkList.map(x=>({points:x.points.map(C=>({x:y.origin.x+(C.x-v.origin.x)*b,y:y.origin.y+(C.y-v.origin.y)*w}))})),strokeWidth:f}}case"rotate":{const n=In(e,t);if(!n)return t.changes;const{dx:o,dy:i}=bi(e,n);return{...n,inkList:e.inkList.map(r=>({points:r.points.map(a=>({x:a.x+o,y:a.y+i}))}))}}case"property-update":{if(!(t.changes.strokeWidth!==void 0||t.changes.rotation!==void 0))return t.changes;const n={...e,...t.changes},o=n.inkList.flatMap(a=>a.points),i=Et(_t(o),n.strokeWidth/2),r=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:i,rect:On(i,r,Fn(e))}:{...t.changes,rect:i}}}},Za=(e,t)=>{switch(t.type){case"vertex-edit":if(t.changes.linePoints){const{start:n,end:o}=t.changes.linePoints,i=[n,o],r=Br(e,i,$t(i,e.strokeWidth,e.lineEndings));return{...Ur(e,$t(r,e.strokeWidth,e.lineEndings)),linePoints:{start:r[0],end:r[1]}}}return t.changes;case"move":{if(!t.changes.rect)return t.changes;const{dx:n,dy:o,rects:i}=Sn(e,t.changes.rect);return{...i,linePoints:{start:{x:e.linePoints.start.x+n,y:e.linePoints.start.y+o},end:{x:e.linePoints.end.x+n,y:e.linePoints.end.y+o}}}}case"resize":{if(!t.changes.rect)return t.changes;const{scaleX:n,scaleY:o,oldRect:i,resolvedRect:r,rects:a}=_n(e,t.changes.rect,t.metadata);return{...a,linePoints:{start:{x:r.origin.x+(e.linePoints.start.x-i.origin.x)*n,y:r.origin.y+(e.linePoints.start.y-i.origin.y)*o},end:{x:r.origin.x+(e.linePoints.end.x-i.origin.x)*n,y:r.origin.y+(e.linePoints.end.y-i.origin.y)*o}}}}case"rotate":{const n=In(e,t);if(!n)return t.changes;const{dx:o,dy:i}=bi(e,n);return{...n,linePoints:{start:{x:e.linePoints.start.x+o,y:e.linePoints.start.y+i},end:{x:e.linePoints.end.x+o,y:e.linePoints.end.y+i}}}}case"property-update":{if(!(t.changes.strokeWidth!==void 0||t.changes.lineEndings!==void 0||t.changes.rotation!==void 0))return t.changes;const n={...e,...t.changes},o=$t([n.linePoints.start,n.linePoints.end],n.strokeWidth,n.lineEndings),i=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:o,rect:On(o,i,Fn(e))}:{...t.changes,rect:o}}default:return t.changes}},ng=(e,t)=>{switch(t.type){case"vertex-edit":if(t.changes.vertices&&t.changes.vertices.length){const n=t.changes.vertices,o=Br(e,n,$t(n,e.strokeWidth,e.lineEndings));return{...Ur(e,$t(o,e.strokeWidth,e.lineEndings)),vertices:o}}return t.changes;case"move":{if(!t.changes.rect)return t.changes;const{dx:n,dy:o,rects:i}=Sn(e,t.changes.rect);return{...i,vertices:e.vertices.map(r=>({x:r.x+n,y:r.y+o}))}}case"resize":{if(!t.changes.rect)return t.changes;const{scaleX:n,scaleY:o,oldRect:i,resolvedRect:r,rects:a}=_n(e,t.changes.rect,t.metadata);return{...a,vertices:e.vertices.map(s=>({x:r.origin.x+(s.x-i.origin.x)*n,y:r.origin.y+(s.y-i.origin.y)*o}))}}case"rotate":{const n=In(e,t);if(!n)return t.changes;const{dx:o,dy:i}=bi(e,n);return{...n,vertices:e.vertices.map(r=>({x:r.x+o,y:r.y+i}))}}case"property-update":{if(!(t.changes.strokeWidth!==void 0||t.changes.lineEndings!==void 0||t.changes.rotation!==void 0))return t.changes;const n={...e,...t.changes},o=$t(n.vertices,n.strokeWidth,n.lineEndings),i=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...t.changes,unrotatedRect:o,rect:On(o,i,Fn(e))}:{...t.changes,rect:o}}default:return t.changes}};function Jc(e,t,n,o){const i=o*Math.PI/180,r=Math.abs(Math.cos(i)),a=Math.abs(Math.sin(i)),s=r*r-a*a,l=e.size.width,c=e.size.height;let d,u;if(Math.abs(s)>1e-6)d=(r*l-a*c)/s,u=(r*c-a*l)/s,d=Math.max(d,1),u=Math.max(u,1);else{const m=t.size.width*t.size.height,g=l*c,p=m>0?Math.sqrt(g/m):1;d=n.size.width*p,u=n.size.height*p}return{origin:{x:e.origin.x+l/2-d/2,y:e.origin.y+c/2-u/2},size:{width:d,height:u}}}const Do=Math.PI,si=Math.PI/2,wn=34*Math.PI/180,ed=30*Math.PI/180,Ya=12*Math.PI/180;class Qs{constructor(){this.parts=[],this.bbox={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},this.started=!1}moveTo(t,n){const o=-n;this.updateBBox(t,o),this.parts.push(`M ${Mn(t)} ${Mn(o)}`),this.started=!0}curveTo(t,n,o,i,r,a){const s=-n,l=-i,c=-a;this.updateBBox(t,s),this.updateBBox(o,l),this.updateBBox(r,c),this.parts.push(`C ${Mn(t)} ${Mn(s)}, ${Mn(o)} ${Mn(l)}, ${Mn(r)} ${Mn(c)}`)}close(){this.started&&this.parts.push("Z")}build(t){const n=t>0?t/2:0;return{path:this.parts.join(" "),bbox:{minX:this.bbox.minX-n,minY:this.bbox.minY-n,maxX:this.bbox.maxX+n,maxY:this.bbox.maxY+n}}}updateBBox(t,n){t<this.bbox.minX&&(this.bbox.minX=t),n<this.bbox.minY&&(this.bbox.minY=n),t>this.bbox.maxX&&(this.bbox.maxX=t),n>this.bbox.maxY&&(this.bbox.maxY=n)}}function Mn(e){return Number(e.toFixed(4)).toString()}function li(e,t){const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function og(e,t){return t===0?0:e/t}function ig(e,t){return t===0?0:e/t}function xo(e,t,n,o,i,r,a,s){const l=Math.cos(e),c=Math.sin(e),d=Math.cos(t),u=Math.sin(t),m=Math.sin((t-e)/2);if(m===0)return void(s&&a.moveTo(n+i*l,o+r*c));const g=4/3*(1-Math.cos((t-e)/2))/m,p=n+i*(l-g*c),f=o+r*(c+g*l),v=n+i*(d+g*u),y=o+r*(u-g*d),b=n+i*d,w=o+r*u;s&&a.moveTo(n+i*l,o+r*c),a.curveTo(p,f,v,y,b,w)}function ba(e,t,n,o,i,r){const a=Math.cos(e),s=Math.sin(e),l=Math.cos(t),c=Math.sin(t),d=Math.sin((t-e)/2);if(d===0)return[];const u=4/3*(1-Math.cos((t-e)/2))/d;return[{x:n+i*(a-u*s),y:o+r*(s+u*a)},{x:n+i*(l+u*c),y:o+r*(c-u*l)},{x:n+i*l,y:o+r*c}]}function Qo(e,t,n,o,i,r,a,s){const l=si;let c=t-e;for(;c<0;)c+=2*Math.PI;const d=c;let u=0;for(s&&a.moveTo(i+n*Math.cos(e),r+o*Math.sin(e));c>l;)xo(e+u,e+u+l,i,r,n,o,a,!1),u+=l,c-=l;c>0&&xo(e+u,e+d,i,r,n,o,a,!1)}function rg(e,t,n,o,i,r,a,s,l){let c=e+Do+a;const d=e+Do+a-22*Math.PI/180;xo(c,d,o,i,n,n,s,l),c=d,Qo(c,t-r,n,n,o,i,s,!1)}function x0(e,t,n,o,i,r){const a=e+Do;xo(a+n,a+n-ed,o,i,t,t,r,!1),xo(a+n-ed,a+si,o,i,t,t,r,!1),xo(a+si,a+Do-wn,o,i,t,t,r,!1)}function k0(e,t){const n=[],o=e+Do;return n.push(...ba(o+wn,o+Ya,0,0,t,t)),n.push(...ba(o+Ya,o+si,0,0,t,t)),n.push(...ba(o+si,o+Do-wn,0,0,t,t)),n}function C0(e,t,n,o){for(let i=0;i+2<e.length;i+=3){const r=e[i],a=e[i+1],s=e[i+2];o.curveTo(r.x+t,r.y+n,a.x+t,a.y+n,s.x+t,s.y+n)}}function I0(e,t,n){if(n===0)return{n:-1,adjustedRadius:e};const o=n-2*t*e;if(o<=0)return{n:0,adjustedRadius:e};const i=2*t*e,r=Math.max(1,Math.ceil(o/i));return{n:r,adjustedRadius:o/(2*r*t)}}function Js(e,t,n,o,i){let r=(function(g){if(g.length<=2)return g;const p=[g[0]];for(let f=1;f<g.length;f++){const v=p[p.length-1],y=g[f];(Math.abs(y.x-v.x)>=.5||Math.abs(y.y-v.y)>=.5)&&p.push(y)}return p})(e);var a;(function(g){let p=0;const f=g.length;for(let v=0;v<f;v++){const y=(v+1)%f;p+=g[v].x*g[y].y-g[v].y*g[y].x}return p})(a=r)<0&&a.reverse();const s=r.length;if(s<2)return;if(n<=0){i.moveTo(r[0].x,r[0].y);for(let g=1;g<s;g++)i.curveTo(r[g].x,r[g].y,r[g].x,r[g].y,r[g].x,r[g].y);return}let l=t?el(n,o):ag(n,o);l<.5&&(l=.5);const c=Math.cos(wn),d=[];for(let g=0;g+1<s;g++){const p=li(r[g],r[g+1]);p<=0||p>=2*c*l?d.push(wn):d.push(Math.acos(Math.min(1,p/(2*l))))}let u=0,m=!1;for(let g=0;g+1<s;g++){const p=r[g],f=r[g+1],v=li(p,f);if(v===0)continue;const y=I0(l,c,v);if(y.n<0){m||(i.moveTo(p.x,p.y),m=!0);continue}const b=Math.max(.5,y.adjustedRadius),w=2*c*b,x=c*l+c*b;let C=Math.atan2(f.y-p.y,f.x-p.x);if(g===0){const M=r[s-2];u=Math.atan2(p.y-M.y,p.x-M.x)}const I=og(f.x-p.x,v),S=ig(f.y-p.y,v);let P=p.x,A=p.y;const D=d[g],R=d[g===0?s-2:g-1]??wn;if(rg(u,C,l,p.x,p.y,D,R,i,!m),m=!0,y.n===0)P+=v*I,A+=v*S;else{P+=x*I,A+=x*S;let M=y.n;y.n>=1&&(x0(C,b,wn,P,A,i),P+=w*I,A+=w*S,M=y.n-1);const N=k0(C,b);for(let z=0;z<M;z++)C0(N,P,A,i),P+=w*I,A+=w*S}u=C}}function el(e,t){return 4.75*e+.5*t}function ag(e,t){return 4*e+.5*t}function S0(e,t,n,o,i,r,a){if(i<=0){const M=Math.abs(n-e)/2,N=Math.abs(o-t)/2,z=(e+n)/2,_=(t+o)/2;return void Qo(0,2*Math.PI,M,N,z,_,a,!0)}const s=n-e,l=o-t;let c=el(i,r);const d=.5*c;if(s<d&&l<d){const M=Math.abs(n-e)/2,N=Math.abs(o-t)/2,z=(e+n)/2,_=(t+o)/2;return void Qo(0,2*Math.PI,M,N,z,_,a,!0)}if(s<5&&l>20||s>20&&l<5)return void Js([{x:e,y:t},{x:n,y:t},{x:n,y:o},{x:e,y:o},{x:e,y:t}],!0,i,r,a);const u=Math.sin(Ya)*c-1.5;let m=e,g=n,p=t,f=o;if(s>2*u)m+=u,g-=u;else{const M=(e+n)/2;m=M-.1,g=M+.1}if(l>2*u)p+=u,f-=u;else{const M=(o+t)/2;f=M+.1,p=M-.1}const v=(function(M,N,z,_){const L=(M+z)/2,j=(N+_)/2,E=(z-M)/2,F=(_-N)/2;if(E<=0||F<=0)return[];const X=Math.max(32,Math.ceil(2*Math.max(E,F))),Q=[];for(let J=0;J<=X;J++){const te=2*Math.PI*J/X;Q.push({x:L+E*Math.cos(te),y:j+F*Math.sin(te)})}return Q})(m,p,g,f),y=v.length;if(y<2)return;let b=0;for(let M=1;M<y;M++)b+=li(v[M-1],v[M]);const w=Math.cos(wn);let x=2*w*c,C=Math.ceil(b/x);if(C<2){const M=Math.abs(n-e)/2,N=Math.abs(o-t)/2,z=(e+n)/2,_=(t+o)/2;return void Qo(0,2*Math.PI,M,N,z,_,a,!0)}if(x=b/C,c=x/(2*w),c<.5)c=.5,x=2*w*c;else if(c<3){const M=Math.abs(n-e)/2,N=Math.abs(o-t)/2,z=(e+n)/2,_=(t+o)/2;return void Qo(0,2*Math.PI,M,N,z,_,a,!0)}const I=[];let S=0;const P=.1*r;for(let M=0;M+1<y;M++){const N=v[M],z=v[M+1],_=z.x-N.x,L=z.y-N.y,j=li(N,z);if(j===0)continue;let E=j+S;if(E>=x-P||M===y-2){const F=og(_,j),X=ig(L,j);let Q=x-S;for(;E>=x-P;)I.push({x:N.x+Q*F,y:N.y+Q*X}),E-=x,Q+=x;S=Math.max(0,E)}else S+=j}const A=I.length;let D=0,R=0;for(let M=0;M<A;M++){const N=(M+1)%A,z=I[M],_=I[N];if(M===0){const E=I[A-1];D=Math.atan2(z.y-E.y,z.x-E.x),R=td(E,z,c,x)}const L=Math.atan2(_.y-z.y,_.x-z.x),j=td(z,_,c,x);rg(D,L,c,z.x,z.y,j,R,a,M===0),D=L,R=j}}function td(e,t,n,o){const i=li(e,t);if(i===0)return wn;const r=(o/2+(i-o)/2)/n;return r<-1||r>1?0:Math.acos(r)}function jt(e,t,n){return(n?el(e,t):ag(e,t))+t/2}function nd(e,t){return(e??0)>0?jt(e,t,!1):t/2}const sg=(e,t)=>{switch(t.type){case"vertex-edit":if(t.changes.vertices&&t.changes.vertices.length){const n=nd(e.cloudyBorderIntensity,e.strokeWidth),o=t.changes.vertices,i=Br(e,o,Et(_t(o),n));return{...Ur(e,Et(_t(i),n)),vertices:i}}return t.changes;case"move":{if(!t.changes.rect)return t.changes;const{dx:n,dy:o,rects:i}=Sn(e,t.changes.rect);return{...i,vertices:e.vertices.map(r=>({x:r.x+n,y:r.y+o}))}}case"resize":{if(!t.changes.rect)return t.changes;const{scaleX:n,scaleY:o,oldRect:i,resolvedRect:r,rects:a}=_n(e,t.changes.rect,t.metadata);return{...a,vertices:e.vertices.map(s=>({x:r.origin.x+(s.x-i.origin.x)*n,y:r.origin.y+(s.y-i.origin.y)*o}))}}case"rotate":{const n=In(e,t);if(!n)return t.changes;const{dx:o,dy:i}=bi(e,n);return{...n,vertices:e.vertices.map(r=>({x:r.x+o,y:r.y+i}))}}case"property-update":{const n=t.changes.cloudyBorderIntensity!==void 0;if(!(t.changes.strokeWidth!==void 0||t.changes.rotation!==void 0||n))return t.changes;const o={...e,...t.changes},i=nd(o.cloudyBorderIntensity,o.strokeWidth),r=Et(_t(o.vertices),i);let a=t.changes;const s=(e.cloudyBorderIntensity??0)>0;if(n||t.changes.strokeWidth!==void 0&&s){const c=o.cloudyBorderIntensity??0;if(c>0){const d=jt(c,o.strokeWidth,!1);a={...a,rectangleDifferences:{left:d,top:d,right:d,bottom:d}}}else a={...a,rectangleDifferences:void 0}}const l=t.changes.rotation??e.rotation??0;return e.unrotatedRect||t.changes.rotation!==void 0?{...a,unrotatedRect:r,rect:On(r,l,Fn(e))}:{...a,rect:r}}default:return t.changes}},lg=(e,t)=>{switch(t.type){case"move":return t.changes.rect?Sn(e,t.changes.rect).rects:t.changes;case"resize":return t.changes.rect?_n(e,t.changes.rect,t.metadata).rects:t.changes;case"rotate":return In(e,t)??t.changes;case"property-update":{let n=t.changes;const o=t.changes.cloudyBorderIntensity!==void 0,i=t.changes.strokeWidth!==void 0,r=(e.cloudyBorderIntensity??0)>0;if(o||i&&r){const a={...e,...t.changes},s=a.cloudyBorderIntensity??0;if(s>0){const l=jt(s,a.strokeWidth,!0);n={...n,rectangleDifferences:{left:l,top:l,right:l,bottom:l}}}else n={...n,rectangleDifferences:void 0}}return t.changes.rotation!==void 0&&(n={...n,...yi(e,t.changes.rotation)}),n}default:return t.changes}},cg=(e,t)=>{switch(t.type){case"move":return t.changes.rect?Sn(e,t.changes.rect).rects:t.changes;case"resize":return t.changes.rect?_n(e,t.changes.rect,t.metadata).rects:t.changes;case"rotate":return In(e,t)??t.changes;case"property-update":{let n=t.changes;const o=t.changes.cloudyBorderIntensity!==void 0,i=t.changes.strokeWidth!==void 0,r=(e.cloudyBorderIntensity??0)>0;if(o||i&&r){const a={...e,...t.changes},s=a.cloudyBorderIntensity??0;if(s>0){const l=jt(s,a.strokeWidth,!1);n={...n,rectangleDifferences:{left:l,top:l,right:l,bottom:l}}}else n={...n,rectangleDifferences:void 0}}return t.changes.rotation!==void 0&&(n={...n,...yi(e,t.changes.rotation)}),n}default:return t.changes}},dg=(e,t)=>{switch(t.type){case"move":return t.changes.rect?Sn(e,t.changes.rect).rects:t.changes;case"resize":return t.changes.rect?_n(e,t.changes.rect,t.metadata).rects:t.changes;case"rotate":return In(e,t)??t.changes;case"property-update":return t.changes.rotation!==void 0?{...t.changes,...yi(e,t.changes.rotation)}:t.changes;default:return t.changes}},ug=(e,t)=>{var n,o;switch(t.type){case"vertex-edit":{if(!t.changes.calloutLine)return t.changes;const i=t.changes.calloutLine;return i.length<4?t.changes:(function(r,a,s,l,c){const d={origin:{x:Math.min(l.x,c.x),y:Math.min(l.y,c.y)},size:{width:Math.abs(c.x-l.x),height:Math.abs(c.y-l.y)}},u=[a,s,ai(s,d)],m=Po(d,u,r.lineEnding,r.strokeWidth??1);return{calloutLine:u,rect:m,rectangleDifferences:ri(m,d)}})(e,i[0],i[1],i[2],i[3])}case"move":{if(!t.changes.rect)return t.changes;const{dx:i,dy:r,rects:a}=Sn(e,t.changes.rect),s=(n=e.calloutLine)==null?void 0:n.map(l=>({x:l.x+i,y:l.y+r}));return{...a,...s&&{calloutLine:s}}}case"rotate":{const i=In(e,t);if(!i)return t.changes;const{dx:r,dy:a}=bi(e,i),s=(o=e.calloutLine)==null?void 0:o.map(l=>({x:l.x+r,y:l.y+a}));return{...i,...s&&{calloutLine:s}}}case"property-update":if(t.changes.lineEnding!==void 0||t.changes.strokeWidth!==void 0){const i={...e,...t.changes};if(i.calloutLine&&i.calloutLine.length>=3){const r=Ys(e.rect,e.rectangleDifferences),a=Po(r,i.calloutLine,i.lineEnding,i.strokeWidth??1);return{...t.changes,rect:a,rectangleDifferences:ri(a,r)}}}return t.changes;default:return t.changes}},hg=(e,t)=>{switch(t.type){case"move":return t.changes.rect?Sn(e,t.changes.rect).rects:t.changes;case"resize":return t.changes.rect?_n(e,t.changes.rect,t.metadata).rects:t.changes;case"rotate":return In(e,t)??t.changes;case"property-update":return t.changes.rotation!==void 0?{...t.changes,...yi(e,t.changes.rotation)}:t.changes;default:return t.changes}},kn=Object.freeze(Object.defineProperty({__proto__:null,LINE_ENDING_HANDLERS:gr,PatchRegistry:tg,applyInsertUpright:Mo,calculateAABBFromVertices:function(e,t=0){if(e.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};const n=_t(e);return t>0?Et(n,t):n},calculateRotatedRectAABB:Ds,calculateRotatedRectAABBAroundPoint:On,calloutVertexConfig:b0,clampAnnotationToPage:ao,compensateRotatedVertexEdit:Br,computeCalloutConnectionPoint:ai,computeCalloutOverallRect:Po,computeRDFromTextBox:ri,computeTextBoxFromRD:Ys,createEnding:function(e,t,n,o,i){if(!e)return null;const r=gr[e];if(!r)return null;const a=r.getRotation(n);return{d:r.getSvgPath(t),transform:`translate(${o} ${i}) rotate(${s=a,180*s/Math.PI})`,filled:r.filled};var s},getRectCenter:Jn,lineRectWithEndings:$t,patchCalloutFreeText:ug,patchCircle:lg,patchFreeText:dg,patchInk:Xa,patchLine:Za,patchPolygon:sg,patchPolyline:ng,patchRegistry:w0,patchSquare:cg,patchStamp:hg,resolveAnnotationRotationCenter:Fn,resolveRotateRects:Zs,resolveVertexEditRects:Ur,rotatePointAroundCenter:eo,rotateVertices:Xu},Symbol.toStringTag,{value:"Module"})),mg={annotationType:T.TEXT,create(e){const{onCommit:t,getTool:n,pageSize:o}=e;return{onPointerDown:i=>{const r=n();if(!r)return;const a={origin:{x:i.x-12,y:i.y-12},size:{width:24,height:24}};let s={...r.defaults,rect:a,type:T.TEXT,name:r.defaults.name??Pe.Comment,contents:r.defaults.contents??"",flags:r.defaults.flags??["print","noRotate","noZoom"],pageIndex:e.pageIndex,id:pe(),created:new Date};s=ao(s,o),t(s)}}}};function sn({threshold:e=5,getTool:t,onClickDetected:n}){const[o,i]=Ke(null),[r,a]=Ke(!1);return{onStart:s=>{i(s),a(!1)},onMove:s=>{const l=o();!l||r()||Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))>e&&a(!0)},onEnd:s=>{var l;if(o()&&!r()){const c=t();c&&"clickBehavior"in c&&((l=c.clickBehavior)!=null&&l.enabled)&&n(s,c)}i(null),a(!1)},hasMoved:r,reset:()=>{i(null),a(!1)}}}const pg={annotationType:T.FREETEXT,create(e){const{onCommit:t,onPreview:n,getTool:o,pageSize:i,pageIndex:r,pageRotation:a}=e,[s,l]=Ke(null),c=g=>({x:ue(g.x,0,i.width),y:ue(g.y,0,i.height)}),d=()=>{const g=o();return g?{...g.defaults,fontColor:g.defaults.fontColor??"#000000",opacity:g.defaults.opacity??1,fontSize:g.defaults.fontSize??12,fontFamily:g.defaults.fontFamily??Ee.Helvetica,color:g.defaults.color??g.defaults.backgroundColor??"transparent",textAlign:g.defaults.textAlign??Xe.Left,verticalAlign:g.defaults.verticalAlign??mt.Top,contents:g.defaults.contents??"Insert text here",flags:g.defaults.flags??["print"]}:null},u=sn({threshold:5,getTool:o,onClickDetected:(g,p)=>{var f;const v=d();if(!v)return;const y=p.clickBehavior;if(!y?.enabled)return;const{width:b,height:w}=y.defaultSize,x={origin:{x:g.x-b/2,y:g.y-w/2},size:{width:b,height:w}},C=y.defaultContent??v.contents;let I={...v,contents:C,type:T.FREETEXT,rect:x,pageIndex:r,id:pe(),created:new Date};(f=p.behavior)!=null&&f.insertUpright&&(I=Mo(I,a,!1)),I=ao(I,i),t(I)}}),m=g=>{const p=s();if(!p)return null;const f=d();if(!f)return null;const v={origin:{x:Math.min(p.x,g.x),y:Math.min(p.y,g.y)},size:{width:Math.abs(p.x-g.x),height:Math.abs(p.y-g.y)}};return{type:T.FREETEXT,bounds:v,data:{...f,rect:v}}};return{onPointerDown:(g,p)=>{var f;const v=c(g);l(v),u.onStart(v),n(m(v)),(f=p.setPointerCapture)==null||f.call(p)},onPointerMove:g=>{const p=c(g);u.onMove(p),s()&&u.hasMoved()&&n(m(p))},onPointerUp:(g,p)=>{var f,v;const y=s();if(!y)return;const b=d();if(!b)return;const w=c(g);if(u.hasMoved()){const x={origin:{x:Math.min(y.x,w.x),y:Math.min(y.y,w.y)},size:{width:Math.abs(y.x-w.x),height:Math.abs(y.y-w.y)}},C=o();let I={...b,type:T.FREETEXT,rect:x,pageIndex:e.pageIndex,id:pe(),created:new Date};(f=C?.behavior)!=null&&f.insertUpright&&(I=Mo(I,a,!0)),t(I)}else u.onEnd(w);l(null),n(null),u.reset(),(v=p.releasePointerCapture)==null||v.call(p)},onPointerLeave:(g,p)=>{var f;l(null),n(null),u.reset(),(f=p.releasePointerCapture)==null||f.call(p)},onPointerCancel:(g,p)=>{var f;l(null),n(null),u.reset(),(f=p.releasePointerCapture)==null||f.call(p)}}}},od=150,A0={annotationType:T.FREETEXT,create(e){const{onCommit:t,onPreview:n,getTool:o,pageSize:i,pageIndex:r}=e,[a,s]=Ke("arrow"),[l,c]=Ke(null),[d,u]=Ke(null),[m,g]=Ke(null),[p,f]=Ke(null),[v,y]=Ke(!1),b=A=>({x:ue(A.x,0,i.width),y:ue(A.y,0,i.height)}),w=A=>({origin:{x:ue(A.origin.x,0,i.width-A.size.width),y:ue(A.origin.y,0,i.height-A.size.height)},size:A.size}),x=()=>{const A=o();return A?{...A.defaults,fontColor:A.defaults.fontColor??"#000000",opacity:A.defaults.opacity??1,fontSize:A.defaults.fontSize??12,fontFamily:A.defaults.fontFamily??Ee.Helvetica,color:A.defaults.color??A.defaults.backgroundColor??"transparent",textAlign:A.defaults.textAlign??Xe.Left,verticalAlign:A.defaults.verticalAlign??mt.Top,contents:A.defaults.contents??"Insert text",flags:A.defaults.flags??["print"],lineEnding:A.defaults.lineEnding??ge.OpenArrow,strokeColor:A.defaults.strokeColor??"#000000",strokeWidth:A.defaults.strokeWidth??1}:null},C=(A,D)=>Math.abs(A.x-D.x)<5&&Math.abs(A.y-D.y)<5,I=A=>{const D=x();if(!D)return null;const R=l(),M=d(),N=a();if(N==="knee"&&R){const z=[R,A],_=Math.min(R.x,A.x),L=Math.min(R.y,A.y),j=Math.abs(R.x-A.x),E=Math.abs(R.y-A.y),F={origin:{x:_,y:L},size:{width:Math.max(j,1),height:Math.max(E,1)}};return{type:T.FREETEXT,bounds:F,data:{...D,rect:F,calloutLine:z}}}if(N==="textbox"&&R&&M){const z=p();let _;_=v()&&z?{origin:{x:Math.min(z.x,A.x),y:Math.min(z.y,A.y)},size:{width:Math.max(Math.abs(A.x-z.x),20),height:Math.max(Math.abs(A.y-z.y),14)}}:{origin:{x:A.x-75,y:A.y-20},size:{width:od,height:40}},_=w(_);const L=[R,M,ai(M,_)],j=Po(_,L,D.lineEnding,D.strokeWidth);return{type:T.FREETEXT,bounds:j,data:{...D,rect:j,calloutLine:L,textBox:_}}}return null},S=A=>{const D=x(),R=l(),M=d();if(!D||!R||!M)return;const N=w(A),z=[R,M,ai(M,N)],_=Po(N,z,D.lineEnding,D.strokeWidth),L=ri(_,N),j={...D,type:T.FREETEXT,intent:"FreeTextCallout",rect:_,rectangleDifferences:L,calloutLine:z,pageIndex:r,id:pe(),created:new Date};t(j),P()},P=()=>{s("arrow"),c(null),u(null),g(null),f(null),y(!1),n(null)};return{onPointerDown:(A,D)=>{var R,M;const N=b(A),z=a();z==="arrow"||z==="knee"?(g(N),(R=D.setPointerCapture)==null||R.call(D)):z==="textbox"&&(f(N),y(!0),(M=D.setPointerCapture)==null||M.call(D))},onPointerMove:A=>{const D=b(A),R=a();R==="textbox"&&v()?n(I(D)):R!=="knee"&&R!=="textbox"||n(I(D))},onPointerUp:(A,D)=>{var R,M,N,z;const _=b(A),L=a(),j=m();if(L==="arrow"&&j&&C(j,_))return c(_),s("knee"),g(null),void((R=D.releasePointerCapture)==null||R.call(D));if(L==="knee"&&j&&C(j,_))return u(_),s("textbox"),g(null),void((M=D.releasePointerCapture)==null||M.call(D));if(L==="textbox"&&v()){const E=p();if(E){const F=Math.min(E.x,_.x),X=Math.min(E.y,_.y),Q=Math.abs(_.x-E.x),J=Math.abs(_.y-E.y);if(Q>5||J>5){const te={origin:{x:F,y:X},size:{width:Math.max(Q,20),height:Math.max(J,14)}};S(te)}else S({origin:{x:E.x-75,y:E.y-20},size:{width:od,height:40}})}return void((N=D.releasePointerCapture)==null||N.call(D))}g(null),(z=D.releasePointerCapture)==null||z.call(D)},onPointerCancel:(A,D)=>{var R;P(),(R=D.releasePointerCapture)==null||R.call(D)}}}},Qa={annotationType:T.LINE,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=m=>({x:ue(m.x,0,r.width),y:ue(m.y,0,r.height)}),c=()=>{const m=i();return m?{...m.defaults,strokeWidth:m.defaults.strokeWidth??1,lineEndings:m.defaults.lineEndings??{start:ge.None,end:ge.None},color:m.defaults.color??"#000000",opacity:m.defaults.opacity??1,strokeStyle:m.defaults.strokeStyle??ke.SOLID,strokeDashArray:m.defaults.strokeDashArray??[],strokeColor:m.defaults.strokeColor??"#000000",flags:m.defaults.flags??["print"]}:null},d=sn({threshold:5,getTool:i,onClickDetected:(m,g)=>{const p=c();if(!p)return;const f=g.clickBehavior;if(!f?.enabled)return;const v=f.defaultAngle??0,y=f.defaultLength/2,b=m.x-y*Math.cos(v),w=m.y-y*Math.sin(v),x=m.x+y*Math.cos(v),C=m.y+y*Math.sin(v),I=l({x:b,y:w}),S=l({x,y:C}),P=$t([I,S],p.strokeWidth,p.lineEndings);n({...p,rect:P,linePoints:{start:I,end:S},pageIndex:t,id:pe(),created:new Date,type:T.LINE})}}),u=m=>{const g=a();if(!g)return null;const p=c();if(!p)return null;const f=$t([g,m],p.strokeWidth,p.lineEndings);return{type:T.LINE,bounds:f,data:{...p,rect:f,linePoints:{start:g,end:m}}}};return{onPointerDown:(m,g)=>{var p;const f=l(m);s(f),d.onStart(f),o(u(f)),(p=g.setPointerCapture)==null||p.call(g)},onPointerMove:m=>{const g=l(m);d.onMove(g),a()&&d.hasMoved()&&o(u(g))},onPointerUp:(m,g)=>{var p;const f=a();if(!f)return;const v=l(m);if(d.hasMoved()){const y=c();if(!y)return;if(Math.abs(v.x-f.x)>2||Math.abs(v.y-f.y)>2){const b=$t([f,v],y.strokeWidth,y.lineEndings);n({...y,rect:b,linePoints:{start:f,end:v},pageIndex:t,id:pe(),flags:["print"],created:new Date,type:T.LINE})}}else d.onEnd(v);s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerLeave:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerCancel:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)}}}},gg={annotationType:T.POLYLINE,create(e){const{onCommit:t,onPreview:n,getTool:o,pageSize:i}=e,[r,a]=Ke([]),[s,l]=Ke(null),c=m=>({x:ue(m.x,0,i.width),y:ue(m.y,0,i.height)}),d=()=>{const m=o();return m?{...m.defaults,strokeWidth:m.defaults.strokeWidth??1,lineEndings:m.defaults.lineEndings??{start:ge.None,end:ge.None},color:m.defaults.color??"#000000",opacity:m.defaults.opacity??1,strokeColor:m.defaults.strokeColor??"#000000",strokeStyle:m.defaults.strokeStyle??ke.SOLID,strokeDashArray:m.defaults.strokeDashArray??[],flags:m.defaults.flags??["print"]}:null},u=()=>{const m=r(),g=s();if(m.length===0||!g)return null;const p=d();if(!p)return null;const f=[...m,g],v=$t(f,p.strokeWidth,p.lineEndings);return{type:T.POLYLINE,bounds:v,data:{...p,rect:v,vertices:f,currentVertex:g}}};return{onClick:(m,g)=>{if(g.metaKey||g.ctrlKey)return;const p=c(m),f=r(),v=f[f.length-1];v&&Math.abs(v.x-p.x)<1&&Math.abs(v.y-p.y)<1||(a([...f,p]),l(p),n(u()))},onDoubleClick:()=>{(()=>{const m=r();if(m.length<2)return;const g=d();if(!g)return;const p=$t(m,g.strokeWidth,g.lineEndings),f={...g,vertices:m,rect:p,type:T.POLYLINE,pageIndex:e.pageIndex,id:pe(),created:new Date};t(f),a([]),l(null),n(null)})()},onPointerMove:m=>{if(r().length>0){const g=c(m);l(g),n(u())}},onPointerCancel:()=>{a([]),l(null),n(null)}}}},fg={annotationType:T.POLYGON,create(e){const{onCommit:t,onPreview:n,getTool:o,scale:i,pageSize:r}=e,[a,s]=Ke([]),[l,c]=Ke(null),d=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),u=()=>{const p=o();return p?{...p.defaults,color:p.defaults.color??"#000000",opacity:p.defaults.opacity??1,strokeWidth:p.defaults.strokeWidth??1,strokeColor:p.defaults.strokeColor??"#000000",strokeStyle:p.defaults.strokeStyle??ke.SOLID,strokeDashArray:p.defaults.strokeDashArray??[],flags:p.defaults.flags??["print"]}:null},m=()=>{const p=a();if(p.length<3)return;const f=u();if(!f)return;const v=f.cloudyBorderIntensity??0,y=v>0?jt(v,f.strokeWidth,!1):f.strokeWidth/2,b=Et(_t(p),y),w={...f,vertices:p,rect:b,type:T.POLYGON,pageIndex:e.pageIndex,id:pe(),created:new Date,...v>0&&{rectangleDifferences:{left:y,top:y,right:y,bottom:y}}};t(w),s([]),c(null),n(null)},g=()=>{const p=a(),f=l();if(p.length===0||!f)return null;const v=u();if(!v)return null;const y=v.cloudyBorderIntensity??0,b=y>0?jt(y,v.strokeWidth,!1):v.strokeWidth/2,w=Et(_t([...p,f]),b);return{type:T.POLYGON,bounds:w,data:{...v,rect:w,vertices:p,currentVertex:f}}};return{onClick:(p,f)=>{if(f.metaKey||f.ctrlKey)return;const v=d(p);if((w=>{const x=a();if(x.length<2)return!1;const C=14/i/2,I=x[0];return w.x>=I.x-C&&w.x<=I.x+C&&w.y>=I.y-C&&w.y<=I.y+C})(v)&&a().length>=3)return void m();const y=a(),b=y[y.length-1];b&&Math.abs(b.x-v.x)<1&&Math.abs(b.y-v.y)<1||(s([...y,v]),c(v),n(g()))},onDoubleClick:p=>{m()},onPointerMove:p=>{if(a().length>0){const f=d(p);c(f),n(g())}},onPointerCancel:p=>{s([]),c(null),n(null)}}}},vg={annotationType:T.SQUARE,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=m=>({x:ue(m.x,0,r.width),y:ue(m.y,0,r.height)}),c=()=>{const m=i();return m?{...m.defaults,flags:m.defaults.flags??["print"],strokeWidth:m.defaults.strokeWidth??2,strokeColor:m.defaults.strokeColor??"#000000",strokeStyle:m.defaults.strokeStyle??ke.SOLID,strokeDashArray:m.defaults.strokeDashArray??[],color:m.defaults.color??"#000000",opacity:m.defaults.opacity??1}:null},d=sn({threshold:5,getTool:i,onClickDetected:(m,g)=>{const p=c();if(!p)return;const f=g.clickBehavior;if(!f?.enabled)return;const{width:v,height:y}=f.defaultSize,b=v/2,w=y/2,x=ue(m.x-b,0,r.width-v),C=ue(m.y-w,0,r.height-y),I=p.strokeWidth,S=p.cloudyBorderIntensity??0,P=S>0?jt(S,I,!1):I/2,A={origin:{x:x-P,y:C-P},size:{width:v+2*P,height:y+2*P}},D={...p,type:T.SQUARE,created:new Date,id:pe(),pageIndex:t,rect:A,...S>0&&{rectangleDifferences:{left:P,top:P,right:P,bottom:P}}};n(D)}}),u=m=>{const g=a();if(!g)return null;const p=Math.min(g.x,m.x),f=Math.min(g.y,m.y),v=Math.abs(g.x-m.x),y=Math.abs(g.y-m.y),b=c();if(!b)return null;const w=b.strokeWidth,x=b.cloudyBorderIntensity??0,C=x>0?jt(x,w,!1):w/2,I={origin:{x:p-C,y:f-C},size:{width:v+2*C,height:y+2*C}};return{type:T.SQUARE,bounds:I,data:{rect:I,...b,...x>0&&{rectangleDifferences:{left:C,top:C,right:C,bottom:C}}}}};return{onPointerDown:(m,g)=>{var p;const f=l(m);s(f),d.onStart(f),o(u(f)),(p=g.setPointerCapture)==null||p.call(g)},onPointerMove:m=>{const g=l(m);d.onMove(g),a()&&d.hasMoved()&&o(u(g))},onPointerUp:(m,g)=>{var p;if(!a()||!c())return;const f=l(m);if(d.hasMoved()){const v=c();if(!v)return;const y=u(f);if(y){const b=v.cloudyBorderIntensity??0,w=b>0?jt(b,v.strokeWidth,!1):void 0,x={...v,type:T.SQUARE,created:new Date,id:pe(),pageIndex:t,rect:y.data.rect,...w!==void 0&&{rectangleDifferences:{left:w,top:w,right:w,bottom:w}}};n(x)}}else d.onEnd(f);s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerLeave:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerCancel:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)}}}},Ui=new Map,yg={annotationType:T.STAMP,create(e){const{services:t,onCommit:n,onPreview:o,getTool:i,pageSize:r,pageRotation:a}=e;let s=null,l=null;const c=(d,u,m)=>{const g=Xl(u);if(!g||g.mimeType==="application/pdf")return!1;const p=Wl(g,r);return((f,v,y,b)=>{var w;const x=i();if(!x)return;const C={origin:{x:f.x-v/2,y:f.y-y/2},size:{width:v,height:y}};let I={...x.defaults,rect:C,type:T.STAMP,name:x.defaults.name??Pe.Image,subject:x.defaults.subject??"Stamp",flags:x.defaults.flags??["print"],pageIndex:e.pageIndex,id:pe(),created:new Date};(w=x.behavior)!=null&&w.insertUpright&&(I=Mo(I,a,!1)),I=ao(I,r),n(I,b)})(d,m?.width??p.width,m?.height??p.height,{data:u}),!0};return{onHandlerActiveStart:()=>{const d=i(),u=d?.defaults.imageSrc;if(!u)return;let m=Ui.get(u);m?m.refs++:(m={promise:fetch(u).then(g=>g.arrayBuffer()).then(g=>{const p=Xl(g);if(!p||p.mimeType==="application/pdf")return null;const f=Wl(p,r),v=d.defaults.imageSize;return{buffer:g,width:v?.width??f.width,height:v?.height??f.height}}).catch(()=>null),refs:1},Ui.set(u,m)),m.promise.then(g=>{g&&(s=g.buffer,l={width:g.width,height:g.height})})},onHandlerActiveEnd:()=>{const d=i(),u=d?.defaults.imageSrc;if(u){const m=Ui.get(u);m&&--m.refs<=0&&Ui.delete(u)}s=null,l=null,o(null)},onPointerMove:d=>{var u;const m=i();if(!((u=m?.behavior)!=null&&u.showGhost)||!l||!m.defaults.imageSrc)return;const g={origin:{x:d.x-l.width/2,y:d.y-l.height/2},size:l};o({type:T.STAMP,bounds:g,data:{rect:g,ghostUrl:m.defaults.imageSrc,pageRotation:a}})},onPointerDown:d=>{const u=i();if(!u)return;const{imageSrc:m,imageSize:g}=u.defaults;m?(o(null),s?c(d,s,g):fetch(m).then(p=>p.arrayBuffer()).then(p=>c(d,p,g))):t.requestFile({accept:"image/png,image/jpeg",onFile:p=>{p.arrayBuffer().then(f=>c(d,f))}})},onPointerLeave:()=>{o(null)}}}},bg={annotationType:T.CIRCLE,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=m=>({x:ue(m.x,0,r.width),y:ue(m.y,0,r.height)}),c=()=>{const m=i();return m?{...m.defaults,strokeWidth:m.defaults.strokeWidth??2,strokeColor:m.defaults.strokeColor??"#000000",strokeStyle:m.defaults.strokeStyle??ke.SOLID,strokeDashArray:m.defaults.strokeDashArray??[],color:m.defaults.color??"#000000",opacity:m.defaults.opacity??1,flags:m.defaults.flags??["print"]}:null},d=sn({threshold:5,getTool:i,onClickDetected:(m,g)=>{const p=c();if(!p)return;const f=g.clickBehavior;if(!f?.enabled)return;const{width:v,height:y}=f.defaultSize,b=v/2,w=y/2,x=ue(m.x-b,0,r.width-v),C=ue(m.y-w,0,r.height-y),I=p.strokeWidth,S=p.cloudyBorderIntensity??0,P=S>0?jt(S,I,!0):I/2,A={origin:{x:x-P,y:C-P},size:{width:v+2*P,height:y+2*P}},D={...p,type:T.CIRCLE,created:new Date,id:pe(),pageIndex:t,rect:A,...S>0&&{rectangleDifferences:{left:P,top:P,right:P,bottom:P}}};n(D)}}),u=m=>{const g=a();if(!g)return null;const p=Math.min(g.x,m.x),f=Math.min(g.y,m.y),v=Math.abs(g.x-m.x),y=Math.abs(g.y-m.y),b=c();if(!b)return null;const w=b.strokeWidth,x=b.cloudyBorderIntensity??0,C=x>0?jt(x,w,!0):w/2,I={origin:{x:p-C,y:f-C},size:{width:v+2*C,height:y+2*C}};return{type:T.CIRCLE,bounds:I,data:{rect:I,...b,...x>0&&{rectangleDifferences:{left:C,top:C,right:C,bottom:C}}}}};return{onPointerDown:(m,g)=>{var p;const f=l(m);s(f),d.onStart(f),o(u(f)),(p=g.setPointerCapture)==null||p.call(g)},onPointerMove:m=>{const g=l(m);d.onMove(g),a()&&d.hasMoved()&&o(u(g))},onPointerUp:(m,g)=>{var p;if(!a()||!c())return;const f=l(m);if(d.hasMoved()){const v=c();if(!v)return;const y=u(f);if(y){const b=v.cloudyBorderIntensity??0,w=b>0?jt(b,v.strokeWidth,!0):void 0,x={...v,type:T.CIRCLE,flags:["print"],created:new Date,id:pe(),pageIndex:t,rect:y.data.rect,...w!==void 0&&{rectangleDifferences:{left:w,top:w,right:w,bottom:w}}};n(x)}}else d.onEnd(f);s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerLeave:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerCancel:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)}}}},wg={annotationType:T.LINK,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=m=>({x:ue(m.x,0,r.width),y:ue(m.y,0,r.height)}),c=()=>{const m=i();return m?{...m.defaults,flags:m.defaults.flags??["print"],strokeWidth:m.defaults.strokeWidth??2,strokeColor:m.defaults.strokeColor??"#0000FF",strokeStyle:m.defaults.strokeStyle??ke.UNDERLINE,strokeDashArray:m.defaults.strokeDashArray??[]}:null},d=sn({threshold:5,getTool:i,onClickDetected:(m,g)=>{const p=c();if(!p)return;const f=g.clickBehavior;if(!f?.enabled)return;const{width:v,height:y}=f.defaultSize,b=v/2,w=y/2,x={origin:{x:ue(m.x-b,0,r.width-v),y:ue(m.y-w,0,r.height-y)},size:{width:v,height:y}},C={...p,type:T.LINK,target:void 0,created:new Date,id:pe(),pageIndex:t,rect:x};n(C)}}),u=m=>{const g=a();if(!g)return null;const p=Math.min(g.x,m.x),f=Math.min(g.y,m.y),v=Math.abs(g.x-m.x),y=Math.abs(g.y-m.y),b=c();if(!b)return null;const w={origin:{x:p,y:f},size:{width:v,height:y}};return{type:T.LINK,bounds:w,data:{rect:w,strokeColor:b.strokeColor,strokeWidth:b.strokeWidth,strokeStyle:b.strokeStyle,strokeDashArray:b.strokeDashArray}}};return{onPointerDown:(m,g)=>{var p;const f=l(m);s(f),d.onStart(f),o(u(f)),(p=g.setPointerCapture)==null||p.call(g)},onPointerMove:m=>{const g=l(m);d.onMove(g),a()&&d.hasMoved()&&o(u(g))},onPointerUp:(m,g)=>{var p;if(!a())return;const f=c();if(!f)return;const v=l(m);if(d.hasMoved()){const y=u(v);if(y){const b={...f,type:T.LINK,target:void 0,created:new Date,id:pe(),pageIndex:t,rect:y.data.rect};n(b)}}else d.onEnd(v);s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerLeave:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)},onPointerCancel:(m,g)=>{var p;s(null),o(null),d.reset(),(p=g.releasePointerCapture)==null||p.call(g)}}}},P0={toolId:"__textMarkup__",handle(e,t,n){const o=e.getTool();if(o)for(const i of t){const r=pe();n().then(a=>{var s;e.createAnnotation(i.pageIndex,{...o.defaults,rect:i.rect,segmentRects:i.segmentRects,pageIndex:i.pageIndex,created:new Date,id:r,...a!=null&&{custom:{text:a}}}),(s=o.behavior)!=null&&s.selectAfterCreate&&e.selectAnnotation(i.pageIndex,r)})}}};function xg(e){const t=e.size.height,n=t/2,o=n;return{origin:{x:e.origin.x+e.size.width-o/2,y:e.origin.y+t/2},size:{width:o,height:n}}}const M0={toolId:"insertText",handle(e,t,n){const o=e.getTool();if(!o)return;const i=()=>({strokeColor:o.defaults.strokeColor??"#E44234",opacity:o.defaults.opacity??1,flags:o.defaults.flags??["print"]});for(const r of t){const a=r.segmentRects[r.segmentRects.length-1];if(!a)continue;const s=xg(a),l=pe(),c=i();n().then(d=>{var u;e.createAnnotation(r.pageIndex,{type:T.CARET,id:l,pageIndex:r.pageIndex,rect:s,strokeColor:c.strokeColor,opacity:c.opacity,intent:"Insert",rectangleDifferences:{left:.5,top:.5,right:.5,bottom:.5},created:new Date,flags:c.flags,...d!=null&&{custom:{text:d}}}),(u=o.behavior)!=null&&u.selectAfterCreate&&e.selectAnnotation(r.pageIndex,l)})}}},D0={toolId:"replaceText",handle(e,t,n){const o=e.getTool();if(!o)return;const i=()=>({strokeColor:o.defaults.strokeColor??"#E44234",opacity:o.defaults.opacity??1,flags:o.defaults.flags??["print"]});for(const r of t){const a=r.segmentRects[r.segmentRects.length-1];if(!a)continue;const s=xg(a),l=pe(),c=pe(),d=i();n().then(u=>{var m;e.createAnnotation(r.pageIndex,{type:T.CARET,id:l,pageIndex:r.pageIndex,rect:s,strokeColor:d.strokeColor,opacity:d.opacity,intent:"Replace",rectangleDifferences:{left:.5,top:.5,right:.5,bottom:.5},created:new Date,flags:d.flags}),e.createAnnotation(r.pageIndex,{type:T.STRIKEOUT,id:c,pageIndex:r.pageIndex,rect:r.rect,segmentRects:r.segmentRects,strokeColor:d.strokeColor,opacity:d.opacity,intent:"StrikeOutTextEdit",inReplyToId:l,replyType:Ut.Group,created:new Date,flags:d.flags,...u!=null&&{custom:{text:u}}}),(m=o.behavior)!=null&&m.selectAfterCreate&&e.selectAnnotation(r.pageIndex,l)})}}},T0=[{id:"highlight",name:"Highlight",labelKey:"annotation.highlight",categories:["annotation","markup"],matchScore:e=>e.type===T.HIGHLIGHT?1:0,interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.HIGHLIGHT,strokeColor:"#FFCD45",color:"#FFCD45",opacity:1,blendMode:ve.Multiply}},{id:"underline",name:"Underline",labelKey:"annotation.underline",categories:["annotation","markup"],matchScore:e=>e.type===T.UNDERLINE?1:0,interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.UNDERLINE,strokeColor:"#E44234",color:"#E44234",opacity:1}},{id:"strikeout",name:"Strikeout",labelKey:"annotation.strikeout",categories:["annotation","markup"],matchScore:e=>e.type===T.STRIKEOUT?1:0,interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.STRIKEOUT,strokeColor:"#E44234",color:"#E44234",opacity:1}},{id:"squiggly",name:"Squiggly",labelKey:"annotation.squiggly",categories:["annotation","markup"],matchScore:e=>e.type===T.SQUIGGLY?1:0,interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.SQUIGGLY,strokeColor:"#E44234",color:"#E44234",opacity:1}}],R0=[{id:"insertText",name:"Insert Text",labelKey:"annotation.insertText",categories:["annotation","markup"],matchScore:e=>{var t;return e.type!==T.CARET?0:(t=e.intent)!=null&&t.includes("Insert")?2:1},interaction:{exclusive:!1,textSelection:!0,showSelectionRects:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.CARET,strokeColor:"#E44234",opacity:1,intent:"Insert"},selectionHandler:M0}],E0=[{id:"replaceText",name:"Replace Text",labelKey:"annotation.replaceText",categories:["annotation","markup"],matchScore:e=>{var t,n;return e.type===T.STRIKEOUT&&((t=e.intent)!=null&&t.includes("StrikeOutTextEdit"))||e.type===T.CARET&&((n=e.intent)!=null&&n.includes("Replace"))?2:0},interaction:{exclusive:!1,textSelection:!0,isDraggable:!1,isResizable:!1,isRotatable:!1,isGroupDraggable:!1,isGroupResizable:!1},defaults:{type:T.STRIKEOUT,strokeColor:"#E44234",opacity:1,intent:"StrikeOutTextEdit"},selectionHandler:D0}],z0=[{id:"ink",name:"Pen",labelKey:"annotation.ink",categories:["annotation","markup"],matchScore:e=>e.type===T.INK&&e.intent!=="InkHighlight"?5:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,lockAspectRatio:!1},defaults:{type:T.INK,strokeColor:"#E44234",color:"#E44234",opacity:1,strokeWidth:6},behavior:{commitDelay:800},transform:Xa,pointerHandler:Va},{id:"inkHighlighter",name:"Ink Highlighter",labelKey:"annotation.inkHighlighter",categories:["annotation","markup"],matchScore:e=>e.type===T.INK&&e.intent==="InkHighlight"?10:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.INK,intent:"InkHighlight",strokeColor:"#FFCD45",color:"#FFCD45",opacity:1,strokeWidth:14,blendMode:ve.Multiply},behavior:{commitDelay:800,smartLineRecognition:!0,smartLineThreshold:.15},transform:Xa,pointerHandler:Va}],L0=[{id:"circle",name:"Circle",labelKey:"annotation.circle",categories:["annotation","shape"],matchScore:e=>e.type===T.CIRCLE?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.CIRCLE,color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234",strokeStyle:ke.SOLID},clickBehavior:{enabled:!0,defaultSize:{width:100,height:100}},transform:lg,pointerHandler:bg}],N0=[{id:"square",name:"Square",labelKey:"annotation.square",categories:["annotation","shape"],matchScore:e=>e.type===T.SQUARE?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,lockAspectRatio:!1,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.SQUARE,color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234",strokeStyle:ke.SOLID},clickBehavior:{enabled:!0,defaultSize:{width:100,height:100}},transform:cg,pointerHandler:vg}],O0=[{id:"line",name:"Line",labelKey:"annotation.line",categories:["annotation","shape"],matchScore:e=>e.type===T.LINE&&e.intent!=="LineArrow"?5:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.LINE,color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234"},clickBehavior:{enabled:!0,defaultLength:100,defaultAngle:0},transform:Za,pointerHandler:Qa},{id:"lineArrow",name:"Arrow",labelKey:"annotation.arrow",categories:["annotation","shape"],matchScore:e=>e.type===T.LINE&&e.intent==="LineArrow"?10:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.LINE,intent:"LineArrow",color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234",lineEndings:{start:ge.None,end:ge.OpenArrow}},clickBehavior:{enabled:!0,defaultLength:100,defaultAngle:0},transform:Za,pointerHandler:Qa}],F0=[{id:"polyline",name:"Polyline",labelKey:"annotation.polyline",categories:["annotation","shape"],matchScore:e=>e.type===T.POLYLINE?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.POLYLINE,color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234"},transform:ng,pointerHandler:gg}],_0=[{id:"polygon",name:"Polygon",labelKey:"annotation.polygon",categories:["annotation","shape"],matchScore:e=>e.type===T.POLYGON?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,lockAspectRatio:!1,isGroupResizable:!0,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.POLYGON,color:"transparent",opacity:1,strokeWidth:6,strokeColor:"#E44234"},transform:sg,pointerHandler:fg}],$0=[{id:"textComment",name:"Comment",labelKey:"annotation.text",categories:["annotation","markup"],matchScore:e=>e.type!==T.TEXT||e.inReplyToId?0:1,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,isRotatable:!1},defaults:{type:T.TEXT,strokeColor:"#FFCD45",opacity:1},behavior:{selectAfterCreate:!0},pointerHandler:mg}],j0=[{id:"freeText",name:"Free Text",labelKey:"annotation.freeText",categories:["annotation","markup"],matchScore:e=>e.type===T.FREETEXT&&e.intent!=="FreeTextCallout"?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,lockA
2287spectRatio:!1,lockGroupAspectRatio:e=>{const t=((e.rotation??0)%90+90)%90;return t>=6&&t<=84}},defaults:{type:T.FREETEXT,contents:"Insert text",fontSize:14,fontColor:"#E44234",fontFamily:Ee.Helvetica,textAlign:Xe.Left,verticalAlign:mt.Top,color:"transparent",backgroundColor:"transparent",opacity:1},clickBehavior:{enabled:!0,defaultSize:{width:100,height:20},defaultContent:"Insert text"},behavior:{insertUpright:!0,editAfterCreate:!0,selectAfterCreate:!0},transform:dg,pointerHandler:pg}],U0=[{id:"freeTextCallout",name:"Callout",labelKey:"annotation.callout",categories:["annotation","markup"],matchScore:e=>e.type===T.FREETEXT&&e.intent==="FreeTextCallout"?10:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!1,isRotatable:!1},defaults:{type:T.FREETEXT,intent:"FreeTextCallout",contents:"Insert text",fontSize:14,fontColor:"#E44234",fontFamily:Ee.Helvetica,textAlign:Xe.Left,verticalAlign:mt.Top,color:"transparent",opacity:1,lineEnding:ge.OpenArrow,strokeColor:"#E44234",strokeWidth:1},behavior:{insertUpright:!0,editAfterCreate:!0,selectAfterCreate:!0},transform:ug,pointerHandler:A0}],B0=[{id:"stamp",name:"Image",labelKey:"annotation.stamp",categories:["annotation","markup"],matchScore:e=>e.type===T.STAMP?1:0,interaction:{exclusive:!1,cursor:"copy",isDraggable:!0,isResizable:!0,lockAspectRatio:!0,lockGroupAspectRatio:!0},defaults:{type:T.STAMP},behavior:{insertUpright:!0,useAppearanceStream:!1},transform:hg,pointerHandler:yg}],W0=[{id:"link",name:"Link",labelKey:"annotation.link",categories:["annotation","markup"],matchScore:e=>e.type===T.LINK?1:0,interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1},defaults:{type:T.LINK,strokeColor:"#0000FF",strokeWidth:2,strokeStyle:ke.UNDERLINE},clickBehavior:{enabled:!0,defaultSize:{width:100,height:20}},pointerHandler:wg}],H0=[...T0,...R0,...E0,...z0,...L0,...N0,...O0,...F0,..._0,...$0,...j0,...U0,...B0,...W0],G0=["#E44234","#FF8D00","#FFCD45","#5CC96E","#25D2D1","#597CE2","#C544CE","#7D2E25","#000000","#FFFFFF"],wa=e=>e.length===1?e[0]:null,kg=e=>({pages:{},byUid:{},selectedUids:[],selectedUid:null,activeToolId:null,hasPendingChanges:!1,locked:e?.locked??{type:Ze.None}}),q0=(e,t,n)=>{const o=e.byUid[t];return o?{...e,byUid:{...e.byUid,[t]:{...o,commitState:o.commitState==="synced"||o.commitState==="moved"?"dirty":o.commitState,object:{...o.object,...n},dictMode:!0}},hasPendingChanges:!0}:e},K0=(e,t,n)=>{const o=e.byUid[t];return o?{...e,byUid:{...e.byUid,[t]:{...o,commitState:o.commitState==="synced"?"moved":o.commitState,object:{...o.object,...n}}},hasPendingChanges:!0}:e},Ja=class Cg extends $e{constructor(t,n,o){var i,r,a,s;super(t,n),this.ANNOTATION_HISTORY_TOPIC="annotations",this.state$=Ue((l,c)=>({documentId:l,state:c})),this.pendingContexts=new Map,this.isInitialLoadComplete=new Map,this.importQueue=new Map,this.commitInProgress=new Map,this.activeTool$=Ue((l,c)=>({documentId:l,tool:c})),this.events$=Ue((l,c)=>c,{cache:!1}),this.toolsChange$=xe(),this.appearanceCache=new Map,this.unifiedDragStates=new Map,this.unifiedDrag$=xe(),this.unifiedResizeStates=new Map,this.unifiedResize$=xe(),this.unifiedRotateStates=new Map,this.unifiedRotate$=xe(),this.navigate$=Ue((l,c)=>c,{cache:!1}),this.config=o,this.selection=((i=n.getPlugin("selection"))==null?void 0:i.provides())??null,this.history=((r=n.getPlugin("history"))==null?void 0:r.provides())??null,this.scroll=((a=n.getPlugin("scroll"))==null?void 0:a.provides())??null,this.interactionManager=((s=n.getPlugin("interaction-manager"))==null?void 0:s.provides())??null}onDocumentLoadingStarted(t){this.dispatch((function(n,o){return{type:Tp,payload:{documentId:n,state:o}}})(t,kg(this.config))),this.pendingContexts.set(t,new Map),this.isInitialLoadComplete.set(t,!1),this.importQueue.set(t,[]),this.logger.debug("AnnotationPlugin","DocumentOpened",`Initialized annotation state for document: ${t}`)}onDocumentLoaded(t){const n=this.getCoreDocument(t);if(n?.document&&this.getAllAnnotations(t,n.document),this.selection)for(const o of this.state.tools)o.interaction.textSelection&&this.selection.enableForMode(o.interaction.mode??o.id,{showSelectionRects:o.interaction.showSelectionRects??!1,enableSelection:!0,enableMarquee:!1})}onDocumentClosed(t){this.dispatch((function(n){return{type:Rp,payload:n}})(t)),this.pendingContexts.delete(t),this.isInitialLoadComplete.delete(t),this.importQueue.delete(t),this.appearanceCache.delete(t),this.state$.clearScope(t),this.activeTool$.clearScope(t),this.events$.clearScope(t),this.navigate$.clearScope(t),this.logger.debug("AnnotationPlugin","DocumentClosed",`Cleaned up annotation state for document: ${t}`)}async initialize(){var t,n,o;
2287this.state.tools.forEach(i=>this.registerInteractionForTool(i)),this.history&&this.history.onHistoryChange(i=>{i.topic===this.ANNOTATION_HISTORY_TOPIC&&this.config.autoCommit!==!1&&this.commit(i.documentId)}),(t=this.interactionManager)==null||t.onModeChange(i=>{var r,a;const s=((r=this.state.tools.find(l=>(l.interaction.mode??l.id)===i.activeMode))==null?void 0:r.id)??null;s!==(((a=this.state.documents[i.documentId])==null?void 0:a.activeToolId)??null)&&i.documentId&&this.dispatch(Gc(i.documentId,s))}),(n=this.selection)==null||n.onMarqueeEnd(({documentId:i,pageIndex:r,rect:a,modeId:s})=>{if(s!=="pointerMode")return;const l=this.state.documents[i];if(!l)return;const c=(l.pages[r]??[]).map(d=>l.byUid[d]).filter(d=>d!==void 0).filter(d=>v0(d)).filter(d=>(function(u,m){return!(u.origin.x+u.size.width<m.origin.x||m.origin.x+m.size.width<u.origin.x||u.origin.y+u.size.height<m.origin.y||m.origin.y+m.size.height<u.origin.y)})(a,d.object.rect)).filter(d=>this.isAnnotationSelectable(d.object,i)).map(d=>d.object.id);if(c.length>0){const d=new Set;for(const u of c)if(this.isInGroupMethod(u,i)){const m=this.getGroupMembersMethod(u,i);for(const g of m)d.add(g.object.id)}else d.add(u);this.setSelectionMethod([...d],i)}}),(o=this.selection)==null||o.onEndSelection(({documentId:i})=>{var r,a,s,l;if(!this.checkPermission(i,U.ModifyAnnotations))return;const c=this.getActiveTool(i);if(!c||!c.interaction.textSelection)return;const d=(r=this.selection)==null?void 0:r.getFormattedSelection(),u=(a=this.selection)==null?void 0:a.getSelectedText();if(!d||!u)return;const m={toolId:c.id,documentId:i,getTool:()=>this.getActiveTool(i)??null,createAnnotation:(g,p)=>this.createAnnotation(g,p,void 0,i),selectAnnotation:(g,p)=>this.selectAnnotation(g,p,i)};(c.selectionHandler??P0).handle(m,d,()=>new Promise(g=>{u.wait(p=>g(p.join(`
2288`)),()=>g(void 0))})),(s=c.behavior)!=null&&s.deactivateToolAfterCreate&&this.setActiveTool(null,i),(l=this.selection)==null||l.clear()})}registerInteractionForTool(t){var n;(n=this.interactionManager)==null||n.registerMode({id:t.interaction.mode??t.id,scope:"page",exclusive:t.interaction.exclusive,cursor:t.interaction.cursor})}buildCapability(){return{getActiveTool:()=>this.getActiveTool(),setActiveTool:(t,n)=>this.setActiveTool(t,void 0,n),getState:()=>this.getDocumentState(),getPageAnnotations:t=>this.getPageAnnotations(t),getSelectedAnnotation:()=>this.getSelectedAnnotation(),getSelectedAnnotations:()=>this.getSelectedAnnotationsMethod(),getSelectedAnnotationIds:()=>this.getSelectedAnnotationIdsMethod(),getAnnotationById:t=>this.getAnnotationById(t),getAnnotations:t=>this.getAnnotationsMethod(t),selectAnnotation:(t,n)=>this.selectAnnotation(t,n),toggleSelection:(t,n)=>this.toggleSelectionMethod(t,n),addToSelection:(t,n)=>this.addToSelectionMethod(t,n),removeFromSelection:t=>this.removeFromSelectionMethod(t),setSelection:t=>this.setSelectionMethod(t),deselectAnnotation:()=>this.deselectAnnotation(),importAnnotations:t=>this.importAnnotations(t),exportAnnotations:(t,n)=>this.exportAnnotationsMethod(t,n),createAnnotation:(t,n,o)=>this.createAnnotation(t,n,o),updateAnnotation:(t,n,o)=>this.updateAnnotation(t,n,o),updateAnnotations:t=>this.updateAnnotationsMethod(t),moveAnnotation:(t,n,o,i,r)=>this.moveAnnotationMethod(t,n,o,i,r),deleteAnnotation:(t,n)=>this.deleteAnnotation(t,n),deleteAnnotations:(t,n)=>this.deleteAnnotationsMethod(t,n),deleteAllAnnotations:t=>this.deleteAllAnnotationsMethod(t),purgeAnnotation:(t,n,o)=>this.purgeAnnotationMethod(t,n,o),renderAnnotation:t=>this.renderAnnotation(t),getPageAppearances:(t,n,o)=>this.getPageAppearances(t,n,o),invalidatePageAppearances:(t,n)=>this.invalidatePageAppearances(t,n),commit:()=>this.commit(),getAttachedLinks:(t,n)=>this.getAttachedLinksMethod(t,n),hasAttachedLinks:(t,n)=>this.hasAttachedLinksMethod(t,n),deleteAttachedLinks:(t,n)=>this.deleteAttachedLinksMethod(t,n),groupAnnotations:t=>this.groupAnnotationsMethod(t),ungroupAnnotations:(t,n)=>this.ungroupAnnotationsMethod(t,n),getGroupMembers:(t,n)=>this.getGroupMembersMethod(t,n),isInGroup:(t,n)=>this.isInGroupMethod(t,n),setLocked:(t,n)=>this.setLocked(t,n),getLocked:t=>this.getLocked(t),isAnnotationLocked:(t,n)=>this.isAnnotationLocked(t,n),isAnnotationInteractive:(t,n)=>this.isAnnotationInteractive(t,n),isAnnotationStructurallyLocked:(t,n)=>this.isAnnotationStructurallyLocked(t,n),isAnnotationContentLocked:(t,n)=>this.isAnnotationContentLocked(t,n),isCategoryLocked:(t,n)=>this.isCategoryLockedMethod(t,n),isToolLocked:(t,n)=>this.isToolLockedMethod(t,n),syncAnnotationObject:(t,n,o)=>this.syncAnnotationObject(t,n,o),navigateTarget:(t,n)=>this.navigateTargetMethod(t,n),forDocument:t=>this.createAnnotationScope(t),getTools:()=>this.state.tools,getTool:t=>this.getTool(t),addTool:t=>{this.dispatch((n=>({type:Xp,payload:n}))(t)),this.registerInteractionForTool(t)},findToolForAnnotation:t=>this.findToolForAnnotation(t),setToolDefaults:(t,n)=>this.dispatch(((o,i)=>({type:Vp,payload:{toolId:o,patch:i}}))(t,n)),getColorPresets:()=>[...this.state.colorPresets],addColorPreset:t=>this.dispatch((n=>({type:Kp,payload:n}))(t)),transformAnnotation:(t,n)=>this.transformAnnotation(t,n),onStateChange:this.state$.onGlobal,onActiveToolChange:this.activeTool$.onGlobal,onAnnotationEvent:this.events$.onGlobal,onToolsChange:this.toolsChange$.on,onNavigate:this.navigate$.onGlobal}}createAnnotationScope(t){return{getState:()=>this.getDocumentState(t),getPageAnnotations:n=>this.getPageAnnotations(n,t),getSelectedAnnotation:()=>this.getSelectedAnnotation(t),getSelectedAnnotations:()=>this.getSelectedAnnotationsMethod(t),getSelectedAnnotationIds:()=>this.getSelectedAnnotationIdsMethod(t),getAnnotationById:n=>this.getAnnotationById(n,t),getAnnotations:n=>this.getAnnotationsMethod(n,t),selectAnnotation:(n,o)=>this.selectAnnotation(n,o,t),toggleSelection:(n,o)=>this.toggleSelectionMethod(n,o,t),addToSelection:(n,o)=>this.addToSelectionMethod(n,o,t),removeFromSelection:n=>this.removeFromSelectionMethod(n,t),setSelection:n=>this.setSelectionMethod(n,t),deselectAnnotation:()=>this.deselectAnnotation(t),getActiveTool:()=>this.getActiveTool(t),setActiveTool:(n,o)=>this.setActiveTool(n,t,o),findToolForAnnotation:n=>
2288this.findToolForAnnotation(n),importAnnotations:n=>this.importAnnotations(n,t),exportAnnotations:n=>this.exportAnnotationsMethod(n,t),createAnnotation:(n,o,i)=>this.createAnnotation(n,o,i,t),updateAnnotation:(n,o,i)=>this.updateAnnotation(n,o,i,t),updateAnnotations:n=>this.updateAnnotationsMethod(n,t),moveAnnotation:(n,o,i,r)=>this.moveAnnotationMethod(n,o,i,r,t),deleteAnnotation:(n,o)=>this.deleteAnnotation(n,o,t),deleteAnnotations:n=>this.deleteAnnotationsMethod(n,t),deleteAllAnnotations:()=>this.deleteAllAnnotationsMethod(t),purgeAnnotation:(n,o)=>this.purgeAnnotationMethod(n,o,t),renderAnnotation:n=>this.renderAnnotation(n,t),getPageAppearances:(n,o)=>this.getPageAppearances(n,o,t),invalidatePageAppearances:n=>this.invalidatePageAppearances(n,t),commit:()=>this.commit(t),getAttachedLinks:n=>this.getAttachedLinksMethod(n,t),hasAttachedLinks:n=>this.hasAttachedLinksMethod(n,t),deleteAttachedLinks:n=>this.deleteAttachedLinksMethod(n,t),groupAnnotations:()=>this.groupAnnotationsMethod(t),ungroupAnnotations:n=>this.ungroupAnnotationsMethod(n,t),getGroupMembers:n=>this.getGroupMembersMethod(n,t),isInGroup:n=>this.isInGroupMethod(n,t),getGroupingAction:()=>this.getGroupingActionMethod(t),setLocked:n=>this.setLocked(n,t),getLocked:()=>this.getLocked(t),isAnnotationLocked:n=>this.isAnnotationLocked(n,t),isAnnotationInteractive:n=>this.isAnnotationInteractive(n,t),isAnnotationStructurallyLocked:n=>this.isAnnotationStructurallyLocked(n,t),isAnnotationContentLocked:n=>this.isAnnotationContentLocked(n,t),isCategoryLocked:n=>this.isCategoryLockedMethod(n,t),isToolLocked:n=>this.isToolLockedMethod(n,t),syncAnnotationObject:(n,o)=>this.syncAnnotationObject(n,o,t),navigateTarget:n=>this.navigateTargetMethod(n,t),onStateChange:this.state$.forScope(t),onAnnotationEvent:this.events$.forScope(t),onActiveToolChange:this.activeTool$.forScope(t),onNavigate:this.navigate$.forScope(t)}}onStoreUpdated(t,n){for(const o in n.documents){const i=t.documents[o],r=n.documents[o];i!==r&&(this.state$.emit(o,r),i&&i.activeToolId!==r.activeToolId&&this.activeTool$.emit(o,this.getActiveTool(o)),i?.selectedUids!==r.selectedUids&&this.updateAnnotationSelectionActivity(o,r))}if(t.tools!==n.tools){for(const o in n.documents)this.activeTool$.emit(o,this.getActiveTool(o));this.toolsChange$.emit({tools:n.tools})}}transformAnnotation(t,n){const o={type:n.type,changes:n.changes,metadata:n.metadata},i=this.findToolForAnnotation(t);return i?.transform?i.transform(t,o):o.changes}registerPageHandlers(t,n,o,i){var r,a;const s=this.getCoreDocument(t),l=(r=s?.document)==null?void 0:r.pages[n];if(!l)return()=>{};if(!this.interactionManager)return()=>{};const c=[],d=((l.rotation??0)+(s?.rotation??0))%4;for(const u of this.state.tools){const m=u.pointerHandler??((a=u.defaults)!=null&&a.type?Cg.defaultHandlerFactories.get(u.defaults.type):void 0);if(!m)continue;const g={pageIndex:n,pageSize:l.size,pageRotation:d,scale:o,services:i.services,onPreview:f=>i.onPreview(u.id,f),onCommit:(f,v)=>{var y,b,w;const x=((y=u.behavior)==null?void 0:y.editAfterCreate)??!1;this.createAnnotation(n,f,v,t,{editAfterCreate:x}),(b=u.behavior)!=null&&b.deactivateToolAfterCreate&&this.setActiveTool(null,t),((w=u.behavior)!=null&&w.selectAfterCreate||x)&&this.selectAnnotation(n,f.id,t)},getTool:()=>this.state.tools.find(f=>f.id===u.id),getToolContext:()=>{var f;return(f=this.state.documents[t])==null?void 0:f.activeToolContext}},p=this.interactionManager.registerHandlers({documentId:t,modeId:u.interaction.mode??u.id,handlers:m.create(g),pageIndex:n});c.push(p)}return()=>c.forEach(u=>u())}getDocumentState(t){const n=t??this.getActiveDocumentId(),o=this.state.documents[n];if(!o)throw new Error(`Annotation state not found for document: ${n}`);return o}getAllAnnotations(t,n){this.engine.getAllAnnotations(n).wait(o=>{this.dispatch(((r,a)=>({type:Ep,payload:{documentId:r,annotations:a}}))(t,o)),this.isInitialLoadComplete.set(t,!0);const i=this.importQueue.get(t);i&&i.length>0&&this.processImportQueue(t),this.events$.emit(t,{type:"loaded",documentId:t,total:Object.values(o).reduce((r,a)=>r+a.length,0)})},et)}getPageAnnotations(t,n){const{pageIndex:o}=t,i=n??this.getActiveDocumentId(),r=this.getCoreDocument(i),a=r?.document;if(!a)return ne.reject({code:H.NotFound,message:"Document not found"});const s=a.pages.find(l=>l.index===o);return s?this.engine.getPageAnnotations(a,s):ne.reject({code:H.NotFound,message:"Page not found"})}getSelectedAnnotation(t){return(n=>n.selectedUids.length>0?n.byUid[n.selectedUids[0]]??null:null)(this.getDocumentState(t))}getAnnotationById(t,n){return((o,i)=>o.byUid[i]??null)(this.getDocumentState(n),t)}getAnnotationsMethod(t,n){const o=this.getDocumentState(n);return t?.pageIndex!==void 0?qa(o,t.pageIndex).filter(i=>i!==void 0):Object.values(o.byUid)}renderAnnotation({pageIndex:t,annotation:n,options:o},i){const r=i??this.getActiveDocumentId(),a=this.getCoreDocument(r),s=a?.document;if(!s)return ne.reject({code:H.NotFound,message:"Document not found"});const l=s.pages.find(c=>c.index===t);return l?this.engine.renderPageAnnotation(s,l,n,o):ne.reject({code:H.NotFound,message:"Page not found"})}getPageAppearances(t,n,o){const i=o??this.getActiveDocumentId(),r=this.getCoreDocument(i),a=r?.document;if(!a)return ne.reject({code:H.NotFound,message:"Document not found"});const s=a.pages.find(m=>m.index===t);if(!s)return ne.reject({code:H.NotFound,message:"Page not found"});let l=this.appearanceCache.get(i);l||(l=new Map,this.appearanceCache.set(i,l));const c=l.get(t);if(c&&!n){const m=new se;return m.resolve(c),m}const d=this.engine.renderPageAnnotations(a,s,n),u=new se;return d.wait(m=>
2288{l.set(t,m),u.resolve(m)},m=>{u.fail(m)}),u}invalidatePageAppearances(t,n){const o=n??this.getActiveDocumentId(),i=this.appearanceCache.get(o);i&&i.delete(t)}invalidateAnnotationAppearance(t,n,o){const i=o??this.getActiveDocumentId(),r=this.appearanceCache.get(i);if(!r)return;const a=r.get(n);a&&delete a[t]}exportAnnotationsMethod(t,n){const o=n??this.getActiveDocumentId(),i=this.getDocumentState(o),r=this.getCoreDocument(o),a=r?.document;if(!a)return ne.reject({code:H.NotFound,message:"Document not found"});const s=t?.pageIndex!==void 0?[t.pageIndex]:Object.keys(i.pages).map(Number),l=[];for(const p of s){const f=i.pages[p]??[];for(const v of f){const y=i.byUid[v];y&&y.commitState!=="deleted"&&l.push({annotation:y.object,pageIndex:p,isStamp:y.object.type===T.STAMP})}}const c=l.filter(p=>p.isStamp);if(c.length===0)return ne.resolve(l.map(p=>({annotation:p.annotation})));const d=ne.create(),u=new Map;let m=c.length,g=!1;for(const p of c){const f=a.pages.find(v=>v.index===p.pageIndex);if(!f){m--;continue}this.engine.exportAnnotationAppearanceAsPdf(a,f,p.annotation).wait(v=>{g||(u.set(p.annotation.id,v),m--,m===0&&d.resolve(l.map(y=>({annotation:y.annotation,...u.has(y.annotation.id)?{ctx:{data:u.get(y.annotation.id),mimeType:"application/pdf"}}:{}}))))},v=>{g||(g=!0,d.reject(v.reason))})}return m===0&&d.resolve(l.map(p=>({annotation:p.annotation}))),d}importAnnotations(t,n){const o=n??this.getActiveDocumentId();if(!this.isInitialLoadComplete.get(o)){const i=this.importQueue.get(o)||[];return i.push(...t),void this.importQueue.set(o,i)}this.processImportItems(o,t)}processImportQueue(t){const n=this.importQueue.get(t);if(!n||n.length===0)return;const o=[...n];this.importQueue.set(t,[]),this.processImportItems(t,o)}
vendor: 19,796 bytes, line 2288
2288processImportItems(t,n){const o=this.pendingContexts.get(t);if(o){for(const i of n){const{annotation:r,ctx:a}=i,s=r.pageIndex,l=r.id;this.dispatch(_i(t,s,r)),a&&o.set(l,a)}this.config.autoCommit!==!1&&this.commit(t)}}createAnnotation(t,n,o,i,r){const a=i??this.getActiveDocumentId();if(!this.checkPermission(a,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","CreateAnnotation",`Cannot create annotation: document ${a} lacks ModifyAnnotations permission`);const s=n.id,l=this.pendingContexts.get(a);if(!l)return;const c={...n,author:n.author??this.config.annotationAuthor},d=r?.editAfterCreate,u=()=>{this.dispatch(_i(a,t,c)),o&&l.set(s,o),this.events$.emit(a,{type:"create",documentId:a,annotation:c,pageIndex:t,ctx:o,committed:!1,editAfterCreate:d})};if(!this.history)return u(),void(this.config.autoCommit&&this.commit(a));const m={execute:u,undo:()=>{l.delete(s),this.dispatch(ma(a)),this.dispatch(fa(a,t,s)),this.events$.emit(a,{type:"delete",documentId:a,annotation:c,pageIndex:t,committed:!1})},metadata:{annotationIds:[s]}};this.history.forDocument(a).register(m,this.ANNOTATION_HISTORY_TOPIC)}buildPatch(t,n){return"rect"in n?n:this.transformAnnotation(t,{type:"property-update",changes:n})}updateAnnotation(t,n,o,i){const r=i??this.getActiveDocumentId();if(!this.checkPermission(r,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","UpdateAnnotation",`Cannot update annotation: document ${r} lacks ModifyAnnotations permission`);const a=this.getDocumentState(r).byUid[n].object,s=this.buildPatch(a,{...o,author:o.author??this.config.annotationAuthor}),l=()=>{this.dispatch($i(r,t,n,s)),this.events$.emit(r,{type:"update",documentId:r,annotation:a,pageIndex:t,patch:s,committed:!1})};if(!this.history)return l(),void(this.config.autoCommit!==!1&&this.commit(r));const c=Object.fromEntries(Object.keys(o).map(u=>[u,a[u]])),d={execute:l,undo:()=>{this.dispatch($i(r,t,n,c)),this.events$.emit(r,{type:"update",documentId:r,annotation:a,pageIndex:t,patch:c,committed:!1})},metadata:{annotationIds:[n]}};this.history.forDocument(r).register(d,this.ANNOTATION_HISTORY_TOPIC)}deleteAnnotation(t,n,o){var i;const r=o??this.getActiveDocumentId();if(!this.checkPermission(r,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","DeleteAnnotation",`Cannot delete annotation: document ${r} lacks ModifyAnnotations permission`);const a=this.getDocumentState(r),s=(i=a.byUid[n])==null?void 0:i.object;if(!s)return;const l=((m,g)=>{const p=[];for(const f of Object.values(m.pages))for(const v of f){const y=m.byUid[v];y&&"inReplyToId"in y.object&&y.object.inReplyToId===g&&p.push({id:y.object.id,pageIndex:y.object.pageIndex})}return p})(a,n),c=l.map(m=>{var g;return(g=a.byUid[m.id])==null?void 0:g.object}).filter(m=>m!==void 0),d=()=>{var m;for(const g of l){const p=(m=a.byUid[g.id])==null?void 0:m.object;p&&(this.dispatch(fa(r,g.pageIndex,g.id)),this.events$.emit(r,{type:"delete",documentId:r,annotation:p,pageIndex:g.pageIndex,committed:!1}))}this.dispatch(ma(r)),this.dispatch(fa(r,t,n)),this.events$.emit(r,{type:"delete",documentId:r,annotation:s,pageIndex:t,committed:!1})};if(!this.history)return d(),void(this.config.autoCommit!==!1&&this.commit(r));const u={execute:d,undo:()=>{this.dispatch(_i(r,t,s)),this.events$.emit(r,{type:"create",documentId:r,annotation:s,pageIndex:t,committed:!1});for(const m of c)this.dispatch(_i(r,m.pageIndex,m)),this.events$.emit(r,{type:"create",documentId:r,annotation:m,pageIndex:m.pageIndex,committed:!1})},metadata:{annotationIds:[n,...l.map(m=>m.id)]}};this.history.forDocument(r).register(u,this.ANNOTATION_HISTORY_TOPIC)}deleteAnnotationsMethod(t,n){for(const{pageIndex:o,id:i}of t)this.deleteAnnotation(o,i,n)}deleteAllAnnotationsMethod(t){const n=t??this.getActiveDocumentId(),o=this.getDocumentState(n),i=[];for(const[r,a]of Object.entries(o.pages))for(const s of a){const l=o.byUid[s];l&&i.push({pageIndex:Number(r),id:l.object.id})}i.length>0&&this.deleteAnnotationsMethod(i,n)}purgeAnnotationMethod(t,n,o){const i=o??this.getActiveDocumentId();this.dispatch(va(i,t,n))}selectAnnotation(t,n,o){const i=o??this.getActiveDocumentId(),r=this.getAnnotationById(n,i);if(!r||this.isAnnotationSelectable(r.object,i))if(this.isInGroupMethod(n,i)){const a=this.getGroupMembersMethod(n,i).map(s=>s.object.id);this.dispatch(ga(i,a))}else this.dispatch(((a,s,l)=>({type:zp,payload:{documentId:a,pageIndex:s,id:l}}))(i,t,n))}deselectAnnotation(t){const n=t??this.getActiveDocumentId();this.dispatch(ma(n))}updateAnnotationSelectionActivity(t,n){var o,i;if(n.selectedUids.length===0)return void((o=this.interactionManager)==null||o.releasePageActivity(t,"annotation-selection"));const r=n.selectedUids[0],a=n.byUid[r];a&&((i=this.interactionManager)==null||i.claimPageActivity(t,"annotation-selection",a.object.pageIndex))}getSelectedAnnotationsMethod(t){return ii(this.getDocumentState(t))}getSelectedAnnotationIdsMethod(t){return Ka(this.getDocumentState(t))}toggleSelectionMethod(t,n,o){const i=o??this.getActiveDocumentId(),r=this.getAnnotationById(n,i);if(r&&!this.isAnnotationSelectable(r.object,i))return;const a=this.getDocumentState(i);if(a.selectedUids.includes(n))this.dispatch(Hc(i,n));else if(this.isInGroupMethod(n,i)){const s=this.getGroupMembersMethod(n,i);for(const l of s)a.selectedUids.includes(l.object.id)||this.dispatch(pa(i,l.object.pageIndex,l.object.id))}else this.dispatch(pa(i,t,n))}addToSelectionMethod(t,n,o){const i=o??this.getActiveDocumentId(),r=this.getAnnotationById(n,i);r&&!this.isAnnotationInteractive(r.object,i)||this.dispatch(pa(i,t,n))}removeFromSelectionMethod(t,n){const o=n??this.getActiveDocumentId();this.dispatch(Hc(o,t))}setSelectionMethod(t,n){const o=n??this.getActiveDocumentId(),i=this.getDocumentState(o),r=t.filter(a=>{const s=i.byUid[a];return!s||this.isAnnotationInteractive(s.object,o)});this.dispatch(ga(o,r))}getAttachedLinksMethod(t,n){return y0(this.getDocumentState(n),t)}hasAttachedLinksMethod(t,n){return this.getAttachedLinksMethod(t,n).length>0}deleteAttachedLinksMethod(t,n){const o=this.getAttachedLinksMethod(t,n);for(const i of o)this.deleteAnnotation(i.object.pageIndex,i.object.id,n)}groupAnnotationsMethod(t){const n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","GroupAnnotations",`Cannot group annotations: document ${n} lacks ModifyAnnotations permission`);const o=this.getSelectedAnnotationsMethod(n);if(o.length<2)return void this.logger.debug("AnnotationPlugin","GroupAnnotations","Need at least 2 annotations to group");const i=o[0],r=o.slice(1).map(a=>({pageIndex:a.object.pageIndex,id:a.object.id,patch:{inReplyToId:i.object.id,replyType:Ut.Group}}));this.updateAnnotationsMethod(r,n)}ungroupAnnotationsMethod(t,n){const o=n??this.getActiveDocumentId();if(!this.checkPermission(o,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","UngroupAnnotations",`Cannot ungroup annotations: document ${o} lacks ModifyAnnotations permission`);const i=this.getGroupMembersMethod(t,o).filter(r=>r.object.inReplyToId&&r.object.replyType===Ut.Group).map(r=>({pageIndex:r.object.pageIndex,id:r.object.id,patch:{inReplyToId:void 0,replyType:void 0}}));i.length>0&&this.updateAnnotationsMethod(i,o)}getGroupMembersMethod(t,n){return Vc(this.getDocumentState(n),t)}isInGroupMethod(t,n){return Xc(this.getDocumentState(n),t)}getGroupingActionMethod(t){return(n=>{const o=ii(n);if(o.length===0)return"disabled";const i=o[0].object.id;if(Xc(n,i)){const r=Vc(n,i),a=new Set(r.map(s=>s.object.id));if(o.every(s=>a.has(s.object.id)))return"ungroup"}return o.length>=2?"group":"disabled"})(this.getDocumentState(t))}computeCombinedConstraints(t){let n=1/0,o=1/0,i=1/0,r=1/0;for(const a of t){const s=a.rect.origin.y,l=a.pageSize.height-(a.rect.origin.y+a.rect.size.height),c=a.rect.origin.x,d=a.pageSize.width-(a.rect.origin.x+a.rect.size.width);n=Math.min(n,s),o=Math.min(o,l),i=Math.min(i,c),r=Math.min(r,d)}return isFinite(n)||(n=0),isFinite(o)||(o=0),isFinite(i)||(i=0),isFinite(r)||(r=0),{maxUp:n,maxDown:o,maxLeft:i,maxRight:r}}clampDelta(t,n){return{x:Math.max(-n.maxLeft,Math.min(n.maxRight,t.x)),y:Math.max(-n.maxUp,Math.min(n.maxDown,t.y))}}startDrag(t,n){const{annotationIds:o,pageSize:i}=n,r=[];for(const d of o){const u=this.getAttachedLinksMethod(d,t);for(const m of u)r.includes(m.object.id)||r.push(m.object.id)}const a=[...o,...r],s=new Map,l=[];for(const d of a){const u=this.getAnnotationById(d,t);u&&(s.set(d,{...u.object.rect}),l.push({id:d,rect:u.object.rect,pageIndex:u.object.pageIndex,pageSize:i}))}const c={documentId:t,isDragging:!0,primaryIds:o,attachedLinkIds:r,allParticipantIds:a,originalRects:s,delta:{x:0,y:0},combinedConstraints:this.computeCombinedConstraints(l)};this.unifiedDragStates.set(t,c),this.unifiedDrag$.emit({documentId:t,type:"start",state:c,previewPatches:{}})}computeDragPreviewPatches(t,n){const o={};for(const i of t.allParticipantIds){const r=this.getAnnotationById(i,n);if(!r)continue;const a=t.originalRects.get(i);if(!a)continue;const s={...a,origin:{x:a.origin.x+t.delta.x,y:a.origin.y+t.delta.y}};o[i]=this.transformAnnotation(r.object,{type:"move",changes:{rect:s}})}return o}updateDrag(t,n){const o=this.unifiedDragStates.get(t);if(!o?.isDragging)return{x:0,y:0};const i=this.clampDelta(n,o.combinedConstraints),r={...o,delta:i};this.unifiedDragStates.set(t,r);const a=this.computeDragPreviewPatches(r,t);return this.unifiedDrag$.emit({documentId:t,type:"update",state:r,previewPatches:a}),i}commitDrag(t){const n=this.unifiedDragStates.get(t);if(!n)return;const o=n.delta;if(o.x!==0||o.y!==0){const r=[];for(const a of n.allParticipantIds){const s=this.getAnnotationById(a,t);if(!s)continue;const l=n.originalRects.get(a)??s.object.rect,c={...l,origin:{x:l.origin.x+o.x,y:l.origin.y+o.y}},d=this.transformAnnotation(s.object,{type:"move",changes:{rect:c}});r.push({pageIndex:s.object.pageIndex,id:a,patch:d})}r.length>0&&this.moveAnnotationsMethod(r,t)}const i=this.computeDragPreviewPatches(n,t);this.unifiedDrag$.emit({documentId:t,type:"end",state:{...n,isDragging:!1},previewPatches:i}),this.unifiedDragStates.delete(t)}cancelDrag(t){const n=this.unifiedDragStates.get(t);n&&(this.unifiedDrag$.emit({documentId:t,type:"cancel",state:{...n,isDragging:!1,delta:{x:0,y:0}},previewPatches:{}}),this.unifiedDragStates.delete(t))}getDragState(t){return this.unifiedDragStates.get(t)??null}get onDragChange(){return this.unifiedDrag$.on}computeUnifiedGroupBoundingBox(t){if(t.length===0)return{origin:{x:0,y:0},size:{width:0,height:0}};let n=1/0,o=1/0,i=-1/0,r=-1/0;for(const a of t)n=Math.min(n,a.origin.x),o=Math.min(o,a.origin.y),i=Math.max(i,a.origin.x+a.size.width),r=Math.max(r,a.origin.y+a.size.height);return{origin:{x:n,y:o},size:{width:i-n,height:r-o}}}computeUnifiedRelativePositions(t,n){return t.map(o=>({id:o.id,originalRect:o.rect,originalUnrotatedRect:o.unrotatedRect,pageIndex:o.pageIndex,isAttachedLink:o.isAttachedLink,parentId:o.parentId,relativeX:n.size.width>0?(o.rect.origin.x-n.origin.x)/n.size.width:0,relativeY:n.size.height>0?(o.rect.origin.y-n.origin.y)/n.size.height:0,relativeWidth:n.size.width>0?o.rect.size.width/n.size.width:1,relativeHeight:n.size.height>0?o.rect.size.height/n.size.height:1}))}computeUnifiedResizedRects(t,n,o=10){const i=new Map;for(const r of t){const a=Math.max(o,r.relativeWidth*n.size.width),s=Math.max(o,r.relativeHeight*n.size.height);i.set(r.id,{origin:{x:n.origin.x+r.relativeX*n.size.width,y:n.origin.y+r.relativeY*n.size.height},size:{width:a,height:s}})}return i}computeResizePreviewPatches(t,n){const o={},i=this.unifiedResizeStates.get(n),r=i?new Map(i.participatingAnnotations.map(a=>[a.id,a])):void 0;for(const[a,s]of t){const l=this.getAnnotationById(a,n);if(!l)continue;let c=s;const d=r?.get(a);i?.isGroupResize&&d?.originalUnrotatedRect&&(c=Jc(s,d.originalRect,d.originalUnrotatedRect,l.object.rotation??0)),o[a]=this.transformAnnotation(l.object,{type:"resize",changes:{rect:c}})}return o}startResize(t,n){const{annotationIds:o,pageSize:i,resizeHandle:r}=n,a=[],s=[];for(const f of o){const v=this.getAnnotationById(f,t);if(v){s.push({id:f,rect:v.object.rect,unrotatedRect:v.object.unrotatedRect?this.cloneRect(v.object.unrotatedRect):void 0,pageIndex:v.object.pageIndex,isAttachedLink:!1});const y=this.getAttachedLinksMethod(f,t);for(const b of y)a.includes(b.object.id)||(a.push(b.object.id),s.push({id:b.object.id,rect:b.object.rect,unrotatedRect:b.object.unrotatedRect?this.cloneRect(b.object.unrotatedRect):void 0,pageIndex:b.object.pageIndex,isAttachedLink:!0,parentId:f}))}}const l=[...o,...a],c=s.map(f=>f.rect),d=this.computeUnifiedGroupBoundingBox(c),u=this.computeUnifiedRelativePositions(s,d),m=this.computeUnifiedResizedRects(u,d),g={documentId:t,isResizing:!0,isGroupResize:o.length>1,primaryIds:o,attachedLinkIds:a,allParticipantIds:l,originalGroupBox:d,currentGroupBox:d,participatingAnnotations:u,resizeHandle:r,computedRects:m};this.unifiedResizeStates.set(t,g);const p=this.computeResizePreviewPatches(m,t);this.unifiedResize$.emit({documentId:t,type:"start",state:g,computedRects:Object.fromEntries(m),previewPatches:p})}updateResize(t,n){const o=this.unifiedResizeStates.get(t);if(!o?.isResizing)return{};const i=this.computeUnifiedResizedRects(o.participatingAnnotations,n),r={...o,currentGroupBox:n,computedRects:i};this.unifiedResizeStates.set(t,r);const a=Object.fromEntries(i),s=this.computeResizePreviewPatches(i,t);return this.unifiedResize$.emit({documentId:t,type:"update",state:r,computedRects:a,previewPatches:s}),a}commitResize(t){const n=this.unifiedResizeStates.get(t);if(!n)return;const o=this.computeUnifiedResizedRects(n.participatingAnnotations,n.currentGroupBox),i=[],r=new Map(n.participatingAnnotations.map(s=>[s.id,s]));for(const[s,l]of o){const c=this.getAnnotationById(s,t);if(!c)continue;let d=l;const u=r.get(s);n.isGroupResize&&u?.originalUnrotatedRect&&(d=Jc(l,u.originalRect,u.originalUnrotatedRect,c.object.rotation??0));const m=this.transformAnnotation(c.object,{type:"resize",changes:{rect:d}});i.push({pageIndex:c.object.pageIndex,id:s,patch:m})}i.length>0&&this.updateAnnotationsMethod(i,t);const a=this.computeResizePreviewPatches(o,t);this.unifiedResize$.emit({documentId:t,type:"end",state:{...n,isResizing:!1},computedRects:Object.fromEntries(o),previewPatches:a}),this.unifiedResizeStates.delete(t)}cancelResize(t){const n=this.unifiedResizeStates.get(t);if(!n)return;const o=this.computeUnifiedResizedRects(n.participatingAnnotations,n.originalGroupBox);this.unifiedResize$.emit({documentId:t,type:"cancel",state:{...n,isResizing:!1,currentGroupBox:n.originalGroupBox},computedRects:Object.fromEntries(o),previewPatches:{}}),this.unifiedResizeStates.delete(t)}getResizeState(t){return this.unifiedResizeStates.get(t)??null}get onResizeChange(){return this.unifiedResize$.on}cloneRect(t){return{origin:{x:t.origin.x,y:t.origin.y},size:{width:t.size.width,height:t.size.height}}}translateRect(t,n){return{origin:{x:t.origin.x+n.x,y:t.origin.y+n.y},size:{...t.size}}}normalizeAngle(t){const n=t%360;return n<0?n+360:n}normalizeDelta(t){return(t+540)%360-180}buildRotationParticipants(t,n){const o=[],i=[];for(const r of t){const a=this.getAnnotationById(r,n);if(!a)continue;o.push({id:r,rect:this.cloneRect(a.object.rect),pageIndex:a.object.pageIndex,rotation:a.object.rotation??0,unrotatedRect:a.object.unrotatedRect?this.cloneRect(a.object.unrotatedRect):void 0,isAttachedLink:!1});const s=this.getAttachedLinksMethod(r,n);for(const l of s)i.includes(l.object.id)||(i.push(l.object.id),o.push({id:l.object.id,rect:this.cloneRect(l.object.rect),pageIndex:l.object.pageIndex,rotation:l.object.rotation??0,unrotatedRect:l.object.unrotatedRect?this.cloneRect(l.object.unrotatedRect):void 0,isAttachedLink:!0,parentId:r}))}return{participants:o,attachedLinkIds:i}}computeRotatePreviewPatches(t,n){const o={};for(const i of t.participants){const r=this.getAnnotationById(i.id,n);if(!r)continue;const a=Fn({rect:i.rect,unrotatedRect:i.unrotatedRect,rotation:i.rotation}),s=eo(a,t.rotationCenter,t.delta),l={x:s.x-a.x,y:s.y-a.y},c=this.normalizeAngle(i.rotation+t.delta),d=this.transformAnnotation(r.object,{type:"rotate",changes:{rotation:c,unrotatedRect:this.translateRect(i.unrotatedRect??i.rect,l)},metadata:{rotationAngle:c,rotationDelta:t.delta,rotationCenter:t.rotationCenter}});d.rect||l.x===0&&l.y===0||(d.rect={origin:{x:r.object.rect.origin.x+l.x,y:r.object.rect.origin.y+l.y},size:{...r.object.rect.size}}),o[i.id]=d}return o}startRotation(t,n){const{annotationIds:o,cursorAngle:i,rotationCenter:r}=n,{participants:a,attachedLinkIds:s}=this.buildRotationParticipants(o,t);if(a.length===0)return;const l=a.map(g=>g.rect),c=this.computeUnifiedGroupBoundingBox(l),d=r??{x:c.origin.x+c.size.width/2,y:c.origin.y+c.size.height/2},u={documentId:t,isRotating:!0,primaryIds:o,attachedLinkIds:s,allParticipantIds:a.map(g=>g.id),rotationCenter:d,cursorStartAngle:i,currentAngle:i,delta:0,participants:a};this.unifiedRotateStates.set(t,u);const m=this.computeRotatePreviewPatches(u,t);this.unifiedRotate$.emit({documentId:t,type:"start",state:u,previewPatches:m})}updateRotation(t,n,o){const i=this.unifiedRotateStates.get(t);if(!i?.isRotating)return;const r=o!==void 0?o:this.normalizeDelta(n-i.cursorStartAngle),a={...i,currentAngle:n,delta:r};this.unifiedRotateStates.set(t,a);const s=this.computeRotatePreviewPatches(a,t);this.unifiedRotate$.emit({documentId:t,type:"update",state:a,previewPatches:s})}commitRotation(t){const n=this.unifiedRotateStates.get(t);if(!n)return;const o=this.computeRotatePreviewPatches(n,t),i=[];for(const[r,a]of Object.entries(o)){const s=this.getAnnotationById(r,t);s&&i.push({pageIndex:s.object.pageIndex,id:r,patch:a})}i.length>0&&this.updateAnnotationsMethod(i,t),this.unifiedRotate$.emit({documentId:t,type:"end",state:{...n,isRotating:!1},previewPatches:o}),this.unifiedRotateStates.delete(t)}cancelRotation(t){const n=this.unifiedRotateStates.get(t);n&&(this.unifiedRotate$.emit({documentId:t,type:"cancel",state:{...n,isRotating:!1,delta:0,currentAngle:n.cursorStartAngle},previewPatches:{}}),this.unifiedRotateStates.delete(t))}getRotateState(t){return this.unifiedRotateStates.get(t)??null}get onRotateChange(){return this.unifiedRotate$.on}updateAnnotationsMethod(t,n){const o=n??this.getActiveDocumentId();if(!this.checkPermission(o,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","UpdateAnnotations",`Cannot update annotations: document ${o} lacks ModifyAnnotations permission`);const i=this.getDocumentState(o),r=t.map(({pageIndex:c,id:d,patch:u})=>{var m;const g=(m=i.byUid[d])==null?void 0:m.object;return g?{pageIndex:c,id:d,patch:this.buildPatch(g,{...u,author:u.author??this.config.annotationAuthor}),originalObject:g}:null}).filter(c=>c!==null);if(r.length===0)return;const a=()=>{for(const{pageIndex:c,id:d,patch:u,originalObject:m}of r)this.dispatch($i(o,c,d,u)),this.events$.emit(o,{type:"update",documentId:o,annotation:m,pageIndex:c,patch:u,committed:!1})};if(!this.history)return a(),void(this.config.autoCommit!==!1&&this.commit(o));const s=r.map(({pageIndex:c,id:d,patch:u,originalObject:m})=>({pageIndex:c,id:d,originalPatch:Object.fromEntries(Object.keys(u).map(g=>[g,m[g]])),originalObject:m})),l={execute:a,undo:()=>{for(const{pageIndex:c,id:d,originalPatch:u,originalObject:m}of s)this.dispatch($i(o,c,d,u)),this.events$.emit(o,{type:"update",documentId:o,annotation:m,pageIndex:c,patch:u,committed:!1})},metadata:{annotationIds:r.map(c=>c.id)}};this.history.forDocument(o).register(l,this.ANNOTATION_HISTORY_TOPIC)}moveAnnotationsMethod(t,n){const o=n??this.getActiveDocumentId();if(!this.checkPermission(o,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","MoveAnnotations",`Cannot move annotations: document ${o} lacks ModifyAnnotations permission`);
2288const i=this.getDocumentState(o),r=t.map(({pageIndex:c,id:d,patch:u})=>{var m;const g=(m=i.byUid[d])==null?void 0:m.object;return g?{pageIndex:c,id:d,patch:u,originalObject:g}:null}).filter(c=>c!==null);if(r.length===0)return;const a=()=>{for(const{pageIndex:c,id:d,patch:u,originalObject:m}of r)this.dispatch(qc(o,c,d,u)),this.events$.emit(o,{type:"update",documentId:o,annotation:m,pageIndex:c,patch:u,committed:!1})};if(!this.history)return a(),void(this.config.autoCommit!==!1&&this.commit(o));const s=r.map(({pageIndex:c,id:d,patch:u,originalObject:m})=>({pageIndex:c,id:d,originalPatch:Object.fromEntries(Object.keys(u).map(g=>[g,m[g]])),originalObject:m})),l={execute:a,undo:()=>{for(const{pageIndex:c,id:d,originalPatch:u,originalObject:m}of s)this.dispatch(qc(o,c,d,u)),this.events$.emit(o,{type:"update",documentId:o,annotation:m,pageIndex:c,patch:u,committed:!1})},metadata:{annotationIds:r.map(c=>c.id)}};this.history.forDocument(o).register(l,this.ANNOTATION_HISTORY_TOPIC)}moveAnnotationMethod(t,n,o,i="delta",r){const a=r??this.getActiveDocumentId(),s=this.getAnnotationById(n,a);if(!s)return;const l=s.object.rect,c={...l,origin:i==="absolute"?{x:o.x,y:o.y}:{x:l.origin.x+o.x,y:l.origin.y+o.y}},d=this.transformAnnotation(s.object,{type:"move",changes:{rect:c}});this.moveAnnotationsMethod([{pageIndex:t,id:n,patch:d}],a)}getActiveTool(t){const n=this.getDocumentState(t);return n.activeToolId?this.state.tools.find(o=>o.id===n.activeToolId)??null:null}setActiveTool(t,n,o){var i,r;const a=n??this.getActiveDocumentId();if(t!==null&&!this.checkPermission(a,U.ModifyAnnotations))return void this.logger.debug("AnnotationPlugin","SetActiveTool",`Cannot activate tool: document ${a} lacks ModifyAnnotations permission`);const s=this.getDocumentState(a);if(t===s.activeToolId&&!o)return;this.dispatch(Gc(a,t,o));const l=this.state.tools.find(c=>c.id===t);l?(i=this.interactionManager)==null||i.forDocument(a).activate(l.interaction.mode??l.id):(r=this.interactionManager)==null||r.forDocument(a).activateDefaultMode()}getTool(t){return this.state.tools.find(n=>n.id===t)}findToolForAnnotation(t){let n=null,o=0;for(const i of this.state.tools){const r=i.matchScore(t);r>o&&(o=r,n=i)}return n}setLocked(t,n){const o=n??this.getActiveDocumentId();this.dispatch(((a,s)=>({type:Gp,payload:{documentId:a,mode:s}}))(o,t));const i=this.getDocumentState(o),r=i.selectedUids.filter(a=>{const s=i.byUid[a];return!!s&&!this.isAnnotationInteractive(s.object,o)});if(r.length>0){const a=i.selectedUids.filter(s=>!r.includes(s));this.dispatch(ga(o,a))}}getLocked(t){return this.getDocumentState(t).locked}isAnnotationLocked(t,n){return Kc(t)?!0:ji(ya(this.findToolForAnnotation(t)),this.getLocked(n))}isAnnotationInteractive(t,n){return Yp(t)||Qp(t)||(function(o){var i;return((i=o.flags)==null?void 0:i.includes("readOnly"))??!1})(t)?!1:!ji(ya(this.findToolForAnnotation(t)),this.getLocked(n))}isAnnotationStructurallyLocked(t,n){return!this.isAnnotationInteractive(t,n)||Kc(t)}isAnnotationContentLocked(t,n){return!this.isAnnotationInteractive(t,n)||(function(o){var i;return((i=o.flags)==null?void 0:i.includes("lockedContents"))??!1})(t)}isAnnotationSelectable(t,n){return this.isAnnotationInteractive(t,n)}isCategoryLockedMethod(t,n){return ji([t],this.getLocked(n))}isToolLockedMethod(t,n){const o=this.getTool(t);return o?ji(ya(o),this.getLocked(n)):!1}syncAnnotationObject(t,n,o){const i=o??this.getActiveDocumentId();this.dispatch(((r,a,s)=>({type:qp,payload:{documentId:r,id:a,patch:s}}))(i,t,n))}navigateTargetMethod(t,n){var o;const i=n??this.getActiveDocumentId(),r=l=>(this.navigate$.emit(i,{documentId:i,result:l,target:t}),ne.resolve(l));let a;if(t.type==="destination")a=t.destination;else if(t.type==="action"){const l=t.action;if(l.type!==zn.Goto&&l.type!==zn.RemoteGoto)return l.type===zn.URI?r({outcome:"uri",uri:l.uri}):r({outcome:"unsupported"});a=l.destination}if(!a)return r({outcome:"unsupported"});if(!this.scroll)return r({outcome:"destination",destination:a});const s=this.scroll.forDocument(i);if(a.zoom.mode===Sr.XYZ){const l=this.getCoreDocument(i),c=(o=l?.document)==null?void 0:o.pages.find(d=>d.index===a.pageIndex);s.scrollToPage({pageNumber:a.pageIndex+1,pageCoordinates:c&&a.zoom.params?{x:a.zoom.params.x,y:c.size.height-a.zoom.params.y}:void 0,behavior:"smooth"})}else s.scrollToPage({pageNumber:a.pageIndex+1,behavior:"smooth"});return r({outcome:"navigated"})}collectPendingChanges(t,n){const o=this.getDocumentState(t),i=this.pendingContexts.get(t),r={creations:[],updates:[],deletions:[],committedUids:[],isEmpty:!0};for(const[a,s]of Object.entries(o.byUid)){if(s.commitState==="synced")continue;if(n.pages.find(c=>c.index===s.object.pageIndex))switch(r.committedUids.push(a),r.isEmpty=!1,s.commitState){case"new":r.creations.push({uid:a,ta:s,ctx:i?.get(s.object.id)});break;case"moved":r.updates.push({uid:a,ta:s,moved:!0});break;case"dirty":r.updates.push({uid:a,ta:s});break;case"deleted":r.deletions.push({uid:a,ta:s})}}return r}executeCommitBatch(t,n,o){const i=new se,r=this.pendingContexts.get(t),a=[];for(const{uid:l,ta:c,ctx:d}of o.creations){const u=n.pages.find(g=>g.index===c.object.pageIndex);if(!u)continue;const m=this.engine.createPageAnnotation(n,u,c.object,d);a.push({type:"create",task:m,ta:c,uid:l,ctx:d})}for(const{uid:l,ta:c,moved:d}of o.updates){const u=n.pages.find(g=>g.index===c.object.pageIndex);if(!u)continue;const m=d?this.engine.updatePageAnnotation(n,u,c.object,{regenerateAppearance:!1}):this.engine.updatePageAnnotation(n,u,c.object);a.push({type:"update",task:m,ta:c,uid:l,moved:d})}for(const{uid:l,ta:c}of o.deletions){const d=n.pages.find(u=>u.index===c.object.pageIndex);if(d)if(c.object.id){const u=new se;this.engine.removePageAnnotation(n,d,c.object).wait(()=>u.resolve(!0),u.fail),a.push({type:"delete",task:u,ta:c,uid:l})}else this.dispatch(va(t,c.object.pageIndex,l))}
vendor: 11,733 bytes, line 2288
2288const s=a.map(l=>l.task);return se.allSettled(s).wait(()=>{this.emitCommitEvents(t,a,r);for(const d of a)d.type==="update"&&d.moved||d.type!=="create"&&d.type!=="update"&&d.type!=="delete"||this.invalidateAnnotationAppearance(d.ta.object.id,d.ta.object.pageIndex,t);var l,c;this.dispatch((l=t,c=o.committedUids,{type:Wp,payload:{documentId:l,committedUids:c}})),i.resolve(!0)},l=>i.fail(l)),i}emitCommitEvents(t,n,o){for(const i of n)if(i.task.state.stage===Tn.Resolved)switch(i.type){case"create":this.events$.emit(t,{type:"create",documentId:t,annotation:i.ta.object,pageIndex:i.ta.object.pageIndex,ctx:i.ctx,committed:!0}),o?.delete(i.ta.object.id);break;case"update":this.events$.emit(t,{type:"update",documentId:t,annotation:i.ta.object,pageIndex:i.ta.object.pageIndex,patch:i.ta.object,committed:!0});break;case"delete":this.dispatch(va(t,i.ta.object.pageIndex,i.uid)),this.events$.emit(t,{type:"delete",documentId:t,annotation:i.ta.object,pageIndex:i.ta.object.pageIndex,committed:!0})}}acquireCommitLock(t){return!this.commitInProgress.get(t)&&(this.commitInProgress.set(t,!0),!0)}releaseCommitLock(t){this.commitInProgress.set(t,!1)}commit(t){const n=t??this.getActiveDocumentId();if(!this.getDocumentState(n).hasPendingChanges||!this.acquireCommitLock(n))return ne.resolve(!0);const o=this.getCoreDocument(n),i=o?.document;if(!i)return this.releaseCommitLock(n),ne.reject({code:H.NotFound,message:"Document not found"});const r=this.collectPendingChanges(n,i);if(r.isEmpty)return this.releaseCommitLock(n),ne.resolve(!0);const a=new se;return this.executeCommitBatch(n,i,r).wait(()=>{this.releaseCommitLock(n),this.getDocumentState(n).hasPendingChanges?this.commit(n).wait(s=>a.resolve(s),s=>a.fail(s)):a.resolve(!0)},s=>{this.releaseCommitLock(n),a.fail(s)}),a}};Ja.id="annotation",Ja.defaultHandlerFactories=new Map([[T.CIRCLE,bg],[T.SQUARE,vg],[T.STAMP,yg],[T.POLYGON,fg],[T.POLYLINE,gg],[T.LINE,Qa],[T.INK,Va],[T.FREETEXT,pg],[T.TEXT,mg],[T.LINK,wg]]);let Wr=Ja;function Ft(e,t,n){return e===void 0?n:typeof e=="function"?e(t):e}function Hr(e){return t=>t?.id===e}const V0=Hr("highlight"),X0=Hr("squiggly"),Z0=Hr("underline"),Y0=Hr("strikeout"),Q0={manifest:g0,create:(e,t)=>new Wr(Y,e,t),reducer:(e,t)=>{switch(t.type){case Tp:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case Rp:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"ANNOTATION/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Ep:{const{documentId:n,annotations:o}=t.payload,i=e.documents[n];if(!i)return e;const r={},a={};for(const[s,l]of Object.entries(o)){const c=Number(s),d=i.pages[c]||[];for(const m of d)delete a[m];const u=l.map(m=>{const g=m.id;return a[g]={commitState:"synced",object:m},g});r[c]=u}return{...e,documents:{...e.documents,[n]:{...i,pages:r,byUid:a}}}}case zp:{const{documentId:n,id:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedUids:[o],selectedUid:o}}}:e}case Lp:{const{documentId:n}=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,selectedUids:[],selectedUid:null}}}:e}case Np:{const{documentId:n,id:o}=t.payload,i=e.documents[n];if(!i||i.selectedUids.includes(o))return e;const r=[...i.selectedUids,o];return{...e,documents:{...e.documents,[n]:{...i,selectedUids:r,selectedUid:wa(r)}}}}case Op:{const{documentId:n,id:o}=t.payload,i=e.documents[n];if(!i)return e;const r=i.selectedUids.filter(a=>a!==o);return{...e,documents:{...e.documents,[n]:{...i,selectedUids:r,selectedUid:wa(r)}}}}case Fp:{const{documentId:n,ids:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedUids:o,selectedUid:wa(o)}}}:e}case _p:{const{documentId:n,toolId:o,context:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,activeToolId:o,activeToolContext:i}}}:e}case $p:{const{documentId:n,pageIndex:o,annotation:i}=t.payload,r=e.documents[n];if(!r)return e;const a=i.id;return{...e,documents:{...e.documents,[n]:{...r,pages:{...r.pages,[o]:[...r.pages[o]??[],a]},byUid:{...r.byUid,[a]:{commitState:"new",object:i,dictMode:!0}},hasPendingChanges:!0}}}}case Bp:{const{documentId:n,pageIndex:o,id:i}=t.payload,r=e.documents[n];return r&&r.byUid[i]?{...e,documents:{...e.documents,[n]:{...r,pages:{...r.pages,[o]:(r.pages[o]??[]).filter(a=>a!==i)},byUid:{...r.byUid,[i]:{...r.byUid[i],commitState:"deleted"}},hasPendingChanges:!0}}}:e}case jp:{const{documentId:n,id:o,patch:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:q0(r,o,i)}}:e}case Up:{const{documentId:n,id:o,patch:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:K0(r,o,i)}}:e}case Wp:{const{documentId:n,committedUids:o}=t.payload,i=e.documents[n];if(!i)return e;const r=new Set(o),a={};let s=!1;for(const[l,c]of Object.entries(i.byUid))r.has(l)?a[l]={...c,commitState:c.commitState==="dirty"||c.commitState==="new"||c.commitState==="moved"?"synced":c.commitState}:(a[l]=c,c.commitState!=="new"&&c.commitState!=="dirty"&&c.commitState!=="moved"&&c.commitState!=="deleted"||(s=!0));return{...e,documents:{...e.documents,[n]:{...i,byUid:a,hasPendingChanges:s}}}}case Hp:{const{documentId:n,pageIndex:o,uid:i}=t.payload,r=e.documents[n];if(!r||!r.byUid[i])return e;const{[i]:a,...s}=r.byUid;return{...e,documents:{...e.documents,[n]:{...r,pages:{...r.pages,[o]:(r.pages[o]??[]).filter(l=>l!==i)},byUid:s}}}}case Gp:{const{documentId:n,mode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,locked:o}}}:e}case qp:{const{documentId:n,id:o,patch:i}=t.payload,r=e.documents[n];if(!r)return e;const a=r.byUid[o];return a?{...e,documents:{...e.documents,[n]:{...r,byUid:{...r.byUid,[o]:{...a,object:{...a.object,...i}}}}}}:e}case Xp:{const n=new Map(e.tools.map(o=>[o.id,o]));return n.set(t.payload.id,t.payload),{...e,tools:Array.from(n.values())}}case Vp:{const{toolId:n,patch:o}=t.payload;return{...e,tools:e.tools.map(i=>i.id===n?{...i,defaults:{...i.defaults,...o}}:i)}}case Kp:return e.colorPresets.includes(t.payload)?e:{...e,colorPresets:[...e.colorPresets,t.payload]};default:return e}},initialState:(e,t)=>(n=>{const o=new Map;H0.forEach(a=>o.set(a.id,a));const i=new Map(o);(n.tools||[]).forEach(a=>{const s=o.get(a.id);s?i.set(a.id,{...s,...a,defaults:{...s.defaults,...a.defaults},interaction:{...s.interaction,...a.interaction},behavior:{...s.behavior,...a.behavior},...s.clickBehavior||a.clickBehavior?{clickBehavior:{...s.clickBehavior,...a.clickBehavior}}:{}}):i.set(a.id,a)});const r=Array.from(i.values()).map(a=>{var s,l,c;return{...a,behavior:{...a.behavior,deactivateToolAfterCreate:((s=a.behavior)==null?void 0:s.deactivateToolAfterCreate)??n.deactivateToolAfterCreate??!1,selectAfterCreate:((l=a.behavior)==null?void 0:l.selectAfterCreate)??n.selectAfterCreate??!0,editAfterCreate:((c=a.behavior)==null?void 0:c.editAfterCreate)??n.editAfterCreate??!1}}});return{documents:{},activeDocumentId:null,tools:r,colorPresets:n.colorPresets??G0}})(t)};function id(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function rd(e,t){this.props=e,this.context=t}(rd.prototype=new Jt).isPureReactComponent=!0,rd.prototype.shouldComponentUpdate=function(e,t){return id(this.props,e)||id(this.state,t)};var ad=Ce.__b;Ce.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ad&&ad(e)};var J0=Ce.__e;Ce.__e=function(e,t,n,o){if(e.then){for(var i,r=t;r=r.__;)if((i=r.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}J0(e,t,n,o)};var sd=Ce.unmount;function Ig(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=(function(o,i){for(var r in i)o[r]=i[r];return o})({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Ig(o,t,n)})),e}function Sg(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Sg(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function xa(){this.__u=0,this.o=null,this.__b=null}function Ag(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Bi(){this.i=null,this.l=null}Ce.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),sd&&sd(e)},(xa.prototype=new Jt).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var i=Ag(o.__v),r=!1,a=function(){r||o.__z||(r=!0,n.__R=null,i?i(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=Sg(c,c.__c.__P,c.__c.__O)}var d;for(o.setState({__a:o.__b=null});d=o.o.pop();)d.__P=s,d.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},xa.prototype.componentWillUnmount=function(){this.o=[]},xa.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ig(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&h(de,null,e.fallback);return i&&(i.__u&=-33),[h(de,null,t.__a?null:e.children),i]};var ld=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function ew(e){return this.getChildContext=function(){return e.context},e.children}function tw(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){rr(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(i,r){this.childNodes.push(i),t.h.insertBefore(i,r)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),t.h.removeChild(i)}}}rr(h(ew,{context:t.context},e.__v),t.v)}function Gr(e,t){var n=h(tw,{__v:e,h:t});return n.containerInfo=t,n}(Bi.prototype=new Jt).__a=function(e){var t=this,n=Ag(t.__v),o=t.l.get(e);return o[0]++,function(i){var r=function(){t.props.revealOrder?(o.push(i),ld(t,e,o)):i()};n?n(r):r()}},Bi.prototype.render=function(e){this.i=null,this.l=new Map;var t=ir(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Bi.prototype.componentDidUpdate=Bi.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){ld(e,n,t)})};var nw=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ow=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,iw=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,rw=/[A-Z0-9]/g,aw=typeof document<"u",sw=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Jt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Jt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var cd=Ce.event;function lw(){}function cw(){return this.cancelBubble}function dw(){return this.defaultPrevented}Ce.event=function(e){return cd&&(e=cd(e)),e.persist=lw,e.isPropagationStopped=cw,e.isDefaultPrevented=dw,e.nativeEvent=e};
2288var uw={enumerable:!1,configurable:!0,get:function(){return this.class}},dd=Ce.vnode;Ce.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,i={},r=o.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||aw&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||sw(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":iw.test(a)&&(a=l):l=a="oninput":r&&ow.test(a)?a=a.replace(rw,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}o=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ir(n.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),o=="select"&&i.defaultValue!=null&&(i.value=ir(n.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",uw)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i})(e),e.$$typeof=nw,dd&&dd(e)};var ud=Ce.__r;Ce.__r=function(e){ud&&ud(e),e.__c};var hd=Ce.diffed;Ce.diffed=function(e){hd&&hd(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};const Pg="INTERACTION/INIT_STATE",Mg="INTERACTION/CLEANUP_STATE",Dg="INTERACTION/ACTIVATE_MODE",Tg="INTERACTION/PAUSE",Rg="INTERACTION/RESUME",Eg="INTERACTION/SET_CURSOR",zg="INTERACTION/SET_DEFAULT_MODE",Lg="INTERACTION/SET_EXCLUSION_RULES",Ng="INTERACTION/ADD_EXCLUSION_CLASS",Og="INTERACTION/REMOVE_EXCLUSION_CLASS",Fg="INTERACTION/ADD_EXCLUSION_ATTRIBUTE",_g="INTERACTION/REMOVE_EXCLUSION_ATTRIBUTE";function md(e){return{type:zg,payload:{mode:e}}}function pd(e){return{type:Lg,payload:{rules:e}}}const gd="pointerMode",$g=class extends $e{constructor(e,t,n){super(e,t),this.modes=new Map,this.cursorClaims=new Map,this.buckets=new Map,this.alwaysGlobal=new Map,this.alwaysPage=new Map,this.pageActivities=new Map,this.onModeChange$=st(),this.onHandlerChange$=st(),this.onCursorChange$=st(),this.onStateChange$=xe(),this.onPageActivityChange$=st(),this.registerMode({id:gd,scope:"page",exclusive:!1,cursor:"auto"}),this.dispatch(md(gd)),n.exclusionRules&&this.dispatch(pd(n.exclusionRules))}onDocumentLoadingStarted(e){const t={activeMode:this.state.defaultMode,cursor:"auto",paused:!1};this.dispatch((function(o,i){return{type:Pg,payload:{documentId:o,state:i}}})(e,t)),this.cursorClaims.set(e,new Map),this.buckets.set(e,new Map),this.alwaysGlobal.set(e,new Set),this.alwaysPage.set(e,new Map),this.pageActivities.set(e,new Map);const n=this.buckets.get(e);for(const o of this.modes.keys())n.set(o,{global:new Set,page:new Map});this.logger.debug("InteractionManagerPlugin","DocumentOpened",`Initialized interaction state for document: ${e}`)}onDocumentClosed(e){const t=this.pageActivities.get(e);if(t){const n=new Set(t.values());t.clear();for(const o of n)this.onPageActivityChange$.emit({documentId:e,pageIndex:o,hasActivity:!1})}this.cursorClaims.delete(e),this.buckets.delete(e),this.alwaysGlobal.delete(e),this.alwaysPage.delete(e),this.pageActivities.delete(e),this.dispatch((function(n){return{type:Mg,payload:n}})(e)),this.logger.debug("InteractionManagerPlugin","DocumentClosed",`Cleaned up interaction state for document: ${e}`)}buildCapability(){return{getActiveMode:()=>this.getActiveMode(),getActiveInteractionMode:()=>this.getActiveInteractionMode(),activate:e=>this.activate(e),activateDefaultMode:()=>this.activateDefaultMode(),setCursor:(e,t,n)=>this.setCursor(e,t,n),getCurrentCursor:()=>this.getCurrentCursor(),removeCursor:e=>this.removeCursor(e),getHandlersForScope:e=>this.getHandlersForScope(e),activeModeIsExclusive:()=>this.activeModeIsExclusive(),pause:()=>this.pause(),resume:()=>this.resume(),isPaused:()=>this.registry.isDestroyed()||this.isPaused(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createInteractionScope(e),registerMode:e=>this.registerMode(e),registerHandlers:e=>this.registerHandlers(e),registerAlways:e=>this.registerAlways(e),setDefaultMode:e=>this.setDefaultMode(e),getDefaultMode:()=>this.state.defaultMode,getExclusionRules:()=>this.state.exclusionRules,setExclusionRules:e=>
2288this.dispatch(pd(e)),addExclusionClass:e=>this.dispatch((function(t){return{type:Ng,payload:{className:t}}})(e)),removeExclusionClass:e=>this.dispatch((function(t){return{type:Og,payload:{className:t}}})(e)),addExclusionAttribute:e=>this.dispatch((function(t){return{type:Fg,payload:{attribute:t}}})(e)),removeExclusionAttribute:e=>this.dispatch((function(t){return{type:_g,payload:{attribute:t}}})(e)),claimPageActivity:(e,t,n)=>this.claimPageActivity(e,t,n),releasePageActivity:(e,t)=>this.releasePageActivity(e,t),hasPageActivity:(e,t)=>this.hasPageActivity(e,t),onModeChange:this.onModeChange$.on,onCursorChange:this.onCursorChange$.on,onHandlerChange:this.onHandlerChange$.on,onStateChange:this.onStateChange$.on,onPageActivityChange:this.onPageActivityChange$.on}}createInteractionScope(e){return{getActiveMode:()=>this.getActiveMode(e),getActiveInteractionMode:()=>this.getActiveInteractionMode(e),activate:t=>this.activate(t,e),activateDefaultMode:()=>this.activateDefaultMode(e),setCursor:(t,n,o)=>this.setCursor(t,n,o,e),getCurrentCursor:()=>this.getCurrentCursor(e),removeCursor:t=>this.removeCursor(t,e),getHandlersForScope:t=>this.getHandlersForScope(t),activeModeIsExclusive:()=>this.activeModeIsExclusive(e),pause:()=>this.pause(e),resume:()=>this.resume(e),isPaused:()=>this.isPaused(e),getState:()=>this.getDocumentStateOrThrow(e),claimPageActivity:(t,n)=>this.claimPageActivity(e,t,n),releasePageActivity:t=>this.releasePageActivity(e,t),hasPageActivity:t=>this.hasPageActivity(e,t),onModeChange:t=>this.onModeChange$.on(n=>{n.documentId===e&&t(n.activeMode)}),onCursorChange:t=>this.onCursorChange$.on(n=>{n.documentId===e&&t(n.cursor)}),onStateChange:t=>this.onStateChange$.on(n=>{n.documentId===e&&t(n.state)}),onPageActivityChange:t=>this.onPageActivityChange$.on(n=>{n.documentId===e&&t({pageIndex:n.pageIndex,hasActivity:n.hasActivity})})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Interaction state not found for document: ${e??"active"}`);return t}activate(e,t){var n;const o=t??this.getActiveDocumentId(),i=this.getDocumentStateOrThrow(o);if(!this.modes.has(e))throw new Error(`[interaction] unknown mode '${e}'`);if(e===i.activeMode)return;const r=i.activeMode;(n=this.cursorClaims.get(o))==null||n.clear(),this.notifyHandlersInactive(o,r),this.dispatch((function(a,s){return{type:Dg,payload:{documentId:a,mode:s}}})(o,e)),this.emitCursor(o),this.notifyHandlersActive(o,e),this.onModeChange$.emit({documentId:o,activeMode:e,previousMode:r})}activateDefaultMode(e){const t=e??this.getActiveDocumentIdOrNull();t&&this.activate(this.state.defaultMode,t)}setDefaultMode(e){if(!this.modes.has(e))throw new Error(`[interaction] cannot set unknown mode '${e}' as default`);this.dispatch(md(e))}getActiveMode(e){return this.getDocumentStateOrThrow(e).activeMode}getActiveInteractionMode(e){const t=this.getDocumentState(e);return t?this.modes.get(t.activeMode)??null:null}activeModeIsExclusive(e){const t=this.getActiveInteractionMode(e);return!!t?.exclusive}pause(e){const t=e??this.getActiveDocumentId();this.dispatch((function(n){return{type:Tg,payload:n}})(t))}resume(e){const t=e??this.getActiveDocumentId();this.dispatch((function(n){return{type:Rg,payload:n}})(t))}isPaused(e){return this.getDocumentStateOrThrow(e).paused}registerMode(e){this.modes.set(e.id,e);for(const t of this.buckets.keys()){const n=this.buckets.get(t);n.has(e.id)||n.set(e.id,{global:new Set,page:new Map})}}registerHandlers({documentId:e,modeId:t,handlers:n,pageIndex:o}){const i=Array.isArray(t)?t:[t],r=[],a=this.buckets.get(e);if(!a)throw new Error(`No buckets found for document: ${e}`);for(const s of i){const l=a.get(s);if(!l)throw new Error(`unknown mode '${s}'`);if(o==null)l.global.add(n);else{const c=l.page.get(o)??new Set;c.add(n),l.page.set(o,c)}r.push(()=>{if(o==null)l.global.delete(n);else{const c=l.page.get(o);c&&(c.delete(n),c.size===0&&l.page.delete(o))}})}return this.onHandlerChange$.emit({...this.state}),()=>{r.forEach(s=>s()),this.onHandlerChange$.emit({...this.state})}}registerAlways({scope:e,handlers:t}){if(e.type==="global"){const i=this.alwaysGlobal.get(e.documentId)??new Set;return i.add(t),this.alwaysGlobal.set(e.documentId,i),this.onHandlerChange$.emit({...this.state}),()=>{i.delete(t),this.onHandlerChange$.emit({...this.state})}}const n=this.alwaysPage.get(e.documentId)??new Map,o=n.get(e.pageIndex)??new Set;return o.add(t),n.set(e.pageIndex,o),this.alwaysPage.set(e.documentId,n),this.onHandlerChange$.emit({...this.state}),()=>{o.delete(t),this.onHandlerChange$.emit({...this.state})}}getHandlersForScope(e){var t;const n=this.getDocumentState(e.documentId);if(!n)return null;const o=this.modes.get(n.activeMode);if(!o)return null;const i=this.buckets.get(e.documentId);if(!i)return null;const r=i.get(o.id);if(!r)return null;const a=(s,l)=>s.size||l.size?(function(c){const d=["onPointerDown","onPointerUp","onPointerMove","onPointerEnter","onPointerLeave","onPointerCancel","onMouseDown","onMouseUp","onMouseMove","onMouseEnter","onMouseLeave","onMouseCancel","onClick","onDoubleClick"],u={};for(const m of d)u[m]=(g,p,f)=>{var v;
2288for(const y of c){if(p.isImmediatePropagationStopped())break;(v=y[m])==null||v.call(y,g,p,f)}};return u})([...s,...l]):null;return e.type==="global"?a(this.alwaysGlobal.get(e.documentId)??new Set,o.scope==="global"?r.global:new Set):a(((t=this.alwaysPage.get(e.documentId))==null?void 0:t.get(e.pageIndex))??new Set,o.scope==="page"?r.page.get(e.pageIndex)??new Set:new Set)}setCursor(e,t,n=0,o){const i=o??this.getActiveDocumentId(),r=this.cursorClaims.get(i);r&&(r.set(e,{cursor:t,priority:n}),this.emitCursor(i))}removeCursor(e,t){const n=t??this.getActiveDocumentId(),o=this.cursorClaims.get(n);o&&(o.delete(e),this.emitCursor(n))}getCurrentCursor(e){return this.getDocumentStateOrThrow(e).cursor}emitCursor(e){var t;const n=this.cursorClaims.get(e);if(!n)return;const o=this.getDocumentState(e);if(!o)return;const i=[...n.values()].sort((r,a)=>a.priority-r.priority)[0]??{cursor:((t=this.modes.get(o.activeMode))==null?void 0:t.cursor)??"auto"};i.cursor!==o.cursor&&(this.dispatch((function(r,a){return{type:Eg,payload:{documentId:r,cursor:a}}})(e,i.cursor)),this.onCursorChange$.emit({documentId:e,cursor:i.cursor}))}claimPageActivity(e,t,n){let o=this.pageActivities.get(e);o||(o=new Map,this.pageActivities.set(e,o));const i=o.get(t);i!==n&&(o.set(t,n),i===void 0||this.pageHasAnyTopic(e,i)||this.onPageActivityChange$.emit({documentId:e,pageIndex:i,hasActivity:!1}),this.countTopicsOnPage(e,n)===1&&this.onPageActivityChange$.emit({documentId:e,pageIndex:n,hasActivity:!0}))}releasePageActivity(e,t){const n=this.pageActivities.get(e);if(!n)return;const o=n.get(t);o!==void 0&&(n.delete(t),this.pageHasAnyTopic(e,o)||this.onPageActivityChange$.emit({documentId:e,pageIndex:o,hasActivity:!1}))}hasPageActivity(e,t){return this.pageHasAnyTopic(e,t)}pageHasAnyTopic(e,t){const n=this.pageActivities.get(e);if(!n)return!1;for(const o of n.values())if(o===t)return!0;return!1}countTopicsOnPage(e,t){const n=this.pageActivities.get(e);if(!n)return 0;let o=0;for(const i of n.values())i===t&&o++;return o}notifyHandlersActive(e,t){var n,o;(n=this.alwaysGlobal.get(e))==null||n.forEach(s=>{var l;(l=s.onHandlerActiveStart)==null||l.call(s,t)}),(o=this.alwaysPage.get(e))==null||o.forEach(s=>{s.forEach(l=>{var c;(c=l.onHandlerActiveStart)==null||c.call(l,t)})});const i=this.modes.get(t);if(!i)return;const r=this.buckets.get(e);if(!r)return;const a=r.get(t);a&&(i.scope==="global"&&a.global.forEach(s=>{var l;(l=s.onHandlerActiveStart)==null||l.call(s,t)}),i.scope==="page"&&a.page.forEach(s=>{s.forEach(l=>{var c;(c=l.onHandlerActiveStart)==null||c.call(l,t)})}))}notifyHandlersInactive(e,t){var n,o;(n=this.alwaysGlobal.get(e))==null||n.forEach(s=>{var l;(l=s.onHandlerActiveEnd)==null||l.call(s,t)}),(o=this.alwaysPage.get(e))==null||o.forEach(s=>{s.forEach(l=>{var c;(c=l.onHandlerActiveEnd)==null||c.call(l,t)})});const i=this.modes.get(t);if(!i)return;const r=this.buckets.get(e);if(!r)return;const a=r.get(t);a&&(i.scope==="global"&&a.global.forEach(s=>{var l;(l=s.onHandlerActiveEnd)==null||l.call(s,t)}),i.scope==="page"&&a.page.forEach(s=>{s.forEach(l=>{var c;(c=l.onHandlerActiveEnd)==null||c.call(l,t)})}))}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o!==i&&this.onStateChange$.emit({documentId:n,state:i})}}async initialize(e){this.logger.info("InteractionManagerPlugin","Initialize","Interaction Manager Plugin initialized")}async destroy(){this.pageActivities.clear(),this.onModeChange$.clear(),this.onCursorChange$.clear(),this.onHandlerChange$.clear(),this.onStateChange$.clear(),this.onPageActivityChange$.clear(),await super.destroy()}};$g.id="interaction-manager";let qr=$g;const fd="interaction-manager",vd={defaultMode:"pointerMode",exclusionRules:{classes:[],dataAttributes:["data-no-interaction"]},documents:{},activeDocumentId:null},hw={manifest:{id:fd,name:"Interaction Manager Plugin",version:"1.0.0",provides:["interaction-manager"],requires:[],optional:[],defaultConfig:{exclusionRules:{classes:[],dataAttributes:["data-no-interaction"]}}},create:(e,t)=>new qr(fd,e,t),reducer:(e=vd,t)=>{switch(t.type){case Pg:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case Mg:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"INTERACTION/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Dg:{const{documentId:n,mode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,activeMode:o}}}:e}case Eg:{const{documentId:n,cursor:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,cursor:o}}}:e}case Tg:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,paused:!0}}}:e}case Rg:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,paused:!1}}}:e}case zg:return{...e,defaultMode:t.payload.mode};case Lg:return{...e,exclusionRules:t.payload.rules};case Ng:return{...e,exclusionRules:{...e.exclusionRules,classes:[...e.exclusionRules.classes||[],t.payload.className].filter((n,o,i)=>i.indexOf(n)===o)}};case Og:return{...e,exclusionRules:{...e.exclusionRules,classes:(e.exclusionRules.classes||[]).filter(n=>n!==t.payload.className)}};case Fg:return{...e,exclusionRules:{...e.exclusionRules,dataAttributes:[...e.exclusionRules.dataAttributes||[],t.payload.attribute].filter((n,o,i)=>i.indexOf(n)===o)}};case _g:return{...e,exclusionRules:{...e.exclusionRules,dataAttributes:(e.exclusionRules.dataAttributes||[]).filter(n=>n!==t.payload.attribute)}};default:return e}},initialState:vd},ci=()=>We(qr.id),mw={pointerdown:"onPointerDown",pointerup:"onPointerUp",pointermove:"onPointerMove",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointercancel:"onPointerCancel",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousecancel:"onMouseCancel",click:"onClick",dblclick:"onDoubleClick",touchstart:"onPointerDown",touchend:"onPointerUp",touchmove:"onPointerMove",touchcancel:"onPointerCancel"},yd=["pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointercancel","mousedown","mouseup","mousemove","mouseenter","mouseleave","mousecancel","click","dblclick"],bd=typeof PointerEvent<"u"?yd:[...yd,"touchstart","touchend","touchmove","touchcancel"];function wd(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function jg(e,t,n,o){const i=e.forDocument(t.documentId);let r=e.getHandlersForScope(t);const a=()=>{var b;return((b=i.getActiveInteractionMode())==null?void 0:b.wantsRawTouch)!==!1}
2288,s={};let l=a();const c=b=>{bd.forEach(w=>{const x=s[w]??(s[w]=y);var C;n.addEventListener(w,x,(C=b,w.startsWith("touch")?{passive:!C}:{passive:!1}))})},d=()=>{bd.forEach(b=>{const w=s[b];w&&n.removeEventListener(b,w)})};c(l),n.style.touchAction=l?"none":"";const u=i.onModeChange(()=>{if(t.type==="global"){const w=i.getActiveInteractionMode();n.style.cursor=w?.scope==="global"?w.cursor??"auto":"auto"}r=e.getHandlersForScope(t);const b=a();b!==l&&(d(),c(b),l=b,n.style.touchAction=l?"none":"")}),m=e.onHandlerChange(()=>{r=e.getHandlersForScope(t)}),g=i.getActiveInteractionMode(),p=i.getCurrentCursor();n.style.cursor=t.type==="global"&&g?.scope!=="global"?"auto":p;const f=i.onCursorChange(b=>{var w;t.type==="global"&&((w=i.getActiveInteractionMode())==null?void 0:w.scope)!=="global"||(n.style.cursor=b)}),v=(b,w)=>{if(o)return o(b,w);const x=w.getBoundingClientRect();return{x:b.clientX-x.left,y:b.clientY-x.top}};function y(b){var w;if(e.isPaused())return;const x=e.getExclusionRules();if(b.target&&(function(A,D){var R,M,N;if(!A)return!1;let z=A;for(;z;){if((R=D.classes)!=null&&R.length){for(const _ of D.classes)if((M=z.classList)!=null&&M.contains(_))return!0}if((N=D.dataAttributes)!=null&&N.length){for(const _ of D.dataAttributes)if(z.hasAttribute(_))return!0}z=z.parentElement}return!1})(b.target,x))return;const C=mw[b.type];if(!C||!r?.[C])return;let I,S;wd(b)&&l&&(b.type==="touchmove"||b.type==="touchcancel")&&b.preventDefault();let P=!1;if(wd(b)){const A=b.type==="touchend"||b.type==="touchcancel"?b.changedTouches[0]:b.touches[0];if(!A)return;I=v(A,n),S={clientX:A.clientX,clientY:A.clientY,ctrlKey:b.ctrlKey,shiftKey:b.shiftKey,altKey:b.altKey,metaKey:b.metaKey,target:b.target,currentTarget:b.currentTarget,setPointerCapture:()=>{},releasePointerCapture:()=>{},stopImmediatePropagation:()=>{P=!0},isImmediatePropagationStopped:()=>P}}else{const A=b;I=v(A,n),S={clientX:A.clientX,clientY:A.clientY,ctrlKey:A.ctrlKey,shiftKey:A.shiftKey,altKey:A.altKey,metaKey:A.metaKey,target:A.target,currentTarget:A.currentTarget,setPointerCapture:()=>{var D,R;(R=(D=A.target)==null?void 0:D.setPointerCapture)==null||R.call(D,A.pointerId)},releasePointerCapture:()=>{var D,R;(R=(D=A.target)==null?void 0:D.releasePointerCapture)==null||R.call(D,A.pointerId)},stopImmediatePropagation:()=>{P=!0},isImmediatePropagationStopped:()=>P}}(w=r[C])==null||w.call(r,I,S,i.getActiveMode())}return()=>{d(),u(),f(),m()}}const pw=({children:e,documentId:t,style:n,...o})=>{const i=K(null),{provides:r}=ci();return $(()=>{if(r&&i.current)return jg(r,{type:"global",documentId:t},i.current)},[r,t]),k("div",{ref:i,style:{width:"100%",height:"100%",...n},...o,children:e})},gw=({documentId:e,pageIndex:t,children:n,rotation:o,scale:i,convertEventToPoint:r,style:a,...s})=>{var l,c;const d=K(null),{provides:u}=ci(),m=(function(I){const{provides:S}=ci(),[P,A]=O(()=>{if(!S)return!1;const D=S.forDocument(I).getActiveInteractionMode();return D?.scope==="page"&&!!D.exclusive});return $(()=>{if(!S)return;const D=S.forDocument(I);return D.onModeChange(()=>{const R=D.getActiveInteractionMode();A(R?.scope==="page"&&!!R?.exclusive)})},[S,I]),P})(e),g=pt(e),p=(c=(l=g?.document)==null?void 0:l.pages)==null?void 0:c[t],f=p?.size??{width:0,height:0},v=p?.rotation??0,y=g?.rotation??0,b=o!==void 0?o:(v+y)%4,w=i??g?.scale??1,x=ar(f,0,w),C=W((I,S)=>{const P=S.getBoundingClientRect(),A={x:I.clientX-P.left,y:I.clientY-P.top};return(function(D,R,M,N){return Yi(qu(D,R,(4-M)%4),1/N)})(ar({width:x.width,height:x.height},b,1),A,b,w)},[f,b,w]);return $(()=>{if(u&&d.current)return jg(u,{type:"page",documentId:e,pageIndex:t},d.current,r||C)},[u,e,t,r,C]),k("div",{ref:d,style:{position:"relative",width:x.width,height:x.height,...a},...s,children:[n,m&&k("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:10}})]})},Ug={},Bg=rn(null),Wg=rn([]);function Hg(e){const t=an(Bg),n=K(e);$(()=>{if(t)return t(n.current)},[t])}function Gg(){return an(Wg)}const Kr=()=>At(Wr.id),zt=()=>We(Wr.id),tl=e=>{var t;const{provides:n}=zt(),[o,i]=O(((t=n?.forDocument(e))==null?void 0:t.getState())??kg());return $(()=>{if(!n)return;const r=n.forDocument(e);return i(r.getState()),r.onStateChange(a=>{i(a)})},[n,e]),{state:o,provides:n?.forDocument(e)??null}};let ka;function fw(){return ka===void 0&&(ka=(function(){try{const e=navigator;return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&e?.maxTouchPoints>1}catch{return!1}})()),ka}function nl(e,t){const n=fw();return Z(()=>{const o=n&&t&&e>0&&e<16,i=o?e/16:1;return{needsComp:o,adjustedFontPx:o?16:e,scaleComp:i,wrapperStyle:o?{width:100/i+"%",height:100/i+"%",transform:`scale(${i})`,transformOrigin:"top left"}:void 0}},[n,t,e])}function vw({appearance:e,style:t}){const[n,o]=O(null),i=K(null);return $(()=>{const r=URL.createObjectURL(e.data);return o(r),i.current=r,()=>{i.current&&(URL.revokeObjectURL(i.current),i.current=null)}},[e.data]),n?k("img",{src:n,onLoad:()=>{i.current&&(URL.revokeObjectURL(i.current),i.current=null)},style:{position:"absolute",width:"100%",height:"100%",display:"block",pointerEvents:"none",userSelect:"none",...t}}):null}function yw({scale:e,documentId:t,pageIndex:n,rotation:o,pageWidth:i,pageHeight:r,trackedAnnotation:a,children:s,isSelected:l,isEditing:c=!1,isMultiSelected:d=!1,isDraggable:u,isResizable:m,isRotatable:g=!0,lockA
2288spectRatio:p=!1,style:f={},blendMode:v,vertexConfig:y,selectionMenu:b,structurallyLocked:w=!1,contentLocked:x=!1,outlineOffset:C=1,onDoubleClick:I,onSelect:S,appearance:P,zIndex:A=1,resizeUI:D,vertexUI:R,rotationUI:M,selectionOutlineColor:N,selectionOutline:z,customAnnotationRenderer:_,groupSelectionMenu:L,groupSelectionOutline:j,annotationRenderers:E,...F}){var X,Q,J;const[te,G]=O(a.object),[oe,le]=O(null),[Te,De]=O(null),[Ne,V]=O(!1),[Se,He]=O(!1),{provides:Re}=zt(),{plugin:ae}=Kr(),{canModifyAnnotations:Ie}=zr(t),be=K(null),Oe=Ie&&u&&!d,vt=Ie&&m&&!d,Pt=Ie&&g&&!d,Wt=Z(()=>Re?Re.forDocument(t):null,[Re,t]),ze=te?{...a.object,...te}:a.object,Vt=a.object.flags??[],tt=Vt.includes("noZoom"),xt=Vt.includes("noRotate"),rt=tt?1:e,Ht=xt?0:o,kt=D?.color??"#007ACC",ln=R?.color??"#007ACC",cn=M?.color??"white",dn=M?.connectorColor??"#007ACC",_o=D?.size??12,$n=R?.size??12,un=M?.size??32,hn=M?.margin,Xt=M?.iconColor??"#007ACC",mn=M?.showConnector??!1,we=((X=M?.border)==null?void 0:X.color)??"#007ACC",Be=((Q=M?.border)==null?void 0:Q.width)??1,ce=((J=M?.border)==null?void 0:J.style)??"solid",Ge=z?.color??N??"#007ACC",so=z?.style??"solid",Zt=z?.width??1,pn=z?.offset??C??1,lt=oe??ze.rotation??0,$o=oe??ze.rotation??0,jo=Number.isFinite($o)?Math.round(10*$o)/10:0,gt=oe!==null,gn=K(null),jn=W(Me=>{var nt;if(!((nt=Me.transformData)!=null&&nt.type)||d||!ae)return;const{type:ut,changes:ot,metadata:ft}=Me.transformData,fn=a.object.id,Nt={width:i,height:r};if(Me.state==="start"&&(gn.current=a.object.unrotatedRect??a.object.rect,be.current=a.object,ut!=="resize"&&ut!=="vertex-edit"||He(!0),ut==="move"?ae.startDrag(t,{annotationIds:[fn],pageSize:Nt}):ut==="resize"&&ae.startResize(t,{annotationIds:[fn],pageSize:Nt,resizeHandle:ft?.handle??"se"})),ot.rect&&gn.current)if(ut==="move"){const Ot={x:ot.rect.origin.x-gn.current.origin.x,y:ot.rect.origin.y-gn.current.origin.y};ae.updateDrag(t,Ot)}else ut==="resize"&&ae.updateResize(t,ot.rect);if(ut==="vertex-edit"&&ot.vertices&&y){const Ot=be.current??a.object,An=y.transformAnnotation(Ot,ot.vertices),ho=Re?.transformAnnotation(Ot,{type:ut,changes:An,metadata:ft});ho&&(G(oa=>({...oa,...ho})),Me.state==="end"&&Wt?.updateAnnotation(n,fn,ho))}if(ut==="rotate"){const Ot=ft?.rotationAngle??lt,An=ft?.cursorPosition;return An&&De({x:An.clientX,y:An.clientY}),void(Me.state==="start"?(le(Ot),ae.startRotation(t,{annotationIds:[fn],cursorAngle:Ot,rotationCenter:ft?.rotationCenter})):Me.state==="move"?(le(Ot),ae.updateRotation(t,Ot,ft?.rotationDelta)):Me.state==="end"&&(le(null),De(null),ae.commitRotation(t)))}Me.state==="end"&&(gn.current=null,be.current=null,He(!1),ut==="move"?ae.commitDrag(t):ut==="resize"&&ae.commitResize(t))},[ae,t,a.object,i,r,n,d,y,Re,Wt,lt]),ct=ze.unrotatedRect,yt=ct??ze.rect,bt=ct&&lt!==0?Zu(yt,ze.rect,lt):void 0,Jr=yt,{dragProps:Uv,vertices:Bv,resize:Wv,rotation:lo}=pp({controller:{element:Jr,vertices:y?.extractVertices(ze),constraints:{minWidth:10,minHeight:10,boundingBox:{width:i,height:r}},maintainAspectRatio:p,pageRotation:o,annotationRotation:lt,rotationCenter:bt,rotationElement:ze.rect,scale:e,enabled:l&&!d,onUpdate:jn},resizeUI:{handleSize:_o,spacing:pn,offsetMode:"outside",includeSides:!p,zIndex:A+1},vertexUI:{vertexSize:$n,zIndex:A+2},rotationUI:{handleSize:un,margin:hn,zIndex:A+3,showConnector:mn},includeVertices:!!y,includeRotation:Pt,currentRotation:lt}),Hv=(function(Me,{delay:nt=300,tolerancePx:ut=18}={}){const ot=K({t:0,x:0,y:0}),ft=W(Nt=>{if(!Me||Nt.pointerType==="mouse"||Nt.isPrimary===!1)return;const Ot=performance.now(),An=Nt.clientX,ho=Nt.clientY,oa=Ot-ot.current.t<=nt,Al=An-ot.current.x,Pl=ho-ot.current.y;oa&&Al*Al+Pl*Pl<=ut*ut&&Me?.(Nt),ot.current={t:Ot,x:An,y:ho}},[Me,nt,ut]),fn=W(Nt=>{Me?.(Nt)},[Me]);return Me?{[Xb]:fn,onPointerUpCapture:ft}:{}})(Z(()=>{if(Ie&&I)return I},[Ie,I]));$(()=>{G(a.object)},[a.object]),$(()=>{if(!ae)return;const Me=a.object.id,nt=ot=>{var ft;if(ot.documentId!==t)return;ot.type!=="end"&&ot.type!=="cancel"||le(null);const fn=(ft=ot.previewPatches)==null?void 0:ft[Me];ot.type==="update"&&fn?G(Nt=>({...Nt,...fn}
vendor: 5,058 bytes, line 2288
2288)):ot.type==="cancel"&&G(a.object)},ut=[ae.onDragChange(nt),ae.onResizeChange(nt),ae.onRotateChange(nt)];return()=>ut.forEach(ot=>ot())},[ae,t,a.object]);const bl=l&&!d,Uo=ze.rect.size.width*rt,Bo=ze.rect.size.height*rt,wl=yt.size.width*rt,xl=yt.size.height*rt,ea=!!ct&&lt!==0,Gv=ea?(yt.origin.x-ze.rect.origin.x)*rt:(Uo-wl)/2,qv=ea?(yt.origin.y-ze.rect.origin.y)*rt:(Bo-xl)/2,Kv=ea&&bt?`${(bt.x-yt.origin.x)*rt}px ${(bt.y-yt.origin.y)*rt}px`:"center center",ta=bt?(bt.x-ze.rect.origin.x)*rt:Uo/2,na=bt?(bt.y-ze.rect.origin.y)*rt:Bo/2,co=Math.max(300,Math.max(Uo,Bo)+80),uo=xt?hp({size:{width:Uo,height:Bo}},o):null,kl=Z(()=>ct?{...ze,rect:ct}:ze,[ze,ct]),Cl=!(!P?.normal||Se||c||a.dictMode),Il={position:"absolute",left:ze.rect.origin.x*e,top:ze.rect.origin.y*e,width:uo?uo.width:Uo,height:uo?uo.height:Bo,pointerEvents:"none",zIndex:A,...uo&&{transform:uo.matrix,transformOrigin:"0 0"}},Sl={position:"absolute",left:Gv,top:qv,width:wl,height:xl,transform:lt!==0?`rotate(${lt}deg)`:void 0,transformOrigin:Kv};return k("div",{"data-no-interaction":!0,children:[k("div",{style:{...Il,...v&&{mixBlendMode:v},...f},children:k("div",{style:{...Sl,pointerEvents:c?"auto":"none"},children:[(()=>{const Me=typeof s=="function"?s(kl,{appearanceActive:Cl}):s;return _?.({annotation:kl,children:Me,isSelected:l,scale:e,rotation:o,pageWidth:i,pageHeight:r,pageIndex:n,onSelect:S})??Me})(),P?.normal&&k(vw,{appearance:P.normal,style:{display:Cl?"block":"none"}})]})}),k("div",{style:Il,...F,children:[gt&&k(de,{children:[k("div",{style:{position:"absolute",left:ta-co/2,top:na,width:co,height:1,backgroundColor:dn,opacity:.35,pointerEvents:"none"}}),k("div",{style:{position:"absolute",left:ta,top:na-co/2,width:1,height:co,backgroundColor:dn,opacity:.35,pointerEvents:"none"}}),k("div",{style:{position:"absolute",left:ta-co/2,top:na,width:co,height:1,transformOrigin:"center center",transform:`rotate(${lt}deg)`,backgroundColor:dn,opacity:.8,pointerEvents:"none"}})]}),l&&Pt&&lo&&(M?.component?k("div",{onPointerEnter:()=>V(!0),onPointerLeave:()=>{V(!1),De(null)},onPointerMove:Me=>{gt||De({x:Me.clientX,y:Me.clientY})},style:{display:"contents"},children:M.component({...lo.handle,backgroundColor:cn,iconColor:Xt,connectorStyle:{...lo.connector.style,backgroundColor:dn,opacity:gt?0:1},showConnector:mn,opacity:gt?0:1,border:{color:we,width:Be,style:ce}})}):k("div",{onPointerEnter:()=>V(!0),onPointerLeave:()=>{V(!1),De(null)},onPointerMove:Me=>{gt||De({x:Me.clientX,y:Me.clientY})},style:{display:"contents"},children:[mn&&k("div",{style:{...lo.connector.style,backgroundColor:dn,opacity:gt?0:1}}),k("div",{...lo.handle,style:{...lo.handle.style,backgroundColor:cn,border:`${Be}px ${ce} ${we}`,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",opacity:gt?0:1},children:k("svg",{width:Math.round(.6*un),height:Math.round(.6*un),viewBox:"0 0 24 24",fill:"none",stroke:Xt,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),k("path",{d:"M21 3v5h-5"})]})})]})),k("div",{...Oe&&l?Uv:{},...Hv,style:{...Sl,outline:bl?`${Zt}px ${so} ${Ge}`:"none",outlineOffset:bl?`${pn}px`:"0px",pointerEvents:!l||d||c?"none":"auto",touchAction:"none",cursor:l&&Oe?"move":"default"},children:[l&&vt&&!gt&&Wv.map(({key:Me,...nt})=>D?.component?D.component({key:Me,...nt,backgroundColor:kt}):k("div",{...nt,style:{...nt.style,backgroundColor:kt}},Me)),l&&Ie&&!d&&!gt&&Bv.map(({key:Me,...nt})=>R?.component?R.component({key:Me,...nt,backgroundColor:ln}):k("div",{...nt,style:{...nt.style,backgroundColor:ln}},Me))]})]}),b&&!d&&!gt&&k(oi,{rect:{origin:{x:ze.rect.origin.x*e,y:ze.rect.origin.y*e},size:{width:ze.rect.size.width*rt,height:ze.rect.size.height*rt}},rotation:o,children:Me=>{const nt=((lt+90*Ht)%360+360)%360;return b({...Me,context:{type:"annotation",annotation:a,pageIndex:n,structurallyLocked:w,contentLocked:x},selected:l,placement:{suggestTop:Pt&&nt>90&&nt<270}})}}),(gt||Ne)&&Te&&Gr(k("div",{style:{position:"fixed",left:Te.x+16,top:Te.y-16,background:"rgba(0,0,0,0.8)",color:"#fff",padding:"4px 8px",borderRadius:4,fontSize:12,fontFamily:"monospace",pointerEvents:"none",zIndex:1e4,whiteSpace:"nowrap"},children:[jo.toFixed(0),"°"]}),document.body)]})}function Wi(e,t,n,o,i){switch(i){case 1:return{x:t,y:o-e};case 2:return{x:n-e,y:o-t};case 3:return{x:n-t,y:e};default:return{x:e,y:t}}}function bw(e,t,n){const o=e.object.flags??[],i=o.includes("noZoom"),r=o.includes("noRotate"),a=e.object.rect.origin.x*t,s=e.object.rect.origin.y*t,l=e.object.rect.size.width*(i?1:t),c=e.object.rect.size.height*(i?1:t);if(!r||n===0)return{left:a,top:s,right:a+l,bottom:s+c};const d=[Wi(0,0,l,c,n),Wi(l,0,l,c,n),Wi(0,c,l,c,n),Wi(l,c,l,c,n)];let u=1/0,m=1/0,g=-1/0,p=-1/0;for(const f of d)f.x<u&&(u=f.x),f.y<m&&(m=f.y),f.x>g&&(g=f.x),f.y>p&&(p=f.y);return{left:a+u,top:s+m,right:a+g,bottom:s+p}}function ww({documentId:e,pageIndex:t,scale:n,rotation:o,pageWidth:i,pageHeight:r,selectedAnnotations:a,isDraggable:s,isResizable:l,isRotatable:c=!0,lockA
2288spectRatio:d=!1,resizeUI:u,rotationUI:m,selectionOutlineColor:g,outlineOffset:p,selectionOutline:f,zIndex:v=2,groupSelectionMenu:y}){var b,w,x;const{plugin:C}=Kr(),{canModifyAnnotations:I}=zr(e),S=K(null),P=K(!1),A=K(!1),[D,R]=O(null),[M,N]=O(null),[z,_]=O(!1),L=I&&s,j=I&&l,E=I&&c,F=Z(()=>(function(ce){return Ms(ce)??cy})(a.map(ce=>ce.object.rect)),[a]),[X,Q]=O(F);$(()=>{P.current||A.current||Q(F)},[F]),$(()=>{if(C)return C.onRotateChange(ce=>{ce.documentId===e&&(ce.type!=="end"&&ce.type!=="cancel"||R(null))})},[C,e]);const J=W(ce=>{var Ge,so,Zt,pn,lt,$o;if(!((Ge=ce.transformData)!=null&&Ge.type)||!C)return;const jo=ce.transformData.type,gt=jo==="move",gn=jo==="resize";if(gt&&!L)return;if(ce.state==="start"&&(S.current=F,gt?(P.current=!0,C.startDrag(e,{annotationIds:a.map(ct=>ct.object.id),pageSize:{width:i,height:r}})):gn&&(A.current=!0,C.startResize(e,{annotationIds:a.map(ct=>ct.object.id),pageSize:{width:i,height:r},resizeHandle:((so=ce.transformData.metadata)==null?void 0:so.handle)??"se"}))),jo==="rotate"){if(!c)return;const ct=a.map(Jr=>Jr.object.id),yt=((Zt=ce.transformData.metadata)==null?void 0:Zt.rotationAngle)??0,bt=(pn=ce.transformData.metadata)==null?void 0:pn.cursorPosition;return bt&&N({x:bt.clientX,y:bt.clientY}),void(ce.state==="start"?(R(yt),C.startRotation(e,{annotationIds:ct,cursorAngle:yt,rotationCenter:(lt=ce.transformData.metadata)==null?void 0:lt.rotationCenter})):ce.state==="move"?(R(yt),C.updateRotation(e,yt,($o=ce.transformData.metadata)==null?void 0:$o.rotationDelta)):ce.state==="end"&&(R(null),N(null),C.commitRotation(e)))}const jn=S.current??F;if(gt&&ce.transformData.changes.rect){const ct=ce.transformData.changes.rect,yt={x:ct.origin.x-jn.origin.x,y:ct.origin.y-jn.origin.y},bt=C.updateDrag(e,yt);Q({...jn,origin:{x:jn.origin.x+bt.x,y:jn.origin.y+bt.y}})}else if(gn&&ce.transformData.changes.rect){const ct=ce.transformData.changes.rect;C.updateResize(e,ct),Q(ct)}ce.state==="end"&&(S.current=null,gt&&P.current?(P.current=!1,C.commitDrag(e)):gn&&A.current&&(A.current=!1,C.commitResize(e)))},[C,e,i,r,F,L,a,c]),te=D??0,G=D!==null,oe=Number.isFinite(te)?Math.round(10*te)/10:0,le=u?.color??"#007ACC",Te=u?.size??12,De=m?.color??"white",Ne=m?.connectorColor??"#007ACC",V=m?.size??32,Se=m?.margin,He=m?.iconColor??"#007ACC",Re=m?.showConnector??!1,ae=((b=m?.border)==null?void 0:b.color)??"#007ACC",Ie=((w=m?.border)==null?void 0:w.width)??1,be=((x=m?.border)==null?void 0:x.style)??"solid",Oe=f?.color??g??"#007ACC",vt=f?.style??"dashed",Pt=f?.width??2,Wt=f?.offset??p??2,{dragProps:ze,resize:Vt,rotation:tt}=pp({controller:{element:X,constraints:{minWidth:20,minHeight:20,boundingBox:{width:i,height:r}},maintainAspectRatio:d,pageRotation:o,scale:n,enabled:!0,onUpdate:J},resizeUI:{handleSize:Te,spacing:Wt,offsetMode:"outside",includeSides:!d,zIndex:v+1},vertexUI:{vertexSize:0,zIndex:v},rotationUI:{handleSize:V,margin:Se,zIndex:v+2,showConnector:Re},includeVertices:!1,includeRotation:E,currentRotation:D??0});if(a.length<2)return null;let xt=1/0,rt=1/0,Ht=-1/0,kt=-1/0;for(const ce of a){const Ge=bw(ce,n,o);xt=Math.min(xt,Ge.left),rt=Math.min(rt,Ge.top),Ht=Math.max(Ht,Ge.right),kt=Math.max(kt,Ge.bottom)}const ln=xt-F.origin.x*n,cn=rt-F.origin.y*n,dn=Ht-(F.origin.x+F.size.width)*n,_o=kt-(F.origin.y+F.size.height)*n,$n=X.origin.x*n+ln,un=X.origin.y*n+cn,hn=X.size.width*n+(dn-ln),Xt=X.size.height*n+(_o-cn),mn=hn/2,we=Xt/2,Be=Math.max(300,Math.max(hn,Xt)+80);return k("div",{"data-group-selection-box":!0,"data-no-interaction":!0,children:[k("div",{style:{position:"absolute",left:$n,top:un,width:hn,height:Xt,pointerEvents:"none",zIndex:v},children:[G&&k(de,{children:[k("div",{style:{position:"absolute",left:mn-Be/2,top:we,width:Be,height:1,backgroundColor:le,opacity:.35,pointerEvents:"none"}}),k("div",{style:{position:"absolute",left:mn,top:we-Be/2,width:1,height:Be,backgroundColor:le,opacity:.35,pointerEvents:"none"}}),k("div",{style:{position:"absolute",left:mn-Be/2,top:we,width:Be,height:1,transformOrigin:"center center",transform:`rotate(${te}deg)`,backgroundColor:le,opacity:.8,pointerEvents:"none"}})]}),E&&tt&&(m?.component?k("div",{onPointerEnter:()=>_(!0),onPointerLeave:()=>{_(!1),N(null)},onPointerMove:ce=>{G||N({x:ce.clientX,y:ce.clientY})},style:{display:"contents"},children:m.component({...tt.handle,backgroundColor:De,iconColor:He,connectorStyle:{...tt.connector.style,backgroundColor:Ne,opacity:G?0:1},showConnector:Re,opacity:G?0:1,border:{color:ae,width:Ie,style:be}})}):k("div",{onPointerEnter:()=>_(!0),onPointerLeave:()=>{_(!1),N(null)},onPointerMove:ce=>{G||N({x:ce.clientX,y:ce.clientY})},style:{display:"contents"},children:[Re&&k("div",{style:{...tt.connector.style,backgroundColor:Ne,opacity:G?0:1}}),k("div",{...tt.handle,style:{...tt.handle.style,backgroundColor:De,border:`${Ie}px ${be} ${ae}`,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",opacity:G?0:1},children:k("svg",{width:Math.round(.6*V),height:Math.round(.6*V),viewB
vendor: 28,115 bytes, lines 2288-2291
2288ox:"0 0 24 24",fill:"none",stroke:He,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),k("path",{d:"M21 3v5h-5"})]})})]})),k("div",{...L?ze:{onPointerDown:ce=>ce.stopPropagation()},style:{position:"absolute",left:0,top:0,width:hn,height:Xt,outline:G?"none":`${Pt}px ${vt} ${Oe}`,outlineOffset:Wt-1,cursor:L?"move":"default",touchAction:"none",pointerEvents:"auto"},children:j&&!G&&Vt.map(({key:ce,...Ge})=>u?.component?u.component({key:ce,...Ge,backgroundColor:le}):k("div",{...Ge,style:{...Ge.style,backgroundColor:le}},ce))})]}),(G||z)&&M&&Gr(k("div",{style:{position:"fixed",left:M.x+16,top:M.y-16,background:"rgba(0,0,0,0.8)",color:"#fff",padding:"4px 8px",borderRadius:4,fontSize:12,fontFamily:"monospace",pointerEvents:"none",zIndex:1e4,whiteSpace:"nowrap"},children:[oe.toFixed(0),"°"]}),document.body),y&&!G&&k(oi,{rect:{origin:{x:$n,y:un},size:{width:hn,height:Xt}},rotation:o,children:ce=>{const Ge=((te+90*o)%360+360)%360;return y({...ce,context:{type:"group",annotations:a,pageIndex:t},selected:!0,placement:{suggestTop:E&&Ge>90&&Ge<270}})}})]})}function Ve(e){return{id:e.id,matches:e.matches?t=>e.matches(t):()=>!1,render:e.render?t=>e.render(t):()=>null,matchesPreview:e.matchesPreview,renderPreview:e.renderPreview?t=>e.renderPreview(t):void 0,previewContainerStyle:e.previewContainerStyle?t=>e.previewContainerStyle(t):void 0,vertexConfig:e.vertexConfig,zIndex:e.zIndex,defaultBlendMode:e.defaultBlendMode,containerStyle:e.containerStyle,interactionDefaults:e.interactionDefaults,useAppearanceStream:e.useAppearanceStream,isDraggable:e.isDraggable,onDoubleClick:e.onDoubleClick,selectOverride:e.selectOverride,hideSelectionMenu:e.hideSelectionMenu,hiddenWhenLocked:e.hiddenWhenLocked,renderLocked:e.renderLocked?t=>e.renderLocked(t):void 0}}function xd({isSelected:e,strokeColor:t,opacity:n=1,strokeWidth:o,inkList:i,rect:r,scale:a,onClick:s,appearanceActive:l=!1}){const c=t??"#000000",d=Z(()=>i.map(({points:p})=>{let f="";return p.forEach(({x:v,y},b)=>{const w=v-r.origin.x,x=y-r.origin.y;f+=(b===0?"M":"L")+w+" "+x+" "}),f.trim()}),[i,r]),u=r.size.width*a,m=r.size.height*a,g=Math.max(o,20/a);return k("svg",{style:{position:"absolute",width:u,height:m,pointerEvents:"none",zIndex:2,overflow:"visible"},width:u,height:m,viewBox:`0 0 ${r.size.width} ${r.size.height}`,children:[d.map((p,f)=>k("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:g,onPointerDown:s,style:{cursor:e?"move":s?"pointer":"default",pointerEvents:s?e?"none":"visibleStroke":"none",strokeLinecap:"round",strokeLinejoin:"round"}},`hit-${f}`)),!l&&d.map((p,f)=>k("path",{d:p,fill:"none",opacity:n,style:{pointerEvents:"none",stroke:c,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}},`vis-${f}`))]})}function kd({isSelected:e,color:t="#000000",strokeColor:n,opacity:o=1,strokeWidth:i,strokeStyle:r=ke.SOLID,strokeDashArray:a,rect:s,scale:l,onClick:c,appearanceActive:d=!1,cloudyBorderIntensity:u,rectangleDifferences:m}){const g=(u??0)>0,{width:p,height:f,x:v,y}=Z(()=>{const I=s.size.width,S=s.size.height;return{width:Math.max(I-i,0),height:Math.max(S-i,0),x:i/2,y:i/2}},[s,i]),b=Z(()=>g?(function(I,S,P,A){const D=new Qs;let R=0,M=0,N=I.width,z=I.height;return S?(R+=S.left,M+=S.top,N-=S.right,z-=S.bottom):(R+=A/2,M+=A/2,N-=A/2,z-=A/2),Js([{x:R,y:-M},{x:N,y:-M},{x:N,y:-z},{x:R,y:-z},{x:R,y:-M}],!1,P,A,D),D.close(),D.build(A)})({width:s.size.width,height:s.size.height},m,u,i):null,[g,s,m,u,i]),w=s.size.width*l,x=s.size.height*l,C=Math.max(i,20/l);return k("svg",{style:{position:"absolute",width:w,height:x,pointerEvents:"none",zIndex:2},width:w,height:x,viewBox:`0 0 ${s.size.width} ${s.size.height}`,overflow:"visible",children:[g&&b?k("path",{d:b.path,fill:"transparent",stroke:"transparent",strokeWidth:C,onPointerDown:c,style:{cursor:e?"move":c?"pointer":"default",pointerEvents:c?e?"none":t==="transparent"?"visibleStroke":"visible":"none"}}):k("rect",{x:v,y,width:p,height:f,fill:"transparent",stroke:"transparent",strokeWidth:C,onPointerDown:c,style:{cursor:e?"move":c?"pointer":"default",pointerEvents:c?e?"none":t==="transparent"?"visibleStroke":"visible":"none"}}),!d&&(g&&b?k("path",{d:b.path,fill:t,opacity:o,style:{pointerEvents:"none",stroke:n??t,strokeWidth:i,strokeLinejoin:"round"}}):k("rect",{x:v,y,width:p,height:f,fill:t,opacity:o,style:{pointerEvents:"none",stroke:n??t,strokeWidth:i,...r===ke.DASHED&&{strokeDasharray:a?.join(",")}}}))]})}function Cd({color:e="#000000",strokeColor:t,opacity:n=1,strokeWidth:o,strokeStyle:i=ke.SOLID,strokeDashArray:r,rect:a,scale:s,onClick:l,isSelected:c,appearanceActive:d=!1,cloudyBorderIntensity:u,rectangleDifferences:m}){const g=(u??0)>0,{width:p,height:f,cx:v,cy:y,rx:b,ry:w}=Z(()=>{const P=a.size.width,A=a.size.height,D=Math.max(P-o,0),R=Math.max(A-o,0);return{width:P,height:A,cx:o/2+D/2,cy:o/2+R/2,rx:D/2,ry:R/2}},[a,o]),x=Z(()=>g?(function(P,A,D,R){const M=new Qs;let N=0,z=0,_=P.width,L=P.height;return A&&(N+=A.left,z+=A.top,_-=A.right,L-=A.bottom),S0(N,-L,_,-z,D,R,M),M.close(),M.build(R)})({width:a.size.width,height:a.size.height},m,u,o):null,[g,a,m,u,o]),C=p*s,I=f*s,S=Math.max(o,20/s);return k("svg",{style:{position:"absolute",width:C,height:I,pointerEvents:"none",zIndex:2},width:C,height:I,viewBox:`0 0 ${p} ${f}`,overflow:"visible",children:[g&&x?k("path",{d:x.path,fill:"transparent",stroke:"transparent",strokeWidth:S,onPointerDown:l,style:{cursor:c?"move":l?"pointer":"default",pointerEvents:l?c?"none":e==="transparent"?"visibleStroke":"visible":"none"}}):k("ellipse",{cx:v,cy:y,rx:b,ry:w,fill:"transparent",stroke:"transparent",strokeWidth:S,onPointerDown:l,style:{cursor:c?"move":l?"pointer":"default",pointerEvents:l?c?"none":e==="transparent"?"visibleStroke":"visible":"none"}}),!d&&(g&&x?k("path",{d:x.path,fill:e,opacity:n,style:{pointerEvents:"none",stroke:t??e,strokeWidth:o,strokeLinejoin:"round"}}):k("ellipse",{cx:v,cy:y,rx:b,ry:w,fill:e,opacity:n,style:{pointerEvents:"none",stroke:t??e,strokeWidth:o,...i===ke.DASHED&&{strokeDasharray:r?.join(",")}}}))]})}function Id({color:e="transparent",opacity:t=1,strokeWidth:n,strokeColor:o="#000000",strokeStyle:i=ke.SOLID,strokeDashArray:r,rect:a,linePoints:s,lineEndings:l,scale:c,onClick:d,isSelected:u,appearanceActive:m=!1}){const{x1:g,y1:p,x2:f,y2:v}=Z(()=>({x1:s.start.x-a.origin.x,y1:s.start.y-a.origin.y,x2:s.end.x-a.origin.x,y2:s.end.y-a.origin.y}),[s,a]),y=Z(()=>{const C=Math.atan2(v-p,f-g);return{start:kn.createEnding(l?.start,n,C+Math.PI,g,p),end:kn.createEnding(l?.end,n,C,f,v)}},[l,n,g,p,f,v]),b=a.size.width*c,w=a.size.height*c,x=Math.max(n,20/c);return k("svg",{style:{position:"absolute",width:b,height:w,pointerEvents:"none",zIndex:2,overflow:"visible"},width:b,height:w,viewBox:`0 0 ${a.size.width} ${a.size.height}`,children:[k("line",{x1:g,y1:p,x2:f,y2:v,stroke:"transparent",strokeWidth:x,onPointerDown:d,style:{cursor:u?"move":d?"pointer":"default",pointerEvents:d?u?"none":"visibleStroke":"none",strokeLinecap:"butt"}}),y.start&&k("path",{d:y.start.d,transform:y.start.transform,fill:"transparent",stroke:"transparent",strokeWidth:x,onPointerDown:d,style:{cursor:u?"move":d?"pointer":"default",pointerEvents:d?u?"none":y.start.filled?"visible":"visibleStroke":"none",strokeLinecap:"butt"}}),y.end&&k("path",{d:y.end.d,transform:y.end.transform,fill:"transparent",stroke:"transparent",strokeWidth:x,onPointerDown:d,style:{cursor:u?"move":d?"pointer":"default",pointerEvents:d?u?"none":y.end.filled?"visible":"visibleStroke":"none",strokeLinecap:"butt"}}),!m&&k(de,{children:[k("line",{x1:g,y1:p,x2:f,y2:v,opacity:t,style:{pointerEvents:"none",stroke:o,strokeWidth:n,strokeLinecap:"butt",...i===ke.DASHED&&{strokeDasharray:r?.join(",")}}}),y.start&&k("path",{d:y.start.d,transform:y.start.transform,stroke:o,fill:y.start.filled?e:"none",style:{pointerEvents:"none",strokeWidth:n,strokeLinecap:"butt",...i===ke.DASHED&&{strokeDasharray:r?.join(",")}}}),y.end&&k("path",{d:y.end.d,transform:y.end.transform,stroke:o,fill:y.end.filled?e:"none",style:{pointerEvents:"none",strokeWidth:n,strokeLinecap:"butt",...i===ke.DASHED&&{strokeDasharray:r?.join(",")}}})]})]})}function Sd({rect:e,vertices:t,color:n="transparent",strokeColor:o="#000000",opacity:i=1,strokeWidth:r,strokeStyle:a=ke.SOLID,strokeDashArray:s,scale:l,isSelected:c,onClick:d,lineEndings:u,appearanceActive:m=!1}){const g=Z(()=>t.map(({x:w,y:x})=>({x:w-e.origin.x,y:x-e.origin.y})),[t,e]),p=Z(()=>{if(!g.length)return"";const[w,...x]=g;return`M ${w.x} ${w.y} `+x.map(C=>`L ${C.x} ${C.y} `).join("").trim()},[g]),f=Z(()=>{if(g.length<2)return{start:null,end:null};const w=(I,S)=>Math.atan2(S.y-I.y,S.x-I.x),x=w(g[0],g[1]),C=w(g[g.length-2],g[g.length-1]);return{start:kn.createEnding(u?.start,r,x+Math.PI,g[0].x,g[0].y),end:kn.createEnding(u?.end,r,C,g[g.length-1].x,g[g.length-1].y)}},[g,u,r]),v=e.size.width*l,y=e.size.height*l,b=Math.max(r,20/l);return k("svg",{style:{position:"absolute",width:v,height:y,pointerEvents:"none",zIndex:2,overflow:"visible"},width:v,height:y,viewBox:`0 0 ${e.size.width} ${e.size.height}`,children:[k("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:b,onPointerDown:d,style:{cursor:c?"move":d?"pointer":"default",pointerEvents:d?c?"none":"visibleStroke":"none",strokeLinecap:"butt",strokeLinejoin:"miter"}}),f.start&&k("path",{d:f.start.d,transform:f.start.transform,fill:"transparent",stroke:"transparent",strokeWidth:b,onPointerDown:d,style:{cursor:c?"move":d?"pointer":"default",pointerEvents:d?c?"none":f.start.filled?"visible":"visibleStroke":"none",strokeLinecap:"butt"}}),f.end&&k("path",{d:f.end.d,transform:f.end.transform,fill:"transparent",stroke:"transparent",strokeWidth:b,onPointerDown:d,style:{cursor:c?"move":d?"pointer":"default",pointerEvents:d?c?"none":f.end.filled?"visible":"visibleStroke":"none",strokeLinecap:"butt"}}),!m&&k(de,{children:[k("path",{d:p,opacity:i,style:{fill:"none",stroke:o??n,strokeWidth:r,pointerEvents:"none",strokeLinecap:"butt",strokeLinejoin:"miter",...a===ke.DASHED&&{strokeDasharray:s?.join(",")}}}),f.start&&k("path",{d:f.start.d,transform:f.start.transform,stroke:o,fill:f.start.filled?n:"none",style:{pointerEvents:"none",strokeWidth:r,strokeLinecap:"butt",...a===ke.DASHED&&{strokeDasharray:s?.join(",")}}}),f.end&&k("path",{d:f.end.d,transform:f.end.transform,stroke:o,fill:f.end.filled?n:"none",style:{pointerEvents:"none",strokeWidth:r,strokeLinecap:"butt",...a===ke.DASHED&&{strokeDasharray:s?.join(",")}}})]})]})}function Ad({rect:e,vertices:t,color:n="transparent",strokeColor:o="#000000",opacity:i=1,strokeWidth:r,strokeStyle:a=ke.SOLID,strokeDashArray:s,scale:l,isSelected:c,onClick:d,currentVertex:u,handleSize:m=14,appearanceActive:g=!1,cloudyBorderIntensity:p}){const f=(p??0)>0,v=u?[...t,u]:t,y=Z(()=>v.map(({x:P,y:A})=>({x:P-e.origin.x,y:A-e.origin.y})),[v,e]),b=Z(()=>{if(!y.length)return"";const[P,...A]=y,D=!!u;return(`M ${P.x} ${P.y} `+A.map(R=>`L ${R.x} ${R.y}`).join(" ")+(D?"":" Z")).trim()},[y,u]),w=Z(()=>!f||v.length<3?null:(function(P,A,D,R){const M=new Qs;if(P.length<3)return M.build(R);const N=P.map(L=>({x:L.x-A.x,y:-(L.y-A.y)})),z=N[0],_=N[N.length-1];return z.x===_.x&&z.y===_.y||N.push({x:z.x,y:z.y}),Js(N,!1,D,R,M),M.close(),M.build(R)})(v,e.origin,p,r),[f,v,e.origin,p,r]),x=u&&t.length>0,C=e.size.width*l,I=e.size.height*l,S=Math.max(r,20/l);return k("svg",{style:{position:"absolute",width:C,height:I,pointerEvents:"none",zIndex:2,overflow:"visible"},width:C,height:I,viewBox:`0 0 ${e.size.width} ${e.size.height}`,children:[k("path",{d:f&&w?w.path:b,fill:"transparent",stroke:"transparent",strokeWidth:S,onPointerDown:d,style:{cursor:c?"move":d?"pointer":"default",pointerEvents:d?c?"none":n==="transparent"?"visibleStroke":"visible":"none",strokeLinecap:"butt",strokeLinejoin:"miter"}}),!g&&k(de,{children:f&&w?k("path",{d:w.path,opacity:i,style:{fill:n,stroke:o??n,strokeWidth:r,pointerEvents:"none",strokeLinejoin:"round"}}):k(de,{children:[k("path",{d:b,opacity:i,style:{fill:u?"none":n,stroke:o??n,strokeWidth:r,pointerEvents:"none",strokeLinecap:"butt",strokeLinejoin:"miter",...a===ke.DASHED&&{strokeDasharray:s?.join(",")}}}),x&&t.length>1&&k("path",{d:`M ${y[y.length-1].x} ${y[y.length-1].y} L ${y[0].x} ${y[0].y}`,fill:"none",style:{stroke:o,strokeWidth:r,strokeDasharray:"4,4",opacity:.7,pointerEvents:"none"}}),x&&t.length>=2&&k("rect",{x:y[0].x-m/l/2,y:y[0].y-m/l/2,width:m/l,height:m/l,fill:o,opacity:.4,stroke:o,strokeWidth:r/2,style:{pointerEvents:"none"}})]})})]})}function xw({isSelected:e,color:t="#facc15",opacity:n=1,onClick:o,appearanceActive:i=!1}){const r=(function(a){try{const{red:s,green:l,blue:c}=Ay(a);return(.299*s+.587*l+.114*c)/255<.45?"#fff":"#000"}catch{return"#000"}})(t);return k("div",{style:{position:"absolute",inset:0,zIndex:2,pointerEvents:o?e?"none":"auto":"none",cursor:e?"move":o?"pointer":"default"},onPointerDown:o,children:!i&&k("svg",{style:{position:"absolute",inset:0,pointerEvents:"none"},viewBox:"0 0 20 20",width:"100%",height:"100%",children:[k("path",{d:"M 0.5 15.5 L 0.5 0.5 L 19.5 0.5 L 19.5 15.5 L 8.5 15.5 L 6.5 19.5 L 4.5 15.5 Z",fill:t,opacity:n,stroke:r,strokeWidth:"1",strokeLinejoin:"miter"}),k("line",{x1:"2.5",y1:"4.25",x2:"17.5",y2:"4.25",stroke:r,strokeWidth:"1"}),k("line",{x1:"2.5",y1:"8",x2:"17.5",y2:"8",stroke:r,strokeWidth:"1"}),k("line",{x1:"2.5",y1:"11.75",x2:"17.5",y2:"11.75",stroke:r,strokeWidth:"1"})]})})}function kw({documentId:e,isSelected:t,isEditing:n,annotation:o,pageIndex:i,scale:r,onClick:a,appearanceActive:s=!1}){const l=K(null),c=K(!1),{provides:d}=zt(),u=d?.forDocument(e)??null,{adjustedFontPx:m,wrapperStyle:g}=nl(o.object.fontSize*r,n);return $(()=>{var p;if(n&&l.current){c.current=!0;const f=l.current;f.focus();const v=u?.findToolForAnnotation(o.object),y=((p=v?.defaults)==null?void 0:p.contents)!=null&&o.object.contents===v.defaults.contents,b=window.getSelection();if(b){const w=document.createRange();w.selectNodeContents(f),y||w.collapse(!1),b.removeAllRanges(),b.addRange(w)}}},[n]),k("div",{style:{position:"absolute",width:o.object.rect.size.width*r,height:o.object.rect.size.height*r,cursor:t&&!n?"move":"default",pointerEvents:a?t&&!n?"none":"auto":"none",zIndex:2,opacity:s?0:1},onPointerDown:a,children:k("span",{ref:l,onBlur:()=>{c.current&&(c.current=!1,u&&l.current&&u.updateAnnotation(i,o.object.id,{contents:l.current.innerText.replace(/\u00A0/g," ")}))},tabIndex:0,style:{color:o.object.fontColor,fontSize:m,...Cn(o.object.fontFamily),textAlign:Ar(o.object.textAlign),flexDirection:"column",justifyContent:o.object.verticalAlign===mt.Top?"flex-start":o.object.verticalAlign===mt.Middle?"center":"flex-end",display:"flex",backgroundColor:o.object.color??o.object.backgroundColor,opacity:o.object.opacity,width:"100%",height:"100%",lineHeight:"1.18",overflow:"hidden",cursor:n?"text":a?"pointer":"default",outline:"none",...g},contentEditable:n,...Ug,children:o.object.contents})})}function Cw({documentId:e,isSelected:t,isEditing:n,annotation:o,pageIndex:i,scale:r,onClick:a,appearanceActive:s=!1}){const l=K(null),c=K(!1),{provides:d}=zt(),u=d?.forDocument(e)??null,m=o.object,g=m.rect,p=m.rectangleDifferences,f=m.calloutLine,v=m.strokeWidth??1,y=m.strokeColor??"#000000",b=Z(()=>kn.computeTextBoxFromRD(g,p),[g,p]),w=Z(()=>({left:(b.origin.x-g.origin.x+v/2)*r,top:(b.origin.y-g.origin.y+v/2)*r,width:(b.size.width-v)*r,height:(b.size.height-v)*r}),[b,g,r,v]),x=Z(()=>!f||f.length<3?null:f.map(M=>({x:M.x-g.origin.x,y:M.y-g.origin.y})),[f,g]),C=Z(()=>{if(!x||x.length<2)return null;const M=Math.atan2(x[1].y-x[0].y,x[1].x-x[0].x);return kn.createEnding(m.lineEnding,v,M+Math.PI,x[0].x,x[0].y)},[x,m.lineEnding,v]),I=Z(()=>{if(!x||x.length<2)return x;const M=x.map(E=>({...E})),N=M.length-1,z=N-1,_=M[N].x-M[z].x,L=M[N].y-M[z].y,j=Math.sqrt(_*_+L*L);if(j>0){const E=v/2;M[N].x+=_/j*E,M[N].y+=L/j*E}return M},[x,v]),{adjustedFontPx:S,wrapperStyle:P}=nl(m.fontSize*r,n);$(()=>{var M;if(n&&l.current){c.current=!0;const N=l.current;N.focus();const z=u?.findToolForAnnotation(m),_=((M=z?.defaults)==null?void 0:M.contents)!=null&&m.contents===z.defaults.contents,L=window.getSelection();if(L){const j=document.createRange();j.selectNodeContents(N),_||j.collapse(!1),L.removeAllRanges(),L.addRange(j)}}},[n]);const A=g.size.width*r,D=g.size.height*r,R=Math.max(v,20/r);return k("div",{style:{position:"absolute",width:A,height:D,cursor:t&&!n?"move":"default",pointerEvents:"none",zIndex:2,opacity:s?0:1},children:[k("svg",{style:{position:"absolute",width:A,height:D,pointerEvents:"none",overflow:"visible"},width:A,height:D,viewBox:`0 0 ${g.size.width} ${g.size.height}`,children:[x&&k(de,{children:[k("polyline",{points:x.map(M=>`${M.x},${M.y}`).join(" "),fill:"none",stroke:"transparent",strokeWidth:R,onPointerDown:a?M=>a(M):void 0,style:{cursor:t?"move":a?"pointer":"default",pointerEvents:a?t?"none":"visibleStroke":"none"}}),C&&k("path",{d:C.d,transform:C.transform,fill:"transparent",stroke:"transparent",strokeWidth:R,onPointerDown:a?M=>a(M):void 0,style:{cursor:t?"move":a?"pointer":"default",pointerEvents:a?t?"none":C.filled?"visible":"visibleStroke":"none"}})]}),!s&&k(de,{children:[I&&k(de,{children:[k("polyline",{points:I.map(M=>`${M.x},${M.y}`).join(" "),fill:"none",stroke:y,strokeWidth:v,opacity:m.opacity,style:{pointerEvents:"none"}}),C&&k("path",{d:C.d,transform:C.transform,stroke:y,fill:C.filled?m.color??"transparent":"none",strokeWidth:v,opacity:m.opacity,style:{pointerEvents:"none"}})]}),k("rect",{x:b.origin.x-g.origin.x+v/2,y:b.origin.y-g.origin.y+v/2,width:b.size.width-v,height:b.size.height-v,fill:m.color??m.backgroundColor??"transparent",stroke:y,strokeWidth:v,opacity:m.opacity,style:{pointerEvents:"none"}})]})]}),k("div",{onPointerDown:a?M=>a(M):void 0,style:{position:"absolute",left:(b.origin.x-g.origin.x)*r,top:(b.origin.y-g.origin.y)*r,width:b.size.width*r,height:b.size.height*r,cursor:t&&!n?"move":a?"pointer":"default",pointerEvents:a?t&&!n?"none":"auto":"none"}}),k("span",{ref:l,onBlur:()=>{c.current&&(c.current=!1,u&&l.current&&u.updateAnnotation(i,m.id,{contents:l.current.innerText.replace(/\u00A0/g," ")}))},tabIndex:0,style:{position:"absolute",left:w.left,top:w.top,width:w.width,height:w.height,color:m.fontColor,fontSize:S,...Cn(m.fontFamily),textAlign:Ar(m.textAlign),flexDirection:"column",justifyContent:m.verticalAlign===mt.Top?"flex-start":m.verticalAlign===mt.Middle?"center":"flex-end",display:"flex",padding:v*r/2+2*r,opacity:m.opacity,lineHeight:"1.18",overflow:"hidden",cursor:n?"text":"default",outline:"none",pointerEvents:n?"auto":"none",...P},contentEditable:n,...Ug,children:m.contents})]})}function Iw({calloutLine:e,textBox:t,bounds:n,scale:o,strokeColor:i,strokeWidth:r,color:a,backgroundColor:s,opacity:l,lineEnding:c}){if(!e||e.length<2)return k(de,{});const d=r??1,u=i??"#000000",m=l??1,g=n.size.width,p=n.size.height,f=n.origin.x,v=n.origin.y,y=e.map(C=>({x:C.x-f,y:C.y-v})),b=Math.atan2(y[1].y-y[0].y,y[1].x-y[0].x),w=kn.createEnding(c,d,b+Math.PI,y[0].x,y[0].y),x=d/2;return k("svg",{style:{position:"absolute",width:g*o,height:p*o,pointerEvents:"none",overflow:"visible"},width:g*o,height:p*o,viewBox:`0 0 ${g} ${p}`,children:[k("polyline",{points:y.map(C=>`${C.x},${C.y}`).join(" "),fill:"none",stroke:u,strokeWidth:d,opacity:m}),w&&k("path",{d:w.d,transform:w.transform,stroke:u,fill:w.filled?a??"transparent":"none",strokeWidth:d,opacity:m}),t&&k("rect",{x:t.origin.x-f+x,y:t.origin.y-v+x,width:t.size.width-d,height:t.size.height-d,fill:a??s??"transparent",stroke:u,strokeWidth:d,opacity:m})]})}function Sw({documentId:e,pageIndex:t,annotation:n,scaleFactor:o=1,unrotated:i,style:r,...a}){const{provides:s}=zt(),[l,c]=O(null),d=K(null),{width:u,height:m}=n.rect.size;return $(()=>{if(s){const g=s.forDocument(e).renderAnnotation({pageIndex:t,annotation:n,options:{scaleFactor:o,dpr:window.devicePixelRatio,unrotated:i}});return g.wait(p=>{const f=URL.createObjectURL(p);c(f),d.current=f},et),()=>{d.current?(URL.revokeObjectURL(d.current),d.current=null):g.abort({code:H.Cancelled,message:"canceled render task"})}}},[t,o,i,s,e,n.id,u,m]),k(de,{children:l&&k("img",{src:l,onLoad:()=>{d.current&&(URL.revokeObjectURL(d.current),d.current=null)},...a,style:{width:"100%",height:"100%",display:"block",...r||{}}})})}function Aw({isSelected:e,annotation:t,documentId:n,pageIndex:o,scale:i,onClick:r}){const a=!!t.object.rotation&&!!t.object.unrotatedRect;return k("div",{style:{position:"absolute",width:"100%",height:"100%",zIndex:2,pointerEvents:r?e?"none":"auto":"none",cursor:r?"pointer":"default"},onPointerDown:r,children:k(Sw,{documentId:n,pageIndex:o,annotation:{...t.object,id:t.object.id},scaleFactor:i,unrotated:a})})}function Pw({isSelected:e,strokeColor:t="#0000FF",strokeWidth:n=2,strokeStyle:o=ke.UNDERLINE,strokeDashArray:i,rect:r,scale:a,onClick:s,hasIRT:l=!1}){const{width:c,height:d}=Z(()=>({width:r.size.width,height:r.size.height}),[r]),u=c*a,m=d*a,g=Z(()=>{if(o===ke.DASHED)return i?.join(",")??`${3*n},${n}`},[o,i,n]),p=o===ke.UNDERLINE;return k("svg",{style:{position:"absolute",width:u,height:m,pointerEvents:"none",zIndex:2},width:u,height:m,viewBox:`0 0 ${c} ${d}`,children:[k("rect",{x:0,y:0,width:c,height:d,fill:"transparent",onPointerDown:l?void 0:s,style:{cursor:l||!s?"default":e?"move":"pointer",pointerEvents:l||!s||e?"none":"visible"}}),p?k("line",{x1:1,y1:d-1,x2:c-1,y2:d-1,stroke:t,strokeWidth:n,strokeDasharray:g,style:{pointerEvents:"none"}}):k("rect",{x:n/2,y:n/2,width:Math.max(c-n,0),height:Math.max(d-n,0),fill:"transparent",stroke:t,strokeWidth:n,strokeDasharray:g,style:{pointerEvents:"none"}})]})}function qg({strokeColor:e,opacity:t=.5,segmentRects:n,rect:o,scale:i,onClick:r,style:a,appearanceActive:s=!1}){const l=e??"#FFFF00";return k(de,{children:n.map((c,d)=>k("div",{onPointerDown:r,style:{position:"absolute",left:(o?c.origin.x-o.origin.x:c.origin.x)*i,top:(o?c.origin.y-o.origin.y:c.origin.y)*i,width:c.size.width*i,height:c.size.height*i,background:s?"transparent":l,opacity:s?void 0:t,pointerEvents:r?"auto":"none",cursor:r?"pointer":"default",zIndex:r?1:void 0,...a}},d))})}function Kg({strokeColor:e,opacity:t=.5,segmentRects:n,rect:o,scale:i,onClick:r,style:a,appearanceActive:s=!1}){const l=e??"#FFFF00",c=2*i;return k(de,{children:n.map((d,u)=>k("div",{onPointerDown:r,style:{position:"absolute",left:(o?d.origin.x-o.origin.x:d.origin.x)*i,top:(o?d.origin.y-o.origin.y:d.origin.y)*i,width:d.size.width*i,height:d.size.height*i,background:"transparent",pointerEvents:r?"auto":"none",cursor:r?"pointer":"default",zIndex:r?1:0,...a},children:!s&&k("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:c,background:l,opacity:t,pointerEvents:"none"}})},u))})}function Vg({strokeColor:e,opacity:t=.5,segmentRects:n,rect:o,scale:i,onClick:r,style:a,appearanceActive:s=!1}){const l=e??"#FFFF00",c=2*i;return k(de,{children:n.map((d,u)=>k("div",{onPointerDown:r,style:{position:"absolute",left:(o?d.origin.x-o.origin.x:d.origin.x)*i,top:(o?d.origin.y-o.origin.y:d.origin.y)*i,width:d.size.width*i,height:d.size.height*i,background:"transparent",pointerEvents:r?"auto":"none",cursor:r?"pointer":"default",zIndex:r?1:0,...a},children:!s&&k("div",{style:{position:"absolute",left:0,top:"50%",width:"100%",height:c,background:l,opacity:t,transform:"translateY(-50%)",pointerEvents:"none"}})},u))})}function Xg({strokeColor:e,opacity:t=.5,segmentRects:n,rect:o,scale:i,onClick:r,style:a,appearanceActive:s=!1}){const l=2*i,c=6*i,d=`url("data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${2*l}" viewBox="0 0 ${c} ${2*l}">
2289      <path d="M0 ${l} Q ${c/4} 0 ${c/2} ${l} T ${c} ${l}"
2290            fill="none" stroke="${e??"#FFFF00"}" stroke-width="${l}" stroke-linecap="round"/>
2291    </svg>`)}")`;return k(de,{children:n.map((u,m)=>k("div",{onPointerDown:r,style:{position:"absolute",left:(o?u.origin.x-o.origin.x:u.origin.x)*i,top:(o?u.origin.y-o.origin.y:u.origin.y)*i,width:u.size.width*i,height:u.size.height*i,background:"transparent",pointerEvents:r?"auto":"none",cursor:r?"pointer":"default",zIndex:r?1:0,...a},children:!s&&k("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:2*l,backgroundImage:d,backgroundRepeat:"repeat-x",backgroundSize:`${c}px ${2*l}px`,opacity:t,pointerEvents:"none"}})},m))})}function Mw({isSelected:e,strokeColor:t="#000000",opacity:n=1,rect:o,scale:i,onClick:r,appearanceActive:a=!1}){const{width:s,height:l,path:c}=Z(()=>{const m=o.size.width,g=o.size.height,p=m/2;return{width:m,height:g,path:[`M 0 ${g}`,`C ${.27*m} ${g} ${p} ${g-.44*g} ${p} 0`,`C ${p} ${g-.44*g} ${m-.27*m} ${g} ${m} ${g}`,"Z"].join(" ")}},[o]),d=s*i,u=l*i;return k("svg",{style:{position:"absolute",width:d,height:u,pointerEvents:"none",zIndex:2},width:d,height:u,viewBox:`0 0 ${s} ${l}`,overflow:"visible",children:[k("path",{d:c,fill:"transparent",stroke:"transparent",strokeWidth:4,onPointerDown:r,style:{cursor:e?"move":r?"pointer":"default",pointerEvents:r?e?"none":"visible":"none"}}),!a&&k("path",{d:c,fill:t,stroke:t,strokeWidth:.5,opacity:n,fillRule:"evenodd",style:{pointerEvents:"none"}})]})}function Dw({annotation:e,documentId:t}){const{provides:n}=zt();return k("div",{onClick:W(()=>{const o=e.object.target;o&&n&&n.forDocument(t).navigateTarget(o)},[e.object.target,n,t]),style:{width:"100%",height:"100%",cursor:"pointer",pointerEvents:"auto"}})}const Zg=[Ve({id:"ink",matches:e=>e.type===T.INK,matchesPreview:e=>e.type===T.INK,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(xd,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i}),renderPreview:({data:e,scale:t})=>k(xd,{isSelected:!1,scale:t,...e}),previewContainerStyle:({data:e})=>({mixBlendMode:vo(e.blendMode??ve.Normal)}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),Ve({id:"square",matches:e=>e.type===T.SQUARE,matchesPreview:e=>e.type===T.SQUARE,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(kd,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i}),renderPreview:({data:e,scale:t})=>k(kd,{isSelected:!1,scale:t,...e}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),Ve({id:"circle",matches:e=>e.type===T.CIRCLE,matchesPreview:e=>e.type===T.CIRCLE,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(Cd,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i}),renderPreview:({data:e,scale:t})=>k(Cd,{isSelected:!1,scale:t,...e}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),Ve({id:"line",matches:e=>e.type===T.LINE,matchesPreview:e=>e.type===T.LINE,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(de,{children:k(Id,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>k(Id,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>[e.linePoints.start,e.linePoints.end],transformAnnotation:(e,t)=>({...e,linePoints:{start:t[0],end:t[1]}})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),Ve({id:"polyline",matches:e=>e.type===T.POLYLINE,matchesPreview:e=>e.type===T.POLYLINE,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(de,{children:k(Sd,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>k(Sd,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>e.vertices,transformAnnotation:(e,t)=>({...e,vertices:t})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),Ve({id:"polygon",matches:e=>e.type===T.POLYGON,matchesPreview:e=>e.type===T.POLYGON,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(de,{children:k(Ad,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i})}),renderPreview:({data:e,scale:t})=>k(Ad,{isSelected:!1,scale:t,...e}),vertexConfig:{extractVertices:e=>e.vertices,transformAnnotation:(e,t)=>({...e,vertices:t})},interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!0}}),Ve({id:"highlight",matches:e=>e.type===T.HIGHLIGHT,render:({currentObject:e,scale:t,onClick:n,appearanceActive:o})=>k(qg,{...e,scale:t,onClick:n,appearanceActive:o}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}
2291,defaultBlendMode:ve.Multiply}),Ve({id:"underline",matches:e=>e.type===T.UNDERLINE,render:({currentObject:e,scale:t,onClick:n,appearanceActive:o})=>k(Kg,{...e,scale:t,onClick:n,appearanceActive:o}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),Ve({id:"strikeout",matches:e=>e.type===T.STRIKEOUT,render:({currentObject:e,scale:t,onClick:n,appearanceActive:o})=>k(Vg,{...e,scale:t,onClick:n,appearanceActive:o}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),Ve({id:"squiggly",matches:e=>e.type===T.SQUIGGLY,render:({currentObject:e,scale:t,onClick:n,appearanceActive:o})=>k(Xg,{...e,scale:t,onClick:n,appearanceActive:o}),zIndex:0,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),Ve({id:"text",matches:e=>e.type===T.TEXT&&!e.inReplyToId,render:({currentObject:e,isSelected:t,onClick:n,appearanceActive:o})=>k(xw,{isSelected:t,color:e.strokeColor??e.color,opacity:e.opacity,onClick:n,appearanceActive:o}),interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!1}}),Ve({id:"caret",matches:e=>e.type===T.CARET,render:({currentObject:e,isSelected:t,scale:n,onClick:o,appearanceActive:i})=>k(Mw,{...e,isSelected:t,scale:n,onClick:o,appearanceActive:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1}}),Ve({id:"freeTextCallout",matches:e=>e.type===T.FREETEXT&&e.intent==="FreeTextCallout",matchesPreview:e=>e.type===T.FREETEXT&&!!e.data.calloutLine,render:({annotation:e,currentObject:t,isSelected:n,isEditing:o,scale:i,pageIndex:r,documentId:a,onClick:s,appearanceActive:l})=>k(Cw,{documentId:a,isSelected:n,isEditing:o,annotation:{...e,object:t},pageIndex:r,scale:i,onClick:s,appearanceActive:l}),renderPreview:({data:e,bounds:t,scale:n})=>k(Iw,{calloutLine:e.calloutLine,textBox:e.textBox,bounds:t,scale:n,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,color:e.color,backgroundColor:e.backgroundColor,opacity:e.opacity,lineEnding:e.lineEnding}),vertexConfig:kn.calloutVertexConfig,interactionDefaults:{isDraggable:!0,isResizable:!1,isRotatable:!1},isDraggable:(e,{isEditing:t})=>e&&!t,onDoubleClick:(e,t)=>t(e)}),Ve({id:"freeText",matches:e=>e.type===T.FREETEXT&&e.intent!=="FreeTextCallout",matchesPreview:e=>e.type===T.FREETEXT&&!e.data.calloutLine,render:({annotation:e,currentObject:t,isSelected:n,isEditing:o,scale:i,pageIndex:r,documentId:a,onClick:s,appearanceActive:l})=>k(kw,{documentId:a,isSelected:n,isEditing:o,annotation:{...e,object:t},pageIndex:r,scale:i,onClick:s,appearanceActive:l}),renderPreview:({data:e})=>k("div",{style:{width:"100%",height:"100%",border:`1px dashed ${e.fontColor||"#000000"}`,backgroundColor:"transparent"}}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0},isDraggable:(e,{isEditing:t})=>e&&!t,onDoubleClick:(e,t)=>t(e)}),Ve({id:"stamp",matches:e=>e.type===T.STAMP,matchesPreview:e=>e.type===T.STAMP,render:({annotation:e,isSelected:t,documentId:n,pageIndex:o,scale:i,onClick:r})=>k(Aw,{isSelected:t,annotation:e,documentId:n,pageIndex:o,scale:i,onClick:r}),renderPreview:({data:e})=>{const t=(4-e.pageRotation)%4*90;return k("img",{src:e.ghostUrl,style:{width:"100%",height:"100%",opacity:.6,objectFit:"contain",pointerEvents:"none",transform:t?`rotate(${t}deg)`:void 0},alt:""})},useAppearanceStream:!1,interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!0}}),Ve({id:"link",matches:e=>e.type===T.LINK,matchesPreview:e=>e.type===T.LINK,render:({currentObject:e,isSelected:t,scale:n,onClick:o})=>k(Pw,{...e,isSelected:t,scale:n,onClick:o,hasIRT:!!e.inReplyToId}),renderPreview:({data:e,bounds:t,scale:n})=>k("div",{style:{position:"absolute",left:0,top:0,width:t.size.width*n,height:t.size.height*n,borderBottom:`${e.strokeWidth*n}px solid ${e.strokeColor}`,backgroundColor:"rgba(0, 0, 255, 0.05)",boxSizing:"border-box"}}),interactionDefaults:{isDraggable:!0,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,selectOverride:(e,t,n)=>{if(e.stopPropagation(),n.clearSelection(),t.object.inReplyToId){const o=n.allAnnotations.find(i=>i.object.id===t.object.inReplyToId);if(o)return void n.selectAnnotation(o.object.pageIndex,o.object.id)}n.selectAnnotation(n.pageIndex,t.object.id)},hideSelectionMenu:e=>!!e.inReplyToId,renderLocked:e=>k(Dw,{...e})})];function Tw(e){const{documentId:t,pageIndex:n,scale:o,pageWidth:i,pageHeight:r,selectionMenu:a}=e,{provides:s}=zt(),{provides:l}=$r(),[c,d]=O([]),{register:u}=(function({modeId:E,pageIndex:F,documentId:X}){const{provides:Q}=ci();return{register:(J,te)=>{const G=te?.modeId??E,oe=te?.pageIndex??F,le=te?.documentId??X;return G?Q?.registerHandlers({modeId:G,handlers:J,pageIndex:oe,documentId:le}):Q?.registerAlways({scope:oe!==void 0?{type:"page",documentId:le,pageIndex:oe}:{type:"global",documentId:le},handlers:J})}}})({documentId:t,pageIndex:n}),[m,g]=O([]),[p,f]=O(null),[v,y]=O({}),[,b]=O({type:Ze.None}),w=K(o),x=Z(()=>s?s.forDocument(t):null,[s,t]),C=m.length>1;$(()=>{if(x){const E=x.getState();return d(qa(E,n)),g(Ka(E)),b(E.locked),x.onStateChange(F=>{d(qa(F,n)),g(Ka(F)),b(F.locked)})}},[x,n]),$(()=>{if(x)return x.onAnnotationEvent(E=>{E.type==="create"&&E.editAfterCreate&&f(E.annotation.id)})},[x]),$(()=>{x&&(w.current!==o&&(x.invalidatePageAppearances(n),w.current=o),x.getPageAppearances(n,{scaleFactor:o,dpr:typeof window<"u"?window.devicePixelRatio:1}).wait(E=>y(E),()=>y({})))},[x,n,o]);const I=Z(()=>({onPointerDown:(E,F)=>{F.target===F.currentTarget&&x&&(p&&c.some(X=>X.object.id===p)&&F.stopImmediatePropagation(),x.deselectAnnotation(),f(null))}}),[x,p,c]),S=W((E,F)=>{E.stopPropagation(),x&&l&&(l.clear(),"metaKey"in E&&(E.metaKey||E.ctrlKey)?x.toggleSelection(n,F.object.id):x.selectAnnotation(n,F.object.id),F.object.id!==p&&f(null))},[x,l,p,n]);$(()=>u(I,{documentId:t}),[u,I]);const P=Z(()=>c.filter(E=>m.includes(E.object.id)),[c,m]),A=Z(()=>!(P.length<2)&&P.every(E=>
2291{const F=x?.findToolForAnnotation(E.object),X=Ft(F?.interaction.isGroupDraggable,E.object,!0),Q=Ft(F?.interaction.isDraggable,E.object,!0);return F?.interaction.isGroupDraggable!==void 0?X:Q}),[P,x]),D=Z(()=>!(P.length<2)&&P.every(E=>{const F=x?.findToolForAnnotation(E.object),X=Ft(F?.interaction.isGroupResizable,E.object,!0),Q=Ft(F?.interaction.isResizable,E.object,!0);return F?.interaction.isGroupResizable!==void 0?X:Q}),[P,x]),R=Z(()=>!(P.length<2)&&P.every(E=>{const F=x?.findToolForAnnotation(E.object),X=Ft(F?.interaction.isGroupRotatable,E.object,!0),Q=Ft(F?.interaction.isRotatable,E.object,!0);return F?.interaction.isGroupRotatable!==void 0?X:Q}),[P,x]),M=Z(()=>!(P.length<2)&&P.some(E=>{const F=x?.findToolForAnnotation(E.object),X=Ft(F?.interaction.lockGroupAspectRatio,E.object,!1),Q=Ft(F?.interaction.lockAspectRatio,E.object,!1);return F?.interaction.lockGroupAspectRatio!==void 0?X:Q}),[P,x]),N=Z(()=>{if(!x)return!1;const E=x.getSelectedAnnotations();return E.length>1&&E.every(F=>F.object.pageIndex===n)},[x,n,m]),z=W(E=>{if(E.dictMode||E.object.rotation&&E.object.unrotatedRect)return null;const F=v[E.object.id];return F?.normal?F:null},[v]),_=Z(()=>{const E=e.annotationRenderers??[],F=new Set(E.map(X=>X.id));return[...E,...Zg.filter(X=>!F.has(X.id))]},[e.annotationRenderers]),L=W(E=>_.find(F=>F.matches(E.object))??null,[_]),j=Z(()=>({defaultSelect:S,selectAnnotation:(E,F)=>x?.selectAnnotation(E,F),clearSelection:()=>l?.clear(),allAnnotations:c,pageIndex:n}),[S,x,l,c,n]);return k(de,{children:[c.map(E=>{var F,X,Q;const J=L(E);if(!J||Yp(E.object)||Qp(E.object))return null;const te=x?.findToolForAnnotation(E.object)??null,G=!!x&&!x.isAnnotationInteractive(E.object),oe=!!x&&x.isAnnotationStructurallyLocked(E.object),le=!!x&&x.isAnnotationContentLocked(E.object);if(G&&J.hiddenWhenLocked)return null;const Te=G&&!!J.renderLocked,De=!G&&m.includes(E.object.id),Ne=!G&&p===E.object.id,V=J.interactionDefaults,Se=Ft(te?.interaction.isDraggable,E.object,V?.isDraggable??!0),He=!oe&&(J.isDraggable?J.isDraggable(Se,{isEditing:Ne}):Se),Re=((F=te?.behavior)==null?void 0:F.useAppearanceStream)??J.useAppearanceStream??!0,ae=Te?void 0:Re?z(E):void 0,Ie=G?be=>{be.stopPropagation()}:J.selectOverride?be=>J.selectOverride(be,E,j):be=>S(be,E);return k(yw,{trackedAnnotation:E,isSelected:De,isEditing:Ne,isMultiSelected:!G&&C,isDraggable:He,isResizable:!oe&&Ft(te?.interaction.isResizable,E.object,V?.isResizable??!1),lockAspectRatio:Ft(te?.interaction.lockAspectRatio,E.object,V?.lockAspectRatio??!1),isRotatable:!oe&&Ft(te?.interaction.isRotatable,E.object,V?.isRotatable??!1),vertexConfig:oe?void 0:J.vertexConfig,selectionMenu:G||(X=J.hideSelectionMenu)!=null&&X.call(J,E.object)?void 0:a,structurallyLocked:oe,contentLocked:le,onSelect:Ie,onDoubleClick:G||le?void 0:J.onDoubleClick?be=>{be.stopPropagation(),J.onDoubleClick(E.object.id,f)}:void 0,zIndex:J.zIndex,blendMode:vo(E.object.blendMode??J.defaultBlendMode??ve.Normal),style:(Q=J.containerStyle)==null?void 0:Q.call(J,E.object),appearance:ae,...e,children:(be,{appearanceActive:Oe})=>Te?J.renderLocked({annotation:E,currentObject:be,isSelected:!1,isEditing:!1,scale:o,pageIndex:n,documentId:t,onClick:void 0,appearanceActive:Oe}):J.render({annotation:E,currentObject:be,isSelected:De,isEditing:Ne,scale:o,pageIndex:n,documentId:t,onClick:G?void 0:Ie,appearanceActive:Oe})},E.object.id)}),N&&P.length>=2&&k(ww,{documentId:t,pageIndex:n,scale:o,rotation:e.rotation,pageWidth:i,pageHeight:r,selectedAnnotations:P,isDraggable:A,isResizable:D,isRotatable:R,lockAspectRatio:M,resizeUI:e.resizeUI,rotationUI:e.rotationUI,selectionOutlineColor:e.selectionOutlineColor,selectionOutline:e.groupSelectionOutline??e.selectionOutline,groupSelectionMenu:e.groupSelectionMenu})]})}function Rw({documentId:e,pageIndex:t,scale:n}){var o,i,r,a,s,l,c,d,u,m,g,p;const{provides:f}=$r(),{provides:v}=zt(),[y,b]=O([]),[w,x]=O(null),[C,I]=O(null);if($(()=>{if(f)return f.forDocument(e).onSelectionChange(()=>{b(f.forDocument(e).getHighlightRectsForPage(t)),x(f.forDocument(e).getBoundingRectForPage(t))})},[f,e,t]),$(()=>{if(v)return I(v.forDocument(e).getActiveTool()),v.forDocument(e).onActiveToolChange(S=>I(S))},[v,e]),!w||!C||!C.defaults)return null;switch(C.defaults.type){case T.UNDERLINE:return k("div",{style:{mixBlendMode:vo(((o=C.defaults)==null?void 0:o.blendMode)??ve.Normal),pointerEvents:"none",position:"absolute",inset:0},children:k(Kg,{strokeColor:(i=C.defaults)==null?void 0:i.strokeColor,opacity:(r=C.defaults)==null?void 0:r.opacity,segmentRects:y,scale:n})});case T.HIGHLIGHT:return k("div",{style:{mixBlendMode:vo(((a=C.defaults)==null?void 0:a.blendMode)??ve.Multiply),pointerEvents:"none",position:"absolute",inset:0},children:k(qg,{strokeColor:(s=C.defaults)==null?void 0:s.strokeColor,opacity:(l=C.defaults)==null?void 0:l.opacity,segmentRects:y,scale:n})});case T.STRIKEOUT:return k("div",{style:{mixBlendMode:vo(((c=C.defaults)==null?void 0:c.blendMode)??ve.Normal),pointerEvents:"none",position:"absolute",inset:0},children:k(Vg,{strokeColor:(d=C.defaults)==null?void 0:d.strokeColor,opacity:(u=C.defaults)==null?void 0:u.opacity,segmentRects:y,scale:n})});case T.SQUIGGLY:return k("div",{style:{mixBlendMode:vo(((m=C.defaults)==null?void 0:m.blendMode)??ve.Normal),pointerEvents:"none",position:"absolute",inset:0},children:k(Xg,{strokeColor:(g=C.defaults)==null?void 0:g.strokeColor,opacity:(p=C.defaults)==null?void 0:p.opacity,segmentRects:y,scale:n})});
2291case T.CARET:default:return null}}function Ew({toolId:e,preview:t,scale:n}){var o;const{bounds:i}=t,r=Gg(),a=Z(()=>{const c=new Set(r.map(d=>d.id));return[...r,...Zg.filter(d=>!c.has(d.id))]},[r]),s={position:"absolute",left:i.origin.x*n,top:i.origin.y*n,width:i.size.width*n,height:i.size.height*n,pointerEvents:"none",zIndex:10},l=a.find(c=>{var d;return((d=c.matchesPreview)==null?void 0:d.call(c,t))&&c.renderPreview})??a.find(c=>c.id===e&&c.renderPreview);return l?.renderPreview?k("div",{style:{...s,...(o=l.previewContainerStyle)==null?void 0:o.call(l,{data:t.data,bounds:t.bounds,scale:n})},children:l.renderPreview({data:t.data,bounds:t.bounds,scale:n})}):null}function zw({documentId:e,pageIndex:t,scale:n}){const{plugin:o}=Kr(),[i,r]=O(new Map),a=K(null),s=Z(()=>({requestFile:({accept:l,onFile:c})=>{if(!a.current)return;const d=a.current;d.accept=l,d.onchange=u=>{var m;const g=(m=u.target.files)==null?void 0:m[0];g&&(c(g),d.value="")},d.click()}}),[]);return $(()=>{if(o)return o.registerPageHandlers(e,t,n,{services:s,onPreview:(l,c)=>{r(d=>{const u=new Map(d);return c?u.set(l,c):u.delete(l),u})}})},[e,t,n,o,s]),k(de,{children:[k("input",{ref:a,type:"file",style:{display:"none"}}),Array.from(i.entries()).map(([l,c])=>k(Ew,{toolId:l,preview:c,scale:n},l))]})}function Lw({style:e,documentId:t,pageIndex:n,scale:o,rotation:i,selectionMenu:r,groupSelectionMenu:a,resizeUI:s,vertexUI:l,rotationUI:c,selectionOutlineColor:d,selectionOutline:u,groupSelectionOutline:m,customAnnotationRenderer:g,annotationRenderers:p,...f}){var v,y,b,w;const x=pt(t),C=(y=(v=x?.document)==null?void 0:v.pages)==null?void 0:y[n],I=((b=C?.size)==null?void 0:b.width)??0,S=((w=C?.size)==null?void 0:w.height)??0,P=Gg(),A=Z(()=>{const R=[...P];for(const M of p??[]){const N=R.findIndex(z=>z.id===M.id);N>=0?R[N]=M:R.push(M)}return R},[P,p]),D=Z(()=>o!==void 0?o:x?.scale??1,[o,x?.scale]);return k("div",{style:{...e},...f,children:[k(Tw,{documentId:t,selectionMenu:r,groupSelectionMenu:a,pageIndex:n,scale:D,rotation:Z(()=>i!==void 0?i:((C?.rotation??0)+(x?.rotation??0))%4,[i,C?.rotation,x?.rotation]),pageWidth:I,pageHeight:S,resizeUI:s,vertexUI:l,rotationUI:c,selectionOutlineColor:d,selectionOutline:u,groupSelectionOutline:m,customAnnotationRenderer:g,annotationRenderers:A}),k(Rw,{documentId:t,pageIndex:n,scale:D}),k(zw,{documentId:t,pageIndex:n,scale:D})]})}const Nw=Bt(Q0).addWrapper(function({children:e}){const[t,n]=O([]),o=W(i=>(n(r=>{const a=new Set(i.map(s=>s.id));return[...r.filter(s=>!a.has(s.id)),...i]}),()=>n(r=>r.filter(a=>!i.some(s=>s.id===a.id)))),[]);return k(Bg.Provider,{value:o,children:k(Wg.Provider,{value:t,children:e})})}).addUtility(function(){const{plugin:e}=Kr(),{provides:t}=zt();return $(()=>{if(t&&e)return t.onNavigate(n=>{n.result.outcome==="uri"&&e.config.autoOpenLinks!==!1&&window.open(n.result.uri,"_blank","noopener,noreferrer")})},[t,e]),null}).build(),Yg="print",Ow={id:Yg,name:"Print Plugin",version:"1.0.0",provides:["print"],requires:[],optional:[],defaultConfig:{}},Qg=class extends $e{constructor(e,t,n){super(e,t),this.printReady$=st()}buildCapability(){return{print:e=>this.print(e),forDocument:e=>this.createPrintScope(e)}}createPrintScope(e){return{print:t=>this.print(t,e)}}print(e,t){const n=t??this.getActiveDocumentId();if(!this.checkPermission(n,U.Print))return this.logger.debug("PrintPlugin","Print",`Cannot print: document ${n} lacks Print permission`),ne.reject({code:H.Security,message:"Document lacks Print permission"});const o=e??{},i=new se;return i.progress({stage:"preparing",message:"Preparing document..."}),this.preparePrintDocument(o,n).wait(r=>{i.progress({stage:"document-ready",message:"Document prepared successfully"}),this.printReady$.emit({documentId:n,options:o,buffer:r,task:i})},r=>i.fail(r)),i}preparePrintDocument(e,t){const n=this.coreState.core.documents[t];return n?.document?this.engine.preparePrintDocument(n.document,e):ne.reject({code:H.DocNotOpen,message:`Document ${t} not found`})}onPrintRequest(e){return this.printReady$.on(e)}async initialize(e){this.logger.info("PrintPlugin","Initialize","Print plugin initialized")}async destroy(){this.printReady$.clear(),await super.destroy()}};Qg.id="print";let fr=Qg;const Jg=()=>We(fr.id),Fw=Bt({manifest:Ow,create:(e,t)=>
vendor: 5,120 bytes, line 2291
2291new fr(Yg,e,t),reducer:()=>{},initialState:{}}).addUtility(function(){const{provides:e}=Jg(),{plugin:t}=At(fr.id),n=K(null),o=K(null);return $(()=>{if(!e||!t)return;const i=t.onPrintRequest(({buffer:r,task:a})=>{const s=n.current;if(!s)return;o.current&&(URL.revokeObjectURL(o.current),o.current=null);const l=URL.createObjectURL(new Blob([r],{type:"application/pdf"}));o.current=l,s.onload=()=>{var c,d;s.src===l&&(a.progress({stage:"iframe-ready",message:"Ready to print"}),(c=s.contentWindow)==null||c.focus(),(d=s.contentWindow)==null||d.print(),a.progress({stage:"printing",message:"Print dialog opened"}),a.resolve(r))},s.src=l});return()=>{i(),o.current&&URL.revokeObjectURL(o.current)}},[e,t]),k("iframe",{ref:n,style:{position:"absolute",display:"none"},title:"Print Document",src:"about:blank"})}).build(),ef="fullscreen",_w={id:ef,name:"Fullscreen Plugin",version:"1.0.0",provides:["fullscreen"],requires:[],optional:[],defaultConfig:{}},tf="SET_FULLSCREEN",nf=class extends $e{constructor(e,t,n){super(e,t),this.onStateChange$=xe(),this.fullscreenRequest$=st(),this.config=n}async initialize(e){}buildCapability(){return{isFullscreen:()=>this.state.isFullscreen,enableFullscreen:e=>this.enableFullscreen(e),exitFullscreen:()=>this.exitFullscreen(),toggleFullscreen:e=>this.toggleFullscreen(e),onRequest:this.fullscreenRequest$.on,onStateChange:this.onStateChange$.on}}getTargetSelector(){return this.currentTargetElement??this.config.targetElement}toggleFullscreen(e){this.state.isFullscreen?this.exitFullscreen():this.enableFullscreen(e)}enableFullscreen(e){this.currentTargetElement=e??this.config.targetElement,this.fullscreenRequest$.emit({action:"enter",targetElement:this.currentTargetElement})}exitFullscreen(){this.fullscreenRequest$.emit({action:"exit"}),this.currentTargetElement=void 0}onStoreUpdated(e,t){this.onStateChange$.emit(t)}setFullscreenState(e){this.dispatch({type:tf,payload:e})}async destroy(){this.fullscreenRequest$.clear(),super.destroy()}};nf.id="fullscreen";let vr=nf;const Pd=()=>At(vr.id);async function $w(e,t,n){if(e.action==="enter"){const o=(function(i,r,a){if(!r||i.action!=="enter")return r;let s=null;return a&&(s=r.querySelector(a),s||console.warn(`Fullscreen: Could not find element with selector "${a}" within the wrapper. Falling back to wrapper element.`)),s||(s=r),s})(e,t,n);o&&!document.fullscreenElement&&await o.requestFullscreen()}else document.fullscreenElement&&await document.exitFullscreen()}const jw=Bt({manifest:_w,create:(e,t)=>new vr(ef,e,t),reducer:(e,t)=>t.type===tf?{...e,isFullscreen:t.payload}:e,initialState:{isFullscreen:!1}}).addWrapper(function({children:e,...t}){const{provides:n}=We(vr.id),{plugin:o}=Pd(),{plugin:i}=Pd(),r=K(null);return $(()=>{if(!(!n||!o))return n.onRequest(async a=>{const s=o.getTargetSelector();await $w(a,r.current,s)})},[n,o]),$(()=>{if(!i)return;const a=()=>i.setFullscreenState(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[i]),k("div",{...t,style:{position:"relative",width:"100%",height:"100%",...t.style},ref:r,children:e})}).build(),of="bookmark",Uw={id:of,name:"Bookmark Plugin",version:"1.0.0",provides:["bookmark"],requires:[],optional:[],defaultConfig:{}},rf=class extends $e{constructor(e,t){super(e,t)}async initialize(e){}buildCapability(){return{getBookmarks:()=>this.getBookmarks(),forDocument:e=>this.createBookmarkScope(e)}}createBookmarkScope(e){return{getBookmarks:()=>this.getBookmarks(e)}}getBookmarks(e){const t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];if(!n?.document)throw new Error(`Document ${t} not loaded`);return this.engine.getBookmarks(n.document)}};rf.id="bookmark";let ol=rf;const Bw={manifest:Uw,create:e=>new ol(of,e),reducer:()=>{},initialState:{}},af=class extends $e{constructor(e,t,n){super(e,t),this.downloadRequest$=st(),this.config=n}buildCapability(){return{saveAsCopy:()=>this.saveAsCopy(),download:()=>this.download(),forDocument:e=>this.createExportScope(e)}}createExportScope(e){return{saveAsCopy:()=>this.saveAsCopy(e),download:()=>this.download(e)}}download(e){const t=e??this.getActiveDocumentId();this.downloadRequest$.emit({documentId:t})}saveAsCopy(e){const t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];return n?.document?this.engine.saveAsCopy(n.document):ne.reject({code:H.DocNotOpen,message:`Document ${t} not found`})}saveAsCopyAndGetBufferAndName(e){const t=new se,n=this.coreState.core.documents[e];return n?.document?(this.saveAsCopy(e).wait(o=>{t.resolve({buffer:o,name:n.name??this.config.defaultFileName})},o=>t.fail(o)),t):ne.reject({code:H.DocNotOpen,message:`Document ${e} not found`})}onRequest(e){return this.downloadRequest$.on(e)}async initialize(e){this.logger.info("ExportPlugin","Initialize","Export plugin initialized")}async destroy(){this.downloadRequest$.clear(),await super.destroy()}};af.id="export";let es=af;const Md="export",Ww=Bt({manifest:{id:Md,name:"Export Plugin",version:"1.0.0",provides:["export"],requires:[],optional:[],defaultConfig:{defaultFileName:"document.pdf"}},create:(e,t)=>
2291new es(Md,e,t),reducer:()=>{},initialState:{}}).addUtility(function(){const{plugin:e}=At(es.id),t=K(null);return $(()=>{if(e)return e.onRequest(n=>{const o=t.current;o&&e.saveAsCopyAndGetBufferAndName(n.documentId).wait(({buffer:i,name:r})=>{const a=URL.createObjectURL(new Blob([i]));o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)},et)})},[e]),k("a",{style:{display:"none"},ref:t})}).build(),sf="PAN/INIT_STATE",lf="PAN/CLEANUP_STATE",cf="PAN/SET_PAN_MODE",df=class extends $e{constructor(e,t,n){var o,i,r;super(e,t),this.panMode$=xe(),this.documentHandlers=new Map,this.config=n,this.interactionManager=(o=t.getPlugin(qr.id))==null?void 0:o.provides(),this.viewport=(i=t.getPlugin(vi.id))==null?void 0:i.provides(),this.interactionManager&&(this.interactionManager.registerMode({id:"panMode",scope:"global",exclusive:!1,cursor:"grab",wantsRawTouch:!1}),(r=this.interactionManager)==null||r.onModeChange(a=>{const s=a.activeMode==="panMode",l=this.getDocumentState(a.documentId);l&&l.isPanMode!==s&&this.dispatch((function(c,d){return{type:cf,payload:{documentId:c,isPanMode:d}}})(a.documentId,s))}))}onDocumentLoadingStarted(e){this.dispatch((function(t,n){return{type:sf,payload:{documentId:t,state:n}}})(e,{isPanMode:!1})),this.registerPanHandlersForDocument(e),this.config.defaultMode==="always"&&this.makePanDefault(!0),this.logger.debug("PanPlugin","DocumentOpened",`Initialized pan state for document: ${e}`)}onDocumentClosed(e){const t=this.documentHandlers.get(e);t&&(t(),this.documentHandlers.delete(e)),this.dispatch((function(n){return{type:lf,payload:n}})(e)),this.logger.debug("PanPlugin","DocumentClosed",`Cleaned up pan state for document: ${e}`)}buildCapability(){return{enablePan:()=>this.enablePan(),disablePan:()=>this.disablePan(),togglePan:()=>this.togglePan(),makePanDefault:e=>this.makePanDefault(e),isPanMode:()=>this.isPanMode(),forDocument:e=>this.createPanScope(e),onPanModeChange:this.panMode$.on}}createPanScope(e){return{enablePan:()=>this.enablePan(e),disablePan:()=>this.disablePan(e),togglePan:()=>this.togglePan(e),isPanMode:()=>this.isPanMode(e),onPanModeChange:t=>this.panMode$.on(n=>{n.documentId===e&&t(n.isPanMode)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Pan state not found for document: ${e??"active"}`);return t}enablePan(e){const t=e??this.getActiveDocumentId();this.interactionManager.forDocument(t).activate("panMode")}disablePan(e){const t=e??this.getActiveDocumentId();this.interactionManager.forDocument(t).activateDefaultMode()}togglePan(e){const t=e??this.getActiveDocumentId(),n=this.interactionManager.forDocument(t);n.getActiveMode()==="panMode"?n.activateDefaultMode():n.activate("panMode")}makePanDefault(e=!0){this.interactionManager&&(this.interactionManager.setDefaultMode("panMode"),e&&this.interactionManager.activateDefaultMode())}isPanMode(e){return this.getDocumentStateOrThrow(e).isPanMode}registerPanHandlersForDocument(e){if(!this.interactionManager||!this.viewport)return;let t=null;const n=this.interactionManager.forDocument(e),o=this.viewport.forDocument(e),i={onMouseDown:(a,s)=>{const l=o.getMetrics();t={startX:s.clientX,startY:s.clientY,startLeft:l.scrollLeft,startTop:l.scrollTop},n.setCursor("panMode","grabbing",10)},onMouseMove:(a,s)=>{if(!t)return;const l=s.clientX-t.startX,c=s.clientY-t.startY;o.scrollTo({x:t.startLeft-l,y:t.startTop-c})},onMouseUp:()=>{t&&(t=null,n.removeCursor("panMode"))},onMouseLeave:()=>{t&&(t=null,n.removeCursor("panMode"))},onMouseCancel:()=>{t&&(t=null,n.removeCursor("panMode"))}},r=this.interactionManager.registerHandlers({documentId:e,modeId:"panMode",handlers:i});this.documentHandlers.set(e,r)}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o?.isPanMode!==i.isPanMode&&(this.panMode$.emit({documentId:n,isPanMode:i.isPanMode}),this.logger.debug("PanPlugin","PanModeChanged",`Pan mode changed for document ${n}: ${o?.isPanMode??!1} -> ${i.isPanMode}`))}}async initialize(e){this.logger.info("PanPlugin","Initialize","Pan plugin initialized")}
vendor: 4,560 bytes, line 2291
2291async destroy(){this.documentHandlers.forEach(e=>e()),this.documentHandlers.clear(),this.panMode$.clear(),await super.destroy()}};df.id="pan";let Ji=df;const Dd={documents:{},activeDocumentId:null},Hw=Bt({manifest:{id:"pan",name:"Pan Plugin",version:"1.0.0",provides:["pan"],requires:["interaction-manager","viewport"],optional:[],defaultConfig:{defaultMode:"mobile"}},create:(e,t)=>new Ji("pan",e,t),reducer:(e=Dd,t)=>{switch(t.type){case sf:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case lf:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"PAN/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case cf:{const{documentId:n,isPanMode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isPanMode:o}}}:e}default:return e}},initialState:Dd}).addUtility(()=>{const{provides:e}=We(Ji.id),{plugin:t}=At(Ji.id);return $(()=>{var n;if(!e||!t)return;const o=((n=t.config)==null?void 0:n.defaultMode)??"never",i=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0);o==="mobile"&&i&&e.makePanDefault()},[e,t]),null}).build(),uf="capture",Gw={id:uf,name:"Capture Plugin",version:"1.0.0",provides:["capture"],requires:["render"],optional:["interaction-manager"],defaultConfig:{scale:1,imageType:"image/png",withAnnotations:!1}},hf="CAPTURE/INIT_STATE",mf="CAPTURE/CLEANUP_STATE",pf="CAPTURE/SET_MARQUEE_CAPTURE_ACTIVE",qw={isMarqueeCaptureActive:!1},Td={documents:{},activeDocumentId:null},gf=class extends $e{constructor(e,t,n){var o;super(e,t),this.captureArea$=st(),this.state$=xe(),this.config=n,this.renderCapability=this.registry.getPlugin("render").provides(),this.interactionManagerCapability=(o=this.registry.getPlugin("interaction-manager"))==null?void 0:o.provides(),this.interactionManagerCapability&&(this.interactionManagerCapability.registerMode({id:"marqueeCapture",scope:"page",exclusive:!0,cursor:"crosshair"}),this.interactionManagerCapability.onModeChange(i=>{const r=i.activeMode==="marqueeCapture",a=this.getDocumentState(i.documentId);var s;a&&a.isMarqueeCaptureActive!==r&&this.dispatch((s=i.documentId,{type:pf,payload:{documentId:s,isActive:r}}))}))}onDocumentLoadingStarted(e){const t={...qw};this.dispatch((function(n,o){return{type:hf,payload:{documentId:n,state:o}}})(e,t)),this.logger.debug("CapturePlugin","DocumentOpened",`Initialized capture state for document: ${e}`)}onDocumentClosed(e){this.dispatch((function(t){return{type:mf,payload:t}})(e)),this.logger.debug("CapturePlugin","DocumentClosed",`Cleaned up capture state for document: ${e}`)}async initialize(e){}buildCapability(){return{captureArea:(e,t)=>this.captureArea(e,t),enableMarqueeCapture:()=>this.enableMarqueeCapture(),disableMarqueeCapture:()=>this.disableMarqueeCapture(),toggleMarqueeCapture:()=>this.toggleMarqueeCapture(),isMarqueeCaptureActive:()=>this.isMarqueeCaptureActive(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createCaptureScope(e),registerMarqueeOnPage:e=>this.registerMarqueeOnPage(e),onCaptureArea:this.captureArea$.on,onStateChange:this.state$.on}}createCaptureScope(e){return{captureArea:(t,n)=>this.captureArea(t,n,e),enableMarqueeCapture:()=>this.enableMarqueeCapture(e),disableMarqueeCapture:()=>this.disableMarqueeCapture(e),toggleMarqueeCapture:()=>this.toggleMarqueeCapture(e),isMarqueeCaptureActive:()=>this.isMarqueeCaptureActive(e),getState:()=>this.getDocumentStateOrThrow(e),onCaptureArea:t=>this.captureArea$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Capture state not found for document: ${e??"active"}`);return t}registerMarqueeOnPage(e){if(!this.interactionManagerCapability)return this.logger.warn("CapturePlugin","MissingDependency","Interaction manager plugin not loaded, marquee capture disabled"),()=>{};const t=this.coreState.core.documents[e.documentId];if(!t||!t.document)return this.logger.warn("CapturePlugin","DocumentNotFound","Document not found"),()=>{};const n=t.document.pages[e.pageIndex];if(!n)return this.logger.warn("CapturePlugin","PageNotFound",`Page ${e.pageIndex} not found`),()=>{};const o=(function(i){const{pageSize:r,scale:a,minDragPx:s=5,onPreview:l,onCommit:c}=i;let d=null,u=null;return{onPointerDown:(m,g)=>{var p;
2291d=m,u={origin:{x:m.x,y:m.y},size:{width:0,height:0}},l?.(u),(p=g.setPointerCapture)==null||p.call(g)},onPointerMove:m=>{if(!d)return;const g=ue(m.x,0,r.width),p=ue(m.y,0,r.height);u={origin:{x:Math.min(d.x,g),y:Math.min(d.y,p)},size:{width:Math.abs(g-d.x),height:Math.abs(p-d.y)}},l?.(u)},onPointerUp:(m,g)=>{var p;u&&Math.max(u.size.width,u.size.height)*a>s&&c?.(u),d=null,u=null,l?.(null),(p=g.releasePointerCapture)==null||p.call(g)},onPointerCancel:(m,g)=>{var p;d=null,u=null,l?.(null),(p=g.releasePointerCapture)==null||p.call(g)}}})({pageSize:n.size,scale:e.scale,onPreview:e.callback.onPreview,onCommit:i=>{var r,a;this.captureArea(e.pageIndex,i,e.documentId),(a=(r=e.callback).onCommit)==null||a.call(r,i)}});return this.interactionManagerCapability.registerHandlers({documentId:e.documentId,modeId:"marqueeCapture",handlers:o,pageIndex:e.pageIndex})}captureArea(e,t,n){const o=n??this.getActiveDocumentId();this.disableMarqueeCapture(o),this.renderCapability.forDocument(o).renderPageRect({pageIndex:e,rect:t,options:{imageType:this.config.imageType,scaleFactor:this.config.scale,withAnnotations:this.config.withAnnotations||!1}}).wait(i=>{this.captureArea$.emit({documentId:o,pageIndex:e,rect:t,blob:i,imageType:this.config.imageType||"image/png",scale:this.config.scale||1,withAnnotations:this.config.withAnnotations||!1})},et)}enableMarqueeCapture(e){var t;const n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activate("marqueeCapture")}disableMarqueeCapture(e){var t;const n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activateDefaultMode()}toggleMarqueeCapture(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n);o?.getActiveMode()==="marqueeCapture"?o.activateDefaultMode():o?.activate("marqueeCapture")}isMarqueeCaptureActive(e){var t;const n=e??this.getActiveDocumentId();return((t=this.interactionManagerCapability)==null?void 0:t.forDocument(n).getActiveMode())==="marqueeCapture"}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o&&i&&o.isMarqueeCaptureActive!==i.isMarqueeCaptureActive&&this.state$.emit({documentId:n,state:i})}}async destroy(){this.captureArea$.clear(),this.state$.clear(),super.destroy()}};gf.id="capture";let il=gf;const Kw={manifest:Gw,create:(e,t)=>new il(uf,e,t),reducer:(e=Td,t)=>{switch(t.type){case hf:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case mf:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"CAPTURE/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case pf:{const{documentId:n,isActive:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isMarqueeCaptureActive:o}}}:e}default:return e}},initialState:Td},ff=()=>We(il.id),Vw=({documentId:e,pageIndex:t,scale:n,className:o,stroke:i="rgba(33,150,243,0.8)",fill:r="rgba(33,150,243,0.15)"})=>{const{provides:a}=ff(),s=pt(e),[l,c]=O(null),d=Z(()=>n!==void 0?n:s?.scale??1,[n,s?.scale]);return $(()=>{if(a)return a.registerMarqueeOnPage({documentId:e,pageIndex:t,scale:d,callback:{onPreview:c}})},[a,e,t,d]),l?k("div",{style:{position:"absolute",pointerEvents:"none",left:l.origin.x*d,top:l.origin.y*d,width:l.size.width*d,height:l.size.height*d,border:`1px solid ${i}`,background:r,boxSizing:"border-box"},className:o}):null},bo="history",Xw={id:bo,name:"History Plugin",version:"1.0.0",provides:["history"],requires:[],optional:[],defaultConfig:{}},vf="HISTORY/INIT_STATE",yf="HISTORY/CLEANUP_STATE",bf="HISTORY/SET_DOCUMENT_STATE",wf=class extends $e{constructor(e,t){super(e,t),this.documentHistories=new Map,this.historyChange$=st()}async initialize(e){this.logger.info("HistoryPlugin","Initialize","History plugin initialized")}onDocumentLoadingStarted(e){this.dispatch((t=>({type:vf,payload:{documentId:t}}))(e)),this.documentHistories.set(e,{topicHistories:new Map,globalTimeline:[],globalIndex:-1}),this.logger.debug("HistoryPlugin","DocumentOpened",`Initialized history state for document: ${e}`)}onDocumentClosed(e){this.dispatch((t=>({type:yf,payload:{documentId:t}}))(e)),this.documentHistories.delete(e),this.logger.debug("HistoryPlugin","DocumentClosed",`Cleaned up history state for document: ${e}`)}getDocumentHistoryData(e){const t=e??this.getActiveDocumentId(),n=this.documentHistories.get(t);if(!n)throw new Error(`History data not found for document: ${t}`);return n}getDocumentHistoryState(e){const t=this.documentHistories.get(e);if(!t)throw new Error(`History data not found for document: ${e}`);const n={};
vendor: 5,282 bytes, line 2291
2291return Array.from(t.topicHistories.entries()).forEach(([o,i])=>{n[o]={canUndo:i.currentIndex>-1,canRedo:i.currentIndex<i.commands.length-1}}),{global:{canUndo:t.globalIndex>-1,canRedo:t.globalIndex<t.globalTimeline.length-1},topics:n}}emitHistoryChange(e,t){const n=this.getDocumentHistoryState(e);this.dispatch(((o,i)=>({type:bf,payload:{documentId:o,state:i}}))(e,n)),this.historyChange$.emit({documentId:e,topic:t,state:n})}register(e,t,n){const o=this.getDocumentHistoryData(n);o.topicHistories.has(t)||o.topicHistories.set(t,{commands:[],currentIndex:-1});const i=o.topicHistories.get(t);i.commands.splice(i.currentIndex+1),i.commands.push(e),i.currentIndex++;const r={command:e,topic:t};o.globalTimeline.splice(o.globalIndex+1),o.globalTimeline.push(r),o.globalIndex++,e.execute(),this.emitHistoryChange(n,t)}undo(e,t){const n=this.getDocumentHistoryData(t);let o;if(e){const i=n.topicHistories.get(e);i&&i.currentIndex>-1&&(i.commands[i.currentIndex].undo(),i.currentIndex--,o=e)}else if(n.globalIndex>-1){const i=n.globalTimeline[n.globalIndex];i.command.undo(),n.topicHistories.get(i.topic).currentIndex--,n.globalIndex--,o=i.topic}o&&this.emitHistoryChange(t,o)}redo(e,t){const n=this.getDocumentHistoryData(t);let o;if(e){const i=n.topicHistories.get(e);i&&i.currentIndex<i.commands.length-1&&(i.currentIndex++,i.commands[i.currentIndex].execute(),o=e)}else if(n.globalIndex<n.globalTimeline.length-1){n.globalIndex++;const i=n.globalTimeline[n.globalIndex];i.command.execute(),n.topicHistories.get(i.topic).currentIndex++,o=i.topic}o&&this.emitHistoryChange(t,o)}canUndo(e,t){const n=this.getDocumentHistoryData(t);if(e){const o=n.topicHistories.get(e);return!!o&&o.currentIndex>-1}return n.globalIndex>-1}canRedo(e,t){const n=this.getDocumentHistoryData(t);if(e){const o=n.topicHistories.get(e);return!!o&&o.currentIndex<o.commands.length-1}return n.globalIndex<n.globalTimeline.length-1}purgeByMetadata(e,t,n){const o=this.getDocumentHistoryData(n);let i=0;const r=c=>e(c.metadata),a=t?[t]:Array.from(o.topicHistories.keys());for(const c of a){const d=o.topicHistories.get(c);if(!d)continue;const u=[];let m=0;for(let g=0;g<d.commands.length;g++){const p=d.commands[g];r(p)?(g<=d.currentIndex&&m++,i++):u.push(p)}d.commands=u,d.currentIndex=Math.max(-1,d.currentIndex-m)}const s=[];let l=0;for(let c=0;c<o.globalTimeline.length;c++){const d=o.globalTimeline[c];(!t||d.topic===t)&&r(d.command)?c<=o.globalIndex&&l++:s.push(d)}return o.globalTimeline=s,o.globalIndex=Math.max(-1,o.globalIndex-l),i>0&&(this.emitHistoryChange(n,t),this.logger.debug("HistoryPlugin","PurgeByMetadata",`Purged ${i} history entries for document: ${n}${t?`, topic: ${t}`:""}`)),i}createHistoryScope(e){return{register:(t,n)=>this.register(t,n,e),undo:t=>this.undo(t,e),redo:t=>this.redo(t,e),canUndo:t=>this.canUndo(t,e),canRedo:t=>this.canRedo(t,e),getHistoryState:()=>this.getDocumentHistoryState(e),onHistoryChange:t=>this.historyChange$.on(n=>{n.documentId===e&&t(n.topic)}),purgeByMetadata:(t,n)=>this.purgeByMetadata(t,n,e)}}buildCapability(){return{register:(e,t)=>{const n=this.getActiveDocumentId();this.register(e,t,n)},undo:e=>{const t=this.getActiveDocumentId();this.undo(e,t)},redo:e=>{const t=this.getActiveDocumentId();this.redo(e,t)},canUndo:e=>{const t=this.getActiveDocumentId();return this.canUndo(e,t)},canRedo:e=>{const t=this.getActiveDocumentId();return this.canRedo(e,t)},getHistoryState:()=>{const e=this.getActiveDocumentId();return this.getDocumentHistoryState(e)},forDocument:e=>this.createHistoryScope(e),onHistoryChange:this.historyChange$.on,purgeByMetadata:(e,t)=>{const n=this.getActiveDocumentId();return this.purgeByMetadata(e,t,n)}}}async destroy(){this.historyChange$.clear(),this.documentHistories.clear(),super.destroy()}};wf.id="history";let rl=wf;const Zw={global:{canUndo:!1,canRedo:!1},topics:{}},Rd={documents:{},activeDocumentId:null},Yw={manifest:Xw,create:e=>new rl(bo,e),reducer:(e=Rd,t)=>{switch(t.type){case vf:{const{documentId:n}=t.payload;return{...e,documents:{...e.documents,[n]:{...Zw}}}}case yf:{const{documentId:n}=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case bf:{const{documentId:n,state:o}=t.payload;return e.documents[n]?{...e,documents:{...e.documents,[n]:o}}:e}case"HISTORY/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};default:return e}},initialState:Rd};var je=(e=>(e.Redact="redact",e.MarqueeRedact="marqueeRedact",e.RedactSelection="redactSelection",e))(je||{});const xf="REDACTION/INIT_STATE",kf="REDACTION/CLEANUP_STATE",Cf="START_REDACTION",If="END_REDACTION",Sf="ADD_PENDING",Af="REMOVE_PENDING",Pf="UPDATE_PENDING",Mf="CLEAR_PENDING",Df="SELECT_PENDING",Tf="DESELECT_PENDING",qo=(e,t)=>({type:Sf,payload:{documentId:e,items:t}}),Ko=(e,t,n)=>({type:Af,payload:{documentId:e,page:t,id:n}}),Ca=e=>({type:Mf,payload:e}),Ed=(e,t,n,o)=>({type:Pf,payload:{documentId:e,page:t,id:n,patch:o}}),zd=(e,t,n)=>({type:Df,payload:{documentId:e,page:t,id:n}}),Ld=e=>({type:Tf,payload:e}),Nd=e=>Object.values(e).reduce((t,n)=>t+n.length,0),er={isRedacting:!1,activeType:null,pending:{},pendingCount:0,selected:null},Od={documents:{},activeDocumentId:null},Rf={id:"redact",name:"Redact",categories:["annotation","redaction"],matchScore:e=>
2291e.type===T.REDACT?10:0,interaction:{mode:je.Redact,exclusive:!1,cursor:"crosshair",textSelection:!0,isDraggable:e=>{var t;return e.type!==T.REDACT||!((t=e.segmentRects)!=null&&t.length)},isResizable:e=>{var t;return e.type!==T.REDACT||!((t=e.segmentRects)!=null&&t.length)},isRotatable:!1,lockAspectRatio:!1,isGroupDraggable:!1,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.REDACT,color:"#000000",overlayColor:"#FFFFFF",strokeColor:"#E44234",opacity:1},behavior:{useAppearanceStream:!1}},Qw=[Rf],Ef=class extends $e{constructor(e,t,n){var o,i,r,a;if(super(e,t),this.redactionSelection$=new Map,this.redactionMarquee$=new Map,this.pending$=xe(),this.selected$=xe(),this.state$=xe(),this.events$=xe(),this.documentUnsubscribers=new Map,this.config=n,this.selectionCapability=(o=this.registry.getPlugin("selection"))==null?void 0:o.provides(),this.interactionManagerCapability=(i=this.registry.getPlugin("interaction-manager"))==null?void 0:i.provides(),this.annotationCapability=(r=this.registry.getPlugin("annotation"))==null?void 0:r.provides(),this.historyCapability=(a=this.registry.getPlugin("history"))==null?void 0:a.provides(),this.config.useAnnotationMode?this.annotationCapability?this.useAnnotationMode=!0:(this.logger.warn("RedactionPlugin","ConfigError","useAnnotationMode is enabled but annotation plugin is not available. Falling back to legacy mode."),this.useAnnotationMode=!1):this.useAnnotationMode=!1,this.useAnnotationMode&&this.annotationCapability)for(const s of Qw)this.annotationCapability.addTool(s);this.setupRedactionModes(),!this.useAnnotationMode&&this.annotationCapability&&this.logger.info("RedactionPlugin","LegacyMode","Using legacy redaction mode. Set useAnnotationMode: true in config to use annotation-based redactions."),this.setupModeChangeListener()}setupRedactionModes(){this.interactionManagerCapability&&(this.interactionManagerCapability.registerMode({id:je.Redact,scope:"page",exclusive:!1,cursor:"crosshair"}),this.interactionManagerCapability.registerMode({id:je.MarqueeRedact,scope:"page",exclusive:!1,cursor:"crosshair"}),this.interactionManagerCapability.registerMode({id:je.RedactSelection,scope:"page",exclusive:!1}))}setupModeChangeListener(){var e;(e=this.interactionManagerCapability)==null||e.onModeChange(t=>{const n=t.documentId;if(t.activeMode===je.Redact||t.activeMode===je.MarqueeRedact||t.activeMode===je.RedactSelection)this.dispatch(((o,i)=>({type:Cf,payload:{documentId:o,mode:i}}))(n,t.activeMode));else{const o=this.getDocumentState(n);o?.isRedacting&&this.dispatch((i=>({type:If,payload:i}))(n))}})}onDocumentLoadingStarted(e){this.dispatch((function(n,o){return{type:xf,payload:{documentId:n,state:o}}})(e,{...er})),this.redactionSelection$.set(e,xe()),this.redactionMarquee$.set(e,xe());const t=[];if(this.selectionCapability){const n=this.selectionCapability.forDocument(e),o=n.onSelectionChange(()=>{const l=this.getDocumentState(e);if(!l?.isRedacting)return;const c=n.getFormattedSelection(),d=this.redactionSelection$.get(e);d?.emit(c)}),i=n.onEndSelection(()=>{const l=this.getDocumentState(e);if(!l?.isRedacting||!this.checkPermission(e,U.ModifyContents))return;const c=n.getFormattedSelection();if(!c.length)return;const d=n.getSelectedText(),u=this.redactionSelection$.get(e);u?.emit([]),n.clear(),d.wait(m=>{const g=m.join(" ");this.createRedactionsFromSelection(e,c,g)},()=>{this.createRedactionsFromSelection(e,c)})}),r=n.onMarqueeChange(l=>{var c;const d=this.getDocumentState(e);d?.isRedacting&&((c=this.redactionMarquee$.get(e))==null||c.emit({pageIndex:l.pageIndex,rect:l.rect,modeId:l.modeId}))}),a=n.onMarqueeEnd(l=>{const c=this.getDocumentState(e);if(c?.isRedacting&&this.checkPermission(e,U.ModifyContents))if(this.useAnnotationMode)this.createRedactAnnotationFromArea(e,l.pageIndex,l.rect);else{const d=this.config.drawBlackBoxes?"#000000":"transparent",u={id:pe(),kind:"area",page:l.pageIndex,rect:l.rect,source:"legacy",markColor:"#FF0000",redactionColor:d};this.dispatch(qo(e,[u])),this.selectPending(l.pageIndex,u.id,e)}}),s=n.onEmptySpaceClick(()=>{this.deselectPending(e)});t.push(o,i,r,a,s)}if(this.useAnnotationMode&&this.annotationCapability){const n=this.annotationCapability.forDocument(e),o=n.onAnnotationEvent(r=>{var a;if(r.type==="loaded")return void this.syncFromAnnotationLoad(e);if(((a=r.annotation)==null?void 0:a.type)!==T.REDACT)return;const s=r.annotation;r.type==="create"?(this.syncFromAnnotationCreate(e,s),this.events$.emit({type:"add",documentId:e,items:[this.annotationToRedactionItem(s)]})):r.type==="update"?(this.logger.debug("RedactionPlugin","AnnotationUpdated",{documentId:e,redactAnno:s,patch:r.patch}),this.syncFromAnnotationUpdate(e,s,r.patch)):r.type==="delete"&&(this.syncFromAnnotationDelete(e,s),this.events$.emit({type:"remove",documentId:e,page:s.pageIndex,id:s.id}))}),i=n.onStateChange(()=>{this.syncSelectionFromAnnotation(e)});t.push(o,i)}this.documentUnsubscribers.set(e,t),this.logger.debug("RedactionPlugin","DocumentOpened",`Initialized redaction state for document: ${e}`)}onDocumentLoaded(e){var t,n,o;(t=this.selectionCapability)==null||t.enableForMode(je.Redact,{enableSelection:!0,showSelectionRects:!1,enableMarquee:!0,showMarqueeRects:!1},e),(n=this.selectionCapability)==null||n.enableForMode(je.MarqueeRedact,{enableSelection:!1,enableMarquee:!0,showMarqueeRects:!1},e),(o=this.selectionCapability)==null||o.enableForMode(je.RedactSelection,{enableSelection:!0,showSelectionRects:!1},e)}onDocumentClosed(e){this.dispatch((function(i){return{type:kf,payload:i}})(e));const t=this.redactionSelection$.get(e);t?.clear(),this.redactionSelection$.delete(e);const n=this.redactionMarquee$.get(e);n?.clear(),this.redactionMarquee$.delete(e);const o=this.documentUnsubscribers.get(e);
2291o&&(o.forEach(i=>i()),this.documentUnsubscribers.delete(e)),this.logger.debug("RedactionPlugin","DocumentClosed",`Cleaned up redaction state for document: ${e}`)}async initialize(e){this.logger.info("RedactionPlugin","Initialize","Redaction plugin initialized")}buildCapability(){return{queueCurrentSelectionAsPending:()=>this.queueCurrentSelectionAsPending(),enableRedact:()=>this.enableRedact(),toggleRedact:()=>this.toggleRedact(),isRedactActive:()=>this.isRedactActive(),endRedact:()=>this.endRedact(),enableMarqueeRedact:()=>this.enableMarqueeRedact(),toggleMarqueeRedact:()=>this.toggleMarqueeRedact(),isMarqueeRedactActive:()=>this.isMarqueeRedactActive(),enableRedactSelection:()=>this.enableRedactSelection(),toggleRedactSelection:()=>this.toggleRedactSelection(),isRedactSelectionActive:()=>this.isRedactSelectionActive(),addPending:e=>this.addPendingItems(e),removePending:(e,t)=>this.removePendingItem(e,t),clearPending:()=>this.clearPendingItems(),commitAllPending:()=>this.commitAllPending(),commitPending:(e,t)=>this.commitPendingOne(e,t),selectPending:(e,t)=>
2291this.selectPending(e,t),getSelectedPending:()=>this.getSelectedPending(),deselectPending:()=>this.deselectPending(),getState:()=>this.getDocumentStateOrThrow(),forDocument:e=>this.createRedactionScope(e),onPendingChange:this.pending$.on,onSelectedChange:this.selected$.on,onRedactionEvent:this.events$.on,onStateChange:this.state$.on}}createRedactionScope(e){return{queueCurrentSelectionAsPending:()=>this.queueCurrentSelectionAsPending(e),enableRedact:()=>this.enableRedact(e),toggleRedact:()=>this.toggleRedact(e),isRedactActive:()=>this.isRedactActive(e),endRedact:()=>this.endRedact(e),enableMarqueeRedact:()=>this.enableMarqueeRedact(e),toggleMarqueeRedact:()=>this.toggleMarqueeRedact(e),isMarqueeRedactActive:()=>this.isMarqueeRedactActive(e),enableRedactSelection:()=>this.enableRedactSelection(e),toggleRedactSelection:()=>this.toggleRedactSelection(e),isRedactSelectionActive:()=>this.isRedactSelectionActive(e),addPending:t=>this.addPendingItems(t,e),removePending:(t,n)=>this.removePendingItem(t,n,e),clearPending:()=>this.clearPendingItems(e),commitAllPending:()=>this.commitAllPending(e),commitPending:(t,n)=>this.commitPendingOne(t,n,e),selectPending:(t,n)=>this.selectPending(t,n,e),getSelectedPending:()=>this.getSelectedPending(e),deselectPending:()=>this.deselectPending(e),getState:()=>this.getDocumentStateOrThrow(e),onPendingChange:t=>this.pending$.on(n=>{n.documentId===e&&t(n.pending)}),onSelectedChange:t=>this.selected$.on(n=>{n.documentId===e&&t(n.selected)}),onRedactionEvent:t=>this.events$.on(n=>{n.documentId===e&&t(n)}),onStateChange:t=>this.state$.on(n=>{n.documentId===e&&t(n.state)})}}getPendingFromAnnotations(e){if(!this.annotationCapability)return{};try{const t=this.annotationCapability.forDocument(e).getState(),n={};for(const o of Object.values(t.byUid))if(o.object.type===T.REDACT){const i=this.annotationToRedactionItem(o.object),r=o.object.pageIndex;(n[r]??(n[r]=[])).push(i)}return n}catch{return{}}}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??null}getDocumentStateOrThrow(e){const t=this.getDocumentState(e);if(!t)throw new Error(`Redaction state not found for document: ${e??"active"}`);return t}isRedactTool(e){return e?.id===Rf.id&&e.defaults.type===T.REDACT}getRedactTool(){var e;const t=(e=this.annotationCapability)==null?void 0:e.getTool("redact");return this.isRedactTool(t)?t:void 0}syncFromAnnotationCreate(e,t){const n=this.annotationToRedactionItem(t);this.dispatch(qo(e,[n]))}syncFromAnnotationUpdate(e,t,n){if(!("rect"in n||"segmentRects"in n||"strokeColor"in n||"color"in n))return;const o={};n.rect&&(o.rect=n.rect),n.segmentRects&&(o.rects=n.segmentRects),n.strokeColor&&(o.markColor=n.strokeColor),n.color&&(o.redactionColor=n.color),this.logger.debug("RedactionPlugin","AnnotationUpdated",{documentId:e,annotation:t,patch:o}),this.dispatch(Ed(e,t.pageIndex,t.id,o))}syncFromAnnotationDelete(e,t){this.dispatch(Ko(e,t.pageIndex,t.id))}syncFromAnnotationLoad(e){const t=this.getPendingFromAnnotations(e);this.dispatch(Ca(e));for(const[,n]of Object.entries(t))n.length>0&&this.dispatch(qo(e,n))}syncSelectionFromAnnotation(e){var t;const n=(t=this.annotationCapability)==null?void 0:t.forDocument(e).getState();if(!n)return;const o=n.selectedUids.map(i=>n.byUid[i]).find(i=>i?.object.type===T.REDACT);if(o){const i=o.object;this.dispatch(zd(e,i.pageIndex,i.id))}else{const i=this.getDocumentState(e);i?.selected&&this.dispatch(Ld(e))}}addPendingItems(e,t){const n=t??this.getActiveDocumentId();if(this.checkPermission(n,U.ModifyContents)){if(this.useAnnotationMode){if(!this.annotationCapability)return;const o=this.annotationCapability.forDocument(n);for(const i of e){const r=this.redactionItemToAnnotation(i);o.createAnnotation(i.page,r)}if(e.length>0){const i=e[e.length-1];o.selectAnnotation(i.page,i.id)}}else this.dispatch(qo(n,e));this.events$.emit({type:"add",documentId:n,items:e})}else this.logger.debug("RedactionPlugin","AddPendingItems",`Cannot add redactions: document ${n} lacks ModifyContents permission`)}removePendingItem(e,t,n){var o;const i=n??this.getActiveDocumentId();this.useAnnotationMode?(o=this.annotationCapability)==null||o.forDocument(i).deleteAnnotation(e,t):this.dispatch(Ko(i,e,t)),this.events$.emit({type:"remove",documentId:i,page:e,id:t})}clearPendingItems(e){var t;const n=e??this.getActiveDocumentId();if(this.useAnnotationMode){const o=this.getPendingFromAnnotations(n),i=(t=this.annotationCapability)==null?void 0:t.forDocument(n);for(const[r,a]of Object.entries(o)){const s=Number(r);for(const l of a)i?.deleteAnnotation(s,l.id)}}else this.dispatch(Ca(n));this.events$.emit({type:"clear",documentId:n})}selectPending(e,t,n){var o,i,r;const a=n??this.getActiveDocumentId();this.useAnnotationMode?(o=this.annotationCapability)==null||o.forDocument(a).selectAnnotation(e,t):(this.dispatch(zd(a,e,t)),(i=this.interactionManagerCapability)==null||i.claimPageActivity(a,"redaction-selection",e)),(r=this.selectionCapability)==null||r.forDocument(a).clear()}getSelectedPending(e){var t;const n=e??this.getActiveDocumentId();return((t=this.getDocumentState(n))==null?void 0:t.selected)??null}deselectPending(e){var t,n;const o=e??this.getActiveDocumentId();this.useAnnotationMode?(t=this.annotationCapability)==null||t.forDocument(o).deselectAnnotation():(this.dispatch(Ld(o)),(n=this.interactionManagerCapability)==null||n.releasePageActivity(o,"redaction-selection"))}enableRedactSelection(e){var t;const n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(je.RedactSelection):this.logger.debug("RedactionPlugin","EnableRedactSelection",`Cannot enable redact selection: document ${n} lacks ModifyContents permission`)}toggleRedactSelection(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n);if(o?.getActiveMode()===je.RedactSelection)o?.activateDefaultMode();else{if(!this.checkPermission(n,U.ModifyContents))return;o?.activate(je.RedactSelection)}}isRedactSelectionActive(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n).getActiveMode();return o===je.Redact||o===je.RedactSelection}enableMarqueeRedact(e){var t;const n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(je.MarqueeRedact):this.logger.debug("RedactionPlugin","EnableMarqueeRedact",`Cannot enable marquee redact: document ${n} lacks ModifyContents permission`)}toggleMarqueeRedact(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n);if(o?.getActiveMode()===je.MarqueeRedact)o?.activateDefaultMode();else{if(!this.checkPermission(n,U.ModifyContents))return;o?.activate(je.MarqueeRedact)}}isMarqueeRedactActive(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n).getActiveMode();return o===je.Redact||o===je.MarqueeRedact}enableRedact(e){var t;const n=e??this.getActiveDocumentId();this.checkPermission(n,U.ModifyContents)?(t=this.interactionManagerCapability)==null||t.forDocument(n).activate(je.Redact):this.logger.debug("RedactionPlugin","EnableRedact",`Cannot enable redact mode: document ${n} lacks ModifyContents permission`)}toggleRedact(e){var t;const n=e??this.getActiveDocumentId(),o=(t=this.interactionManagerCapability)==null?void 0:t.forDocument(n);if(o?.getActiveMode()===je.Redact)o?.activateDefaultMode();else{if(!this.checkPermission(n,U.ModifyContents))return;o?.activate(je.Redact)}}isRedactActive(e){var t;const n=e??this.getActiveDocumentId();return((t=this.interactionManagerCapability)==null?void 0:t.forDocument(n).getActiveMode())===je.Redact}endRedact(e){var t;const n=e??this.getActiveDocumentId();(t=this.interactionManagerCapability)==null||t.forDocument(n).activateDefaultMode()}onRedactionSelectionChange(e,t){const n=this.redactionSelection$.get(e);return n?.on(t)??(()=>{})}onRedactionMarqueeChange(e,t){const n=this.redactionMarquee$.get(e);return n?.on(t)??(()=>{})}getPreviewStrokeColor(){var e;return this.useAnnotationMode?((e=this.getRedactTool())==null?void 0:e.defaults.strokeColor)??"#FF0000":"#FF0000"}queueCurrentSelectionAsPending(e){const t=e??this.getActiveDocumentId();if(!this.selectionCapability)return ne.reject({code:H.NotFound,message:"[RedactionPlugin] selection plugin required"});const n=this.coreState.core.documents[t];if(!n?.document)return ne.reject({code:H.NotFound,message:"Document not found"});const o=this.selectionCapability.forDocument(t),i=o.getFormattedSelection();if(!i.length)return ne.resolve(!0);const r=o.getSelectedText(),a=this.redactionSelection$.get(t);a?.emit([]),o.clear(),this.useAnnotationMode||this.enableRedactSelection(t);const s=new se;return r.wait(l=>{const c=l.join(" ");this.createRedactionsFromSelection(t,i,c),s.resolve(!0)},()=>{this.createRedactionsFromSelection(t,i),s.resolve(!0)}),s}commitPendingOne(e,t,n){const o=n??this.getActiveDocumentId();if(!this.checkPermission(o,U.ModifyContents))return this.logger.debug("RedactionPlugin","CommitPendingOne",`Cannot commit redaction: document ${o} lacks ModifyContents permission`),ne.reject({code:H.Security,message:"Document lacks ModifyContents permission"});const i=this.coreState.core.documents[o];if(!i?.document)return ne.reject({code:H.NotFound,message:"Document not found"});const r=i.document.pages[e];if(!r)return ne.reject({code:H.NotFound,message:"Page not found"});if(this.useAnnotationMode)return this.logger.debug("RedactionPlugin","CommitPendingOne",`Applying redaction in annotation mode: page ${e}, id ${t}`),this.applyRedactionAnnotationMode(o,i.document,r,t);
2291const a=this.getDocumentState(o);if(!a)return ne.reject({code:H.NotFound,message:"Document state not found"});const s=(a.pending[e]??[]).find(l=>l.id===t);return s?this.commitPendingOneLegacy(o,i.document,r,e,s):(this.logger.debug("RedactionPlugin","CommitPendingOne",`No pending item found for page ${e}, id ${t}`),ne.resolve(!0))}commitPendingOneLegacy(e,t,n,o,i){const r=i.kind==="text"?i.rects:[i.rect],a=new se;return this.engine.redactTextInRects(t,n,r,{drawBlackBoxes:this.config.drawBlackBoxes}).wait(()=>{this.dispatch(Ko(e,o,i.id)),this.dispatchCoreAction(Di(e,[o])),this.events$.emit({type:"commit",documentId:e,success:!0}),a.resolve(!0)},s=>{this.events$.emit({type:"commit",documentId:e,success:!1,error:s.reason}),a.reject({code:H.Unknown,message:"Failed to commit redactions"})}),a}applyRedactionAnnotationMode(e,t,n,o){var i;const r=new se,a=(i=this.annotationCapability)==null?void 0:i.forDocument(e).getAnnotationById(o);return this.logger.debug("RedactionPlugin","ApplyRedactionAnnotationMode",`Looking for annotation ${o}, found: ${!!a}, type: ${a?.object.type}`),a&&a.object.type===T.REDACT?(this.logger.debug("RedactionPlugin","ApplyRedactionAnnotationMode",`Calling engine.applyRedaction for annotation ${o} on page ${n.index}`),this.engine.applyRedaction(t,n,a.object).wait(()=>{var s,l;this.logger.debug("RedactionPlugin","ApplyRedactionAnnotationMode",`Successfully applied redaction ${o} on page ${n.index}`),(s=this.annotationCapability)==null||s.forDocument(e).purgeAnnotation(n.index,o),this.dispatch(Ko(e,n.index,o)),(l=this.historyCapability)==null||l.forDocument(e).purgeByMetadata(c=>{var d;return((d=c?.annotationIds)==null?void 0:d.includes(o))??!1},"annotations"),this.dispatchCoreAction(Di(e,[n.index])),this.events$.emit({type:"commit",documentId:e,success:!0}),r.resolve(!0)},s=>{var l;this.logger.error("RedactionPlugin","ApplyRedactionAnnotationMode",`Failed to apply redaction ${o}: ${((l=s.reason)==null?void 0:l.message)??"Unknown error"}`),this.events$.emit({type:"commit",documentId:e,success:!1,error:s.reason}),r.reject({code:H.Unknown,message:"Failed to apply redaction"})}),r):(this.logger.warn("RedactionPlugin","ApplyRedactionAnnotationMode",`Redaction annotation not found or wrong type: ${o}`),ne.reject({code:H.NotFound,message:"Redaction annotation not found"}))}commitAllPending(e){const t=e??this.getActiveDocumentId();if(!this.checkPermission(t,U.ModifyContents))return this.logger.debug("RedactionPlugin","CommitAllPending",`Cannot commit redactions: document ${t} lacks ModifyContents permission`),ne.reject({code:H.Security,message:"Document lacks ModifyContents permission"});const n=this.coreState.core.documents[t];if(!n?.document)return ne.reject({code:H.NotFound,message:"Document not found"});const o=this.getDocumentState(t);return o?this.useAnnotationMode?this.applyAllRedactionsAnnotationMode(t,n.document):this.commitAllPendingLegacy(t,n.document,o):ne.reject({code:H.NotFound,message:"Document state not found"})}commitAllPendingLegacy(e,t,n){const o=new Map;for(const[s,l]of Object.entries(n.pending)){const c=Number(s),d=o.get(c)??[];for(const u of l)u.kind==="text"?d.push(...u.rects):d.push(u.rect);o.set(c,d)}const i=Array.from(o.entries()).filter(([s,l])=>l.length>0).map(([s])=>s),r=[];for(const[s,l]of o){const c=t.pages[s];c&&l.length&&r.push(this.engine.redactTextInRects(t,c,l,{drawBlackBoxes:this.config.drawBlackBoxes}))}const a=new se;return se.all(r).wait(()=>{this.dispatch(Ca(e)),this.dispatchCoreAction(Di(e,i)),this.events$.emit({type:"commit",documentId:e,success:!0}),a.resolve(!0)},s=>{this.events$.emit({type:"commit",documentId:e,success:!1,error:s.reason}),a.reject({code:H.Unknown,message:"Failed to commit redactions"})}),a}applyAllRedactionsAnnotationMode(e,t){const n=this.annotationCapability;if(!n)return ne.reject({code:H.NotFound,message:"Annotation capability not found"});const o=n.forDocument(e).getState(),i=new Map;for(const l of Object.values(o.byUid))if(l.object.type===T.REDACT){const c=i.get(l.object.pageIndex)??[];c.push(l.object.id),i.set(l.object.pageIndex,c)}const r=Array.from(i.keys());if(r.length===0)return ne.resolve(!0);const a=[];for(const l of r){const c=t.pages[l];c&&a.push(this.engine.applyAllRedactions(t,c))}const s=new se;
vendor: 25,368 bytes, line 2291
2291return se.all(a).wait(()=>{var l;const c=n.forDocument(e),d=[];for(const[u,m]of i)for(const g of m)c.purgeAnnotation(u,g),this.dispatch(Ko(e,u,g)),d.push(g);d.length>0&&((l=this.historyCapability)==null||l.forDocument(e).purgeByMetadata(u=>{var m;return((m=u?.annotationIds)==null?void 0:m.some(g=>d.includes(g)))??!1},"annotations")),this.dispatchCoreAction(Di(e,r)),this.events$.emit({type:"commit",documentId:e,success:!0}),s.resolve(!0)},l=>{this.events$.emit({type:"commit",documentId:e,success:!1,error:l.reason}),s.reject({code:H.Unknown,message:"Failed to apply redactions"})}),s}createRedactAnnotationsFromSelection(e,t,n){var o;if(!this.annotationCapability)return[];const i=this.annotationCapability.forDocument(e),r=(o=this.getRedactTool())==null?void 0:o.defaults,a=[];for(const s of t){const l=pe();a.push(l);const c={...r,id:l,type:T.REDACT,pageIndex:s.pageIndex,rect:s.rect,segmentRects:s.segmentRects,...n?{custom:{text:n}}:{},created:new Date};i.createAnnotation(s.pageIndex,c),s===t[t.length-1]&&i.selectAnnotation(s.pageIndex,l)}if(n)for(let s=0;s<a.length;s++){const l=t[s].pageIndex;this.dispatch(Ed(e,l,a[s],{text:n}))}return a}createLegacyRedactionsFromSelection(e,t,n){const o=this.config.drawBlackBoxes?"#000000":"transparent",i=t.map(r=>({id:pe(),kind:"text",page:r.pageIndex,rect:r.rect,rects:r.segmentRects,source:"legacy",markColor:"#FF0000",redactionColor:o,text:n}));this.dispatch(qo(e,i)),i.length&&this.selectPending(i[i.length-1].page,i[i.length-1].id,e)}createRedactionsFromSelection(e,t,n){this.useAnnotationMode?this.createRedactAnnotationsFromSelection(e,t,n):this.createLegacyRedactionsFromSelection(e,t,n)}createRedactAnnotationFromArea(e,t,n){var o;if(!this.annotationCapability)return;const i=this.annotationCapability.forDocument(e),r=(o=this.getRedactTool())==null?void 0:o.defaults,a=pe(),s={...r,id:a,type:T.REDACT,pageIndex:t,rect:n,segmentRects:[],created:new Date};i.createAnnotation(t,s),i.selectAnnotation(t,a)}redactionItemToAnnotation(e){var t;return{...((t=this.getRedactTool())==null?void 0:t.defaults)??{},id:e.id,type:T.REDACT,pageIndex:e.page,rect:e.rect,segmentRects:e.kind==="text"?e.rects:[],created:new Date}}annotationToRedactionItem(e){var t;const n=e.strokeColor??"#FF0000",o=e.color??"transparent";return e.segmentRects&&e.segmentRects.length>0?{id:e.id,kind:"text",page:e.pageIndex,rect:e.rect,rects:e.segmentRects,source:"annotation",markColor:n,redactionColor:o,...(t=e.custom)!=null&&t.text?{text:e.custom.text}:{}}:{id:e.id,kind:"area",page:e.pageIndex,rect:e.rect,source:"annotation",markColor:n,redactionColor:o}}emitPendingChange(e){const t=this.getDocumentState(e);t&&this.pending$.emit({documentId:e,pending:t.pending})}emitSelectedChange(e){const t=this.getDocumentState(e);t&&this.selected$.emit({documentId:e,selected:t.selected})}emitStateChange(e){const t=this.getDocumentState(e);t&&this.state$.emit({documentId:e,state:t})}onStoreUpdated(e,t){for(const n in t.documents)t.documents[n]&&(this.emitPendingChange(n),this.emitSelectedChange(n),this.emitStateChange(n))}async destroy(){this.pending$.clear(),this.selected$.clear(),this.state$.clear(),this.events$.clear(),this.redactionSelection$.forEach(e=>e.clear()),this.redactionSelection$.clear(),this.redactionMarquee$.forEach(e=>e.clear()),this.redactionMarquee$.clear(),this.documentUnsubscribers.forEach(e=>{e.forEach(t=>t())}),this.documentUnsubscribers.clear(),await super.destroy()}};Ef.id="redaction";let Vr=Ef;const wo="redaction",Jw={manifest:{id:wo,name:"Redaction Plugin",version:"1.0.0",provides:["redaction"],requires:[],optional:["interaction-manager","selection","annotation"],defaultConfig:{drawBlackBoxes:!0}},create:(e,t)=>new Vr(wo,e,t),reducer:(e=Od,t)=>{switch(t.type){case xf:{const{documentId:n,state:o}=t.payload;return{...e,documents:{...e.documents,[n]:o},activeDocumentId:e.activeDocumentId??n}}case kf:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i,activeDocumentId:e.activeDocumentId===n?null:e.activeDocumentId}}case"REDACTION/SET_ACTIVE_DOCUMENT":return{...e,activeDocumentId:t.payload};case Sf:{const{documentId:n,items:o}=t.payload,i=e.documents[n];if(!i)return e;const r={...i.pending};for(const a of o){const s=r[a.page]??[];s.some(l=>l.id===a.id)||(r[a.page]=s.concat(a))}return{...e,documents:{...e.documents,[n]:{...i,pending:r,pendingCount:Nd(r)}}}}case Af:{const{documentId:n,page:o,id:i}=t.payload,r=e.documents[n];if(!r)return e;const a=(r.pending[o]??[]).filter(c=>c.id!==i),s={...r.pending,[o]:a},l=r.selected&&!(r.selected.page===o&&r.selected.id===i);return{...e,documents:{...e.documents,[n]:{...r,pending:s,pendingCount:Nd(s),selected:l?r.selected:null}}}}case Pf:{const{documentId:n,page:o,id:i,patch:r}=t.payload,a=e.documents[n];if(!a)return e;const s=(a.pending[o]??[]).map(l=>l.id===i?{...l,...r}:l);return{...e,documents:{...e.documents,[n]:{...a,pending:{...a.pending,[o]:s}}}}}case Mf:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,pending:{},pendingCount:0,selected:null}}}:e}case Df:{const{documentId:n,page:o,id:i}=t.payload,r=e.documents[n];return r?{...e,documents:{...e.documents,[n]:{...r,selected:{page:o,id:i}}}}:e}case Tf:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,selected:null}}}:e}case Cf:{const{documentId:n,mode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,isRedacting:!0,activeType:o}}}:e}case If:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,isRedacting:!1,activeType:null}}}:e}case"SET_ACTIVE_TYPE":{const{documentId:n,mode:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,activeType:o}}}:e}default:return e}},initialState:Od};function ex({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=s.segmentRects??[],c=s.rect,d=s.strokeColor??"#FF0000",u=s.color??"#000000",m=s.opacity??1,g=s.fontColor??s.overlayColor??"#FFFFFF",p=s.overlayText,f=s.overlayTextRepeat??!1,v=s.fontSize??12,y=s.fontFamily??Ee.Helvetica,b=s.textAlign??Xe.Center,w=()=>p?f?Array(10).fill(p).join(" "):p:null;return k("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0},children:l.map((x,C)=>k("div",{onPointerDown:o,style:{position:"absolute",left:(c?x.origin.x-c.origin.x:x.origin.x)*n,top:(c?x.origin.y-c.origin.y:x.origin.y)*n,width:x.size.width*n,height:x.size.height*n,background:r?u:"transparent",border:r?"none":`2px solid ${d}`,opacity:r?m:1,boxSizing:"border-box",pointerEvents:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:b===Xe.Left?"flex-start":b===Xe.Right?"flex-end":"center",overflow:"hidden",...i},children:r&&p&&k("span",{style:{color:g,fontSize:Math.min(v*n,x.size.height*n*.8),...Cn(y),textAlign:Ar(b),whiteSpace:f?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1},children:w()})},C))})}function tx({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=s.strokeColor??"#FF0000",c=s.color??"#000000",d=s.opacity??1,u=s.fontColor??s.overlayColor??"#FFFFFF",m=s.overlayText,g=s.overlayTextRepeat??!1,p=s.fontSize??12,f=s.fontFamily??Ee.Helvetica,v=s.textAlign??Xe.Center;return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0,background:r?c:"transparent",border:r?"none":`2px solid ${l}`,opacity:r?d:1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:"center",justifyContent:v===Xe.Left?"flex-start":v===Xe.Right?"flex-end":"center",overflow:"hidden",...i},children:r&&m&&k("span",{style:{color:u,fontSize:p*n,...Cn(f),textAlign:Ar(v),whiteSpace:g?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"4px"},children:m?g?Array(10).fill(m).join(" "):m:null})})}const nx=[Ve({id:"redactHighlight",matches:e=>{var t;return e.type===T.REDACT&&"segmentRects"in e&&(((t=e.segmentRects)==null?void 0:t.length)??0)>0},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(ex,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),Ve({id:"redactArea",matches:e=>{var t;return!(e.type!==T.REDACT||"segmentRects"in e&&((t=e.segmentRects)!=null&&t.length))},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(tx,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})],zf=()=>At(Vr.id),Lf=()=>We(Vr.id),ox=({documentId:e,pageIndex:t,scale:n,className:o,stroke:i,fill:r="transparent"})=>{const{plugin:a}=zf(),s=pt(e),[l,c]=O(null),d=n??s?.scale??1,u=i??a?.getPreviewStrokeColor()??"red";return $(()=>{if(a&&e)return a.onRedactionMarqueeChange(e,m=>{c(m.pageIndex===t?m.rect:null)})},[a,e,t]),l?k("div",{style:{position:"absolute",pointerEvents:"none",left:l.origin.x*d,top:l.origin.y*d,width:l.size.width*d,height:l.size.height*d,border:`1px solid ${u}`,background:r,boxSizing:"border-box"},className:o}):null};function Nf({color:e="#FFFF00",opacity:t=1,border:n="1px solid red",rects:o,rect:i,scale:r,onClick:a,style:s,...l}){return k(de,{children:o.map((c,d)=>k("div",{onPointerDown:a,style:{position:"absolute",border:n,left:(i?c.origin.x-i.origin.x:c.origin.x)*r,top:(i?c.origin.y-i.origin.y:c.origin.y)*r,width:c.size.width*r,height:c.size.height*r,background:e,opacity:t,pointerEvents:a?"auto":"none",cursor:a?"pointer":"default",zIndex:a?1:void 0,...s},...l},d))})}function ix({documentId:e,pageIndex:t,scale:n}){const{plugin:o}=zf(),[i,r]=O([]),[a,s]=O(null),l=o?.getPreviewStrokeColor()??"red";return $(()=>{if(o)return o.onRedactionSelectionChange(e,c=>{const d=c.find(u=>u.pageIndex===t);r(d?.segmentRects??[]),s(d?.rect??null)})},[o,e,t]),a?k("div",{style:{mixBlendMode:"normal",pointerEvents:"none",position:"absolute",inset:0},children:k(Nf,{color:"transparent",opacity:1,rects:i,scale:n,border:`1px solid ${l}`})}):null}function rx({documentId:e,pageIndex:t,scale:n,bboxStroke:o="rgba(0,0,0,0.8)",rotation:i=fi.Degree0,selectionMenu:r}){const{provides:a}=Lf(),[s,l]=O([]),[c,d]=O(null);$(()=>{if(!a)return;const m=a.forDocument(e),g=m.getState();l((g.pending[t]??[]).filter(v=>v.source==="legacy")),d(g.selected&&g.selected.page===t?g.selected.id:null);const p=m.onPendingChange(v=>{l((v[t]??[]).filter(y=>y.source==="legacy"))}),f=m.onSelectedChange(v=>{d(v&&v.page===t?v.id:null)});return()=>{p?.(),f?.()}},[a,e,t]);const u=W((m,g)=>{m.stopPropagation(),a&&a.forDocument(e).selectPending(t,g)},[a,e,t]);return s.length?k("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s.map(m=>{if(m.kind==="area"){const p=m.rect;return k(de,{children:[k("div",{style:{position:"absolute",left:p.origin.x*n,top:p.origin.y*n,width:p.size.width*n,height:p.size.height*n,background:"transparent",outline:c===m.id?`1px solid ${o}`:"none",outlineOffset:"2px",border:`1px solid ${m.markColor}`,pointerEvents:"auto",cursor:"pointer"},onPointerDown:f=>u(f,m.id)}),r&&k(oi,{rect:{origin:{x:p.origin.x*n,y:p.origin.y*n},size:{width:p.size.width*n,height:p.size.height*n}},rotation:i,children:f=>r({...f,context:{type:"redaction",item:m,pageIndex:t},selected:c===m.id,placement:{suggestTop:!1}})})]},m.id)}const g=m.rect;return k(de,{children:[k("div",{style:{position:"absolute",left:g.origin.x*n,top:g.origin.y*n,width:g.size.width*n,height:g.size.height*n,background:"transparent",outline:c===m.id?`1px solid ${o}`:"none",outlineOffset:"2px",pointerEvents:"auto",cursor:c===m.id?"pointer":"default"},children:k(Nf,{rect:g,rects:m.rects,color:"transparent",border:`1px solid ${m.markColor}`,scale:n,onClick:p=>u(p,m.id)})}),r&&k(oi,{rect:{origin:{x:g.origin.x*n,y:g.origin.y*n},size:{width:g.size.width*n,height:g.size.height*n}},rotation:i,children:p=>r({...p,context:{type:"redaction",item:m,pageIndex:t},selected:c===m.id,placement:{suggestTop:!1}})})]},m.id)})}):null}const ax=({documentId:e,pageIndex:t,scale:n,rotation:o,selectionMenu:i})=>{var r,a;const s=pt(e),l=(a=(r=s?.document)==null?void 0:r.pages)==null?void 0:a[t],c=Z(()=>n!==void 0?n:s?.scale??1,[n,s?.scale]);return k(de,{children:[k(rx,{documentId:e,pageIndex:t,scale:c,rotation:Z(()=>o!==void 0?o:((l?.rotation??0)+(s?.rotation??0))%4,[o,l?.rotation,s?.rotation]),selectionMenu:i}),k(ox,{documentId:e,pageIndex:t,scale:c}),k(ix,{documentId:e,pageIndex:t,scale:c})]})},sx=Bt(Jw).addUtility(function(){return Hg(nx),null}).build(),Of=class extends $e{constructor(e,t){super(e,t)}async initialize(e){}buildCapability(){return{getAttachments:()=>this.getAttachments(),downloadAttachment:e=>this.downloadAttachment(e),forDocument:e=>this.createAttachmentScope(e)}}createAttachmentScope(e){return{getAttachments:()=>this.getAttachments(e),downloadAttachment:t=>this.downloadAttachment(t,e)}}downloadAttachment(e,t){const n=t??this.getActiveDocumentId(),o=this.coreState.core.documents[n];return o?.document?this.engine.readAttachmentContent(o.document,e):ne.reject({code:H.NotFound,message:`Document ${n} not found`})}getAttachments(e){const t=e??this.getActiveDocumentId(),n=this.coreState.core.documents[t];return n?.document?this.engine.getAttachments(n.document):ne.reject({code:H.NotFound,message:`Document ${t} not found`})}};Of.id="attachment";let Ff=Of;const Fd="attachment",lx={manifest:{id:Fd,name:"Attachment Plugin",version:"1.0.0",provides:["attachment"],requires:[],optional:[],defaultConfig:{}},create:e=>new Ff(Fd,e),reducer:()=>{},initialState:{}},_f="form",cx={id:_f,name:"Form Plugin",version:"1.0.0",provides:["form"],requires:["interaction-manager"],optional:["history","annotation"],defaultConfig:{enabled:!0}},$f="FORM/INIT_STATE",jf="FORM/CLEANUP_STATE",Uf="FORM/SELECT_FIELD",Bf="FORM/DESELECT_FIELD";function Ia(e,t){return{type:Uf,payload:{documentId:e,annotationId:t}}}const ts={selectedFieldId:null},_d={documents:{}},dx={annotationType:T.WIDGET,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),c=()=>{const p=i();return p?{...p.defaults,fontFamily:p.defaults.fontFamily??Ee.Helvetica,fontSize:p.defaults.fontSize??12,fontColor:p.defaults.fontColor??"#000000",strokeColor:p.defaults.strokeColor??"#000000",color:p.defaults.color??"#FFFFFF",strokeWidth:p.defaults.strokeWidth??1,field:p.defaults.field}:null},d=(p,f)=>({origin:{x:Math.min(p.x,f.x),y:Math.min(p.y,f.y)},size:{width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)}}),u=p=>{var f;const v=c(),y=`TextField_${pe().slice(0,8)}`;return{...v,type:T.WIDGET,id:pe(),pageIndex:t,rect:p,created:new Date,fontFamily:v.fontFamily,fontSize:v.fontSize,fontColor:v.fontColor,strokeColor:v.strokeColor,color:v.color,strokeWidth:v.strokeWidth,field:{type:he.TEXTFIELD,flag:((f=v.field)==null?void 0:f.flag)??me.NONE,name:y,alternateName:y,value:""}}},m=sn({getTool:i,onClickDetected:p=>{if(!c())return;const f=i(),v=f?.clickBehavior;if(!v?.enabled)return;const{width:y,height:b}=v.defaultSize,w=ue(p.x-y/2,0,r.width-y),x=ue(p.y-b/2,0,r.height-b);n(u({origin:{x:w,y:x},size:{width:y,height:b}}))}}),g=p=>{const f=a();if(!f)return null;const v=c();if(!v)return null;const y=d(f,p);return{type:T.WIDGET,bounds:y,data:{rect:y,...v}}};return{onPointerDown:(p,f)=>{var v;const y=l(p);s(y),m.onStart(y),o(g(y)),(v=f.setPointerCapture)==null||v.call(f)},onPointerMove:p=>{const f=l(p);m.onMove(f),a()&&m.hasMoved()&&o(g(f))},onPointerUp:(p,f)=>{var v;const y=a();if(!y)return;const b=l(p);if(m.hasMoved()){const w=d(y,b);w.size.width>5&&w.size.height>5&&n(u(w))}else m.onEnd(b);s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerLeave:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerCancel:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)}}}},ux={annotationType:T.WIDGET,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),c=()=>{const p=i();return p?{...p.defaults,strokeColor:p.defaults.strokeColor??"#000000",color:p.defaults.color??"#FFFFFF",strokeWidth:p.defaults.strokeWidth??1,field:p.defaults.field}:null},d=(p,f)=>({origin:{x:Math.min(p.x,f.x),y:Math.min(p.y,f.y)},size:{width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)}}),u=p=>{var f;const v=c(),y=`Checkbox_${pe().slice(0,8)}`;return{...v,type:T.WIDGET,id:pe(),pageIndex:t,rect:p,created:new Date,strokeColor:v.strokeColor,color:v.color,strokeWidth:v.strokeWidth,exportValue:"Yes",field:{type:he.CHECKBOX,flag:((f=v.field)==null?void 0:f.flag)??me.NONE,name:y,alternateName:y,value:"Off"}}},m=sn({getTool:i,onClickDetected:p=>{if(!c())return;const f=i(),v=f?.clickBehavior;if(!v?.enabled)return;const{width:y,height:b}=v.defaultSize,w=ue(p.x-y/2,0,r.width-y),x=ue(p.y-b/2,0,r.height-b);n(u({origin:{x:w,y:x},size:{width:y,height:b}}))}}),g=p=>{const f=a();if(!f)return null;const v=c();if(!v)return null;const y=d(f,p);return{type:T.WIDGET,bounds:y,data:{rect:y,...v}}};return{onPointerDown:(p,f)=>{var v;const y=l(p);s(y),m.onStart(y),o(g(y)),(v=f.setPointerCapture)==null||v.call(f)},onPointerMove:p=>{const f=l(p);m.onMove(f),a()&&m.hasMoved()&&o(g(f))},onPointerUp:(p,f)=>{var v;const y=a();if(!y)return;const b=l(p);if(m.hasMoved()){const w=d(y,b);w.size.width>5&&w.size.height>5&&n(u(w))}else m.onEnd(b);s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerLeave:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerCancel:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)}}}},hx={annotationType:T.WIDGET,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),c=()=>{const p=i();return p?{...p.defaults,strokeColor:p.defaults.strokeColor??"#000000",color:p.defaults.color??"#FFFFFF",strokeWidth:p.defaults.strokeWidth??1,field:p.defaults.field}:null},d=(p,f)=>{const v=f.x-p.x,y=f.y-p.y,b=Math.max(Math.abs(v),Math.abs(y)),w=v<0?-b:b,x=y<0?-b:b;return{origin:{x:Math.min(p.x,p.x+w),y:Math.min(p.y,p.y+x)},size:{width:b,height:b}}},u=p=>{var f;const v=c(),y=`RadioButton_${pe().slice(0,8)}`,b=pe();return{...v,type:T.WIDGET,id:b,pageIndex:t,rect:p,created:new Date,strokeColor:v.strokeColor,color:v.color,strokeWidth:v.strokeWidth,exportValue:b,field:{type:he.RADIOBUTTON,flag:((f=v.field)==null?void 0:f.flag)??me.BUTTON_RADIO|me.BUTTON_NOTOGGLETOOFF,name:y,alternateName:y,value:"Off",options:[]}}},m=sn({getTool:i,onClickDetected:p=>{if(!c())return;const f=i(),v=f?.clickBehavior;if(!v?.enabled)return;const{width:y,height:b}=v.defaultSize,w=ue(p.x-y/2,0,r.width-y),x=ue(p.y-b/2,0,r.height-b);n(u({origin:{x:w,y:x},size:{width:y,height:b}}))}}),g=p=>{const f=a();if(!f)return null;const v=c();if(!v)return null;const y=d(f,p);return{type:T.WIDGET,bounds:y,data:{rect:y,...v}}};return{onPointerDown:(p,f)=>{var v;const y=l(p);s(y),m.onStart(y),o(g(y)),(v=f.setPointerCapture)==null||v.call(f)},onPointerMove:p=>{const f=l(p);m.onMove(f),a()&&m.hasMoved()&&o(g(f))},onPointerUp:(p,f)=>{var v;const y=a();if(!y)return;const b=l(p);if(m.hasMoved()){const w=d(y,b);w.size.width>5&&w.size.height>5&&n(u(w))}else m.onEnd(b);s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerLeave:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerCancel:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)}}}},mx={annotationType:T.WIDGET,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),c=()=>{const p=i();return p?{...p.defaults,fontFamily:p.defaults.fontFamily??Ee.Helvetica,fontSize:p.defaults.fontSize??12,fontColor:p.defaults.fontColor??"#000000",strokeColor:p.defaults.strokeColor??"#000000",color:p.defaults.color??"#FFFFFF",strokeWidth:p.defaults.strokeWidth??1,field:p.defaults.field}:null},d=(p,f)=>({origin:{x:Math.min(p.x,f.x),y:Math.min(p.y,f.y)},size:{width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)}}),u=p=>{var f;const v=c(),y=`Combobox_${pe().slice(0,8)}`;return{...v,type:T.WIDGET,id:pe(),pageIndex:t,rect:p,created:new Date,fontFamily:v.fontFamily,fontSize:v.fontSize,fontColor:v.fontColor,strokeColor:v.strokeColor,color:v.color,strokeWidth:v.strokeWidth,field:{type:he.COMBOBOX,flag:((f=v.field)==null?void 0:f.flag)??me.NONE,name:y,alternateName:y,value:"",options:[{label:"Option 1",isSelected:!0},{label:"Option 2",isSelected:!1},{label:"Option 3",isSelected:!1}]}}},m=sn({getTool:i,onClickDetected:p=>{if(!c())return;const f=i(),v=f?.clickBehavior;if(!v?.enabled)return;const{width:y,height:b}=v.defaultSize,w=ue(p.x-y/2,0,r.width-y),x=ue(p.y-b/2,0,r.height-b);n(u({origin:{x:w,y:x},size:{width:y,height:b}}))}}),g=p=>{const f=a();if(!f)return null;const v=c();if(!v)return null;const y=d(f,p);return{type:T.WIDGET,bounds:y,data:{rect:y,...v}}};return{onPointerDown:(p,f)=>{var v;const y=l(p);s(y),m.onStart(y),o(g(y)),(v=f.setPointerCapture)==null||v.call(f)},onPointerMove:p=>{const f=l(p);m.onMove(f),a()&&m.hasMoved()&&o(g(f))},onPointerUp:(p,f)=>{var v;const y=a();if(!y)return;const b=l(p);if(m.hasMoved()){const w=d(y,b);w.size.width>5&&w.size.height>5&&n(u(w))}else m.onEnd(b);s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerLeave:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerCancel:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)}}}},px={annotationType:T.WIDGET,create(e){const{pageIndex:t,onCommit:n,onPreview:o,getTool:i,pageSize:r}=e,[a,s]=Ke(null),l=p=>({x:ue(p.x,0,r.width),y:ue(p.y,0,r.height)}),c=()=>{const p=i();return p?{...p.defaults,fontFamily:p.defaults.fontFamily??Ee.Helvetica,fontSize:p.defaults.fontSize??12,fontColor:p.defaults.fontColor??"#000000",strokeColor:p.defaults.strokeColor??"#000000",color:p.defaults.color??"#FFFFFF",strokeWidth:p.defaults.strokeWidth??1,field:p.defaults.field}:null},d=(p,f)=>({origin:{x:Math.min(p.x,f.x),y:Math.min(p.y,f.y)},size:{width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)}}),u=p=>{var f;const v=c(),y=`Listbox_${pe().slice(0,8)}`;return{...v,type:T.WIDGET,id:pe(),pageIndex:t,rect:p,created:new Date,fontFamily:v.fontFamily,fontSize:v.fontSize,fontColor:v.fontColor,strokeColor:v.strokeColor,color:v.color,strokeWidth:v.strokeWidth,field:{type:he.LISTBOX,flag:((f=v.field)==null?void 0:f.flag)??me.NONE,name:y,alternateName:y,value:"",options:[{label:"Option 1",isSelected:!0},{label:"Option 2",isSelected:!1},{label:"Option 3",isSelected:!1}]}}},m=sn({getTool:i,onClickDetected:p=>{if(!c())return;const f=i(),v=f?.clickBehavior;if(!v?.enabled)return;const{width:y,height:b}=v.defaultSize,w=ue(p.x-y/2,0,r.width-y),x=ue(p.y-b/2,0,r.height-b);n(u({origin:{x:w,y:x},size:{width:y,height:b}}))}}),g=p=>{const f=a();if(!f)return null;const v=c();if(!v)return null;const y=d(f,p);return{type:T.WIDGET,bounds:y,data:{rect:y,...v}}};return{onPointerDown:(p,f)=>{var v;const y=l(p);s(y),m.onStart(y),o(g(y)),(v=f.setPointerCapture)==null||v.call(f)},onPointerMove:p=>{const f=l(p);m.onMove(f),a()&&m.hasMoved()&&o(g(f))},onPointerUp:(p,f)=>{var v;const y=a();if(!y)return;const b=l(p);if(m.hasMoved()){const w=d(y,b);w.size.width>5&&w.size.height>5&&n(u(w))}else m.onEnd(b);s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerLeave:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)},onPointerCancel:(p,f)=>{var v;s(null),o(null),m.reset(),(v=f.releasePointerCapture)==null||v.call(f)}}}},gx={id:"formTextField",name:"Text Field",labelKey:"form.textfield",categories:["annotation","form"],matchScore:e=>{var t;return e.type!==T.WIDGET?0:((t=e.field)==null?void 0:t.type)===he.TEXTFIELD?10:0},interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.WIDGET,fontFamily:Ee.Helvetica,fontSize:12,fontColor:"#000000",strokeColor:"#000000",color:"#FFFFFF",strokeWidth:1,field:{flag:me.NONE,name:"TextField",alternateName:"TextField",value:"",type:he.TEXTFIELD}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:150,height:24}},pointerHandler:dx},fx={id:"formCheckbox",name:"Checkbox",labelKey:"form.checkbox",categories:["annotation","form"],matchScore:e=>{var t;return e.type!==T.WIDGET?0:((t=e.field)==null?void 0:t.type)===he.CHECKBOX?10:0},interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.WIDGET,strokeColor:"#000000",color:"#FFFFFF",strokeWidth:1,field:{flag:me.NONE,name:"Checkbox",alternateName:"Checkbox",value:"Off",type:he.CHECKBOX}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:20,height:20}},pointerHandler:ux},vx={id:"formRadioButton",name:"Radio Button",labelKey:"form.radiobutton",categories:["annotation","form"],matchScore:e=>{var t;return e.type!==T.WIDGET?0:((t=e.field)==null?void 0:t.type)===he.RADIOBUTTON?10:0},interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1,lockA
2291spectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.WIDGET,strokeColor:"#000000",color:"#FFFFFF",strokeWidth:1,field:{flag:me.BUTTON_RADIO|me.BUTTON_NOTOGGLETOOFF,name:"RadioButton",alternateName:"RadioButton",value:"Off",type:he.RADIOBUTTON,options:[]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:20,height:20}},pointerHandler:hx},yx={id:"formCombobox",name:"Combo Box",labelKey:"form.combobox",categories:["annotation","form"],matchScore:e=>{var t;return e.type!==T.WIDGET?0:((t=e.field)==null?void 0:t.type)===he.COMBOBOX?10:0},interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.WIDGET,fontFamily:Ee.Helvetica,fontSize:12,fontColor:"#000000",strokeColor:"#000000",color:"#FFFFFF",strokeWidth:1,field:{flag:me.NONE,name:"ComboBox",alternateName:"ComboBox",value:"",type:he.COMBOBOX,options:[{label:"Option 1",isSelected:!0},{label:"Option 2",isSelected:!1},{label:"Option 3",isSelected:!1}]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:200,height:40}},pointerHandler:mx},bx={id:"formListbox",name:"List Box",labelKey:"form.listbox",categories:["annotation","form"],matchScore:e=>{var t;return e.type!==T.WIDGET?0:((t=e.field)==null?void 0:t.type)===he.LISTBOX?10:0},interaction:{exclusive:!1,cursor:"crosshair",isDraggable:!0,isResizable:!0,isRotatable:!1,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.WIDGET,fontFamily:Ee.Helvetica,fontSize:12,fontColor:"#000000",strokeColor:"#000000",color:"#FFFFFF",strokeWidth:1,field:{flag:me.NONE,name:"ListBox",alternateName:"ListBox",value:"",type:he.LISTBOX,options:[{label:"Option 1",isSelected:!0},{label:"Option 2",isSelected:!1},{label:"Option 3",isSelected:!1}]}},behavior:{useAppearanceStream:!1},clickBehavior:{enabled:!0,defaultSize:{width:150,height:150}},pointerHandler:px},wx=[gx,fx,vx,yx,bx],Wf=class extends $e{constructor(e,t,n){var o,i;if(super(e,t),this.FORM_HISTORY_TOPIC="form-fields",this.annotation=null,this.history=null,this.state$=Ue((r,a)=>({documentId:r,state:a})),this.fieldValueChange$=Ue((r,a)=>a,{cache:!1}),this.formReady$=Ue((r,a)=>({documentId:r,fields:a}),{cache:!1}),this.fieldGroupIndex=new Map,this.fieldNameIndex=new Map,this.orderedFieldIndex=new Map,this.propagationInProgress=new Set,this.annotation=((o=t.getPlugin("annotation"))==null?void 0:o.provides())??null,this.history=((i=t.getPlugin(rl.id))==null?void 0:i.provides())??null,this.annotation){for(const r of wx)this.annotation.addTool(r);this.annotation.onAnnotationEvent(r=>this.handleAnnotationEvent(r))}}async initialize(){}onDocumentLoadingStarted(e){this.dispatch((function(t,n){return{type:$f,payload:{documentId:t,state:n}}})(e,{...ts}))}onDocumentClosed(e){this.dispatch((function(t){return{type:jf,payload:t}})(e)),this.fieldGroupIndex.delete(e),this.fieldNameIndex.delete(e),this.orderedFieldIndex.delete(e),this.state$.clearScope(e),this.fieldValueChange$.clearScope(e),this.formReady$.clearScope(e)}onStoreUpdated(e,t){for(const n in t.documents){const o=e.documents[n],i=t.documents[n];o!==i&&this.state$.emit(n,i)}}buildCapability(){return{getPageFormAnnoWidgets:(e,t)=>this.getPageFormAnnoWidgets(e,t),setFormFieldValues:(e,t,n,o)=>this.setFormFieldValues(e,t,n,o),renameField:(e,t,n)=>this.renameFieldMethod(e,t,n),shareField:(e,t,n)=>this.shareFieldMethod(e,t,n),renderWidget:(e,t)=>this.renderWidget(e,t),selectField:(e,t)=>this.selectFieldMethod(e,t),deselectField:e=>this.deselectFieldMethod(e),getSelectedFieldId:e=>this.getSelectedFieldId(e),selectNextField:e=>this.selectNextFieldMethod(e),selectPreviousField:e=>this.selectPreviousFieldMethod(e),activateField:e=>this.activateFieldMethod(e),getState:e=>this.getDocumentState(e),getFieldGroup:(e,t)=>this.getFieldGroup(e,t),getFieldSiblings:(e,t)=>this.getFieldSiblings(e,t),getFormValues:e=>this.getFormValuesMethod(e),getFormFields:e=>this.getFormFieldsMethod(e),setFormValues:(e,t)=>this.setFormValuesMethod(e,t),forDocument:e=>this.createFormScope(e),onStateChange:this.state$.onGlobal,onFieldValueChange:this.fieldValueChange$.onGlobal,onFormReady:this.formReady$.onGlobal}}createFormScope(e){return{getPageFormAnnoWidgets:t=>this.getPageFormAnnoWidgets(t,e),setFormFieldValues:(t,n,o)=>this.setFormFieldValues(t,n,o,e),renameField:(t,n)=>this.renameFieldMethod(t,n,e),shareField:(t,n)=>this.shareFieldMethod(t,n,e),renderWidget:t=>this.renderWidget(t,e),selectField:t=>this.selectFieldMethod(t,e),deselectField:()=>this.deselectFieldMethod(e),getSelectedFieldId:()=>this.getSelectedFieldId(e),selectNextField:()=>this.selectNextFieldMethod(e),selectPreviousField:()=>this.selectPreviousFieldMethod(e),activateField:()=>this.activateFieldMethod(e),getState:()=>this.getDocumentState(e),getFieldGroup:t=>this.getFieldGroup(t,e),getFieldSiblings:t=>this.getFieldSiblings(t,e),getFormValues:()=>this.getFormValuesMethod(e),getFormFields:()=>this.getFormFieldsMethod(e),setFormValues:t=>this.setFormValuesMethod(t,e),onStateChange:this.state$.forScope(e),onFieldValueChange:this.fieldValueChange$.forScope(e),onFormReady:this.formReady$.forScope(e)}}handleAnnotationEvent(e){switch(e.type){case"loaded":this.buildFieldGroupIndex(e.documentId),this.formReady$.emit(e.documentId,this.getFormFieldsMethod(e.documentId));break;case"create":case"delete":if(e.annotation.type!==T.WIDGET)break;this.buildFieldGroupIndex(e.documentId);break;
vendor: 48,943 bytes, line 2291
2291case"update":{if(!e.committed)break;const t=e.annotation;if(t.type!==T.WIDGET)break;if(this.propagationInProgress.has(t.id)){this.propagationInProgress.delete(t.id);break}const n=e.patch;this.buildFieldGroupIndex(e.documentId),this.propagateFieldLevelChanges(e.documentId,t,n);break}}}propagateFieldLevelChanges(e,t,n){if(!this.annotation||!n.field)return;const o=n.field,i=this.getFieldSiblings(t.id,e);if(i.length===0)return;const r=[];for(const a of i)this.propagationInProgress.add(a.annotationId),r.push({pageIndex:a.pageIndex,id:a.annotationId,patch:{field:{...o}}});this.annotation.forDocument(e).updateAnnotations(r)}buildFieldGroupIndex(e){if(!this.annotation)return;const t=this.annotation.forDocument(e).getState();if(!t)return;const n=new Map,o=[];for(const[a,s]of Object.entries(t.pages)){const l=Number(a);for(const c of s){const d=t.byUid[c];if(!d||d.object.type!==T.WIDGET)continue;const u=d.object,m={annotationId:c,pageIndex:l};o.push({entry:m,widget:u});const g=this.getFieldKey(u.field);if(!g)continue;const p=n.get(g)??[];p.push(m),n.set(g,p)}}this.fieldGroupIndex.set(e,n);const i=new Map;for(const{entry:a,widget:s}of o){const l=s.field.name.trim();if(!l)continue;const c=i.get(l)??[];c.push(a),i.set(l,c)}this.fieldNameIndex.set(e,i);const r=o.filter(({widget:a})=>!(a.field.flag&me.READONLY));this.orderedFieldIndex.set(e,r.map(({entry:a})=>a))}getDocumentState(e){const t=e??this.getActiveDocumentId();return this.state.documents[t]??{...ts}}getDocIndex(e){let t=this.fieldGroupIndex.get(e);return t||(t=new Map,this.fieldGroupIndex.set(e,t)),t}getFieldKey(e){if(typeof e.fieldObjectId=="number"&&e.fieldObjectId>0)return`field:${e.fieldObjectId}`;const t=e.name.trim();return t?`legacy:${e.type}:${t}`:null}resolveWidgetAnnotation(e,t){if(!this.annotation)return null;const n=this.annotation.forDocument(t).getState(),o=n?.byUid[e];return o&&o.object.type===T.WIDGET?o.object:null}getFieldGroup(e,t){const n=t??this.getActiveDocumentId(),o=this.resolveWidgetAnnotation(e,n);if(!o)return[];const i=this.getFieldKey(o.field);return i?this.getDocIndex(n).get(i)??[{annotationId:o.id,pageIndex:o.pageIndex}]:[{annotationId:o.id,pageIndex:o.pageIndex}]}getFieldSiblings(e,t){return this.getFieldGroup(e,t).filter(n=>n.annotationId!==e)}getFormValuesMethod(e){const t=e??this.getActiveDocumentId(),n=this.fieldNameIndex.get(t);if(!n)return{};const o={};for(const[i,r]of n){const a=this.resolveWidgetAnnotation(r[0].annotationId,t);a&&(o[i]=a.field.value)}return o}getFormFieldsMethod(e){const t=e??this.getActiveDocumentId(),n=this.fieldNameIndex.get(t);if(!n)return[];const o=[];for(const[i,r]of n){const a=this.resolveWidgetAnnotation(r[0].annotationId,t);a&&o.push({name:i,type:a.field.type,value:a.field.value,readOnly:!!(a.field.flag&me.READONLY),..."options"in a.field&&a.field.options?{options:a.field.options}:{}})}return o}setFormValuesMethod(e,t){const n=t??this.getActiveDocumentId(),o=this.fieldNameIndex.get(n);if(!o)return ne.reject({code:H.NotFound,message:"no form fields indexed for this document"});const i=Object.entries(e);if(i.length===0)return ne.resolve(!0);const r=new se;let a=i.length,s=!1;const l=()=>{a--,a!==0||s||r.resolve(!0)};for(const[c,d]of i){const u=o.get(c);if(!u||u.length===0){l();continue}let m=u[0],g=this.resolveWidgetAnnotation(m.annotationId,n);if(g){if(g.field.type===he.RADIOBUTTON||g.field.type===he.CHECKBOX)for(const p of u){const f=this.resolveWidgetAnnotation(p.annotationId,n);if(f&&f.exportValue===d){g=f,m=p;break}}this.setFormFieldValues(m.pageIndex,g,this.buildImportField(g,d),n).wait(()=>l(),p=>{return f=p.reason,void(s||(s=!0,r.reject(f)));var f})}else l()}return r}buildImportField(e,t){const n=e.field;if((n.type===he.COMBOBOX||n.type===he.LISTBOX)&&"options"in n)return{...n,value:t,options:n.options.map(o=>({...o,isSelected:o.label===t}))};if(n.type===he.CHECKBOX){const o=t==="Off"?"Off":e.exportValue??"Yes";return{...n,value:o}}return{...n,value:t}}isToggleField(e){return e.type===he.CHECKBOX||e.type===he.RADIOBUTTON}shouldRegenerateWidgetAppearances(e){return!this.isToggleField(e)}getFieldBatchTarget(e){const t=[...e.values()];return t.find(n=>this.isToggleField(n.widget.field)&&Kn(n.widget))??t[0]}async readFieldWidgets(e,t,n,o){const i=new Set(t.map(s=>s.pageIndex)),r=new Set(t.map(s=>s.annotationId)),a=new Map;for(const s of i){const l=e.pages.find(u=>u.index===s);if(!l)continue;const c=t.filter(u=>u.pageIndex===s).map(u=>u.annotationId);o&&await n.run(()=>this.engine.regenerateWidgetAppearances(e,l,c));const d=await n.run(()=>this.engine.getPageAnnoWidgets(e,l));for(const u of d)r.has(u.id)&&a.set(u.id,{widget:u,pageIndex:s})}return a}syncFieldBatch(e,t,n={}){if(this.annotation){for(const[o,{widget:i,pageIndex:r}]of t)this.annotation.syncAnnotationObject(o,i,e),this.annotation.invalidatePageAppearances(r,e),n.emitFieldValueChanges&&this.fieldValueChange$.emit(e,{documentId:e,pageIndex:r,annotationId:o,widget:i});this.buildFieldGroupIndex(e)}}resolveWidgetPage(e,t,n){const o=this.resolveWidgetAnnotation(e,t);if(!o)return null;const i=n.pages.find(r=>r.index===o.pageIndex);return i?{widget:o,page:i}:null}getPageFormAnnoWidgets(e,t){const n=this.getCoreDocumentOrThrow(t).document;if(!n)return ne.reject({code:H.DocNotOpen,message:"document is not open"});const o=n.pages.find(i=>i.index===e);return o?this.engine.getPageAnnoWidgets(n,o):ne.reject({code:H.NotFound,message:"page does not exist"})}setFormFieldValues(e,t,n,o){const i=o??this.getActiveDocumentId(),r=this.getCoreDocumentOrThrow(i).document;if(!r)return ne.reject({code:H.DocNotOpen,message:"document is not open"});const a=r.pages.find(c=>c.index===e);if(!a)return ne.reject({code:H.NotFound,message:"page does not exist"});const s=new se,l=new ra(s);return l.execute(async()=>{const c=this.getFieldGroup(t.id,i),d=await this.readFieldWidgets(r,c,l,!1);await l.run(()=>this.engine.setFormFieldState(r,a,t,n));const u=await this.readFieldWidgets(r,c,l,this.shouldRegenerateWidgetAppearances(n));let m=!0;const g=async f=>{const v=this.getFieldBatchTarget(f);if(!v)return;const y=r.pages.find(b=>b.index===v.pageIndex);if(y&&(await new Promise(b=>{this.engine.setFormFieldState(r,y,v.widget,v.widget.field).wait(()=>b(),()=>b())}),this.shouldRegenerateWidgetAppearances(v.widget.field)))for(const b of new Set([...f.values()].map(w=>w.pageIndex))){const w=r.pages.find(C=>C.index===b);if(!w)continue;const x=[...f.entries()].filter(([,C])=>C.pageIndex===b).map(([C])=>C);await new Promise(C=>{this.engine.regenerateWidgetAppearances(r,w,x).wait(()=>C(),()=>C())})}},p={execute:()=>{const f=m;m=!1,f?this.syncFieldBatch(i,u,{emitFieldValueChanges:!0}):g(u).then(()=>this.syncFieldBatch(i,u,{emitFieldValueChanges:!0}))},undo:()=>{g(d).then(()=>this.syncFieldBatch(i,d,{emitFieldValueChanges:!0}))}};this.history?this.history.forDocument(i).register(p,this.FORM_HISTORY_TOPIC):p.execute(),s.resolve(!0)},c=>({code:H.Unknown,message:String(c)})),s}findConflictingFieldGroups(e,t,n){const o=new Map;if(!this.annotation)return o;const i=this.annotation.forDocument(n).getState();if(!i)return o;const r=(()=>{const a=this.resolveWidgetAnnotation(t,n);return a?this.getFieldKey(a.field):null})();for(const[a,s]of Object.entries(i.pages)){const l=Number(a);for(const c of s){const d=i.byUid[c];if(!d||d.object.type!==T.WIDGET)continue;const u=d.object;if(u.field.name.trim()!==e)continue;const m=this.getFieldKey(u.field);m&&m!==r&&(o.has(m)||o.set(m,{entries:[],widget:u}),o.get(m).entries.push({annotationId:c,pageIndex:l}))}}return o}renameFieldMethod(e,t,n){const o=n??this.getActiveDocumentId(),i=t.trim();if(!i)return ne.reject({code:H.Unknown,message:"Field name must not be empty."});const r=this.getCoreDocumentOrThrow(o).document;if(!r)return ne.reject({code:H.DocNotOpen,message:"document is not open"});const a=this.resolveWidgetPage(e,o,r);if(!a)return ne.reject({code:H.NotFound,message:"widget annotation not found"});if(a.widget.field.name.trim()===i)return ne.resolve({outcome:"no-op"});const s=this.findConflictingFieldGroups(i,e,o);if(s.size>0){if(s.size>1)return ne.reject({code:H.Unknown,message:"That field name is used by multiple fields. Choose a unique name."});const[,d]=[...s.entries()][0];return d.widget.field.type!==a.widget.field.type?ne.reject({code:H.Unknown,message:"That field name is already used by a different widget type."}):ne.resolve({outcome:"conflict",targetAnnotationId:d.entries[0].annotationId,fieldName:i})}const l=new se,c=new ra(l);return c.execute(async()=>{const d=this.getFieldGroup(e,o);await c.run(()=>this.engine.renameWidgetField(r,a.page,a.widget,i));const u=await this.readFieldWidgets(r,d,c,!1);this.syncFieldBatch(o,u),l.resolve({outcome:"renamed"})},d=>({code:H.Unknown,message:String(d)})),l}shareFieldMethod(e,t,n){const o=n??this.getActiveDocumentId();if(e===t)return ne.resolve(!0);const i=this.getCoreDocumentOrThrow(o).document;if(!i)return ne.reject({code:H.DocNotOpen,message:"document is not open"});const r=this.resolveWidgetPage(e,o,i),a=this.resolveWidgetPage(t,o,i);if(!r||!a)return ne.reject({code:H.NotFound,message:"widget annotation not found"});if(r.widget.field.type!==a.widget.field.type)return ne.reject({code:H.Unknown,message:"cannot share fields with different widget types"});if(r.widget.field.fieldObjectId&&a.widget.field.fieldObjectId&&r.widget.field.fieldObjectId===a.widget.field.fieldObjectId)return ne.resolve(!0);const s=new Map;for(const u of this.getFieldGroup(e,o))s.set(u.annotationId,u);for(const u of this.getFieldGroup(t,o))s.set(u.annotationId,u);const l=[...s.values()],c=new se,d=new ra(c);return d.execute(async()=>{await d.run(()=>this.engine.shareWidgetField(i,r.page,r.widget,a.page,a.widget));const u=await this.readFieldWidgets(i,l,d,this.shouldRegenerateWidgetAppearances(a.widget.field));this.syncFieldBatch(o,u),c.resolve(!0)},u=>({code:H.Unknown,message:String(u)})),c}selectFieldMethod(e,t){const n=t??this.getActiveDocumentId();this.dispatch(Ia(n,e))}deselectFieldMethod(e){const t=e??this.getActiveDocumentId();this.dispatch((function(n){return{type:Bf,payload:n}})(t))}getSelectedFieldId(e){return this.getDocumentState(e).selectedFieldId}selectNextFieldMethod(e){const t=e??this.getActiveDocumentId(),n=this.orderedFieldIndex.get(t);if(!n||n.length===0)return;const o=this.getSelectedFieldId(t);let i=0;if(o){const a=n.findIndex(s=>s.annotationId===o);i=a>=0?(a+1)%n.length:0}const r=n[i];this.dispatch(Ia(t,r.annotationId))}selectPreviousFieldMethod(e){const t=e??this.getActiveDocumentId(),n=this.orderedFieldIndex.get(t);if(!n||n.length===0)return;const o=this.getSelectedFieldId(t);let i=n.length-1;if(o){const a=n.findIndex(s=>s.annotationId===o);i=a>=0?(a-1+n.length)%n.length:n.length-1}const r=n[i];this.dispatch(Ia(t,r.annotationId))}activateFieldMethod(e){const t=e??this.getActiveDocumentId(),n=this.getSelectedFieldId(t);if(!n)return;const o=this.resolveWidgetAnnotation(n,t);if(!o)return;const i=o.field;if(i.type===he.CHECKBOX){const r=Kn(o)?"Off":o.exportValue??"Yes";this.setFormFieldValues(o.pageIndex,o,{...i,value:r},t)}else i.type===he.RADIOBUTTON&&!Kn(o)&&o.exportValue&&this.setFormFieldValues(o.pageIndex,o,{...i,value:o.exportValue},t)}renderWidget(e,t){if(!this.annotation)return ne.reject({code:H.NotFound,message:"annotation plugin not found"});const n=t??this.getActiveDocumentId();return this.annotation.forDocument(n).renderAnnotation(e)}async destroy(){this.state$.clear(),this.fieldValueChange$.clear(),this.formReady$.clear(),super.destroy()}};Wf.id="form";let al=Wf;const xx={manifest:cx,create:(e,t)=>new al(_f,e,t),reducer:(e=_d,t)=>{switch(t.type){case $f:return{...e,documents:{...e.documents,[t.payload.documentId]:t.payload.state}};case jf:{const n=t.payload,{[n]:o,...i}=e.documents;return{...e,documents:i}}case Uf:{const{documentId:n,annotationId:o}=t.payload,i=e.documents[n];return i?{...e,documents:{...e.documents,[n]:{...i,selectedFieldId:o}}}:e}case Bf:{const n=t.payload,o=e.documents[n];return o?{...e,documents:{...e.documents,[n]:{...o,selectedFieldId:null}}}:e}default:return e}},initialState:_d},kx=(e,t,n)=>({selected:e?t.includes(n):void 0});function Cx({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=s.field,c=l.type===he.TEXTFIELD,d=c?l.value:"",u=c&&!!(l.flag&me.TEXT_COMB)&&!!l.maxLen,m=c&&!!(l.flag&me.TEXT_MULTIPLINE),g=c?l.maxLen:void 0,p=(s.strokeWidth??1)*n,f={fontSize:(s.fontSize??12)*n,...Cn(s.fontFamily),color:s.fontColor??"#000000",lineHeight:1.2};return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0,background:s.color??"rgba(255, 255, 255, 0.9)",border:`${p}px solid ${s.strokeColor??"rgba(0, 0, 0, 0.2)"}`,outline:r||t?"1px solid rgba(66, 133, 244, 0.5)":"none",outlineOffset:-1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:m?"flex-start":"center",overflow:"hidden",...u?{}:{padding:`${p}px ${p}px`},...i},children:u&&g?k(Ix,{value:d??"",maxLen:g,scale:n,width:s.rect.size.width,fontStyle:f,strokeColor:s.strokeColor??"rgba(0, 0, 0, 0.2)"}):k("span",{style:{...f,display:"block",width:"100%",whiteSpace:m?"pre-wrap":"nowrap",wordBreak:m?"break-word":"normal",overflowWrap:m?"break-word":"normal",overflow:"hidden",textOverflow:m?"clip":"ellipsis"},children:d})})}function Ix({value:e,maxLen:t,scale:n,width:o,fontStyle:i,strokeColor:r}){const a=o*n/t,s=e.split("");return k("div",{style:{position:"relative",width:"100%",height:"100%"},children:Array.from({length:t}).map((l,c)=>k("span",{style:{position:"absolute",top:0,left:c*a,width:a,height:"100%",display:"flex",alignItems:"center",justifyContent:"center",borderRight:c<t-1?`1px solid ${r}`:"none",boxSizing:"border-box",...i},children:s[c]||""},c))})}function Sx({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=Kn(s);return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0,background:s.color??"#FFFFFF",border:`${(s.strokeWidth??1)*n}px solid ${s.strokeColor??"#000000"}`,outline:r||t?"1px solid rgba(66, 133, 244, 0.5)":"none",outlineOffset:-1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:"center",justifyContent:"center",...i},children:l&&k("svg",{viewBox:"0 0 100 100",style:{width:"100%",height:"100%"},children:k("path",{d:"M28 48C27.45 50.21 29.45 63.13 30 67C30.55 69.21 34.58 72 39 72C44.52 71.45 76.55 32.55 76 32C77.1 31.45 76 25 76 25C74.34 22.24 68 25.45 68 26C68 26 43.55 53 43 53C41.34 53 40.55 41.1 40 40C33.37 36.69 29.1 45.79 28 48Z",fill:"#000000"})})})}function Ax({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=Kn(s);return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0,background:s.color??"#FFFFFF",border:`${(s.strokeWidth??1)*n}px solid ${s.strokeColor??"#000000"}`,borderRadius:"50%",outline:r||t?"1px solid rgba(66, 133, 244, 0.5)":"none",outlineOffset:-1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:"center",justifyContent:"center",...i},children:l&&k("div",{style:{width:"50%",height:"50%",borderRadius:"50%",background:"#000000"}})})}function Px({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){var r;const[a,s]=O(!1),{object:l}=e,c=l.field,d=((r=(c.type===he.COMBOBOX?c.options:[]).find(g=>g.isSelected))==null?void 0:r.label)??"",u=(l.strokeWidth??1)*n,m=(l.fontSize??12)*n;return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{position:"absolute",inset:0,background:l.color??"#FFFFFF",border:`${u}px solid ${l.strokeColor??"#000000"}`,outline:a||t?"1px solid rgba(66, 133, 244, 0.5)":"none",outlineOffset:-1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:"center",overflow:"hidden",...i},children:[k("span",{style:{flex:1,padding:`0 ${4*n}px`,fontSize:m,...Cn(l.fontFamily),color:l.fontColor??"#000000",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d}),k("div",{style:{width:13*n,minWidth:13*n,height:"100%",display:"flex",alignItems:"center",justifyContent:"center",borderLeft:`1px solid ${l.strokeColor??"#000000"}`},children:k("svg",{viewBox:"0 0 10 6",style:{width:8*n,height:5*n},fill:"currentColor",children:k("path",{d:"M0 0 L5 6 L10 0 Z"})})})]})}function Mx({annotation:e,isSelected:t,scale:n,onClick:o,style:i}){const[r,a]=O(!1),{object:s}=e,l=s.field,c=l.type===he.LISTBOX?l.options:[],d=(s.strokeWidth??1)*n,u=(s.fontSize??12)*n,m=1.2*u;return k("div",{onPointerDown:t?void 0:o,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{position:"absolute",inset:0,background:s.color??"#FFFFFF",border:`${d}px solid ${s.strokeColor??"#000000"}`,outline:r||t?"1px solid rgba(66, 133, 244, 0.5)":"none",outlineOffset:-1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",overflow:"hidden",display:"flex",flexDirection:"column",...i},children:c.map((g,p)=>k("div",{style:{padding:`0 ${4*n}px`,fontSize:u,lineHeight:`${m}px`,...Cn(s.fontFamily),color:g.isSelected?"#FFFFFF":s.fontColor??"#000000",background:g.isSelected?"rgba(0, 51, 113, 1)":"transparent",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:g.label},p))})}const Xr=()=>We(al.id),wi=e=>{var t;const{provides:n}=Xr(),[o,i]=O(((t=n?.forDocument(e))==null?void 0:t.getState())??{...ts});return $(()=>{if(!n)return;const r=n.forDocument(e);return i(r.getState()),r.onStateChange(a=>{i(a)})},[n,e]),o};function xi(e){const{currentObject:t,scale:n,pageIndex:o}=e,i=t.field,{provides:r}=Xr(),[a,s]=O(0),l=!!(i.flag&me.READONLY),c=Z(()=>r?.forDocument(e.documentId),[r,e.documentId]);$(()=>{if(c)return c.onFieldValueChange(u=>{u.annotationId===t.id&&s(m=>m+1)})},[c,t.id]);const d=W(u=>{c&&c.setFormFieldValues(o,t,u)},[c,o,t]);return{annotation:t,field:i,scale:n,pageIndex:o,scope:c,handleChangeField:d,renderKey:a,isReadOnly:l}}function ki({pageIndex:e,annotation:t,scaleFactor:n=1,renderKey:o=0,style:i,...r}){const{provides:a}=Xr(),[s,l]=O(null),c=K(null),{width:d,height:u}=t.rect.size;return $(()=>{if(!a)return;const m=a.renderWidget({pageIndex:e,annotation:t,options:{scaleFactor:n,dpr:window.devicePixelRatio}});return m.wait(g=>{const p=URL.createObjectURL(g);c.current&&URL.revokeObjectURL(c.current),c.current=p,l(p)},et),()=>{m.abort({code:H.Cancelled,message:"canceled render task"})}},[e,n,a,t.id,d,u,o]),$(()=>()=>{c.current&&(URL.revokeObjectURL(c.current),c.current=null)},[]),k(de,{children:s&&k("img",{src:s,...r,style:{width:"100%",height:"100%",display:"block",...i||{}}})})}const sl={position:"absolute",top:0,left:0,padding:0,margin:0,width:"100%",height:"100%",borderRadius:0,outline:"none",boxSizing:"border-box"},Dx=sl,Tx={...sl,cursor:"inherit"},Rx={...sl,resize:"none",lineHeight:1.14},Ex={position:"relative",width:"100%",height:"100%",borderRadius:0,boxSizing:"border-box"},zx={position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0,padding:0,margin:0,border:"none",zIndex:1},Lx={position:"absolute",top:0,height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},Nx={position:"absolute",top:"15%",height:"70%",width:1,backgroundColor:"black",pointerEvents:"none"};function Ox(e){const{inputRef:t,required:n,disabled:o,password:i,name:r,value:a,maxLen:s,cellWidth:l,chars:c,caretIndex:d,containerStyle:u,cellFontStyle:m,onFocus:g,onChange:p,onBlur:f}=e,[v,y]=O(!0);$(()=>{y(!0);const w=setInterval(()=>y(x=>!x),530);return()=>clearInterval(w)},[d]);const b=d<s;return k("div",{style:u,children:[k("input",{ref:t,required:n,disabled:o,type:i?"password":"text",name:r,"aria-label":r,value:a,maxLength:s,onFocus:g,onChange:p,onBlur:f,style:zx}),Array.from({length:s}).map((w,x)=>k("span",{style:{...Lx,...m,left:x*l,width:l},children:c[x]||""},x)),b&&k("span",{style:{...Nx,left:d*l+l/2,opacity:v?1:0}})]})}function Fx(e){const{annotation:t,isEditable:n,onChangeField:o,onFocus:i,onBlur:r,inputRef:a,scale:s,syncExternalValue:l=!0}=e,c=t.field,{flag:d}=c,u=c.name,m=c.value,[g,p]=O(m);$(()=>{l&&p(m)},[m,l]);const f=W(M=>{const N=M.target.value;p(N),o?.({...c,value:N})},[o,c]),v=(t.strokeWidth??0)*s,y=Cn(t.fontFamily),{adjustedFontPx:b,wrapperStyle:w}=nl(t.fontSize*s,!0),x=Z(()=>({backgroundColor:t.color??"transparent",borderStyle:"solid",borderColor:t.strokeColor??"transparent",borderWidth:v,color:t.fontColor,...y,fontSize:b,padding:`${v}px ${v}px`}),[t.color,t.strokeColor,t.fontColor,b,v,y]),C=!n||!!(d&me.READONLY),I=!!(d&me.REQUIRED),S=!!(d&me.TEXT_PASSWORD),P=!!(d&me.TEXT_MULTIPLINE),A=!!(d&me.TEXT_COMB),D=c.maxLen;if(A&&D){const M=t.rect.size.width*s/D,N=(g||"").split(""),z=k(Ox,{inputRef:a,required:I,disabled:C,password:S,name:u,value:g,maxLen:D,cellWidth:M,chars:N,caretIndex:N.length,containerStyle:{...Ex,backgroundColor:t.color??"transparent",borderStyle:"solid",borderColor:t.strokeColor??"transparent",borderWidth:v},cellFontStyle:{color:t.fontColor,...y,fontSize:b},onFocus:i,onChange:f,onBlur:r});return w?k("div",{style:w,children:z}):z}const R=P?k("textarea",{ref:a,required:I,disabled:C,name:u,"aria-label":u,value:g,maxLength:D,onFocus:i,onChange:f,onBlur:r,style:{...Rx,...x}}):k("input",{ref:a,required:I,disabled:C,type:S?"password":"text",name:u,"aria-label":u,value:g,maxLength:D,onFocus:i,onChange:f,onBlur:r,style:{...Dx,...x}});return w?k("div",{style:w,children:R}):R}function _x(e){const{annotation:t,scale:n,pageIndex:o,scope:i,handleChangeField:r,renderKey:a,isReadOnly:s}=xi(e),l=wi(e.documentId),[c,d]=O(!1),u=K(null),m=l.selectedFieldId===t.id;$(()=>{m&&u.current&&document.activeElement!==u.current&&u.current.focus()},[m]);const g=W(()=>{s||(i?.selectField(t.id),d(!0))},[s,i,t.id]),p=W(()=>{d(!1),i?.getSelectedFieldId()===t.id&&i?.deselectField()},[i,t.id]),f=W(v=>{u.current=v},[]);return k("div",{style:{width:"100%",height:"100%",overflow:"hidden",position:"relative",pointerEvents:"auto",outline:"none"},children:[k(ki,{pageIndex:o,annotation:t,scaleFactor:n,renderKey:a,style:{position:"absolute",inset:0,pointerEvents:"none",visibility:c?"hidden":"visible"}}),k("div",{style:{position:"absolute",inset:0,zIndex:1,opacity:c?1:0},children:k(Fx,{annotation:t,scale:n,pageIndex:o,isEditable:!0,onChangeField:r,syncExternalValue:!c,onFocus:g,onBlur:p,inputRef:f})})]})}function $x(e){const{annotation:t,field:n,scale:o,pageIndex:i,scope:r,handleChangeField:a,renderKey:s,isReadOnly:l}=xi(e),c=wi(e.documentId),d=K(null),u=c.selectedFieldId===t.id;$(()=>{u&&d.current&&document.activeElement!==d.current&&d.current.focus()},[u]);const m=W(()=>{if(l)return;const y=Kn(t)?"Off":t.exportValue??"Yes";a({...n,value:y})},[l,t,n,a]),g=W(()=>{l||(r?.selectField(t.id),m())},[l,r,t.id,m]),p=W(()=>{l||r==null||r.selectField(t.id)},[l,r,t.id]),f=W(()=>{r?.getSelectedFieldId()===t.id&&r?.deselectField()},[r,t.id]),v=W(y=>{y.key!==" "&&y.key!=="Enter"||(y.preventDefault(),m())},[m]);return k("div",{ref:d,tabIndex:l?-1:0,onClick:g,onFocus:p,onBlur:f,onKeyDown:v,style:{width:"100%",height:"100%",overflow:"hidden",cursor:l?"default":"pointer",pointerEvents:"auto",outline:u?"2px solid rgba(66, 133, 244, 0.8)":"none",outlineOffset:-2},children:k(ki,{pageIndex:i,annotation:t,scaleFactor:o,renderKey:s,style:{pointerEvents:"none"}})})}function jx(e){const{annotation:t,field:n,scale:o,pageIndex:i,scope:r,handleChangeField:a,renderKey:s,isReadOnly:l}=xi(e),c=wi(e.documentId),d=K(null),u=c.selectedFieldId===t.id;$(()=>{u&&d.current&&document.activeElement!==d.current&&d.current.focus()},[u]);const m=W(()=>{l||!Kn(t)&&t.exportValue&&a({...n,value:t.exportValue})},[l,t,n,a]),g=W(()=>{l||(r?.selectField(t.id),m())},[l,r,t.id,m]),p=W(()=>{l||r==null||r.selectField(t.id)},[l,r,t.id]),f=W(()=>{r?.getSelectedFieldId()===t.id&&r?.deselectField()},[r,t.id]),v=W(y=>{y.key!==" "&&y.key!=="Enter"||(y.preventDefault(),m())},[m]);return k("div",{ref:d,tabIndex:l?-1:0,onClick:g,onFocus:p,onBlur:f,onKeyDown:v,style:{width:"100%",height:"100%",overflow:"hidden",cursor:l?"default":"pointer",pointerEvents:"auto",outline:u?"2px solid rgba(66, 133, 244, 0.8)":"none",outlineOffset:-2},children:k(ki,{pageIndex:i,annotation:t,scaleFactor:o,renderKey:s,style:{pointerEvents:"none"}})})}function Ux(e){const{annotation:t,isEditable:n,onChangeField:o,onBlur:i,inputRef:r}=e,a=t.field,{flag:s,options:l}=a,c=a.alternateName||a.name,d=!n||!!(s&me.READONLY),u=!!(s&me.REQUIRED),m=W(v=>{const y=v.target,b=l.map((w,x)=>({...w,isSelected:x===y.selectedIndex}));o?.({...a,options:b})},[o,a,l]),g=l.filter(v=>v.isSelected).map(v=>v.label);return k("select",{ref:r,required:u,disabled:d,name:c,"aria-label":c,...(p=!1,f=g,{value:p?void 0:f[0]||""}),onChange:m,onBlur:i,style:{...Tx,opacity:0},children:l.map((v,y)=>k("option",{value:v.label,...kx(!1,g,v.label),children:v.label},y))});var p,f}function Bx(e){const{annotation:t,scale:n,pageIndex:o,scope:i,handleChangeField:r,renderKey:a,isReadOnly:s}=xi(e),l=wi(e.documentId),c=K(null),d=K(null),u=l.selectedFieldId===t.id;$(()=>{u&&c.current&&!c.current.contains(document.activeElement)&&(d.current??c.current).focus()},[u]);const m=W(()=>{i?.selectField(t.id)},[i,t.id]),g=W(()=>{requestAnimationFrame(()=>{var f;(f=c.current)!=null&&f.contains(document.activeElement)||i?.getSelectedFieldId()===t.id&&i?.deselectField()})},[i,t.id]),p=W(f=>{d.current=f},[]);return k("div",{ref:c,onFocus:m,onBlur:g,style:{width:"100%",height:"100%",overflow:"hidden",cursor:s?"default":"pointer",pointerEvents:"auto",outline:u?"2px solid rgba(66, 133, 244, 0.8)":"none",outlineOffset:-2},children:[k(ki,{pageIndex:o,annotation:t,scaleFactor:n,renderKey:a,style:{pointerEvents:"none"}}),k(Ux,{annotation:t,scale:n,pageIndex:o,isEditable:!0,onChangeField:r,inputRef:p})]})}function Wx(e){const{annotation:t,isEditable:n,onChangeField:o,onBlur:i,inputRef:r,scale:a}=e,s=t.field,{flag:l,options:c}=s,d=!n||!!(l&me.READONLY),u=!!(l&me.CHOICE_MULTL_SELECT),m=(t.strokeWidth??0)*a,g=(t.fontSize??12)*a,p=1.2*g,f=Cn(t.fontFamily),v=Z(()=>({position:"absolute",top:0,left:0,width:"100%",height:"100%",background:t.color??"#FFFFFF",borderStyle:"solid",borderColor:t.strokeColor??"#000000",borderWidth:m,boxSizing:"border-box",overflow:"auto",display:"flex",flexDirection:"column",outline:"none"}),[t.color,t.strokeColor,m]),y=W(b=>{if(d)return;const w=c.map((x,C)=>({...x,isSelected:u?C===b?!x.isSelected:x.isSelected:C===b}));o?.({...s,options:w})},[d,u,c,s,o]);return k("div",{ref:r,onBlur:i,style:v,children:c.map((b,w)=>k("div",{onClick:()=>y(w),style:{padding:`0 ${4*a}px`,fontSize:g,lineHeight:`${p}px`,...f,color:b.isSelected?"#FFFFFF":t.fontColor??"#000000",background:b.isSelected?"rgba(0, 51, 113, 1)":"transparent",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:d?"default":"pointer"},children:b.label},w))})}function Hx(e){const{annotation:t,scale:n,pageIndex:o,scope:i,handleChangeField:r,renderKey:a,isReadOnly:s}=xi(e),l=wi(e.documentId),[c,d]=O(!1),u=K(null),m=l.selectedFieldId===t.id;$(()=>{m&&u.current&&!u.current.contains(document.activeElement)&&u.current.focus()},[m]);const g=W(()=>{s||(i?.selectField(t.id),d(!0))},[s,i,t.id]),p=W(()=>{requestAnimationFrame(()=>{var f;(f=u.current)!=null&&f.contains(document.activeElement)||(d(!1),i?.getSelectedFieldId()===t.id&&i?.deselectField())})},[i,t.id]);return k("div",{ref:u,tabIndex:s?-1:0,onFocus:g,onBlur:p,style:{width:"100%",height:"100%",overflow:"hidden",cursor:s?"default":"pointer",pointerEvents:"auto",outline:m&&!c?"2px solid rgba(66, 133, 244, 0.8)":"none",outlineOffset:-2},children:[k(Wx,{annotation:t,scale:n,pageIndex:o,isEditable:!0,onChangeField:r}),!c&&k(ki,{pageIndex:o,annotation:t,scaleFactor:n,renderKey:a,style:{pointerEvents:"none"}})]})}const Gx=[Ve({id:"formTextField",matches:e=>{var t;return e.type===T.WIDGET&&((t=e.field)==null?void 0:t.type)===he.TEXTFIELD},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(Cx,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),renderPreview:({bounds:e,scale:t})=>k("div",{style:{position:"absolute",left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:"1px dashed rgba(66, 133, 244, 0.6)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxSizing:"border-box",display:"flex",alignItems:"center",padding:`0 ${2*t}px`,overflow:"hidden"}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>k(_x,{...e})}),Ve({id:"formCheckbox",matches:e=>{var t;return e.type===T.WIDGET&&((t=e.field)==null?void 0:t.type)===he.CHECKBOX},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(Sx,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),renderPreview:({bounds:e,scale:t})=>k("div",{style:{position:"absolute",left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:"1px dashed rgba(66, 133, 244, 0.6)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>k($x,{...e})}),Ve({id:"formRadioButton",matches:e=>{var t;return e.type===T.WIDGET&&((t=e.field)==null?void 0:t.type)===he.RADIOBUTTON},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(Ax,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),renderPreview:({bounds:e,scale:t})=>k("div",{style:{position:"absolute",left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:"1px dashed rgba(66, 133, 244, 0.6)",backgroundColor:"rgba(255, 255, 255, 0.9)",borderRadius:"50%",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>k(jx,{...e})}),Ve({id:"formCombobox",matches:e=>{var t;return e.type===T.WIDGET&&((t=e.field)==null?void 0:t.type)===he.COMBOBOX},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(Px,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),renderPreview:({bounds:e,scale:t})=>k("div",{style:{position:"absolute",left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:"1px dashed rgba(66, 133, 244, 0.6)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxSizing:"border-box",display:"flex",alignItems:"center",padding:`0 ${2*t}px`,overflow:"hidden"}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>k(Bx,{...e})}),Ve({id:"formListbox",matches:e=>{var t;return e.type===T.WIDGET&&((t=e.field)==null?void 0:t.type)===he.LISTBOX},render:({annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i})=>k(Mx,{annotation:e,isSelected:t,scale:n,pageIndex:o,onClick:i}),renderPreview:({bounds:e,scale:t})=>k("div",{style:{position:"absolute",left:0,top:0,width:e.size.width*t,height:e.size.height*t,border:"1px dashed rgba(66, 133, 244, 0.6)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden"}}),interactionDefaults:{isDraggable:!1,isResizable:!0,isRotatable:!1},useAppearanceStream:!1,renderLocked:e=>k(Hx,{...e})})],qx=Bt(xx).addUtility(function(){return Hg(Gx),null}).build(),di="stamp",Kx={id:di,name:"Stamp Plugin",version:"1.0.0",provides:["stamp"],requires:["annotation"],optional:["i18n"],defaultConfig:{defaultLibrary:{id:"custom",name:"Custom Stamps",nameKey:"stamp.library.custom",categories:["custom","sidebar"]},manifests:[{url:"https://cdn.jsdelivr.net/npm/@embedpdf/default-stamps/{locale}/manifest.json",fallbackLocale:"en"}]}},Hf="STAMP/ADD_LIBRARY",Gf="STAMP/REMOVE_LIBRARY";function $d(e){return{type:Hf,payload:e}}function jd(e){return{type:Gf,payload:e}}const Vx={annotationType:T.STAMP,create(e){const{onPreview:t,onCommit:n,getTool:o,pageSize:i,pageRotation:r,getToolContext:a}=e;return{onPointerMove:s=>{const l=a();if(!l?.stampSize)return;const{width:c,height:d}=l.stampSize;t({type:T.STAMP,bounds:{origin:{x:s.x-c/2,y:s.y-d/2},size:{width:c,height:d}},data:{rect:{origin:{x:s.x-c/2,y:s.y-d/2},size:{width:c,height:d}},ghostUrl:l.ghostUrl,pageRotation:r}})},onPointerDown:s=>{var l;const c=o(),d=a();if(!c||!d?.stampSize)return;const{width:u,height:m}=d.stampSize,g={origin:{x:s.x-u/2,y:s.y-m/2},size:{width:u,height:m}};let p={...c.defaults,rect:g,type:T.STAMP,name:d.stamp.name??c.defaults.name??Pe.Custom,subject:d.stamp.subject??c.defaults.subject??"Custom Stamp",flags:c.defaults.flags??["print"],pageIndex:e.pageIndex,id:pe(),created:new Date};(l=c.behavior)!=null&&l.insertUpright&&(p=Mo(p,r,!1)),p=ao(p,i),n(p,{appearance:d.appearance}),t(null)},onPointerLeave:()=>{t(null)}}}},ns="rubberStamp",Xx=[{id:ns,name:"Rubber Stamp",labelKey:"stamp.rubberStamp",categories:["annotation","stamp","insert"],matchScore:()=>0,interaction:{exclusive:!0,cursor:"copy",isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.STAMP},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0,insertUpright:!0,useAppearanceStream:!0},pointerHandler:Vx}],Zx={Approved:Pe.Approved,Experimental:Pe.Experimental,NotApproved:Pe.NotApproved,AsIs:Pe.AsIs,Expired:Pe.Expired,NotForPublicRelease:Pe.NotForPublicRelease,Confidential:Pe.Confidential,Final:Pe.Final,Sold:Pe.Sold,Departmental:Pe.Departmental,ForComment:Pe.ForComment,TopSecret:Pe.TopSecret,Draft:Pe.Draft,ForPublicRelease:Pe.ForPublicRelease,Completed:Pe.Completed,Void:Pe.Void,PreliminaryResults:Pe.PreliminaryResults,InformationOnly:Pe.InformationOnly,Rejected:Pe.Rejected,Witness:Pe.Witness,InitialHere:Pe.InitialHere,SignHere:Pe.SignHere,Accepted:Pe.Accepted,Custom:Pe.Custom,Image:Pe.Image},qf=class extends $e{constructor(e,t,n){var o,i;if(super(e,t),this.config=n,this.instanceId=pe(),this.libraries=new Map,this.libraryChange$=st(),this.activeStamp$=Ue((r,a)=>({documentId:r,activeStamp:a})),this.managedManifests=[],this.annotation=null,this.i18n=null,this.localeUnsubscribe=null,this.toolChangeUnsubscribe=null,this.currentGhostUrl=null,this.annotation=((o=t.getPlugin("annotation"))==null?void 0:o.provides())??null,this.annotation){for(const r of Xx)this.annotation.addTool(r);this.toolChangeUnsubscribe=this.annotation.onActiveToolChange(({documentId:r,tool:a})=>{a?.id!==ns&&(this.currentGhostUrl&&(URL.revokeObjectURL(this.currentGhostUrl),this.currentGhostUrl=null),this.activeStamp$.emit(r,null))})}this.i18n=((i=t.getPlugin("i18n"))==null?void 0:i.provides())??null}async initialize(){if(this.config.libraries)for(const e of this.config.libraries)await this.loadLibraryInternal(e).toPromise();this.config.manifests&&this.config.manifests.length>0&&await this.initializeManifests()}buildCapability(){return{getLibraries:()=>this.getLibraries(),getStampsByCategory:e=>this.getStampsByCategory(e),renderStamp:(e,t,n,o)=>this.renderStamp(e,t,n,o),loadLibrary:e=>this.loadLibrary(e),loadLibraryFromManifest:e=>this.loadLibraryFromManifest(e),createNewLibrary:(e,t)=>this.createNewLibrary(e,t),addStampToLibrary:(e,t,n)=>this.addStampToLibrary(e,t,n),removeStampFromLibrary:(e,t)=>this.removeStampFromLibrary(e,t),updateStamp:(e,t,n)=>this.updateStamp(e,t,n),updateLibrary:(e,t)=>this.updateLibrary(e,t),removeLibrary:e=>this.removeLibrary(e),exportLibrary:e=>this.exportLibrary(e),forDocument:e=>this.createStampScope(e),onActiveStampChange:this.activeStamp$.onGlobal,onLibraryChange:this.libraryChange$.on}}getLibraries(){return Array.from(this.libraries.values())}getStampsByCategory(e){var t,n;const o=[];for(const i of this.libraries.values()){const r=((t=i.categories)==null?void 0:t.includes(e))??!1;for(const a of i.stamps){const s=((n=a.categories)==null?void 0:n.includes(e))??!1;(r||s)&&o.push({library:i,stamp:a})}}return o}renderStamp(e,t,n,o){const i=this.libraries.get(e);if(!i){const s=new se;return s.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),s}const r=i.document.pages[t];if(!r){const s=new se;return s.reject({code:H.NotFound,message:`Page ${t} not found in stamp library: ${e}`}),s}const a=n/r.size.width;return this.engine.renderPageRect(i.document,r,{origin:{x:0,y:0},size:r.size},{scaleFactor:a,dpr:o??1,withAnnotations:!0,rotation:r.rotation,transparentBackground:!0})}loadLibrary(e){return this.loadLibraryInternal(e)}createNewLibrary(e,t){const n=new se,o=t?.id??this.generateLibraryId(),i=this.getLibraryDocumentId(o);return this.engine.createDocument(i).wait(r=>{const a={id:o,name:e,nameKey:t?.nameKey,document:r,stamps:[],categories:t?.categories,readonly:t?.readonly??!1};this.libraries.set(o,a),this.dispatch($d(o)),this.emitLibraryChange(),n.resolve(o)},r=>{this.logger.error("StampPlugin","CreateNewLibrary",`Failed to create library: ${e}`,r),n.fail(r)}),n}addStampToLibrary(e,t,n){const o=new se,i=this.libraries.get(e);if(!i)return o.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),o;if(i.readonly)return o.reject({code:H.NotSupport,message:`Cannot add stamps to readonly library: ${e}`}),o;const r=`stamp-temp-${Date.now()}`;return this.engine.openDocumentBuffer({id:r,content:n}).wait(a=>{this.engine.importPages(i.document,a,[0]).wait(s=>{const l=s[0];i.document.pages.push(l),i.document.pageCount=i.document.pages.length;const c={...t,id:pe(),pageIndex:l.index};i.stamps.push(c),this.engine.closeDocument(a).wait(()=>{this.emitLibraryChange(),o.resolve()},()=>{this.emitLibraryChange(),o.resolve()})},s=>{this.logger.error("StampPlugin","AddStampToLibrary","Failed to import page",s),this.engine.closeDocument(a).wait(()=>o.fail(s),()=>o.fail(s))})},a=>{this.logger.error("StampPlugin","AddStampToLibrary","Failed to open temp document",a),o.fail(a)}),o}createStampScope(e){return{createStampFromAnnotation:(t,n,o)=>this.createStampFromAnnotation(e,t,n,o),createStampFromAnnotations:(t,n,o)=>this.createStampFromAnnotations(e,t,n,o),activateStampPlacement:(t,n)=>this.activateStampPlacement(e,t,n),activateStampPlacementById:(t,n)=>this.activateStampPlacementById(e,t,n),getActiveStamp:()=>this.getActiveStamp(e),onActiveStampChange:this.activeStamp$.forScope(e)}}activateStampPlacementById(e,t,n){const o=new se,i=this.libraries.get(t);if(!i)return o.reject({code:H.NotFound,message:`Stamp library not found: ${t}`}),o;const r=i.stamps.find(a=>a.id===n);return r?this.activateStampPlacement(e,t,r):(o.reject({code:H.NotFound,message:`Stamp ${n} not found in library: ${t}`}),o)}getActiveStamp(e){return this.activeStamp$.getValue(e)??null}activateStampPlacement(e,t,n){const o=new se,i=this.libraries.get(t);if(!i)return o.reject({code:H.NotFound,message:`Stamp library not found: ${t}`}),o;const r=i.document.pages[n.pageIndex];if(!r)return o.reject({code:H.NotFound,message:`Page ${n.pageIndex} not found in library`}),o;const a=r.size;return this.engine.extractPages(i.document,[n.pageIndex]).wait(s=>{this.renderStamp(t,n.pageIndex,a.width,2).wait(l=>{var c;this.currentGhostUrl&&URL.revokeObjectURL(this.currentGhostUrl);const d=URL.createObjectURL(l);this.currentGhostUrl=d,(c=this.annotation)==null||c.setActiveTool(ns,{appearance:s,ghostUrl:d,stampSize:a,libraryId:t,stamp:n}),this.activeStamp$.emit(e,{libraryId:t,stamp:n}),o.resolve()},l=>{this.logger.error("StampPlugin","ActivateStampPlacement","Failed to render stamp preview",l),o.fail(l)})},s=>{this.logger.error("StampPlugin","ActivateStampPlacement","Failed to extract stamp page",s),o.fail(s)}),o}createStampFromAnnotation(e,t,n,o){const i=new se,r=this.getCoreDocument(e);if(!r?.document)return i.reject({code:H.DocNotOpen,message:"document is not open"}),i;const a=r.document,s=a.pages[t.pageIndex];return s?(this.resolveTargetLibrary(o).wait(l=>{this.engine.exportAnnotationAppearanceAsPdf(a,s,t).wait(c=>{this.addStampToLibrary(l,n,c).wait(()=>i.resolve(),d=>i.fail(d))},c=>{this.logger.error("StampPlugin","CreateStampFromAnnotation","Failed to export annotation",c),i.fail(c)})},l=>i.fail(l)),i):(i.reject({code:H.NotFound,message:`page ${t.pageIndex} not found`}),i)}createStampFromAnnotations(e,t,n,o){const i=new se;if(t.length===0)return i.reject({code:H.NotFound,message:"no annotations provided"}),i;const r=this.getCoreDocument(e);if(!r?.document)return i.reject({code:H.DocNotOpen,message:"document is not open"}),i;const a=r.document,s=a.pages[t[0].pageIndex];return s?(this.resolveTargetLibrary(o).wait(l=>{this.engine.exportAnnotationsAppearanceAsPdf(a,s,t).wait(c=>{this.addStampToLibrary(l,n,c).wait(()=>i.resolve(),d=>i.fail(d))},c=>{this.logger.error("StampPlugin","CreateStampFromAnnotations","Failed to export annotations",c),i.fail(c)})},l=>i.fail(l)),i):(i.reject({code:H.NotFound,message:`page ${t[0].pageIndex} not found`}),i)}resolveTargetLibrary(e){if(e&&this.libraries.has(e)){const o=new se;return o.resolve(e),o}const t=this.config.defaultLibrary;if(this.config.defaultLibrary===!1||!t){const o=new se;return o.reject({code:H.NotSupport,message:"Default library creation is disabled"}),o}const n=t.id??"custom";if(this.libraries.has(n)){const o=new se;return o.resolve(n),o}return this.createNewLibrary(t.name??"Custom Stamps",{id:n,nameKey:t.nameKey,categories:t.categories})}removeLibrary(e){const t=new se,n=this.libraries.get(e);return n?(this.engine.closeDocument(n.document).wait(()=>{this.libraries.delete(e),this.dispatch(jd(e)),this.emitLibraryChange(),t.resolve()},()=>{this.logger.warn("StampPlugin","RemoveLibrary",`Failed to close document for library: ${e}`),this.libraries.delete(e),this.dispatch(jd(e)),this.emitLibraryChange(),t.resolve()}),t):(t.resolve(),t)}exportLibrary(e){const t=new se,n=this.libraries.get(e);return n?(this.engine.saveAsCopy(n.document).wait(o=>{t.resolve({name:n.name,pdf:o,stamps:n.stamps,categories:n.categories})},o=>{this.logger.error("StampPlugin","ExportLibrary",`Failed to export library: ${e}`,o),t.fail(o)}),t):(t.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),t)}loadLibraryInternal(e){const t=new se,n=e.id??this.generateLibraryId(),o=this.getLibraryDocumentId(n);return(typeof e.pdf=="string"?this.engine.openDocumentUrl({id:o,url:e.pdf}):this.engine.openDocumentBuffer({id:o,content:e.pdf})).wait(i=>{const r=e.stamps.map(s=>s.id?s:{...s,id:pe()}),a={id:n,name:e.name,nameKey:e.nameKey,document:i,stamps:r,categories:e.categories,readonly:e.readonly??!1};this.libraries.set(n,a),this.dispatch($d(n)),this.emitLibraryChange(),t.resolve(n)},i=>{this.logger.error("StampPlugin","LoadLibrary",`Failed to load stamp library: ${e.name}`,i),t.fail(i)}),t}removeStampFromLibrary(e,t){const n=new se,o=this.libraries.get(e);if(!o)return n.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),n;if(o.readonly)return n.reject({code:H.NotSupport,message:`Cannot remove stamps from readonly library: ${e}`}),n;const i=o.stamps.findIndex(a=>a.id===t);if(i===-1)return n.reject({code:H.NotFound,message:`Stamp ${t} not found in library: ${e}`}),n;const r=o.stamps[i].pageIndex;return this.engine.deletePage(o.document,r).wait(()=>{o.stamps.splice(i,1),o.document.pages.splice(r,1),o.document.pageCount=o.document.pages.length;for(const a of o.stamps)a.pageIndex>r&&a.pageIndex--;for(let a=0;a<o.document.pages.length;a++)o.document.pages[a].index=a;this.emitLibraryChange(),n.resolve()},a=>{this.logger.error("StampPlugin","RemoveStampFromLibrary",`Failed to delete page for stamp ${t}`,a),n.fail(a)}),n}updateStamp(e,t,n){const o=new se,i=this.libraries.get(e);if(!i)return o.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),o;if(i.readonly)return o.reject({code:H.NotSupport,message:`Cannot update stamps in readonly library: ${e}`}),o;const r=i.stamps.find(a=>a.id===t);return r?(Object.assign(r,n),this.emitLibraryChange(),o.resolve(),o):(o.reject({code:H.NotFound,message:`Stamp ${t} not found in library: ${e}`}),o)}updateLibrary(e,t){const n=new se,o=this.libraries.get(e);return o?o.readonly?(n.reject({code:H.NotSupport,message:`Cannot update readonly library: ${e}`}),n):(t.name!==void 0&&(o.name=t.name),t.nameKey!==void 0&&(o.nameKey=t.nameKey),t.categories!==void 0&&(o.categories=t.categories),t.readonly!==void 0&&(o.readonly=t.readonly),this.emitLibraryChange(),n.resolve(),n):(n.reject({code:H.NotFound,message:`Stamp library not found: ${e}`}),n)}loadLibraryFromManifest(e){return this.loadManifestUrl(e,!0)}async initializeManifests(){var e;const t=((e=this.i18n)==null?void 0:e.getLocale())??"en";for(const n of this.config.manifests){const o=n.url.includes("{locale}"),i=o?t:"",r=n.url.replace("{locale}",i||t),a={source:n,localeAware:o,currentLocale:o?t:"",libraryId:null};this.managedManifests.push(a);try{const s=await this.loadManifestUrl(r,!0).toPromise();a.libraryId=s}catch{if(o&&n.fallbackLocale&&n.fallbackLocale!==t){const s=n.url.replace("{locale}",n.fallbackLocale);try{const l=await this.loadManifestUrl(s,!0).toPromise();a.libraryId=l,a.currentLocale=n.fallbackLocale}catch{this.logger.warn("StampPlugin","InitManifests",`Failed to load manifest (including fallback): ${n.url}`)}}else this.logger.warn("StampPlugin","InitManifests",`Failed to load manifest: ${r}`)}}this.i18n&&(this.localeUnsubscribe=this.i18n.onLocaleChange(n=>{this.handleLocaleChange(n.currentLocale)}))}async handleLocaleChange(e){for(const t of this.managedManifests){if(!t.localeAware||t.currentLocale===e)continue;if(t.libraryId){try{await this.removeLibrary(t.libraryId).toPromise()}catch{}t.libraryId=null}const n=t.source.url.replace("{locale}",e);try{const o=await this.loadManifestUrl(n,!0).toPromise();t.libraryId=o,t.currentLocale=e}catch{const o=t.source.fallbackLocale??"en";if(o!==e){const i=t.source.url.replace("{locale}",o);try{const r=await this.loadManifestUrl(i,!0).toPromise();t.libraryId=r,t.currentLocale=o}catch{this.logger.warn("StampPlugin","LocaleChange",`Failed to load manifest for locale ${e} (including fallback): ${t.source.url}`)}}else this.logger.warn("StampPlugin","LocaleChange",`Failed to load manifest for locale ${e}: ${t.source.url}`)}}}loadManifestUrl(e,t){const n=new se;return fetch(e).then(o=>{if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return o.json()}).then(o=>{const i=this.resolveManifestPdfUrl(e,o.pdf),r=o.stamps.map(s=>{return{id:s.id??pe(),pageIndex:s.pageIndex,name:(l=s.name,l?Zx[l]??Pe.Custom:Pe.Custom),subject:s.subject,subjectKey:s.subjectKey,label:s.label,categories:s.categories};var l}),a={id:o.id,name:o.name,nameKey:o.nameKey,pdf:i,stamps:r,categories:o.categories,readonly:t};this.loadLibraryInternal(a).wait(s=>n.resolve(s),s=>n.fail(s))}).catch(o=>{this.logger.error("StampPlugin","LoadManifest",`Failed to fetch manifest: ${e}`,o),n.reject({code:H.NotFound,message:`Failed to load stamp manifest: ${e}`})}),n}resolveManifestPdfUrl(e,t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:e.substring(0,e.lastIndexOf("/")+1)+t}generateLibraryId(){return pe()}getLibraryDocumentId(e){return`stamp-doc-${this.instanceId}-${e}`}emitLibraryChange(){this.libraryChange$.emit(this.getLibraries())}async destroy(){this.currentGhostUrl&&(URL.revokeObjectURL(this.currentGhostUrl),this.currentGhostUrl=null),this.toolChangeUnsubscribe&&(this.toolChangeUnsubscribe(),this.toolChangeUnsubscribe=null),this.localeUnsubscribe&&(this.localeUnsubscribe(),this.localeUnsubscribe=null),this.activeStamp$.clear();const e=Array.from(this.libraries.values());for(const t of e)try{await this.engine.closeDocument(t.document).toPromise()}catch{}this.libraries.clear(),this.managedManifests.length=0,super.destroy()}};qf.id=di;let Kf=qf;const Ud={libraryIds:[]},Jo=()=>We(Kf.id);function Yx({libraryId:e,pageIndex:t,width:n,dpr:o,style:i,...r}){const{provides:a}=Jo(),[s,l]=O(),c=K(null);return $(()=>{if(!a)return;const d=a.renderStamp(e,t,n,o??window.devicePixelRatio);return d.wait(u=>{const m=URL.createObjectURL(u);c.current=m,l(m)},et),()=>{c.current?(URL.revokeObjectURL(c.current),c.current=null):d.abort({code:H.Cancelled,message:"canceled stamp render task"})}},[a,e,t,n,o]),s?k("img",{src:s,onLoad:()=>{c.current&&(URL.revokeObjectURL(c.current),c.current=null)},style:i,...r}):null}const Qx=Bt({manifest:Kx,create:(e,t)=>new Kf(di,e,t),reducer:(e=Ud,t)=>{switch(t.type){case Hf:return{...e,libraryIds:[...e.libraryIds,t.payload]};case Gf:return{...e,libraryIds:e.libraryIds.filter(n=>n!==t.payload)};default:return e}},initialState:Ud}).build();var Nn=(e=>(e.SignatureOnly="signature-only",e.SignatureAndInitials="signature-and-initials",e))(Nn||{}),xn=(e=>(e.Draw="draw",e.Type="type",e.Upload="upload",e))(xn||{}),ko=(e=>(e.Signature="signature",e.Initials="initials",e))(ko||{});const ll="signature",Jx={id:ll,name:"Signature Plugin",version:"1.0.0",provides:["signature"],requires:["annotation"],optional:[],defaultConfig:{mode:Nn.SignatureOnly}},Vf="SIGNATURE/ADD_ENTRY",Xf="SIGNATURE/REMOVE_ENTRY";function Bd(e){return{type:Vf,payload:e}}const ek={annotationType:T.STAMP,create(e){const{onPreview:t,onCommit:n,getTool:o,pageSize:i,pageRotation:r,getToolContext:a}=e;return{onPointerMove:s=>{const l=a();if(!l?.targetSize)return;const{width:c,height:d}=l.targetSize;
2291t({type:T.STAMP,bounds:{origin:{x:s.x-c/2,y:s.y-d/2},size:{width:c,height:d}},data:{rect:{origin:{x:s.x-c/2,y:s.y-d/2},size:{width:c,height:d}},ghostUrl:l.ghostUrl,pageRotation:r}})},onPointerDown:s=>{var l;const c=o(),d=a();if(!c||!d?.targetSize)return;const{width:u,height:m}=d.targetSize,g={origin:{x:s.x-u/2,y:s.y-m/2},size:{width:u,height:m}};let p={...c.defaults,rect:g,type:T.STAMP,name:Pe.Custom,subject:"Signature",flags:c.defaults.flags??["print"],pageIndex:e.pageIndex,id:pe(),created:new Date};(l=c.behavior)!=null&&l.insertUpright&&(p=Mo(p,r,!1)),p=ao(p,i),n(p,{data:d.imageData}),t(null)},onPointerLeave:()=>{t(null)}}}};function Wd(e,t,n){const o=t.width/e.size.width,i=t.height/e.size.height,r=Math.min(o,i),a=e.size.width*r,s=e.size.height*r,l=n.x-a/2,c=n.y-s/2;return{inkList:e.inkList.map(u=>({points:u.points.map(m=>({x:m.x*r+l,y:m.y*r+c}))})),strokeWidth:Math.round(e.strokeWidth*r*10)/10}}const tk={annotationType:T.INK,create(e){const{onPreview:t,onCommit:n,getTool:o,pageSize:i,getToolContext:r}=e;return{onPointerMove:a=>{const s=r();if(!s?.inkData||!s?.targetSize)return;const{inkList:l,strokeWidth:c}=Wd(s.inkData,s.targetSize,a),d=l.flatMap(m=>m.points);if(d.length===0)return;const u=Et({origin:{x:Math.min(...d.map(m=>m.x)),y:Math.min(...d.map(m=>m.y))},size:{width:Math.max(...d.map(m=>m.x))-Math.min(...d.map(m=>m.x)),height:Math.max(...d.map(m=>m.y))-Math.min(...d.map(m=>m.y))}},c/2);t({type:T.INK,bounds:u,data:{rect:u,inkList:l,strokeWidth:c,strokeColor:s.inkData.strokeColor,opacity:.5}})},onPointerDown:a=>{const s=o(),l=r();if(!s||!l?.inkData||!l?.targetSize)return;const{inkList:c,strokeWidth:d}=Wd(l.inkData,l.targetSize,a),u=c.flatMap(y=>y.points);if(u.length===0)return;const m=Et({origin:{x:Math.min(...u.map(y=>y.x)),y:Math.min(...u.map(y=>y.y))},size:{width:Math.max(...u.map(y=>y.x))-Math.min(...u.map(y=>y.x)),height:Math.max(...u.map(y=>y.y))-Math.min(...u.map(y=>y.y))}},d/2);let g={...s.defaults,inkList:c,rect:m,strokeWidth:d,strokeColor:l.inkData.strokeColor,opacity:1,type:T.INK,subject:"Signature",flags:s.defaults.flags??["print"],pageIndex:e.pageIndex,id:pe(),created:new Date};const p=g.rect;g=ao(g,i);const f=g.rect.origin.x-p.origin.x,v=g.rect.origin.y-p.origin.y;f===0&&v===0||(g={...g,inkList:g.inkList.map(y=>({points:y.points.map(b=>({x:b.x+f,y:b.y+v}))}))}),n(g),t(null)},onPointerLeave:()=>{t(null)}}}},os="signatureStamp",is="signatureInk",nk={id:os,name:"Signature Stamp",labelKey:"signature.stamp",categories:["annotation","signature","insert"],matchScore:()=>0,interaction:{exclusive:!0,cursor:"copy",isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.STAMP},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0,insertUpright:!0,useAppearanceStream:!0},pointerHandler:ek},ok={id:is,name:"Signature Ink",labelKey:"signature.ink",categories:["annotation","signature","insert"],matchScore:e=>e.type===T.INK&&e.subject==="Signature"?20:0,interaction:{exclusive:!0,cursor:"copy",isDraggable:!0,isResizable:!0,isRotatable:!1,lockAspectRatio:!0,isGroupDraggable:!0,isGroupResizable:!1,isGroupRotatable:!1},defaults:{type:T.INK},behavior:{deactivateToolAfterCreate:!0,selectAfterCreate:!0},transform:kn.patchInk,pointerHandler:tk},ik=[nk,ok],Zf=class extends $e{constructor(e,t,n){var o;if(super(e,t),this.config=n,this.entries=new Map,this.entriesChange$=st(),this.activePlacement$=Ue((i,r)=>({documentId:i,activePlacement:r})),this.annotation=null,this.toolChangeUnsubscribe=null,this.currentGhostUrl=null,this.annotation=((o=t.getPlugin("annotation"))==null?void 0:o.provides())??null,this.annotation){for(const i of ik)this.annotation.addTool(i);this.toolChangeUnsubscribe=this.annotation.onActiveToolChange(({documentId:i,tool:r})=>{r?.id!==os&&r?.id!==is&&(this.revokeGhostUrl(),this.activePlacement$.emit(i,null))})}}async initialize(){}buildCapability(){return{mode:this.config.mode,getEntries:()=>this.getEntries(),addEntry:e=>this.addEntry(e),removeEntry:e=>this.removeEntry(e),loadEntries:e=>this.loadEntries(e),exportEntries:()=>this.exportEntries(),onEntriesChange:this.entriesChange$.on,forDocument:e=>this.createSignatureScope(e),onActivePlacementChange:this.activePlacement$.onGlobal}}getEntries(){return Array.from(this.entries.values())}addEntry(e){const t=pe(),n={...e,id:t,createdAt:Date.now()};return this.entries.set(t,n),this.dispatch(Bd(t)),this.emitEntriesChange(),t}removeEntry(e){this.entries.has(e)&&(this.entries.delete(e),this.dispatch((function(t){return{type:Xf,payload:t}}
vendor: 8,798 bytes, line 2291
2291)(e)),this.emitEntriesChange())}loadEntries(e){for(const t of e)this.entries.set(t.id,t),this.dispatch(Bd(t.id));this.emitEntriesChange()}exportEntries(){return this.getEntries()}createSignatureScope(e){return{activateSignaturePlacement:t=>this.activatePlacement(e,t,ko.Signature),activateInitialsPlacement:t=>this.activatePlacement(e,t,ko.Initials),deactivatePlacement:()=>this.deactivatePlacement(e),getActivePlacement:()=>this.activePlacement$.getValue(e)??null,onActivePlacementChange:this.activePlacement$.forScope(e)}}activatePlacement(e,t,n){const o=this.entries.get(t);if(!o||!this.annotation)return;const i=n===ko.Initials?o.initials:o.signature;if(i){if(this.revokeGhostUrl(),i.creationType===xn.Draw){if(o.signature.creationType!==xn.Draw)return;const r=this.config.defaultSize??{width:150,height:50},a=o.signature.inkData.size,s=Math.min(r.width/a.width,r.height/a.height),l={width:i.inkData.size.width*s,height:i.inkData.size.height*s};this.annotation.setActiveTool(is,{inkData:i.inkData,targetSize:l,entryId:t,kind:n})}else{if(!i.imageData)return;const r=URL.createObjectURL(new Blob([i.imageData],{type:i.imageMimeType??"image/png"}));this.currentGhostUrl=r;const a=this.config.defaultSize??{width:150,height:50};let s=a;if(i.imageSize){const l=o.signature.creationType!==xn.Draw?o.signature.imageSize??i.imageSize:i.imageSize,c=Math.min(a.width/l.width,a.height/l.height);s={width:i.imageSize.width*c,height:i.imageSize.height*c}}this.annotation.setActiveTool(os,{imageData:i.imageData,ghostUrl:r,targetSize:s,entryId:t,kind:n})}this.activePlacement$.emit(e,{entryId:t,kind:n})}}deactivatePlacement(e){this.annotation&&(this.annotation.setActiveTool(null),this.revokeGhostUrl(),this.activePlacement$.emit(e,null))}revokeGhostUrl(){this.currentGhostUrl&&(URL.revokeObjectURL(this.currentGhostUrl),this.currentGhostUrl=null)}emitEntriesChange(){this.entriesChange$.emit(this.getEntries())}async destroy(){var e;this.revokeGhostUrl(),(e=this.toolChangeUnsubscribe)==null||e.call(this),this.entries.clear()}};Zf.id=ll;let cl=Zf;const Hd={entryIds:[]};function rk(e){const t=new Uint8Array(e);let n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return btoa(n)}function ak(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n.buffer}function Gd(e){if(e.creationType===xn.Draw)return e;const{imageData:t,...n}=e;return{...n,imageData:t?rk(t):void 0}}function qd(e){if(e.creationType===xn.Draw)return e;const{imageData:t,...n}=e;return{...n,imageData:t?ak(t):void 0}}function sk(e){return e.map(t=>({id:t.id,createdAt:t.createdAt,signature:Gd(t.signature),...t.initials&&{initials:Gd(t.initials)}}))}function lk(e){return e.map(t=>({id:t.id,createdAt:t.createdAt,signature:qd(t.signature),...t.initials&&{initials:qd(t.initials)}}))}const rs=()=>We(cl.id);function Kd({accept:e="image/png,image/jpeg,image/svg+xml",onResult:t}){const n=K(null),[o,i]=O(null),[r,a]=O(!1),s=W(p=>{const f=new FileReader;f.onload=()=>{const v=f.result,y=new Blob([v],{type:p.type}),b=URL.createObjectURL(y);i(x=>(x&&URL.revokeObjectURL(x),b));const w=new Image;w.onload=()=>{const x=document.createElement("canvas");x.width=w.width,x.height=w.height;const C=x.getContext("2d");C&&C.drawImage(w,0,0);const I={creationType:xn.Upload,imageMimeType:p.type,imageSize:{width:w.width,height:w.height},previewDataUrl:x.toDataURL("image/png"),imageData:v};t(I)},w.src=b},f.readAsArrayBuffer(p)},[t]),l=W(p=>{const f=p.target.files;f&&f[0]&&s(f[0])},[s]),c=W(p=>{var f;p.preventDefault(),a(!1);const v=(f=p.dataTransfer)==null?void 0:f.files;v&&v[0]&&s(v[0])},[s]),d=W(p=>{p.preventDefault(),a(!0)},[]),u=W(()=>{a(!1)},[]),m=W(()=>{var p;(p=n.current)==null||p.click()},[]),g=W(()=>{i(p=>(p&&URL.revokeObjectURL(p),null)),t(null),n.current&&(n.current.value="")},[t]);return{inputRef:n,openFilePicker:m,processFile:s,handleFileInputChange:l,handleDrop:c,handleDragOver:d,handleDragLeave:u,previewUrl:o,isDragging:r,clear:g,accept:e}}function Yf(e,t=4){const n=e.getContext("2d");if(!n)return null;const{width:o,height:i}=e;if(o===0||i===0)return null;const r=n.getImageData(0,0,o,i),{data:a}=r;let s=o,l=i,c=0,d=0;for(let y=0;y<i;y++)for(let b=0;b<o;b++)a[4*(y*o+b)+3]>0&&(b<s&&(s=b),b>c&&(c=b),y<l&&(l=y),y>d&&(d=y));if(c<s||d<l)return null;const u=Math.max(0,s-t),m=Math.max(0,l-t),g=Math.min(o,c+t+1)-u,p=Math.min(i,d+t+1)-m,f=document.createElement("canvas");f.width=g,f.height=p;const v=f.getContext("2d");return v?(v.drawImage(e,u,m,g,p,0,0,g,p),{canvas:f,bounds:{x:u,y:m,width:g,height:p}}):null}function Vd({onResult:e,padRef:t,strokeColor:n="#000000",strokeWidth:o=4,className:i}){const r=K(null),[a,s]=O([]),l=K(!1),c=K({width:0,height:0}),d=K(a);d.current=a;const u=typeof window<"u"&&window.devicePixelRatio||1,m=W(x=>{const C=r.current;if(!C)return{x:0,y:0};const I=C.getBoundingClientRect();return{x:(x.clientX-I.left)*(C.width/u/I.width),y:(x.clientY-I.top)*(C.height/u/I.height)}},[u]),g=W(x=>{const C=r.current;if(!C)return;const I=C.getContext("2d");if(I){I.clearRect(0,0,C.width,C.height),I.save(),I.scale(u,u),I.strokeStyle=n,I.lineWidth=o,I.lineCap="round",I.lineJoin="round";for(const S of x)if(S.points.length!==0){I.beginPath(),I.moveTo(S.points[0].x,S.points[0].y);for(let P=1;P<S.points.length;P++)I.lineTo(S.points[P].x,S.points[P].y);I.stroke()}I.restore()}},[u,n,o]),p=K(g);p.current=g;const f=W(x=>{if(x.length===0||x.every(M=>M.points.length<2))return void e(null);const C=r.current;if(!C)return;const I=Yf(C,Math.ceil(o*u));if(!I)return void e(null);const S=I.bounds.x/u,P=I.bounds.y/u,A=Math.round(I.bounds.width/u),D=Math.round(I.bounds.height/u),R={creationType:xn.Draw,inkData:{inkList:x.filter(M=>M.points.length>=2).map(M=>({points:M.points.map(N=>({x:N.x-S,y:N.y-P}))})),strokeWidth:o,strokeColor:n,size:{width:A,height:D}},previewDataUrl:I.canvas.toDataURL("image/png")};e(R)},[e,o,n,u]);$(()=>{const x=r.current;if(!x)return;const C=new ResizeObserver(I=>{const{width:S,height:P}=I[0].contentRect;S>0&&P>0&&(c.current={width:Math.round(S),height:Math.round(P)},x.width=Math.round(S)*u,x.height=Math.round(P)*u,p.current(d.current))});return C.observe(x),()=>C.disconnect()},[u]),$(()=>{g(a),a.length>0&&a.some(x=>x.points.length>=2)&&f(a)},[n,o]);const v=W(()=>{s([]),g([]),e(null)},[g,e]);$(()=>(t?.({clear:v}),()=>t?.(null)),[t,v]);const y=W(x=>{var C,I;l.current=!0;const S=m(x),P=[...a,{points:[S]}];s(P),g(P),(I=(C=x.target)==null?void 0:C.setPointerCapture)==null||I.call(C,x.pointerId)},[a,m,g]),b=W(x=>{if(!l.current)return;const C=m(x),I=[...a],S=I[I.length-1];S&&(S.points.push(C),s(I),g(I))},[a,m,g]),w=W(x=>{var C,I;l.current=!1,(I=(C=x.target)==null?void 0:C.releasePointerCapture)==null||I.call(C,x.pointerId),f(a)},[a,f]);return k("canvas",{ref:r,className:i,style:{touchAction:"none",width:"100%",height:"100%",display:"block"},onPointerDown:y,onPointerMove:b,onPointerUp:w})}function Xd({onResult:e,padRef:t,fontFamily:n="'Dancing Script', cursive",fontSize:o=48,color:i="#000000",className:r,placeholder:a="Type your signature..."}){const s=K(null),l=K(null),c=K(`sig-type-${Math.random().toString(36).slice(2,8)}`).current,d=K({width:0,height:0}),[u,m]=O(""),g=typeof window<"u"&&window.devicePixelRatio||1,p=W(w=>{const x=s.current;if(!x)return;const{width:C,height:I}=d.current;if(C===0||I===0)return;x.width=C*g,x.height=I*g;const S=x.getContext("2d");if(!S)return;if(S.clearRect(0,0,x.width,x.height),!w.trim())return void e(null);S.scale(g,g),S.fillStyle=i,S.font=`${o}px ${n}`,S.textBaseline="middle",S.textAlign="center",S.fillText(w,C/2,I/2,C-20);const P=Yf(x,Math.ceil(4*g));if(!P)return void e(null);const A=Math.round(P.bounds.width/g),D=Math.round(P.bounds.height/g);P.canvas.toBlob(R=>{R&&R.arrayBuffer().then(M=>{const N={creationType:xn.Type,label:w,imageMimeType:"image/png",imageSize:{width:A,height:D},previewDataUrl:P.canvas.toDataURL("image/png"),imageData:M};e(N)})},"image/png")},[e,i,o,n,g]),f=K(p);f.current=p;const v=K(u);v.current=u,$(()=>{const w=l.current;if(!w)return;const x=new ResizeObserver(C=>{const{width:I,height:S}=C[0].contentRect;I>0&&S>0&&(d.current={width:Math.round(I),height:Math.round(S)},f.current(v.current))});return x.observe(w),()=>x.disconnect()},[]),$(()=>{p(u)},[u,n,p]);const y=W(()=>{m(""),e(null)},[e]);$(()=>(t?.({clear:y}),()=>t?.(null)),[t,y]);const b=W(w=>{m(w.target.value)},[]);return k("div",{ref:l,className:r,style:{width:"100%",height:"100%"},children:[k("style",{children:`#${c}::placeholder { color: ${i}; opacity: 0.5; }`}),k("input",{id:c,type:"text",value:u,onInput:b,placeholder:a,style:{fontFamily:n,fontSize:`${Math.min(o,32)}px`,color:i,width:"100%",height:"100%",border:"none",outline:"none",background:"transparent",textIndent:"8px"}}),k("canvas",{ref:s,style:{display:"none"}})]})}const ck=Bt({manifest:Jx,create:(e,t)=>
2291new cl(ll,e,t),reducer:(e=Hd,t)=>{switch(t.type){case Vf:return{...e,entryIds:[...e.entryIds,t.payload]};case Xf:return{...e,entryIds:e.entryIds.filter(n=>n!==t.payload)};default:return e}},initialState:Hd}).build(),Qf=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yr="-",Zd=[],dk=e=>{const t=hk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return uk(i);const r=i.split(yr),a=r[0]===""&&r.length>1?1:0;return Jf(r,a,t)},getConflictingClassGroupIds:(i,r)=>{if(r){const a=o[i],s=n[i];return a?s?((l,c)=>{const d=new Array(l.length+c.length);for(let u=0;u<l.length;u++)d[u]=l[u];for(let u=0;u<c.length;u++)d[l.length+u]=c[u];return d})(s,a):a:s||Zd}return n[i]||Zd}}},Jf=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const l=Jf(e,t+1,i);if(l)return l}const r=n.validators;if(r===null)return;const a=t===0?e.join(yr):e.slice(t).join(yr),s=r.length;for(let l=0;l<s;l++){const c=r[l];if(c.validator(a))return c.classGroupId}},uk=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?"arbitrary.."+o:void 0})(),hk=e=>{const{theme:t,classGroups:n}=e;return mk(n,t)},mk=(e,t)=>{const n=Qf();for(const o in e){const i=e[o];dl(i,n,o,t)}return n},dl=(e,t,n,o)=>{const i=e.length;for(let r=0;r<i;r++){const a=e[r];pk(a,t,n,o)}},pk=(e,t,n,o)=>{typeof e!="string"?typeof e!="function"?vk(e,t,n,o):fk(e,t,n,o):gk(e,t,n)},gk=(e,t,n)=>{(e===""?t:ev(t,e)).classGroupId=n},fk=(e,t,n,o)=>{yk(e)?dl(e(o),t,n,o):(t.validators===null&&(t.validators=[]),t.validators.push(((i,r)=>({classGroupId:i,validator:r}))(n,e)))},vk=(e,t,n,o)=>{const i=Object.entries(e),r=i.length;for(let a=0;a<r;a++){const[s,l]=i[a];dl(l,ev(t,s),n,o)}},ev=(e,t)=>{let n=e;const o=t.split(yr),i=o.length;for(let r=0;r<i;r++){const a=o[r];let s=n.nextPart.get(a);s||(s=Qf(),n.nextPart.set(a,s)),n=s}return n},yk=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const i=(r,a)=>{n[r]=a,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(r){let a=n[r];return a!==void 0?a:(a=o[r])!==void 0?(i(r,a),a):void 0},set(r,a){r in n?n[r]=a:i(r,a)}}},wk=[],Yd=(e,t,n,o,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:i}),xk=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=i=>{const r=[];let a,s=0,l=0,c=0;const d=i.length;for(let p=0;p<d;p++){const f=i[p];if(s===0&&l===0){if(f===":"){r.push(i.slice(c,p)),c=p+1;continue}if(f==="/"){a=p;continue}}f==="["?s++:f==="]"?s--:f==="("?l++:f===")"&&l--}const u=r.length===0?i:i.slice(c);let m=u,g=!1;return u.endsWith("!")?(m=u.slice(0,-1),g=!0):u.startsWith("!")&&(m=u.slice(1),g=!0),Yd(r,g,m,a&&a>c?a-c:void 0)};if(t){const i=t+":",r=o;o=a=>a.startsWith(i)?r(a.slice(i.length)):Yd(wk,!1,a,void 0,!0)}if(n){const i=o;o=r=>n({className:r,parseClassName:i})}return o},kk=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let i=[];for(let r=0;r<n.length;r++){const a=n[r],s=a[0]==="[",l=t.has(a);s||l?(i.length>0&&(i.sort(),o.push(...i),i=[]),o.push(a)):i.push(a)}return i.length>0&&(i.sort(),o.push(...i)),o}},Ck=/\s+/,tv=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=tv(e[o]))&&(n&&(n+=" "),n+=t);return n},Ik=(e,...t)=>{let n,o,i,r;const a=s=>{const l=o(s);if(l)return l;const c=((d,u)=>{const{parseClassName:m,getClassGroupId:g,getConflictingClassGroupIds:p,sortModifiers:f}=u,v=[],y=d.trim().split(Ck);let b="";for(let w=y.length-1;w>=0;w-=1){const x=y[w],{isExternal:C,modifiers:I,hasImportantModifier:S,baseClassName:P,maybePostfixModifierPosition:A}=m(x);if(C){b=x+(b.length>0?" "+b:b);continue}let D=!!A,R=g(D?P.substring(0,A):P);if(!R){if(!D){b=x+(b.length>0?" "+b:b);continue}if(R=g(P),!R){b=x+(b.length>0?" "+b:b);continue}D=!1}const M=I.length===0?"":I.length===1?I[0]:f(I).join(":"),N=S?M+"!":M,z=N+R;if(v.indexOf(z)>-1)continue;v.push(z);const _=p(R,D);for(let L=0;L<_.length;++L){const j=_[L];v.push(N+j)}b=x+(b.length>0?" "+b:b)}return b})(s,n);return i(s,c),c};return r=s=>{const l=t.reduce((c,d)=>d(c),e());return n=(c=>({cache:bk(c.cacheSize),parseClassName:xk(c),sortModifiers:kk(c),...dk(c)}))(l),o=n.cache.get,i=n.cache.set,r=a,a(s)},(...s)=>r(((...l)=>{let c,d,u=0,m="";for(;u<l.length;
vendor: 9,872 bytes, line 2291
2291)(c=l[u++])&&(d=tv(c))&&(m&&(m+=" "),m+=d);return m})(...s))},Sk=[],at=e=>{const t=n=>n[e]||Sk;return t.isThemeGetter=!0,t},nv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ov=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ak=/^\d+\/\d+$/,Pk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Tk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,go=e=>Ak.test(e),Ae=e=>!!e&&!Number.isNaN(Number(e)),Dn=e=>!!e&&Number.isInteger(Number(e)),Sa=e=>e.endsWith("%")&&Ae(e.slice(0,-1)),vn=e=>Pk.test(e),Ek=()=>!0,zk=e=>Mk.test(e)&&!Dk.test(e),iv=()=>!1,Lk=e=>Tk.test(e),Nk=e=>Rk.test(e),Ok=e=>!ie(e)&&!re(e),Fk=e=>No(e,sv,iv),ie=e=>nv.test(e),Wn=e=>No(e,lv,zk),Aa=e=>No(e,Bk,Ae),Qd=e=>No(e,rv,iv),_k=e=>No(e,av,Nk),Hi=e=>No(e,cv,Lk),re=e=>ov.test(e),Vo=e=>Oo(e,lv),$k=e=>Oo(e,Wk),Jd=e=>Oo(e,rv),jk=e=>Oo(e,sv),Uk=e=>Oo(e,av),Gi=e=>Oo(e,cv,!0),No=(e,t,n)=>{const o=nv.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},Oo=(e,t,n=!1)=>{const o=ov.exec(e);return!!o&&(o[1]?t(o[1]):n)},rv=e=>e==="position"||e==="percentage",av=e=>e==="image"||e==="url",sv=e=>e==="length"||e==="size"||e==="bg-size",lv=e=>e==="length",Bk=e=>e==="number",Wk=e=>e==="family-name",cv=e=>e==="shadow",Ci=Ik(()=>{const e=at("color"),t=at("font"),n=at("text"),o=at("font-weight"),i=at("tracking"),r=at("leading"),a=at("breakpoint"),s=at("container"),l=at("spacing"),c=at("radius"),d=at("shadow"),u=at("inset-shadow"),m=at("text-shadow"),g=at("drop-shadow"),p=at("blur"),f=at("perspective"),v=at("aspect"),y=at("ease"),b=at("animate"),w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",re,ie],x=()=>[re,ie,l],C=()=>[go,"full","auto",...x()],I=()=>[Dn,"none","subgrid",re,ie],S=()=>["auto",{span:["full",Dn,re,ie]},Dn,re,ie],P=()=>[Dn,"auto",re,ie],A=()=>["auto","min","max","fr",re,ie],D=()=>["auto",...x()],R=()=>[go,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],M=()=>[e,re,ie],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Jd,Qd,{position:[re,ie]}],z=()=>["auto","cover","contain",jk,Fk,{size:[re,ie]}],_=()=>[Sa,Vo,Wn],L=()=>["","none","full",c,re,ie],j=()=>["",Ae,Vo,Wn],E=()=>[Ae,Sa,Jd,Qd],F=()=>["","none",p,re,ie],X=()=>["none",Ae,re,ie],Q=()=>["none",Ae,re,ie],J=()=>[Ae,re,ie],te=()=>[go,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vn],breakpoint:[vn],color:[Ek],container:[vn],"drop-shadow":[vn],ease:["in","out","in-out"],font:[Ok],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vn],shadow:[vn],spacing:["px",Ae],text:[vn],"text-shadow":[vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",go,ie,re,v]}],container:["container"],columns:[{columns:[Ae,ie,re,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",re,ie]}],basis:[{basis:[go,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,go,"auto","initial","none",ie]}],grow:[{grow:["",Ae,re,ie]}],shrink:[{shrink:["",Ae,re,ie]}],order:[{order:[Dn,"first","last","none",re,ie]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[s,"screen",...R()]}],"min-w":[{"min-w":[s,"screen","none",...R()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Vo,Wn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,re,Aa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sa,ie]}],"font-family":[{font:[$k,ie,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,re,ie]}],"line-clamp":[{"line-clamp":[Ae,"none",re,Aa]}],leading:[{leading:[r,...x()]}],"list-image":[{"list-image":["none",re,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",re,Wn]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ae,"auto",re,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,re,ie],radial:["",re,ie],conic:[Dn,re,ie]},Uk,_k]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:_()}
2291],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":j()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}
vendor: 4,110 bytes, line 2291
2291],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,re,ie]}],"outline-w":[{outline:["",Ae,Vo,Wn]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,Gi,Hi]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",u,Gi,Hi]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ae,Wn]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",m,Gi,Hi]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ae,re,ie]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":E()}],"mask-image-linear-to-pos":[{"mask-linear-to":E()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":E()}],"mask-image-t-to-pos":[{"mask-t-to":E()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":E()}],"mask-image-r-to-pos":[{"mask-r-to":E()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":E()}],"mask-image-b-to-pos":[{"mask-b-to":E()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":E()}],"mask-image-l-to-pos":[{"mask-l-to":E()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":E()}],"mask-image-x-to-pos":[{"mask-x-to":E()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":E()}],"mask-image-y-to-pos":[{"mask-y-to":E()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[re,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":E()}],"mask-image-radial-to-pos":[{"mask-radial-to":E()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":E()}],"mask-image-conic-to-pos":[{"mask-conic-to":E()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",re,ie]}],filter:[{filter:["","none",re,ie]}],blur:[{blur:F()}],brightness:[{brightness:[Ae,re,ie]}],contrast:[{contrast:[Ae,re,ie]}],"drop-shadow":[{"drop-shadow":["","none",g,Gi,Hi]}
vendor: 7,508 bytes, line 2291
2291],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ae,re,ie]}],"hue-rotate":[{"hue-rotate":[Ae,re,ie]}],invert:[{invert:["",Ae,re,ie]}],saturate:[{saturate:[Ae,re,ie]}],sepia:[{sepia:["",Ae,re,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",re,ie]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,re,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,re,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,re,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,re,ie]}],"backdrop-invert":[{"backdrop-invert":["",Ae,re,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,re,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,re,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,re,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",re,ie]}],ease:[{ease:["linear","initial",y,re,ie]}],delay:[{delay:[Ae,re,ie]}],animate:[{animate:["none",b,re,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,re,ie]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[re,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re,ie]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ae,Vo,Wn,Aa]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});var Hk=["children","onClick","active","disabled","className","anchorRef"];function as(e){var t=e.children,n=e.onClick,o=e.active,i=o!==void 0&&o,r=e.disabled,a=r!==void 0&&r,s=e.className,l=s===void 0?"":s,c=e.anchorRef,d=Cr(e,Hk);return h("button",B({type:"button",ref:c,onClick:n,disabled:a,className:Ci("flex h-[32px] w-auto min-w-[32px] items-center justify-center rounded-md p-[5px] transition-colors hover:bg-interactive-hover hover:ring hover:ring-accent cursor-pointer rounded-none px-2 py-1 text-sm hover:bg-transparent border-b-2 hover:border-b-fg-muted hover:ring-transparent",i?"border-b-accent text-accent hover:border-b-accent":"border-b-transparent",a?"cursor-not-allowed opacity-50":"",l)},d),t)}var ui=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 6l6 6l-6 6"}))},ul=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 6l-6 6l6 6"}))},dv=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 9l6 6l6 -6"}))},uv=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),h("path",{d:"M21 21l-6 -6"}))},hv=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M18 6l-12 12"}),h("path",{d:"M6 6l12 12"}))},mv=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor,l=s===void 0?"currentColor":s;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 4h10"}),h("path",{d:"M12 4v8"}),h("defs",null,h("clipPath",{id:"stripeClip"},h("rect",{x:"2",y:"12",width:"20",height:"10",rx:"2"}))),h("rect",{x:"2",y:"12",width:"20",height:"10",rx:"2",fill:"none",stroke:a}),h("g",{"clip-path":"url(#stripeClip)",stroke:l},h("path",{d:"M-7 24l12 -12"}),h("path",{d:"M-3 24l12 -12"}),h("path",{d:"M1 24l12 -12"}),h("path",{d:"M5 24l12 -12"}),h("path",{d:"M9 24l12 -12"}),h("path",{d:"M13 24l12 -12"}),h("path",{d:"M17 24l12 -12"}),h("path",{d:"M21 24l12 -12"}),h("path",{d:"M25 24l12 -12"})))},pv=function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor,l=s===void 0?"currentColor":s;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 20h-1a2 2 0 0 1 -2 -2v-1"}),h("path",{d:"M3 13v-3"}),h("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),h("path",{d:"M10 3h3"}),h("path",{d:"M17 3h1a2 2 0 0 1 2 2v1"}),h("defs",null,h("clipPath",{id:"redactClip"},h("rect",{x:"10",y:"10",width:"12",height:"12",rx:"2"}))),h("rect",{x:"10",y:"10",width:"12",height:"12",rx:"2",fill:"none"}),h("g",{"clip-path":"url(#redactClip)",stroke:l},h("path",{d:"M-2 24l14 -14"}),h("path",{d:"M2 24l14 -14"}),h("path",{d:"M6 24l14 -14"}),h("path",{d:"M10 24l15 -15"}),h("path",{d:"M14 24l15 -15"}),h("path",{d:"M18 24l15 -15"})))},Gk={download:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),h("path",{d:"M7 11l5 5l5 -5"}),h("path",{d:"M12 4l0 12"}))},menu:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 8l16 0"}),h("path",{d:"M4 16l16 0"}))},fullscreen:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),h("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),h("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),h("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"}))},fullscreenExit:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 8v-2c0 -.551 .223 -1.05 .584 -1.412"}),h("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),h("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),h("path",{d:"M16 20h2c.545 0 1.04 -.218 1.4 -.572"}),h("path",{d:"M3 3l18 18"}))},save:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"}),h("path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M14 4l0 4l-6 0l0 -4"}))},print:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2"}),h("path",{d:"M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4"}),h("path",{d:"M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z"}))},settings:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"}),h("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"}))},viewSettings:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M12 10.5v1.5"}),h("path",{d:"M12 16v1.5"}),h("path",{d:"M15.031 12.25l-1.299 .75"}),h("path",{d:"M10.268 15l-1.3 .75"}),h("path",{d:"M15 15.803l-1.285 -.773"}),h("path",{d:"M10.285 12.97l-1.285 -.773"}),h("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}))},rotateClockwise:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5"}))},rotateCounterClockwise:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5"}))},singlePage:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 3m0 1a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1z"}))},doublePage:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18"}))},zoomIn:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),h("path",{d:"M9 12h6"}),h("path",{d:"M12 9v6"}))},zoomOut:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),h("path",{d:"M9 12l6 0"}))},fitToWidth:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6"}),h("path",{d:"M10 18h-7"}),h("path",{d:"M21 18h-7"}),h("path",{d:"M6 15l-3 3l3 3"}),h("path",{d:"M18 15l3 3l-3 3"}))},fitToPage:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6"}),h("path",{d:"M18 14v7"}),h("path",{d:"M18 3v7"}),h("path",{d:"M15 18l3 3l3 -3"}),h("path",{d:"M15 6l3 -3l3 3"}))},chevronRight:ui,chevronLeft:ul,chevronDown:dv,search:uv,callout:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:s===void 0?"none":s,stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1"}),h("path",{fill:"none",d:"M17 11v6h-9"}),h("path",{fill:"none",d:"M8 15l-2 2l2 2"}))},comment:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 11v.01"}),h("path",{d:"M8 11v.01"}),h("path",{d:"M16 11v.01"}),h("path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z"}))},sidebar:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),h("path",{d:"M10 18v-12a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z"}))},dots:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),h("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),h("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}))},vertical:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 7l4 -4l4 4"}),h("path",{d:"M8 17l4 4l4 -4"}),h("path",{d:"M12 3l0 18"}))},horizontal:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 8l-4 4l4 4"}),h("path",{d:"M17 8l4 4l-4 4"}),h("path",{d:"M3 12l18 0"}))},book:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h("path",{d:"M3 6l0 13"}),h("path",{d:"M12 6l0 13"}),h("path",{d:"M21 6l0 13"}))},book2:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z"}),h("path",{d:"M19 16h-12a2 2 0 0 0 -2 2"}),h("path",{d:"M9 8h6"}))},squares:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 10a2 2 0 0 1 2 -2h9a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-9a2 2 0 0 1 -2 -2z"}),h("path",{d:"M16 8v-3a2 2 0 0 0 -2 -2h-9a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h3"}))},listTree:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 6h11"}),h("path",{d:"M12 12h8"}),h("path",{d:"M15 18h5"}),h("path",{d:"M5 6v.01"}),h("path",{d:"M8 12v.01"}),h("path",{d:"M11 18v.01"}))},paperclip:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5"}))},rubberStamp:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 1 1 8 0c0 2.21 -4 6.8 1.21 6.8c2.369 0 3.79 0 3.79 4.05"}),h("path",{d:"M5 21h14"}))},rubberStampPlus:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 0 1 4.9 -4.1"}),h("path",{d:"M16 10c0 1.2 -4 3.8 1.21 3.8c2.369 0 3.79 0 3.79 4.05"}),h("path",{d:"M5 21h14"}),h("path",{d:"M16 5h6"}),h("path",{d:"M19 2v6"}))},copy:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"}),h("path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"}))},underline:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 20h16",stroke:a}),h("path",{d:"M8 16v-8a4 4 0 1 1 8 0v8",stroke:"currentColor"}),h("path",{d:"M8 10h8",stroke:"currentColor"}))},squiggly:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 16v-8a4 4 0 1 1 8 0v8",stroke:"currentColor"}),h("path",{d:"M8 10h8",stroke:"currentColor"}),h("path",{d:"M4 20c1.5 -1.5 3.5 -1.5 5 0s3.5 1.5 5 0 3.5 -1.5 5 0",stroke:a}))},strikethrough:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 16v-8a4 4 0 1 1 8 0v8",stroke:"currentColor"}),h("path",{d:"M4 10h16",stroke:a}))},highlight:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("rect",{x:"2",y:"6",width:"20",height:"16",rx:"2",fill:a,stroke:"none"}),h("path",{d:"M8 16v-8a4 4 0 1 1 8 0v8",stroke:"currentColor"}),h("path",{d:"M8 10h8",stroke:"currentColor"}))},palette:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25"}),h("path",{d:"M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),h("path",{d:"M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),h("path",{d:"M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}))},x:hv,fileImport:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h("path",{d:"M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3"}))},hand:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),h("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),h("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),h("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"}))},zoomInArea:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 13v4"}),h("path",{d:"M13 15h4"}),h("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),h("path",{d:"M22 22l-3 -3"}),h("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),h("path",{d:"M3 11v-1"}),h("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),h("path",{d:"M10 3h1"}),h("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"}))},screenshot:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 19a2 2 0 0 1 -2 -2"}),h("path",{d:"M5 13v-2"}),h("path",{d:"M5 7a2 2 0 0 1 2 -2"}),h("path",{d:"M11 5h2"}),h("path",{d:"M17 5a2 2 0 0 1 2 2"}),h("path",{d:"M19 11v2"}),h("path",{d:"M19 17v4"}),h("path",{d:"M21 19h-4"}),h("path",{d:"M13 19h-2"}))},arrowBackUp:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 14l-4 -4l4 -4"}),h("path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"}))},arrowForwardUp:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 14l4 -4l-4 -4"}),h("path",{d:"M19 10h-11a4 4 0 1 0 0 8h1"}))},trash:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 7l16 0"}),h("path",{d:"M10 11l0 6"}),h("path",{d:"M14 11l0 6"}),h("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),h("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"}))},deviceFloppy:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"}),h("path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M14 4l0 4l-6 0l0 -4"}))},pencilMarker:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":i,class:e.className,role:"img","aria-label":e.title},h("path",{d:"m9.109 16.275 8.856-8.097c.812-.743.87-2.014.127-2.826s-2.014-.869-2.826-.127L6.41 13.322l-.127 2.826zM13.79 6.575l2.7 2.952",stroke:"currentColor"}),h("path",{stroke:a,d:"M19.375 20.125c.569.063-4.05-.562-6.412-.437s-4.759 1.229-6.857 1.625c-1.764.687-3.404-.938-1.981-2.5"}))},circle:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:s===void 0?"none":s,stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}))},square:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:s===void 0?"none":s,stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"}))},line:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2.2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M20 4l-16 16"}))},lineArrow:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2.2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M20 4l-16 16"}),h("path",{d:"M16 3h5v5"}))},polygon:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:s===void 0?"none":s,stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M13.163 2.168l8.021 5.828c.694 .504 .984 1.397 .719 2.212l-3.064 9.43a1.978 1.978 0 0 1 -1.881 1.367h-9.916a1.978 1.978 0 0 1 -1.881 -1.367l-3.064 -9.43a1.978 1.978 0 0 1 .719 -2.212l8.021 -5.828a1.978 1.978 0 0 1 2.326 0z"}))},zigzag:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{d:"M12 2.4L21.36 11.76L2.64 12.24L12 21.6"}))},text:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0"}),h("path",{d:"M14 19v-10.5a3.5 3.5 0 0 1 7 0v10.5"}),h("path",{d:"M14 13h7"}),h("path",{d:"M10 12v7"}))},italic:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11 5l6 0"}),h("path",{d:"M7 19l6 0"}),h("path",{d:"M14 5l-4 14"}))},bold:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),h("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"}))},alignLeft:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 6l16 0"}),h("path",{d:"M4 12l10 0"}),h("path",{d:"M4 18l14 0"}))},alignCenter:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 6l16 0"}),h("path",{d:"M8 12l8 0"}),h("path",{d:"M6 18l12 0"}))},alignRight:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 6l16 0"}),h("path",{d:"M10 12l10 0"}),h("path",{d:"M6 18l14 0"}))},alignTop:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"}),h("path",{d:"M11 13h2"}),h("path",{d:"M9 10h6"}),h("path",{d:"M10 7h4"}))},alignMiddle:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"}),h("path",{d:"M11 15h2"}),h("path",{d:"M9 12h6"}),h("path",{d:"M10 9h4"}))},alignBottom:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"}),h("path",{d:"M11 17h2"}),h("path",{d:"M9 14h6"}),h("path",{d:"M10 11h4"}))},photo:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 8h.01"}),h("path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"}),h("path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"}),h("path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"}))},pointer:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563z"}))},redact:mv,redactArea:pv,redactCombined:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.secondaryColor,l=s===void 0?"currentColor":s;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 20h-1a2 2 0 0 1 -2 -2v-1"}),h("path",{d:"M3 13v-3"}),h("path",{d:"M20 13v-3"}),h("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),h("path",{d:"M10 3h3"}),h("path",{d:"M17 3h1a2 2 0 0 1 2 2v1"}),h("path",{d:"M8 8h8"}),h("path",{d:"M12 8v7"}),h("defs",null,h("clipPath",{id:"redactCombinedClip"},h("rect",{x:"10",y:"18",width:"13",height:"6",rx:"2"}))),h("rect",{x:"10",y:"17",width:"13",height:"6",rx:"2",fill:"none"}),h("g",{"clip-path":"url(#redactCombinedClip)",stroke:l},h("path",{d:"M6 19l12 -12"}),h("path",{d:"M6 23l12 -12"}),h("path",{d:"M10 23l12 -12"}),h("path",{d:"M14 27l12 -12"}),h("path",{d:"M14 23l12 -12"})))},check:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 12l5 5l10 -10"}))},file:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.className,l=e.title;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:s,"aria-hidden":!l,role:l?"img":"presentation"},l&&h("title",null,l),h("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h("polyline",{points:"14 2 14 8 20 8"}))},plus:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r,s=e.className,l=e.title;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:a,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:s,"aria-hidden":!l,role:l?"img":"presentation"},l&&h("title",null,l),h("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),h("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))},lock:function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),h("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))},unlock:function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),h("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"}))},alertTriangle:function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),h("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),h("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))},eye:function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),h("circle",{cx:"12",cy:"12",r:"3"}))},"eye-off":function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),h("line",{x1:"1",y1:"1",x2:"23",y2:"23"}))},info:function(e){var t=e.size,n=t===void 0?24:t,o=e.className;return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o===void 0?"":o,style:e.style},h("circle",{cx:"12",cy:"12",r:"10"}),h("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),h("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"}))},link:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 15l6 -6"}),h("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),h("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}))},linkOff:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 15l3 -3m2 -2l1 -1"}),h("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.072 7.071l-.534 .464"}),h("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}),h("path",{d:"M3 3l18 18"}))},externalLink:function(e){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e.className},h("path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6"}),h("path",{d:"M11 13l9 -9"}),h("path",{d:"M15 4h5v5"}))},marqueeSelect:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M17 20h6"}),h("path",{d:"M20 17v6"}),h("path",{d:"M4 13v-2"}),h("path",{d:"M4 6v-1a1 1 0 0 1 1 -1h1"}),h("path",{d:"M6 20h-1a1 1 0 0 1 -1 -1v-1"}),h("path",{d:"M11 4h2"}),h("path",{d:"M11 20h2"}),h("path",{d:"M18 4h1a1 1 0 0 1 1 1v1"}),h("path",{d:"M20 11v2"}))},group:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M17 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M3 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M17 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M5 7v10"}),h("path",{d:"M19 7v10"}),h("path",{d:"M7 5h10"}),h("path",{d:"M7 19h10"}),h("path",{d:"M8 8H12.8V11.2H16V16H11.2V12.8H8V8Z"}))},ungroup:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),h("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"}))},redactionSidebar:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),h("path",{d:"M15 4v16"}),h("path",{d:"M7 8h5"}),h("path",{d:"M7 11h5"}),h("path",{d:"M7 14h4"}))},freeText:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 7v-2h12v2"}),h("path",{d:"M10 5v14"}),h("path",{d:"M12 19h-4"}),h("path",{d:"M15 13v-1h6v1"}),h("path",{d:"M18 12v7"}),h("path",{d:"M17 19h2"}))},insertText:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 7v-2h12v2"}),h("path",{d:"M9 5v14"}),h("path",{d:"M7 19h4"}),h("path",{d:"M18 15l2 2h-5"}),h("path",{d:"M18 19l2 -2"}))},replaceText:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 7v-2h12v2"}),h("path",{d:"M9 5v14"}),h("path",{d:"M7 19h4"}),h("g",{transform:"translate(-1, -3) rotate(180 19 18)"},h("path",{d:"M20 14l2 2h-3"}),h("path",{d:"M20 18l2 -2"}),h("path",{d:"M19 16a3 3 0 1 0 2 5.236"})))},message:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 9h8",stroke:"currentColor"}),h("path",{d:"M8 13h6",stroke:"currentColor"}),h("path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"}))},inkHighlighter:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor,a=r===void 0?"currentColor":r;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":i,class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{stroke:"currentColor",d:"M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),h("path",{stroke:"currentColor",d:"M12.5 5.5l4 4"}),h("path",{stroke:"currentColor",d:"M4.5 13.5l4 4"}),h("path",{stroke:a,fill:a,d:"M21 15v4h-8l4 -4l4 0"}))},formCheckbox:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14"}),h("path",{d:"M9 12l2 2l4 -4"}))},formRadio:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 12a2 2 0 1 0 6 0a2 2 0 1 0 -6 0",fill:"currentColor"}),h("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}))},formSelect:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14"}),h("path",{d:"M9 11l3 3l3 -3"}))},formListbox:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14"}),h("path",{d:"M11 8h6"}),h("path",{d:"M11 12h6"}),h("path",{d:"M11 16h6"}),h("path",{d:"M7 8l0 .01"}),h("path",{d:"M7 12l0 .01"}),h("path",{d:"M7 16l0 .01"}))},formTextfield:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"
2291stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3"}),h("path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3"}),h("path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7"}),h("path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1"}),h("path",{d:"M17 12h.01"}),h("path",{d:"M13 12h.01"}))},widgetEdit:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"}),h("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415"}),h("path",{d:"M16 5l3 3"}))},signature:function(e){var t=e.size,n=t===void 0?24:t,o=e.strokeWidth,i=o===void 0?2:o,r=e.primaryColor;return h("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r===void 0?"currentColor":r,"stroke-width":i,"stroke-linecap":"round","stroke-linejoin":"round",class:e.className,role:"img","aria-label":e.title},h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 17c3.333 -3.333 5 -6 5 -8c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 4.877 2.5 6c1.5 2 2.5 2.5 3.5 1l2 -3c.333 2.667 1.333 4 3 4c.53 0 2.639 -2 3 -2c.517 0 1.517 .667 3 2"}))}},ss=new Map,qk=/^[MmZzLlHhVvCcSsQqTtAa0-9\s,.\-eE]+$/;function Kk(e){return qk.test(e.trim())}function hl(e,t){for(var n=(function(r){var a,s;return"path"in r?{viewBox:r.viewBox||"0 0 24 24",paths:[{d:r.path,stroke:(a=r.stroke)!==null&&a!==void 0?a:"primary",fill:(s=r.fill)!==null&&s!==void 0?s:"none",strokeWidth:r.strokeWidth}],strokeLinecap:r.strokeLinecap||"round",strokeLinejoin:r.strokeLinejoin||"round",strokeWidth:r.strokeWidth}:{viewBox:r.viewBox||"0 0 24 24",paths:r.paths,strokeLinecap:r.strokeLinecap||"round",strokeLinejoin:r.strokeLinejoin||"round",strokeWidth:r.strokeWidth}})(t),o=0;o<n.paths.length;o++){var i=n.paths[o];if(!i.d||!Kk(i.d))throw new Error('Invalid path data for icon "'.concat(e,'" at path index ').concat(o,". ")+"Path must only contain valid SVG path commands.")}ss.set(e,n)}function ls(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var o=q(n[t],2);hl(o[0],o[1])}}function eu(e,t,n){return e&&e!=="none"?e==="primary"?t:e==="secondary"?n:e==="currentColor"?"currentColor":e:"none"}function ye(e){var t,n=e.icon,o=e.title,i=e.size,r=i===void 0?24:i,a=e.strokeWidth,s=a===void 0?2:a,l=e.primaryColor,c=l===void 0?"currentColor":l,d=e.secondaryColor,u=d===void 0?"currentColor":d,m=e.className,g=Gk[n];if(g)return h(g,{size:r,strokeWidth:s,primaryColor:c,secondaryColor:u,className:m,title:o});if(t=n,ss.has(t)){var p=(function(f){return ss.get(f)})(n);return(function(f,v){var y,b=v.size,w=v.strokeWidth,x=v.primaryColor,C=v.secondaryColor,I=v.className,S=v.title,P=(y=f.strokeWidth)!==null&&y!==void 0?y:w;return h("svg",{width:b,height:b,viewBox:f.viewBox,"stroke-linecap":f.strokeLinecap,"stroke-linejoin":f.strokeLinejoin,class:I,role:"img","aria-label":S},f.paths.map(function(A,D){var R,M=eu(A.stroke,x,C),N=eu(A.fill,x,C),z=(R=A.strokeWidth)!==null&&R!==void 0?R:P;return h("path",{key:D,d:A.d,stroke:M,fill:N,"stroke-width":M!=="none"?z:void 0,opacity:A.opacity})}))})(p,{size:r,strokeWidth:s,primaryColor:c,secondaryColor:u,className:m,title:o})}return console.warn("Icon not found: ".concat(n)),null}var Vk=["id","children","onClick","active","disabled","className","tooltip","elementRef"];function Je(e){var t=e.id,n=e.children,o=e.onClick,i=e.active,r=i!==void 0&&i,a=e.disabled,s=a!==void 0&&a,l=e.className,c=l===void 0?"":l,d=e.tooltip,u=e.elementRef,m=Cr(e,Vk);return h("button",B({id:t,ref:u,onClick:o,className:"flex h-[32px] w-auto min-w-[32px] items-center justify-center rounded-md p-[5px] transition-colors ".concat(r?"bg-interactive-selected text-accent ring-accent border-none shadow ring":"hover:bg-interactive-hover hover:ring-accent hover:ring"," ").concat(s?"cursor-not-allowed opacity-50 hover:bg-transparent hover:ring-0":"cursor-pointer"," ").concat(c),title:d},m),n)}const To=Math.min,Vn=Math.max,br=Math.round,qi=Math.floor,en=e=>({x:e,y:e}
2291),Xk={left:"right",right:"left",bottom:"top",top:"bottom"},Zk={start:"end",end:"start"};function cs(e,t,n){return Vn(e,To(t,n))}function Ii(e,t){return typeof e=="function"?e(t):e}function no(e){return e.split("-")[0]}function Si(e){return e.split("-")[1]}function gv(e){return e==="x"?"y":"x"}function ml(e){return e==="y"?"height":"width"}const Yk=new Set(["top","bottom"]);function Rn(e){return Yk.has(no(e))?"y":"x"}function pl(e){return gv(Rn(e))}function ds(e){return e.replace(/start|end/g,t=>Zk[t])}const tu=["left","right"],nu=["right","left"],Qk=["top","bottom"],Jk=["bottom","top"];function eC(e,t,n,o){const i=Si(e);let r=(function(a,s,l){switch(a){case"top":case"bottom":return l?s?nu:tu:s?tu:nu;case"left":case"right":return s?Qk:Jk;default:return[]}})(no(e),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),t&&(r=r.concat(r.map(ds)))),r}function Ki(e){return e.replace(/left|right|bottom|top/g,t=>Xk[t])}function fv(e){return typeof e!="number"?(function(t){return{top:0,right:0,bottom:0,left:0,...t}})(e):{top:e,right:e,bottom:e,left:e}}function wr(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function ou(e,t,n){let{reference:o,floating:i}=e;const r=Rn(t),a=pl(t),s=ml(a),l=no(t),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let g;switch(l){case"top":g={x:d,y:o.y-i.height};break;case"bottom":g={x:d,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:u};break;case"left":g={x:o.x-i.width,y:u};break;default:g={x:o.x,y:o.y}}switch(Si(t)){case"start":g[a]-=m*(n&&c?-1:1);break;case"end":g[a]+=m*(n&&c?-1:1)}return g}async function tC(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:g=0}=Ii(t,e),p=fv(g),f=s[m?u==="floating"?"reference":"floating":u],v=wr(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(f)))==null||n?f:f.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),w=await(r.isElement==null?void 0:r.isElement(b))&&await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1},x=wr(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(v.top-x.top+p.top)/w.y,bottom:(x.bottom-v.bottom+p.bottom)/w.y,left:(v.left-x.left+p.left)/w.x,right:(x.right-v.right+p.right)/w.x}}const nC=new Set(["left","top"]);function Zr(){return typeof window<"u"}function Ro(e){return vv(e)?(e.nodeName||"").toLowerCase():"#document"}function Tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tn(e){var t;return(t=(vv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vv(e){return!!Zr()&&(e instanceof Node||e instanceof Tt(e).Node)}function qt(e){return!!Zr()&&(e instanceof Element||e instanceof Tt(e).Element)}function on(e){return!!Zr()&&(e instanceof HTMLElement||e instanceof Tt(e).HTMLElement)}function iu(e){return!(!Zr()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof Tt(e).ShadowRoot)}const oC=new Set(["inline","contents"]);function hi(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!oC.has(i)}const iC=new Set(["table","td","th"]);function rC(e){return iC.has(Ro(e))}const aC=[":popover-open",":modal"];function xr(e){return aC.some(t=>{try{return e.matches(t)}catch{return!1}})}const sC=["transform","translate","scale","rotate","perspective"],lC=["transform","translate","scale","rotate","perspective","filter"],cC=["paint","layout","strict","content"];function us(e){const t=gl(),n=qt(e)?Kt(e):e;return sC.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||lC.some(o=>(n.willChange||"").includes(o))||cC.some(o=>(n.contain||"").includes(o))}function gl(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const dC=new Set(["html","body","#document"]);function Co(e){return dC.has(Ro(e))}function Kt(e){return Tt(e).getComputedStyle(e)}function Yr(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function En(e){if(Ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iu(e)&&e.host||tn(e);return iu(t)?t.host:t}function yv(e){const t=En(e);return Co(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&hi(t)?t:yv(t)}
2291function mi(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=yv(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),a=Tt(i);if(r){const s=hs(a);return t.concat(a,a.visualViewport||[],hi(i)?i:[],s&&n?mi(s):[])}return t.concat(i,mi(i,[],n))}function hs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bv(e){const t=Kt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=on(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,s=br(n)!==r||br(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function fl(e){return qt(e)?e:e.contextElement}function Io(e){const t=fl(e);if(!on(t))return en(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=bv(t);let a=(r?br(n.width):n.width)/o,s=(r?br(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const uC=en(0);function wv(e){const t=Tt(e);return gl()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:uC}function oo(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=fl(e);let a=en(1);t&&(o?qt(o)&&(a=Io(o)):a=Io(e));const s=(function(m,g,p){return g===void 0&&(g=!1),!(!p||g&&p!==Tt(m))&&g})(r,n,o)?wv(r):en(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(r){const m=Tt(r),g=o&&qt(o)?Tt(o):o;let p=m,f=hs(p);for(;f&&o&&g!==p;){const v=Io(f),y=f.getBoundingClientRect(),b=Kt(f),w=y.left+(f.clientLeft+parseFloat(b.paddingLeft))*v.x,x=y.top+(f.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=w,c+=x,p=Tt(f),f=hs(p)}}return wr({width:d,height:u,x:l,y:c})}function kr(e,t){const n=Yr(e).scrollLeft;return t?t.left+n:oo(tn(e)).left+n}function xv(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-kr(e,n),y:n.top+t.scrollTop}}const hC=new Set(["absolute","fixed"]);function ru(e,t,n){let o;if(t==="viewport")o=(function(i,r){const a=Tt(i),s=tn(i),l=a.visualViewport;let c=s.clientWidth,d=s.clientHeight,u=0,m=0;if(l){c=l.width,d=l.height;const p=gl();(!p||p&&r==="fixed")&&(u=l.offsetLeft,m=l.offsetTop)}const g=kr(s);if(g<=0){const p=s.ownerDocument,f=p.body,v=getComputedStyle(f),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(s.clientWidth-f.clientWidth-y);b<=25&&(c-=b)}else g<=25&&(c+=g);return{width:c,height:d,x:u,y:m}})(e,n);else if(t==="document")o=(function(i){const r=tn(i),a=Yr(i),s=i.ownerDocument.body,l=Vn(r.scrollWidth,r.clientWidth,s.scrollWidth,s.clientWidth),c=Vn(r.scrollHeight,r.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+kr(i);const u=-a.scrollTop;return Kt(s).direction==="rtl"&&(d+=Vn(r.clientWidth,s.clientWidth)-l),{width:l,height:c,x:d,y:u}})(tn(e));else if(qt(t))o=(function(i,r){const a=oo(i,!0,r==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,c=on(i)?Io(i):en(1);return{width:i.clientWidth*c.x,height:i.clientHeight*c.y,x:l*c.x,y:s*c.y}})(t,n);else{const i=wv(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return wr(o)}function kv(e,t){const n=En(e);return!(n===t||!qt(n)||Co(n))&&(Kt(n).position==="fixed"||kv(n,t))}function mC(e,t,n){const o=on(t),i=tn(t),r=n==="fixed",a=oo(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=en(0);function c(){l.x=kr(i)}if(o||!o&&!r)if((Ro(t)!=="body"||hi(i))&&(s=Yr(t)),o){const u=oo(t,!0,r,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&c();r&&!o&&i&&c();const d=!i||o||r?en(0):xv(i,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Pa(e){return Kt(e).position==="static"}function au(e,t){if(!on(e)||Kt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tn(e)===n&&(n=n.ownerDocument.body),n}function su(e,t){const n=Tt(e);if(xr(e))return n;if(!on(e)){let i=En(e);for(;i&&!Co(i);){if(qt(i)&&!Pa(i))return i;i=En(i)}return n}let o=au(e,t);for(;o&&rC(o)&&Pa(o);)o=au(o,t);return o&&Co(o)&&Pa(o)&&!us(o)?n:o||(function(i){let r=En(i);for(;on(r)&&!Co(r);){if(us(r))return r;if(xr(r))return null;r=En(r)}return null})(e)||n}const pC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",a=tn(o),s=!!t&&xr(t.floating);if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=en(1);const d=en(0),u=on(o);if((u||!u&&!r)&&((Ro(o)!=="body"||hi(a))&&(l=Yr(o)),on(o))){const g=oo(o);c=Io(o),d.x=g.x+o.clientLeft,d.y=g.y+o.clientTop}const m=!a||u||r?en(0):xv(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}},getDocumentElement:tn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?xr(t)?[]:(function(l,c){const d=c.get(l);if(d)return d;let u=mi(l,[],!1).filter(f=>qt(f)&&Ro(f)!=="body"),m=null;const g=Kt(l).position==="fixed";let p=g?En(l):l;for(;qt(p)&&!Co(p);){const f=Kt(p),v=us(p);v||f.position!=="fixed"||(m=null),(g?!v&&!m:!v&&f.position==="static"&&m&&hC.has(m.position)||hi(p)&&!v&&kv(l,p))?u=u.filter(y=>y!==p):m=f,p=En(p)}return c.set(l,u),u})(t,this._c):[].concat(n),o],a=r[0],s=r.reduce((l,c)=>{const d=ru(t,c,i);return l.top=Vn(d.top,l.top),l.right=To(d.right,l.right),l.bottom=To(d.bottom,l.bottom),l.left=Vn(d.left,l.left),l},ru(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:su,getElementRects:async function(e){const t=this.getOffsetParent||su,n=this.getDimensions,o=await n(e.floating);return{reference:mC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bv(e);return{width:t,height:n}},getScale:Io,isElement:qt,isRTL:function(e){return Kt(e).direction==="rtl"}};function lu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gC(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=fl(e),d=i||r?[...c?mi(c):[],...mi(t)]:[];d.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),r&&v.addEventListener("resize",n)});const u=c&&s?(function(v,y){let b,w=null;const x=tn(v);function C(){var I;clearTimeout(b),(I=w)==null||I.disconnect(),w=null}return(function I(S,P){S===void 0&&(S=!1),P===void 0&&(P=1),C();const A=v.getBoundingClientRect(),{left:D,top:R,width:M,height:N}=A;if(S||y(),!M||!N)return;const z={rootMargin:-qi(R)+"px "+-qi(x.clientWidth-(D+M))+"px "+-qi(x.clientHeight-(R+N))+"px "+-qi(D)+"px",threshold:Vn(0,To(1,P))||1};let _=!0;function L(j){const E=j[0].intersectionRatio;if(E!==P){if(!_)return I();E?I(!1,E):b=setTimeout(()=>{I(!1,1e-7)},1e3)}E!==1||lu(A,v.getBoundingClientRect())||I(),_=!1}try{w=new IntersectionObserver(L,{...z,root:x.ownerDocument})}catch{w=new IntersectionObserver(L,z)}w.observe(v)})(!0),C})(c,n):null;let m,g=-1,p=null;a&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let f=l?oo(e):null;return l&&(function v(){const y=oo(e);f&&!lu(f,y)&&n(),f=y,m=requestAnimationFrame(v)})(),n(),()=>{var v;d.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),u?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const fC=function(e){return{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=t,l=await(async function(c,d){const{placement:u,platform:m,elements:g}=c,p=await(m.isRTL==null?void 0:m.isRTL(g.floating)),f=no(u),v=Si(u),y=Rn(u)==="y",b=nC.has(f)?-1:1,w=p&&y?-1:1,x=Ii(d,c);let{mainAxis:C,crossAxis:I,alignmentAxis:S}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}
2291:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return v&&typeof S=="number"&&(I=v==="end"?-1*S:S),y?{x:I*w,y:C*b}:{x:C*b,y:I*w}})(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}},vC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:r}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=Ii(e,t),d={x:n,y:o},u=await r.detectOverflow(t,c),m=Rn(no(i)),g=gv(m);let p=d[g],f=d[m];if(a){const y=g==="y"?"bottom":"right";p=cs(p+u[g==="y"?"top":"left"],p,p-u[y])}if(s){const y=m==="y"?"bottom":"right";f=cs(f+u[m==="y"?"top":"left"],f,f-u[y])}const v=l.fn({...t,[g]:p,[m]:f});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:a,[m]:s}}}}}},yC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:f=!0,...v}=Ii(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=no(i),b=Rn(s),w=no(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(w||!f?[Ki(s)]:(function(z){const _=Ki(z);return[ds(z),_,ds(_)]})(s)),I=p!=="none";!m&&I&&C.push(...eC(s,f,p,x));const S=[s,...C],P=await l.detectOverflow(t,v),A=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&A.push(P[y]),u){const z=(function(_,L,j){j===void 0&&(j=!1);const E=Si(_),F=pl(_),X=ml(F);let Q=F==="x"?E===(j?"end":"start")?"right":"left":E==="start"?"bottom":"top";return L.reference[X]>L.floating[X]&&(Q=Ki(Q)),[Q,Ki(Q)]})(i,a,x);A.push(P[z[0]],P[z[1]])}if(D=[...D,{placement:i,overflows:A}],!A.every(z=>z<=0)){var R,M;const z=(((R=r.flip)==null?void 0:R.index)||0)+1,_=S[z];if(_&&(!(u==="alignment"&&b!==Rn(_))||D.every(j=>Rn(j.placement)!==b||j.overflows[0]>0)))return{data:{index:z,overflows:D},reset:{placement:_}};let L=(M=D.filter(j=>j.overflows[0]<=0).sort((j,E)=>j.overflows[1]-E.overflows[1])[0])==null?void 0:M.placement;if(!L)switch(g){case"bestFit":{var N;const j=(N=D.filter(E=>{if(I){const F=Rn(E.placement);return F===b||F==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(F=>F>0).reduce((F,X)=>F+X,0)]).sort((E,F)=>E[1]-F[1])[0])==null?void 0:N[0];j&&(L=j);break}case"initialPlacement":L=s}if(i!==L)return{reset:{placement:L}}}return{}}}},bC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Ii(e,t)||{};if(c==null)return{};const u=fv(d),m={x:n,y:o},g=pl(i),p=ml(g),f=await a.getDimensions(c),v=g==="y",y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=r.reference[p]+r.reference[g]-m[g]-r.floating[p],C=m[g]-r.reference[g],I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let S=I?I[w]:0;S&&await(a.isElement==null?void 0:a.isElement(I))||(S=s.floating[w]||r.floating[p]);const P=x/2-C/2,A=S/2-f[p]/2-1,D=To(u[y],A),R=To(u[b],A),M=D,N=S-f[p]-R,z=S/2-f[p]/2+P,_=cs(M,z,N),L=!l.arrow&&Si(i)!=null&&z!==_&&r.reference[p]/2-(z<M?D:R)-f[p]/2<0,j=L?z<M?z-M:z-N:0;return{[g]:m[g]+j,data:{[g]:_,centerOffset:z-_-j,...L&&{alignmentOffset:j}},reset:L}}}),wC=(e,t,n)=>{const o=new Map,i={platform:pC,...n},r={...i.platform,_c:o};return(async(a,s,l)=>{const{placement:c="bottom",strategy:d="absolute",middleware:u=[],platform:m}=l,g=u.filter(Boolean),p=await(m.isRTL==null?void 0:m.isRTL(s));let f=await m.getElementRects({reference:a,floating:s,strategy:d}),{x:v,y}=ou(f,c,p),b=c,w={},x=0;for(let I=0;I<g.length;I++){var C;const{name:S,fn:P}=g[I],{x:A,y:D,data:R,reset:M}=await P({x:v,y,initialPlacement:c,placement:b,strategy:d,middlewareData:w,rects:f,platform:{...m,detectOverflow:(C=m.detectOverflow)!=null?C:tC},elements:{reference:a,floating:s}});v=A??v,y=D??y,w={...w,[S]:{...w[S],...R}},M&&x<=50&&(x++,typeof M=="object"&&(M.placement&&(b=M.placement),M.rects&&(f=M.rects===!0?await m.getElementRects({reference:a,floating:s,strategy:d}):M.rects),{x:v,y}=ou(f,b,p)),I=-1)}return{x:v,y,placement:b,strategy:d,middlewareData:w}})(e,t,{...i,platform:r})};var xC=(function(){function e(){return ys(this,e),Pu(this,e,arguments)}return Mu(e,Jt),bs(e,[{key:"render",value:function(){return this.props.children}}])})();function kC(e){var t=e.children,n=e.content,o=e.position,i=o===void 0?"top":o,r=e.className,a=r===void 0?"":r,s=e.delay,l=s===void 0?200:s,c=e.style,d=c===void 0?"dark":c,u=e.trigger,m=u===void 0?"hover":u,g=K(null),p=K(null),f=K(null),v=q(O(!1),2),y=v[0],b=v[1],w=K(null);return $(function(){var x;if((x=g.current)!==null&&x!==void 0&&x.base&&p.current)return gC(g.current.base,p.current,function(){wC(g.current.base,p.current,{placement:i,middleware:[fC(8),yC(),vC({padding:8}),bC({element:f.current,padding:6}
2291)]}).then(function(C){var I,S=C.x,P=C.y,A=C.placement,D=C.middlewareData;Object.assign(p.current.style,{left:"".concat(S,"px"),top:"".concat(P,"px")});var R=(I=D.arrow)!==null&&I!==void 0?I:{},M=R.x,N=R.y,z={top:"bottom",bottom:"top",left:"right",right:"left"}[A.split("-")[0]];Object.assign(f.current.style,ee({left:M!=null?"".concat(M,"px"):"",top:N!=null?"".concat(N,"px"):"",right:"",bottom:""},z,"-4px"))})})},[i,y]),$(function(){var x,C=(x=g.current)===null||x===void 0?void 0:x.base,I=p.current;if(C&&I){var S=function(){w.current&&clearTimeout(w.current)},P=function(){S(),w.current=setTimeout(function(){return b(!0)},l)},A=function(){S(),b(!1)},D=function(){return b(function(R){return!R})};return m==="hover"?(C.addEventListener("mouseenter",P),C.addEventListener("mouseleave",A),I.addEventListener("mouseenter",P),I.addEventListener("mouseleave",A),C.addEventListener("pointerdown",A)):m==="click"&&C.addEventListener("click",D),m==="none"&&(w.current&&clearTimeout(w.current),b(!1)),function(){S(),m==="hover"?(C.removeEventListener("mouseenter",P),C.removeEventListener("mouseleave",A),I.removeEventListener("mouseenter",P),I.removeEventListener("mouseleave",A),C.removeEventListener("pointerdown",A)):m==="click"&&C.removeEventListener("click",D)}}},[m,l]),h(de,null,h("div",{ref:p,role:"tooltip",className:"z-100 pointer-events-none absolute select-none whitespace-nowrap rounded-lg px-3 py-2 text-sm shadow-md transition-opacity duration-150 ".concat(d==="dark"?"bg-tooltip-bg text-tooltip-fg":"border-border-subtle bg-bg-elevated text-fg-primary border"," ").concat(y?"opacity-100":"opacity-0"," ").concat(a," "),style:{visibility:y?"visible":"hidden"}},n,h("div",{ref:f,className:"absolute h-2 w-2 rotate-45 bg-inherit ".concat(d==="light"?"border-border-subtle border":""," ")})),h(xC,{ref:g},t))}function Xn(e){var t=e.commandId,n=e.documentId,o=e.variant,i=o===void 0?"icon":o,r=e.itemId,a=e.className,s=Gt(t,n),l=vm(n,r||t);if(!s||!s.visible)return null;var c=s.iconProps||{};return h(kC,{content:s.label,position:"bottom",delay:500,trigger:s.active||s.disabled?"none":"hover"},h(Je,{elementRef:l,onClick:function(){s.disabled||s.execute()},active:s.active,disabled:s.disabled,className:a||"p-1","aria-label":s.label},i==="text"?h("span",{className:"text-sm"},s.label):i==="icon-text"?h("span",{className:"flex items-center whitespace-nowrap"},s.icon&&h(ye,{icon:s.icon,className:"mr-1.5 h-5 w-5 flex-shrink-0",primaryColor:c.primaryColor,secondaryColor:c.secondaryColor}),h("span",null,s.label)):i==="tab"?h("span",{className:"px-3 py-1"},s.label):s.icon?h(ye,{icon:s.icon,className:Ci("h-5 w-5",c.className),primaryColor:c.primaryColor,secondaryColor:c.secondaryColor}):h("span",null,s.label)))}function CC(e){var t=e.schema,n=e.documentId,o=e.isOpen,i=e.className,r=i===void 0?"":i;if(!o)return null;var a=t.position.slot==="secondary",s=(function(l){switch(l){case"top":return"border-b border-border-default bg-bg-surface px-4 py-2";case"bottom":return"border-t border-border-default bg-bg-surface px-4 py-2";case"left":return"border-r border-border-default bg-bg-surface px-2 py-3 flex-col";case"right":return"border-l border-border-default bg-bg-surface px-2 py-3 flex-col"}})(t.position.placement);return h("div",B({className:Ci("flex items-center gap-2",s,a?"bg-bg-surface-alt":"",r)},it(t)),t.items.map(function(l){return h(Cv,{key:l.id,item:l,documentId:n})}))}function Cv(e){var t=e.item,n=e.documentId;switch(t.type){case"command-button":return h(IC,{item:t,documentId:n});case"tab-group":return h(SC,{item:t,documentId:n});case"divider":return h(PC,{item:t});case"spacer":return h(MC,{item:t});case"group":return h(DC,{item:t,documentId:n});case"custom":return h(TC,{item:t,documentId:n});default:return console.warn("Unknown toolbar item type:",t),null}}function IC(e){var t=e.item,n=e.documentId;return h("div",B({},it(t)),h(Xn,{commandId:t.commandId,documentId:n,itemId:t.id,variant:t.variant}))}function SC(e){var t=e.item,n=e.documentId;return h("div",B(B({className:"flex items-center gap-2"},it(t)),{},{role:"tablist"}),t.tabs.map(function(o){return h(AC,{key:o.id,tab:o,documentId:n})}))}function AC(e){var t=e.tab,n=e.documentId,o=Gt(t.commandId,n),i=vm(n,t.id);return!o||!o.visible?null:h("div",B({}
vendor: 21,832 bytes, line 2291
2291,it(t)),h(as,{anchorRef:i,active:o.active,onClick:function(){o.disabled||o.execute()},disabled:o.disabled},t.variant==="text"&&o.label,t.variant==="icon"&&o.icon&&h(cu,{icon:o.icon,iconProps:o.iconProps}),t.variant==="icon-text"&&h(de,null,o.icon&&h(cu,{icon:o.icon,iconProps:o.iconProps}),o.label)))}function cu(e){var t=e.icon,n=e.iconProps;return h(ye,{icon:t,className:"h-5 w-5",primaryColor:n?.primaryColor,secondaryColor:n?.secondaryColor})}function PC(e){var t=e.item;return h("div",B({},it(t)),h("div",{className:t.orientation==="vertical"?"bg-border-default h-6 w-px":"bg-border-default h-px w-6","aria-hidden":"true"}))}function MC(e){var t=e.item;return h("div",B(B({className:t.flex?"flex-1":"w-4"},it(t)),{},{"aria-hidden":"true"}))}function DC(e){var t=e.item,n=e.documentId,o=t.gap?"gap-".concat(t.gap):"gap-2",i=(function(r){switch(r){case"start":default:return"justify-start";case"center":return"justify-center";case"end":return"justify-end"}})(t.alignment);return h("div",B({className:Ci("flex items-center",o,i)},it(t)),t.items.map(function(r){return h(Cv,{key:r.id,item:r,documentId:n})}))}function TC(e){var t=e.item,n=e.documentId,o=Fr().renderCustomComponent;return h("div",B({},it(t)),o(t.componentId,n,t.props))}function RC(e){var t=e.schema,n=e.documentId,o=e.isOpen,i=e.onClose,r=e.sidebarProps,a=pm().getContainer,s=O(function(){var b=a();return!!b&&b.clientWidth<768}),l=q(s,2),c=l[0],d=l[1];$(function(){var b=a();if(b){var w=new ResizeObserver(function(){var x=b.clientWidth;d(x<768)});return w.observe(b),function(){return w.disconnect()}}},[a]);var u=t.position,m=t.content,g=t.width,p=Fr().renderCustomComponent,f=a();if(c&&f)return Gr(h(EC,{schema:t,documentId:n,isOpen:o,onClose:i,renderCustomComponent:p,content:m,rootElement:f,sidebarProps:r}),f);if(!o)return null;var v=(function(b){switch(b){case"left":return"border-r";case"right":return"border-l";case"top":return"border-b";case"bottom":return"border-t"}})(u.placement),y=g?{width:g}:void 0;return h("div",{className:"".concat(v," border-border-default bg-bg-surface flex flex-col shadow-lg"),style:y,"data-sidebar-id":t.id},h("div",{className:"min-h-0 flex-1"},m.type==="tabs"&&h(Iv,{content:m,documentId:n,renderCustomComponent:p}),m.type==="component"&&h(de,null,p(m.componentId,n,r??{}))))}function EC(e){var t=e.schema,n=e.documentId,o=e.isOpen,i=e.onClose,r=e.renderCustomComponent,a=e.content,s=e.rootElement,l=e.sidebarProps,c=q(O("closed"),2),d=c[0],u=c[1],m=q(O(!1),2),g=m[0],p=m[1],f=q(O(0),2),v=f[0],y=f[1],b=q(O(!1),2),w=b[0],x=b[1],C=K(null),I=K({y:0,height:0,time:0,state:"half"}),S=K({y:0,time:0});$(function(){if(!o){u("closed");var F=setTimeout(function(){x(!1)},300);return function(){return clearTimeout(F)}}x(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){u("half")})})},[o]);var P=function(F){switch(F){case"closed":return 0;case"half":return 50;case"full":return 100}},A=W(function(F){if(C.current){var X,Q=s.clientHeight,J=C.current.offsetHeight/Q*100;X=J>=75?"full":J<=25?"closed":"half",I.current={y:F,height:J,time:Date.now(),state:X},S.current={y:F,time:Date.now()},y(0),X!==d&&u(X),p(!0)}},[s,d]),D=W(function(F){if(g){var X=s.clientHeight,Q=(I.current.y-F)/X*100,J=Math.max(0,Math.min(100,I.current.height+Q));S.current={y:F,time:Date.now()};var te=P(I.current.state);y(J-te)}},[g,s]),R=W(function(){if(g){if(Math.abs(I.current.y-S.current.y)<5)return p(!1),void y(0);var F=P(I.current.state)+v,X=Date.now()-S.current.time,Q=S.current.y-I.current.y,J=(function(te,G){return Math.abs(G)>.5?G>0?te>50?"half":"closed":te<50?"half":"full":te>=75?"full":te<=25?"closed":"half"})(F,X>0?Q/X:0);J==="closed"?(u("closed"),p(!1),y(0),i()):(p(!1),y(0),u(J))}},[g,v,i]),M=W(function(F){A(F.touches[0].clientY)},[A]),N=W(function(F){g&&(F.cancelable&&F.preventDefault(),D(F.touches[0].clientY))},[g,D]),z=W(function(){R()},[R]),_=W(function(F){F.preventDefault(),A(F.clientY)},[A]);if($(function(){if(g){var F=function(Q){D(Q.clientY)},X=function(){R()};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",X),function(){document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",X)}}},[g,D,R]),!w)return null;var L=P(g?I.current.state:d),j=g?Math.max(0,Math.min(100,L+v)):L,E=.3*Math.min(j/50,1);return h(de,null,h("div",{className:"bg-bg-overlay absolute inset-0 z-40 transition-opacity duration-300 ".concat(j===0?"pointer-events-none":""),style:{opacity:E},onClick:i}),h("div",{ref:C,className:"bg-bg-surface absolute inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl shadow-2xl ".concat(g?"":"transition-[height] duration-300 ease-out"),style:{height:"".concat(j,"%")},"data-sidebar-id":t.id},h("div",{className:"flex flex-shrink-0 cursor-grab touch-none items-center justify-center py-3 active:cursor-grabbing",onTouchStart:M,onTouchMove:N,onTouchEnd:z,onMouseDown:_},h("div",{className:"bg-border-default h-1.5 w-12 rounded-full"})),h("div",{className:"min-h-0 flex-1 overflow-hidden"},a.type==="tabs"&&h(Iv,{content:a,documentId:n,renderCustomComponent:r}),a.type==="component"&&h(de,null,r(a.componentId,n,l??{})))))}function Iv(e){var t,n=e.content,o=e.documentId,i=e.renderCustomComponent,r=q(O(((t=n.tabs[0])===null||t===void 0?void 0:t.id)||""),2),a=r[0],s=r[1];return h("div",{className:"flex h-full flex-1 flex-col"},h("div",{role:"tablist",className:"bg-bg-surface mx-4 my-4 flex flex-shrink-0 overflow-hidden"},n.tabs.map(function(l,c,d){var u=a===l.id,m=c===0,g=c===d.length-1;return h("button",{key:l.id,role:"tab","aria-selected":u,tabIndex:u?0:-1,onClick:function(){return s(l.id)},className:"relative flex h-7 flex-1 cursor-pointer items-center justify-center border outline-none transition-colors ".concat(m?"rounded-l-md":""," ").concat(g?"rounded-r-md":""," ").concat(g?"":"border-r-0"," ").concat(u?"border-accent bg-accent text-fg-on-accent":"border-border-default text-fg-secondary hover:bg-interactive-hover")},l.icon&&h(ye,{icon:l.icon,className:"h-5 w-5"}))})),h("div",{className:"min-h-0 flex-1 overflow-auto"},n.tabs.filter(function(l){return l.id===a}).map(function(l){return h(de,{key:l.id},i(l.componentId,o,{}))})))}function zC(e){var t=e.schema,n=e.documentId,o=e.anchorEl,i=e.onClose,r=pm().getContainer,a=(function(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:768,y=q(O(function(){var x=f();return!!x&&x.clientWidth<v}),2),b=y[0],w=y[1];return $(function(){var x=f();if(x){var C=new ResizeObserver(function(){w(x.clientWidth<v)});return C.observe(x),function(){return C.disconnect()}}},[f,v]),b})(r,768),s=r(),l=(()=>{const{provides:f}=ro();return f?.getSchema()??null})(),c=q(O([{menuId:t.id,schema:t,title:void 0}]),2),d=c[0],u=c[1];$(function(){u([{menuId:t.id,schema:t,title:void 0}])},[t]);var m=d[d.length-1],g=W(function(f,v){if(l){var y=l.menus[f];y?u(function(b){return[].concat(Eo(b),[{menuId:f,schema:y,title:v}])}):console.warn("Submenu schema not found: ".concat(f))}},[l]),p=W(function(){d.length>1&&u(function(f){return f.slice(0,-1)})},[d.length]);return m?a&&s?Gr(h(LC,{currentMenu:m,menuStack:d,documentId:n,onClose:i,onNavigateBack:p,onNavigateToSubmenu:g,container:s}),s):h(NC,{currentMenu:m,documentId:n,anchorEl:o,onClose:i,onNavigateToSubmenu:g}):null}function LC(e){var t=e.currentMenu,n=e.menuStack,o=e.documentId,i=e.onClose,r=e.onNavigateBack,a=e.onNavigateToSubmenu,s=e.container,l=q(O(!1),2),c=l[0],d=l[1],u=q(O(!1),2),m=u[0],g=u[1],p=q(O(0),2),f=p[0],v=p[1],y=K(null),b=K(null),w=K({isDragging:!1,startY:0,currentY:0,startTime:0,sheetHeight:0});$(function(){d(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){g(!0)})})},[]);var x=q(O(null),2),C=x[0],I=x[1];$(function(){if(b.current){var L=(n.length>1?60:0)+b.current.scrollHeight+24,j=.8*s.clientHeight;I(Math.min(L,j))}},[t,n.length,s]);var S=W(function(){g(!1),setTimeout(function(){d(!1),i()},300)},[i]),P=W(function(L){y.current&&(w.current={isDragging:!0,startY:L,currentY:L,startTime:Date.now(),sheetHeight:y.current.offsetHeight})},[]),A=W(function(L){if(w.current.isDragging){var j=L-w.current.startY,E=Math.max(0,j);w.current.currentY=L,v(E)}},[]),D=W(function(){if(w.current.isDragging){var L=w.current,j=L.startY,E=L.currentY,F=L.startTime,X=L.sheetHeight,Q=Math.abs(j-E);if(w.current.isDragging=!1,Q<5)v(0);else{var J=E-j,te=J/X*100,G=Date.now()-F;te>30||(G>0?J/G:0)>.5?S():v(0)}}},[S]),R=W(function(L){P(L.touches[0].clientY)},[P]),M=W(function(L){w.current.isDragging&&L.cancelable&&L.preventDefault(),A(L.touches[0].clientY)},[A]),N=W(function(){D()},[D]),z=W(function(L){L.preventDefault(),P(L.clientY)},[P]);if($(function(){if(w.current.isDragging){var L=function(E){return A(E.clientY)},j=function(){return D()};return document.addEventListener("mousemove",L),document.addEventListener("mouseup",j),function(){document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",j)}}},[A,D]),$(function(){var L=function(j){j.key==="Escape"&&S()};return document.addEventListener("keydown",L),function(){return document.removeEventListener("keydown",L)}},[S]),!c)return null;var _=m?f:C||400;return h(de,null,h("div",{className:"bg-bg-overlay absolute inset-0 z-40 transition-opacity duration-300 ".concat(m?"opacity-100":"opacity-0"),onClick:S}),h("div",B({ref:y,className:"bg-bg-surface absolute inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl shadow-2xl ".concat(w.current.isDragging?"":"transition-transform duration-300 ease-out"),style:{maxHeight:"80%",transform:"translateY(".concat(_,"px)")}},it(t.schema)),h("div",{className:"flex flex-shrink-0 cursor-grab touch-none items-center justify-center py-3 active:cursor-grabbing",onTouchStart:R,onTouchMove:M,onTouchEnd:N,onMouseDown:z},h("div",{className:"bg-border-default h-1.5 w-12 rounded-full"})),n.length>1&&h("div",{className:"border-border-subtle flex items-center gap-3 border-b px-4 pb-3"},h("button",{onClick:r,className:"hover:bg-interactive-hover rounded-full p-1"},h(ul,{className:"h-5 w-5"})),h("h3",{className:"text-fg-primary font-semibold"},t.title||"Menu")),h("div",{ref:b,className:"flex-1 overflow-y-auto py-2"},t.schema.items.map(function(L){return h(vl,{key:L.id,item:L,documentId:o,onClose:S,isMobile:!0,onNavigateToSubmenu:a})}))))}function NC(e){var t=e.currentMenu,n=e.documentId,o=e.anchorEl,i=e.onClose,r=e.onNavigateToSubmenu,a=K(null),s=q(O(null),2),l=s[0],c=s[1];$(function(){if(o){var u=function(){var m,g=o.getBoundingClientRect(),p=((m=a.current)===null||m===void 0?void 0:m.offsetWidth)||200,f=g.bottom+4,v=g.left;v+p>window.innerWidth&&(v=window.innerWidth-p-8),v<8&&(v=8),c({top:f,left:v})};return u(),window.addEventListener("scroll",u),window.addEventListener("resize",u),function(){window.removeEventListener("scroll",u),window.removeEventListener("resize",u)}}},[o]),$(function(){var u=function(g){if(a.current){var p=g.composedPath(),f=p.includes(a.current),v=o&&p.includes(o);f||v||i()}},m=setTimeout(function(){document.addEventListener("mousedown",u)},0);return function(){clearTimeout(m),document.removeEventListener("mousedown",u)}},[i,o]),$(function(){var u=function(m){m.key==="Escape"&&i()};return document.addEventListener("keydown",u),function(){return document.removeEventListener("keydown",u)}},[i]);var d=l?{position:"fixed",top:"".concat(l.top,"px"),left:"".concat(l.left,"px"),zIndex:1e3}:{display:"none"};return h("div",B(B({ref:a},it(t.schema)),{},{className:"border-border-default bg-bg-elevated min-w-[200px] rounded-lg border py-2 shadow-lg",style:d}),t.schema.items.map(function(u){return h(vl,{key:u.id,item:u,documentId:n,onClose:i,isMobile:!1,onNavigateToSubmenu:r})}))}function vl(e){var t=e.item,n=e.documentId,o=e.onClose,i=e.isMobile,r=e.onNavigateToSubmenu;switch(t.type){case"command":return h(OC,{item:t,documentId:n,onClose:o,isMobile:i});case"submenu":return h(FC,{item:t,documentId:n,isMobile:i,onNavigateToSubmenu:r});case"divider":return h("div",B({},it(t)),h("hr",{className:"border-border-subtle my-2"}));case"section":return h(_C,{item:t,documentId:n,onClose:o,isMobile:i,onNavigateToSubmenu:r});default:return null}}function OC(e){var t,n,o=e.item,i=e.documentId,r=e.onClose,a=e.isMobile,s=Gt(o.commandId,i);if(!s||!s.visible)return null;var l,c,d=function(){s.disabled||(s.execute(),r())};return a?h("button",B(B({},it(o)),{},{onClick:d,disabled:s.disabled,className:"active:bg-interactive-active flex w-full items-center gap-3 px-4 py-3 text-left text-base transition-colors ".concat(s.disabled?"cursor-not-allowed opacity-50":"cursor-pointer"," ").concat(s.active?"bg-interactive-selected text-accent":"text-fg-secondary"),role:"menuitem"}),s.icon&&h(ye,{icon:s.icon,className:"h-5 w-5",primaryColor:(l=s.iconProps)===null||l===void 0?void 0:l.primaryColor,secondaryColor:(c=s.iconProps)===null||c===void 0?void 0:c.secondaryColor}),h("span",{className:"flex-1"},s.label)):h("button",B(B({},it(o)),{},{onClick:d,disabled:s.disabled,className:"flex w-full items-center justify-between gap-2 px-4 py-1 text-left ".concat(s.disabled?"pointer-events-none cursor-not-allowed opacity-50":"cursor-pointer"," ").concat(s.active&&!s.disabled?"bg-accent text-fg-on-accent":"text-fg-muted hover:bg-accent hover:text-fg-on-accent"),role:"menuitem"}),h("div",{className:"flex items-center gap-2"},h("div",{className:"flex h-6 w-6 items-center justify-center"},s.icon&&h(ye,{icon:s.icon,className:"h-6 w-6",primaryColor:(t=s.iconProps)===null||t===void 0?void 0:t.primaryColor,secondaryColor:(n=s.iconProps)===null||n===void 0?void 0:n.secondaryColor})),h("span",{className:"text-sm"},s.label)))}function FC(e){var t=e.item,n=e.documentId,o=e.isMobile,i=e.onNavigateToSubmenu,r=Le(n).translate,a=t.labelKey?r(t.labelKey):t.label||"",s=function(){return i(t.menuId,a)};return o?h("button",B(B({},it(t)),{},{onClick:s,className:"text-fg-secondary active:bg-interactive-active flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left text-base transition-colors",role:"menuitem"}),h("span",{className:"flex-1"},a),h(ui,{className:"h-4 w-4"})):h("button",B(B({},it(t)),{},{onClick:s,className:"text-fg-muted hover:bg-accent hover:text-fg-on-accent flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-1 text-left",role:"menuitem"}),h("span",{className:"text-sm"},a),h(ui,{className:"h-6 w-6"}))}function _C(e){var t=e.item,n=e.documentId,o=e.onClose,i=e.isMobile,r=e.onNavigateToSubmenu,a=Le(n).translate,s=t.labelKey?a(t.labelKey):t.label||"";return h("div",B({},it(t)),h("div",{className:"text-fg-secondary px-4 py-3 text-xs font-medium uppercase"},s),t.items.map(function(l){return h(vl,{key:l.id,item:l,documentId:n,onClose:o,isMobile:i,onNavigateToSubmenu:r})}))}function $C(e){var t=e.schema,n=e.documentId,o=e.isOpen,i=e.onClose,r=e.onExited,a=e.modalProps,s=t.content,l=Fr().renderCustomComponent;return s.type!=="component"?(console.warn("SchemaModal only supports component content type, got: ".concat(s.type)),null):h(de,null,l(s.componentId,n,B({isOpen:o,onClose:i,onExited:r},a)))}function jC(e){var t=e.documentId;e.onClose;var n=Rh(t),o=n.state,i=n.provides;return h("div",{className:"flex h-full flex-1 flex-col"},h("div",{className:"flex-1 overflow-hidden"},h(m0,{documentId:t,style:{width:"100%",height:"100%"}},function(r){return h("div",{key:r.pageIndex,style:{position:"absolute",width:"100%",height:r.wrapperHeight,top:r.top,display:"flex",flexDirection:"column",alignItems:"center",cursor:"pointer"},onClick:function(){var a;i==null||(a=i.scrollToPage)===null||a===void 0||a.call(i,{pageNumber:r.pageIndex+1})}},h("div",{style:{width:r.width,height:r.height,border:"2px solid ".concat(o.currentPage===r.pageIndex+1?"var(--ep-accent-primary)":"var(--ep-border-default)"),borderRadius:"4px",overflow:"hidden",boxShadow:o.currentPage===r.pageIndex+1?"0 0 0 2px var(--ep-interactive-focus-ring)":"none"}},h(p0,{documentId:t,meta:r,style:{width:"100%",height:"100%"}})),h("div",{style:{height:r.labelHeight,display:"flex",alignItems:"center",justifyContent:"center",marginTop:"4px"}},h("span",{className:"text-fg-secondary text-xs"},r.pageIndex+1)))})))}function Ai(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:300,n=q(O(e),2),o=n[0],i=n[1];return $(function(){var r=window.setTimeout(function(){return i(e)},t);return function(){return clearTimeout(r)}},[e,t]),o}var Rt=function(e){var t=e.label,n=e.checked,o=e.onChange,i=e.disabled;return h("label",{className:"text-fg-secondary inline-flex select-none items-center gap-2 text-xs font-medium ".concat(i?"cursor-not-allowed opacity-50":"cursor-pointer")},h("input",{type:"checkbox",checked:n,disabled:i,onChange:function(r){return o(r.target.checked)},className:"border-border-default bg-bg-input checked:border-accent checked:bg-accent peer h-4 w-4 shrink-0 appearance-none rounded-[3px] border transition-all disabled:cursor-not-allowed"}),h("svg",{viewBox:"0 0 24 24",className:"/* fine-tune centering */ text-fg-on-accent pointer-events-none absolute h-3.5 w-3.5 translate-x-[1px] translate-y-[1px] opacity-0 peer-checked:opacity-100",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"},h("polyline",{points:"20 6 9 17 4 12"})),t)},UC=function(e){var t=e.hit,n=e.onClick,o=e.active,i=K(null);return $(function(){o&&i.current&&i.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[o]),h("button",{ref:i,onClick:n,className:"w-full rounded border p-2 text-left text-sm transition-colors ".concat(o?"border-accent bg-accent-light text-fg-primary":"border-border-subtle bg-bg-surface text-fg-secondary hover:bg-interactive-hover")},h("span",null,t.context.truncatedLeft&&"… ",t.context.before,h("span",{className:"text-accent font-bold"},t.context.match),t.context.after,t.context.truncatedRight&&" …"))};function BC(e){var t=e.documentId;e.onClose;var n=(f=>{const{provides:v}=Qm(),[y,b]=O(mr),w=Z(()=>v?.forDocument(f),[v,f]);return $(()=>{if(w)return b(w.getState()),w.onStateChange(x=>b(x));b(mr)},[w]),{state:y,provides:w??null}})(t),o=n.state,i=n.provides,r=io().provides,a=Le(t).translate,s=K(null),l=q(O(""),2),c=l[0],d=l[1];$(function(){},[]),$(function(){o.query&&!c&&d(o.query)},[o.query]),$(function(){o.activeResultIndex!==void 0&&o.activeResultIndex>=0&&g(o.activeResultIndex)},[o.activeResultIndex]);var u=Ai(c,300);$(function(){u!==o.query&&i?.searchAllPages(u)},[u,i,o.query]);var m=function(f,v){v?i?.setFlags([].concat(Eo(o.flags),[f])):i?.setFlags(o.flags.filter(function(y){return y!==f}))},g=function(f){var v,y=o.results[f];if(y){var b=y.rects.reduce(function(w,x){return{x:Math.min(w.x,x.origin.x),y:Math.min(w.y,x.origin.y)}},{x:1/0,y:1/0});r==null||(v=r.forDocument(t))===null||v===void 0||v.scrollToPage({pageNumber:y.pageIndex+1,pageCoordinates:b,alignX:50,alignY:25})}},p=(function(f){var v={};return f.forEach(function(y,b){v[y.pageIndex]||(v[y.pageIndex]=[]),v[y.pageIndex].push({hit:y,index:b})}),v})(o.results);return h("div",{className:"bg-bg-surface flex h-full flex-col"},h("div",{className:"p-4"},h("div",{className:"relative"},h("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},h(uv,{className:"text-fg-muted h-4 w-4"})),h("input",{ref:s,type:"text",placeholder:a("search.placeholder"),value:c,onInput:function(f){var v=f.target;d(v.value)},className:"border-border-default bg-bg-input focus:border-accent focus:ring-accent w-full rounded-md border py-1 pl-8 pr-9 text-base focus:outline-none focus:ring-1"}),c&&h("div",{className:"absolute inset-y-0 right-0 flex cursor-pointer items-center pr-3",onClick:function(){d(""),s.current&&s.current.focus()}},h(hv,{className:"text-fg-muted hover:text-fg-secondary h-4 w-4"}))),h("div",{className:"mt-3 flex flex-col gap-2"},h(Rt,{label:a("search.caseSensitive"),checked:o.flags.includes(Xo.MatchCase),onChange:function(f){return m(Xo.MatchCase,f)}}),h(Rt,{label:a("search.wholeWord"),checked:o.flags.includes(Xo.MatchWholeWord),onChange:function(f){return m(Xo.MatchWholeWord,f)}})),h("hr",{className:"border-border-subtle mb-2 mt-5"}),o.active&&h("div",{className:"flex h-[32px] flex-row items-center justify-between"},h("div",{className:"text-fg-muted text-xs"},a("search.resultsFound",{params:{count:o.total}})),o.total>1&&h("div",{className:"flex flex-row"},h(Je,{onClick:function(){i?.previousResult()}},h(ul,{className:"h-4 w-4"})),h(Je,{onClick:function(){i?.nextResult()}},h(ui,{className:"h-4 w-4"}))))),h("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4"},Object.entries(p).map(function(f){var v=q(f,2),y=v[0],b=v[1];return h("div",{key:y,className:"mt-2 first:mt-0"},h("div",{className:"bg-bg-surface/80 text-fg-muted py-2 text-xs backdrop-blur"},a("search.page",{params:{page:Number(y)+1}})),h("div",{className:"flex flex-col gap-2"},b.map(function(w){var x=w.hit,C=w.index;return h(UC,{key:C,hit:x,active:C===o.activeResultIndex,onClick:function(){i?.goToResult(C)}})})))}),h("div",null)))}function WC(e){var t=e.documentId,n=We(ol.id).provides,o=io().provides,i=Le(t).translate,r=pt(t),a=q(O([]),2),s=a[0],l=a[1],c=q(O(new Set),2),d=c[0],u=c[1],m=q(O(!0),2),g=m[0],p=m[1];$(function(){if(n&&r!=null&&r.document){p(!0);var v=n.getBookmarks();return v.wait(function(y){var b=y.bookmarks;l(b);var w=b.map(function(x,C){return"bookmark-".concat(C)});u(new Set(w)),p(!1)},function(){p(!1)}),function(){v.abort({code:H.Cancelled,message:"Bookmark task cancelled"})}}},[n,r?.document]);var f=function(v,y){var b,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,x="bookmark-".concat(y),C=v.children&&v.children.length>0,I=d.has(x);return h("div",{key:x,className:"select-none"},h("div",{className:"hover:bg-interactive-hover flex cursor-pointer items-center gap-1 px-2 py-1",style:{paddingLeft:"".concat(16*w+8,"px")},onClick:function(){return(function(S){if(o&&S.target){var P;if(S.target.type==="action"){var A=S.target.action;if(A.type===zn.Goto||A.type===zn.RemoteGoto)P=A.destination;
2291else if(A.type===zn.URI)return void window.open(A.uri,"_blank")}else S.target.type==="destination"&&(P=S.target.destination);if(P)if(P.zoom.mode===Sr.XYZ){var D,R=r==null||(D=r.document)===null||D===void 0?void 0:D.pages.find(function(M){return M.index===P.pageIndex});if(!R)return;o.scrollToPage({pageNumber:P.pageIndex+1,pageCoordinates:P.zoom.params?{x:P.zoom.params.x,y:R.size.height-P.zoom.params.y}:void 0,behavior:"smooth"})}else o.scrollToPage({pageNumber:P.pageIndex+1,behavior:"smooth"})}})(v)}},C&&h("button",{onClick:function(S){S.stopPropagation(),(function(P){u(function(A){var D=new Set(A);return D.has(P)?D.delete(P):D.add(P),D})})(x)},className:"flex h-4 w-4 items-center justify-center"},h(I?dv:ui,{className:"h-3 w-3"})),!C&&h("div",{className:"w-4"}),h("span",{className:"text-fg-secondary text-sm"},v.title)),C&&I&&h("div",null,(b=v.children)===null||b===void 0?void 0:b.map(function(S,P){return f(S,P,w+1)})))};return r==null||!r.document||g?h("div",{className:"text-fg-secondary flex h-full flex-col gap-3 p-4 text-sm"},h("div",{className:"text-fg-primary font-medium"},i("outline.title")),h("p",null,i("outline.loading"))):s.length===0?h("div",{className:"flex h-full items-center justify-center p-6"},h("div",{className:"text-fg-muted text-center"},h("div",{className:"text-sm"},i("outline.noOutline")),h("div",{className:"mt-1 text-xs"},i("outline.noBookmarks")))):h("div",{className:"bg-bg-surface flex h-full flex-col"},h("div",{className:"flex-1 overflow-y-auto"},h("div",{className:"outline-tree"},s.map(function(v,y){return f(v,y)}))))}function ms(e){var t=e.size,n=t===void 0?"md":t,o=e.text,i=e.className,r={sm:"w-6 h-6",md:"w-10 h-10",lg:"w-16 h-16"};return h("div",{className:"flex flex-col items-center justify-center gap-3 ".concat(i===void 0?"":i)},h("div",{className:"relative"},h("div",{className:"".concat(r[n]," border-border-default animate-spin rounded-full border-4")}),h("div",{className:"".concat(r[n]," border-r-accent border-t-accent absolute left-0 top-0 animate-spin rounded-full border-4 border-transparent")})),o&&h("p",{className:"".concat({sm:"text-sm",md:"text-base",lg:"text-lg"}[n]," text-fg-secondary animate-pulse font-medium")},o))}function So(e){var t=e.size,n=t===void 0?"md":t,o=e.className,i=o===void 0?"":o;return h("div",{className:"".concat({sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-3"}[n]," border-border-default border-t-accent animate-spin rounded-full ").concat(i)})}var du,HC=function(e){var t=e.documentId,n=ci().provides,o=q(O({show:!1,mode:null,isAnimating:!1}),2),i=o[0],r=o[1],a=Le(t).translate;if($(function(){if(n)return n.onModeChange(function(c){var d=c.activeMode;if(d==="marqueeZoom"||d==="marqueeCapture"){r({show:!0,mode:d,isAnimating:!0});var u=setTimeout(function(){r(function(m){return B(B({},m),{},{show:!1})})},3e3);return function(){return clearTimeout(u)}}r({show:!1,mode:null,isAnimating:!1})})},[n]),!i.show&&!i.isAnimating)return null;var s=i.mode==="marqueeZoom"?a("zoom.dragTip"):a("capture.dragTip"),l=i.mode==="marqueeZoom"?"rgba(33,150,243,0.8)":"rgba(76,175,80,0.8)";return h("div",{className:"hint-overlay ".concat(i.show?"hint-show":"hint-hide"),onAnimationEnd:function(){i.show||r(function(c){return B(B({},c),{},{isAnimating:!1,mode:null})})},style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"20px"}},h("div",{className:"hint-text",style:{background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:"500",textAlign:"center",maxWidth:"250px"}},s),h("div",{className:"drag-demo",style:{position:"relative",width:"150px",height:"100px"}},h("div",{style:{position:"absolute",top:"20px",left:"20px",width:"110px",height:"60px",border:"2px dashed ".concat(l),borderRadius:"4px",opacity:.6}}),h("div",{className:"animated-rect",style:{position:"absolute",top:"20px",left:"20px",border:"2px solid ".concat(l),backgroundColor:"".concat(l.replace("0.8","0.15")),borderRadius:"4px"}}),h("div",{className:"cursor-demo",style:{position:"absolute",width:"20px",height:"20px"}},h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M3.5 2.5L16.5 10L10 11.5L7.5 16.5L3.5 2.5Z",fill:"rgba(0,0,0,0.3)",transform:"translate(1,1)"}),h("path",{d:"M3 2L16 10L10 11.5L7.5 16L3 2Z",fill:"white",stroke:"black",strokeWidth:"1"}
vendor: 27,228 bytes, lines 2291-2381
2291),h("path",{d:"M4 3.5L13.5 9.5L9.5 10.5L7.5 14L4 3.5Z",fill:"rgba(255,255,255,0.8)"})))),h("style",{jsx:!0},`
2292        .hint-overlay {
2293          animation-duration: 0.3s;
2294          animation-fill-mode: both;
2295        }
2296
2297        .hint-show {
2298          animation-name: hintFadeIn;
2299        }
2300
2301        .hint-hide {
2302          animation-name: hintFadeOut;
2303        }
2304
2305        @keyframes hintFadeIn {
2306          from {
2307            opacity: 0;
2308            transform: translateY(10px);
2309          }
2310          to {
2311            opacity: 1;
2312            transform: translateY(0);
2313          }
2314        }
2315
2316        @keyframes hintFadeOut {
2317          from {
2318            opacity: 1;
2319            transform: translateY(0);
2320          }
2321          to {
2322            opacity: 0;
2323            transform: translateY(-10px);
2324          }
2325        }
2326
2327        .animated-rect {
2328          animation: rectGrow 2s ease-in-out infinite;
2329        }
2330
2331        @keyframes rectGrow {
2332          0% {
2333            width: 0;
2334            height: 0;
2335          }
2336          50% {
2337            width: 110px;
2338            height: 60px;
2339          }
2340          100% {
2341            width: 110px;
2342            height: 60px;
2343            opacity: 0.7;
2344          }
2345        }
2346
2347        .cursor-demo {
2348          animation: cursorMove 2s ease-in-out infinite;
2349        }
2350
2351        @keyframes cursorMove {
2352          0% {
2353            top: 20px;
2354            left: 20px;
2355          }
2356          50% {
2357            top: 50px;
2358            left: 80px;
2359          }
2360          100% {
2361            top: 80px;
2362            left: 130px;
2363          }
2364        }
2365
2366        .hint-text {
2367          animation: textPulse 0.6s ease-in-out;
2368        }
2369
2370        @keyframes textPulse {
2371          0% {
2372            transform: scale(0.9);
2373          }
2374          50% {
2375            transform: scale(1.05);
2376          }
2377          100% {
2378            transform: scale(1);
2379          }
2380        }
2381      `))},GC=function(e){var t=e.placeholder,n=e.onSubmit,o=e.inputRef,i=e.isFocused,r=q(O(""),2),a=r[0],s=r[1],l=function(){a.trim()&&(n(a),s(""))};return h("div",{className:"border-border-subtle mt-4 flex items-end space-x-2 border-t pt-4",onClick:function(c){return c.stopPropagation()}},h("input",{ref:o,type:"text",placeholder:t,value:a,onInput:function(c){return s(c.currentTarget.value)},onKeyDown:function(c){c.key==="Enter"&&(c.preventDefault(),l())},className:"bg-bg-input text-fg-primary placeholder-fg-muted w-full rounded-lg border px-3 py-1 text-base transition-colors focus:border-transparent focus:outline-none focus:ring-2 ".concat(i?"border-accent focus:ring-accent":"border-border-default focus:ring-accent")}),h("button",{type:"button",onClick:function(){return l()},disabled:!a.trim(),className:"bg-accent text-fg-on-accent hover:bg-accent-hover disabled:bg-interactive-disabled rounded-lg p-2 transition-colors disabled:cursor-not-allowed"},h("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},h("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"}))))},Ma=["bg-red-500","bg-blue-500","bg-green-500","bg-yellow-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-teal-500"],qC=function(e){if(!e)return Ma[0];var t=e.length>0?e.charCodeAt(0)%Ma.length:0;return Ma[t]},uu=function(e){var t=e.name,n=e.className,o=n===void 0?"":n;return h("div",{className:"flex h-8 w-8 items-center justify-center rounded-full text-sm font-medium text-white ".concat(qC(t)," ").concat(o)},(function(i){return i?i.split(" ").map(function(r){return r[0]}).join("").toUpperCase().slice(0,2):"G"})(t))},Sv=function(e){var t,n,o=e.onEdit,i=e.onDelete,r=e.onClose,a=e.documentId,s=K(null),l=Le(a).translate;return $(function(){var c=function(d){t.current&&!t.current.contains(d.target)&&n()};return document.addEventListener("click",c),function(){document.removeEventListener("click",c)}},[t=s,n=r]),h("div",{ref:s,className:"bg-bg-elevated ring-border-default absolute right-0 top-6 z-10 w-32 rounded-md shadow-lg ring-1"},h("div",{className:"py-1"},h("button",{onClick:function(c){c.preventDefault(),c.stopPropagation(),o(),r()},className:"text-fg-secondary hover:bg-interactive-hover block w-full px-4 py-2 text-left text-sm"},l("comments.edit")),h("button",{onClick:function(c){c.preventDefault(),c.stopPropagation(),i(),r()},className:"text-state-error hover:bg-interactive-hover block w-full px-4 py-2 text-left text-sm"},l("comments.delete"))))},Av=function(e){var t=e.initialText,n=e.onSave,o=e.onCancel,i=e.autoFocus,r=i!==void 0&&i,a=e.documentId,s=q(O(t),2),l=s[0],c=s[1],d=K(null),u=Le(a).translate;return $(function(){r&&d.current&&(d.current.focus(),d.current.setSelectionRange(l.length,l.length))},[r,l.length]),h("div",{className:"flex-1 space-y-2"},h("textarea",{ref:d,value:l,onInput:function(m){return c(m.currentTarget.value)},className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1",rows:3}),h("div",{className:"flex flex-wrap gap-2"},h("button",{onClick:function(m){m.stopPropagation(),n(l)},className:"bg-accent text-fg-on-accent hover:bg-accent-hover whitespace-nowrap rounded-md px-3 py-1 text-sm"},u("comments.save")),h("button",{onClick:function(m){m.stopPropagation(),o()},className:"bg-interactive-hover text-fg-secondary hover:bg-border-default whitespace-nowrap rounded-md px-3 py-1 text-sm"},u("comments.cancel"))))},ps=function(e){if(!e)return"(no date)";try{return(e instanceof Date?e:new Date(e)).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return typeof e=="string"?e:"(no date)"}},KC=function(e){var t=e.annotation,n=e.onSave,o=e.onDelete,i=e.isReply,r=i!==void 0&&i,a=e.documentId,s=e.isReadOnly,l=s!==void 0&&s,c=q(O(!1),2),d=c[0],u=c[1],m=q(O(!1),2),g=m[0],p=m[1],f=t.author||"Guest";return g?h("div",{className:"flex w-full items-start space-x-3",onClick:function(v){return v.stopPropagation()}},r&&h(uu,{name:f,className:"h-8 w-8"}),h(Av,{initialText:t.contents||"",onSave:function(v){n(v),p(!1)},onCancel:function(){p(!1)},autoFocus:!0,documentId:a})):h("div",{className:"flex items-start space-x-3"},r&&h(uu,{name:f,className:"h-8 w-8"}),h("div",{className:"min-w-0 flex-1"},r&&h("div",{className:"flex items-center justify-between"},h("div",{className:"leading-none"},h("h5",{className:"text-fg-primary text-sm font-medium"},f),h("span",{className:"text-fg-muted text-xs"},ps(t.modified||t.created))),!l&&h("div",{className:"relative"},h("button",{onClick:function(v){v.stopPropagation(),u(!0)},className:"text-fg-muted hover:bg-interactive-hover rounded-md p-1"},h("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20"},h("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"}))),d&&h(Sv,{onEdit:function(){return p(!0)},onDelete:o,onClose:function(){return u(!1)},documentId:a}))),h("p",{className:"text-fg-primary mt-2 text-sm"},t.contents)))},VC=(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(du={},T.TEXT,{label:"Comment",labelKey:"annotation.comment",icon:"message",iconProps:function(e){return{primaryColor:e.strokeColor||e.color||"#6b7280"}}}),T.HIGHLIGHT,{label:"Highlight",labelKey:"annotation.highlight",icon:"highlight",iconProps:function(e){return{primaryColor:e.strokeColor||"#ffff00"}}}),T.CIRCLE,{label:"Circle",labelKey:"annotation.circle",icon:"circle",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000",secondaryColor:e.color}}}),T.SQUARE,{label:"Square",labelKey:"annotation.square",icon:"square",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000",secondaryColor:e.color}}}),T.LINE,{label:"Line",labelKey:"annotation.line",icon:"line",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.UNDERLINE,{label:"Underline",labelKey:"annotation.underline",icon:"underline",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.SQUIGGLY,{label:"Squiggly",labelKey:"annotation.squiggly",icon:"squiggly",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.STRIKEOUT,{label:"Strikethrough",labelKey:"annotation.strikeout",icon:"strikethrough",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.INK,{label:"Ink",labelKey:"annotation.ink",icon:"pencilMarker",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.FREETEXT,{label:"Text",labelKey:"annotation.freeText",icon:"freeText",iconProps:function(e){return{primaryColor:e.fontColor||"#000000"}}}),ee(ee(ee(ee(ee(du,T.POLYGON,{label:"Polygon",labelKey:"annotation.polygon",icon:"polygon",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000",secondaryColor:e.color}}}),T.POLYLINE,{label:"Polyline",labelKey:"annotation.polyline",icon:"zigzag",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000"}}}),T.STAMP,{label:"Stamp",labelKey:"annotation.stamp",icon:"rubberStamp",iconProps:function(){return{primaryColor:"#000000"}}}),T.CARET,{label:"Caret",labelKey:"annotation.caret",icon:"insertText",iconProps:function(e){return{primaryColor:e.strokeColor||"#E44234"}}}),T.REDACT,{label:"Redact",labelKey:"annotation.redact",icon:"redact",iconProps:function(e){return{primaryColor:e.strokeColor||"#000000",secondaryColor:e.color||"#000000"}}})),hu=function(e){return pr(e)?VC[e.object.type]:null},mu=function(e){var t=e.text,n=e.maxWords,o=n===void 0?16:n,i=e.className,r=i===void 0?"":i,a=e.documentId,s=q(O(!1),2),l=s[0],c=s[1],d=Le(a).translate,u=t.split(" ");return u.length>o?h("div",{className:r},l?t:u.slice(0,o).join(" ")+"..."," ",h("button",{onClick:function(m){m.stopPropagation(),c(!l)},className:"text-accent hover:text-accent-hover text-sm font-medium focus:outline-none"},d(l?"comments.showLess":"comments.showMore"))):h("div",{className:r},t)},pu=function(e){var t=e.annotation,n=e.config,o=e.className,i=o===void 0?"":o,r=e.title,a=n.iconProps(t.object);return h("div",{className:"bg-bg-surface-alt flex items-center justify-center rounded-full ".concat(i),title:r},h(ye,B({icon:n.icon},a)))},XC=function(e){var t,n=e.entry,o=e.isSelected,i=e.onSelect,r=e.onUpdate,a=e.onDelete,s=e.onReply,l=e.documentId,c=e.isReadOnly,d=c!==void 0&&c,u=n.annotation,m=n.replies,g=n.groupMembers,p=q(O(!1),2),f=p[0],v=p[1],y=q(O(!1),2),b=y[0],w=y[1],x=q(O(!1),2),C=x[0],I=x[1],S=Le(l).translate,P=g!=null&&g.length>0,A=hu(u),D=!!u.object.contents,R=m.length>0,M=!D&&!R,N=K(null),z=K(!1),_=u.object.author||"Guest";return $(function(){var L;o&&!z.current&&((L=N.current)===null||L===void 0||L.focus({preventScroll:!0})),z.current=o},[o]),A?h("div",{onClick:i,className:"bg-bg-surface cursor-pointer rounded-lg border shadow-sm transition-all hover:shadow-md ".concat(o?"border-accent ring-interactive-focus-ring ring-2":"border-border-subtle")},h("div",{className:"p-4"},h("div",{className:"flex items-start space-x-3"},h(pu,{annotation:u,config:A,title:S(A.labelKey,{fallback:A.label}),className:"h-8 w-8"}),h("div",{className:"min-w-0 flex-1"},h("div",{className:"flex items-center justify-between"},h("div",{className:"leading-none"},h("h4",{className:"text-fg-primary text-sm font-medium"},_),h("span",{className:"text-fg-disabled text-xs"},ps(u.object.modified||u.object.created))),!d&&h("div",{className:"relative"},h("button",{onClick:function(L){L.stopPropagation(),v(!0)},className:"text-fg-disabled hover:bg-interactive-hover hover:text-fg-secondary rounded-md p-1"},h("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20"},h("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"}))),f&&h(Sv,{onEdit:function(){return w(!0)},onDelete:function(){return a(u)},onClose:function(){return v(!1)},documentId:l}))),((t=u.object.custom)===null||t===void 0?void 0:t.text)&&h(mu,{text:u.object.custom.text,maxWords:14,className:"text-fg-muted mt-2 text-sm",documentId:l}),b?h("div",{className:"mt-2"},h(Av,{initialText:u.object.contents||"",onSave:function(L){r(u.object.id,L),w(!1)},onCancel:function(){w(!1)},autoFocus:!0,documentId:l})):D?h("p",{className:"text-fg-primary mt-2 text-sm"},u.object.contents):null)),R&&h("div",{className:"border-border-subtle mt-4 space-y-4 border-t pt-4"},m.map(function(L){return h(KC,{key:L.object.id,annotation:L.object,onSave:function(j){return r(L.object.id,j)},onDelete:function(){return a(L)},isReply:!0,documentId:l,isReadOnly:d})})),P&&h("div",{className:"border-border-subtle mt-4 border-t pt-3"},h("button",{onClick:function(L){L.stopPropagation(),I(function(j){return!j})},className:"text-accent hover:text-accent-hover flex w-full items-center justify-center gap-1 text-sm font-medium"},C?S("comments.closeAllAnnotations",{fallback:"Close All Annotations"}):S("comments.showAllAnnotations",{fallback:"Show All Annotations"}),h("svg",{className:"h-4 w-4 transition-transform ".concat(C?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2},h("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))),C&&h("div",{className:"mt-3 space-y-3"},g.map(function(L){var j,E=hu(L);if(!E)return null;var F=L.object.author||"Guest";return h("div",{key:L.object.id,className:"flex items-start gap-2"},h(pu,{annotation:L,config:E,title:S(E.labelKey,{fallback:E.label}),className:"h-6 w-6"}),h("div",{className:"min-w-0 flex-1"},h("div",{className:"leading-none"},h("span",{className:"text-fg-primary text-sm font-medium"},F),h("span",{className:"text-fg-disabled ml-2 text-xs"},ps(L.object.modified||L.object.created)," (".concat(S("comments.page",{params:{page:L.object.pageIndex+1}}),")"))),((j=L.object.custom)===null||j===void 0?void 0:j.text)&&h(mu,{text:L.object.custom.text,maxWords:14,className:"text-fg-muted mt-1 text-sm",documentId:l}),L.object.contents&&h("p",{className:"text-fg-primary mt-1 text-sm"},L.object.contents)))}))),!b&&!d&&h(GC,{inputRef:N,isFocused:o,placeholder:S(M?"comments.addComment":"comments.addReply"),onSubmit:function(L){M?r(u.object.id,L):s(u.object.id,L)}}))):null},ZC=function(e){var t=e.documentId,n=Le(t).translate;return h("div",{class:"text-fg-muted flex flex-col items-center gap-2 p-4"},h(ye,{icon:"comment",className:"h-18 w-18 text-fg-muted"}),h("div",{className:"text-fg-muted max-w-[150px] text-center text-sm"},n("comments.emptyState")))},YC=function(e){var t=e.documentId,n=zt().provides,o=tl(t).state,i=io().provides,r=Le(t).translate,a=zr(t).canModifyAnnotations,s=K({}),l=K(null),c=!a,d=ii(o),u=(b=>{const w={};for(const S of Object.values(b.pages))for(const P of S){const A=b.byUid[P];if(A&&Zp(A)){const D=A.object.inReplyToId;D&&(w[D]||(w[D]=[])).push(A)}}const x={},C=new Set;for(const S of Object.values(b.pages))for(const P of S){const A=b.byUid[P];if(A&&A.object.inReplyToId&&A.object.replyType===Ut.Group&&A.object.type!==T.LINK&&pr(A)){const D=A.object.inReplyToId;(x[D]||(x[D]=[])).push(A),C.add(A.object.id)}}const I={};for(const[S,P]of Object.entries(b.pages)){const A=Number(S),D=[];for(const R of P){const M=b.byUid[R];if(!M||!pr(M)||C.has(M.object.id))continue;const N=x[M.object.id];D.push({page:A,annotation:M,replies:w[M.object.id]??[],...N&&N.length>0?{groupMembers:N}:{}})}D.length>0&&(I[A]=D)}return I})(o),m=new Set(d.map(function(b){var w;return(w=Jp(o,b.object.id))!==null&&w!==void 0?w:b.object.id}));$(function(){var b=m.values().next().value;if(b&&l.current){var w=s.current[b];if(w){var x=l.current,C=x.getBoundingClientRect(),I=w.getBoundingClientRect(),S=I.top-C.top+x.scrollTop-x.clientHeight/2+I.height/2;x.scrollTo({top:S,behavior:"smooth"})}}},[o.selectedUids]);var g=function(b,w){var x=y(b);x&&n?.updateAnnotation(x.object.pageIndex,b,{contents:w,modified:new Date})},p=function(b){n?.deleteAnnotation(b.object.pageIndex,b.object.id)},f=function(b,w){var x=y(b);x&&n?.createAnnotation(x.object.pageIndex,{id:pe(),rect:{origin:{x:x.object.rect.origin.x,y:x.object.rect.origin.y},size:{width:24,height:24}},pageIndex:x.object.pageIndex,created:new Date,modified:new Date,type:T.TEXT,contents:w,inReplyToId:x.object.id,flags:["noRotate","noZoom","print"],name:Pe.Comment})},v=Object.keys(u).map(Number).sort(function(b,w){return b-w}),y=function(b){var w,x=Dt(v);try{for(x.s();!(w=x.n()).done;){var C,I=w.value,S=Dt(u[I]);try{for(S.s();!(C=S.n()).done;){var P=C.value;if(P.annotation.object.id===b)return P.annotation;var A=P.replies.find(function(D){return D.object.id===b});if(A)return A}}catch(D){S.e(D)}finally{S.f()}}}catch(D){x.e(D)}finally{x.f()}};return v.length===0?h(ZC,{documentId:t}):h("div",{ref:l,className:"h-full overflow-y-auto"},h("div",{className:"space-y-6 p-3"},v.map(function(b){return h("div",{key:b,className:"space-y-3"},h("div",{className:"bg-bg-surface sticky top-0 z-10 px-1"},h("div",{className:"border-border-subtle border-b py-2"},h("h3",{className:"text-md text-fg-primary font-semibold"},r("comments.page",{params:{page:b+1}})),h("p",{className:"text-fg-muted text-sm"},u[b].length===1?r("comments.commentCount",{params:{count:1}}):r("comments.commentCountPlural",{params:{count:u[b].length}})))),h("div",{className:"space-y-3 px-1"},u[b].map(function(w){return h("div",{key:w.annotation.object.id,ref:function(x){x&&(s.current[w.annotation.object.id]=x)}},h(XC,{entry:w,isSelected:m.has(w.annotation.object.id),onSelect:function(){return x=w.annotation,n?.selectAnnotation(x.object.pageIndex,x.object.id),void(i==null||i.scrollToPage({pageNumber:x.object.pageIndex+1,pageCoordinates:{x:x.object.rect.origin.x,y:x.object.rect.origin.y},alignX:50,alignY:25,behavior:"smooth"}));var x},onUpdate:g,onDelete:p,onReply:f,documentId:t,isReadOnly:c}))})))})))};function QC(e){var t=e.documentId,n=(c=>{const{provides:d}=Gs(),[u,m]=O(zm);return $(()=>{if(!d)return;const g=d.forDocument(c);return m(g.getState()),g.onStateChange(p=>{m(p)})},[d,c]),{state:u,provides:d?.forDocument(c)??null}})(t),o=n.state,i=n.provides,r=q(O(""),2),a=r[0],s=r[1];if(!i)return null;var l=Math.round(100*o.currentZoomLevel);return $(function(){s(l.toString())},[l]),h("div",{className:"relative"},h("div",{className:"bg-interactive-hover flex items-center rounded"},h("div",{className:"flex min-w-0 flex-nowrap items-center overflow-hidden whitespace-nowrap"},h("input",{name:"zoom",type:"text",inputMode:"numeric",pattern:"\\d*",className:"h-6 w-8 min-w-0 shrink border-0 bg-transparent p-0 text-right text-sm outline-none focus:outline-none","aria-label":"Set zoom",autoFocus:!1,value:a,onInput:function(c){var d=c.target.value.replace(/[^0-9]/g,"");s(d)},onBlur:function(){(!a||parseFloat(a)<=0)&&s(l.toString())},onKeyDown:function(c){var d;c.key==="Enter"&&(c.preventDefault(),d=parseFloat(a),!isNaN(d)&&d>0&&i.requestZoom(d/100))}}),h("span",{className:"shrink-0 text-sm"},"%")),h(Xn,{commandId:"zoom:toggle-menu",documentId:t,itemId:"zoom-menu-button"}),h(Xn,{commandId:"zoom:out",documentId:t}),h(Xn,{commandId:"zoom:in",documentId:t})))}var JC=function(e){var t=e.documentId,n=Le(t).translate;return h("div",{class:"text-fg-muted flex flex-col items-center gap-2 p-4"},h(ye,{icon:"palette",className:"h-18 w-18 text-fg-muted"}),h("div",{className:"text-fg-muted max-w-[150px] text-center text-sm"},n("annotation.selectAnnotation")))},Vi={color:{key:"color",type:"colorWithTransparent",labelKey:"annotation.fillColor"},strokeColor:{key:"strokeColor",type:"colorWithTransparent",labelKey:"annotation.strokeColor"},strokeColorWithoutTransparent:{key:"strokeColor",type:"color",labelKey:"annotation.strokeColor"},opacity:{key:"opacity",type:"opacity",labelKey:"annotation.opacity",min:.1,max:1,step:.05,debounce:!0},strokeWidth:{key:"strokeWidth",type:"slider",labelKey:"annotation.strokeWidth",min:1,max:30,step:1,unit:"px",debounce:!0},strokeStyle:{key:"strokeStyle",type:"strokeStyle",labelKey:"annotation.borderStyle"},strokeStyleWithCloudy:{key:"strokeStyle",type:"strokeStyle",labelKey:"annotation.borderStyle",showCloudy:!0},lineEndings:{key:"lineEndings",type:"lineEndings",labelKey:"annotation.lineEndings"},fontFamily:{key:"fontFamily",type:"fontFamily",labelKey:"annotation.fontFamily"},fontSize:{key:"fontSize",type:"fontSize",labelKey:"annotation.fontSize"},fontColor:{key:"fontColor",type:"fontColor",labelKey:"annotation.fontColor"},textAlign:{key:"textAlign",type:"textAlign",labelKey:"annotation.textAlign"},verticalAlign:{key:"verticalAlign",type:"verticalAlign",labelKey:"annotation.verticalAlign"},blendMode:{key:"blendMode",type:"blendMode",labelKey:"annotation.blendMode"},rotation:{key:"rotation",type:"rotation",labelKey:"annotation.rotation",debounce:!0,editOnly:!0},overlayText:{key:"overlayText",type:"text",labelKey:"annotation.overlayText",placeholderKey:"annotation.overlayTextPlaceholder"}},gs={highlight:["strokeColor","opacity","blendMode"],underline:["strokeColor","opacity","blendMode"],strikeout:["strokeColor","opacity","blendMode"],squiggly:["strokeColor","opacity","blendMode"],ink:["strokeColor","opacity","strokeWidth","rotation"],inkHighlighter:["strokeColor","opacity","strokeWidth","blendMode","rotation"],signatureInk:["strokeColor","opacity","strokeWidth","rotation"],circle:["color","opacity","strokeColor","strokeStyleWithCloudy","strokeWidth","rotation"],square:["color","opacity","strokeColor","strokeStyleWithCloudy","strokeWidth","rotation"],polygon:["strokeColor","opacity","strokeStyleWithCloudy","strokeWidth","color","rotation"],line:["strokeColor","opacity","strokeStyle","strokeWidth","lineEndings","color","rotation"],lineArrow:["strokeColor","opacity","strokeStyle","strokeWidth","lineEndings","color","rotation"],polyline:["strokeColor","opacity","strokeStyle","strokeWidth","lineEndings","color","rotation"],textComment:["strokeColor","opacity"],insertText:["strokeColor","opacity"],replaceText:["strokeColor","opacity"],freeText:["fontFamily","fontSize","fontColor","textAlign","verticalAlign","opacity","color","rotation"],freeTextCallout:["fontFamily","fontSize","fontColor","textAlign","verticalAlign","opacity","color","strokeColorWithoutTransparent","strokeWidth"],stamp:["rotation"],redact:["strokeColor","color","opacity"],formTextField:["fontSize","fontColor","strokeColor","strokeWidth","color"],formCheckbox:["strokeColor","color","strokeWidth"],formCombobox:["fontSize","fontColor","strokeColor","strokeWidth","color"],formListbox:["fontFamily","fontSize","fontColor","strokeColor","strokeWidth","color"],formRadioButton:["strokeColor","color","strokeWidth"]},eI=["position"],Pv=function(){var e=q(O(!1),2),t=e[0],n=e[1],o=K(null),i=K(null);return $(function(){if(t){var r=function(a){o.current&&!o.current.contains(a.target)&&n(!1)};return document.addEventListener("click",r),function(){return document.removeEventListener("click",r)}}},[t]),$(function(){t&&i.current&&i.current.scrollIntoView({block:"center",inline:"start"})},[t]),{open:t,setOpen:n,rootRef:o,selectedItemRef:i}},yl=function(e){var t=e.value,n=e.onChange,o=e.options,i=e.getOptionKey,r=e.renderValue,a=e.renderOption,s=e.triggerClass,l=s===void 0?"px-3 py-2":s,c=Pv(),d=c.open,u=c.setOpen,m=c.rootRef,g=c.selectedItemRef;return h("div",{ref:m,class:"relative inline-block w-full"},h("button",{type:"button",class:"border-border-default bg-bg-input flex w-full items-center justify-between gap-2 rounded border ".concat(l),onClick:function(){return u(function(p){return!p})}},r(t),h("svg",{class:"text-fg-secondary h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},h("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z",clipRule:"evenodd"}))),d&&h("div",{class:"border-border-default bg-bg-elevated absolute z-10 mt-1 max-h-60 w-full overflow-y-auto rounded border p-1 shadow-lg"},o.map(function(p){var f=i(p)===i(t);return h("button",{ref:f?g:null,key:i(p),class:"hover:bg-interactive-hover block w-full rounded text-left ".concat(f?"bg-interactive-hover":""),onClick:function(){n(p),u(!1)}},a(p,f))})))},St=function(e){var t=e.children,n=e.className;return h("label",{class:"text-fg-primary mb-2 block text-sm font-medium ".concat(n===void 0?"":n)},t)},Mv=function(e){var t=e.children,n=e.className;return h("span",{class:"text-fg-muted text-xs ".concat(n===void 0?"":n)},t)},Lt=function(e){var t=e.children,n=e.className;return h("section",{class:"mb-6 ".concat(n===void 0?"":n)},t)},Dv=function(e){var t=e.value,n=e.min,o=n===void 0?0:n,i=e.max,r=i===void 0?1:i,a=e.step,s=a===void 0?.1:a,l=e.onChange;return h("input",{type:"range",class:"range-sm bg-border-subtle mb-2 h-1 w-full cursor-pointer appearance-none rounded-lg",value:t,min:o,max:r,step:s,onInput:function(c){return l(parseFloat(c.target.value))}})},fs=function(e){var t=e.color,n=e.active,o=e.onSelect,i=(function(r){return r==="transparent"||/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0\s*\)$/i.test(r)||/^#([0-9a-f]{8})$/i.test(r)&&r.slice(-2).toLowerCase()==="00"||/^#([0-9a-f]{4})$/i.test(r)&&r.slice(-1).toLowerCase()==="0"})(t)?{backgroundColor:"#fff",backgroundImage:"linear-gradient(45deg, transparent 40%, red 40%, red 60%, transparent 60%)",backgroundSize:"100% 100%"}:{backgroundColor:t};return h("button",{title:t,class:"border-border-strong h-5 w-5 rounded-full border ".concat(n?"outline-accent outline outline-2 outline-offset-2":""),style:i,onClick:function(){return o(t)}})},gu=[{id:ke.SOLID},{id:ke.DASHED,dash:[6,2]},{id:ke.DASHED,dash:[8,4]},{id:ke.DASHED,dash:[3,3]},{id:ke.DASHED,dash:[1,2]},{id:ke.DASHED,dash:[4,2,1,2]},{id:ke.DASHED,dash:[8,4,1,4]},{id:ke.SOLID,cloudyIntensity:1},{id:ke.SOLID,cloudyIntensity:2}],fu=function(e){var t;if(e.cloudyIntensity){for(var n=e.cloudyIntensity===1?3:5,o=Math.ceil(80/(2*n)),i=80/o,r=n+1,a=2*n+2,s=["M 0 ".concat(r)],l=0;l<o;l++)s.push("A ".concat(n," ").concat(n," 0 0 1 ").concat(i*(l+1)," ").concat(r));return h("svg",{width:"80",height:a,viewBox:"0 0 80 ".concat(a)},h("path",{d:s.join(" "),fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round","stroke-linecap":"round"}))}return h("svg",{width:"80",height:"8",viewBox:"0 0 80 8"},h("line",{x1:"0",y1:"4",x2:"80",y2:"4",style:{strokeDasharray:(t=e.dash)===null||t===void 0?void 0:t.join(" "),stroke:"currentColor",strokeWidth:"2"}}))};function tI(e){var t;return e.cloudyIntensity?"cloudy-".concat(e.cloudyIntensity):e.id+(((t=e.dash)===null||t===void 0?void 0:t.join("-"))||"")}var vu,nI=function(e){var t=e.value,n=e.onChange,o=e.showCloudy?gu:gu.filter(function(i){return!i.cloudyIntensity});return h(yl,{value:t,onChange:n,options:o,getOptionKey:tI,renderValue:function(i){return fu(i)},renderOption:function(i){return h("div",{class:"px-1 py-2"},fu(i))}})},oI=[ge.None,ge.Square,ge.Circle,ge.Diamond,ge.OpenArrow,ge.ClosedArrow,ge.ROpenArrow,ge.RClosedArrow,ge.Butt,ge.Slash],yu=function(e){var t,n=e.ending,o=e.position,i=ee(ee(ee(ee(ee(ee(ee(ee(ee({},ge.Square,h("path",{d:"M68 -4 L76 -4 L76 4 L68 4 Z"})),ge.Circle,h("circle",{cx:"72",cy:"0",r:"4"})),ge.Diamond,h("path",{d:"M72 -5 L77 0 L72 5 L67 0 Z"})),ge.OpenArrow,h("path",{d:"M67 -5 L77 0 L67 5",fill:"none"})),ge.ClosedArrow,h("path",{d:"M67 -5 L77 0 L67 5 Z"})),ge.ROpenArrow,h("path",{d:"M77 -5 L67 0 L77 5",fill:"none"})),ge.RClosedArrow,h("path",{d:"M77 -5 L67 0 L77 5 Z"})),ge.Butt,h("path",{d:"M72 -5 L72 5",fill:"none"})),ge.Slash,h("path",{d:"M67 -5 L77 5",fill:"none"})),r=ee(ee(ee(ee(ee(ee(ee(ee(ee({}
2381,ge.Square,68),ge.Circle,68),ge.Diamond,67),ge.OpenArrow,76),ge.ClosedArrow,67),ge.ROpenArrow,67),ge.RClosedArrow,67),ge.Butt,72),ge.Slash,72),a=i[n];return h("svg",{width:"80",height:"20",viewBox:"0 0 80 20",class:"text-fg-primary"},h("g",{transform:o==="start"?"rotate(180 40 10)":""},h("line",{x1:"4",y1:"10",x2:(t=r[n])!==null&&t!==void 0?t:77,y2:"10",stroke:"currentColor","stroke-width":"1.5"}),a&&h("g",{transform:"translate(0, 10)",fill:"currentColor",stroke:"currentColor","stroke-width":"1.5"},a)))},bu=function(e){var t=e.position,n=Cr(e,eI);return h(yl,B(B({},n),{},{options:oI,getOptionKey:function(o){return o},triggerClass:"px-3 py-1",renderValue:function(o){return h(yu,{ending:o,position:t})},renderOption:function(o){return h("div",{class:"px-1 py-1"},h(yu,{ending:o,position:t}))}}))},iI=function(e){return h(yl,B(B({},e),{},{options:Dy,getOptionKey:function(t){return t},triggerClass:"px-2 py-1 text-sm",renderValue:function(t){return h("span",null,ql(t))},renderOption:function(t){return h("div",{class:"px-2 py-1"},ql(t))}}))},rI=function(e){var t=e.value,n=e.onChange,o=(t%360+360)%360,i=function(r){n(((o+r)%360+360)%360)};return h("div",{class:"flex items-center gap-1"},h("button",{type:"button",title:"-90°",class:"border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover flex h-8 w-8 shrink-0 items-center justify-center rounded border",onClick:function(){return i(-90)}},h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M1 4v6h6"}),h("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"}))),h("div",{class:"relative flex-1"},h("input",{type:"number",min:"0",max:"359",class:"border-border-default bg-bg-input text-fg-primary h-8 w-full rounded border px-2 pr-6 text-center text-sm",value:o,onInput:function(r){var a=parseInt(r.target.value,10);Number.isFinite(a)&&n((a%360+360)%360)}}),h("span",{class:"text-fg-muted pointer-events-none absolute inset-y-0 right-2 flex items-center text-xs"},"°")),h("button",{type:"button",title:"+90°",class:"border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover flex h-8 w-8 shrink-0 items-center justify-center rounded border",onClick:function(){return i(90)}},h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M23 4v6h-6"}),h("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"}))))},aI=function(e){var t=e.value,n=e.onChange,o=e.options,i=o===void 0?[8,9,10,11,12,14,16,18,24,36,48,72]:o,r=Pv(),a=r.open,s=r.setOpen,l=r.rootRef,c=r.selectedItemRef;return h("div",{ref:l,class:"relative w-full"},h("input",{type:"number",min:"1",class:"border-border-default bg-bg-input w-full rounded border px-2 py-1 pr-7 text-sm",value:t,onInput:function(d){var u=parseInt(d.target.value,10);Number.isFinite(u)&&u>0&&n(u)},onClick:function(){return s(!0)}}),h("button",{type:"button",class:"absolute inset-y-0 right-1 flex items-center",onClick:function(){return s(function(d){return!d})},tabIndex:-1},h("svg",{class:"text-fg-secondary h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},h("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"}))),a&&h("div",{class:"border-border-default bg-bg-elevated absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded border shadow-lg"},i.map(function(d){var u=d===t;return h("button",{ref:u?c:null,key:d,class:"hover:bg-interactive-hover block w-full px-2 py-1 text-left text-sm ".concat(u?"bg-interactive-hover":""),onClick:function(){n(d),s(!1)}},d)})))};function Ln(e){var t=e.active,n=t!==void 0&&t,o=e.disabled,i=o!==void 0&&o,r=e.onClick,a=e.title,s=e.children,l=e.className,c=l===void 0?"":l;return h("button",{type:"button",title:a,disabled:i,onClick:r,className:"h-9 w-9 rounded border px-2 py-1 text-sm transition-colors ".concat(n?"border-accent bg-accent text-fg-on-accent":"border-border-default bg-bg-input text-fg-primary hover:bg-interactive-hover"," disabled:cursor-not-allowed disabled:opacity-40 ").concat(c)},s)}function sI(e){switch(e.config.type){case"color":return k(wu,B(B({},e),{},{allowTransparent:!1}));case"colorWithTransparent":return k(wu,B(B({},e),{},{allowTransparent:!0}));case"opacity":return k(lI,B({},e));case"slider":return k(cI,B({},e));case"strokeStyle":return k(dI,B({},e));case"lineEndings":return k(uI,B({},e));case"fontFamily":return k(hI,B({},e));case"fontSize":return k(mI,B({},e));case"fontColor":return k(pI,B({},e));case"textAlign":return k(gI,B({},e));case"verticalAlign":return k(fI,B({},e));case"blendMode":return k(yI,B({},e));case"text":return k(bI,B({},e));case"rotation":return k(wI,B({},e));default:return null}}function wu(e){var t=e.config,n=e.value,o=e.onChange,i=e.colorPresets,r=e.translate,a=e.allowTransparent,s=q(O(n??"#000000"),2),l=s[0],c=s[1];$(function(){return c(n??"#000000")},[n]);var d=function(u){c(u),o(u)};return k(Lt,{children:[k(St,{className:"mb-3",children:r(t.labelKey)}),k("div",{class:"grid grid-cols-6 gap-x-1 gap-y-4",children:[i.map(function(u){return k(fs,{color:u,active:u.toLowerCase()===l?.toLowerCase(),onSelect:d},u)}),a&&k(fs,{color:"transparent",active:l==="transparent",onSelect:d})]})]})}function lI(e){var t,n,o,i=e.config,r=e.value,a=e.onChange,s=e.translate,l=q(O(r??1),2),c=l[0],d=l[1];$(function(){return d(r??1)},[r]);var u=Ai(c,300);return $(function(){u!==r&&a(u)},[u]),k(Lt,{children:[k(St,{children:s(i.labelKey)}),k(Dv,{value:c,min:(t=i.min)!==null&&t!==void 0?t:.1,max:(n=i.max)!==null&&n!==void 0?n:1,step:(o=i.step)!==null&&o!==void 0?o:.05,onChange:d}),k(Mv,{children:[Math.round(100*c),"%"]})]})}function cI(e){var t,n,o,i,r,a=e.config,s=e.value,l=e.onChange,c=e.translate,d=q(O((t=s??a.min)!==null&&t!==void 0?t:1),2),u=d[0],m=d[1];$(function(){var p;return m((p=s??a.min)!==null&&p!==void 0?p:1)},[s]);var g=Ai(u,300);return $(function(){g!==s&&l(g)},[g]),k(Lt,{children:[k(St,{children:c(a.labelKey)}),k(Dv,{value:u,min:(n=a.min)!==null&&n!==void 0?n:1,max:(o=a.max)!==null&&o!==void 0?o:30,step:(i=a.step)!==null&&i!==void 0?i:1,onChange:m}),k(Mv,{children:[u,(r=a.unit)!==null&&r!==void 0?r:""]})]})}function dI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(Yn(n)==="object"&&n!==null?n:{id:n??ke.SOLID}),2),a=r[0],s=r[1];return $(function(){var l=Yn(n)==="object"&&n!==null?n:{id:n??ke.SOLID};s(l)},[n]),k(Lt,{children:[k(St,{className:"mb-3",children:i(t.labelKey)}),k(nI,{value:a,onChange:function(l){var c;s(l),o({strokeStyle:l.id,strokeDashArray:l.dash,cloudyBorderIntensity:(c=l.cloudyIntensity)!==null&&c!==void 0?c:0})},showCloudy:t.showCloudy})]})}function uI(e){e.config;
2381var t=e.value,n=e.onChange,o=e.translate,i=t??{start:ge.None,end:ge.None},r=q(O(i.start),2),a=r[0],s=r[1],l=q(O(i.end),2),c=l[0],d=l[1];return $(function(){s(i.start),d(i.end)},[t]),k(Lt,{children:k("div",{class:"grid grid-cols-2 gap-4",children:[k("div",{children:[k(St,{className:"mb-3",children:o("annotation.lineStart")}),k(bu,{value:a,onChange:function(u){s(u),n({start:u,end:c})},position:"start"})]}),k("div",{children:[k(St,{className:"mb-3",children:o("annotation.lineEnd")}),k(bu,{value:c,onChange:function(u){d(u),n({start:a,end:u})},position:"end"})]})]})})}function hI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=n??Ee.Helvetica,a=Gl(r),s=Wo(r),l=Ho(r),c=q(O(a),2),d=c[0],u=c[1],m=q(O(s),2),g=m[0],p=m[1],f=q(O(l),2),v=f[0],y=f[1];$(function(){var w=n??Ee.Helvetica;u(Gl(w)),p(Wo(w)),y(Ho(w))},[n]);var b=function(w,x,C){var I=Un(w,{bold:x,italic:C});o(I)};return k(Lt,{children:[k(St,{children:i(t.labelKey)}),k("div",{class:"mb-3",children:k(iI,{value:d,onChange:function(w){var x=Wo(Un(w,{bold:!0,italic:!1})),C=Ho(Un(w,{bold:!1,italic:!0})),I=!!x&&g,S=!!C&&v;u(w),p(I),y(S),b(w,I,S)}})}),k("div",{class:"flex gap-2",children:[k(Ln,{title:"Bold",active:g,disabled:!Wo(Un(d,{bold:!0,italic:!1})),onClick:function(){if(Wo(Un(d,{bold:!0,italic:!1}))){var w=!g;p(w),b(d,w,v)}},className:"font-bold",children:k(ye,{icon:"bold",size:18})}),k(Ln,{title:"Italic",active:v,disabled:!Ho(Un(d,{bold:!1,italic:!0})),onClick:function(){if(Ho(Un(d,{bold:!1,italic:!0}))){var w=!v;y(w),b(d,g,w)}},className:"italic",children:k(ye,{icon:"italic",size:18})})]})]})}function mI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??12),2),a=r[0],s=r[1];return $(function(){return s(n??12)},[n]),k(Lt,{children:[k(St,{children:i(t.labelKey)}),k(aI,{value:a,onChange:function(l){!Number.isFinite(l)||l<=0||(s(l),o(l))}})]})}function pI(e){var t=e.config,n=e.value,o=e.onChange,i=e.colorPresets,r=e.translate,a=q(O(n??"#000000"),2),s=a[0],l=a[1];$(function(){return l(n??"#000000")},[n]);var c=function(d){l(d),o(d)};return k(Lt,{children:[k(St,{className:"mb-3",children:r(t.labelKey)}),k("div",{class:"grid grid-cols-6 gap-x-1 gap-y-4",children:i.map(function(d){return k(fs,{color:d,active:d.toLowerCase()===s?.toLowerCase(),onSelect:c},d)})})]})}function gI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??Xe.Left),2),a=r[0],s=r[1];$(function(){return s(n??Xe.Left)},[n]);var l=function(c){s(c),o(c)};return k(Lt,{children:[k(St,{children:i(t.labelKey)}),k("div",{class:"flex gap-2",children:[k(Ln,{title:"Align left",active:a===Xe.Left,onClick:function(){return l(Xe.Left)},children:k(ye,{icon:"alignLeft",size:18})}),k(Ln,{title:"Align center",active:a===Xe.Center,onClick:function(){return l(Xe.Center)},children:k(ye,{icon:"alignCenter",size:18})}),k(Ln,{title:"Align right",active:a===Xe.Right,onClick:function(){return l(Xe.Right)},children:k(ye,{icon:"alignRight",size:18})})]})]})}function fI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??mt.Top),2),a=r[0],s=r[1];$(function(){return s(n??mt.Top)},[n]);var l=function(c){s(c),o(c)};return k(Lt,{children:[k(St,{children:i(t.labelKey)}),k("div",{class:"flex gap-2",children:[k(Ln,{title:"Align top",active:a===mt.Top,onClick:function(){return l(mt.Top)},children:k(ye,{icon:"alignTop",size:18})}),k(Ln,{title:"Align middle",active:a===mt.Middle,onClick:function(){return l(mt.Middle)},children:k(ye,{icon:"alignMiddle",size:18})}),k(Ln,{title:"Align bottom",active:a===mt.Bottom,onClick:function(){return l(mt.Bottom)},children:k(ye,{icon:"alignBottom",size:18})})]})]})}var vI=(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(vu={},ve.Normal,"blendMode.normal"),ve.Multiply,"blendMode.multiply"),ve.Screen,"blendMode.screen"),ve.Overlay,"blendMode.overlay"),ve.Darken,"blendMode.darken"),ve.Lighten,"blendMode.lighten"),ve.ColorDodge,"blendMode.colorDodge"),ve.ColorBurn,"blendMode.colorBurn"),ve.HardLight,"blendMode.hardLight"),ve.SoftLight,"blendMode.softLight"),ee(ee(ee(ee(ee(ee(vu,ve.Difference,"blendMode.difference"),ve.Exclusion,"blendMode.exclusion"),ve.Hue,"blendMode.hue"),ve.Saturation,"blendMode.saturation"),ve.Color,"blendMode.color"),ve.Luminosity,"blendMode.luminosity"));function yI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??ve.Normal),2),a=r[0],s=r[1];return $(function(){return s(n??ve.Normal)},[n]),k(Lt,{children:[k(St,{children:i(t.labelKey)}),k("select",{class:"border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1 text-sm",value:a,onChange:function(l){var c=parseInt(l.target.value,10);s(c),o(c)},children:Ty.map(function(l){return k("option",{value:l,children:i(vI[l])},l)})})]})}function bI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??""),2),a=r[0],s=r[1];$(function(){return s(n??"")},[n]);var l=Ai(a,300);return $(function(){l!==n&&o(l)},[l]),k(Lt,{children:[k(St,{children:i(t.labelKey)}),k("input",{type:"text",class:"border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1 text-sm",value:a,onInput:function(c){var d=c.target.value;s(d)},placeholder:t.placeholderKey?i(t.placeholderKey):void 0})]})}function wI(e){var t=e.config,n=e.value,o=e.onChange,i=e.translate,r=q(O(n??0),2),a=r[0],s=r[1];$(function(){return s(n??0)},[n]);var l=Ai(a,300);return $(function(){l!==(n??0)&&o(l)},[l]),k(Lt,{children:[k(St,{children:i(t.labelKey)}),k(rI,{value:a,onChange:s})]})}function xI(e){var t=e.documentId,n=e.annotations,o=e.activeTool,i=e.colorPresets,r=zt().provides,a=Le(t).translate;if(!r)return null;var s=n.length>0,l=s?n.map(function(p){var f;return(f=r.findToolForAnnotation(p.object))===null||f===void 0?void 0:f.id}).filter(function(p){return p!==void 0}):o?[o.id]:[];if(l.length===0)return null;var c=(function(p){var f;if(p.length===0)return[];for(var v=Eo(new Set(p)),y=v.map(function(S){var P;return new Set((P=gs[S])!==null&&P!==void 0?P:[])}),b=y[0],w=1;w<y.length;w++){var x,C=Dt(b);try{for(C.s();!(x=C.n()).done;){var I=x.value;y[w].has(I)||b.delete(I)}}catch(S){C.e(S)}finally{C.f()}}return((f=gs[v[0]])!==null&&f!==void 0?f:[]).filter(function(S){return b.has(S)})})(l),d=s?c:c.filter(function(p){var f;return!((f=Vi[p])!==null&&f!==void 0&&f.editOnly)});if(d.length===0)return null;var u=s?n[0].object:o?.defaults,m=function(p){r&&(s?r.updateAnnotations(n.map(function(f){return{pageIndex:f.object.pageIndex,id:f.object.id,patch:p}})):o&&r.setToolDefaults(o.id,p))},g=function(p){if(u){var f=Vi[p];if(f){if(f.type==="strokeStyle"){var v=u;return B({id:v.strokeStyle,dash:v.strokeDashArray},f.showCloudy&&{cloudyIntensity:v.cloudyBorderIntensity})}return u[f.key]}}};return h(de,null,d.map(function(p){var f=Vi[p];return f?h(sI,{key:p,config:f,value:g(p),onChange:function(v){return(function(y,b){var w=Vi[y];if(w)if(w.type!=="strokeStyle"||Yn(b)!=="object")w.type!=="lineEndings"?m(ee({},w.key,b)):m({lineEndings:b});else{var x,C={strokeStyle:b.strokeStyle,strokeDashArray:b.strokeDashArray};w.showCloudy&&(C.cloudyBorderIntensity=(x=b.cloudyBorderIntensity)!==null&&x!==void 0?x:0),m(C)}})(p,v)},colorPresets:i,translate:a}):null}))}function kI(e){var t,n,o,i,r,a=e.documentId,s=zt().provides,l=tl(a),c=l.provides,d=l.state,u=Le(a).translate;if(!s||!c)return null;var m=(t=s?.getColorPresets())!==null&&t!==void 0?t:[],g=ii(d),p=c.getActiveTool(),f=g.length>0,v=g.length>1,y=f?c.findToolForAnnotation(g[0].object):p,b=u((n=y?.labelKey)!==null&&n!==void 0?n:"",{fallback:(o=y?.name)!==null&&o!==void 0?o:""}),w="";v?w=u("annotation.multiSelect",{params:{count:String(g.length)}}):f&&y?w=u("annotation.styles",{params:{type:b}}):p&&(w=u("annotation.defaults",{params:{type:b}}));var x=y?.id;return x!==void 0&&((i=(r=gs[x])===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0||f||p?k("div",{class:"h-full overflow-y-auto p-4",children:[w&&k("h2",{class:"text-md mb-4 font-medium",children:w}),k(xI,{documentId:a,annotations:g,activeTool:p,colorPresets:m})]}):k(JC,{documentId:a})}var CI=function(e){var t=e.item,n=e.pageNumber,o=e.isSelected,i=e.onSelect,r=t.kind==="text"?mv:pv;return h("div",{onClick:i,class:"border-border-subtle hover:bg-interactive-hover flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors ".concat(o?"bg-interactive-selected ring-accent ring-1":"")},h("div",{class:"flex-shrink-0"},h(r,{size:20,primaryColor:t.markColor,secondaryColor:t.redactionColor})),h("div",{class:"min-w-0 flex-1"},h("div",{class:"text-fg-muted text-xs"},"Page ",n),h("div",{class:"text-fg-primary text-sm font-medium"},t.kind==="text"?"Text Redaction":"Area Redaction"),t.kind==="text"&&t.text&&h("div",{class:"text-fg-muted mt-1 truncate text-xs italic"},'"',t.text,'"')))},II=function(e){var t=e.documentId,n=Le(t).translate;return h("div",{class:"text-fg-muted flex flex-col items-center gap-2 p-4"},h(ye,{icon:"redact",className:"h-18 w-18 text-fg-muted"}),h("div",{className:"text-fg-muted max-w-[150px] text-center text-sm"},n("redaction.emptyState",{fallback:"No pending redactions"}
vendor: 12,558 bytes, line 2381
2381)))};function SI(e){var t=e.documentId,n=(u=>{const{provides:m}=Lf(),[g,p]=O(er),f=Z(()=>m?m.forDocument(u):null,[m,u]);return $(()=>{if(f){try{p(f.getState())}catch{p(er)}return f.onStateChange(v=>{p(v)})}p(er)},[f]),{state:g,provides:f}})(t),o=n.state,i=n.provides,r=zr(t),a=r.canModifyAnnotations,s=r.canModifyContents,l=io().provides,c=Le(t).translate,d=Object.entries(o.pending).flatMap(function(u){var m=q(u,2),g=m[0];return m[1].map(function(p){return{item:p,pageNumber:Number(g)+1}})}).sort(function(u,m){return u.pageNumber-m.pageNumber});return h("div",{class:"flex h-full flex-col"},h("div",{class:"border-border-subtle border-b p-3"},h("h2",{class:"text-fg-primary text-md font-semibold"},c("redaction.panel.title",{fallback:"Redactions"})),d.length>0&&h("p",{class:"text-fg-muted text-sm"},d.length===1?c("redaction.panel.itemCount",{fallback:"1 pending redaction",params:{count:1}}):c("redaction.panel.itemCountPlural",{fallback:"".concat(d.length," pending redactions"),params:{count:d.length}}))),h("div",{class:"flex-1 overflow-y-auto p-3"},d.length===0?h(II,{documentId:t}):h("div",{class:"space-y-2"},d.map(function(u){var m,g=u.item,p=u.pageNumber;return h(CI,{key:g.id,item:g,pageNumber:p,onSelect:function(){return(function(f){i?.selectPending(f.page,f.id),l?.scrollToPage({pageNumber:f.page+1,pageCoordinates:{x:f.rect.origin.x,y:f.rect.origin.y},alignX:50,alignY:25,behavior:"smooth"})})(g)},isSelected:((m=o.selected)===null||m===void 0?void 0:m.id)===g.id})}))),d.length>0&&h("div",{class:"border-border-subtle flex gap-2 border-t p-3"},h(Je,{onClick:function(){i?.clearPending()},disabled:!a,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover flex-1 rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},c("redaction.panel.clearAll",{fallback:"Clear All"})),h(Je,{onClick:function(){i?.commitAllPending()},disabled:!s,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover flex-1 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},c("redaction.panel.redactAll",{fallback:"Redact All"}))))}var AI=ee(ee(ee(ee(ee({},he.TEXTFIELD,"form.textfield"),he.CHECKBOX,"form.checkbox"),he.RADIOBUTTON,"form.radiobutton"),he.COMBOBOX,"form.combobox"),he.LISTBOX,"form.listbox"),PI=ee(ee(ee(ee(ee({},he.TEXTFIELD,"Text Field"),he.CHECKBOX,"Checkbox"),he.RADIOBUTTON,"Radio Button"),he.COMBOBOX,"Dropdown"),he.LISTBOX,"List Box"),Zn="border-border-default bg-bg-input text-fg-primary w-full rounded border px-2 py-1.5 text-sm",MI=function(e){var t,n,o=e.documentId,i=tl(o),r=i.provides,a=i.state,s=Xr().provides,l=Le(o).translate,c=q(O(null),2),d=c[0],u=c[1];if(!r||!s)return null;var m=ii(a);if(m.length!==1)return null;var g=m[0].object;if(g.type!==T.WIDGET)return null;var p=g,f=l((t=AI[p.field.type])!==null&&t!==void 0?t:"",{fallback:(n=PI[p.field.type])!==null&&n!==void 0?n:"Widget"}),v=l("annotation.styles",{params:{type:f}}),y=W(function(x){r.updateAnnotations([{pageIndex:p.pageIndex,id:p.id,patch:x}])},[r,p.pageIndex,p.id]),b=W(function(x){y({field:B(B({},p.field),x)})},[y,p.field]),w=W(function(x,C){s.renameField(p.id,x,o).wait(function(I){var S,P;u(null),I.outcome==="conflict"&&((S=(P=globalThis.confirm)===null||P===void 0?void 0:P.call(globalThis,"Share this ".concat(f,' with the existing field "').concat(I.fieldName,'"?')))!==null&&S!==void 0&&S?s.shareField(p.id,I.targetAnnotationId,o).wait(function(){return u(null)},function(A){u(A.reason.message),C.value=p.field.name}):C.value=p.field.name)},function(I){u(I.reason.message),C.value=p.field.name})},[o,f,s,p.field.name,p.id]);return k("div",{class:"h-full overflow-y-auto p-4",children:[k("h2",{class:"text-fg-secondary text-md mb-4 font-medium",children:v}),p.field.type===he.TEXTFIELD&&k(DI,{field:p.field,updateField:b,renameField:w,fieldNameError:d,translate:l}),p.field.type===he.RADIOBUTTON&&k(RI,{field:p.field,updateField:b,renameField:w,fieldNameError:d,translate:l}),p.field.type===he.CHECKBOX&&k(TI,{field:p.field,updateField:b,renameField:w,fieldNameError:d,translate:l}),(p.field.type===he.COMBOBOX||p.field.type===he.LISTBOX)&&k(EI,{field:p.field,updateField:b,renameField:w,fieldNameError:d,translate:l})]})};function Qr(e,t){return W(function(n,o){var i,r=(i=e.flag)!==null&&i!==void 0?i:me.NONE;t({flag:o?r|n:r&~n})},[e.flag,t])}function DI(e){var t,n,o=e.field,i=e.updateField,r=e.renameField,a=e.fieldNameError,s=e.translate,l=Qr(o,i),c=(t=o.maxLen)!==null&&t!==void 0?t:0,d=!!(o.flag&me.TEXT_COMB);return k("div",{class:"space-y-4",children:[k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[s("form.fieldName",{fallback:"Field Name"}),"*:"]}),k("input",{type:"text",class:Zn,value:o.name,onBlur:function(u){return r(u.target.value,u.target)},onKeyDown:function(u){u.key==="Enter"&&u.target.blur()}}),a&&k("p",{class:"mt-1 text-xs text-red-600",children:a})]}),k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[s("form.defaultValue",{fallback:"Default Value"}),":"]}),k("input",{type:"text",class:Zn,value:(n=o.value)!==null&&n!==void 0?n:"",maxLength:c>0?c:void 0,onBlur:function(u){return i({value:u.target.value})},onKeyDown:function(u){u.key==="Enter"&&u.target.blur()}})]}),k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[s("form.maxLength",{fallback:"Max Length"}),":"]}),k("input",{type:"number",min:"0",class:Zn,value:c||"",placeholder:"0 (unlimited)",onBlur:function(u){var m=parseInt(u.target.value,10),g=isNaN(m)||m<=0?void 0:m;i({maxLen:g}),!g&&d&&l(me.TEXT_COMB,!1)},onKeyDown:function(u){u.key==="Enter"&&u.target.blur()}})]}),k("hr",{class:"border-border-default"}),k("div",{children:[k("h3",{class:"text-fg-primary mb-3 text-sm font-medium",children:s("form.properties",{fallback:"Properties"})}),k("div",{class:"flex flex-col gap-3",children:[k(Rt,{label:s("form.readOnly",{fallback:"Read Only"}),checked:!!(o.flag&me.READONLY),onChange:function(u){return l(me.READONLY,u)}}),k(Rt,{label:s("form.required",{fallback:"Required"}),checked:!!(o.flag&me.REQUIRED),onChange:function(u){return l(me.REQUIRED,u)}}),k(Rt,{label:s("form.multiline",{fallback:"Multiline"}),checked:!!(o.flag&me.TEXT_MULTIPLINE),onChange:function(u){return l(me.TEXT_MULTIPLINE,u)}}),k(Rt,{label:s("form.comb",{fallback:"Comb"}),checked:d,disabled:c<=0,onChange:function(u){return l(me.TEXT_COMB,u)}})]})]})]})}function TI(e){var t=e.field,n=e.updateField,o=e.renameField,i=e.fieldNameError,r=e.translate,a=Qr(t,n);return k("div",{class:"space-y-4",children:[k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[r("form.fieldName",{fallback:"Field Name"}),"*:"]}),k("input",{type:"text",class:Zn,value:t.name,onBlur:function(s){return o(s.target.value,s.target)},onKeyDown:function(s){s.key==="Enter"&&s.target.blur()}}),i&&k("p",{class:"mt-1 text-xs text-red-600",children:i})]}),k("hr",{class:"border-border-default"}),k("div",{children:[k("h3",{class:"text-fg-primary mb-3 text-sm font-medium",children:r("form.properties",{fallback:"Properties"})}),k("div",{class:"flex flex-col gap-3",children:[k(Rt,{label:r("form.readOnly",{fallback:"Read Only"}),checked:!!(t.flag&me.READONLY),onChange:function(s){return a(me.READONLY,s)}}),k(Rt,{label:r("form.required",{fallback:"Required"}),checked:!!(t.flag&me.REQUIRED),onChange:function(s){return a(me.REQUIRED,s)}})]})]})]})}function RI(e){var t=e.field,n=e.updateField,o=e.renameField,i=e.fieldNameError,r=e.translate,a=Qr(t,n);return k("div",{class:"space-y-4",children:[k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[r("form.fieldName",{fallback:"Field Name"}),"*:"]}),k("input",{type:"text",class:Zn,value:t.name,onBlur:function(s){return o(s.target.value,s.target)},onKeyDown:function(s){s.key==="Enter"&&s.target.blur()}}),i&&k("p",{class:"mt-1 text-xs text-red-600",children:i})]}),k("hr",{class:"border-border-default"}),k("div",{children:[k("h3",{class:"text-fg-primary mb-3 text-sm font-medium",children:r("form.properties",{fallback:"Properties"})}),k("div",{class:"flex flex-col gap-3",children:[k(Rt,{label:r("form.readOnly",{fallback:"Read Only"}),checked:!!(t.flag&me.READONLY),onChange:function(s){return a(me.READONLY,s)}}),k(Rt,{label:r("form.required",{fallback:"Required"}),checked:!!(t.flag&me.REQUIRED),onChange:function(s){return a(me.REQUIRED,s)}})]})]})]})}function EI(e){var t=e.field,n=e.updateField,o=e.renameField,i=e.fieldNameError,r=e.translate,a=Qr(t,n),s=t.type===he.COMBOBOX||t.type===he.LISTBOX?t.options:[],l=W(function(c){n({options:c})},[n]);return k("div",{class:"space-y-4",children:[k("div",{children:[k("label",{class:"text-fg-secondary mb-1 block text-xs font-medium",children:[r("form.fieldName",{fallback:"Field Name"}),"*:"]}),k("input",{type:"text",class:Zn,value:t.name,onBlur:function(c){return o(c.target.value,c.target)},onKeyDown:function(c){c.key==="Enter"&&c.target.blur()}}),i&&k("p",{class:"mt-1 text-xs text-red-600",children:i})]}),k("hr",{class:"border-border-default"}),k("div",{children:[k("h3",{class:"text-fg-primary mb-3 text-sm font-medium",children:r("form.options",{fallback:"Options"})}),k("div",{class:"flex flex-col gap-2",children:[s.map(function(c,d){return k("div",{class:"flex items-center gap-2",children:[k("input",{type:"text",class:Zn+" flex-1",value:c.label,onBlur:function(u){var m=u.target.value;if(m!==c.label){var g=s.map(function(p,f){return f===d?B(B({},p),{},{label:m}):p});l(g)}},onKeyDown:function(u){u.key==="Enter"&&u.target.blur()}}),k("button",{type:"button",class:"text-fg-secondary hover:text-fg-primary shrink-0 text-sm",onClick:function(){var u=s.filter(function(m,g){return g!==d});l(u)},title:r("form.removeOption",{fallback:"Remove"}),children:"✕"})]},d)}),k("button",{type:"button",class:"text-accent-primary hover:text-accent-primary-hover mt-1 text-left text-sm",onClick:function(){l([].concat(Eo(s),[{label:"Option ".concat(s.length+1),isSelected:!1}]))},children:["+ ",r("form.addOption",{fallback:"Add Option"})]})]})]}),k("hr",{class:"border-border-default"}),k("div",{children:[k("h3",{class:"text-fg-primary mb-3 text-sm font-medium",children:r("form.properties",{fallback:"Properties"})}),k("div",{class:"flex flex-col gap-3",children:[k(Rt,{label:r("form.readOnly",{fallback:"Read Only"}),checked:!!(t.flag&me.READONLY),onChange:function(c){return a(me.READONLY,c)}}),k(Rt,{label:r("form.required",{fallback:"Required"}),checked:!!(t.flag&me.REQUIRED),onChange:function(c){return a(me.REQUIRED,c)}}),t.type===he.LISTBOX&&k(Rt,{label:r("form.multiSelect",{fallback:"Multi Select"}),checked:!!(t.flag&me.CHOICE_MULTL_SELECT),onChange:function(c){return a(me.CHOICE_MULTL_SELECT,c)}})]})]})]})}function zI(e){var t=e.documentId,n=e.selectedLibraryId,o=Le(t).translate,i=Jo().provides,r=(()=>{const{provides:p}=Jo(),[f,v]=O(p?.getLibraries()??[]);return $(()=>{if(p)return v(p.getLibraries()),p.onLibraryChange(y=>{v(y)})},[p]),{libraries:f,provides:p}})(),a=r.libraries,s=q(O("all"),2),l=s[0],c=s[1],d=((p,f)=>{const{provides:v}=Jo(),[y,b]=O([]);return $(()=>{if(!v)return;const w=()=>{var x,C;const I=v.getLibraries(),S=[];for(const P of I)if(!p||p==="all"||P.id===p)for(const A of P.stamps){{const D=((x=P.categories)==null?void 0:x.includes(f))??!1,R=((C=A.categories)==null?void 0:C.includes(f))??!1;if(!D&&!R)continue}S.push({library:P,stamp:A})}b(S)};return w(),v.onLibraryChange(w)},[v,p,f]),y})(l,"sidebar"),u=(p=>{const{provides:f}=Jo(),[v,y]=O(null);return $(()=>{if(!f)return;const b=f.forDocument(p);return y(b.getActiveStamp()),b.onActiveStampChange(y)},[f,p]),v})(t);$(function(){n&&c(n)},[n]);var m=W(function(p,f){i&&i.forDocument(t).activateStampPlacement(p,f)},[i,t]),g=W(function(p,f,v){p.stopPropagation(),i&&i.removeStampFromLibrary(f,v).wait(function(){},et)},[i]);return W(function(){if(i){var p,f=Eo(new Set(d.map(function(b){return b.library.id}))),v=Dt(f);try{for(v.s();!(p=v.n()).done;){var y=p.value;i.exportLibrary(y).wait(function(b){var w=new Blob([b.pdf],{type:"application/pdf"}),x=URL.createObjectURL(w),C=document.createElement("a");C.href=x,C.download="".concat(b.name,".pdf"),C.click(),URL.revokeObjectURL(x)},et)}}catch(b){v.e(b)}finally{v.f()}}},[i,d]),h("div",{class:"flex h-full flex-col"},h("div",{class:"border-border-subtle border-b p-4"},h("div",{class:"flex items-center justify-between"},h("h2",{class:"text-fg-primary text-md font-medium"},o("stamp.title",{fallback:"Rubber Stamps"}
2381))),a.length>1&&h("select",{class:"border-border-default bg-bg-input focus:border-accent focus:ring-accent text-fg-primary mt-4 w-full rounded-md border px-3 py-1.5 text-sm focus:outline-none focus:ring-1",value:l,onChange:function(p){return c(p.target.value)}},h("option",{value:"all"},o("stamp.allStamps",{fallback:"All Stamps"})),a.map(function(p){return h("option",{key:p.id,value:p.id},(function(f){var v;return o((v=f.nameKey)!==null&&v!==void 0?v:"",{fallback:f.name})})(p))}))),d.length>0?h("div",{class:"flex-1 overflow-y-auto p-4"},h("div",{class:"grid grid-cols-2 gap-3"},d.map(function(p){var f=p.library,v=p.stamp,y=u?.libraryId===f.id&&u?.stamp.id===v.id;return h("div",{key:"".concat(f.id,"-").concat(v.id),class:"group relative flex cursor-pointer items-center justify-center overflow-hidden rounded-md border transition-colors ".concat(y?"border-accent bg-accent-light ring-accent ring-2":"border-border-subtle bg-bg-surface hover:bg-interactive-hover hover:border-border-default"),style:{aspectRatio:"1"},onClick:function(){return m(f.id,v)}},h(Yx,{libraryId:f.id,pageIndex:v.pageIndex,width:120,style:{maxWidth:"80%",maxHeight:"80%",objectFit:"contain"}}),!f.readonly&&h("button",{class:"bg-bg-surface border-border-default text-fg-muted hover:text-fg-primary absolute right-1 top-1 flex rounded-full border p-0.5 opacity-0 shadow-sm transition-opacity group-hover:opacity-100",onClick:function(b){return g(b,f.id,v.id)}},h(ye,{icon:"x",className:"h-3 w-3"})))}))):h("div",{class:"text-fg-muted mt-8 flex flex-col items-center gap-2 p-4"},h(ye,{icon:"rubberStamp",className:"h-18 w-18 text-fg-muted"}),h("div",{class:"text-fg-muted max-w-[150px] text-center text-sm"},o("stamp.emptyState",{fallback:"No stamps found in the selected library."}))))}function LI(e){var t,n=e.documentId,o=Le(n).translate,i=(()=>{const{provides:f}=rs(),[v,y]=O(f?.getEntries()??[]);return $(()=>{if(f)return y(f.getEntries()),f.onEntriesChange(b=>{y(b)})},[f]),{entries:v,provides:f}})(),r=i.entries,a=i.provides,s=(f=>{const{provides:v}=rs(),[y,b]=O(null);return $(()=>{if(!v)return;const w=v.forDocument(f);return b(w.getActivePlacement()),w.onActivePlacementChange(b)},[v,f]),y})(n),l=We("ui").provides,c=((t=a?.mode)!==null&&t!==void 0?t:Nn.SignatureOnly)===Nn.SignatureAndInitials,d=W(function(){l&&l.forDocument(n).openModal("signature-create-modal")},[l,n]),u=W(function(f){a&&a.forDocument(n).activateSignaturePlacement(f)},[a,n]),m=W(function(f){a&&a.forDocument(n).activateInitialsPlacement(f)},[a,n]),g=W(function(f,v){f.stopPropagation(),a&&a.removeEntry(v)}
vendor: 5,489 bytes, line 2381
2381,[a]),p=function(f,v){return s?.entryId===f&&s?.kind===v};return h("div",{class:"flex h-full flex-col"},h("div",{class:"border-border-subtle border-b p-3"},h("h2",{class:"text-fg-primary text-md font-semibold"},o("signature.title",{fallback:"Signatures"})),h("button",{class:"bg-accent hover:bg-accent-hover text-fg-on-accent mt-3 w-full rounded-md px-3 py-2 text-sm font-medium transition-colors",onClick:d},o(c?"signature.createNewWithInitials":"signature.createNew",{fallback:c?"Create Signature & Initials":"Create New Signature"}))),r.length>0?h("div",{class:"flex-1 overflow-y-auto p-4"},h("div",{class:"flex flex-col gap-4"},r.map(function(f){return h("div",{key:f.id,class:"border-border-subtle bg-bg-surface hover:border-fg-muted/30 flex flex-col gap-2 rounded-lg border p-3 shadow-sm transition-all hover:shadow-md"},h("div",{class:"flex items-start justify-between"},h("div",{class:"flex flex-1 items-center gap-2 pl-0.5 pt-0.5"},h("span",{class:"text-fg-muted text-[10px] font-semibold uppercase tracking-widest"},o("signature.placeSignature",{fallback:"Signature"})),c&&f.initials&&h("span",{class:"text-border-default text-[10px]"},"•"),c&&f.initials&&h("span",{class:"text-fg-muted text-[10px] font-semibold uppercase tracking-widest"},o("signature.placeInitials",{fallback:"Initials"}))),h("button",{class:"text-fg-muted hover:text-fg-danger hover:bg-danger/10 -mr-1 -mt-1 flex rounded p-1.5 transition-colors",onClick:function(v){return g(v,f.id)},title:o("signature.remove",{fallback:"Remove signature"})},h(ye,{icon:"trash",className:"h-3.5 w-3.5"}))),h("div",{class:"flex gap-3"},h("div",{class:"flex h-16 cursor-pointer items-center justify-center rounded-md border border-dashed transition-all ".concat(c&&f.initials?"flex-[2]":"flex-1"," ").concat(p(f.id,ko.Signature)?"border-accent bg-accent/5 ring-accent ring-2 ring-offset-1":"border-border-default hover:border-fg-muted hover:bg-interactive-hover"),onClick:function(){return u(f.id)}},h("img",{src:f.signature.previewDataUrl,class:"h-12 max-w-[90%] object-contain",alt:"Signature"})),c&&f.initials&&h("div",{class:"flex h-16 flex-1 cursor-pointer items-center justify-center rounded-md border border-dashed transition-all ".concat(p(f.id,ko.Initials)?"border-accent bg-accent/5 ring-accent ring-2 ring-offset-1":"border-border-default hover:border-fg-muted hover:bg-interactive-hover"),onClick:function(){return m(f.id)}},h("img",{src:f.initials.previewDataUrl,class:"h-10 max-w-[80%] object-contain",alt:"Initials"}))))}))):h("div",{class:"text-fg-muted mt-8 flex flex-col items-center gap-2 p-4"},h(ye,{icon:"signature",className:"h-18 w-18 text-fg-muted opacity-50"}),h("div",{class:"text-fg-muted max-w-[180px] text-center text-sm"},o("signature.emptyState",{fallback:"No signatures yet. Create one to get started."}))))}function Fo(e){var t=e.open,n=e.title,o=e.children,i=e.onClose,r=e.onExited,a=e.className,s=e.showCloseButton,l=s===void 0||s,c=K(null),d=q(O(t),2),u=d[0],m=d[1],g=q(O(!1),2),p=g[0],f=g[1];return $(function(){if(t)m(!0),requestAnimationFrame(function(){f(!0)});else if(u){f(!1);var v=setTimeout(function(){m(!1),r?.()},200);return function(){return clearTimeout(v)}}},[t,u,r]),$(function(){if(t){var v=function(y){y.key==="Escape"&&i?.()};return document.addEventListener("keydown",v),function(){return document.removeEventListener("keydown",v)}}},[t,i]),$(function(){return document.body.style.overflow=u?"hidden":"",function(){document.body.style.overflow=""}},[u]),u?k("div",{ref:c,className:"fixed inset-0 z-50 transition-opacity duration-200 md:flex md:items-center md:justify-center ".concat(p&&t?"bg-bg-overlay":"bg-transparent"),onClick:function(v){v.target===c.current&&i?.()},children:k("div",{className:Ci("bg-bg-surface md:border-border-subtle relative flex h-full w-full flex-col transition-all duration-200 md:h-auto md:w-[28rem] md:max-w-[90vw] md:rounded-lg md:border md:shadow-lg",p&&t?"scale-100 opacity-100":"scale-95 opacity-0",a),onClick:function(v){return v.stopPropagation()},children:[(n||l)&&k("div",{className:"border-border-subtle flex flex-shrink-0 items-center justify-between border-b px-6 py-4",children:[n&&k("h2",{className:"text-fg-primary text-lg font-semibold",children:n}),l&&k(Je,{onClick:i,className:"hover:bg-interactive-hover p-1",children:k(ye,{icon:"x",className:"h-5 w-5"})})]}),k("div",{className:"flex-1 overflow-y-auto px-6 py-4 md:max-h-[80vh] md:flex-none",children:o})]})}):null}var Tv=rn({});function NI(e){var t=e.config,n=e.children;return h(Tv.Provider,{value:t},n)}var OI=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function FI(e){var t,n=[],o="",i=null,r=Dt(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;a!=='"'&&a!=="'"||i!==null?a!==i?a!==","||i!==null?o+=a:(n.push(o.trim()),o=""):(i=null,o+=a):(i=a,o+=a)}}catch(s){r.e(s)}finally{r.f()}return o.trim()&&n.push(o.trim()),n}function vs(e){return e.trim().replace(/^['"]|['"]$/g,"").toLowerCase()}function Rv(e){return Array.from(new Set(e.flatMap(FI).map(function(t){return t.trim().replace(/^['"]|['"]$/g,"")}).filter(function(t){return t&&!OI.has(vs(t))})))}function _I(e){if(!e||e.length===0)return!1;var t=(function(o){return Rv(o).map(vs)})(e);if(t.length===0)return!1;var n=(function(){if(typeof document>"u"||!("fonts"in document))return new Set;for(var o=new Set,i=0,r=Array.from(document.fonts);i<r.length;i++){var a=r[i];o.add(vs(a.family))}return o}
2381)();return n.size!==0&&t.every(function(o){return n.has(o)})}function Ev(e,t,n){if(typeof document>"u"||_I(n))return null;var o=(function(a){if(typeof document>"u")return null;try{return new URL(a,document.baseURI).href}catch{return null}})(t);if(!o)return null;var i=(function(a){var s;return(s=Array.from(document.head.querySelectorAll('link[rel~="stylesheet"][href]')).find(function(l){return l.href===a}))!==null&&s!==void 0?s:null})(o);if(i)return i;var r=(function(a){return document.head.querySelector('link[data-embedpdf-fonts="'.concat(a,'"][data-embedpdf-managed="true"]'))})(e);return r||((r=document.createElement("link")).rel="stylesheet",r.setAttribute("data-embedpdf-fonts",e),r.setAttribute("data-embedpdf-managed","true"),document.head.appendChild(r)),r.href!==o&&(r.href=t),r}var Da="'Open Sans', system-ui, sans-serif",Ta=[{name:"Dancing Script",family:"'Dancing Script', cursive"},{name:"Great Vibes",family:"'Great Vibes', cursive"},{name:"Pacifico",family:"'Pacifico', cursive"},{name:"Caveat",family:"'Caveat', cursive"}],Ra=[{name:"Black",value:"#000000"},{name:"Blue",value:"#597ce2"},{name:"Red",value:"#e44234"}];function $I(e){var t,n,o=e.documentId,i=e.isOpen,r=e.onClose,a=e.onExited,s=Le(o).translate,l=rs().provides,c=(t=an(Tv).fonts)===null||t===void 0?void 0:t.signature,d=((n=l?.mode)!==null&&n!==void 0?n:Nn.SignatureOnly)===Nn.SignatureAndInitials,u=Z(function(){return(V=c)===null?{fonts:Ta,stylesheetUrl:null,enabled:!1}:V===void 0?{fonts:Ta,stylesheetUrl:"https://fonts.googleapis.com/css2?family=Caveat&family=Dancing+Script&family=Great+Vibes&family=Pacifico&display=swap",enabled:!0}:V.fonts&&V.fonts.length>0?{fonts:V.fonts,stylesheetUrl:(He=V.stylesheetUrl)!==null&&He!==void 0?He:null,enabled:!0}:{fonts:Ta,stylesheetUrl:(Se=V.stylesheetUrl)!==null&&Se!==void 0?Se:null,enabled:V.stylesheetUrl!=null};var V,Se,He},[c]),m=u.fonts,g=u.stylesheetUrl,p=u.enabled;$(function(){if(i&&g){var V=m.map(function(Se){return Se.family});(function(Se){return Se?Se.sheet?Promise.resolve():new Promise(function(He){var Re=function(){Se.removeEventListener("load",Re),Se.removeEventListener("error",Re),He()};Se.addEventListener("load",Re,{once:!0}),Se.addEventListener("error",Re,{once:!0})}):Promise.resolve()})(Ev("signature",g,V)).then(function(){return(function(Se){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:48;if(typeof document>"u"||!("fonts"in document))return Promise.resolve();var Re=Rv(Se);return Re.length===0?Promise.resolve():Promise.all(Re.map(function(ae){return document.fonts.load("".concat(He,'px "').concat(ae,'"'))}))})(V,48)})}},[m,g,i]);var f=q(O("draw"),2),v=f[0],y=f[1],b=q(O(m[0].family),2),w=b[0],x=b[1],C=q(O(Ra[0].value),2),I=C[0],S=C[1],P=q(O(null),2),A=P[0],D=P[1],R=q(O(null),2),M=R[0],N=R[1];$(function(){p||v!=="type"||y("draw")},[p,v]);var z=K(null),_=K(null),L=K(null),j=K(null),E=W(function(V){D(V?{field:V}:null)},[]),F=W(function(V){N(V?{field:V}:null)},[]),X=Kd({onResult:E}),Q=Kd({onResult:F}),J=W(function(){var V,Se,He,Re;(V=z.current)===null||V===void 0||V.clear(),(Se=_.current)===null||Se===void 0||Se.clear(),(He=L.current)===null||He===void 0||He.clear(),(Re=j.current)===null||Re===void 0||Re.clear(),X.clear(),Q.clear(),D(null),N(null)},[X,Q]),te=W(function(){y("draw"),x(m[0].family),S(Ra[0].value),J()},[J,m]),G=W(function(V){J(),y(V)},[J]),oe=W(function(){A&&l&&(l.addEntry(B({signature:A.field},M&&{initials:M.field})),te(),r?.())},[A,M,l,r,te]),le=W(function(){te(),r?.()},[te,r]),Te=A&&(!d||M),De=[{id:"draw",label:s("signature.create.draw",{fallback:"Draw"})}].concat(Eo(p?[{id:"type",label:s("signature.create.type",{fallback:"Type"})}]:[]),[{id:"upload",label:s("signature.create.upload",{fallback:"Upload"})}]),Ne=140;return h(Fo,{open:!!i,title:s("signature.create.title",{fallback:"Create Signature"}),onClose:le,onExited:a,className:d?"md:w-[42rem]":void 0},h("div",{class:"flex flex-col gap-4"},h("div",{class:"border-border-subtle flex gap-1 border-b"},De.map(function(V){return h("button",{key:V.id,class:"px-4 py-2 text-sm font-medium transition-colors ".concat(v===V.id?"border-accent text-accent border-b-2":"text-fg-muted hover:text-fg-primary"),onClick:function(){return G(V.id)}},V.label)})),h("div",{class:"flex gap-4"},h("div",{class:"flex ".concat(d?"flex-[2]":"flex-1"," flex-col gap-2")},h("div",{class:"flex items-center justify-between"},h("span",{class:"text-fg-muted text-xs font-medium"},s("signature.create.signatureLabel",{fallback:"Signature"})),h("button",{class:"text-fg-muted hover:text-fg-primary text-xs underline",onClick:function(){var V,Se;v==="draw"?(V=z.current)===null||V===void 0||V.clear():v==="type"?(Se=L.current)===null||Se===void 0||Se.clear():X.clear()}},s("signature.create.clear",{fallback:"Clear"}))),h("div",{style:{height:"".concat(Ne,"px")}},v==="draw"&&h(Vd,{onResult:E,padRef:function(V){z.current=V},strokeColor:I,className:"border-border-default rounded border"}),v==="type"&&h(Xd,{onResult:E,padRef:function(V){L.current=V},fontFamily:w,color:I,className:"border-border-default text-fg-primary rounded border px-3 py-2",placeholder:s("signature.create.typePlaceholder",{fallback:"e.g. John Smith"})}),v==="upload"&&h(xu,{upload:X,height:Ne,placeholder:s("signature.create.uploadPlaceholder",{fallback:"Click or drag an image here"})}))),d&&h("div",{class:"flex flex-1 flex-col gap-2"},h("div",{class:"flex items-center justify-between"},h("span",{class:"text-fg-muted text-xs font-medium"},s("signature.create.initialsLabel",{fallback:"Initials"})),h("button",{class:"text-fg-muted hover:text-fg-primary text-xs underline",onClick:function(){var V,Se;v==="draw"?(V=_.current)===null||V===void 0||V.clear():v==="type"?(Se=j.current)===null||Se===void 0||Se.clear():Q.clear()}},s("signature.create.clear",{fallback:"Clear"}))),h("div",{style:{height:"".concat(Ne,"px")}},v==="draw"&&h(Vd,{onResult:F,padRef:function(V){_.current=V},strokeColor:I,className:"border-border-default rounded border"}),v==="type"&&h(Xd,{onResult:F,padRef:function(V){j.current=V},fontFamily:w,color:I,className:"border-border-default text-fg-primary rounded border px-3 py-2",placeholder:s("signature.create.initialsPlaceholder",{fallback:"e.g. JS"})}),v==="upload"&&h(xu,{upload:Q,height:Ne,placeholder:s("signature.create.uploadPlaceholder",{fallback:"Click or drag an image here"})})))),(v==="draw"||v==="type")&&h("div",{class:"flex items-center gap-4"},v==="type"&&h("div",{class:"flex items-center gap-2"},h("label",{class:"text-fg-muted text-xs"},s("signature.create.font",{fallback:"Font"})),h("select",{class:"border-border-default bg-bg-surface text-fg-primary rounded border px-2 py-1 text-sm",value:w,onChange:function(V){x(V.target.value)}},m.map(function(V){return h("option",{key:V.family,value:V.family,style:{fontFamily:V.family}},V.name)}))),h("div",{class:"flex items-center gap-2"},h("label",{class:"text-fg-muted text-xs"},s("signature.create.color",{fallback:"Color"})),h("div",{class:"flex gap-1.5"},Ra.map(function(V){return h("button",{key:V.value,title:V.name,class:"h-6 w-6 rounded-full border-2 transition-all ".concat(I===V.value?"border-accent scale-110":"border-border-default hover:scale-105"),style:{backgroundColor:V.value},onClick:function(){return S(V.value)}})})))),h("div",{class:"flex justify-end gap-2"},h("button",{class:"text-fg-muted hover:text-fg-primary rounded-md px-3 py-1.5 text-sm transition-colors",onClick:le},s("signature.create.cancel",{fallback:"Cancel"})),h("button",{class:"bg-accent hover:bg-accent-hover text-fg-on-accent rounded-md px-4 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",disabled:!Te,onClick:oe},s("signature.create.save",{fallback:"Save"})))))}function xu(e){var t=e.upload,n=e.height,o=e.placeholder;return h(de,null,h("input",{ref:t.inputRef,type:"file",accept:t.accept,onChange:t.handleFileInputChange,style:{display:"none"}}),h("div",{onClick:t.openFilePicker,onDrop:t.handleDrop,onDragOver:t.handleDragOver,onDragLeave:t.handleDragLeave,class:"border-border-default flex w-full cursor-pointer items-center justify-center rounded border-2 border-dashed transition-colors ".concat(t.isDragging?"border-accent bg-accent/5":"hover:border-fg-muted"),style:{height:"".concat(n,"px")}},t.previewUrl?h("img",{src:t.previewUrl,style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain"}}):h("span",{class:"text-fg-muted px-4 text-center text-xs"},o)))}function jI(e){var t=e.schema,n=e.documentId,o=e.props,i=o.menuWrapperProps,r=o.rect,a=o.placement,s={position:"absolute",pointerEvents:"auto",cursor:"default",left:"50%",transform:"translateX(-50%)"};return a!=null&&a.suggestTop?s.top=-50:s.top=r.size.height+8,h("div",B(B({},i),it(t)),h("div",{style:s,className:"border-border-subtle bg-bg-elevated rounded-lg border shadow-lg"},h("div",{className:"flex items-center gap-1 p-1"},t.items.map(function(l){return h(zv,{key:l.id,item:l,documentId:n,props:o})}))))}function UI(e){var t=e.item,n=e.documentId,o=Gt(t.commandId,n);return o!=null&&o.visible?h("div",B({},it(t)),h(Xn,{commandId:t.commandId,documentId:n,variant:t.variant})):null}function zv(e){var t,n=e.item,o=e.documentId,i=e.props;switch(n.type){case"command-button":return h(UI,{item:n,documentId:o});case"divider":return h("div",B({},it(n)),h("div",{className:"bg-border-default h-6 w-px","aria-hidden":"true"}));case"group":return h("div",B({className:"flex items-center gap-".concat((t=n.gap)!==null&&t!==void 0?t:1)},it(n)),n.items.map(function(r){return h(zv,{key:r.id,item:r,documentId:o,props:i})}));default:return null}}
2381function BI(e){var t,n,o,i=e.schema,r=e.documentId,a=e.className,s=i.content,l=i.position,c=Fr().renderCustomComponent,d=(n=l.anchor,(o={"top-left":"top-0 left-0","top-center":"top-0 left-1/2 -translate-x-1/2","top-right":"top-0 right-0","center-left":"top-1/2 left-0 -translate-y-1/2",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 right-0 -translate-y-1/2","bottom-left":"bottom-0 left-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2","bottom-right":"bottom-0 right-0"})[n]||o["bottom-center"]),u=(function(g){if(g){var p={};return g.top&&(p.top=g.top),g.right&&(p.right=g.right),g.bottom&&(p.bottom=g.bottom),g.left&&(p.left=g.left),Object.keys(p).length>0?p:void 0}})(l.offset),m=(t=i.categories)!==null&&t!==void 0&&t.length?ee({},Nr,i.categories.join(" ")):{};return h("div",B(ee({className:"z-3 absolute ".concat(d," ").concat(a||""),style:u,"data-overlay-id":i.id},_s,i.id),m),c(s.componentId,r))}function WI(e){var t=e.documentId,n=e.isOpen,o=e.onClose,i=e.onExited,r=io().provides,a=Jg().provides,s=Le(t).translate,l=q(O("all"),2),c=l[0],d=l[1],u=q(O(""),2),m=u[0],g=u[1],p=q(O(!0),2),f=p[0],v=p[1],y=q(O(!1),2),b=y[0],w=y[1],x=q(O(""),2),C=x[0],I=x[1],S=r?.forDocument(t).getMetrics(),P=S?.currentPage||1,A=r?.forDocument(t).getTotalPages()||0;$(function(){n&&(d("all"),g(""),v(!0),w(!1),I(""))},[n]);var D=(c!=="custom"||m.trim().length>0)&&!b;return h(Fo,{open:n!=null&&n,title:s("print.title"),onClose:o,onExited:i,className:"md:w-[32rem]"},h("div",{className:"space-y-6"},h("div",null,h("label",{className:"text-fg-secondary mb-3 block text-sm font-medium"},s("print.pages")),h("div",{className:"space-y-2"},h("label",{className:"flex items-center"},h("input",{type:"radio",name:"pageRange",value:"all",checked:c==="all",onChange:function(){return d("all")},disabled:b,className:"accent-accent mr-2"}),h("span",{className:"text-fg-primary text-sm"},s("print.all"))),h("label",{className:"flex items-center"},h("input",{type:"radio",name:"pageRange",value:"current",checked:c==="current",onChange:function(){return d("current")},disabled:b,className:"accent-accent mr-2"}),h("span",{className:"text-fg-primary text-sm"},s("print.current",{params:{currentPage:P}}))),h("label",{className:"flex items-start"},h("input",{type:"radio",name:"pageRange",value:"custom",checked:c==="custom",onChange:function(){return d("custom")},disabled:b,className:"accent-accent mr-2 mt-0.5"}),h("div",{className:"flex-1"},h("span",{className:"text-fg-primary mb-1 block text-sm"},s("print.specify")),h("input",{type:"text",placeholder:s("print.specifyEG"),value:m,onInput:function(R){return g(R.target.value)},disabled:c!=="custom"||b,className:"w-full rounded-md border px-3 py-1 text-base ".concat(c!=="custom"||b?"bg-interactive-disabled text-fg-muted":"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent"," focus:outline-none focus:ring-1")}),c==="custom"&&m.trim()&&A>0&&h("p",{className:"text-fg-muted mt-1 text-xs"},s("print.current",{params:{totalPages:A}})))))),h("div",null,h("label",{className:"flex items-center"},h("input",{type:"checkbox",checked:f,onChange:function(R){return v(R.target.checked)},disabled:b,className:"accent-accent mr-2"}),h("span",{className:"text-fg-secondary text-sm font-medium"},s("print.annotation")))),b&&h("div",{className:"bg-state-info-light flex items-center space-x-3 rounded-md p-3"},h(So,{className:"text-accent"}),h("span",{className:"text-accent text-sm"},C)),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},h(Je,{onClick:o,disabled:b,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},s("print.cancel")),h(Je,{onClick:function(){var R;c==="current"?R=String(P):c==="custom"&&(R=m.trim()||void 0);var M={includeAnnotations:f,pageRange:R};try{w(!0),I(s("print.loading"));var N=a?.forDocument(t).print(M);N&&(N.onProgress(function(z){I(z.message)}),N.wait(function(){w(!1),I(""),o?.()},function(z){console.error("Print failed:",z),w(!1),I("")}))}catch(z){console.error("Print failed:",z),w(!1),I("")}},disabled:!D,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},b&&h(So,{size:"sm"}),h("span",null,s(b?"print.printing":"print.print"))))))}function HI(e){var t,n=e.documentId,o=e.isOpen,i=e.onClose,r=e.onExited,a=e.source,s=io().provides,l=zt().provides,c=$r().provides,d=Le(n).translate,u=q(O("url"),2),m=u[0],g=u[1],p=q(O(""),2),f=p[0],v=p[1],y=q(O(1),2),b=y[0],w=y[1],x=s?.forDocument(n).getTotalPages()||1,C=l?.forDocument(n),I=c?.forDocument(n),S=C?.getSelectedAnnotation(),P=(t=I?.getFormattedSelection())!==null&&t!==void 0?t:[];$(function(){o&&(g("url"),v(""),w(1))},[o]);var A=function(){var M;if(m==="url"){if(!f.trim())return;M={type:"action",action:{type:zn.URI,uri:f.trim()}}}else M={type:"destination",destination:{pageIndex:b-1,zoom:{mode:Sr.FitPage},view:[]}};var N=function(){if(!S)return!1;var _,L="segmentRects"in S.object?S.object.segmentRects:[S.object.rect],j=Dt(L??[]);try{for(j.s();!(_=j.n()).done;){var E=_.value;C?.createAnnotation(S.object.pageIndex,{id:pe(),type:T.LINK,pageIndex:S.object.pageIndex,rect:E,inReplyToId:S.object.id,replyType:Ut.Group,target:M,strokeStyle:ke.UNDERLINE,strokeColor:"#0000FF",strokeWidth:2})}}
2381catch(F){j.e(F)}finally{j.f()}return!0},z=function(){if(P.length===0)return!1;var _,L=I?.getSelectedText(),j=Dt(P);try{var E=function(){var F=_.value;L?.wait(function(X){var Q,J=pe();C?.createAnnotation(F.pageIndex,{id:J,created:new Date,flags:["print"],type:T.HIGHLIGHT,blendMode:ve.Multiply,pageIndex:F.pageIndex,rect:F.rect,segmentRects:F.segmentRects,strokeColor:"#FFFFFF",opacity:0,custom:{text:X.join(`
2382`)}});var te,G=Dt((Q=F.segmentRects)!==null&&Q!==void 0?Q:[F.rect]);try{for(G.s();!(te=G.n()).done;){var oe=te.value;C?.createAnnotation(F.pageIndex,{id:pe(),type:T.LINK,pageIndex:F.pageIndex,rect:oe,inReplyToId:J,replyType:Ut.Group,target:M,strokeStyle:ke.UNDERLINE,strokeColor:"#0000FF",strokeWidth:2})}}catch(le){G.e(le)}finally{G.f()}C?.selectAnnotation(F.pageIndex,J)},et)};for(j.s();!(_=j.n()).done;)E()}catch(F){j.e(F)}finally{j.f()}return I?.clear(),!0};a==="annotation"?N():a==="selection"?z():N()||z(),i?.()},D=m==="page"||f.trim().length>0,R=function(M){M.key==="Enter"&&D&&(M.preventDefault(),A())};return h(Fo,{open:o!=null&&o,title:d("link.title")||"Insert Link or Page",onClose:i,onExited:r,className:"md:w-[28rem]"},h("div",{className:"space-y-6"},h("div",{className:"border-border-subtle flex border-b"},h(as,{active:m==="url",onClick:function(){return g("url")}},d("link.url")||"URL"),h(as,{active:m==="page",onClick:function(){return g("page")}},d("link.page")||"Page")),h("div",{className:"bg-bg-muted rounded-lg"},m==="url"?h("div",null,h("label",{className:"text-fg-secondary mb-2 block text-sm font-medium"},d("link.enterUrl")||"Enter URL"),h("input",{type:"url",value:f,onInput:function(M){return v(M.target.value)},onKeyDown:R,placeholder:"https://example.com",className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1",autoFocus:!0})):h("div",null,h("label",{className:"text-fg-secondary mb-2 block text-sm font-medium"},d("link.enterPage")||"Enter Page Number"),h("input",{type:"number",min:1,max:x,value:b,onInput:function(M){var N=parseInt(M.target.value,10);isNaN(N)||w(Math.max(1,Math.min(x,N)))},onKeyDown:R,className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 text-base focus:outline-none focus:ring-1",autoFocus:!0}),h("p",{className:"text-fg-muted mt-1 text-xs"},d("link.pageRange",{params:{totalPages:x}})||"Page 1 to ".concat(x)))),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},h(Je,{type:"button",onClick:i,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm"},d("common.cancel")||"Cancel"),h(Je,{type:"button",onClick:A,disabled:!D,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},d("link.link")||"Link"))))}function GI(e){var t=e.documentId,n=Ha().provides,o=Rh(t),i=o.provides,r=o.state,a=r.currentPage,s=r.totalPages,l=q(O(!1),2),c=l[0],d=l[1],u=q(O(!1),2),m=u[0],g=u[1],p=K(null),f=q(O(a.toString()),2),v=f[0],y=f[1],b=K(null);$(function(){y(a.toString())},[a]);var w=W(function(){p.current&&clearTimeout(p.current),p.current=setTimeout(function(){m||d(!1)},4e3)},[m]);return $(function(){if(n)return n.onScrollActivity(function(x){x.documentId===t&&(d(!0),w())})},[n,t,w]),$(function(){return function(){p.current&&clearTimeout(p.current)}},[]),s<=1?null:h("div",{onMouseEnter:function(){g(!0),d(!0),p.current&&clearTimeout(p.current)},onMouseLeave:function(){g(!1),w()},className:"pointer-events-auto"},h("div",{className:"border-border-default bg-bg-surface flex items-center gap-1 rounded-lg border p-1 shadow-lg transition-opacity duration-300 ".concat(c?"opacity-100":"opacity-0")},h(Xn,{commandId:"scroll:previous-page",documentId:t,variant:"icon"}),h("div",{className:"flex items-center gap-1 px-1"},h("input",{ref:b,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:v,onChange:function(x){var C=x.target.value.replace(/[^0-9]/g,"");y(C)},onFocus:function(){setTimeout(function(){var x;return(x=b.current)===null||x===void 0?void 0:x.select()},0)},onBlur:function(){var x,C=parseInt(v,10);!isNaN(C)&&C>=1&&C<=s?i==null||(x=i.scrollToPage)===null||x===void 0||x.call(i,{pageNumber:C}):y(a.toString())},onKeyDown:function(x){x.key==="Enter"?x.target.blur():x.key==="Escape"&&(y(a.toString()),x.target.blur())},className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent h-7 w-10 rounded border px-1 text-center text-base focus:outline-none focus:ring-1"}),h("span",{className:"text-fg-secondary text-sm"},"  ",s)),h(Xn,{commandId:"scroll:next-page",documentId:t,variant:"icon"})))}var fe=function(e,t,n){return!(function(o,i,r){return lr(o.core,i,r)})(e,t,n)},qI={"zoom:in":{id:"zoom:in",labelKey:"zoom.in",icon:"zoomIn",shortcuts:["Ctrl+=","Meta+=","Ctrl+NumpadAdd","Meta+NumpadAdd"],categories:["zoom","zoom-in"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).zoomIn()}},"zoom:out":{id:"zoom:out",labelKey:"zoom.out",icon:"zoomOut",shortcuts:["Ctrl+-","Meta+-","Ctrl+NumpadSubtract","Meta+NumpadSubtract"],categories:["zoom","zoom-out"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).zoomOut()}},"zoom:fit-page":{id:"zoom:fit-page",labelKey:"zoom.fitPage",icon:"fitToPage",shortcuts:["Ctrl+0","Meta+0"],categories:["zoom","zoom-fit-page"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(dt.FitPage)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===dt.FitPage}},"zoom:fit-width":{id:"zoom:fit-width",labelKey:"zoom.fitWidth",icon:"fitToWidth",shortcuts:["Ctrl+1","Meta+1"],categories:["zoom","zoom-fit-width"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(dt.FitWidth)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===dt.FitWidth}},"zoom:marquee":{id:"zoom:marquee",labelKey:"zoom.marquee",icon:"zoomInArea",shortcuts:["Ctrl+M","Meta+M"],categories:["zoom","zoom-marquee"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).toggleMarqueeZoom()},active:function(e){var t,n,o=e.state,i=e.documentId;return(t=(n=o.plugins.zoom)===null||n===void 0||(n=n.documents[i])===null||n===void 0?void 0:n.isMarqueeZoomActive)!==null&&t!==void 0&&t}},"zoom:25":{id:"zoom:25",label:"25%",categories:["zoom","zoom-level","zoom-level-25"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(.25)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===.25}},"zoom:50":{id:"zoom:50",label:"50%",categories:["zoom","zoom-level","zoom-level-50"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(.5)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===.5}},"zoom:100":{id:"zoom:100",label:"100%",categories:["zoom","zoom-level","zoom-level-100"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(1)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===1}},"zoom:125":{id:"zoom:125",label:"125%",categories:["zoom","zoom-level","zoom-level-125"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(1.25)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===1.25}},"zoom:150":{id:"zoom:150",label:"150%",categories:["zoom","zoom-level","zoom-level-150"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(1.5)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===1.5}},"zoom:200":{id:"zoom:200",label:"200%",categories:["zoom","zoom-level","zoom-level-200"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(2)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===2}},"zoom:400":{id:"zoom:400",label:"400%",categories:["zoom","zoom-level","zoom-level-400"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(4)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===4}},"zoom:800":{id:"zoom:800",label:"800%",categories:["zoom","zoom-level","zoom-level-800"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(8)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===8}},"zoom:1600":{id:"zoom:1600",label:"1600%",categories:["zoom","zoom-level","zoom-level-1600"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("zoom"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).requestZoom(16)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.zoom)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.zoomLevel)===16}},"zoom:toggle-menu":{id:"zoom:toggle-menu",labelKey:"zoom.menu",icon:"chevronDown",iconProps:{className:"h-3.5 w-3.5"},categories:["zoom","zoom-menu"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).toggleMenu("zoom-menu","zoom:toggle-menu","zoom-menu-button")},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["zoom-menu"]!==void 0}},"zoom:toggle-menu-mobile":{id:"zoom:toggle-menu-mobile",labelKey:"zoom.menu",icon:"zoomIn",categories:["zoom","zoom-menu"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).toggleMenu("zoom-menu","zoom:toggle-menu-mobile","zoom-menu-button")},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["zoom-menu"]!==void 0}},"pan:toggle":{id:"pan:toggle",labelKey:"pan.toggle",icon:"hand",shortcuts:["h"],categories:["tools","pan"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("pan"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).togglePan()},active:function(e){var t,n,o=e.state,i=e.documentId;return(t=(n=o.plugins.pan)===null||n===void 0||(n=n.documents[i])===null||n===void 0?void 0:n.isPanMode)!==null&&t!==void 0&&t}},"pointer:toggle":{id:"pointer:toggle",labelKey:"pointer.toggle",icon:"pointer",shortcuts:["p"],categories:["tools","pointer"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("interaction-manager"))===null||t===void 0?void 0:t.provides();if(i){var r=i.forDocument(o);r.getActiveMode()==="pointerMode"?r.activateDefaultMode():r.activate("pointerMode")}},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins["interaction-manager"])===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.activeMode)==="pointerMode"}},"left-action-menu:overflow-menu":{id:"left-action-menu:overflow-menu",labelKey:"menu.moreOptions",icon:"dots",categories:["ui","ui-menu"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.toggleMenu("left-action-menu","left-action-menu:overflow-menu","overflow-left-action-menu-button",o)},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["left-action-menu"]!==void 0}},"capture:screenshot":{id:"capture:screenshot",labelKey:"capture.screenshot",icon:"screenshot",shortcuts:["Ctrl+Shift+S","Meta+Shift+S"],categories:["tools","capture","capture-screenshot"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("capture"))===null||t===void 0?void 0:t.provides();if(i){var r=i.forDocument(o);r.isMarqueeCaptureActive()?r.disableMarqueeCapture():r.enableMarqueeCapture()}},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins["interaction-manager"].documents[o])===null||t===void 0?void 0:t.activeMode)==="marqueeCapture"}},"document:menu":{id:"document:menu",labelKey:"document.menu",icon:"menu",categories:["document","document-menu"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleMenu("document-menu","document:menu","document-menu-button")}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["document-menu"]!==void 0}},"document:open":{id:"document:open",labelKey:"document.open",icon:"fileImport",shortcuts:["Ctrl+O","Meta+O"],categories:["document","document-open"],action:function(e){var t,n=(t=e.registry.getPlugin("document-manager"))===null||t===void 0?void 0:t.provides();n?.openFileDialog()}},"document:close":{id:"document:close",labelKey:"document.close",icon:"x",shortcuts:["Ctrl+W","Meta+W"],categories:["document","document-close"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("document-manager"))===null||t===void 0?void 0:t.provides();i?.closeDocument(o)}},"document:print":{id:"document:print",labelKey:"document.print",icon:"print",shortcuts:["Ctrl+P","Meta+P"],categories:["document","document-print"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).openModal("print-modal")}},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.Print)}},"document:protect":{id:"document:protect",labelKey:"document.protect",icon:"lock",categories:["document","document-protect","security"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).openModal("protect-modal")}},"document:export":{id:"document:export",labelKey:"document.export",icon:"download",categories:["document","document-export"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("export"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).download()}},"document:capture":{id:"document:capture",labelKey:"capture.screenshot",icon:"screenshot",categories:["document","document-capture"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("capture"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).toggleMarqueeCapture()},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins["interaction-manager"])===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.activeMode)==="marqueeCapture"}},"document:fullscreen":{id:"document:fullscreen",labelKey:"document.fullscreen",icon:function(e){var t;return(t=e.state.plugins.fullscreen)!==null&&t!==void 0&&t.isFullscreen?"fullscreenExit":"full
2382screen"},shortcuts:["F11"],categories:["document","document-fullscreen"],action:function(e){var t,n=(t=e.registry.getPlugin("fullscreen"))===null||t===void 0?void 0:t.provides();n&&(n.isFullscreen()?n.exitFullscreen():n.enableFullscreen())},active:function(e){var t,n;return(t=(n=e.state.plugins.fullscreen)===null||n===void 0?void 0:n.isFullscreen)!==null&&t!==void 0&&t}},"panel:toggle-sidebar":{id:"panel:toggle-sidebar",labelKey:"panel.sidebar",icon:"sidebar",categories:["panel","panel-sidebar"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("left","main","sidebar-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"left","main","sidebar-panel")}},"panel:toggle-search":{id:"panel:toggle-search",labelKey:"panel.search",icon:"search",shortcuts:["Ctrl+F","Meta+F"],categories:["panel","panel-search"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("right","main","search-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"right","main","search-panel")}},"panel:toggle-comment":{id:"panel:toggle-comment",labelKey:"panel.comment",icon:"comment",categories:["panel","panel-comment"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("right","main","comment-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"right","main","comment-panel")}},"panel:toggle-redaction":{id:"panel:toggle-redaction",labelKey:"panel.redaction",icon:"redactionSidebar",categories:["panel","panel-redaction","redaction"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("right","main","redaction-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"right","main","redaction-panel")}},"panel:toggle-annotation-style":{id:"panel:toggle-annotation-style",labelKey:"panel.annotationStyle",icon:"palette",categories:["panel","panel-annotation-style"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("left","main","annotation-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"left","main","annotation-panel")},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"page:settings":{id:"page:settings",labelKey:"page.settings",icon:"viewSettings",categories:["page","page-settings"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleMenu("page-settings-menu","page:settings","page-settings-button")}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["page-settings-menu"]!==void 0}},"spread:none":{id:"spread:none",labelKey:"page.single",icon:"singlePage",categories:["page","spread","spread-none"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("spread"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).setSpreadMode(wt.None)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.spread)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.spreadMode)===wt.None}},"spread:odd":{id:"spread:odd",labelKey:"page.twoOdd",icon:"doublePage",categories:["page","spread","spread-odd"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("spread"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).setSpreadMode(wt.Odd)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.spread)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.spreadMode)===wt.Odd}},"spread:even":{id:"spread:even",labelKey:"page.twoEven",icon:"book2",categories:["page","spread","spread-even"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("spread"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).setSpreadMode(wt.Even)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.spread)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.spreadMode)===wt.Even}},"rotate:clockwise":{id:"rotate:clockwise",labelKey:"rotate.clockwise",icon:"rotateClockwise",shortcuts:["Ctrl+]","Meta+]"],categories:["page","rotate","rotate-clockwise"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("rotate"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).rotateForward()}},"rotate:counter-clockwise":{id:"rotate:counter-clockwise",labelKey:"rotate.counterClockwise",icon:"rotateCounterClockwise",shortcuts:["Ctrl+[","Meta+["],categories:["page","rotate","rotate-counter-clockwise"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("rotate"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).rotateBackward()}},"scroll:vertical":{id:"scroll:vertical",labelKey:"page.vertical",icon:"vertical",categories:["page","scroll","scroll-vertical"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("scroll"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).setScrollStrategy(It.Vertical)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.scroll)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.strategy)===It.Vertical}}
2382,"scroll:horizontal":{id:"scroll:horizontal",labelKey:"page.horizontal",icon:"horizontal",categories:["page","scroll","scroll-horizontal"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("scroll"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).setScrollStrategy(It.Horizontal)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.scroll)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.strategy)===It.Horizontal}},"scroll:next-page":{id:"scroll:next-page",labelKey:"page.next",icon:"chevronRight",categories:["page","navigation","navigation-next"],shortcuts:["Ctrl+]","Meta+]","ArrowRight"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("scroll"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).scrollToNextPage()},disabled:function(e){var t,n,o=e.state,i=e.documentId;return((t=o.plugins.scroll)===null||t===void 0||(t=t.documents[i])===null||t===void 0?void 0:t.currentPage)>=((n=o.plugins.scroll)===null||n===void 0||(n=n.documents[i])===null||n===void 0?void 0:n.totalPages)}},"scroll:previous-page":{id:"scroll:previous-page",labelKey:"page.previous",icon:"chevronLeft",categories:["page","navigation","navigation-previous"],shortcuts:["Ctrl+[","Meta+[","ArrowLeft"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("scroll"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).scrollToPreviousPage()},disabled:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.scroll)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.currentPage)<=1}},"mode:view":{id:"mode:view",labelKey:"mode.view",categories:["mode","mode-view"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin("ui"))===null||t===void 0?void 0:t.provides(),s=(n=i.getPlugin("interaction-manager"))===null||n===void 0?void 0:n.provides();if(a&&s){var l=s.forDocument(r);l&&(l.activateDefaultMode(),a.forDocument(r).closeToolbarSlot("top","secondary"),(o=i.getPlugin(Y))===null||o===void 0||o.provides().forDocument(r).setLocked((function(c){var d;return(d=c.getPluginConfig(Y).locked)!==null&&d!==void 0?d:{type:Ze.None}})(i)))}},active:function(e){var t=e.state,n=e.documentId;return!po(t.plugins,n,"top","secondary")}},"mode:annotate":{id:"mode:annotate",labelKey:"mode.annotate",categories:["mode","mode-annotate","annotation"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("ui"))===null||t===void 0?void 0:t.provides();r&&(r.setActiveToolbar("top","secondary","annotation-toolbar",i),(n=o.getPlugin(Y))===null||n===void 0||n.provides().forDocument(i).setLocked({type:Ze.Include,categories:["form"]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,"top","secondary","annotation-toolbar")}},"mode:shapes":{id:"mode:shapes",labelKey:"mode.shapes",categories:["mode","mode-shapes","annotation","annotation-shape"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("ui"))===null||t===void 0?void 0:t.provides();r&&(r.setActiveToolbar("top","secondary","shapes-toolbar",i),(n=o.getPlugin(Y))===null||n===void 0||n.provides().forDocument(i).setLocked({type:Ze.Include,categories:["form"]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,"top","secondary","shapes-toolbar")}},"mode:insert":{id:"mode:insert",labelKey:"mode.insert",categories:["mode","mode-insert","insert"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("ui"))===null||t===void 0?void 0:t.provides();r&&(r.setActiveToolbar("top","secondary","insert-toolbar",i),(n=o.getPlugin(Y))===null||n===void 0||n.provides().forDocument(i).setLocked({type:Ze.Include,categories:["form"]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,"top","secondary","insert-toolbar")}},"mode:form":{id:"mode:form",labelKey:"mode.form",categories:["mode","mode-form","form"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("ui"))===null||t===void 0?void 0:t.provides();r&&(r.setActiveToolbar("top","secondary","form-toolbar",i),(n=o.getPlugin(Y))===null||n===void 0||n.provides().forDocument(i).setLocked({type:Ze.None}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,"top","secondary","form-toolbar")}},"form:add-textfield":{id:"form:add-textfield",labelKey:"form.textfield",icon:"formTextfield",categories:["form","form-textfield"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="formTextField"?a.setActiveTool(null):a.setActiveTool("formTextField"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="formTextField"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:add-checkbox":{id:"form:add-checkbox",labelKey:"form.checkbox",icon:"formCheckbox",categories:["form","form-checkbox"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="formCheckbox"?a.setActiveTool(null):a.setActiveTool("formCheckbox"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="formCheckbox"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:add-radio":{id:"form:add-radio",labelKey:"form.radio",icon:"formRadio",categories:["form","form-radio"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="formRadioButton"?a.setActiveTool(null):a.setActiveTool("formRadioButton"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="formRadioButton"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:add-select":{id:"form:add-select",labelKey:"form.select",icon:"formSelect",categories:["form","form-select"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="formCombobox"?a.setActiveTool(null):a.setActiveTool("formCombobox"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="formCombobox"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:add-listbox":{id:"form:add-listbox",labelKey:"form.listbox",icon:"formListbox",categories:["form","form-listbox"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="formListbox"?a.setActiveTool(null):a.setActiveTool("formListbox"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="formListbox"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:toggle-fill-mode":{id:"form:toggle-fill-mode",labelKey:"form.toggleFillMode",icon:"widgetEdit",categories:["form","form-fill-mode"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o);i&&(i.isCategoryLocked("form")?i.setLocked({type:Ze.None}):i.setLocked({type:Ze.Include,categories:["form"]}))},active:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(i);return!((n=r?.isCategoryLocked("form"))===null||n===void 0||n)}},"mode:redact":{id:"mode:redact",labelKey:"mode.redact",categories:["mode","mode-redact","redaction"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("ui"))===null||t===void 0?void 0:t.provides();r&&(r.setActiveToolbar("top","secondary","redaction-toolbar",i),(n=o.getPlugin(Y))===null||n===void 0||n.provides().forDocument(i).setLocked({type:Ze.Include,categories:["form"]}))},active:function(e){var t=e.state,n=e.documentId;return po(t.plugins,n,"top","secondary","redaction-toolbar")}},"insert:add-rubber-stamp":{id:"insert:add-rubber-stamp",labelKey:"insert.rubberStamp",icon:"rubberStamp",categories:["insert","insert-rubber-stamp"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("left","main","rubber-stamp-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"left","main","rubber-stamp-panel")},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"insert:add-signature":{id:"insert:add-signature",labelKey:"signature.title",icon:"signature",categories:["insert","insert-signature"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("left","main","signature-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"left","main","signature-panel")},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"signature:create":{id:"signature:create",labelKey:"signature.create.title",icon:"signature",categories:["insert","insert-signature"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(ht))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).openModal("signature-create-modal")}},"insert:add-attachment":{id:"insert:add-attachment",label:"Attachment",icon:"paperclip",categories:["insert","insert-attachment"],action:function(){}},"insert:add-image":{id:"insert:add-image",labelKey:"insert.image",icon:"photo",categories:["insert","insert-image"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="stamp"?a.setActiveTool(null):a.setActiveTool("stamp"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="stamp"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"tabs:overflow-menu":{id:"tabs:overflow-menu",labelKey:"tabs.overflowMenu",icon:"dots",categories:["ui","ui-menu"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.toggleMenu("mode-tabs-overflow-menu","tabs:overflow-menu","overflow-tabs-button",o)},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins.ui)===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.openMenus["mode-tabs-overflow-menu"])!==void 0}},"annotation:add-highlight":{id:"annotation:add-highlight",labelKey:"annotation.highlight",icon:"highlight",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"highlight"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-highlight"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides(),s=(n=i.getPlugin(qn))===null||n===void 0?void 0:n.provides(),l=(o=i.getPlugin("ui"))===null||o===void 0?void 0:o.provides();if(s&&a&&l){var c=a?.forDocument(r),d=s?.forDocument(r);if(c&&d){var u=a.getTool("highlight");if(u&&V0(u)){var m=u.defaults,g=d.getFormattedSelection(),p=d.getSelectedText();if(g.length>0){c.setLocked({type:Ze.Exclude,categories:["markup","shape"]});var f,v=Dt(g);try{var y=function(){var w=f.value,x=pe(),C=function(I){c.createAnnotation(w.pageIndex,B({id:x,created:new Date,flags:["print"],type:T.HIGHLIGHT,blendMode:ve.Multiply,strokeColor:m.strokeColor,opacity:m.opacity,pageIndex:w.pageIndex,rect:w.rect,segmentRects:w.segmentRects},I!=null&&{custom:{text:I}})),c.selectAnnotation(w.pageIndex,x)};p.wait(function(I){return C(I.join(`
2383`))},function(){return C()})};for(v.s();!(f=v.n()).done;)y()}catch(w){v.e(w)}finally{v.f()}d.clear(),c.setActiveTool("highlight"),l.setActiveToolbar("top","secondary","annotation-toolbar",r)}else{var b;((b=c.getActiveTool())===null||b===void 0?void 0:b.id)==="highlight"?c.setA
2383ctiveTool(null):c.setActiveTool("highlight")}}}}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="highlight"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-underline":{id:"annotation:add-underline",labelKey:"annotation.underline",icon:"underline",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"underline"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-underline"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides(),s=(n=i.getPlugin(qn))===null||n===void 0?void 0:n.provides(),l=(o=i.getPlugin("ui"))===null||o===void 0?void 0:o.provides();if(s&&a&&l){var c=a?.forDocument(r),d=s?.forDocument(r);if(c&&d){var u=a.getTool("underline");if(u&&Z0(u)){var m=u.defaults,g=d.getFormattedSelection(),p=d.getSelectedText();if(g.length>0){c.setLocked({type:Ze.Exclude,categories:["markup","shape"]});var f,v=Dt(g);try{var y=function(){var w=f.value,x=pe(),C=function(I){c.createAnnotation(w.pageIndex,B({id:x,created:new Date,flags:["print"],type:T.UNDERLINE,strokeColor:m.strokeColor,opacity:m.opacity,pageIndex:w.pageIndex,rect:w.rect,segmentRects:w.segmentRects},I!=null&&{custom:{text:I}})),c.selectAnnotation(w.pageIndex,x)};p.wait(function(I){return C(I.join(`
2384`))},function(){return C()})};for(v.s();!(f=v.n()).done;)y()}catch(w){v.e(w)}finally{v.f()}d.clear(),c.setActiveTool("underline"),l.setActiveToolbar("top","secondary","annotation-toolbar",r)}else{var b;((b=c.getActiveTool())===null||b===void 0?void 0:b.id)==="underline"?c.setActiveTool(null):c.setActiveTool("underline")}}}}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="underline"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-strikeout":{id:"annotation:add-strikeout",labelKey:"annotation.strikeout",icon:"strikethrough",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"strikeout"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-strikeout"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides(),s=(n=i.getPlugin(qn))===null||n===void 0?void 0:n.provides(),l=(o=i.getPlugin("ui"))===null||o===void 0?void 0:o.provides();if(s&&a&&l){var c=a?.forDocument(r),d=s?.forDocument(r);if(c&&d){var u=a.getTool("strikeout");if(u&&Y0(u)){var m=u.defaults,g=d.getFormattedSelection(),p=d.getSelectedText();if(g.length>0){c.setLocked({type:Ze.Exclude,categories:["markup","shape"]});var f,v=Dt(g);try{var y=function(){var w=f.value,x=pe(),C=function(I){c.createAnnotation(w.pageIndex,B({id:x,created:new Date,flags:["print"],type:T.STRIKEOUT,strokeColor:m.strokeColor,opacity:m.opacity,pageIndex:w.pageIndex,rect:w.rect,segmentRects:w.segmentRects},I!=null&&{custom:{text:I}})),c.selectAnnotation(w.pageIndex,x)};p.wait(function(I){return C(I.join(`
2385`))},function(){return C()})};for(v.s();!(f=v.n()).done;)y()}catch(w){v.e(w)}finally{v.f()}d.clear(),c.setActiveTool("strikeout"),l.setActiveToolbar("top","secondary","annotation-toolbar",r)}else{var b;((b=c.getActiveTool())===null||b===void 0?void 0:b.id)==="strikeout"?c.setActiveTool(null):c.setActiveTool("strikeout")}}}}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="strikeout"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-squiggly":{id:"annotation:add-squiggly",labelKey:"annotation.squiggly",icon:"squiggly",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"squiggly"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-squiggly"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides(),s=(n=i.getPlugin(qn))===null||n===void 0?void 0:n.provides(),l=(o=i.getPlugin("ui"))===null||o===void 0?void 0:o.provides();if(s&&a&&l){var c=a?.forDocument(r),d=s?.forDocument(r);if(c&&d){var u=a.getTool("squiggly");if(u&&X0(u)){var m=u.defaults,g=d.getFormattedSelection(),p=d.getSelectedText();if(g.length>0){c.setLocked({type:Ze.Exclude,categories:["markup","shape"]});var f,v=Dt(g);try{var y=function(){var w=f.value,x=pe(),C=function(I){c.createAnnotation(w.pageIndex,B({id:x,created:new Date,flags:["print"],type:T.SQUIGGLY,strokeColor:m.strokeColor,opacity:m.opacity,pageIndex:w.pageIndex,rect:w.rect,segmentRects:w.segmentRects},I!=null&&{custom:{text:I}})),c.selectAnnotation(w.pageIndex,x)};p.wait(function(I){return C(I.join(`
2386`))},function(){return C()})};for(v.s();!(f=v.n()).done;)y()}catch(w){v.e(w)}finally{v.f()}d.clear(),c.setActiveTool("squiggly"),l.setActiveToolbar("top","secondary","annotation-toolbar",r)}else{var b;((b=c.getActiveTool())===null||b===void 0?void 0:b.id)==="squiggly"?c.setActiveTool(null):c.setActiveTool("squiggly")}
2386}}}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="squiggly"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-insert-text":{id:"annotation:add-insert-text",labelKey:"annotation.insertText",icon:"insertText",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"insertText"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-insert-text"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="insertText"?a.setActiveTool(null):a.setActiveTool("insertText"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="insertText"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-replace-text":{id:"annotation:add-replace-text",labelKey:"annotation.replaceText",icon:"replaceText",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"replaceText"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-markup","annotation-replace-text"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="replaceText"?a.setActiveTool(null):a.setActiveTool("replaceText"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="replaceText"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-ink":{id:"annotation:add-ink",labelKey:"annotation.ink",icon:"pencilMarker",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"ink"))===null||t===void 0?void 0:t.color}},categories:["annotation","annotation-ink"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="ink"?a.setActiveTool(null):a.setActiveTool("ink"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="ink"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-ink-highlighter":{id:"annotation:add-ink-highlighter",labelKey:"annotation.inkHighlighter",icon:"inkHighlighter",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"inkHighlighter"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-ink"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="inkHighlighter"?a.setActiveTool(null):a.setActiveTool("inkHighlighter"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="inkHighlighter"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-text":{id:"annotation:add-text",labelKey:"annotation.text",icon:"freeText",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"freeText"))===null||t===void 0?void 0:t.fontColor}},categories:["annotation","annotation-text"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="freeText"?a.setActiveTool(null):a.setActiveTool("freeText"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="freeText"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-callout":{id:"annotation:add-callout",labelKey:"annotation.callout",icon:"callout",iconProps:function(e){var t,n,o=e.state;return{primaryColor:(t=Ye(o.plugins.annotation,"freeTextCallout"))===null||t===void 0?void 0:t.strokeColor,secondaryColor:(n=Ye(o.plugins.annotation,"freeTextCallout"))===null||n===void 0?void 0:n.color}},categories:["annotation","annotation-text"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="freeTextCallout"?a.setActiveTool(null):a.setActiveTool("freeTextCallout"))},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins[Y])===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.activeToolId)==="freeTextCallout"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-comment":{id:"annotation:add-comment",labelKey:"annotation.comment",icon:"message",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"textComment"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-comment-tool"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="textComment"?a.setActiveTool(null):a.setActiveTool("textComment"))},active:function(e){var t,n=e.state,o=e.documentId;return((t=n.plugins[Y])===null||t===void 0||(t=t.documents[o])===null||t===void 0?void 0:t.activeToolId)==="textComment"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-rectangle":{id:"annotation:add-rectangle",labelKey:"annotation.rectangle",icon:"square",iconProps:function(e){var t,n,o=e.state;return{primaryColor:(t=Ye(o.plugins.annotation,"square"))===null||t===void 0?void 0:t.strokeColor,secondaryColor:(n=Ye(o.plugins.annotation,"square"))===null||n===void 0?void 0:n.color}},categories:["annotation","annotation-shape","annotation-rectangle"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="square"?a.setActiveTool(null):a.setActiveTool("square"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="square"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-circle":{id:"annotation:add-circle",labelKey:"annotation.circle",icon:"circle",iconProps:function(e){var t,n,o=e.state;return{primaryColor:(t=Ye(o.plugins.annotation,"circle"))===null||t===void 0?void 0:t.strokeColor,secondaryColor:(n=Ye(o.plugins.annotation,"circle"))===null||n===void 0?void 0:n.color}},categories:["annotation","annotation-shape","annotation-circle"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="circle"?a.setActiveTool(null):a.setActiveTool("
2386circle"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="circle"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-line":{id:"annotation:add-line",labelKey:"annotation.line",icon:"line",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"line"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-shape","annotation-line"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="line"?a.setActiveTool(null):a.setActiveTool("line"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="line"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-arrow":{id:"annotation:add-arrow",labelKey:"annotation.arrow",icon:"lineArrow",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"line"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-shape","annotation-arrow"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="lineArrow"?a.setActiveTool(null):a.setActiveTool("lineArrow"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="lineArrow"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-polygon":{id:"annotation:add-polygon",labelKey:"annotation.polygon",icon:"polygon",iconProps:function(e){var t,n,o=e.state;return{primaryColor:(t=Ye(o.plugins.annotation,"polygon"))===null||t===void 0?void 0:t.strokeColor,secondaryColor:(n=Ye(o.plugins.annotation,"polygon"))===null||n===void 0?void 0:n.color}},categories:["annotation","annotation-shape","annotation-polygon"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="polygon"?a.setActiveTool(null):a.setActiveTool("polygon"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="polygon"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:add-polyline":{id:"annotation:add-polyline",labelKey:"annotation.polyline",icon:"zigzag",iconProps:function(e){var t;return{primaryColor:(t=Ye(e.state.plugins.annotation,"polyline"))===null||t===void 0?void 0:t.strokeColor}},categories:["annotation","annotation-shape","annotation-polyline"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=r?.forDocument(i);a&&(((n=a.getActiveTool())===null||n===void 0?void 0:n.id)==="polyline"?a.setActiveTool(null):a.setActiveTool("polyline"))},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[Y])===null||t===void 0?void 0:t.documents[o];return i?.activeToolId==="polyline"},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:delete-selected":{id:"annotation:delete-selected",labelKey:"annotation.deleteSelected",icon:"trash",categories:["annotation","annotation-delete"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides(),r=i?.forDocument(o);if(r){var a=r.getSelectedAnnotation();a&&r.deleteAnnotation(a.object.pageIndex,a.object.id)}},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:delete-all-selected":{id:"annotation:delete-all-selected",labelKey:"annotation.deleteAllSelected",icon:"trash",categories:["annotation","annotation-delete","annotation-group"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides(),r=i?.forDocument(o);if(r){var a=r.getSelectedAnnotations();a.length!==0&&(r.deleteAnnotations(a.map(function(s){return{pageIndex:s.object.pageIndex,id:s.object.id}})),r.deselectAnnotation())}},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:toggle-group":{id:"annotation:toggle-group",labelKey:function(e){var t,n=e.registry,o=e.documentId;return((t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o).getGroupingAction())==="ungroup"?"annotation.ungroup":"annotation.group"},icon:function(e){var t,n=e.registry,o=e.documentId;return((t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o).getGroupingAction())==="ungroup"?"ungroup":"group"},categories:["annotation","annotation-group"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o);if(i){var r=i.getGroupingAction();if(r==="ungroup"){var a=i.getSelectedAnnotations();a.length>0&&i.ungroupAnnotations(a[0].object.id)}else r==="group"&&i.groupAnnotations()}},disabled:function(e){var t,n=e.registry,o=e.state,i=e.documentId;return!!fe(o,i,U.ModifyAnnotations)||((t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(i).getGroupingAction())==="disabled"}},"stamp:create-from-selected":{id:"stamp:create-from-selected",labelKey:"stamp.createFromSelected",icon:"rubberStampPlus",categories:["annotation","stamp"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(r);if(a){var s=a.getSelectedAnnotation();if(s){var l=(n=i.getPlugin(di))===null||n===void 0?void 0:n.provides().forDocument(r);if(l){l.createStampFromAnnotation(s.object,{name:Pe.Custom,subject:"Custom Stamp ".concat(Date.now()),categories:["custom","sidebar"]});var c=(o=i.getPlugin(ht))===null||o===void 0||(o=o.provides())===null||o===void 0?void 0:o.forDocument(r);c?.setActiveSidebar("left","main","rubber-stamp-panel",void 0,{selectedLibraryId:"custom"})}}}},visible:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(i);if(!r)return!1;var a=(n=r.getSelectedAnnotation())===null||n===void 0?void 0:n.object.type;return!!a&&![T.REDACT,T.HIGHLIGHT,T.SQUIGGLY,T.UNDERLINE,T.STRIKEOUT,T.CARET,T.WIDGET].includes(a)},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)||fe(t,n,U.CopyContents)}},"stamp:create-from-group":{id:"stamp:create-from-group",labelKey:"stamp.createFromGroup",icon:"rubberStampPlus",categories:["annotation","stamp","annotation-group"],action:function(e){var t,n,o,i=e.registry,r=e.documentId,a=(t=i.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(r);if(a){var s=a.getSelectedAnnotations();if(s.length!==0){var l=(n=i.getPlugin(di))===null||n===void 0?void 0:n.provides().forDocument(r);if(l){var c=s.map(function(u){return u.object});l.createStampFromAnnotations(c,{name:Pe.Custom,subject:"Custom Stamp ".concat(Date.now()),categories:["custom","sidebar"]});var d=(o=i.getPlugin(ht))===null||o===void 0||(o=o.provides())===null||o===void 0?void 0:o.forDocument(r);d?.setActiveSidebar("left","main","rubber-stamp-panel",void 0,{selectedLibraryId:"custom"})}}}},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o);if(!i)return!1;var r=i.getSelectedAnnotations();if(r.length===0)return!1;var a=[T.REDACT,T.HIGHLIGHT,T.SQUIGGLY,T.UNDERLINE,T.STRIKEOUT,T.CARET,T.WIDGET];return r.every(function(s){return!a.includes(s.object.type)})},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)||fe(t,n,U.CopyContents)}},"annotation:overflow-tools":{id:"annotation:overflow-tools",labelKey:"annotation.moreTools",icon:"dots",categories:["annotation","annotation-overflow"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();if(i){var r=i.forDocument(o);r&&r.toggleMenu("annotation-tools-menu","annotation:overflow-tools","overflow-annotation-tools")}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["annotation-tools-menu"]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:overflow-shapes":{id:"annotation:overflow-shapes",labelKey:"annotation.moreTools",icon:"dots",categories:["annotation","annotation-shape","annotation-overflow"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();if(i){var r=i.forDocument(o);r&&r.toggleMenu("shapes-tools-menu","annotation:overflow-shapes","overflow-shapes-tools")}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["shapes-tools-menu"]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"form:overflow-tools":{id:"form:overflow-tools",labelKey:"annotation.moreTools",icon:"dots",categories:["form","form-overflow"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();if(i){var r=i.forDocument(o);r&&r.toggleMenu("form-tools-menu","form:overflow-tools","overflow-forms-tools")}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins.ui)===null||t===void 0?void 0:t.documents[o];return i?.openMenus["form-tools-menu"]!==void 0},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}}
2386,"annotation:add-link":{id:"annotation:add-link",labelKey:"annotation.addLink",icon:"link",categories:["annotation","annotation-link"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("ui"))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).openModal("link-modal",{source:"selection"})},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:toggle-annotation-style":{id:"annotation:toggle-annotation-style",labelKey:"annotation.style",icon:"palette",categories:["annotation","annotation-style"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("left","main","annotation-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"left","main","annotation-panel")},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o),r=i?.getSelectedAnnotation();return!r||r.object.type!==T.LINK},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:toggle-link":{id:"annotation:toggle-link",labelKey:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o);if(!i)return"annotation.addLink";var r=i.getSelectedAnnotation();return r&&i.hasAttachedLinks(r.object.id)?"annotation.removeLink":"annotation.addLink"},icon:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o);if(!i)return"link";var r=i.getSelectedAnnotation();return r&&i.hasAttachedLinks(r.object.id)?"linkOff":"link"},categories:["annotation","annotation-link"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=(n=o.getPlugin("ui"))===null||n===void 0?void 0:n.provides();if(r&&a){var s=r.forDocument(i),l=s.getSelectedAnnotation();l&&(s.hasAttachedLinks(l.object.id)?s.deleteAttachedLinks(l.object.id):a.forDocument(i).openModal("link-modal",{source:"annotation"}))}},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o),r=i?.getSelectedAnnotation();return!r||r.object.type!==T.LINK&&r.object.type!==T.REDACT&&r.object.type!==T.WIDGET},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyAnnotations)}},"annotation:toggle-widget-edit":{id:"annotation:toggle-widget-edit",labelKey:"annotation.widgetEdit",icon:"widgetEdit",categories:["annotation","annotation-widget-edit"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),a=(n=o.getPlugin("ui"))===null||n===void 0?void 0:n.provides();r&&a&&r.forDocument(i).getSelectedAnnotation()&&a.forDocument(i).toggleSidebar("right","main","widget-edit-panel")},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"right","main","widget-edit-panel")},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o),r=i?.getSelectedAnnotation();return!r||r.object.type===T.WIDGET}},"annotation:toggle-comment":{id:"annotation:toggle-comment",labelKey:"annotation.comment",icon:"comment",categories:["annotation","annotation-comment"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin(ht);if(o&&o.provides){var i=o.provides();i&&i.forDocument(n).toggleSidebar("right","main","comment-panel")}},active:function(e){var t=e.state,n=e.documentId;return Yt(t.plugins,n,"right","main","comment-panel")},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o),r=i?.getSelectedAnnotation();return!r||r.object.type!==T.LINK&&r.object.type!==T.WIDGET}},"annotation:goto-link":{id:"annotation:goto-link",labelKey:"annotation.gotoLink",icon:"externalLink",categories:["annotation","annotation-link"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides();if(r){var a=r.forDocument(i),s=a.getSelectedAnnotation();if(s){var l=null;if((function(d){return d.object.type===T.LINK})(s))l=s.object;else{var c=a.getAttachedLinks(s.object.id);c.length>0&&(l=c[0].object)}(n=l)!==null&&n!==void 0&&n.target&&a.navigateTarget(l.target)}}},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides();if(!i)return!1;var r=i.forDocument(o),a=r?.getSelectedAnnotation();return!!a&&(a.object.type===T.LINK||r.hasAttachedLinks(a.object.id))}},"redaction:redact":{id:"redaction:redact",labelKey:"redaction.redact",icon:"redactArea",categories:["redaction","redaction-combined"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).toggleRedact()},active:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();return(n=r?.forDocument(i).isRedactActive())!==null&&n!==void 0&&n},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyContents)}},"redaction:redact-area":{id:"redaction:redact-area",labelKey:"redaction.area",icon:"redactArea",categories:["redaction","redaction-area"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).toggleMarqueeRedact()},active:function(e){var t,n,o=e.registry,i=e.documentId,r=(t=o.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();return(n=r?.forDocument(i).isMarqueeRedactActive())!==null&&n!==void 0&&n},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyContents)}},"redaction:redact-text":{id:"redaction:redact-text",labelKey:"redaction.text",icon:"redact",categories:["redaction","redaction-text"],action:function(e){var t,n,o,i,r=e.registry,a=e.documentId,s=(t=r.getPlugin("redaction"))===null||t===void 0?void 0:t.provides(),l=(n=r.getPlugin(qn))===null||n===void 0?void 0:n.provides(),c=(o=r.getPlugin("ui"))===null||o===void 0?void 0:o.provides();if(s&&l&&c){var d,u=s.forDocument(a),m=l?.forDocument(a);((i=m?.getFormattedSelection())!==null&&i!==void 0?i:[]).length>0?((d=r.getPlugin(Y))===null||d===void 0||d.provides().forDocument(a).setLocked({type:Ze.Exclude,categories:["redaction"]}),u.queueCurrentSelectionAsPending(),c.setActiveToolbar("top","secondary","redaction-toolbar",a)):u.toggleRedactSelection()}},active:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[wo])===null||t===void 0?void 0:t.documents[o];return i?.activeType===je.RedactSelection},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyContents)}},"redaction:apply-all":{id:"redaction:apply-all",labelKey:"redaction.applyAll",icon:"check",categories:["redaction","redaction-apply"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).commitAllPending()},disabled:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[wo])===null||t===void 0?void 0:t.documents[o];return i?.pendingCount===0||fe(n,o,U.ModifyContents)}},"redaction:clear-all":{id:"redaction:clear-all",labelKey:"redaction.clearAll",icon:"x",categories:["redaction","redaction-clear"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides();i?.forDocument(o).clearPending()},disabled:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[wo])===null||t===void 0?void 0:t.documents[o];return i?.pendingCount===0||fe(n,o,U.ModifyContents)}},"redaction:delete-selected":{id:"redaction:delete-selected",labelKey:"redaction.deleteSelected",icon:"trash",categories:["redaction","redaction-delete"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides(),r=i?.forDocument(o).getSelectedPending();r&&i?.forDocument(o).removePending(r.page,r.id)}},"redaction:commit-selected":{id:"redaction:commit-selected",labelKey:"redaction.commitSelected",icon:"check",categories:["redaction","redaction-commit"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin("redaction"))===null||t===void 0?void 0:t.provides(),r=i?.forDocument(o).getSelectedPending();r&&i?.forDocument(o).commitPending(r.page,r.id)}},"annotation:apply-redaction":{id:"annotation:apply-redaction",labelKey:"redaction.apply",icon:"check",categories:["annotation","annotation-redaction","redaction"],action:function(e){var t,n,o=e.registry,i=e.documentId,r=e.logger;r.debug("Command","ApplyRedaction","Starting for document: ".concat(i));var a=(t=o.getPlugin(Y))===null||t===void 0?void 0:t.provides(),s=(n=o.getPlugin(wo))===null||n===void 0?void 0:n.provides();if(a&&s){var l=a.forDocument(i).getSelectedAnnotation();r.debug("Command","ApplyRedaction","Selected annotation: ".concat(l?JSON.stringify({id:l.object.id,type:l.object.type,pageIndex:l.object.pageIndex}):"none")),l&&l.object.type===T.REDACT?(r.debug("Command","ApplyRedaction","Calling commitPending for page ".concat(l.object.pageIndex,", id ").concat(l.object.id)),s.forDocument(i).c
2386ommitPending(l.object.pageIndex,l.object.id),r.debug("Command","ApplyRedaction","commitPending called successfully")):r.warn("Command","ApplyRedaction","No valid redaction selected - selected: ".concat(!!l,", type: ").concat(l?.object.type))}else r.warn("Command","ApplyRedaction","Missing plugins - annotation: ".concat(!!a,", redaction: ").concat(!!s))},visible:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(Y))===null||t===void 0?void 0:t.provides().forDocument(o),r=i?.getSelectedAnnotation();return r?.object.type===T.REDACT},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.ModifyContents)}},"selection:copy-to-clipboard":{id:"selection:copy-to-clipboard",labelKey:"selection.copyToClipboard",icon:"copy",shortcuts:["Ctrl+C","Meta+C"],categories:["selection","selection-copy-to-clipboard"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin("selection"),i=o?.provides().forDocument(n);i?.copyToClipboard()},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.CopyContents)}},"selection:copy":{id:"selection:copy",labelKey:"selection.copy",icon:"copy",categories:["selection","selection-copy"],action:function(e){var t=e.registry,n=e.documentId,o=t.getPlugin("selection"),i=o?.provides().forDocument(n);i?.copyToClipboard(),i?.clear()},disabled:function(e){var t=e.state,n=e.documentId;return fe(t,n,U.CopyContents)}},"history:undo":{id:"history:undo",labelKey:"history.undo",icon:"arrowBackUp",shortcuts:["Ctrl+Z","Meta+Z"],categories:["history","history-undo"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(bo))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).undo()},disabled:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[bo])===null||t===void 0?void 0:t.documents[o];return!(i!=null&&i.global.canUndo)}},"history:redo":{id:"history:redo",labelKey:"history.redo",icon:"arrowForwardUp",shortcuts:["Ctrl+Y","Meta+Shift+Z"],categories:["history","history-redo"],action:function(e){var t,n=e.registry,o=e.documentId,i=(t=n.getPlugin(bo))===null||t===void 0?void 0:t.provides();i&&i.forDocument(o).redo()},disabled:function(e){var t,n=e.state,o=e.documentId,i=(t=n.plugins[bo])===null||t===void 0?void 0:t.documents[o];return!(i!=null&&i.global.canRedo)}}},KI={"zoom.level":function(e){var t,n,o=e.state,i=e.documentId,r=i&&(t=(n=o.plugins[Ws])===null||n===void 0||(n=n.documents[i])===null||n===void 0?void 0:n.currentZoomLevel)!==null&&t!==void 0?t:1;return{level:Math.round(100*r)}}},Lv={colors:{background:{app:"#f3f4f6",surface:"#ffffff",surfaceAlt:"#f1f3f5",elevated:"#ffffff",overlay:"rgba(0, 0, 0, 0.5)",input:"#ffffff"},foreground:{primary:"#111827",secondary:"#374151",muted:"#6b7280",disabled:"#9ca3af",onAccent:"#ffffff"},border:{default:"#d1d5db",subtle:"#e5e7eb",strong:"#9ca3af"},accent:{primary:"#3b82f6",primaryHover:"#2563eb",primaryActive:"#1d4ed8",primaryLight:"#eff6ff",primaryForeground:"#ffffff"},interactive:{hover:"#f3f4f6",active:"#e5e7eb",selected:"#eff6ff",focus:"#3b82f6",focusRing:"#bfdbfe"},state:{error:"#ef4444",errorLight:"#fef2f2",warning:"#f59e0b",warningLight:"#fffbeb",success:"#22c55e",successLight:"#f0fdf4",info:"#3b82f6",infoLight:"#eff6ff"},tooltip:{background:"#111827",foreground:"#ffffff"},scrollbar:{track:"#f3f4f6",thumb:"#d1d5db",thumbHover:"#9ca3af"}}},Nv={colors:{background:{app:"#111827",surface:"#1f2937",surfaceAlt:"#374151",elevated:"#1f2937",overlay:"rgba(0, 0, 0, 0.7)",input:"#374151"},foreground:{primary:"#f9fafb",secondary:"#e5e7eb",muted:"#9ca3af",disabled:"#6b7280",onAccent:"#111827"},border:{default:"#4b5563",subtle:"#374151",strong:"#6b7280"},accent:{primary:"#60a5fa",primaryHover:"#3b82f6",primaryActive:"#2563eb",primaryLight:"#1e3a5f",primaryForeground:"#111827"},interactive:{hover:"#374151",active:"#4b5563",selected:"#1e3a5f",focus:"#60a5fa",focusRing:"#1e40af"},state:{error:"#f87171",errorLight:"#7f1d1d",warning:"#fbbf24",warningLight:"#78350f",success:"#4ade80",successLight:"#14532d",info:"#60a5fa",infoLight:"#1e3a5f"},tooltip:{background:"#f9fafb",foreground:"#111827"},scrollbar:{track:"#1f2937",thumb:"#4b5563",thumbHover:"#6b7280"}}};function Ov(e,t){var n=B({},e);for(var o in t){var i=t[o];i&&Yn(i)==="object"&&!Array.isArray(i)?n[o]=Ov(e[o]||{},i):i!==void 0&&(n[o]=i)}return n}function Fv(e,t){return{colors:Ov(e.colors,t)}}function ku(e){return e==="system"?typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
2386k":"light":e}function Cu(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function VI(e){return`:host {
2387`.concat((function(t){var n=[];return(function o(i,r){for(var a=0,s=Object.entries(i);a<s.length;a++){var l=q(s[a],2),c=l[0],d=l[1];d&&Yn(d)==="object"?o(d,"".concat(r,"-").concat(Cu(c))):d!==void 0&&n.push("  --ep".concat(r,"-").concat(Cu(c),": ").concat(d,";"))}})(t.colors,""),n.join(`
2388`)})(e),`
2389}`)}function XI(e){var t=e.documentStates,n=e.activeDocumentId,o=e.visibility,i=o===void 0?"multiple":o,r=e.allowOpenFile,a=r===void 0||r,s=Lo().provides,l=W(function(u){s?.setActiveDocument(u)},[s]),c=W(function(u){s?.closeDocument(u)},[s]),d=W(function(){s?.openFileDialog()},[s]);return i==="always"||i==="multiple"&&t.length>1?h("div",{className:"bg-bg-surface-alt flex items-end pr-2 pt-2"},h("div",{className:"flex flex-1 items-end overflow-x-auto pl-4"},t.map(function(u){var m,g,p=n===u.id;return h("div",{key:u.id,onClick:function(){return l(u.id)},role:"tab",tabIndex:0,"aria-selected":p,onKeyDown:function(f){f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),l(u.id))},className:"group relative flex min-w-[120px] max-w-[240px] cursor-pointer items-center gap-2 rounded-t-lg px-4 py-2 text-sm font-medium transition-all ".concat(p?"bg-bg-surface text-fg-primary z-10":"bg-bg-surface-alt text-fg-secondary hover:bg-interactive-hover hover:text-fg-primary")},h("span",{className:"min-w-0 flex-1 truncate"},(m=u.name)!==null&&m!==void 0?m:"Document ".concat(u.id.slice(0,8))),p&&h("button",{onClick:function(f){f.stopPropagation(),c(u.id)},"aria-label":"Close ".concat((g=u.name)!==null&&g!==void 0?g:"document"),className:"hover:bg-interactive-hover flex-shrink-0 cursor-pointer rounded-full p-1 transition-all ".concat(p?"opacity-100":"opacity-0 group-hover:opacity-100")},h(ye,{icon:"x",size:14})))}),a&&h("button",{onClick:d,className:"text-fg-secondary hover:bg-interactive-hover hover:text-fg-primary mb-1.5 ml-1 flex-shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":"Open File",title:"Open File"},h(ye,{icon:"plus",size:14})))):null}function ZI(){var e=Lo().provides,t=Le().translate;return h("div",{className:"bg-bg-app flex h-full w-full items-center justify-center"},h("div",{className:"flex max-w-sm flex-col items-center text-center"},h("div",{className:"bg-accent-light mb-6 rounded-full p-5"},h(ye,{icon:"file",size:48,className:"text-accent"})),h("h2",{className:"text-fg-primary mb-2 text-xl font-semibold"},t("emptyState.title")),h("p",{className:"text-fg-secondary mb-6 text-sm leading-relaxed"},t("emptyState.description"),h("br",null),t("emptyState.descriptionMulti")),h("button",{onClick:function(){e?.openFileDialog()},className:"bg-accent hover:bg-accent-hover text-accent-fg inline-flex cursor-pointer items-center gap-2 rounded-md px-5 py-2.5 text-sm font-medium shadow-sm transition-all"},h(ye,{icon:"plus",size:16}),t("emptyState.openButton")),h("p",{className:"text-fg-muted mt-4 text-xs"},t("emptyState.supportedFormats"))))}function YI(e){var t=e.documentState,n=Lo().provides,o=Le().translate,i=q(O(""),2),r=i[0],a=i[1],s=q(O(!1),2),l=s[0],c=s[1];if(!t)return null;var d=t.name,u=t.errorCode,m=t.passwordProvided,g=u===H.Password,p=g&&!m,f=g&&m;if(!g)return h("div",{className:"bg-bg-app flex h-full items-center justify-center p-8"},h("div",{className:"bg-bg-surface border-border-default flex max-w-sm flex-col items-center rounded-xl border p-6 text-center shadow-lg"},h("div",{className:"bg-state-error-light mb-4 rounded-full p-4"},h(ye,{icon:"alertTriangle",size:28,className:"text-state-error"})),h("h3",{className:"text-fg-primary text-lg font-semibold"},o("documentError.title")),h("p",{className:"text-fg-secondary mt-2 text-sm"},t.error||o("documentError.unknown")),u&&h("p",{className:"text-fg-muted mt-1 text-xs"},o("documentError.errorCode",{params:{code:String(u)}})),h("button",{onClick:function(){return n?.closeDocument(t.id)},className:"bg-accent hover:bg-accent-hover text-accent-fg mt-5 w-full cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors"},o("documentError.close"))));var v=(function(){var y=Au(ei().m(function b(){return ei().w(function(w){for(;;)switch(w.n){case 0:if(n&&r.trim()){w.n=1;break}return w.a(2);case 1:c(!0),n.retryDocument(t.id,{password:r}).wait(function(){a(""),c(!1)},function(x){console.error("Retry failed:",x),c(!1)});case 2:return w.a(2)}},b)}));return function(){return y.apply(this,arguments)}})();return h("div",{className:"bg-bg-app flex h-full items-center justify-center p-8"},h("div",{className:"bg-bg-surface border-border-default w-full max-w-sm rounded-xl border p-6 shadow-lg"},h("div",{className:"flex flex-col items-center text-center"},h("div",{className:"bg-accent-light mb-4 rounded-full p-4"},h(ye,{icon:"lock",size:28,className:"text-accent"})),h("h3",{className:"text-fg-primary text-lg font-semibold"},o("passwordPrompt.title")),d&&h("p",{className:"text-fg-muted mt-1 text-sm"},d)),h("p",{className:"text-fg-secondary mt-4 text-center text-sm"},p&&o("passwordPrompt.required"),f&&o("passwordPrompt.incorrect")),h("div",{className:"mt-5"},h("label",{className:"text-fg-primary mb-1.5 block text-sm font-medium"},o("passwordPrompt.label")),h("input",{type:"password",value:r,onInput:function(y){return a(y.target.value)},onKeyDown:function(y){return y.key==="Enter"&&!l&&r.trim()&&v()},disabled:l,placeholder:o("passwordPrompt.placeholder"),className:"bg-bg-input border-border-default focus:border-accent focus:ring-accent text-fg-primary placeholder:text-fg-muted block w-full rounded-md border px-3 py-2.5 text-sm focus:outline-none focus:ring-1 disabled:opacity-50",autoFocus:!0})),f&&h("div",{className:"bg-state-error-light border-state-error mt-3 flex items-center gap-2 rounded-md border p-3"},h(ye,{icon:"alertTriangle",size:16,className:"text-state-error flex-shrink-0"}),h("p",{className:"text-state-error text-sm"},o("passwordPrompt.incorrectWarning"))),h("div",{className:"mt-6 flex gap-3"},h("button",{onClick:function(){return n?.closeDocument(t.id)},disabled:l,className:"border-border-default text-fg-secondary hover:bg-interactive-hover flex-1 cursor-pointer rounded-md border px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50"},o("passwordPrompt.cancel")),h("button",{onClick:v,disabled:l||!r.trim(),className:"bg-accent hover:bg-accent-hover text-accent-fg flex-1 cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50"},o(l?"passwordPrompt.opening":"passwordPrompt.open")))))}function QI(e){var t=e.documentId,n=e.className,o=Gt("mode:view",t),i=Gt("mode:annotate",t),r=Gt("mode:shapes",t),a=Gt("mode:redact",t),s=Gt("mode:form",t),l=Gt("mode:insert",t),c=Gt("tabs:overflow-menu",t),d=Z(function(){return[o,i,r,s,l,a].find(function(g){return g?.active})||o},[o,i,r,s,l,a]),u=W(function(g){g.preventDefault(),g.stopPropagation(),c&&!c.disabled&&c.execute()},[c]);if(!c||!c.visible)return null;var m=c.active;return h("div",{style:{maxWidth:"100px",width:"100px"},className:n},h(Je,{className:"bg-bg-surface col-start-1 row-start-1 !w-full appearance-none rounded-md py-1.5 pl-3 pr-2 text-[13px] ".concat(m?"bg-interactive-selected ring-accent border-none shadow ring":"border-border-default outline-border-default hover:bg-interactive-hover hover:ring-accent outline outline-1 -outline-offset-1 hover:ring"," flex flex-row items-center justify-between gap-2"),onClick:u,disabled:c.disabled,style:{height:34}},h("span",{className:"min-w-0 flex-1 truncate text-left ".concat(m?"text-accent":"text-fg-primary")},d?.label),h(ye,{icon:"chevronDown",className:"h-4 w-4 ".concat(m?"text-accent":"text-fg-secondary")})))}function JI(e){var t=e.documentId,n=ff().provides,o=q(O(!1),2),i=o[0],r=o[1],a=q(O(null),2),s=a[0],l=a[1],c=q(O(null),2),d=c[0],u=c[1],m=q(O(null),2),g=m[0],p=m[1],f=K(null),v=K(null),y=Le(t).translate,b=function(){f.current&&(URL.revokeObjectURL(f.current),f.current=null),g&&(URL.revokeObjectURL(g),p(null)),r(!1),l(null),u(null)};return $(function(){if(n)return n.onCaptureArea(function(w){var x=w.pageIndex,C=w.rect,I=w.blob;l({pageIndex:x,rect:C,blob:I});var S=URL.createObjectURL(I);f.current=S,u(S),r(!0)})},[n]),h(de,null,h(Fo,{open:i,onClose:b,title:y("capture.title"),className:"md:w-[48rem]"},h("div",{className:"space-y-6"},h("div",{className:"flex justify-center"},d&&h("img",{src:d,onLoad:function(){f.current&&(URL.revokeObjectURL(f.current),f.current=null)},alt:"Captured PDF area",style:{maxWidth:"100%",maxHeight:"400px",border:"1px solid #e5e7eb",borderRadius:"4px",display:"block"}})),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},h(Je,{onClick:b,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},y("capture.cancel")),h(Je,{onClick:function(){if(s&&v.current){var w=URL.createObjectURL(s.blob);p(w),v.current.href=w,v.current.download="pdf-capture-page-".concat(s.pageIndex+1,".png"),v.current.click(),b()}},disabled:!s,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},y("capture.download"))))),h("a",{ref:v,style:{display:"none"},href:"",download:""}))}var tr=[{flag:U.Print,labelKey:"protect.permissions.print"},{flag:U.PrintHighQuality,labelKey:"protect.permissions.printHighQuality"},{flag:U.CopyContents,labelKey:"protect.permissions.copy"},{flag:U.ExtractForAccessibility,labelKey:"protect.permissions.accessibility"},{flag:U.ModifyContents,labelKey:"protect.permissions.modify"},{flag:U.ModifyAnnotations,labelKey:"protect.permissions.annotations"},{flag:U.FillForms,labelKey:"protect.permissions.fillForms"},{flag:U.AssembleDocument,labelKey:"protect.permissions.assemble"}];function _v(e){var t=e.permissions,n=e.translate,o=e.label;return h("div",null,h("label",{className:"text-fg-secondary mb-2 block text-sm font-medium"},o??n("security.viewPermissions.restrictedActions")),h("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2"},tr.map(function(i){var r,a=(r=i.flag,(t&r)!==0);return h("div",{key:i.flag,className:"flex items-center rounded-md p-2 ".concat(a?"text-fg-primary":"text-fg-muted")},h(ye,{icon:a?"check":"x",className:"mr-2 h-4 w-4 flex-shrink-0 ".concat(a?"text-state-success":"text-state-error")}),h("span",{className:"text-sm"},n(i.labelKey)))})))}function eS(e){var t,n,o,i=e.documentId,r=e.isOpen,a=e.onClose,s=e.onExited,l=Le(i).translate,c=Lo().provides,d=pt(i),u=d?.document,m=(t=u?.isEncrypted)!==null&&t!==void 0&&t,g=(n=u?.isOwnerUnlocked)!==null&&n!==void 0&&n,p=(o=u?.permissions)!==null&&o!==void 0?o:0,f=q(O("edit-protection"),2),v=f[0],y=f[1],b=q(O(""),2),w=b[0],x=b[1],C=q(O(!1),2),I=C[0],S=C[1],P=q(O(!1),2),A=P[0],D=P[1],R=q(O(null),2),M=R[0],N=R[1],z=q(O(!1),2),_=z[0],L=z[1],j=q(O(""),2),E=j[0],F=j[1],X=q(O(""),2),Q=X[0],J=X[1],te=q(O(!1),2),G=te[0],oe=te[1],le=q(O(!1),2),Te=le[0],De=le[1],Ne=q(O(""),2),V=Ne[0],Se=Ne[1],He=q(O(""),2),Re=He[0],ae=He[1],Ie=q(O(!1),2),be=Ie[0],Oe=Ie[1],vt=O(new Set(tr.map(function(we){return we.flag}))),Pt=q(vt,2),Wt=Pt[0],ze=Pt[1],Vt=q(O(!1),2),tt=Vt[0],xt=Vt[1],rt=q(O(null),2),Ht=rt[0],kt=rt[1];$(function(){r&&(x(""),S(!1),D(!1),N(null),L(!1),F(""),J(""),oe(!1),De(!1),Se(""),ae(""),Oe(!1),ze(new Set(tr.map(function(we){return we.flag}))),xt(!1),kt(null),y(m&&!g?"unlock":m&&g?"choose-action":"edit-protection"))},[r,m,g]);var ln=E===Q,cn=V===Re,dn=!_||E.length>0&&ln,_o=!Te||V.length>0&&cn,$n=(_||Te)&&dn&&_o&&!tt,un=function(){c&&w&&(D(!0),N(null),c.unlockOwnerPermissions(i,w).wait(function(we){D(!1),we?y("choose-action"):N(l("security.unlock.invalidPassword"))},function(we){var Be,ce;D(!1),N((Be=(ce=we.reason)===null||ce===void 0?void 0:ce.message)!==null&&Be!==void 0?Be:l("security.unlock.failed"))}))},hn=function(){if($n&&c){var we=0;if(Te){var Be,ce=Dt(Wt);try{for(ce.s();!(Be=ce.n()).done;)we|=Be.value}catch(Zt){ce.e(Zt)}finally{ce.f()}}else we=U.AllowAll;var Ge=_?E:"",so=Te?V:_?E:"";xt(!0),kt(null),c.setDocumentEncryption(i,{userPassword:Ge,ownerPassword:so,allowedFlags:we}).wait(function(Zt){xt(!1),Zt?a?.():kt(l("protect.applyFailed"))},function(Zt){var pn,lt;xt(!1),kt((pn=(lt=Zt.reason)===null||lt===void 0?void 0:lt.message)!==null&&pn!==void 0?pn:l("protect.applyFailed"))})}},Xt=function(){c&&(xt(!0),kt(null),c.removeEncryption(i).wait(function(we){xt(!1),we?a?.():kt(l("protect.removeFailed"))},function(we){var Be,ce;xt(!1),kt((Be=(ce=we.reason)===null||ce===void 0?void 0:ce.message)!==null&&Be!==void 0?Be:l("protect.removeFailed"))}))},mn=function(){return h("div",{className:"space-y-6"},h("div",{className:"bg-bg-subtle rounded-lg"},h("label",{className:"flex cursor-pointer items-start"},h("input",{type:"checkbox",checked:_,onChange:function(we){return L(we.target.checked)},className:"accent-accent mr-3 mt-0.5"}),h("div",{className:"flex-1"},h("span",{className:"text-fg-primary block font-medium"},l("protect.openPassword.title")),h("span",{className:"text-fg-muted text-sm"},l("protect.openPassword.description")))),_&&h("div",{className:"mt-4 space-y-3 pl-6"},h("div",null,h("label",{className:"text-fg-secondary mb-1 block text-sm"},l("protect.openPassword.label")),h("div",{className:"relative"},h("input",{type:G?"text":"password",value:E,onInput:function(we){return F(we.target.value)},placeholder:l("protect.openPassword.placeholder"),className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1"}),h("button",{type:"button",onClick:function(){return oe(!G)},className:"text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2"},h(ye,{icon:G?"eye-off":"eye",className:"h-4 w-4"})))),h("div",null,h("label",{className:"text-fg-secondary mb-1 block text-sm"},l("protect.openPassword.confirm")),h("input",{type:G?"text":"password",value:Q,onInput:function(we){return J(we.target.value)},placeholder:l("protect.openPassword.confirmPlaceholder"),className:"border-border-default bg-bg-input text-fg-primary focus:ring-accent w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 ".concat(Q&&!ln?"border-state-error focus:border-state-error":"focus:border-accent")}),Q&&!ln&&h("p",{className:"text-state-error mt-1 text-xs"},l("protect.passwordMismatch"))))),h("div",{className:"bg-bg-subtle rounded-lg"},h("label",{className:"flex cursor-pointer items-start"},h("input",{type:"checkbox",checked:Te,onChange:function(we){return De(we.target.checked)},className:"accent-accent mr-3 mt-0.5"}),h("div",{className:"flex-1"},h("span",{className:"text-fg-primary block font-medium"},l("protect.permissions.title")),h("span",{className:"text-fg-muted text-sm"},l("protect.permissions.description")))),Te&&h("div",{className:"mt-4 space-y-4 pl-6"},h("div",{className:"border-border-subtle border-b pb-4"},h("div",null,h("label",{className:"text-fg-secondary mb-1 block text-sm"},l("protect.ownerPassword.label")),h("div",{className:"relative"},h("input",{type:be?"text":"password",value:V,onInput:function(we){return Se(we.target.value)},placeholder:l("protect.ownerPassword.placeholder"),className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1"}),h("button",{type:"button",onClick:function(){return Oe(!be)},className:"text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2"},h(ye,{icon:be?"eye-off":"eye",className:"h-4 w-4"})))),h("div",{className:"mt-3"},h("label",{className:"text-fg-secondary mb-1 block text-sm"},l("protect.ownerPassword.confirm")),h("input",{type:be?"text":"password",value:Re,onInput:function(we){return ae(we.target.value)},placeholder:l("protect.ownerPassword.confirmPlaceholder"),className:"border-border-default bg-bg-input text-fg-primary focus:ring-accent w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 ".concat(Re&&!cn?"border-state-error focus:border-state-error":"focus:border-accent")}),Re&&!cn&&h("p",{className:"text-state-error mt-1 text-xs"},l("protect.passwordMismatch")))),h("div",null,h("label",{className:"text-fg-secondary mb-2 block text-sm font-medium
2389"},l("protect.permissions.allowedActions")),h("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2"},tr.map(function(we){return h("label",{key:we.flag,className:"hover:bg-bg-surface flex cursor-pointer items-center rounded-md p-2 transition-colors"},h("input",{type:"checkbox",checked:Wt.has(we.flag),onChange:function(){return Be=we.flag,void ze(function(ce){var Ge=new Set(ce);return Ge.has(Be)?Ge.delete(Be):(Ge.add(Be),Be===U.PrintHighQuality&&Ge.add(U.Print)),Ge});var Be},className:"accent-accent mr-2"}),h("span",{className:"text-fg-primary text-sm"},l(we.labelKey)))}))))),_&&Te&&h("div",{className:"bg-state-info-light flex items-start space-x-2 rounded-md p-3"},h(ye,{icon:"info",className:"text-accent mt-0.5 h-4 w-4 flex-shrink-0"}),h("p",{className:"text-fg-secondary text-sm"},l("protect.bothPasswordsNote"))),!_&&!Te&&!Ht&&h("div",{className:"bg-state-warning-light flex items-start space-x-2 rounded-md p-3"},h(ye,{icon:"alertTriangle",className:"text-state-warning mt-0.5 h-4 w-4 flex-shrink-0"}),h("p",{className:"text-fg-secondary text-sm"},l("protect.noProtectionSelected"))),Ht&&h("div",{className:"bg-state-error-light flex items-start space-x-2 rounded-md p-3"},h(ye,{icon:"alertTriangle",className:"text-state-error mt-0.5 h-4 w-4 flex-shrink-0"}),h("p",{className:"text-state-error text-sm"},Ht)),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},m&&g&&h(Je,{onClick:function(){return y("choose-action")},disabled:tt,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},l("common.back")),h(Je,{onClick:hn,disabled:!$n,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},tt&&h(So,{size:"sm"}),h("span",null,l(tt?"protect.applying":"protect.apply")))))};return h(Fo,{open:r!=null&&r,title:(function(){switch(v){case"unlock":return l("protect.encrypted.title");case"choose-action":return l("protect.modifyProtection.title");case"remove-protection":return l("protect.removeProtection.title");default:return l("protect.title")}})(),onClose:a,onExited:s,className:"md:w-[36rem]"},(function(){switch(v){case"unlock":return h("div",{className:"space-y-5"},h("p",{className:"text-fg-secondary text-sm"},l("protect.encrypted.description")),h("div",null,h("label",{className:"text-fg-primary mb-2 block text-sm font-medium"},l("protect.encrypted.enterOwnerPassword")),h("div",{className:"relative"},h("input",{type:I?"text":"password",value:w,onInput:function(we){return x(we.target.value)},placeholder:l("protect.ownerPassword.placeholder"),className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1",onKeyDown:function(we){we.key==="Enter"&&w&&un()}}),h("button",{type:"button",onClick:function(){return S(!I)},className:"text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2"},h(ye,{icon:I?"eye-off":"eye",className:"h-4 w-4"}))),M&&h("p",{className:"text-state-error mt-2 text-xs"},M)),h(_v,{permissions:p,translate:l}),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},h(Je,{onClick:un,disabled:!w||A,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},A&&h(So,{size:"sm"}),h("span",null,l("protect.encrypted.unlockAndEdit")))));case"choose-action":return h("div",{className:"space-y-5"},h("p",{className:"text-fg-secondary text-sm"},l("protect.modifyProtection.description")),h("div",{className:"space-y-3"},h("button",{type:"button",onClick:function(){return y("edit-protection")},className:"border-border-default hover:border-accent hover:bg-bg-subtle flex w-full items-center rounded-lg border p-4 text-left transition-colors"},h("div",{className:"bg-accent/10 mr-4 rounded-full p-2"},h(ye,{icon:"lock",size:20,className:"text-accent"})),h("div",null,h("span",{className:"text-fg-primary block font-medium"},l("protect.modifyProtection.changeOption")),h("span",{className:"text-fg-muted text-sm"},l("protect.modifyProtection.changeDescription")))),h("button",{type:"button",onClick:function(){return y("remove-protection")},className:"border-border-default hover:border-state-error hover:bg-state-error-light flex w-full items-center rounded-lg border p-4 text-left transition-colors"},h("div",{className:"bg-state-error-light mr-4 rounded-full p-2"},h(ye,{icon:"unlock",size:20,className:"text-state-error"})),h("div",null,h("span",{className:"text-fg-primary block font-medium"},l("protect.modifyProtection.removeOption")),h("span",{className:"text-fg-muted text-sm"},l("protect.modifyProtection.removeDescription"))))),h("div",{className:"border-border-subtle flex justify-end border-t pt-4"},h(Je,{onClick:a,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm"},l("protect.cancel"))));case"remove-protection":return h("div",{className:"space-y-5"},h("div",{className:"bg-state-warning-light flex items-start space-x-3 rounded-lg p-4"},h(ye,{icon:"alertTriangle",className:"text-state-warning mt-0.5 h-5 w-5 flex-shrink-0"}),h("div",null,h("p",{className:"text-fg-primary font-medium"},l("protect.removeProtection.warning")),h("p",{className:"text-fg-secondary mt-1 text-sm"},l("protect.removeProtection.description")))),Ht&&h("div",{className:"bg-state-error-light flex items-start space-x-2 rounded-md p-3"},h(ye,{icon:"alertTriangle",className:"text-state-error mt-0.5 h-4 w-4 flex-shrink-0"}),h("p",{className:"text-state-error text-sm"},Ht)),h("div",{className:"border-border-subtle flex justify-end space-x-3 border-t pt-4"},h(Je,{onClick:function(){return y("choose-action")},disabled:tt,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},l("common.back")),h(Je,{onClick:Xt,disabled:tt,className:"bg-state-error text-fg-on-accent hover:bg-state-error/90 flex items-center space-x-2 rounded-md border border-transparent px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},tt&&h(So,{size:"sm"}),h("span",null,l("protect.removeProtection.confirm")))));default:return mn()}})())}function tS(e){var t,n,o,i=e.documentId,r=Le(i).translate,a=ro().provides,s=pt(i),l=s?.document,c=(t=l?.isEncrypted)!==null&&t!==void 0&&t,d=(n=l?.isOwnerUnlocked)!==null&&n!==void 0&&n,u=(((o=l?.permissions)!==null&&o!==void 0?o:U.AllowAll)&U.AllowAll)!==U.AllowAll,m=c&&!d&&u,g=W(function(){a?.forDocument(i).disableOverlay("unlock-owner-overlay")},[i,a]),p=W(function(){a?.forDocument(i).disableOverlay("unlock-owner-overlay"),a?.forDocument(i).openModal("view-permissions-modal")},[i,a]);return m?h("div",{className:""},h("div",{className:"bg-bg-surface border-border-default flex max-w-sm items-start gap-3 rounded-lg border p-4 shadow-lg"},h("div",{className:"bg-accent/10 flex-shrink-0 rounded-full p-2"},h(ye,{icon:"lock",size:20,className:"text-accent"})),h("div",{className:"min-w-0 flex-1"},h("h3",{className:"text-fg-primary text-sm font-semibold"},r("security.protected.title")),h("p",{className:"text-fg-secondary mt-1 text-xs leading-relaxed"},r("security.protected.description")),h("button",{type:"button",onClick:p,className:"text-accent hover:text-accent-hover mt-2 text-xs font-medium"},r("security.protected.viewPermissions"))),h("button",{type:"button",onClick:g,className:"text-fg-muted hover:text-fg-secondary -mr-1 -mt-1 flex-shrink-0 p-1","aria-label":r("common.close")},h(ye,{icon:"x",size:16})))):null}function nS(e){var t,n,o=e.documentId,i=e.isOpen,r=e.onClose,a=e.onExited,s=Le(o).translate,l=pt(o),c=Lo().provides,d=q(O(""),2),u=d[0],m=d[1],g=q(O(!1),2),p=g[0],f=g[1],v=q(O(!1),2),y=v[0],b=v[1],w=q(O(null),2),x=w[0],C=w[1],I=l?.document,S=(t=I?.permissions)!==null&&t!==void 0?t:0,P=(n=I?.isOwnerUnlocked)!==null&&n!==void 0&&n;$(function(){i&&(m(""),f(!1),b(!1),C(null))},[i]);var A=function(){c&&u&&(b(!0),C(null),c.unlockOwnerPermissions(o,u).wait(function(D){b(!1),D?m(""):C(s("security.unlock.invalidPassword"))},function(D){var R,M;b(!1),C((R=(M=D.reason)===null||M===void 0?void 0:M.message)!==null&&R!==void 0?R:s("security.unlock.failed"))}))};return h(Fo,{open:i!=null&&i,title:s("security.viewPermissions.title"),onClose:r,onExited:a,className:"md:w-[32rem]"},h("div",{className:"space-y-5"},h("p",{className:"text-fg-secondary text-sm"},s("security.viewPermissions.description")),!P&&h("div",null,h("label",{className:"text-fg-primary mb-2 block text-sm font-medium"},s("security.unlock.label")),h("div",{className:"relative"},h("input",{type:p?"text":"password",value:u,onInput:function(D){return m(D.target.value)},placeholder:s("security.unlock.placeholder"),className:"border-border-default bg-bg-input text-fg-primary focus:border-accent focus:ring-accent w-full rounded-md border px-3 py-2 pr-10 text-sm focus:outline-none focus:ring-1",onKeyDown:function(D){D.key==="Enter"&&u&&A()}}),h("button",{type:"button",onClick:function(){return f(!p)},className:"text-fg-muted hover:text-fg-secondary absolute right-2 top-1/2 -translate-y-1/2"},h(ye,{icon:p?"eye-off":"eye",className:"h-4 w-4"}))),x&&h("p",{className:"text-state-error mt-2 text-xs"},x),h(Je,{onClick:A,disabled:!u||y,className:"bg-accent text-fg-on-accent hover:!bg-accent-hover mt-3 flex items-center space-x-2 rounded-md px-4 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50"},y&&h(So,{size:"sm"}),h("span",null,s("security.unlock.button")))),P&&h("div",{className:"bg-state-success-light flex items-center space-x-2 rounded-md p-3"},h(ye,{icon:"check",className:"text-state-success h-4 w-4 flex-shrink-0"}),h("p",{className:"text-fg-secondary text-sm"},s("security.unlock.success"))),h(_v,{permissions:S,translate:s}),h("div",{className:"border-border-subtle flex justify-end border-t pt-4"},h(Je,{onClick:r,className:"border-border-default bg-bg-surface text-fg-secondary hover:bg-interactive-hover rounded-md border px-4 py-2 text-sm"},s("common.close")))))}var _e={documentManager:{},commands:{commands:qI
vendor: 100,927 bytes, line 2389
2389},i18n:{defaultLocale:"en",locales:[{code:"en",name:"English",translations:{search:{placeholder:"Search",caseSensitive:"Case sensitive",wholeWord:"Whole word",resultsFound:"{count} results found",page:"Page {page}"},zoom:{in:"Zoom In",out:"Zoom Out",fitWidth:"Fit to Width",fitPage:"Fit to Page",marquee:"Marquee Zoom",menu:"Zoom Menu",level:"Zoom Level ({level}%)",dragTip:"Drag to select area to zoom"},pan:{toggle:"Toggle Pan Mode"},pointer:{toggle:"Toggle Pointer Mode"},capture:{screenshot:"Screenshot",dragTip:"Drag to select area to capture",title:"Screenshot Preview",download:"Download",cancel:"Cancel"},document:{menu:"Document Menu",open:"Open",close:"Close",print:"Print",protect:"Security",export:"Export",fullscreen:"Fullscreen",loading:"Loading document..."},emptyState:{title:"No Documents Open",description:"Open a PDF document to get started.",descriptionMulti:"You can view multiple documents using tabs.",openButton:"Open Document",supportedFormats:"Supported format: PDF"},passwordPrompt:{title:"Password Required",required:"This document is password protected. Please enter the password to open it.",incorrect:"The password you entered was incorrect. Please try again.",incorrectWarning:"Incorrect password. Please check and try again.",label:"Password",placeholder:"Enter document password",open:"Open",opening:"Opening...",cancel:"Cancel",close:"Close"},documentError:{title:"Error loading document",unknown:"An unknown error occurred",errorCode:"Error Code: {code}",close:"Close Document"},panel:{sidebar:"Sidebar",search:"Search",comment:"Comment",thumbnails:"Thumbnails",outline:"Outline",annotationStyle:"Annotation Style",redaction:"Redaction Sidebar"},menu:{viewControls:"View Controls",zoomControls:"Zoom Controls",moreOptions:"More Options"},outline:{title:"Outline",loading:"Loading outline...",noOutline:"No outline available",noBookmarks:"This document doesn't contain bookmarks"},page:{settings:"Page Settings",single:"Single Page",twoOdd:"Two Page (Odd)",twoEven:"Two Page (Even)",vertical:"Vertical",horizontal:"Horizontal",spreadMode:"Spread Mode",scrollLayout:"Scroll Layout",rotation:"Page Rotation",next:"Next Page",previous:"Previous Page"},rotate:{clockwise:"Rotate Clockwise",counterClockwise:"Rotate Counter-Clockwise"},selection:{copy:"Copy Selection"},mode:{view:"View",annotate:"Annotate",shapes:"Shapes",form:"Form",redact:"Redact",insert:"Insert"},form:{textfield:"Text Field",checkbox:"Checkbox",radio:"Radio Button",select:"Dropdown",listbox:"List Box"},annotation:{text:"Text",highlight:"Highlight",strikeout:"Strikethrough",underline:"Underline",squiggly:"Squiggly",rectangle:"Rectangle",circle:"Circle",line:"Line",arrow:"Arrow",polygon:"Polygon",polyline:"Polyline",ink:"Ink",inkHighlighter:"Ink Highlighter",stamp:"Stamp",caret:"Caret",insertText:"Insert Text",replaceText:"Replace Text",freeText:"Free Text",square:"Square",style:"Annotation Style",styles:"{type} Styles",defaults:"{type} Defaults",color:"Color",opacity:"Opacity",blendMode:"Blend mode",strokeWidth:"Stroke width",strokeColor:"Stroke color",borderStyle:"Border style",fillColor:"Fill color",fontSize:"Font size",fontFamily:"Font",textAlign:"Text alignment",verticalAlign:"Vertical alignment",lineEnding:"Line ending",lineStart:"Line start",lineEnd:"Line end",font:"Font",fontColor:"Font color",backgroundColor:"Background color",noStyles:"There are no styles for this annotation.",noStylesStamp:"There are no styles for stamps.",selectAnnotation:"Select an annotation to see styles",deleteSelected:"Delete selected annotation",deleteAllSelected:"Delete Selected",multiSelect:"{count} annotations selected",group:"Group",ungroup:"Ungroup",moreTools:"More Tools",addLink:"Add Link",removeLink:"Remove Link",gotoLink:"Go to Link",comment:"Comment",callout:"Callout",redact:"Redact",overlayText:"Overlay Text",overlayTextPlaceholder:"e.g., REDACTED",rotation:"Rotation"},insert:{image:"Image",rubberStamp:"Rubber Stamp"},redaction:{redact:"Redact",area:"Redact Area",text:"Redact Text",apply:"Apply Redaction",applyAll:"Apply All",clearAll:"Clear All",deleteSelected:"Delete selected redaction",commitSelected:"Apply selected redaction",emptyState:"No pending redactions",panel:{title:"Redactions",itemCount:"{count} pending redaction",itemCountPlural:"{count} pending redactions",clearAll:"Clear All",redactAll:"Redact All"}},history:{undo:"Undo",redo:"Redo"},comments:{page:"Page {page}",commentCount:"{count} comment",commentCountPlural:"{count} comments",addComment:"Add comment...",addReply:"Add reply...",showAllAnnotations:"Show All Annotations",closeAllAnnotations:"Close All Annotations",save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",showMore:"more",showLess:"less",emptyState:"Add annotations to be able to comment on them."},blendMode:{normal:"Normal",multiply:"Multiply",screen:"Screen",overlay:"Overlay",darken:"Darken",lighten:"Lighten",colorDodge:"Color Dodge",colorBurn:"Color Burn",hardLight:"Hard Light",softLight:"Soft Light",difference:"Difference",exclusion:"Exclusion",hue:"Hue",saturation:"Saturation",color:"Color",luminosity:"Luminosity"},print:{title:"Print Settings",loading:"Preparing document...",pages:"Pages to print",all:"All pages",current:"Current page ({currentPage})",specify:"Specify pages",specifyEG:"e.g., 1-3, 5, 8-10",total:"Total pages in document: {totalPages}",annotation:"Include annotations",printing:"Printing...",print:"Print",cancel:"Cancel"},protect:{title:"Protect Document",cancel:"Cancel",apply:"Apply Protection",applying:"Applying...",applyFailed:"Failed to apply protection. Please try again.",removeFailed:"Failed to remove protection. Please try again.",passwordMismatch:"Passwords do not match",noProtectionSelected:"Select at least one protection option to apply.",bothPasswordsNote:"Users who open with the document password will have restricted permissions. Use the owner password to unlock full access.",openPassword:{title:"Require password to open",description:"Users must enter a password to view this document.",label:"Document Password",placeholder:"Enter password",confirm:"Confirm Password",confirmPlaceholder:"Confirm password"},ownerPassword:{label:"Owner Password",placeholder:"Enter owner password",confirm:"Confirm Owner Password",confirmPlaceholder:"Confirm owner password"},permissions:{title:"Restrict permissions",description:"Limit what users can do with this document.",allowedActions:"Allowed actions",print:"Print",printHighQuality:"Print high quality",copy:"Copy content",accessibility:"Extract for accessibility",modify:"Modify content",annotations:"Add/modify annotations & comments",fillForms:"Fill forms & sign",assemble:"Assemble & extract pages"},encrypted:{title:"Document is Protected",description:"This document is protected by the owner. Enter the owner password to modify security settings.",enterOwnerPassword:"Enter Owner Password to Modify",unlockAndEdit:"Unlock & Edit"},modifyProtection:{title:"Modify Protection",description:"Choose how you want to modify the document protection.",changeOption:"Change Passwords or Permissions",changeDescription:"Update the document password or permission settings.",removeOption:"Remove All Protection",removeDescription:"Remove password protection from this document."},removeProtection:{title:"Remove Protection",warning:"Are you sure you want to remove protection?",description:"This will remove all password protection from the document. Anyone will be able to open and modify it.",confirm:"Remove Protection"}},security:{protected:{title:"This Document is Protected",description:"This file is protected and some features may be disabled. Go to Security in the document menu to view or unlock permissions.",viewPermissions:"View permissions"},viewPermissions:{title:"Document Permissions",description:"This file is restricted by the owner and requires a password to unlock certain actions.",restrictedActions:"Restricted Actions"},unlock:{label:"Enter Owner Password to Unlock File",placeholder:"Enter owner password",button:"Unlock file",invalidPassword:"Invalid password. Please try again.",failed:"Failed to unlock. Please try again.",success:"Owner permissions unlocked! You now have full access."}},common:{close:"Close",back:"Back",cancel:"Cancel"},link:{title:"Insert Link",url:"URL",page:"Page",enterUrl:"Enter URL",enterPage:"Enter Page Number",pageRange:"Page 1 to {totalPages}",link:"Link"},stamp:{title:"Rubber Stamps",allStamps:"All Stamps",export:"Export Stamps",emptyState:"No stamps found in the selected library.",createFromSelected:"Create Stamp",createFromGroup:"Create Stamp from Group",library:{custom:"Custom Stamps"}},signature:{title:"Signatures",createNew:"Create New Signature",createNewWithInitials:"Create Signature & Initials",placeSignature:"Signature",placeInitials:"Initials",remove:"Remove signature",emptyState:"No signatures yet. Create one to get started.",create:{title:"Create Signature",draw:"Draw",type:"Type",upload:"Upload",signatureLabel:"Signature",initialsLabel:"Initials",clear:"Clear",typePlaceholder:"e.g. John Smith",initialsPlaceholder:"e.g. JS",uploadPlaceholder:"Click or drag an image here",font:"Font",color:"Color",cancel:"Cancel",save:"Save"}}}},{code:"nl",name:"Nederlands",translations:{search:{placeholder:"Zoeken",caseSensitive:"Hoofdlettergevoelig",wholeWord:"Heel woord",resultsFound:"{count} resultaten gevonden",page:"Pagina {page}"},zoom:{in:"Inzoomen",out:"Uitzoomen",fitWidth:"Aanbreedte aanpassen",fitPage:"Aan pagina aanpassen",marquee:"Lijstzoom",menu:"Zoommenu",level:"Zoomniveau ({level}%)",dragTip:"Drag to select area to zoom"},pan:{toggle:"Pan-modus wisselen"},pointer:{toggle:"Aanwijzermodus wisselen"},capture:{screenshot:"Schermafbeelding",dragTip:"Sleep om een gebied te selecteren om vast te leggen",title:"Screenshot voorbeeld",download:"Downloaden",cancel:"Annuleren"},document:{menu:"Documentmenu",open:"Openen",close:"Sluiten",print:"Afdrukken",protect:"Beveiliging",export:"Exporteren",fullscreen:"Volledig scherm",loading:"Document laden..."},emptyState:{title:"Geen documenten geopend",description:"Open een PDF-document om te beginnen.",descriptionMulti:"U kunt meerdere documenten bekijken met tabs.",openButton:"Document openen",supportedFormats:"Ondersteund formaat: PDF"},passwordPrompt:{title:"Wachtwoord vereist",required:"Dit document is beveiligd met een wachtwoord. Voer het wachtwoord in om te openen.",incorrect:"Het ingevoerde wachtwoord was onjuist. Probeer het opnieuw.",incorrectWarning:"Onjuist wachtwoord. Controleer en probeer opnieuw.",label:"Wachtwoord",placeholder:"Voer documentwachtwoord in",open:"Openen",opening:"Openen...",cancel:"Annuleren",close:"Sluiten"},documentError:{title:"Fout bij laden van document",unknown:"Er is een onbekende fout opgetreden",errorCode:"Foutcode: {code}",close:"Document sluiten"},panel:{sidebar:"Zijbalk",search:"Zoeken",comment:"Opmerking",thumbnails:"Miniaturen",outline:"Overzicht",annotationStyle:"Annotatiestijl",redaction:"Redactie Zijbalk"},menu:{viewControls:"Weergave-instellingen",zoomControls:"Zoom-instellingen",moreOptions:"Meer opties"},outline:{title:"Overzicht",loading:"Overzicht laden...",noOutline:"Geen overzicht beschikbaar",noBookmarks:"Dit document bevat geen bladwijzers"},page:{settings:"Pagina-instellingen",single:"Enkele pagina",twoOdd:"Twee pagina's (Oneven)",twoEven:"Twee pagina's (Even)",vertical:"Verticaal",horizontal:"Horizontaal",spreadMode:"Spreidingsmodus",scrollLayout:"Scrollindeling",rotation:"Paginarotatie",next:"Volgende pagina",previous:"Vorige pagina"},rotate:{clockwise:"Met de klok mee draaien",counterClockwise:"Tegen de klok in draaien"},selection:{copy:"Selectie kopiëren"},mode:{view:"Weergave",annotate:"Annoteren",shapes:"Vormen",form:"Formulier",redact:"Redigeren",insert:"Invoegen"},form:{textfield:"Tekstveld",checkbox:"Selectievakje",radio:"Keuzerondje",select:"Dropdown",listbox:"Keuzelijst"},annotation:{text:"Tekst",highlight:"Markeren",strikeout:"Doorhalen",underline:"Onderstrepen",squiggly:"Golflijn",rectangle:"Rechthoek",circle:"Cirkel",line:"Lijn",arrow:"Pijl",polygon:"Veelhoek",polyline:"Polylijn",ink:"Inkt",inkHighlighter:"Inktmarkeerstift",stamp:"Stempel",caret:"Invoegpunt",insertText:"Tekst invoegen",replaceText:"Tekst vervangen",freeText:"Vrije tekst",square:"Vierkant",style:"Annotatiestijl",styles:"{type} stijlen",defaults:"{type} standaardwaarden",color:"Kleur",opacity:"Dekking",blendMode:"Overvloeimodus",strokeWidth:"Lijndikte",strokeColor:"Lijnkleur",borderStyle:"Randstijl",fillColor:"Vulkleur",fontSize:"Lettergrootte",fontFamily:"Lettertype",textAlign:"Tekstuitlijning",verticalAlign:"Verticale uitlijning",lineEnding:"Lijneinde",lineStart:"Lijnbegin",lineEnd:"Lijneinde",font:"Lettertype",fontColor:"Tekstkleur",backgroundColor:"Achtergrondkleur",noStyles:"Er zijn geen stijlen voor deze annotatie.",noStylesStamp:"Er zijn geen stijlen voor stempels.",selectAnnotation:"Selecteer een annotatie om stijlen te zien",deleteSelected:"Geselecteerde annotatie verwijderen",deleteAllSelected:"Selectie verwijderen",multiSelect:"{count} annotaties geselecteerd",group:"Groeperen",ungroup:"Groepering opheffen",moreTools:"Meer gereedschappen",addLink:"Link toevoegen",removeLink:"Link verwijderen",gotoLink:"Ga naar link",comment:"Opmerking",callout:"Callout",redact:"Redigeren",overlayText:"Overlaytekst",overlayTextPlaceholder:"bijv. GEREDIGEERD",rotation:"Rotatie"},insert:{image:"Afbeelding",rubberStamp:"Stempel"},redaction:{redact:"Redigeren",area:"Gebied redigeren",text:"Tekst redigeren",apply:"Redactie toepassen",applyAll:"Alles toepassen",clearAll:"Alles wissen",deleteSelected:"Geselecteerde redactie verwijderen",commitSelected:"Geselecteerde redactie toepassen",emptyState:"Geen openstaande redacties",panel:{title:"Redacties",itemCount:"{count} openstaande redactie",itemCountPlural:"{count} openstaande redacties",clearAll:"Alles wissen",redactAll:"Alles redigeren"}},history:{undo:"Ongedaan maken",redo:"Opnieuw doen"},comments:{page:"Pagina {page}",commentCount:"{count} opmerking",commentCountPlural:"{count} opmerkingen",addComment:"Opmerking toevoegen...",addReply:"Antwoord toevoegen...",showAllAnnotations:"Alle annotaties tonen",closeAllAnnotations:"Alle annotaties sluiten",save:"Opslaan",cancel:"Annuleren",edit:"Bewerken",delete:"Verwijderen",showMore:"meer",showLess:"minder",emptyState:"Voeg annotaties toe om erop te kunnen reageren."},blendMode:{normal:"Normaal",multiply:"Vermenigvuldigen",screen:"Bleken",overlay:"Bedekken",darken:"Donkerder",lighten:"Lichter",colorDodge:"Kleur tegenhouden",colorBurn:"Kleur doordrukken",hardLight:"Hard licht",softLight:"Zacht licht",difference:"Verschil",exclusion:"Uitsluiting",hue:"Kleurtoon",saturation:"Verzadiging",color:"Kleur",luminosity:"Helderheid"},print:{title:"Afdrukinstellingen",loading:"Document voorbereiden...",pages:"Af te drukken pagina's",all:"Alle pagina's",current:"Huidige pagina ({currentPage})",specify:"Pagina's",specifyEG:"bijv. 1-3, 5, 8-10",total:"Totaal aantal pagina's in document: {totalPages}",annotation:"Inclusief annotaties",printing:"Afdrukken...",print:"Afdrukken",cancel:"Annuleren"},protect:{title:"Document beveiligen",cancel:"Annuleren",apply:"Beveiliging toepassen",applying:"Bezig met toepassen...",applyFailed:"Beveiliging kon niet worden toegepast. Probeer het opnieuw.",removeFailed:"Beveiliging kon niet worden verwijderd. Probeer het opnieuw.",passwordMismatch:"Wachtwoorden komen niet overeen",noProtectionSelected:"Selecteer minimaal één beveiligingsoptie.",bothPasswordsNote:"Gebruikers die openen met het documentwachtwoord hebben beperkte rechten. Gebruik het eigenaarswachtwoord voor volledige toegang.",openPassword:{title:"Wachtwoord vereist om te openen",description:"Gebruikers moeten een wachtwoord invoeren om dit document te bekijken.",label:"Documentwachtwoord",placeholder:"Wachtwoord invoeren",confirm:"Wachtwoord bevestigen",confirmPlaceholder:"Wachtwoord bevestigen"},ownerPassword:{label:"Eigenaarswachtwoord",placeholder:"Eigenaarswachtwoord invoeren",confirm:"Eigenaarswachtwoord bevestigen",confirmPlaceholder:"Eigenaarswachtwoord bevestigen"},permissions:{title:"Rechten beperken",description:"Beperk wat gebruikers met dit document kunnen doen.",allowedActions:"Toegestane acties",print:"Afdrukken",printHighQuality:"Hoge kwaliteit afdrukken",copy:"Inhoud kopiëren",accessibility:"Extraheren voor toegankelijkheid",modify:"Inhoud wijzigen",annotations:"Annotaties & opmerkingen toevoegen/wijzigen",fillForms:"Formulieren invullen & ondertekenen",assemble:"Document samenstellen & pagina's extraheren"},encrypted:{title:"Document is beveiligd",description:"Dit document is beveiligd door de eigenaar. Voer het eigenaarswachtwoord in om beveiligingsinstellingen te wijzigen.",enterOwnerPassword:"Voer eigenaarswachtwoord in om te wijzigen",unlockAndEdit:"Ontgrendelen & Bewerken"},modifyProtection:{title:"Beveiliging wijzigen",description:"Kies hoe u de documentbeveiliging wilt wijzigen.",changeOption:"Wachtwoorden of rechten wijzigen",changeDescription:"Update het documentwachtwoord of rechtinstellingen.",removeOption:"Alle beveiliging verwijderen",removeDescription:"Verwijder wachtwoordbeveiliging van dit document."},removeProtection:{title:"Beveiliging verwijderen",warning:"Weet u zeker dat u de beveiliging wilt verwijderen?",description:"Dit verwijdert alle wachtwoordbeveiliging van het document. Iedereen kan het openen en wijzigen.",confirm:"Beveiliging verwijderen"}},security:{protected:{title:"Dit document is beveiligd",description:"Dit bestand is beveiligd en sommige functies zijn mogelijk uitgeschakeld. Ga naar Beveiliging in het documentmenu om rechten te bekijken of te ontgrendelen.",viewPermissions:"Rechten bekijken"},viewPermissions:{title:"Documentrechten",description:"Dit bestand is beperkt door de eigenaar en vereist een wachtwoord om bepaalde acties te ontgrendelen.",restrictedActions:"Beperkte acties"},unlock:{label:"Voer eigenaarswachtwoord in om te ontgrendelen",placeholder:"Eigenaarswachtwoord invoeren",button:"Bestand ontgrendelen",invalidPassword:"Ongeldig wachtwoord. Probeer het opnieuw.",failed:"Ontgrendelen mislukt. Probeer het opnieuw.",success:"Eigenaarrechten ontgrendeld! U heeft nu volledige toegang."}},common:{close:"Sluiten",back:"Terug",cancel:"Annuleren"},link:{title:"Link invoegen",url:"URL",page:"Pagina",enterUrl:"URL invoeren",enterPage:"Paginanummer invoeren",pageRange:"Pagina 1 tot {totalPages}",link:"Koppelen"},stamp:{title:"Stempels",allStamps:"Alle stempels",export:"Stempels exporteren",emptyState:"Geen stempels gevonden in de geselecteerde bibliotheek.",createFromSelected:"Stempel maken",createFromGroup:"Stempel maken van groep",library:{custom:"Eigen stempels"}},signature:{title:"Handtekeningen",createNew:"Nieuwe handtekening maken",createNewWithInitials:"Handtekening & initialen maken",placeSignature:"Handtekening",placeInitials:"Initialen",remove:"Handtekening verwijderen",emptyState:"Nog geen handtekeningen. Maak er een om te beginnen.",create:{title:"Handtekening maken",draw:"Tekenen",type:"Typen",upload:"Uploaden",signatureLabel:"Handtekening",initialsLabel:"Initialen",clear:"Wissen",typePlaceholder:"bijv. Jan Jansen",initialsPlaceholder:"bijv. JJ",uploadPlaceholder:"Klik of sleep een afbeelding hierheen",font:"Lettertype",color:"Kleur",cancel:"Annuleren",save:"Opslaan"}}}},{code:"de",name:"Deutsch",translations:{search:{placeholder:"Suchen",caseSensitive:"Groß-/Kleinschreibung",wholeWord:"Ganzes Wort",resultsFound:"{count} Ergebnisse gefunden",page:"Seite {page}"},zoom:{in:"Vergrößern",out:"Verkleinern",fitWidth:"An Breite anpassen",fitPage:"An Seite anpassen",marquee:"Laufrahmen-Zoom",menu:"Zoom-Menü",level:"Zoomstufe ({level}%)",dragTip:"Drag to select area to zoom"},pan:{toggle:"Verschieben-Modus umschalten"},pointer:{toggle:"Zeiger-Modus umschalten"},capture:{screenshot:"Screenshot",dragTip:"Ziehen Sie, um den Bereich zum Erfassen auszuwählen",title:"Screenshot-Vorschau",download:"Herunterladen",cancel:"Abbrechen"},document:{menu:"Dokument-Menü",open:"Öffnen",close:"Schließen",print:"Drucken",protect:"Sicherheit",export:"Exportieren",fullscreen:"Vollbild",loading:"Dokument wird geladen..."},emptyState:{title:"Keine Dokumente geöffnet",description:"Öffnen Sie ein PDF-Dokument, um zu beginnen.",descriptionMulti:"Sie können mehrere Dokumente mit Tabs anzeigen.",openButton:"Dokument öffnen",supportedFormats:"Unterstütztes Format: PDF"},passwordPrompt:{title:"Passwort erforderlich",required:"Dieses Dokument ist passwortgeschützt. Bitte geben Sie das Passwort ein.",incorrect:"Das eingegebene Passwort war falsch. Bitte versuchen Sie es erneut.",incorrectWarning:"Falsches Passwort. Bitte überprüfen und erneut versuchen.",label:"Passwort",placeholder:"Dokumentpasswort eingeben",open:"Öffnen",opening:"Öffnen...",cancel:"Abbrechen",close:"Schließen"},documentError:{title:"Fehler beim Laden des Dokuments",unknown:"Ein unbekannter Fehler ist aufgetreten",errorCode:"Fehlercode: {code}",close:"Dokument schließen"},panel:{sidebar:"Seitenleiste",search:"Suchen",comment:"Kommentar",thumbnails:"Miniaturansichten",outline:"Gliederung",annotationStyle:"Anmerkungsstil",redaction:"Schwärzungs-Seitenleiste"},menu:{viewControls:"Ansichtseinstellungen",zoomControls:"Zoom-Einstellungen",moreOptions:"Weitere Optionen"},outline:{title:"Gliederung",loading:"Gliederung wird geladen...",noOutline:"Keine Gliederung verfügbar",noBookmarks:"Dieses Dokument enthält keine Lesezeichen"},page:{settings:"Seiteneinstellungen",single:"Einzelseite",twoOdd:"Zwei Seiten (Ungerade)",twoEven:"Zwei Seiten (Gerade)",vertical:"Vertikal",horizontal:"Horizontal",spreadMode:"Doppelseiten-Modus",scrollLayout:"Scroll-Layout",rotation:"Seitendrehung",next:"Nächste Seite",previous:"Vorherige Seite"},rotate:{clockwise:"Im Uhrzeigersinn drehen",counterClockwise:"Gegen den Uhrzeigersinn drehen"},selection:{copy:"Auswahl kopieren"},mode:{view:"Ansicht",annotate:"Annotieren",shapes:"Formen",form:"Formular",redact:"Schwärzen",insert:"Einfügen"},form:{textfield:"Textfeld",checkbox:"Kontrollkästchen",radio:"Optionsfeld",select:"Dropdown",listbox:"Listenfeld"},annotation:{text:"Text",highlight:"Markieren",strikeout:"Durchstreichen",underline:"Unterstreichen",squiggly:"Wellenlinie",rectangle:"Rechteck",circle:"Kreis",line:"Linie",arrow:"Pfeil",polygon:"Polygon",polyline:"Polylinie",ink:"Freihand",inkHighlighter:"Freihand-Textmarker",stamp:"Stempel",caret:"Einfügemarke",insertText:"Text einfügen",replaceText:"Text ersetzen",freeText:"Freitext",square:"Quadrat",style:"Anmerkungsstil",styles:"{type}-Stile",defaults:"{type}-Standardwerte",color:"Farbe",opacity:"Deckkraft",blendMode:"Mischmodus",strokeWidth:"Strichstärke",strokeColor:"Strichfarbe",borderStyle:"Rahmenstil",fillColor:"Füllfarbe",fontSize:"Schriftgröße",fontFamily:"Schriftart",textAlign:"Textausrichtung",verticalAlign:"Vertikale Ausrichtung",lineEnding:"Linienende",lineStart:"Linienanfang",lineEnd:"Linienende",font:"Schriftart",fontColor:"Schriftfarbe",backgroundColor:"Hintergrundfarbe",noStyles:"Für diese Anmerkung gibt es keine Stile.",noStylesStamp:"Für Stempel gibt es keine Stile.",selectAnnotation:"Wählen Sie eine Anmerkung aus, um Stile anzuzeigen",deleteSelected:"Ausgewählte Anmerkung löschen",deleteAllSelected:"Ausgewählte löschen",multiSelect:"{count} Anmerkungen ausgewählt",group:"Gruppieren",ungroup:"Gruppierung aufheben",moreTools:"Weitere Werkzeuge",addLink:"Link hinzufügen",removeLink:"Link entfernen",gotoLink:"Zum Link gehen",comment:"Kommentar",callout:"Legende",redact:"Schwärzen",overlayText:"Überlagerungstext",overlayTextPlaceholder:"z.B. GESCHWÄRZT",rotation:"Drehung"},insert:{image:"Bild",rubberStamp:"Stempel"},redaction:{redact:"Schwärzen",area:"Bereich schwärzen",text:"Text schwärzen",apply:"Schwärzung anwenden",applyAll:"Alle anwenden",clearAll:"Alle löschen",deleteSelected:"Ausgewählte Schwärzung löschen",commitSelected:"Ausgewählte Schwärzung anwenden",emptyState:"Keine ausstehenden Schwärzungen",panel:{title:"Schwärzungen",itemCount:"{count} ausstehende Schwärzung",itemCountPlural:"{count} ausstehende Schwärzungen",clearAll:"Alle löschen",redactAll:"Alle schwärzen"}},history:{undo:"Rückgängig",redo:"Wiederholen"},comments:{page:"Seite {page}",commentCount:"{count} Kommentar",commentCountPlural:"{count} Kommentare",addComment:"Kommentar hinzufügen...",addReply:"Antwort hinzufügen...",showAllAnnotations:"Alle Anmerkungen anzeigen",closeAllAnnotations:"Alle Anmerkungen schließen",save:"Speichern",cancel:"Abbrechen",edit:"Bearbeiten",delete:"Löschen",showMore:"mehr",showLess:"weniger",emptyState:"Fügen Sie Anmerkungen hinzu, um sie kommentieren zu können."},blendMode:{normal:"Normal",multiply:"Multiplizieren",screen:"Negativ multiplizieren",overlay:"Ineinanderkopieren",darken:"Abdunkeln",lighten:"Aufhellen",colorDodge:"Farbig abwedeln",colorBurn:"Farbig nachbelichten",hardLight:"Hartes Licht",softLight:"Weiches Licht",difference:"Differenz",exclusion:"Ausschluss",hue:"Farbton",saturation:"Sättigung",color:"Farbe",luminosity:"Luminanz"},print:{title:"Druckeinstellungen",loading:"Dokument wird vorbereitet...",pages:"Zu druckende Seiten",all:"Alle Seiten",current:"Aktuelle Seite ({currentPage})",specify:"Seiten angeben",specifyEG:"z.B. 1-3, 5, 8-10",total:"Gesamtseitenzahl im Dokument: {totalPages}",annotation:"Anmerkungen einbeziehen",printing:"Drucken...",print:"Drucken",cancel:"Abbrechen"},protect:{title:"Dokument schützen",cancel:"Abbrechen",apply:"Schutz anwenden",applying:"Wird angewendet...",applyFailed:"Schutz konnte nicht angewendet werden. Bitte versuchen Sie es erneut.",removeFailed:"Schutz konnte nicht entfernt werden. Bitte versuchen Sie es erneut.",passwordMismatch:"Passwörter stimmen nicht überein",noProtectionSelected:"Wählen Sie mindestens eine Schutzoption aus.",bothPasswordsNote:"Benutzer, die das Dokumentpasswort eingeben, haben eingeschränkte Berechtigungen. Verwenden Sie das Eigentümerpasswort für vollen Zugriff.",openPassword:{title:"Passwort zum Öffnen erforderlich",description:"Benutzer müssen ein Passwort eingeben, um dieses Dokument anzuzeigen.",label:"Dokumentpasswort",placeholder:"Passwort eingeben",confirm:"Passwort bestätigen",confirmPlaceholder:"Passwort bestätigen"},ownerPassword:{label:"Eigentümerpasswort",placeholder:"Eigentümerpasswort eingeben",confirm:"Eigentümerpasswort bestätigen",confirmPlaceholder:"Eigentümerpasswort bestätigen"},permissions:{title:"Berechtigungen einschränken",description:"Beschränken Sie, was Benutzer mit diesem Dokument tun können.",allowedActions:"Erlaubte Aktionen",print:"Drucken",printHighQuality:"In hoher Qualität drucken",copy:"Inhalt kopieren",accessibility:"Für Barrierefreiheit extrahieren",modify:"Inhalt ändern",annotations:"Anmerkungen & Kommentare hinzufügen/ändern",fillForms:"Formulare ausfüllen & unterschreiben",assemble:"Dokument zusammenstellen & Seiten extrahieren"},encrypted:{title:"Dokument ist geschützt",description:"Dieses Dokument ist vom Eigentümer geschützt. Geben Sie das Eigentümerpasswort ein, um die Sicherheitseinstellungen zu ändern.",enterOwnerPassword:"Eigentümerpasswort eingeben zum Ändern",unlockAndEdit:"Entsperren & Bearbeiten"},modifyProtection:{title:"Schutz ändern",description:"Wählen Sie, wie Sie den Dokumentschutz ändern möchten.",changeOption:"Passwörter oder Berechtigungen ändern",changeDescription:"Aktualisieren Sie das Dokumentpasswort oder die Berechtigungseinstellungen.",removeOption:"Gesamten Schutz entfernen",removeDescription:"Passwortschutz von diesem Dokument entfernen."},removeProtection:{title:"Schutz entfernen",warning:"Sind Sie sicher, dass Sie den Schutz entfernen möchten?",description:"Dadurch wird der gesamte Passwortschutz vom Dokument entfernt. Jeder kann es öffnen und bearbeiten.",confirm:"Schutz entfernen"}},security:{protected:{title:"Dieses Dokument ist geschützt",description:"Diese Datei ist geschützt und einige Funktionen sind möglicherweise deaktiviert. Gehen Sie zu Sicherheit im Dokumentmenü, um Berechtigungen anzuzeigen oder freizuschalten.",viewPermissions:"Berechtigungen anzeigen"},viewPermissions:{title:"Dokumentberechtigungen",description:"Diese Datei ist vom Eigentümer eingeschränkt und erfordert ein Passwort, um bestimmte Aktionen freizuschalten.",restrictedActions:"Eingeschränkte Aktionen"},unlock:{label:"Eigentümerpasswort eingeben zum Entsperren",placeholder:"Eigentümerpasswort eingeben",button:"Datei entsperren",invalidPassword:"Ungültiges Passwort. Bitte versuchen Sie es erneut.",failed:"Entsperren fehlgeschlagen. Bitte versuchen Sie es erneut.",success:"Eigentümerberechtigungen entsperrt! Sie haben jetzt vollen Zugriff."}},common:{close:"Schließen",back:"Zurück",cancel:"Abbrechen"},link:{title:"Link einfügen",url:"URL",page:"Seite",enterUrl:"URL eingeben",enterPage:"Seitennummer eingeben",pageRange:"Seite 1 bis {totalPages}",link:"Verknüpfen"},stamp:{title:"Stempel",allStamps:"Alle Stempel",export:"Stempel exportieren",emptyState:"Keine Stempel in der ausgewählten Bibliothek gefunden.",createFromSelected:"Stempel erstellen",createFromGroup:"Stempel aus Gruppe erstellen",library:{custom:"Eigene Stempel"}},signature:{title:"Unterschriften",createNew:"Neue Unterschrift erstellen",createNewWithInitials:"Unterschrift & Initialen erstellen",placeSignature:"Unterschrift",placeInitials:"Initialen",remove:"Unterschrift entfernen",emptyState:"Noch keine Unterschriften. Erstellen Sie eine, um loszulegen.",create:{title:"Unterschrift erstellen",draw:"Zeichnen",type:"Tippen",upload:"Hochladen",signatureLabel:"Unterschrift",initialsLabel:"Initialen",clear:"Löschen",typePlaceholder:"z.B. Max Mustermann",initialsPlaceholder:"z.B. MM",uploadPlaceholder:"Klicken oder Bild hierher ziehen",font:"Schriftart",color:"Farbe",cancel:"Abbrechen",save:"Speichern"}}}},{code:"fr",name:"Français",translations:{search:{placeholder:"Rechercher",caseSensitive:"Respecter la casse",wholeWord:"Mot entier",resultsFound:"{count} résultats trouvés",page:"Page {page}"},zoom:{in:"Zoom avant",out:"Zoom arrière",fitWidth:"Ajuster à la largeur",fitPage:"Ajuster à la page",marquee:"Zoom de sélection",menu:"Menu Zoom",level:"Niveau de zoom ({level}%)",dragTip:"Drag to select area to zoom"},pan:{toggle:"Basculer le mode déplacement"},pointer:{toggle:"Basculer le mode pointeur"},capture:{screenshot:"Capture d'écran",dragTip:"Faites glisser pour sélectionner la zone à capturer",title:"Aperçu de la capture",download:"Télécharger",cancel:"Annuler"},document:{menu:"Menu Document",open:"Ouvrir",close:"Fermer",print:"Imprimer",protect:"Sécurité",export:"Exporter",fullscreen:"Plein écran",loading:"Chargement du document..."},emptyState:{title:"Aucun document ouvert",description:"Ouvrez un document PDF pour commencer.",descriptionMulti:"Vous pouvez afficher plusieurs documents avec des onglets.",openButton:"Ouvrir un document",supportedFormats:"Format pris en charge : PDF"},passwordPrompt:{title:"Mot de passe requis",required:"Ce document est protégé par mot de passe. Veuillez entrer le mot de passe.",incorrect:"Le mot de passe saisi est incorrect. Veuillez réessayer.",incorrectWarning:"Mot de passe incorrect. Veuillez vérifier et réessayer.",label:"Mot de passe",placeholder:"Entrer le mot de passe du document",open:"Ouvrir",opening:"Ouverture...",cancel:"Annuler",close:"Fermer"},documentError:{title:"Erreur lors du chargement du document",unknown:"Une erreur inconnue est survenue",errorCode:"Code erreur : {code}",close:"Fermer le document"},panel:{sidebar:"Barre latérale",search:"Rechercher",comment:"Commentaire",thumbnails:"Miniatures",outline:"Plan",annotationStyle:"Style d'annotation",redaction:"Barre latérale de caviardage"},menu:{viewControls:"Contrôles d'affichage",zoomControls:"Contrôles de zoom",moreOptions:"Plus d'options"},outline:{title:"Plan",loading:"Chargement du plan...",noOutline:"Aucun plan disponible",noBookmarks:"Ce document ne contient pas de signets"},page:{settings:"Paramètres de page",single:"Page unique",twoOdd:"Deux pages (Impair)",twoEven:"Deux pages (Pair)",vertical:"Vertical",horizontal:"Horizontal",spreadMode:"Mode double page",scrollLayout:"Disposition de défilement",rotation:"Rotation de page",next:"Page suivante",previous:"Page précédente"},rotate:{clockwise:"Tourner dans le sens horaire",counterClockwise:"Tourner dans le sens antihoraire"},selection:{copy:"Copier la sélection"},mode:{view:"Affichage",annotate:"Annoter",shapes:"Formes",form:"Formulaire",redact:"Caviarder",insert:"Insérer"},form:{textfield:"Champ de texte",checkbox:"Case à cocher",radio:"Bouton radio",select:"Liste déroulante",listbox:"Zone de liste"},annotation:{text:"Texte",highlight:"Surligner",strikeout:"Barrer",underline:"Souligner",squiggly:"Ondulé",rectangle:"Rectangle",circle:"Cercle",line:"Ligne",arrow:"Flèche",polygon:"Polygone",polyline:"Polyligne",ink:"Encre",inkHighlighter:"Surligneur à encre",stamp:"Tampon",caret:"Curseur",insertText:"Insérer du texte",replaceText:"Remplacer le texte",freeText:"Texte libre",square:"Carré",style:"Style d'annotation",styles:"Styles de {type}",defaults:"Valeurs par défaut de {type}",color:"Couleur",opacity:"Opacité",blendMode:"Mode de fusion",strokeWidth:"Épaisseur du trait",strokeColor:"Couleur du trait",borderStyle:"Style de bordure",fillColor:"Couleur de remplissage",fontSize:"Taille de police",fontFamily:"Police",textAlign:"Alignement du texte",verticalAlign:"Alignement vertical",lineEnding:"Fin de ligne",lineStart:"Début de ligne",lineEnd:"Fin de ligne",font:"Police",fontColor:"Couleur du texte",backgroundColor:"Couleur de fond",noStyles:"Il n'y a pas de styles pour cette annotation.",noStylesStamp:"Il n'y a pas de styles pour les tampons.",selectAnnotation:"Sélectionnez une annotation pour voir les styles",deleteSelected:"Supprimer l'annotation sélectionnée",deleteAllSelected:"Supprimer la sélection",multiSelect:"{count} annotations sélectionnées",group:"Grouper",ungroup:"Dissocier",moreTools:"Plus d'outils",addLink:"Ajouter un lien",removeLink:"Supprimer le lien",gotoLink:"Aller au lien",comment:"Commentaire",callout:"Légende",redact:"Caviarder",overlayText:"Texte de superposition",overlayTextPlaceholder:"ex: CAVIARDÉ",rotation:"Rotation"},insert:{image:"Image",rubberStamp:"Tampon"},redaction:{redact:"Caviarder",area:"Caviarder la zone",text:"Caviarder le texte",apply:"Appliquer le caviardage",applyAll:"Tout appliquer",clearAll:"Tout effacer",deleteSelected:"Supprimer la rédaction sélectionnée",commitSelected:"Appliquer la rédaction sélectionnée",emptyState:"Aucun caviardage en attente",panel:{title:"Caviardages",itemCount:"{count} caviardage en attente",itemCountPlural:"{count} caviardages en attente",clearAll:"Tout effacer",redactAll:"Tout caviarder"}},history:{undo:"Annuler",redo:"Refaire"},comments:{page:"Page {page}",commentCount:"{count} commentaire",commentCountPlural:"{count} commentaires",addComment:"Ajouter un commentaire...",addReply:"Ajouter une réponse...",showAllAnnotations:"Afficher toutes les annotations",closeAllAnnotations:"Fermer toutes les annotations",save:"Enregistrer",cancel:"Annuler",edit:"Modifier",delete:"Supprimer",showMore:"plus",showLess:"moins",emptyState:"Ajoutez des annotations pour pouvoir les commenter."},blendMode:{normal:"Normal",multiply:"Produit",screen:"Superposition",overlay:"Incrustation",darken:"Obscurcir",lighten:"Éclaircir",colorDodge:"Densité couleur -",colorBurn:"Densité couleur +",hardLight:"Lumière crue",softLight:"Lumière tamisée",difference:"Différence",exclusion:"Exclusion",hue:"Teinte",saturation:"Saturation",color:"Couleur",luminosity:"Luminosité"},print:{title:"Paramètres d'impression",loading:"Préparation du document...",pages:"Pages à imprimer",all:"Toutes les pages",current:"Page actuelle ({currentPage})",specify:"Spécifier les pages",specifyEG:"ex : 1-3, 5, 8-10",total:"Nombre total de pages dans le document : {totalPages}",annotation:"Inclure les annotations",printing:"Impression...",print:"Imprimer",cancel:"Annuler"},protect:{title:"Protéger le document",cancel:"Annuler",apply:"Appliquer la protection",applying:"Application en cours...",applyFailed:"Échec de l'application de la protection. Veuillez réessayer.",removeFailed:"Échec de la suppression de la protection. Veuillez réessayer.",passwordMismatch:"Les mots de passe ne correspondent pas",noProtectionSelected:"Sélectionnez au moins une option de protection.",bothPasswordsNote:"Les utilisateurs qui ouvrent avec le mot de passe du document auront des permissions limitées. Utilisez le mot de passe propriétaire pour un accès complet.",openPassword:{title:"Mot de passe requis pour l'ouverture",description:"Les utilisateurs doivent entrer un mot de passe pour voir ce document.",label:"Mot de passe du document",placeholder:"Entrer le mot de passe",confirm:"Confirmer le mot de passe",confirmPlaceholder:"Confirmer le mot de passe"},ownerPassword:{label:"Mot de passe propriétaire",placeholder:"Entrer le mot de passe propriétaire",confirm:"Confirmer le mot de passe propriétaire",confirmPlaceholder:"Confirmer le mot de passe propriétaire"},permissions:{title:"Restreindre les permissions",description:"Limitez ce que les utilisateurs peuvent faire avec ce document.",allowedActions:"Actions autorisées",print:"Imprimer",printHighQuality:"Imprimer en haute qualité",copy:"Copier le contenu",accessibility:"Extraire pour l'accessibilité",modify:"Modifier le contenu",annotations:"Ajouter/modifier les annotations et commentaires",fillForms:"Remplir les formulaires et signer",assemble:"Assembler le document et extraire les pages"},encrypted:{title:"Document protégé",description:"Ce document est protégé par le propriétaire. Entrez le mot de passe propriétaire pour modifier les paramètres de sécurité.",enterOwnerPassword:"Entrer le mot de passe propriétaire pour modifier",unlockAndEdit:"Déverrouiller & Modifier"},modifyProtection:{title:"Modifier la protection",description:"Choisissez comment vous voulez modifier la protection du document.",changeOption:"Modifier les mots de passe ou les permissions",changeDescription:"Mettre à jour le mot de passe du document ou les paramètres de permissions.",removeOption:"Supprimer toute la protection",removeDescription:"Supprimer la protection par mot de passe de ce document."},removeProtection:{title:"Supprimer la protection",warning:"Êtes-vous sûr de vouloir supprimer la protection ?",description:"Cela supprimera toute la protection par mot de passe du document. Tout le monde pourra l'ouvrir et le modifier.",confirm:"Supprimer la protection"}},security:{protected:{title:"Ce document est protégé",description:"Ce fichier est protégé et certaines fonctionnalités peuvent être désactivées. Allez dans Sécurité dans le menu document pour afficher ou déverrouiller les permissions.",viewPermissions:"Voir les permissions"},viewPermissions:{title:"Permissions du document",description:"Ce fichier est restreint par le propriétaire et nécessite un mot de passe pour débloquer certaines actions.",restrictedActions:"Actions restreintes"},unlock:{label:"Entrer le mot de passe propriétaire pour déverrouiller",placeholder:"Entrer le mot de passe propriétaire",button:"Déverrouiller le fichier",invalidPassword:"Mot de passe invalide. Veuillez réessayer.",failed:"Échec du déverrouillage. Veuillez réessayer.",success:"Permissions propriétaire déverrouillées ! Vous avez maintenant un accès complet."}},common:{close:"Fermer",back:"Retour",cancel:"Annuler"},link:{title:"Insérer un lien",url:"URL",page:"Page",enterUrl:"Entrer l'URL",enterPage:"Entrer le numéro de page",pageRange:"Page 1 à {totalPages}",link:"Lier"},stamp:{title:"Tampons",allStamps:"Tous les tampons",export:"Exporter les tampons",emptyState:"Aucun tampon trouvé dans la bibliothèque sélectionnée.",createFromSelected:"Créer un tampon",createFromGroup:"Créer un tampon à partir du groupe",library:{custom:"Tampons personnalisés"}},signature:{title:"Signatures",createNew:"Créer une nouvelle signature",createNewWithInitials:"Créer signature & paraphe",placeSignature:"Signature",placeInitials:"Paraphe",remove:"Supprimer la signature",emptyState:"Aucune signature pour le moment. Créez-en une pour commencer.",create:{title:"Créer une signature",draw:"Dessiner",type:"Saisir",upload:"Télécharger",signatureLabel:"Signature",initialsLabel:"Paraphe",clear:"Effacer",typePlaceholder:"ex. Jean Dupont",initialsPlaceholder:"ex. JD",uploadPlaceholder:"Cliquez ou glissez une image ici",font:"Police",color:"Couleur",cancel:"Annuler",save:"Enregistrer"}}}},{code:"es",name:"Español",translations:{search:{placeholder:"Buscar",caseSensitive:"Distinguir mayúsculas",wholeWord:"Palabra completa",resultsFound:"{count} resultados encontrados",page:"Página {page}"},zoom:{in:"Acercar",out:"Alejar",fitWidth:"Ajustar al ancho",fitPage:"Ajustar a la página",marquee:"Zoom de selección",menu:"Menú de zoom",level:"Nivel de zoom ({level}%)",dragTip:"Drag to select area to zoom"},pan:{toggle:"Alternar modo desplazamiento"},pointer:{toggle:"Alternar modo puntero"},capture:{screenshot:"Captura de pantalla",dragTip:"Arrastre para seleccionar el área a capturar",title:"Vista previa de la captura",download:"Descargar",cancel:"Cancelar"},document:{menu:"Menú del documento",open:"Abrir",close:"Cerrar",print:"Imprimir",protect:"Seguridad",export:"Exportar",fullscreen:"Pantalla completa",loading:"Cargando documento..."},emptyState:{title:"No hay documentos abiertos",description:"Abra un documento PDF para comenzar.",descriptionMulti:"Puede ver varios documentos usando pestañas.",openButton:"Abrir documento",supportedFormats:"Formato compatible: PDF"},passwordPrompt:{title:"Contraseña requerida",required:"Este documento está protegido con contraseña. Por favor, ingrese la contraseña para abrirlo.",incorrect:"La contraseña ingresada es incorrecta. Por favor, inténtelo de nuevo.",incorrectWarning:"Contraseña incorrecta. Por favor, verifique e inténtelo de nuevo.",label:"Contraseña",placeholder:"Ingrese la contraseña del documento",open:"Abrir",opening:"Abriendo...",cancel:"Cancelar",close:"Cerrar"},documentError:{title:"Error al cargar el documento",unknown:"Ha ocurrido un error desconocido",errorCode:"Código de error: {code}",close:"Cerrar documento"},panel:{sidebar:"Barra lateral",search:"Buscar",comment:"Comentario",thumbnails:"Miniaturas",outline:"Esquema",annotationStyle:"Estilo de anotación",redaction:"Barra lateral de redacción"},menu:{viewControls:"Controles de vista",zoomControls:"Controles de zoom",moreOptions:"Más opciones"},outline:{title:"Esquema",loading:"Cargando esquema...",noOutline:"No hay esquema disponible",noBookmarks:"Este documento no contiene marcadores"},page:{settings:"Configuración de página",single:"Página única",twoOdd:"Dos páginas (Impar)",twoEven:"Dos páginas (Par)",vertical:"Vertical",horizontal:"Horizontal",spreadMode:"Modo de doble página",scrollLayout:"Diseño de desplazamiento",rotation:"Rotación de página",next:"Página siguiente",previous:"Página anterior"},rotate:{clockwise:"Rotar en sentido horario",counterClockwise:"Rotar en sentido antihorario"},selection:{copy:"Copiar selección"},mode:{view:"Ver",annotate:"Anotar",shapes:"Formas",form:"Formulario",redact:"Redactar",insert:"Insertar"},form:{textfield:"Campo de texto",checkbox:"Casilla",radio:"Botón de radio",select:"Desplegable",listbox:"Cuadro de lista"},annotation:{text:"Texto",highlight:"Resaltar",strikeout:"Tachar",underline:"Subrayar",squiggly:"Ondulado",rectangle:"Rectángulo",circle:"Círculo",line:"Línea",arrow:"Flecha",polygon:"Polígono",polyline:"Polilínea",ink:"Tinta",inkHighlighter:"Resaltador de tinta",stamp:"Sello",caret:"Cursor",insertText:"Insertar texto",replaceText:"Reemplazar texto",freeText:"Texto libre",square:"Cuadrado",style:"Estilo de anotación",styles:"Estilos de {type}",defaults:"Valores predeterminados de {type}",color:"Color",opacity:"Opacidad",blendMode:"Modo de fusión",strokeWidth:"Grosor del trazo",strokeColor:"Color del trazo",borderStyle:"Estilo del borde",fillColor:"Color de relleno",fontSize:"Tamaño de fuente",fontFamily:"Fuente",textAlign:"Alineación del texto",verticalAlign:"Alineación vertical",lineEnding:"Final de línea",lineStart:"Inicio de línea",lineEnd:"Final de línea",font:"Fuente",fontColor:"Color de fuente",backgroundColor:"Color de fondo",noStyles:"No hay estilos para esta anotación.",noStylesStamp:"No hay estilos para los sellos.",selectAnnotation:"Seleccione una anotación para ver los estilos",deleteSelected:"Eliminar anotación seleccionada",deleteAllSelected:"Eliminar selección",multiSelect:"{count} anotaciones seleccionadas",group:"Agrupar",ungroup:"Desagrupar",moreTools:"Más herramientas",addLink:"Agregar enlace",removeLink:"Eliminar enlace",gotoLink:"Ir al enlace",comment:"Comentario",callout:"Llamada",redact:"Redactar",overlayText:"Texto superpuesto",overlayTextPlaceholder:"ej: REDACTADO",rotation:"Rotación"},insert:{image:"Imagen",rubberStamp:"Sello"},redaction:{redact:"Redactar",area:"Redactar área",text:"Redactar texto",apply:"Aplicar redacción",applyAll:"Aplicar todo",clearAll:"Borrar todo",deleteSelected:"Eliminar redacción seleccionada",commitSelected:"Aplicar redacción seleccionada",emptyState:"No hay redacciones pendientes",panel:{title:"Redacciones",itemCount:"{count} redacción pendiente",itemCountPlural:"{count} redacciones pendientes",clearAll:"Borrar todo",redactAll:"Redactar todo"}},history:{undo:"Deshacer",redo:"Rehacer"},comments:{page:"Página {page}",commentCount:"{count} comentario",commentCountPlural:"{count} comentarios",addComment:"Añadir comentario...",addReply:"Añadir respuesta...",showAllAnnotations:"Mostrar todas las anotaciones",closeAllAnnotations:"Cerrar todas las anotaciones",save:"Guardar",cancel:"Cancelar",edit:"Editar",delete:"Eliminar",showMore:"más",showLess:"menos",emptyState:"Añada anotaciones para poder comentarlas."},blendMode:{normal:"Normal",multiply:"Multiplicar",screen:"Trama",overlay:"Superponer",darken:"Oscurecer",lighten:"Aclarar",colorDodge:"Sobreexponer color",colorBurn:"Subexponer color",hardLight:"Luz fuerte",softLight:"Luz suave",difference:"Diferencia",exclusion:"Exclusión",hue:"Tono",saturation:"Saturación",color:"Color",luminosity:"Luminosidad"},print:{title:"Configuración de impresión",loading:"Preparando documento...",pages:"Páginas a imprimir",all:"Todas las páginas",current:"Página actual ({currentPage})",specify:"Especificar páginas",specifyEG:"ej: 1-3, 5, 8-10",total:"Total de páginas en el documento: {totalPages}",annotation:"Incluir anotaciones",printing:"Imprimiendo...",print:"Imprimir",cancel:"Cancelar"},protect:{title:"Proteger documento",cancel:"Cancelar",apply:"Aplicar protección",applying:"Aplicando...",applyFailed:"No se pudo aplicar la protección. Por favor, inténtelo de nuevo.",removeFailed:"No se pudo eliminar la protección. Por favor, inténtelo de nuevo.",passwordMismatch:"Las contraseñas no coinciden",noProtectionSelected:"Seleccione al menos una opción de protección.",bothPasswordsNote:"Los usuarios que abran con la contraseña del documento tendrán permisos restringidos. Use la contraseña de propietario para acceso completo.",openPassword:{title:"Contraseña requerida para abrir",description:"Los usuarios deben ingresar una contraseña para ver este documento.",label:"Contraseña del documento",placeholder:"Ingresar contraseña",confirm:"Confirmar contraseña",confirmPlaceholder:"Confirmar contraseña"},ownerPassword:{label:"Contraseña de propietario",placeholder:"Ingresar contraseña de propietario",confirm:"Confirmar contraseña de propietario",confirmPlaceholder:"Confirmar contraseña de propietario"},permissions:{title:"Restringir permisos",description:"Limite lo que los usuarios pueden hacer con este documento.",allowedActions:"Acciones permitidas",print:"Imprimir",printHighQuality:"Imprimir alta calidad",copy:"Copiar contenido",accessibility:"Extraer para accesibilidad",modify:"Modificar contenido",annotations:"Añadir/modificar anotaciones y comentarios",fillForms:"Rellenar formularios y firmar",assemble:"Ensamblar documento y extraer páginas"},encrypted:{title:"Documento protegido",description:"Este documento está protegido por el propietario. Ingrese la contraseña de propietario para modificar la configuración de seguridad.",enterOwnerPassword:"Ingrese la contraseña de propietario para modificar",unlockAndEdit:"Desbloquear y Editar"},modifyProtection:{title:"Modificar protección",description:"Elija cómo desea modificar la protección del documento.",changeOption:"Cambiar contraseñas o permisos",changeDescription:"Actualizar la contraseña del documento o la configuración de permisos.",removeOption:"Eliminar toda la protección",removeDescription:"Eliminar la protección por contraseña de este documento."},removeProtection:{title:"Eliminar protección",warning:"¿Está seguro de que desea eliminar la protección?",description:"Esto eliminará toda la protección por contraseña del documento. Cualquiera podrá abrirlo y modificarlo.",confirm:"Eliminar protección"}},security:{protected:{title:"Este documento está protegido",description:"Este archivo está protegido y algunas funciones pueden estar deshabilitadas. Vaya a Seguridad en el menú del documento para ver o desbloquear los permisos.",viewPermissions:"Ver permisos"},viewPermissions:{title:"Permisos del documento",description:"Este archivo está restringido por el propietario y requiere una contraseña para desbloquear ciertas acciones.",restrictedActions:"Acciones restringidas"},unlock:{label:"Ingrese la contraseña de propietario para desbloquear",placeholder:"Ingresar contraseña de propietario",button:"Desbloquear archivo",invalidPassword:"Contraseña inválida. Por favor, inténtelo de nuevo.",failed:"Error al desbloquear. Por favor, inténtelo de nuevo.",success:"¡Permisos de propietario desbloqueados! Ahora tiene acceso completo."}},common:{close:"Cerrar",back:"Atrás",cancel:"Cancelar"},link:{title:"Insertar enlace",url:"URL",page:"Página",enterUrl:"Introducir URL",enterPage:"Introducir número de página",pageRange:"Página 1 a {totalPages}",link:"Enlazar"},stamp:{title:"Sellos",allStamps:"Todos los sellos",export:"Exportar sellos",emptyState:"No se encontraron sellos en la biblioteca seleccionada.",createFromSelected:"Crear sello",createFromGroup:"Crear sello del grupo",library:{custom:"Sellos personalizados"}},signature:{title:"Firmas",createNew:"Crear nueva firma",createNewWithInitials:"Crear firma e iniciales",placeSignature:"Firma",placeInitials:"Iniciales",remove:"Eliminar firma",emptyState:"Aún no hay firmas. Crea una para empezar.",create:{title:"Crear firma",draw:"Dibujar",type:"Escribir",upload:"Subir",signatureLabel:"Firma",initialsLabel:"Iniciales",clear:"Borrar",typePlaceholder:"ej. Juan García",initialsPlaceholder:"ej. JG",uploadPlaceholder:"Haz clic o arrastra una imagen aquí",font:"Fuente",color:"Color",cancel:"Cancelar",save:"Guardar"}}}},{code:"zh-CN",name:"简体中文",translations:{search:{placeholder:"搜索",caseSensitive:"大小写敏感",wholeWord:"全词匹配",resultsFound:"{count} 个结果",page:"第{page}页"},zoom:{in:"放大",out:"缩小",fitWidth:"适合宽度",fitPage:"适合页面",marquee:"框选放大",menu:"缩放菜单",level:"缩放比例 ({level}%)",dragTip:"拖动鼠标选择要放大的区域"},pan:{toggle:"拖动模式"},pointer:{toggle:"光标模式"},capture:{screenshot:"截图",dragTip:"拖动鼠标选择要截取的区域",title:"截取的PDF区域",download:"下载",cancel:"取消"},document:{menu:"文件选项",open:"打开",close:"关闭",print:"打印",protect:"安全",export:"导出",fullscreen:"全屏",loading:"文件加载中..."},emptyState:{title:"尚无打开的文件",description:"请点击“+ 打开文件”按钮选择并打开一个PDF文件。",descriptionMulti:"您可以使用标签页同时打开多个文件。",openButton:"打开文件",supportedFormats:"支持的文件格式为: PDF"},passwordPrompt:{title:"请输入密码",required:"该文件设置有密码保护,要打开文件请输入密码。",incorrect:"你输入的密码错误,请重新输入。",incorrectWarning:"密码错误,请检查后重新输入。",label:"密码",placeholder:"请输入文件密码",open:"打开",opening:"打开中...",cancel:"取消",close:"关闭"},documentError:{title:"文件加载出错",unknown:"未知错误",errorCode:"错误码: {code}",close:"关闭文件"},panel:{sidebar:"大纲与书签",search:"搜索",comment:"评论",thumbnails:"缩略图",outline:"大纲",annotationStyle:"批注样式",redaction:"遮蔽侧边栏"},menu:{viewControls:"视图控件",zoomControls:"缩放控件",moreOptions:"更多选项"},outline:{title:"大纲",loading:"大纲加载中...",noOutline:"没有大纲",noBookmarks:"该文件不含书签"},page:{settings:"页面设置",single:"单页视图",twoOdd:"双页视图",twoEven:"书籍视图",vertical:"垂直滚动",horizontal:"水平滚动",spreadMode:"跨页模式",scrollLayout:"滚动布局",rotation:"页面转向",next:"下一页",previous:"上一页"},rotate:{clockwise:"顺时针旋转",counterClockwise:"逆时针旋转"},selection:{copy:"复制"},mode:{view:"阅读",annotate:"批注",shapes:"形状",form:"表单",redact:"遮蔽",insert:"插入"},form:{textfield:"文本框",checkbox:"复选框",radio:"单选按钮",select:"下拉列表",listbox:"列表框"},annotation:{text:"任意文本",highlight:"高亮",strikeout:"删除线",underline:"下划线",squiggly:"下划曲线",rectangle:"矩形",circle:"圆形",line:"直线",arrow:"带箭头直线",polygon:"多边形",polyline:"多段线",ink:"自由绘制",inkHighlighter:"墨迹荧光笔",stamp:"印章",caret:"插入符号",insertText:"插入文本",replaceText:"替换文本",freeText:"任意文本",square:"矩形",style:"批注样式",styles:"{type} 样式",defaults:"{type} 默认值",color:"颜色",opacity:"透明度",blendMode:"混合模式",strokeWidth:"线条宽度",strokeColor:"线条颜色",borderStyle:"线条样式",fillColor:"填充色",fontSize:"字号",fontFamily:"字体",textAlign:"左右对齐",verticalAlign:"上下对齐",lineEnding:"行尾",lineStart:"线条起点",lineEnd:"线条结尾",font:"字体",fontColor:"字色",backgroundColor:"背景色",noStyles:"该批注无需设置样式。",noStylesStamp:"印章无需设置样式。",selectAnnotation:"在此处查看选中批注的样式。",deleteSelected:"删除选中的批注",deleteAllSelected:"删除选中",multiSelect:"已选择 {count} 个批注",group:"分组",ungroup:"取消分组",moreTools:"更多工具",addLink:"添加链接",removeLink:"移除链接",gotoLink:"跳转到链接",comment:"评论",callout:"标注",redact:"遮蔽",overlayText:"覆盖文字",overlayTextPlaceholder:"例如:已遮蔽",rotation:"旋转"},insert:{image:"图片",rubberStamp:"印章"},redaction:{redact:"遮蔽",area:"遮蔽区域",text:"遮蔽文本",apply:"应用遮蔽",applyAll:"全部应用",clearAll:"全部取消",deleteSelected:"取消遮蔽",commitSelected:"应用遮蔽",emptyState:"暂无待处理的遮蔽",panel:{title:"遮蔽",itemCount:"{count} 个待处理遮蔽",itemCountPlural:"{count} 个待处理遮蔽",clearAll:"全部取消",redactAll:"全部遮蔽"}},history:{undo:"撤销",redo:"恢复"},comments:{page:"第{page}页",commentCount:"{count}条评论",commentCountPlural:"{count}条评论",addComment:"新增评论...",addReply:"新增回复...",showAllAnnotations:"显示所有注释",closeAllAnnotations:"关闭所有注释",save:"保存",cancel:"取消",edit:"编辑",delete:"删除",showMore:"展开",showLess:"收起",emptyState:"添加批注后,可以在这里对批注进行评论。"},blendMode:{normal:"正常",multiply:"正片",screen:"屏幕",overlay:"叠加",darken:"变暗",lighten:"变亮",colorDodge:"色彩减淡",colorBurn:"颜色加深",hardLight:"强光",softLight:"柔光",difference:"差值",exclusion:"排除",hue:"色相",saturation:"饱和度",color:"颜色",luminosity:"亮度"},print:{title:"打印设置",loading:"正在处理...",pages:"要打印的页码",all:"所有页",current:"当前页({currentPage})",specify:"指定页",specifyEG:"例如:1-3, 5, 8-10",total:"文档总页数:{totalPages}",annotation:"包含批注",printing:"打印中...",print:"打印",cancel:"取消"},protect:{title:"文档保护",cancel:"取消",apply:"应用保护",applying:"正在应用...",applyFailed:"无法应用保护。请重试。",removeFailed:"无法移除保护。请重试。",passwordMismatch:"密码不匹配",noProtectionSelected:"请至少选择一种保护方式。",bothPasswordsNote:"使用文档密码打开的用户将受到权限限制。使用所有者密码可获得完全访问权限。",openPassword:{title:"需要密码才能打开",description:"用户必须输入密码才能查看此文档。",label:"文档密码",placeholder:"输入密码",confirm:"确认密码",confirmPlaceholder:"确认密码"},ownerPassword:{label:"所有者密码",placeholder:"输入所有者密码",confirm:"确认所有者密码",confirmPlaceholder:"确认所有者密码"},permissions:{title:"限制权限",description:"限制用户对此文档的操作。",allowedActions:"允许的操作",print:"打印",printHighQuality:"高质量打印",copy:"复制内容",accessibility:"提取辅助功能",modify:"修改内容",annotations:"添加/修改批注和评论",fillForms:"填写表单和签名",assemble:"组装文档和提取页面"},encrypted:{title:"文档受保护",description:"此文档已被所有者保护。请输入所有者密码以修改安全设置。",enterOwnerPassword:"输入所有者密码以修改",unlockAndEdit:"解锁并编辑"},modifyProtection:{title:"修改保护",description:"选择如何修改文档保护。",changeOption:"更改密码或权限",changeDescription:"更新文档密码或权限设置。",removeOption:"移除所有保护",removeDescription:"移除此文档的密码保护。"},removeProtection:{title:"移除保护",warning:"确定要移除保护吗?",description:"这将移除文档的所有密码保护。任何人都可以打开和修改它。",confirm:"移除保护"}},security:{protected:{title:"此文档受保护",description:'此文件受保护,某些功能可能被禁用。请在文档菜单中点击"安全"以查看或解锁权限。',viewPermissions:"查看权限"},viewPermissions:{title:"文档权限",description:"此文件受所有者限制,需要密码才能解锁某些操作。",restrictedActions:"受限操作"},unlock:{label:"输入所有者密码以解锁文件",placeholder:"输入所有者密码",button:"解锁文件",invalidPassword:"密码无效。请重试。",failed:"解锁失败。请重试。",success:"所有者权限已解锁!您现在拥有完全访问权限。"}},common:{close:"关闭",back:"返回",cancel:"取消"},link:{title:"插入链接",url:"网址",page:"页面",enterUrl:"输入网址",enterPage:"输入页码",pageRange:"第1页到第{totalPages}页",link:"链接"},stamp:{title:"印章",allStamps:"所有印章",export:"导出印章",emptyState:"所选库中没有找到印章。",createFromSelected:"创建印章",createFromGroup:"从组创建印章",library:{custom:"自定义印章"}},signature:{title:"签名",createNew:"创建新签名",createNewWithInitials:"创建签名和首字母",placeSignature:"签名",placeInitials:"首字母",remove:"删除签名",emptyState:"还没有签名。创建一个来开始吧。",create:{title:"创建签名",draw:"绘制",type:"输入",upload:"上传",signatureLabel:"签名",initialsLabel:"首字母",clear:"清除",typePlaceholder:"例如 张三",initialsPlaceholder:"例如 张",uploadPlaceholder:"点击或拖放图片到此处",font:"字体",color:"颜色",cancel:"取消",save:"保存"}}}},{code:"zh-TW",name:"繁體中文",translations:{search:{placeholder:"搜尋",caseSensitive:"區分大小寫",wholeWord:"符合整個字",resultsFound:"{count} 個結果",page:"第{page}頁"},zoom:{in:"放大",out:"縮小",fitWidth:"頁面寬度",fitPage:"縮放至頁面大小",marquee:"框選放大",menu:"縮放選單",level:"縮放比例 ({level}%)",dragTip:"拖曳滑鼠選擇要放大的範圍"},pan:{toggle:"頁面移動模式"},pointer:{toggle:"鼠標模式"},capture:{screenshot:"截圖",dragTip:"拖曳滑鼠選擇要截取的範圍",title:"截取的PDF範圍",download:"下載",cancel:"取消"},document:{menu:"文件選項",open:"開啟",close:"關閉",print:"列印",protect:"文件保護",export:"匯出",fullscreen:"全螢幕",loading:"檔案載入中..."},emptyState:{title:"尚無檔案開啟",description:"請點擊「+ 開啟檔案」按鈕選擇並開啟一個PDF檔案。",descriptionMulti:"您可以使用分頁同時開啟多個檔案。",openButton:"開啟檔案",supportedFormats:"支援的檔案格式為:PDF"},passwordPrompt:{title:"請輸入密碼",required:"該檔案設有密碼,請輸入密碼以開啟檔案。",incorrect:"密碼不正確,請再試一次。",incorrectWarning:"密碼錯誤,請重新輸入。",label:"密碼",placeholder:"請輸入檔案密碼",open:"開啟",opening:"開啟中...",cancel:"取消",close:"關閉"},documentError:{title:"檔案載入發生錯誤",unknown:"未知錯誤",errorCode:"錯誤碼:{code}",close:"關閉檔案"},panel:{sidebar:"側邊欄",search:"搜尋",comment:"註解",thumbnails:"縮圖",outline:"文件大綱",annotationStyle:"註解樣式",redaction:"檢視遮蔽"},menu:{viewControls:"畫面控制",zoomControls:"縮放控制",moreOptions:"更多選項"},outline:{title:"文件大綱",loading:"大綱載入中...",noOutline:"沒有大綱",noBookmarks:"該檔案不含書籤"},page:{settings:"頁面設定",single:"單頁檢視",twoOdd:"雙頁檢視",twoEven:"書籍檢視",vertical:"垂直捲動",horizontal:"水平捲動",spreadMode:"跨頁模式",scrollLayout:"捲動版面",rotation:"頁面旋轉",next:"下一頁",previous:"上一頁"},rotate:{clockwise:"順時針旋轉",counterClockwise:"逆時針旋轉"},selection:{copy:"複製"},mode:{view:"檢視",annotate:"註解",shapes:"形狀",form:"表單",redact:"遮蔽",insert:"插入"},form:{textfield:"文字方塊",checkbox:"核取方塊",radio:"單選按鈕",select:"下拉式選單",listbox:"清單方塊"},annotation:{text:"文字",highlight:"強調",strikeout:"刪除線",underline:"底線",squiggly:"波浪底線",rectangle:"矩形",circle:"圓形",line:"直線",arrow:"箭頭",polygon:"多邊形",polyline:"折線",ink:"繪圖",inkHighlighter:"螢光筆",stamp:"印章",caret:"插入符號",insertText:"插入文字",replaceText:"替換文字",freeText:"文字",square:"矩形",style:"圖形樣式",styles:"{type} 樣式",defaults:"{type} 預設值",color:"色彩",opacity:"透明度",blendMode:"混合模式",strokeWidth:"線條粗細",strokeColor:"線條色彩",borderStyle:"線條樣式",fillColor:"填入色彩",fontSize:"大小",fontFamily:"字型",textAlign:"水平對齊",verticalAlign:"垂直對齊",lineEnding:"線條端點",lineStart:"線條起點",lineEnd:"線條終點",font:"字體",fontColor:"字型色彩",backgroundColor:"背景色彩",noStyles:"該註解無需設定樣式。",noStylesStamp:"圖片無需設定樣式。",selectAnnotation:"在此處查看選取註解的樣式。",deleteSelected:"移除選取的註解",deleteAllSelected:"移除選取項目",multiSelect:"已選擇 {count} 筆註解",group:"群組",ungroup:"取消群組",moreTools:"更多工具",addLink:"新增連結",removeLink:"移除連結",gotoLink:"前往連結",comment:"留言",callout:"圖說",redact:"遮蔽",overlayText:"覆蓋文字",overlayTextPlaceholder:"例如:已遮蔽",rotation:"旋轉"},insert:{image:"圖片",rubberStamp:"印章"},redaction:{redact:"遮蔽",area:"遮蔽範圍",text:"遮蔽文字",apply:"套用遮蔽",applyAll:"全部套用",clearAll:"全部清除",deleteSelected:"取消遮蔽",commitSelected:"套用遮蔽",emptyState:"暫無待處理的遮蔽",panel:{title:"遮蔽",itemCount:"{count} 個待處理遮蔽",itemCountPlural:"{count} 個待處理遮蔽",clearAll:"全部清除",redactAll:"全部遮蔽"}},history:{undo:"還原",redo:"取消復原"},comments:{page:"第{page}頁",commentCount:"{count}則留言",commentCountPlural:"{count}則留言",addComment:"新增留言...",addReply:"新增回覆...",showAllAnnotations:"顯示所有註解",closeAllAnnotations:"關閉所有註解",save:"儲存",cancel:"取消",edit:"編輯",delete:"移除",showMore:"展開",showLess:"折疊",emptyState:"新增註解後,可以在此對註解進行編輯。"},blendMode:{normal:"正常",multiply:"色彩增值",screen:"濾色",overlay:"覆蓋",darken:"變暗",lighten:"變亮",colorDodge:"加亮顏色",colorBurn:"加深顏色",hardLight:"強光",softLight:"柔光",difference:"差值",exclusion:"排除",hue:"色相",saturation:"飽和度",color:"色彩",luminosity:"光度"},print:{title:"列印設定",loading:"處理中...",pages:"要列印的頁碼",all:"所有頁面",current:"目前頁面({currentPage})",specify:"指定頁面",specifyEG:"例如:1-3, 5, 8-10",total:"文件總頁數:{totalPages}",annotation:"包含註解",printing:"列印中...",print:"列印",cancel:"取消"},protect:{title:"文件保護",cancel:"取消",apply:"套用文件保護",applying:"正在套用...",applyFailed:"無法套用文件保護。請重試。",removeFailed:"無法移除文件保護。請重試。",passwordMismatch:"密碼不符",noProtectionSelected:"請至少選擇一種文件保護方式。",bothPasswordsNote:"使用文件密碼開啟的使用者將受到權限限制。使用擁有者密碼可獲得完整存取權限。",openPassword:{title:"需要密碼才能開啟",description:"使用者必須輸入密碼才能檢視此文件。",label:"文件密碼",placeholder:"輸入密碼",confirm:"確認密碼",confirmPlaceholder:"確認密碼"},ownerPassword:{label:"擁有者密碼",placeholder:"輸入擁有者密碼",confirm:"確認擁有者密碼",confirmPlaceholder:"確認擁有者密碼"},permissions:{title:"限制權限",description:"限制使用者對此文件的權限。",allowedActions:"允許的操作",print:"列印",printHighQuality:"高品質列印",copy:"複製內容",accessibility:"擷取無障礙工具內容",modify:"修改",annotations:"新增/修改註解",fillForms:"填寫表單與簽章",assemble:"組合文件與擷取頁面"},encrypted:{title:"文件受保護",description:"此文件已被擁有者保護。請輸入擁有者密碼以修改安全設定。",enterOwnerPassword:"輸入擁有者密碼以修改",unlockAndEdit:"解除鎖定並編輯"},modifyProtection:{title:"修改文件保護",description:"選擇如何修改文件保護。",changeOption:"變更密碼或權限",changeDescription:"更新文件密碼或權限設定。",removeOption:"移除所有文件保護",removeDescription:"移除此文件的密碼保護。"},removeProtection:{title:"移除文件保護",warning:"確定要移除文件保護嗎?",description:"這將移除文件的所有密碼保護。任何人都可以開啟和修改它。",confirm:"移除文件保護"}},security:{protected:{title:"此文件受保護",description:"此文件受保護,某些功能可能被停用。請在文件選單中點擊「文件保護」以查看或解除權限鎖定。",viewPermissions:"檢視權限"},viewPermissions:{title:"文件權限",description:"此文件受擁有者限制,需要密碼才能解除特定操作的鎖定。",restrictedActions:"受限操作"},unlock:{label:"輸入擁有者密碼以解除檔案鎖定",placeholder:"輸入擁有者密碼",button:"解除檔案鎖定",invalidPassword:"密碼無效。請重試。",failed:"解除鎖定失敗。請重試。",success:"擁有者權限已解除鎖定!您現在擁有完整存取權限。"}},common:{close:"關閉",back:"返回",cancel:"取消"},link:{title:"插入連結",url:"網址",page:"頁面",enterUrl:"輸入網址",enterPage:"輸入頁碼",pageRange:"第1頁到第{totalPages}頁",link:"連結"},stamp:{title:"印章",allStamps:"所有印章",export:"匯出印章",emptyState:"沒有找到印章。",createFromSelected:"建立印章",createFromGroup:"從群組建立印章",library:{custom:"自訂印章"}},signature:{title:"簽章",createNew:"建立新簽章",createNewWithInitials:"建立簽章和姓名縮寫",placeSignature:"簽章",placeInitials:"姓名縮寫",remove:"移除簽章",emptyState:"尚未建立簽章。建立一個來開始吧。",create:{title:"建立簽章",draw:"繪製",type:"輸入",upload:"上傳",signatureLabel:"簽章",initialsLabel:"姓名縮寫",clear:"清除",typePlaceholder:"例如:王小明",initialsPlaceholder:"例如:王",uploadPlaceholder:"點擊或將圖片拖曳至此",font:"字體",color:"色彩",cancel:"取消",save:"儲存"}}}},{code:"ja",name:"日本語",translations:{search:{placeholder:"検索",caseSensitive:"大文字小文字を区別",wholeWord:"単語単位で検索",resultsFound:"{count}件見つかりました",page:"{page}ページ"},zoom:{in:"拡大",out:"縮小",fitWidth:"幅に合わせる",fitPage:"ページに合わせる",marquee:"範囲選択ズーム",menu:"ズームメニュー",level:"ズーム ({level}%)",dragTip:"ドラッグしてズーム範囲を選択"},pan:{toggle:"パンモードの切り替え"},pointer:{toggle:"ポインターモードの切り替え"},capture:{screenshot:"スクリーンショット",dragTip:"ドラッグしてキャプチャ範囲を選択",title:"スクリーンショットプレビュー",download:"ダウンロード",cancel:"キャンセル"},document:{menu:"ドキュメントメニュー",open:"開く",close:"閉じる",print:"印刷",protect:"セキュリティ",export:"エクスポート",fullscreen:"全画面表示",loading:"ドキュメントを読み込み中..."},emptyState:{title:"ドキュメントが開かれていません",description:"PDFドキュメントを開いて始めましょう。",descriptionMulti:"タブを使って複数のドキュメントを表示できます。",openButton:"ドキュメントを開く",supportedFormats:"対応フォーマット: PDF"},passwordPrompt:{title:"パスワードが必要です",required:"このドキュメントはパスワードで保護されています。パスワードを入力してください。",incorrect:"入力されたパスワードが正しくありません。もう一度お試しください。",incorrectWarning:"パスワードが正しくありません。確認してもう一度お試しください。",label:"パスワード",placeholder:"ドキュメントのパスワードを入力",open:"開く",opening:"開いています...",cancel:"キャンセル",close:"閉じる"},documentError:{title:"ドキュメントの読み込みエラー",unknown:"不明なエラーが発生しました",errorCode:"エラーコード: {code}",close:"ドキュメントを閉じる"},panel:{sidebar:"サイドバー",search:"検索",comment:"コメント",thumbnails:"サムネイル",outline:"アウトライン",annotationStyle:"注釈スタイル",redaction:"黒塗りサイドバー"},menu:{viewControls:"表示コントロール",zoomControls:"ズームコントロール",moreOptions:"その他のオプション"},outline:{title:"アウトライン",loading:"アウトラインを読み込み中...",noOutline:"アウトラインがありません",noBookmarks:"このドキュメントにはブックマークがありません"},page:{settings:"ページ設定",single:"単一ページ",twoOdd:"見開き(奇数)",twoEven:"見開き(偶数)",vertical:"縦方向",horizontal:"横方向",spreadMode:"見開きモード",scrollLayout:"スクロールレイアウト",rotation:"ページ回転",next:"次のページ",previous:"前のページ"},rotate:{clockwise:"時計回りに回転",counterClockwise:"反時計回りに回転"},selection:{copy:"選択範囲をコピー"},mode:{view:"表示",annotate:"注釈",shapes:"図形",form:"フォーム",redact:"黒塗り",insert:"挿入"},form:{textfield:"テキストフィールド",checkbox:"チェックボックス",radio:"ラジオボタン",select:"ドロップダウン",listbox:"リストボックス"},annotation:{text:"テキスト",highlight:"ハイライト",strikeout:"取り消し線",underline:"下線",squiggly:"波線",rectangle:"四角形",circle:"円",line:"線",arrow:"矢印",polygon:"多角形",polyline:"折れ線",ink:"インク",inkHighlighter:"インク蛍光ペン",stamp:"スタンプ",freeText:"フリーテキスト",square:"正方形",style:"注釈スタイル",styles:"{type}のスタイル",defaults:"{type}のデフォルト",color:"色",opacity:"不透明度",blendMode:"ブレンドモード",strokeWidth:"線の太さ",strokeColor:"線の色",borderStyle:"枠線のスタイル",fillColor:"塗りつぶしの色",fontSize:"フォントサイズ",fontFamily:"フォント",textAlign:"テキスト配置",verticalAlign:"縦方向の配置",lineEnding:"線の端点",lineStart:"始点",lineEnd:"終点",font:"フォント",fontColor:"フォントの色",backgroundColor:"背景色",noStyles:"この注釈にはスタイルがありません。",noStylesStamp:"スタンプにはスタイルがありません。",selectAnnotation:"注釈を選択してスタイルを表示",deleteSelected:"選択した注釈を削除",deleteAllSelected:"選択を削除",multiSelect:"{count}件の注釈が選択されています",group:"グループ化",ungroup:"グループ解除",moreTools:"その他のツール",addLink:"リンクを追加",removeLink:"リンクを削除",gotoLink:"リンク先へ移動",comment:"コメント",callout:"吹き出し",redact:"黒塗り",overlayText:"オーバーレイテキスト",overlayTextPlaceholder:"例: 黒塗り済み",rotation:"回転"},insert:{image:"画像",rubberStamp:"スタンプ"},redaction:{redact:"黒塗り",area:"範囲の黒塗り",text:"テキストの黒塗り",apply:"黒塗りを適用",applyAll:"すべて適用",clearAll:"すべてクリア",deleteSelected:"選択した黒塗りを削除",commitSelected:"選択した黒塗りを適用",emptyState:"保留中の黒塗りはありません",panel:{title:"黒塗り",itemCount:"{count}件の保留中の黒塗り",itemCountPlural:"{count}件の保留中の黒塗り",clearAll:"すべてクリア",redactAll:"すべて黒塗り"}},history:{undo:"元に戻す",redo:"やり直す"},comments:{page:"{page}ページ",commentCount:"{count}件のコメント",commentCountPlural:"{count}件のコメント",addComment:"コメントを追加...",addReply:"返信を追加...",showAllAnnotations:"すべての注釈を表示",closeAllAnnotations:"すべての注釈を閉じる",save:"保存",cancel:"キャンセル",edit:"編集",delete:"削除",showMore:"もっと見る",showLess:"閉じる",emptyState:"注釈を追加してコメントできるようにしましょう。"},blendMode:{normal:"通常",multiply:"乗算",screen:"スクリーン",overlay:"オーバーレイ",darken:"暗く",lighten:"明るく",colorDodge:"覆い焼きカラー",colorBurn:"焼き込みカラー",hardLight:"ハードライト",softLight:"ソフトライト",difference:"差の絶対値",exclusion:"除外",hue:"色相",saturation:"彩度",color:"カラー",luminosity:"輝度"},print:{title:"印刷設定",loading:"ドキュメントを準備中...",pages:"印刷するページ",all:"すべてのページ",current:"現在のページ ({currentPage})",specify:"ページを指定",specifyEG:"例: 1-3, 5, 8-10",total:"ドキュメントの総ページ数: {totalPages}",annotation:"注釈を含める",printing:"印刷中...",print:"印刷",cancel:"キャンセル"},protect:{title:"ドキュメントの保護",cancel:"キャンセル",apply:"保護を適用",applying:"適用中...",applyFailed:"保護の適用に失敗しました。もう一度お試しください。",removeFailed:"保護の解除に失敗しました。もう一度お試しください。",passwordMismatch:"パスワードが一致しません",noProtectionSelected:"適用する保護オプションを少なくとも1つ選択してください。",bothPasswordsNote:"ドキュメントパスワードで開いたユーザーは権限が制限されます。オーナーパスワードを使用すると完全なアクセスが可能になります。",openPassword:{title:"開くにはパスワードが必要",description:"このドキュメントを表示するにはパスワードの入力が必要です。",label:"ドキュメントパスワード",placeholder:"パスワードを入力",confirm:"パスワードの確認",confirmPlaceholder:"パスワードを確認"},ownerPassword:{label:"オーナーパスワード",placeholder:"オーナーパスワードを入力",confirm:"オーナーパスワードの確認",confirmPlaceholder:"オーナーパスワードを確認"},permissions:{title:"権限を制限",description:"このドキュメントでユーザーが行える操作を制限します。",allowedActions:"許可された操作",print:"印刷",printHighQuality:"高品質印刷",copy:"コンテンツのコピー",accessibility:"アクセシビリティのための抽出",modify:"コンテンツの変更",annotations:"注釈・コメントの追加/変更",fillForms:"フォームの入力と署名",assemble:"ページの組み立てと抽出"},encrypted:{title:"ドキュメントは保護されています",description:"このドキュメントはオーナーによって保護されています。セキュリティ設定を変更するにはオーナーパスワードを入力してください。",enterOwnerPassword:"オーナーパスワードを入力して変更",unlockAndEdit:"ロック解除して編集"},modifyProtection:{title:"保護の変更",description:"ドキュメントの保護をどのように変更するか選択してください。",changeOption:"パスワードまたは権限を変更",changeDescription:"ドキュメントパスワードまたは権限設定を更新します。",removeOption:"すべての保護を解除",removeDescription:"このドキュメントからパスワード保護を解除します。"},removeProtection:{title:"保護の解除",warning:"保護を解除してもよろしいですか?",description:"ドキュメントからすべてのパスワード保護が解除されます。誰でもドキュメントを開いて変更できるようになります。",confirm:"保護を解除"}},security:{protected:{title:"このドキュメントは保護されています",description:"このファイルは保護されており、一部の機能が無効になっている場合があります。ドキュメントメニューのセキュリティから権限を確認またはロック解除できます。",viewPermissions:"権限を表示"},viewPermissions:{title:"ドキュメントの権限",description:"このファイルはオーナーによって制限されており、特定の操作をロック解除するにはパスワードが必要です。",restrictedActions:"制限された操作"},unlock:{label:"オーナーパスワードを入力してロック解除",placeholder:"オーナーパスワードを入力",button:"ファイルのロックを解除",invalidPassword:"パスワードが無効です。もう一度お試しください。",failed:"ロック解除に失敗しました。もう一度お試しください。",success:"オーナー権限がロック解除されました!完全なアクセスが可能になりました。"}},common:{close:"閉じる",back:"戻る",cancel:"キャンセル"},link:{title:"リンクの挿入",url:"URL",page:"ページ",enterUrl:"URLを入力",enterPage:"ページ番号を入力",pageRange:"1~{totalPages}ページ",link:"リンク"},stamp:{title:"スタンプ",allStamps:"すべてのスタンプ",export:"スタンプをエクスポート",emptyState:"選択したライブラリにスタンプが見つかりません。",createFromSelected:"スタンプを作成",createFromGroup:"グループからスタンプを作成",library:{custom:"カスタムスタンプ"}},signature:{title:"署名",createNew:"新しい署名を作成",createNewWithInitials:"署名とイニシャルを作成",placeSignature:"署名",placeInitials:"イニシャル",remove:"署名を削除",emptyState:"まだ署名がありません。作成して始めましょう。",create:{title:"署名を作成",draw:"描く",type:"入力",upload:"アップロード",signatureLabel:"署名",initialsLabel:"イニシャル",clear:"クリア",typePlaceholder:"例:山田太郎",initialsPlaceholder:"例:山田",uploadPlaceholder:"クリックまたは画像をここにドラッグ",font:"フォント",color:"色",cancel:"キャンセル",save:"保存"}}}},{code:"sv",name:"Svenska",translations:{search:{placeholder:"Sök",caseSensitive:"Skiftlägeskänslig",wholeWord:"Hela ord",resultsFound:"{count} träffar",page:"Sida {page}"},zoom:{in:"Zooma in",out:"Zooma ut",fitWidth:"Sidbredd",fitPage:"Sidnivå",marquee:"Zooma till markering",menu:"Zoommeny",level:"Zoomnivå ({level}%)",dragTip:"Dra för att välja ett område att zooma in på"},pan:{toggle:"Panorera"},pointer:{toggle:"Välj"},capture:{screenshot:"Skärmdumpa",dragTip:"Dra för att välja område",title:"Förhandsgranskning",download:"Ladda ned",cancel:"Avbryt"},document:{menu:"Filmeny",open:"Öppna",close:"Stäng",print:"Skriv ut",protect:"Säkerhet",export:"Ladda ned",fullscreen:"Helskärmsläge",loading:"Läser in dokumentet..."},emptyState:{title:"Ingen fil är öppen",description:"Öppna en pdf för att komma igång.",descriptionMulti:"Du kan växla mellan olika filer med hjälp av flikar.",openButton:"Öppna fil",supportedFormats:"Format som stöds: PDF"},passwordPrompt:{title:"Lösenord krävs",required:"Den här filen är lösenordsskyddad. Skriv in lösenordet för att öppna den.",incorrect:"Lösenordet du skrev in var fel. Var god försök igen.",incorrectWarning:"Fel lösenord. Kontrollera att du skrivit rätt och försök igen.",label:"Lösenord",placeholder:"Skriv in filens lösenord",open:"Öppna",opening:"Öppnar...",cancel:"Avbryt",close:"Stäng"},documentError:{title:"Fel när dokumentet lästes in",unknown:"Ett okänt fel inträffade",errorCode:"Felkod: {code}",close:"Stäng dokumentet"},panel:{sidebar:"Sidofält",search:"Sök",comment:"Kommentera",thumbnails:"Miniatyrbilder",outline:"Dokumentdisposition",annotationStyle:"Annoteringsstil",redaction:"Sidofält för maskning"},menu:{viewControls:"Visa kontroller",zoomControls:"Zoomkontroller",moreOptions:"Fler alternativ"},outline:{title:"Dokumentdisposition",loading:"Läser in disposition...",noOutline:"Ingen disposition tillgänglig",noBookmarks:"Det här dokumentet har inga bokmärken"},page:{settings:"Sidinställningar",single:"Enkelsidig vy",twoOdd:"Dubbelsidig vy (Udda)",twoEven:"Dubbelsidig vy (Jämna)",vertical:"Lodrätt",horizontal:"Vågrätt",spreadMode:"Vy",scrollLayout:"Skrollningsläge",rotation:"Rotera",next:"Nästa sida",previous:"Föregående sida"},rotate:{clockwise:"Rotera medurs",counterClockwise:"Rotera moturs"},selection:{copy:"Kopiera markering"},mode:{view:"Läsvy",annotate:"Annotera",shapes:"Rita former",form:"Formulär",redact:"Maskera",insert:"Infoga"},form:{textfield:"Textfält",checkbox:"Kryssruta",radio:"Alternativknapp",select:"Rullgardinsmeny",listbox:"Listruta"},annotation:{text:"Text",highlight:"Överstrykningspenna",strikeout:"Genomstruken",underline:"Understruken",squiggly:"Vågig",rectangle:"Rektangel",circle:"Cirkel",line:"Linje",arrow:"Pil",polygon:"Polygon",polyline:"Flerpunktslinje",ink:"Bläck",inkHighlighter:"Bläcköverstrykningspenna",stamp:"Stämpel",freeText:"Fritext",square:"Kvadrat",style:"Annoteringsstil",styles:"{type}stilar",defaults:"{type}förval",color:"Färg",opacity:"Genomskinlighet",blendMode:"Blandningsläge",strokeWidth:"Linjebredd",strokeColor:"Linjefärg",borderStyle:"Kantlinjestil",fillColor:"Fyllningsfärg",fontSize:"Teckenstorlek",fontFamily:"Typsnitt",textAlign:"Justering",verticalAlign:"Vertikal justering",lineEnding:"Linjeslut",lineStart:"Linjestart",lineEnd:"Linjeslut",font:"Typsnitt",fontColor:"Teckenfärg",backgroundColor:"Bakgrundsfärg",noStyles:"Den här annoteringen har inga valda stilar.",noStylesStamp:"Inga stilar finns tillgängliga.",selectAnnotation:"Välj en annotering för att se stilalternativ.",deleteSelected:"Ta bort vald annotering",deleteAllSelected:"Ta bort alla valda",multiSelect:"{count} annoteringar valda",group:"Gruppera",ungroup:"Lös upp grupp",moreTools:"Fler verktyg",addLink:"Lägg till länk",removeLink:"Ta bort länk",gotoLink:"Gå till länk",comment:"Kommentera",callout:"Bildtext",redact:"Maskera",overlayText:"Textöverlägg",overlayTextPlaceholder:"t.ex., MASKERAD",rotation:"Rotera"},insert:{image:"Bild",rubberStamp:"Stämpel"},redaction:{redact:"Maskera",area:"Maskera område",text:"Maskera text",apply:"Tillämpa maskering",applyAll:"Tillämpa alla",clearAll:"Rensa alla",deleteSelected:"Ta bort vald maskering",commitSelected:"Tillämpa vald maskering",emptyState:"Inget väntar på att maskeras",panel:{title:"Maskering",itemCount:"{count} väntar på att maskeras",itemCountPlural:"{count} väntar på att maskeras",clearAll:"Rensa alla",redactAll:"Maskera alla"}},history:{undo:"Ångra",redo:"Gör om"},comments:{page:"Sida {page}",commentCount:"{count} kommentar",commentCountPlural:"{count} kommentarer",addComment:"Lägg till kommentar...",addReply:"Lägg till svar...",showAllAnnotations:"Visa alla anteckningar",closeAllAnnotations:"Stäng alla anteckningar",save:"Spara",cancel:"Avbryt",edit:"Redigera",delete:"Radera",showMore:"mer",showLess:"mindre",emptyState:"Lägg till annoteringar för att kunna kommentera dem."},blendMode:{normal:"Normal",multiply:"Multiplicera",screen:"Skärm",overlay:"Täck över",darken:"Mörkare",lighten:"Ljusare",colorDodge:"Färgskugga",colorBurn:"Efterbelys färg",hardLight:"Skarpt ljus",softLight:"Mjukt ljus",difference:"Differens",exclusion:"Uteslutning",hue:"Nyans",saturation:"Mättnad",color:"Färg",luminosity:"Luminiscens"},print:{title:"Utskriftsinställningar",loading:"Förbereder dokument...",pages:"Sidor att skriva ut",all:"Alla sidor",current:"Aktuell sida ({currentPage})",specify:"Välj sidor",specifyEG:"t.ex. 1-3, 5, 8-10",total:"Totalt antal sidor i dokumentet: {totalPages}",annotation:"Inkludera annoteringar",printing:"Skriver ut...",print:"Skriv ut",cancel:"Avbryt"},protect:{title:"Skydda dokumentet",cancel:"Avbryt",apply:"Tillämpa skydd",applying:"Tillämpar...",applyFailed:"Misslyckades med att tillämpa skydd. Var god försök igen.",removeFailed:"Misslyckades med att ta bort skydd. Var god försök igen.",passwordMismatch:"Lösenorden stämmer inte överens",noProtectionSelected:"Välj minst ett alternativ att tillämpa.",bothPasswordsNote:"Användare som öppnar dokumentet med lösenordet kommer ha begränsade behörigheter. Använd ägarlösenordet för att låsa upp alla behörigheter.",openPassword:{title:"Kräv lösenord för att öppna fil",description:"Användare måste skriva in ett lösenord för att öppna dokumentet.",label:"Dokumentlösenord",placeholder:"Skriv in lösenord",confirm:"Bekräfta lösenord",confirmPlaceholder:"Bekräfta lösenord"},ownerPassword:{label:"Ägarlösenord",placeholder:"Skriv in ägarlösenord",confirm:"Bekräfta ägarlösenord",confirmPlaceholder:"Bekräfta ägarlösenord"},permissions:{title:"Begränsa behörigheter",description:"Begränsa vad användaren kan göra med dokumentet.",allowedActions:"Tillåtna handlingar",print:"Skriv ut",printHighQuality:"Skriv ut i hög kvalitet",copy:"Kopiera innehåll",accessibility:"Extrahera för tillgänglighet",modify:"Ändra innehåll",annotations:"Lägga till/ändra annoteringar & kommentarer",fillForms:"Fylla i formulär & signera",assemble:"Ordna sidor"},encrypted:{title:"Dokumentet är skyddat",description:"Det här dokumentet skyddas av ägaren. Skriv in ägarlösenordet för att ändra säkerhetsinställningarna.",enterOwnerPassword:"Skriv in ägarlösenordet för att redigera",unlockAndEdit:"Lås upp & redigera"},modifyProtection:{title:"Ändra skydd",description:"Välj hur du vill ändra dokumentskyddet.",changeOption:"Ändra lösenord eller behörigheter",changeDescription:"Ändra dokumentets lösenord eller behörigheter.",removeOption:"Ta bort alla skydd",removeDescription:"Ta bort lösenordsskydd från dokumentet."},removeProtection:{title:"Ta bort skydd",warning:"Är du säker på att du vill ta bort skydd?",description:"Det här kommer ta bort allt lösenordsskydd från dokumentet. Vem som helst kommer kunna öppna och ändra det.",confirm:"Ta bort skydd"}},security:{protected:{title:"Det här dokumentet är skyddat",description:"Den här filen är skyddad och vissa funktioner kan vara inaktiverade. Gå till Säkerhet i filmenyn för att visa eller låsa upp behörigheter.",viewPermissions:"Visa behörigheter"},viewPermissions:{title:"Filbehörigheter",description:"Den här filen är skyddad av ägaren och kräver ett lösenord för vissa handlingar.",restrictedActions:"Begränsade handlingar"},unlock:{label:"Skriv in ägarlösenordet för att låsa upp filen",placeholder:"Skriv in ägarlösenordet",button:"Lås upp filen",invalidPassword:"Ogiltigt lösenord. Var vänlig försök igen.",failed:"Misslyckades med att låsa upp. Var vänlig försök igen.",success:"Ägarbehörighet upplåst! Du har nu full åtkomst."}},common:{close:"Stäng",back:"Tillbaka",cancel:"Avbryt"},link:{title:"Lägg till länk",url:"URL",page:"Sida",enterUrl:"Skriv in URL",enterPage:"Skriv in sidnummer",pageRange:"Sida 1 till {totalPages}",link:"Länk"},stamp:{title:"Stämplar",allStamps:"Alla stämplar",export:"Exportera stämplar",emptyState:"Inga stämplar hittades i det valda biblioteket.",createFromSelected:"Skapa stämpel",createFromGroup:"Skapa stämpel från grupp",library:{custom:"Egna stämplar"}},signature:{title:"Signaturer",createNew:"Skapa ny signatur",createNewWithInitials:"Skapa signatur & initialer",placeSignature:"Signatur",placeInitials:"Initialer",remove:"Ta bort signatur",emptyState:"Inga signaturer ännu. Skapa en för att komma igång.",create:{title:"Skapa signatur",draw:"Rita",type:"Skriv",upload:"Ladda upp",signatureLabel:"Signatur",initialsLabel:"Initialer",clear:"Rensa",typePlaceholder:"t.ex. Erik Svensson",initialsPlaceholder:"t.ex. ES",uploadPlaceholder:"Klicka eller dra en bild hit",font:"Typsnitt",color:"Färg",cancel:"Avbryt",save:"Spara"}}}},{code:"pt-BR",name:"Português (Brasil)",translations:{search:{placeholder:"Pesquisar",caseSensitive:"Diferenciar maiúsculas e minúsculas",wholeWord:"Palavra inteira",resultsFound:"{count} resultados encontrados",page:"Página {page}"},zoom:{in:"Aproximar",out:"Afastar",fitWidth:"Ajustar à largura",fitPage:"Ajustar à página",marquee:"Zoom por área",menu:"Menu de zoom",level:"Nível de zoom ({level}%)",dragTip:"Arraste para selecionar a área de zoom"},pan:{toggle:"Alternar modo de arrastar"},pointer:{toggle:"Alternar modo de ponteiro"},capture:{screenshot:"Captura de tela",dragTip:"Arraste para selecionar a área a capturar",title:"Pré-visualização da captura",download:"Baixar",cancel:"Cancelar"},document:{menu:"Menu do documento",open:"Abrir",close:"Fechar",print:"Imprimir",protect:"Segurança",export:"Exportar",fullscreen:"Tela cheia",loading:"Carregando documento..."},emptyState:{title:"Nenhum documento aberto",description:"Abra um documento PDF para começar.",descriptionMulti:"Você pode visualizar vários documentos usando abas.",openButton:"Abrir documento",supportedFormats:"Formato suportado: PDF"},passwordPrompt:{title:"Senha necessária",required:"Este documento está protegido por senha. Digite a senha para abri-lo.",incorrect:"A senha digitada está incorreta. Tente novamente.",incorrectWarning:"Senha incorreta. Verifique e tente novamente.",label:"Senha",placeholder:"Digite a senha do documento",open:"Abrir",opening:"Abrindo...",cancel:"Cancelar",close:"Fechar"},documentError:{title:"Erro ao carregar o documento",unknown:"Ocorreu um erro desconhecido",errorCode:"Código do erro: {code}",close:"Fechar documento"},panel:{sidebar:"Barra lateral",search:"Pesquisa",comment:"Comentários",thumbnails:"Miniaturas",outline:"Sumário",annotationStyle:"Estilo de anotação",redaction:"Barra lateral de redação"},menu:{viewControls:"Controles de visualização",zoomControls:"Controles de zoom",moreOptions:"Mais opções"},outline:{title:"Sumário",loading:"Carregando sumário...",noOutline:"Nenhum sumário disponível",noBookmarks:"Este documento não contém marcadores"},page:{settings:"Configurações da página",single:"Página única",twoOdd:"Duas páginas (ímpares)",twoEven:"Duas páginas (pares)",vertical:"Vertical",horizontal:"Horizontal",spreadMode:"Modo de páginas espelhadas",scrollLayout:"Layout de rolagem",rotation:"Rotação da página",next:"Próxima página",previous:"Página anterior"},rotate:{clockwise:"Girar no sentido horário",counterClockwise:"Girar no sentido anti-horário"},selection:{copy:"Copiar seleção"},mode:{view:"Visualizar",annotate:"Anotar",shapes:"Formas",form:"Formulário",redact:"Redigir",insert:"Inserir"},form:{textfield:"Campo de texto",checkbox:"Caixa de seleção",radio:"Botão de opção",select:"Lista suspensa",listbox:"Caixa de lista"},annotation:{text:"Texto",highlight:"Realçar",strikeout:"Tachado",underline:"Sublinhado",squiggly:"Sublinhado ondulado",rectangle:"Retângulo",circle:"Círculo",line:"Linha",arrow:"Seta",polygon:"Polígono",polyline:"Polilinha",ink:"Tinta",inkHighlighter:"Marca-texto de tinta",stamp:"Carimbo",caret:"Cursor de inserção",insertText:"Inserir texto",replaceText:"Substituir texto",freeText:"Texto livre",square:"Quadrado",style:"Estilo de anotação",styles:"Estilos de {type}",defaults:"Padrões de {type}",color:"Cor",opacity:"Opacidade",blendMode:"Modo de mesclagem",strokeWidth:"Espessura do traço",strokeColor:"Cor do traço",borderStyle:"Estilo da borda",fillColor:"Cor de preenchimento",fontSize:"Tamanho da fonte",fontFamily:"Fonte",textAlign:"Alinhamento do texto",verticalAlign:"Alinhamento vertical",lineEnding:"Extremidade da linha",lineStart:"Início da linha",lineEnd:"Fim da linha",font:"Fonte",fontColor:"Cor da fonte",backgroundColor:"Cor de fundo",noStyles:"Não há estilos para esta anotação.",noStylesStamp:"Não há estilos para carimbos.",selectAnnotation:"Selecione uma anotação para ver seus estilos",deleteSelected:"Excluir anotação selecionada",deleteAllSelected:"Excluir selecionadas",multiSelect:"{count} anotações selecionadas",group:"Agrupar",ungroup:"Desagrupar",moreTools:"Mais ferramentas",addLink:"Adicionar link",removeLink:"Remover link",gotoLink:"Ir para link",comment:"Comentário",callout:"Chamada",redact:"Redigir",overlayText:"Texto sobreposto",overlayTextPlaceholder:"ex.: REDIGIDO",rotation:"Rotação"},insert:{image:"Imagem",rubberStamp:"Carimbo"},redaction:{redact:"Redigir",area:"Área de redação",text:"Redigir texto",apply:"Aplicar redação",applyAll:"Aplicar tudo",clearAll:"Limpar tudo",deleteSelected:"Excluir redação selecionada",commitSelected:"Aplicar redação selecionada",emptyState:"Nenhuma redação pendente",panel:{title:"Redações",itemCount:"{count} redação pendente",itemCountPlural:"{count} redações pendentes",clearAll:"Limpar tudo",redactAll:"Redigir tudo"}},history:{undo:"Desfazer",redo:"Refazer"},comments:{page:"Página {page}",commentCount:"{count} comentário",commentCountPlural:"{count} comentários",addComment:"Adicionar comentário...",addReply:"Adicionar resposta...",showAllAnnotations:"Mostrar todas as anotações",closeAllAnnotations:"Fechar todas as anotações",save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Excluir",showMore:"mais",showLess:"menos",emptyState:"Adicione anotações para poder comentá-las."},blendMode:{normal:"Normal",multiply:"Multiplicar",screen:"Tela",overlay:"Sobrepor",darken:"Escurecer",lighten:"Clarear",colorDodge:"Subexposição de cores",colorBurn:"Superexposição de cores",hardLight:"Luz intensa",softLight:"Luz suave",difference:"Diferença",exclusion:"Exclusão",hue:"Matiz",saturation:"Saturação",color:"Cor",luminosity:"Luminosidade"},print:{title:"Configurações de impressão",loading:"Preparando documento...",pages:"Páginas a imprimir",all:"Todas as páginas",current:"Página atual ({currentPage})",specify:"Especificar páginas",specifyEG:"ex.: 1-3, 5, 8-10",total:"Total de páginas no documento: {totalPages}",annotation:"Incluir anotações",printing:"Imprimindo...",print:"Imprimir",cancel:"Cancelar"},protect:{title:"Proteger documento",cancel:"Cancelar",apply:"Aplicar proteção",applying:"Aplicando...",applyFailed:"Falha ao aplicar proteção. Tente novamente.",removeFailed:"Falha ao remover proteção. Tente novamente.",passwordMismatch:"As senhas não coincidem",noProtectionSelected:"Selecione pelo menos uma opção de proteção para aplicar.",bothPasswordsNote:"Usuários que abrirem com a senha do documento terão permissões restritas. Use a senha de proprietário para liberar o acesso completo.",openPassword:{title:"Exigir senha para abrir",description:"Os usuários precisarão digitar uma senha para visualizar este documento.",label:"Senha do documento",placeholder:"Digite a senha",confirm:"Confirmar senha",confirmPlaceholder:"Confirme a senha"},ownerPassword:{label:"Senha de proprietário",placeholder:"Digite a senha de proprietário",confirm:"Confirmar senha de proprietário",confirmPlaceholder:"Confirme a senha de proprietário"},permissions:{title:"Restringir permissões",description:"Limite o que os usuários podem fazer com este documento.",allowedActions:"Ações permitidas",print:"Imprimir",printHighQuality:"Imprimir em alta qualidade",copy:"Copiar conteúdo",accessibility:"Extrair para acessibilidade",modify:"Modificar conteúdo",annotations:"Adicionar/modificar anotações e comentários",fillForms:"Preencher formulários e assinar",assemble:"Montar e extrair páginas"},encrypted:{title:"O documento está protegido",description:"Este documento está protegido pelo proprietário. Digite a senha de proprietário para modificar as configurações de segurança.",enterOwnerPassword:"Digite a senha de proprietário para modificar",unlockAndEdit:"Desbloquear e editar"},modifyProtection:{title:"Modificar proteção",description:"Escolha como deseja modificar a proteção do documento.",changeOption:"Alterar senhas ou permissões",changeDescription:"Atualize a senha do documento ou as configurações de permissão.",removeOption:"Remover toda a proteção",removeDescription:"Remover a proteção por senha deste documento."},removeProtection:{title:"Remover proteção",warning:"Tem certeza de que deseja remover a proteção?",description:"Isso removerá toda a proteção por senha do documento. Qualquer pessoa poderá abri-lo e modificá-lo.",confirm:"Remover proteção"}},security:{protected:{title:"Este documento está protegido",description:"Este arquivo está protegido e alguns recursos podem estar desativados. Acesse Segurança no menu do documento para visualizar ou desbloquear as permissões.",viewPermissions:"Visualizar permissões"},viewPermissions:{title:"Permissões do documento",description:"Este arquivo está restrito pelo proprietário e requer uma senha para desbloquear determinadas ações.",restrictedActions:"Ações restritas"},unlock:{label:"Digite a senha de proprietário para desbloquear o arquivo",placeholder:"Digite a senha de proprietário",button:"Desbloquear arquivo",invalidPassword:"Senha inválida. Tente novamente.",failed:"Falha ao desbloquear. Tente novamente.",success:"Permissões de proprietário desbloqueadas! Você agora tem acesso completo."}},common:{close:"Fechar",back:"Voltar",cancel:"Cancelar"},link:{title:"Inserir link",url:"URL",page:"Página",enterUrl:"Digite a URL",enterPage:"Digite o número da página",pageRange:"Página 1 a {totalPages}",link:"Link"},stamp:{title:"Carimbos",allStamps:"Todos os carimbos",export:"Exportar carimbos",emptyState:"Nenhum carimbo encontrado na biblioteca selecionada.",createFromSelected:"Criar carimbo",createFromGroup:"Criar carimbo a partir de grupo",library:{custom:"Carimbos personalizados"}},signature:{title:"Assinaturas",createNew:"Criar nova assinatura",createNewWithInitials:"Criar assinatura e iniciais",placeSignature:"Assinatura",placeInitials:"Iniciais",remove:"Remover assinatura",emptyState:"Nenhuma assinatura ainda. Crie uma para começar.",create:{title:"Criar assinatura",draw:"Desenhar",type:"Digitar",upload:"Enviar",signatureLabel:"Assinatura",initialsLabel:"Iniciais",clear:"Limpar",typePlaceholder:"ex.: João da Silva",initialsPlaceholder:"ex.: JS",uploadPlaceholder:"Clique ou arraste uma imagem aqui",font:"Fonte",color:"Cor",cancel:"Cancelar",save:"Salvar"}}}}],paramResolvers:
2389KI
vendor: 30,806 bytes, line 2389
2389},ui:{schema:{id:"pdf-viewer-ui",version:"1.0.0",toolbars:{"main-toolbar":{id:"main-toolbar",position:{placement:"top",slot:"main",order:0},permanent:!0,responsive:{localeOverrides:{groups:[{id:"cjk-languages",locales:["zh-CN","ja","zh-TW"],breakpoints:{sm:{replaceHide:["zoom-toolbar","mode-select-button","form-mode","redact-mode"],replaceShow:["view-mode","annotate-mode","shapes-mode","insert-mode","overflow-tabs-button","pan-button","pointer-button","divider-3"]},md:{replaceShow:["view-mode","annotate-mode","shapes-mode","insert-mode","zoom-toolbar","overflow-tabs-button","pan-button","pointer-button","divider-3"],replaceHide:["zoom-menu-button","mode-select-button","form-mode","redact-mode"]}}},{id:"wide-label-languages",locales:["de","nl","pt-BR"],breakpoints:{md:{replaceShow:["view-mode","annotate-mode","zoom-toolbar","pan-button","pointer-button","divider-3","overflow-tabs-button"]}}}]},breakpoints:{xxxs:{maxWidth:400,hide:["annotate-mode","view-mode","shapes-mode","insert-mode","form-mode","redact-mode","zoom-toolbar","pan-button","pointer-button","divider-3","page-settings-button","zoom-menu-button","divider-2","overflow-tabs-button"],show:["mode-select-button"]},xxs:{minWidth:400,show:["page-settings-button","zoom-menu-button","divider-2"],hide:["overflow-left-action-menu-button"]},xs:{minWidth:500,maxWidth:640,show:["pan-button","pointer-button","divider-3"]},sm:{minWidth:640,maxWidth:768,hide:["shapes-mode","insert-mode","form-mode","redact-mode","zoom-toolbar","mode-select-button"],show:["view-mode","annotate-mode","overflow-tabs-button","pan-button","pointer-button","divider-3"]},md:{minWidth:768,show:["view-mode","annotate-mode","shapes-mode","zoom-toolbar","pan-button","pointer-button","divider-3","overflow-tabs-button"],hide:["zoom-menu-button","mode-select-button"]},lg:{minWidth:1024,show:["shapes-mode","insert-mode","form-mode","redact-mode"],hide:["overflow-tabs-button"]}}},items:[{type:"group",id:"left-group",alignment:"start",gap:2,items:[{type:"command-button",id:"document-menu-button",commandId:"document:menu",variant:"icon",categories:["document","document-menu"]},{type:"divider",id:"divider-1",orientation:"vertical"},{type:"command-button",id:"sidebar-button",commandId:"panel:toggle-sidebar",variant:"icon",categories:["panel","panel-sidebar"]},{type:"command-button",id:"overflow-left-action-menu-button",commandId:"left-action-menu:overflow-menu",variant:"icon",categories:["ui","ui-menu"]},{type:"command-button",id:"page-settings-button",commandId:"page:settings",variant:"icon",categories:["page","page-settings"]}]},{type:"divider",id:"divider-2",orientation:"vertical"},{type:"group",id:"center-group",alignment:"center",gap:2,items:[{type:"command-button",id:"zoom-menu-button",commandId:"zoom:toggle-menu-mobile",variant:"icon",categories:["zoom","zoom-menu"]},{type:"custom",id:"zoom-toolbar",componentId:"zoom-toolbar",categories:["zoom"]},{type:"divider",id:"divider-3",orientation:"vertical",visibilityDependsOn:{itemIds:["zoom-toolbar","zoom-menu-button"]}},{type:"command-button",id:"pan-button",commandId:"pan:toggle",variant:"icon",categories:["tools","pan"]},{type:"command-button",id:"pointer-button",commandId:"pointer:toggle",variant:"icon",categories:["tools","pointer"]}]},{type:"spacer",id:"spacer-1",flex:!0},{type:"custom",id:"mode-select-button",componentId:"mode-select-button",categories:["mode"],visibilityDependsOn:{itemIds:["mode:annotate","mode:shapes","mode:insert","mode:form","mode:redact"]}},{type:"tab-group",id:"mode-tabs",tabs:[{id:"view-mode",commandId:"mode:view",variant:"text",categories:["mode","mode-view"],visibilityDependsOn:{itemIds:["annotate-mode","shapes-mode","insert-mode","form-mode","redact-mode"]}},{id:"annotate-mode",commandId:"mode:annotate",variant:"text",categories:["mode","mode-annotate","annotation"]},{id:"shapes-mode",commandId:"mode:shapes",variant:"text",categories:["mode","mode-shapes","annotation","annotation-shape"]},{id:"insert-mode",commandId:"mode:insert",variant:"text",categories:["mode","mode-insert","insert"]},{id:"form-mode",commandId:"mode:form",variant:"text",categories:["mode","mode-form","form"]},{id:"redact-mode",commandId:"mode:redact",variant:"text",categories:["mode","mode-redact","redaction"]},{id:"overflow-tabs-button",commandId:"tabs:overflow-menu",variant:"icon",categories:["ui","ui-menu"],visibilityDependsOn:{menuId:"mode-tabs-overflow-menu"}}]},{type:"spacer",id:"spacer-2",flex:!0},{type:"group",id:"right-group",alignment:"end",gap:2,items:[{type:"command-button",id:"search-button",commandId:"panel:toggle-search",variant:"icon",categories:["panel","panel-search"]},{type:"command-button",id:"comment-button",commandId:"panel:toggle-comment",variant:"icon",categories:["panel","panel-comment"]}]}]},"annotation-toolbar":{id:"annotation-toolbar",position:{placement:"top",slot:"secondary",order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:["add-text","add-ink","add-ink-highlighter","add-insert-text","add-replace-text","add-comment","add-callout"],show:["overflow-annotation-tools"]},md:{minWidth:640,hide:["overflow-annotation-tools"],show:["add-text","add-ink","add-ink-highlighter","add-insert-text","add-replace-text","add-comment","add-callout"]}}},permanent:!1,categories:["annotation"],items:[{type:"spacer",id:"spacer-3",flex:!0},{type:"group",id:"annotation-tools",alignment:"start",gap:2,items:[{type:"command-button",id:"add-highlight",commandId:"annotation:add-highlight",variant:"icon",categories:["annotation","annotation-markup","annotation-highlight"]},{type:"command-button",id:"add-strikeout",commandId:"annotation:add-strikeout",variant:"icon",categories:["annotation","annotation-markup","annotation-strikeout"]},{type:"command-button",id:"add-underline",commandId:"annotation:add-underline",variant:"icon",categories:["annotation","annotation-markup","annotation-underline"]},{type:"command-button",id:"add-squiggly",commandId:"annotation:add-squiggly",variant:"icon",categories:["annotation","annotation-markup","annotation-squiggly"]},{type:"command-button",id:"add-ink",commandId:"annotation:add-ink",variant:"icon",categories:["annotation","annotation-ink"]},{type:"command-button",id:"add-ink-highlighter",commandId:"annotation:add-ink-highlighter",variant:"icon",categories:["annotation","annotation-ink"]},{type:"command-button",id:"add-text",commandId:"annotation:add-text",variant:"icon",categories:["annotation","annotation-text"]},{type:"command-button",id:"add-insert-text",commandId:"annotation:add-insert-text",variant:"icon",categories:["annotation","annotation-markup","annotation-insert-text"]},{type:"command-button",id:"add-replace-text",commandId:"annotation:add-replace-text",variant:"icon",categories:["annotation","annotation-markup","annotation-replace-text"]},{type:"command-button",id:"add-comment",commandId:"annotation:add-comment",variant:"icon",categories:["annotation","annotation-comment-tool"]},{type:"command-button",id:"add-callout",commandId:"annotation:add-callout",variant:"icon",categories:["annotation","annotation-text"]},{type:"command-button",id:"overflow-annotation-tools",commandId:"annotation:overflow-tools",variant:"icon",categories:["annotation","annotation-overflow"]},{type:"divider",id:"annotation-tools-divider-1",orientation:"vertical"},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"divider",id:"annotation-tools-divider-2",orientation:"vertical",visibilityDependsOn:{itemIds:["toggle-annotation-style"]}},{type:"command-button",id:"undo-button",commandId:"history:undo",variant:"icon",categories:["history","history-undo"]},{type:"command-button",id:"redo-button",commandId:"history:redo",variant:"icon",categories:["history","history-redo"]}]},{type:"spacer",id:"spacer-4",flex:!0}]},"shapes-toolbar":{id:"shapes-toolbar",position:{placement:"top",slot:"secondary",order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:["add-polygon","add-polyline"],show:["overflow-shapes-tools"]},md:{minWidth:640,hide:["overflow-shapes-tools"],show:["add-polygon","add-polyline"]}}},permanent:!1,categories:["annotation","annotation-shape"],items:[{type:"spacer",id:"spacer-5",flex:!0},{type:"group",id:"shapes-tools",alignment:"start",gap:2,items:[{type:"command-button",id:"add-rectangle",commandId:"annotation:add-rectangle",variant:"icon",categories:["annotation","annotation-shape","annotation-rectangle"]},{type:"command-button",id:"add-circle",commandId:"annotation:add-circle",variant:"icon",categories:["annotation","annotation-shape","annotation-circle"]},{type:"command-button",id:"add-line",commandId:"annotation:add-line",variant:"icon",categories:["annotation","annotation-shape","annotation-line"]},{type:"command-button",id:"add-arrow",commandId:"annotation:add-arrow",variant:"icon",categories:["annotation","annotation-shape","annotation-arrow"]},{type:"command-button",id:"add-polygon",commandId:"annotation:add-polygon",variant:"icon",categories:["annotation","annotation-shape","annotation-polygon"]},{type:"command-button",id:"add-polyline",commandId:"annotation:add-polyline",variant:"icon",categories:["annotation","annotation-shape","annotation-polyline"]},{type:"command-button",id:"overflow-shapes-tools",commandId:"annotation:overflow-shapes",variant:"icon",categories:["annotation","annotation-shape","annotation-overflow"]},{type:"divider",id:"shapes-tools-divider-1",orientation:"vertical"},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"divider",id:"shapes-tools-divider-2",orientation:"vertical",visibilityDependsOn:{itemIds:["toggle-annotation-style"]}},{type:"command-button",id:"undo-button",commandId:"history:undo",variant:"icon",categories:["history","history-undo"]},{type:"command-button",id:"redo-button",commandId:"history:redo",variant:"icon",categories:["history","history-redo"]}]},{type:"spacer",id:"spacer-6",flex:!0}]},"form-toolbar":{id:"form-toolbar",position:{placement:"top",slot:"secondary",order:0},responsive:{breakpoints:{sm:{maxWidth:640,hide:["add-form-select","add-form-listbox"],show:["overflow-forms-tools"]},md:{minWidth:640,hide:["overflow-forms-tools"],show:["add-form-select","add-form-listbox"]}}},permanent:!1,categories:["form"],items:[{type:"spacer",id:"spacer-form-1",flex:!0},{type:"group",id:"form-tools",alignment:"start",gap:2,items:[{type:"command-button",id:"add-form-textfield",commandId:"form:add-textfield",variant:"icon",categories:["form","form-textfield"]},{type:"command-button",id:"add-form-checkbox",commandId:"form:add-checkbox",variant:"icon",categories:["form","form-checkbox"]},{type:"command-button",id:"add-form-radio",commandId:"form:add-radio",variant:"icon",categories:["form","form-radio"]},{type:"command-button",id:"add-form-select",commandId:"form:add-select",variant:"icon",categories:["form","form-select"]},{type:"command-button",id:"add-form-listbox",commandId:"form:add-listbox",variant:"icon",categories:["form","form-listbox"]},{type:"command-button",id:"overflow-forms-tools",commandId:"form:overflow-tools",variant:"icon",categories:["form","form-overflow"]},{type:"divider",id:"form-tools-divider-1",orientation:"vertical"},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"command-button",id:"toggle-form-fill-mode",commandId:"form:toggle-fill-mode",variant:"icon",categories:["form","form-fill-mode"]},{type:"divider",id:"form-tools-divider-2",orientation:"vertical"},{type:"command-button",id:"undo-button",commandId:"history:undo",variant:"icon",categories:["history","history-undo"]},{type:"command-button",id:"redo-button",commandId:"history:redo",variant:"icon",categories:["history","history-redo"]}]},{type:"spacer",id:"spacer-form-2",flex:!0}]},"insert-toolbar":{id:"insert-toolbar",position:{placement:"top",slot:"secondary",order:0},permanent:!1,categories:["insert"],items:[{type:"spacer",id:"spacer-insert-1",flex:!0},{type:"group",id:"insert-tools",alignment:"start",gap:2,items:[{type:"command-button",id:"add-rubber-stamp",commandId:"insert:add-rubber-stamp",variant:"icon",categories:["insert","insert-rubber-stamp"]},{type:"command-button",id:"add-signature",commandId:"insert:add-signature",variant:"icon",categories:["insert","insert-signature"]},{type:"command-button",id:"add-image",commandId:"insert:add-image",variant:"icon",categories:["insert","insert-image"]},{type:"divider",id:"insert-tools-divider-1",orientation:"vertical"},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"divider",id:"insert-tools-divider-2",orientation:"vertical",visibilityDependsOn:{itemIds:["toggle-annotation-style"]}},{type:"command-button",id:"undo-button",commandId:"history:undo",variant:"icon",categories:["history","history-undo"]},{type:"command-button",id:"redo-button",commandId:"history:redo",variant:"icon",categories:["history","history-redo"]}]},{type:"spacer",id:"spacer-insert-2",flex:!0}]},"redaction-toolbar":{id:"redaction-toolbar",position:{placement:"top",slot:"secondary",order:0},permanent:!1,categories:["redaction"],items:[{type:"spacer",id:"spacer-7",flex:!0},{type:"group",id:"redaction-tools",alignment:"start",gap:2,items:[{type:"command-button",id:"redact",commandId:"redaction:redact",variant:"icon",categories:["redaction","redaction-combined"]},{type:"divider",id:"redaction-tools-divider-1",orientation:"vertical"},{type:"command-button",id:"toggle-redaction-panel",commandId:"panel:toggle-redaction",variant:"icon",categories:["panel","panel-redaction"]},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"divider",id:"redaction-tools-divider-2",orientation:"vertical",visibilityDependsOn:{itemIds:["toggle-annotation-style"]}},{type:"command-button",id:"undo-button",commandId:"history:undo",variant:"icon",categories:["history","history-undo"]},{type:"command-button",id:"redo-button",commandId:"history:redo",variant:"icon",categories:["history","history-redo"]}]},{type:"spacer",id:"spacer-8",flex:!0}]}},menus:{"left-action-menu":{id:"left-action-menu",categories:["ui"],items:[{type:"submenu",id:"page-settings-submenu",labelKey:"menu.viewControls",label:"View Controls",icon:"viewSettings",menuId:"page-settings-menu",categories:["page"]},{type:"submenu",id:"zoom-submenu",labelKey:"menu.zoomControls",label:"Zoom Controls",icon:"zoomIn",menuId:"zoom-menu",categories:["zoom"]},{type:"divider",id:"divider-15"},{type:"command",id:"pan-button-menu",commandId:"pan:toggle",categories:["tools","pan"]},{type:"command",id:"pointer-button-menu",commandId:"pointer:toggle",categories:["tools","pointer"]}]},"mode-tabs-overflow-menu":{id:"mode-tabs-overflow-menu",items:[{type:"command",id:"mode:view",commandId:"mode:view",categories:["mode","mode-view"]},{type:"command",id:"mode:annotate",commandId:"mode:annotate",categories:["mode","mode-annotate","annotation"]},{type:"command",id:"mode:shapes",commandId:"mode:shapes",categories:["mode","mode-shapes","annotation","annotation-shape"]},{type:"command",id:"mode:insert",commandId:"mode:insert",categories:["mode","mode-insert","insert"]},{type:"command",id:"mode:form",commandId:"mode:form",categories:["mode","mode-form","form"]},{type:"command",id:"mode:redact",commandId:"mode:redact",categories:["mode","mode-redact","redaction"]}],responsive:{breakpoints:{xs:{maxWidth:640,show:["mode:view","mode:annotate","mode:shapes","mode:insert","mode:form","mode:redact"]},sm:{minWidth:640,maxWidth:768,hide:["mode:view","mode:annotate"]},md:{minWidth:768,hide:["mode:view","mode:annotate","mode:shapes"]}},localeOverrides:{groups:[{id:"cjk-languages",locales:["zh-CN","zh-TW","ja"],breakpoints:{sm:{replaceHide:["mode:view","mode:annotate","mode:shapes","mode:insert"],replaceShow:["mode:form","mode:redact"]},md:{replaceHide:["mode:view","mode:annotate","mode:shapes","mode:insert"],replaceShow:["mode:form","mode:redact"]}}},{id:"wide-label-languages",locales:["de","nl","pt-BR"],breakpoints:{md:{replaceHide:["mode:view","mode:annotate"]}}}]}}},"zoom-levels-menu":{id:"zoom-levels-menu",categories:["zoom","zoom-level"],items:[{type:"command",id:"zoom-levels-menu:25",commandId:"zoom:25",categories:["zoom","zoom-level","zoom-level-25"]},{type:"command",id:"zoom-levels-menu:50",commandId:"zoom:50",categories:["zoom","zoom-level","zoom-level-50"]},{type:"command",id:"zoom-levels-menu:100",commandId:"zoom:100",categories:["zoom","zoom-level","zoom-level-100"]},{type:"command",id:"zoom-levels-menu:125",commandId:"zoom:125",categories:["zoom","zoom-level","zoom-level-125"]},{type:"command",id:"zoom-levels-menu:150",commandId:"zoom:150",categories:["zoom","zoom-level","zoom-level-150"]},{type:"command",id:"zoom-levels-menu:200",commandId:"zoom:200",categories:["zoom","zoom-level","zoom-level-200"]},{type:"command",id:"zoom-levels-menu:400",commandId:"zoom:400",categories:["zoom","zoom-level","zoom-level-400"]},{type:"command",id:"zoom-levels-menu:800",commandId:"zoom:800",categories:["zoom","zoom-level","zoom-level-800"]},{type:"command",id:"zoom-levels-menu:1600",commandId:"zoom:1600",categories:["zoom","zoom-level","zoom-level-1600"]}]},"zoom-menu":{id:"zoom-menu",categories:["zoom"],items:[{type:"command",id:"zoom-menu:25",commandId:"zoom:25",categories:["zoom","zoom-level","zoom-level-25"]},{type:"command",id:"zoom-menu:50",commandId:"zoom:50",categories:["zoom","zoom-level","zoom-level-50"]},{type:"command",id:"zoom-menu:100",commandId:"zoom:100",categories:["zoom","zoom-level","zoom-level-100"]},{type:"command",id:"zoom-menu:125",commandId:"zoom:125",categories:["zoom","zoom-level","zoom-level-125"]},{type:"command",id:"zoom-menu:150",commandId:"zoom:150",categories:["zoom","zoom-level","zoom-level-150"]},{type:"command",id:"zoom-menu:200",commandId:"zoom:200",categories:["zoom","zoom-level","zoom-level-200"]},{type:"command",id:"zoom-menu:400",commandId:"zoom:400",categories:["zoom","zoom-level","zoom-level-400"]},{type:"command",id:"zoom-menu:800",commandId:"zoom:800",categories:["zoom","zoom-level","zoom-level-800"]},{type:"command",id:"zoom-menu:1600",commandId:"zoom:1600",categories:["zoom","zoom-level","zoom-level-1600"]},{type:"submenu",id:"zoom-levels-submenu",labelKey:"zoom.level",label:"Zoom Levels",menuId:"zoom-levels-menu",categories:["zoom","zoom-level"]},{type:"divider",id:"divider-zoom-in-out"},{type:"command",id:"zoom-menu:in",commandId:"zoom:in",categories:["zoom","zoom-in"]},{type:"command",id:"zoom-menu:out",commandId:"zoom:out",categories:["zoom","zoom-out"]},{type:"divider",id:"divider-8"},{type:"command",id:"zoom:fit-page",commandId:"zoom:fit-page",categories:["zoom","zoom-fit-page"]},{type:"command",id:"zoom:fit-width",commandId:"zoom:fit-width",categories:["zoom","zoom-fit-width"]},{type:"divider",id:"divider-9"},{type:"command",id:"zoom:marquee",commandId:"zoom:marquee",categories:["zoom","zoom-marquee"]}],responsive:{breakpoints:{xs:{maxWidth:640,show:["zoom-levels-submenu","divider-zoom-in-out"],hide:["zoom-menu:25","zoom-menu:50","zoom-menu:100","zoom-menu:125","zoom-menu:150","zoom-menu:200","zoom-menu:400","zoom-menu:800","zoom-menu:1600"]},md:{minWidth:768,show:["zoom-menu:25","zoom-menu:50","zoom-menu:100","zoom-menu:125","zoom-menu:150","zoom-menu:200","zoom-menu:400","zoom-menu:800","zoom-menu:1600"],hide:["zoom-levels-submenu","divider-zoom-in-out","zoom-menu:in","zoom-menu:out"]}}}},"document-menu":{id:"document-menu",categories:["document"],items:[{type:"command",id:"document:open",commandId:"document:open",categories:["document","document-open"]},{type:"command",id:"document:close",commandId:"document:close",categories:["document","document-close"]},{type:"divider",id:"divider-10",visibilityDependsOn:{itemIds:["document:open","document:close"]}},{type:"command",id:"document:print",commandId:"document:print",categories:["document","document-print"]},{type:"command",id:"document:protect",commandId:"document:protect",categories:["document","document-protect","security"]},{type:"command",id:"document:capture",commandId:"document:capture",categories:["document","document-capture"]},{type:"command",id:"document:export",commandId:"document:export",categories:["document","document-export"]},{type:"divider",id:"divider-11",visibilityDependsOn:{itemIds:["document:export","document:print","document:capture","document:protect"]}},{type:"command",id:"document:fullscreen",commandId:"document:fullscreen",categories:["document","document-fullscreen"]}]},"annotation-tools-menu":{id:"annotation-tools-menu",categories:["annotation"],items:[{type:"command",id:"annotation:add-ink",commandId:"annotation:add-ink",categories:["annotation","annotation-ink"]},{type:"command",id:"annotation:add-ink-highlighter",commandId:"annotation:add-ink-highlighter",categories:["annotation","annotation-ink"]},{type:"command",id:"annotation:add-text",commandId:"annotation:add-text",categories:["annotation","annotation-text"]},{type:"command",id:"annotation:add-insert-text",commandId:"annotation:add-insert-text",categories:["annotation","annotation-markup","annotation-insert-text"]},{type:"command",id:"annotation:add-replace-text",commandId:"annotation:add-replace-text",categories:["annotation","annotation-markup","annotation-replace-text"]},{type:"command",id:"annotation:add-comment",commandId:"annotation:add-comment",categories:["annotation","annotation-comment-tool"]},{type:"command",id:"annotation:add-callout",commandId:"annotation:add-callout",categories:["annotation","annotation-text"]}]},"shapes-tools-menu":{id:"shapes-tools-menu",categories:["annotation","annotation-shape"],items:[{type:"command",id:"annotation:add-polygon",commandId:"annotation:add-polygon",categories:["annotation","annotation-shape","annotation-polygon"]},{type:"command",id:"annotation:add-polyline",commandId:"annotation:add-polyline",categories:["annotation","annotation-shape","annotation-polyline"]}]},"form-tools-menu":{id:"form-tools-menu",categories:["form"],items:[{type:"command",id:"form:add-select",commandId:"form:add-select",categories:["form","form-select"]},{type:"command",id:"form:add-listbox",commandId:"form:add-listbox",categories:["form","form-listbox"]}]},"page-settings-menu":{id:"page-settings-menu",categories:["page"],items:[{type:"section",id:"spread-mode-section",labelKey:"page.spreadMode",label:"Spread Mode",categories:["page","spread"],items:[{type:"command",id:"spread:none",commandId:"spread:none",categories:["page","spread","spread-none"]},{type:"command",id:"spread:odd",commandId:"spread:odd",categories:["page","spread","spread-odd"]},{type:"command",id:"spread:even",commandId:"spread:even",categories:["page","spread","spread-even"]}]},{type:"divider",id:"divider-13"},{type:"section",id:"scroll-layout-section",labelKey:"page.scrollLayout",label:"Scroll Layout",categories:["page","scroll"],items:[{type:"command",id:"scroll:vertical",commandId:"scroll:vertical",categories:["page","scroll","scroll-vertical"]},{type:"command",id:"scroll:horizontal",commandId:"scroll:horizontal",categories:["page","scroll","scroll-horizontal"]}]},{type:"divider",id:"divider-14"},{type:"section",id:"page-rotation-section",labelKey:"page.rotation",label:"Page Rotation",categories:["page","rotate"],items:[{type:"command",id:"rotate:clockwise",commandId:"rotate:clockwise",categories:["page","rotate","rotate-clockwise"]},{type:"command",id:"rotate:counter-clockwise",commandId:"rotate:counter-clockwise",categories:["page","rotate","rotate-counter-clockwise"]}]},{type:"divider",id:"divider-15"},{type:"command",id:"document:fullscreen",commandId:"document:fullscreen",categories:["document","document-fullscreen"]}]}},sidebars:{"sidebar-panel":{id:"sidebar-panel",position:{placement:"left",slot:"main",order:0},content:{type:"tabs",tabs:[{id:"thumbnails",labelKey:"panel.thumbnails",label:"Thumbnails",icon:"squares",componentId:"thumbnails-sidebar"},{id:"outline",labelKey:"panel.outline",label:"Outline",icon:"listTree",componentId:"outline-sidebar"}]},width:"250px",collapsible:!0,defaultOpen:!1},"annotation-panel":{id:"annotation-panel",position:{placement:"left",slot:"main",order:0},content:{type:"component",componentId:"annotation-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1},"rubber-stamp-panel":{id:"rubber-stamp-panel",position:{placement:"left",slot:"main",order:0},content:{type:"component",componentId:"rubber-stamp-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1,categories:["insert","insert-rubber-stamp"]},"signature-panel":{id:"signature-panel",position:{placement:"left",slot:"main",order:0},content:{type:"component",componentId:"signature-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1,categories:["insert","insert-signature"]},"search-panel":{id:"search-panel",position:{placement:"right",slot:"main",order:0},content:{type:"component",componentId:"search-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1},"widget-edit-panel":{id:"widget-edit-panel",position:{placement:"right",slot:"main",order:0},content:{type:"component",componentId:"widget-edit-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1},"comment-panel":{id:"comment-panel",position:{placement:"right",slot:"main",order:0},content:{type:"component",componentId:"comment-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1},"redaction-panel":{id:"redaction-panel",position:{placement:"right",slot:"main",order:0},content:{type:"component",componentId:"redaction-sidebar"},width:"250px",collapsible:!0,defaultOpen:!1,categories:["redaction"]}},modals:{"print-modal":{id:"print-modal",content:{type:"component",componentId:"print-modal"},maxWidth:"28rem",closeOnClickOutside:!0,closeOnEscape:!0},"protect-modal":{id:"protect-modal",content:{type:"component",componentId:"protect-modal"},maxWidth:"28rem",closeOnClickOutside:!0,closeOnEscape:!0},"view-permissions-modal":{id:"view-permissions-modal",content:{type:"component",componentId:"view-permissions-modal"},maxWidth:"28rem",closeOnClickOutside:!0,closeOnEscape:!0},"link-modal":{id:"link-modal",content:{type:"component",componentId:"link-modal"},maxWidth:"28rem",closeOnClickOutside:!0,closeOnEscape:!0},"signature-create-modal":{id:"signature-create-modal",content:{type:"component",componentId:"signature-create-modal"},maxWidth:"32rem",closeOnClickOutside:!1,closeOnEscape:!0,categories:["insert","insert-signature"]}},overlays:{"page-controls":{id:"page-controls",position:{anchor:"bottom-center",offset:{bottom:"1.5rem"}},content:{type:"component",componentId:"page-controls"},defaultEnabled:!0},"unlock-owner-overlay":{id:"unlock-owner-overlay",position:{anchor:"bottom-right",offset:{bottom:"1.5rem",right:"1.5rem"}},content:{type:"component",componentId:"unlock-owner-overlay"},categories:["security","security-unlock-overlay"],defaultEnabled:!0}},selectionMenus:{annotation:{id:"annotation",categories:["annotation"],items:[{type:"command-button",id:"comment-button",commandId:"annotation:toggle-comment",variant:"icon",categories:["annotation","annotation-comment"]},{type:"command-button",id:"toggle-link",commandId:"annotation:toggle-link",variant:"icon",categories:["annotation","annotation-link"]},{type:"command-button",id:"toggle-annotation-widget-edit",commandId:"annotation:toggle-widget-edit",variant:"icon",categories:["annotation","annotation-widget-edit"]},{type:"command-button",id:"toggle-annotation-style",commandId:"annotation:toggle-annotation-style",variant:"icon",categories:["annotation","annotation-style"]},{type:"command-button",id:"apply-redaction",commandId:"annotation:apply-redaction",variant:"icon",categories:["annotation","annotation-redaction"]},{type:"command-button",id:"create-stamp-from-annotation",commandId:"stamp:create-from-selected",variant:"icon",categories:["annotation","stamp"]},{type:"command-button",id:"delete-annotation",commandId:"annotation:delete-selected",variant:"icon",categories:["annotation","annotation-delete"]},{type:"command-button",id:"goto-link",commandId:"annotation:goto-link",variant:"icon-text",categories:["annotation","annotation-link"]}]},groupAnnotation:{id:"groupAnnotation",categories:["annotation","annotation-group"],items:[{type:"command-button",id:"comment-button",commandId:"annotation:toggle-comment",variant:"icon",categories:["annotation","annotation-comment"]},{type:"command-button",id:"toggle-group-annotations",commandId:"annotation:toggle-group",variant:"icon",categories:["annotation","annotation-group"]},{type:"command-button",id:"toggle-annotation-style",commandId:"panel:toggle-annotation-style",variant:"icon",categories:["panel","panel-annotation-style"]},{type:"command-button",id:"create-stamp-from-group",commandId:"stamp:create-from-group",variant:"icon",categories:["annotation","stamp","annotation-group"]},{type:"command-button",id:"delete-all-annotations",commandId:"annotation:delete-all-selected",variant:"icon",categories:["annotation","annotation-delete","annotation-group"]}]},redaction:{id:"redaction",categories:["redaction"],items:[{type:"command-button",id:"delete-redaction",commandId:"redaction:delete-selected",variant:"icon",categories:["redaction","redaction-delete"]},{type:"command-button",id:"commit-redaction",commandId:"redaction:commit-selected",variant:"icon",categories:["redaction","redaction-commit"]}]},selection:{id:"selection",visibilityDependsOn:{itemIds:["copy-selection","add-highlight","add-strikeout","add-underline","add-squiggly","add-link","redact-text"]},items:[{type:"command-button",id:"copy-selection",commandId:"selection:copy",variant:"icon",categories:["selection","selection-copy"]},{type:"command-button",id:"add-highlight",commandId:"annotation:add-highlight",variant:"icon",categories:["annotation","annotation-markup","annotation-highlight"]},{type:"command-button",id:"add-strikeout",commandId:"annotation:add-strikeout",variant:"icon",categories:["annotation","annotation-markup","annotation-strikeout"]},{type:"command-button",id:"add-underline",commandId:"annotation:add-underline",variant:"icon",categories:["annotation","annotation-markup","annotation-underline"]},{type:"command-button",id:"add-squiggly",commandId:"annotation:add-squiggly",variant:"icon",categories:["annotation","annotation-markup","annotation-squiggly"]},{type:"command-button",id:"add-link",commandId:"annotation:add-link",variant:"icon",categories:["annotation","annotation-link"]},{type:"command-button",id:"redact-text",commandId:"redaction:redact-text",variant:"icon",categories:["redaction","redaction-text"]}]}}}},viewport:{viewportGap:10},scroll:{defaultStrategy:
vendor: 8,858 bytes, line 2389
2389It.Vertical},zoom:{defaultZoomLevel:dt.FitPage},spread:{defaultSpreadMode:wt.None},rotation:{defaultRotation:fi.Degree0},pan:{},render:{defaultImageType:"image/png"},tiling:{tileSize:768,overlapPx:2.5,extraRings:0},thumbnails:{width:150,gap:10,buffer:3,labelHeight:30},annotations:{locked:{type:Ze.Include,categories:["form"]}},search:{},selection:{},bookmarks:{},attachments:{},capture:{scale:2,imageType:"image/png"},redaction:{drawBlackBoxes:!0,useAnnotationMode:!0},print:{},export:{defaultFileName:"document.pdf"},fullscreen:{},stamp:{},signature:{mode:Nn.SignatureAndInitials},history:{},interactionManager:{},form:{}};function oS(e){var t=e.documentId,n=e.tabBarVisibility,o=n===void 0?"multiple":n,i=(function(v){const y=js(),{provides:b}=ro(),w=b?.getSchema(),x=hm(v);return{renderToolbar:(C,I)=>{const S=`${C}-${I}`;if(!w||!b||!x)return null;const P=x.activeToolbars[S],A=P?w.toolbars[P.toolbarId]:null;P&&!A&&console.warn(`Toolbar "${P.toolbarId}" not found in schema`);const D=A&&!A.permanent?()=>b.forDocument(v).closeToolbarSlot(C,I):void 0,R=y.toolbar;return k(de,{children:P&&A&&k(R,{schema:A,documentId:v,isOpen:P.isOpen,onClose:D})},`toolbar-slot-${S}`)},renderSidebar:(C,I)=>{var S;const P=`${C}-${I}`;if(!w||!b||!x)return null;const A=x.activeSidebars[P],D=A?(S=w.sidebars)==null?void 0:S[A.sidebarId]:null;A&&!D&&console.warn(`Sidebar "${A.sidebarId}" not found in schema`);const R=y.sidebar;return k(de,{children:A&&D&&k(R,{schema:D,documentId:v,isOpen:A.isOpen,onClose:()=>{b.forDocument(v).closeSidebarSlot(C,I)},sidebarProps:A.props})},`sidebar-slot-${P}`)},renderModal:()=>{var C;if(!w||!b||!x)return null;const I=y.modal;if(!I)return null;const S=x.activeModal,P=S?(C=w.modals)==null?void 0:C[S.modalId]:null;return S&&!P&&console.warn(`Modal "${S.modalId}" not found in schema`),k(de,{children:S&&P&&k(I,{schema:P,documentId:v,isOpen:S.isOpen,onClose:()=>{b.forDocument(v).closeModal()},onExited:()=>{b.forDocument(v).clearModal()},modalProps:S.props})},"modal-slot")},getActiveToolbars:()=>x?Object.entries(x.activeToolbars).map(([C,I])=>{const[S,P]=C.split("-");return{placement:S,slot:P,toolbarId:I.toolbarId,isOpen:I.isOpen}}):[],getActiveSidebars:()=>x?Object.entries(x.activeSidebars).map(([C,I])=>{const[S,P]=C.split("-");return{placement:S,slot:P,sidebarId:I.sidebarId,isOpen:I.isOpen}}):[],renderOverlays:()=>{if(!w||!b||!x)return null;const C=y.overlay;return C?k(de,{children:(w.overlays?Object.values(w.overlays):[]).filter(I=>x.enabledOverlays[I.id]!==!1).map(I=>k(C,{schema:I,documentId:v},I.id))},"overlays-slot"):null}}})(t),r=i.renderToolbar,a=i.renderSidebar,s=i.renderModal,l=i.renderOverlays,c=Le(t).translate,d=zi("selection",t),u=zi("annotation",t),m=zi("groupAnnotation",t),g=zi("redaction",t),p=(v=>{const y=dr();return Z(()=>y?y.documentOrder.map(b=>y.documents[b]).filter(b=>b!=null):[],[y,v])})(),f=(()=>{const v=dr();return Z(()=>{if(!v)return{activeDocumentId:null,activeDocument:null};const y=v.activeDocumentId;return{activeDocumentId:y,activeDocument:y?v.documents[y]??null:null}},[v])})();return h(de,null,h(XI,{documentStates:p,activeDocumentId:f.activeDocumentId,visibility:o}),r("top","main"),r("top","secondary"),h("div",{id:"document-content",className:"bg-bg-surface flex flex-1 overflow-hidden"},a("left","main"),h("div",{className:"flex-1 overflow-hidden"},h(Pb,{documentId:t},function(v){var y=v.documentState,b=v.isLoading,w=v.isError,x=v.isLoaded;return h(de,null,b&&h("div",{className:"flex h-full items-center justify-center"},h(ms,{size:"lg",text:c("document.loading")})),w&&h(YI,{documentState:y}),x&&h("div",{className:"relative h-full w-full"},h(pw,{documentId:t},h(Jy,{className:"bg-bg-app",documentId:t},h(Ob,{documentId:t},h(ib,{documentId:t,renderPage:function(C){var I=C.pageIndex;return h(Bb,{documentId:t,pageIndex:I,style:{backgroundColor:"#fff"}},h(gw,{documentId:t,pageIndex:I},h($b,{documentId:t,pageIndex:I,scale:.5,style:{pointerEvents:"none"}}),h(c0,{documentId:t,pageIndex:I,style:{pointerEvents:"none"}}),h(Hb,{documentId:t,pageIndex:I}),h(Fb,{documentId:t,pageIndex:I}),h(Vw,{documentId:t,pageIndex:I}),h(o0,{documentId:t,pageIndex:I,selectionMenu:d}),h(ax,{documentId:t,pageIndex:I,selectionMenu:g}),h(Lw,{documentId:t,pageIndex:I,selectionMenu:u,groupSelectionMenu:m})))}})))),l()))})),a("right","main")),s())}var Iu=new eh([new Qu,new Ju]);function iS(e){var t,n,o,i,r,a=e.config,s=e.onRegistryReady,l=(function(f){const{wasmUrl:v=Vy,worker:y=!0,logger:b,encoderPoolSize:w,fontFallback:x}=f??{},[C,I]=O(null),[S,P]=O(!0),[A,D]=O(null),R=K(null);return $(()=>{let M=!1;return(async()=>{try{const{createPdfiumEngine:N}=y?await Ml(()=>import("./icC-XkrA.js"),__vite__mapDeps([0,1,2,3]),import.meta.url):await Ml(()=>import("./C8j9ZZhS.js"),__vite__mapDeps([4,2,3,1]),import.meta.url),z=await N(v,{logger:b,encoderPoolSize:w,fontFallback:x});R.current=z,I(z),P(!1)}catch(N){M||(D(N),P(!1))}})(),()=>{var N,z;M=!0,(z=(N=R.current)==null?void 0:N.closeAllDocuments)==null||z.call(N).wait(()=>{var _,L;(L=(_=R.current)==null?void 0:_.destroy)==null||L.call(_),R.current=null},et)}},[v,y,b,x]),{engine:C,isLoading:S,error:A}})(B(B(B({},a.wasmUrl&&{wasmUrl:a.wasmUrl}),a.fontFallback!==void 0&&{fontFallback:a.fontFallback}),{},{worker:a.worker,logger:a.log?Iu:void 0})),c=l.engine,d=l.isLoading,u=Z(function(){return{"thumbnails-sidebar":jC,"annotation-sidebar":kI,"rubber-stamp-sidebar":zI,"signature-sidebar":LI,"zoom-toolbar":QC,"search-sidebar":BC,"outline-sidebar":WC,"comment-sidebar":YC,"widget-edit-sidebar":MI,"print-modal":WI,"link-modal":HI,"signature-create-modal":$I,"protect-modal":eS,"unlock-owner-overlay":tS,"page-controls":GI,"mode-select-button":QI,"view-permissions-modal":nS,"redaction-sidebar":SI}},[]),m=Z(function(){return{toolbar:CC,sidebar:RC,modal:$C,overlay:BI,menu:zC,selectionMenu:jI}},[]),g=(n=(t=a.fonts)===null||t===void 0?void 0:t.ui)===null?{family:Da,stylesheetUrl:null}:n===void 0?{family:Da,stylesheetUrl:"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap"}:{family:(o=n.family)!==null&&o!==void 0?o:Da,stylesheetUrl:(i=n.stylesheetUrl)!==null&&i!==void 0?i:null},p=Z(function(){return{"--ep-font-family":g.family}},[g.family]);return $(function(){g.stylesheetUrl&&Ev("ui",g.stylesheetUrl,[g.family])},[g.family,g.stylesheetUrl]),h("div",{className:"embedpdf-snippet-root",style:p},h("style",null,iy),!c||d?h("div",{className:"flex h-full w-full items-center justify-center"},h(ms,{size:"lg",text:"Initializing PDF engine..."})):h(Gy,{config:{logger:a.log?Iu:void 0,permissions:a.permissions},onInitialized:(r=Au(ei().m(function f(v){return ei().w(function(y){for(;;)switch(y.n){case 0:s&&v&&s(v);case 1:return y.a(2)}},f)})),function(f){return r.apply(this,arguments)}),engine:c,plugins:[Fe(Mb,B(B(B({},_e.documentManager),a.src&&{initialDocuments:[{url:a.src}]}),a.documentManager)),Fe(Tb,B(B(B({},_e.commands),a.disabledCategories&&{disabledCategories:a.disabledCategories}),a.commands)),Fe(Eb,B(B({},_e.i18n),a.i18n)),Fe(wb,B(B(B({},_e.ui),a.disabledCategories&&{disabledCategories:a.disabledCategories}),a.ui)),Fe(Yy,B(B({},_e.viewport),a.viewport)),Fe(ob,B(B({},_e.scroll),a.scroll)),Fe(Lb,B(B({},_e.zoom),a.zoom)),Fe(ab,B(B({},_e.spread),a.spread)),Fe(Ub,B(B({},_e.rotation),a.rotation)),Fe(Hw,B(B({},_e.pan),a.pan)),Fe(_b,B(B({},_e.render),a.render)),Fe(s0,B(B({},_e.tiling),a.tiling)),Fe(h0,B(B({},_e.thumbnails),a.thumbnails)),Fe(Nw,B(B({},_e.annotations),a.annotations)),Fe(Wb,B(B({},_e.search),a.search)),Fe(i0,B(B({},_e.selection),a.selection)),Fe(Bw,B(B({},_e.bookmarks),a.bookmarks)),Fe(lx,B(B({},_e.attachments),a.attachments)),Fe(Kw,B(B({},_e.capture),a.capture)),Fe(sx,B(B({},_e.redaction),a.redaction)),Fe(Fw,B(B({},_e.print),a.print)),Fe(Ww,B(B({},_e.export),a.export)),Fe(jw,B(B({},_e.fullscreen),a.fullscreen)),Fe(Yw,B(B({},_e.history),a.history)),Fe(hw,B(B({},_e.interactionManager),a.interactionManager)),Fe(qx,B(B({},_e.form),a.form)),Fe(Qx,B(B({},_e.stamp),a.stamp)),Fe(ck,B(B({},_e.signature),a.signature))]},function(f){var v=f.pluginsReady,y=f.activeDocumentId;return h(de,null,v?h(de,null,y?h(NI,{config:a},h(Ab,{documentId:y,components:u,renderers:m,className:"relative flex h-full w-full select-none flex-col"},h(oS,{documentId:y,tabBarVisibility:a.tabBar}),h(JI,{documentId:y}),h(HC,{documentId:y}))):h(ZI,null)):h("div",{className:"flex h-full items-center justify-center"},h(ms,{size:"lg",text:"Initializing plugins..."})))}))}var rS=typeof HTMLElement<"u"?HTMLElement:bs(function e(){ys(this,e)}),$v=(function(){function e(){var t;return ys(this,e),ee(t=Pu(this,e),"_resolveRegistry",null),ee(t,"themeStyleEl",null),ee(t,"systemPreferenceCleanup",null),ee(t,"handleRegistryReady",function(n){t._resolveRegistry&&(t._resolveRegistry(n),t._resolveRegistry=null)}),t.root=t.attachShadow({mode:"open"}),t._registryPromise=new Promise(function(n){t._resolveRegistry=n}),t}
2389return Mu(e,rS),bs(e,[{key:"connectedCallback",value:function(){this._config||(this._config={src:this.getAttribute("src")||"/demo.pdf",worker:this.getAttribute("worker")!=="false",theme:this.parseThemeAttribute()}),this.setupTheme(),this.renderViewer()}},{key:"disconnectedCallback",value:function(){var t;(t=this.systemPreferenceCleanup)===null||t===void 0||t.call(this),this.systemPreferenceCleanup=null,rr(null,this.root)}},{key:"parseThemeAttribute",value:function(){var t=this.getAttribute("theme");if(t)return["light","dark","system"].includes(t)?{preference:t}:void 0}},{key:"config",get:function(){return this._config},set:function(t){this._config=t,t.icons&&ls(t.icons),this.isConnected&&(this.setupTheme(),this.renderViewer())}},{key:"registry",get:function(){return this._registryPromise}},{key:"themePreference",get:function(){var t;return((t=this._config)===null||t===void 0||(t=t.theme)===null||t===void 0?void 0:t.preference)||"system"}},{key:"activeColorScheme",get:function(){return ku(this.themePreference)}},{key:"activeTheme",get:function(){return this.resolveActiveTheme()}},{key:"resolveActiveTheme",value:function(){var t,n,o,i=(t=this._config)===null||t===void 0?void 0:t.theme,r=ku(i?.preference||"system"),a=r==="dark"?Nv:Lv,s=i?.[r];return o=a,(n=s)?Fv(o,n):o}},{key:"setupTheme",value:function(){var t,n,o=this;(t=this.systemPreferenceCleanup)===null||t===void 0||t.call(this),this.systemPreferenceCleanup=null,(((n=this._config)===null||n===void 0||(n=n.theme)===null||n===void 0?void 0:n.preference)||"system")==="system"&&(this.systemPreferenceCleanup=(function(i){if(typeof window>"u")return function(){};var r=window.matchMedia("(prefers-color-scheme: dark)"),a=function(s){return i(s.matches?"dark":"light")};return r.addEventListener("change",a),function(){return r.removeEventListener("change",a)}})(function(i){o.injectTheme(),o.dispatchEvent(new CustomEvent("themechange",{detail:{preference:"system",colorScheme:i,theme:o.activeTheme},bubbles:!0}))})),this.injectTheme()}},{key:"injectTheme",value:function(){var t=VI(this.resolveActiveTheme()),n=this.root.querySelector("style[data-embedpdf-theme]");n||((n=document.createElement("style")).setAttribute("data-embedpdf-theme",""),this.root.appendChild(n)),this.themeStyleEl=n,this.themeStyleEl.textContent=t,this.setAttribute("data-color-scheme",this.activeColorScheme)}},{key:"setTheme",value:function(t){this._config&&(this._config.theme=typeof t=="string"?B(B({},this._config.theme),{},{preference:t}):B(B({},this._config.theme),t),this.setupTheme(),this.dispatchEvent(new CustomEvent("themechange",{detail:{preference:this.themePreference,colorScheme:this.activeColorScheme,theme:this.activeTheme},bubbles:!0})))}},{key:"registerIcon",value:function(t,n){hl(t,n)}},{key:"registerIcons",value:function(t){ls(t)}},{key:"renderViewer",value:function(){this._config&&(rr(h(iS,{config:this._config,onRegistryReady:this.handleRegistryReady}),this.root),this.injectTheme())}}])})(),aS=["type","target"],jv="2.15.1";typeof customElements>"u"||customElements.get("embedpdf-container")||customElements.define("embedpdf-container",$v);var sS={version:jv,init:function(e){if(e.type==="container")return(function(t){t.type,t.target;var n=Cr(t,aS),o=document.createElement("embedpdf-container");return o.config=n,t.target.appendChild(o),o})(e)}};const Su=Vv({name:"PDFViewer",props:{config:{type:Object,default:()=>({})}},emits:{init:e=>!0,ready:e=>!0},setup(e,{emit:t,expose:n,attrs:o}){const i=Dl(null),r=Dl(null);return n({get container(){return r.value},get registry(){var a;return((a=r.value)==null?void 0:a.registry)??null}}),Xv(()=>{if(!i.value)return;const a=sS.init({type:"container",target:i.value,...e.config});a&&(r.value=a,t("init",a),a.registry.then(s=>{t("ready",s)}))}),Zv(()=>{r.value&&i.value&&(i.value.innerHTML="",r.value=null)}),()=>Yv("div",{ref:i,class:o.class,style:o.style})}}),kS=Object.freeze(Object.defineProperty({__proto__:null,AnnotationPlugin:Wr,AppearanceMode:oh,AttachmentPlugin:Ff,BookmarkPlugin:ol,CapturePlugin:il,CommandsPlugin:Us,DocumentManagerPlugin:hr,EmbedPdfContainer:$v,ExportPlugin:es,FormPlugin:al,FullscreenPlugin:vr,HistoryPlugin:rl,I18nPlugin:Bs,InteractionManagerPlugin:qr,LockModeType:Ze,PDFViewer:Su,PanPlugin:Ji,PdfAnnotationBorderStyle:ke,PdfAnnotationFlags:ah,PdfAnnotationIcon:py,PdfAnnotationLineEnding:ge,PdfAnnotationName:Pe,PdfAnnotationObjectStatus:nh,PdfAnnotationReplyType:Ut,PdfAnnotationState:ih,PdfAnnotationStateModel:rh,PdfAnnotationSubtype:T,PdfBlendMode:ve,PdfStampFit:th,PrintPlugin:fr,RedactionMode:je,RedactionPlugin:Vr,RenderPlugin:qs,RotatePlugin:Ks,Rotation:fi,ScrollPlugin:Lr,ScrollStrategy:It,SearchPlugin:Vs,SelectionPlugin:_r,SignatureMode:Nn,SignaturePlugin:cl,SpreadMode:wt,SpreadPlugin:Fh,ThumbnailPlugin:jr,TilingPlugin:Xs,UIPlugin:Or,ViewportPlugin:vi,ZoomMode:dt,ZoomPlugin:Hs,createTheme:Fv,darkTheme:Nv,default:Su,deserializeEntries:lk,flagsToNames:yy,ignore:et,lightTheme:Lv,namesToFlags:by,registerIcon:hl,registerIcons:ls,serializeEntries:sk,version:jv},Symbol.toStringTag,{value:"Module"}));
2389export{T as $,my as D,gS as F,Zo as G,pe as H,se as I,fy as J,Xl as K,th as L,mS as M,zn as N,pS as O,Sr as P,me as Q,Ee as T,oh as U,he as V,Vl as W,gy as X,ke as Z,fS as _,wy as a,Pe as b,Cy as c,vS as d,Ut as e,Yu as f,ne as g,dS as h,uS as i,fi as j,cS as k,ky as l,Sy as m,yy as n,by as o,H as p,ge as q,ly as r,xy as s,hS as t,bS as u,Ay as v,wS as w,xS as x,yS as y,kS as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.